Add Pokémon Legends: Arceus support

.NET5.0 -> .NET6.0

Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
This commit is contained in:
Kurt
2022-02-04 18:43:21 -08:00
parent d6c8780ed2
commit e432370a40
142 changed files with 7542 additions and 296 deletions

View File

@@ -70,8 +70,8 @@ public IEnumerable<string> SummaryLines
}
public Function LookupFunction(uint pc) => Array.Find(Functions, f => f.Within(pc));
public TableRecord LookupPublic(string name) => Array.Find(this.Publics, t => t.Name == name);
public TableRecord LookupPublic(uint addr) => Array.Find(this.Publics, t => t.Address == addr);
public TableRecord LookupPublic(string name) => Array.Find(Publics, t => t.Name == name);
public TableRecord LookupPublic(uint addr) => Array.Find(Publics, t => t.Address == addr);
public Function[] Functions { get; protected set; }
public TableRecord[] Publics { get; protected set; }

View File

@@ -1,12 +1,11 @@
namespace pkNX.Structures
namespace pkNX.Structures;
public enum CellType
{
public enum CellType
{
None,
Bool,
Float,
Character,
Tag,
Function
};
}
None,
Bool,
Float,
Character,
Tag,
Function,
}

View File

@@ -141,7 +141,7 @@ private static byte[] CompressInstruction(uint instruction)
public static string[] ParseScript(uint[] cmd, int sanity = -1)
{
// sub_148CBC Moon v1.0
List<string> parse = new List<string>();
List<string> parse = new();
const int sanityMode = 0; // todo
string ErrorNear(int line, string error)
@@ -288,7 +288,7 @@ string ErrorNear(int line, string error)
}
}
if (opcode == AmxOpCode.RET || opcode == AmxOpCode.RETN || opcode == AmxOpCode.IRETN)
if (opcode is AmxOpCode.RET or AmxOpCode.RETN or AmxOpCode.IRETN)
{
// Newline after return
instrLine += Environment.NewLine;
@@ -315,7 +315,7 @@ internal static string EchoIntCommand(AmxOpCode c, params int[] arr)
{
static string FormatParameter(int param)
{
if (param < -100 || param > 100)
if (param is < -100 or > 100)
return $"0x{param:X4}";
return param.ToString();
}