Use string interpolation

This commit is contained in:
YoshiRulz 2019-04-04 02:41:18 +10:00
parent 7fb8051426
commit 9af93be0d3
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
51 changed files with 768 additions and 821 deletions

View File

@ -10,10 +10,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
public string RawBytes;
public int Length;
public override string ToString()
{
return string.Format("{0:X6}: {1,-20} {2,-8} {3}", PC, RawBytes, Mnemonic, Args);
}
public override string ToString() => $"{PC:X6}: {RawBytes,-20} {Mnemonic,-8} {Args}";
}
partial class MC68000

View File

@ -51,15 +51,15 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
case 0: // Byte
info.Mnemonic = "and.b";
info.Args = string.Format("{0}, D{1}", DisassembleValue(srcMode, srcReg, 1, ref pc), dstReg);
info.Args = $"{DisassembleValue(srcMode, srcReg, 1, ref pc)}, D{dstReg}";
break;
case 1: // Word
info.Mnemonic = "and.w";
info.Args = string.Format("{0}, D{1}", DisassembleValue(srcMode, srcReg, 2, ref pc), dstReg);
info.Args = $"{DisassembleValue(srcMode, srcReg, 2, ref pc)}, D{dstReg}";
break;
case 2: // Long
info.Mnemonic = "and.l";
info.Args = string.Format("{0}, D{1}", DisassembleValue(srcMode, srcReg, 4, ref pc), dstReg);
info.Args = $"{DisassembleValue(srcMode, srcReg, 4, ref pc)}, D{dstReg}";
break;
}
@ -124,15 +124,15 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
case 0: // Byte
info.Mnemonic = "and.b";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 1, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 1, ref pc)}";
break;
case 1: // Word
info.Mnemonic = "and.w";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 2, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 2, ref pc)}";
break;
case 2: // Long
info.Mnemonic = "and.l";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 4, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 4, ref pc)}";
break;
}
@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
info.Mnemonic = "andi.b";
sbyte imm = (sbyte)ReadWord(pc); pc += 2;
info.Args = string.Format("#${0:X}, ", imm);
info.Args = $"#${imm:X}, ";
info.Args += DisassembleValue(dstMode, dstReg, 1, ref pc);
break;
}
@ -208,7 +208,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
info.Mnemonic = "andi.w";
short imm = ReadWord(pc); pc += 2;
info.Args = string.Format("#${0:X}, ", imm);
info.Args = $"#${imm:X}, ";
info.Args += DisassembleValue(dstMode, dstReg, 2, ref pc);
break;
}
@ -216,7 +216,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
info.Mnemonic = "andi.l";
int imm = ReadLong(pc); pc += 4;
info.Args = string.Format("#${0:X}, ", imm);
info.Args = $"#${imm:X}, ";
info.Args += DisassembleValue(dstMode, dstReg, 4, ref pc);
break;
}
@ -283,15 +283,15 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
case 0: // Byte
info.Mnemonic = "eor.b";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 1, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 1, ref pc)}";
break;
case 1: // Word
info.Mnemonic = "eor.w";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 2, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 2, ref pc)}";
break;
case 2: // Long
info.Mnemonic = "eor.l";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 4, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 4, ref pc)}";
break;
}
@ -355,21 +355,21 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
info.Mnemonic = "eori.b";
sbyte immed = (sbyte)ReadWord(pc); pc += 2;
info.Args = String.Format("#${0:X}, {1}", immed, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"#${immed:X}, {DisassembleValue(mode, reg, 1, ref pc)}";
break;
}
case 1: // word
{
info.Mnemonic = "eori.w";
short immed = ReadWord(pc); pc += 2;
info.Args = String.Format("#${0:X}, {1}", immed, DisassembleValue(mode, reg, 2, ref pc));
info.Args = $"#${immed:X}, {DisassembleValue(mode, reg, 2, ref pc)}";
break;
}
case 2: // long
{
info.Mnemonic = "eori.l";
int immed = ReadLong(pc); pc += 4;
info.Args = String.Format("#${0:X}, {1}", immed, DisassembleValue(mode, reg, 4, ref pc));
info.Args = $"#${immed:X}, {DisassembleValue(mode, reg, 4, ref pc)}";
break;
}
}
@ -423,15 +423,15 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
case 0: // Byte
info.Mnemonic = "or.b";
info.Args = string.Format("{0}, D{1}", DisassembleValue(srcMode, srcReg, 1, ref pc), dstReg);
info.Args = $"{DisassembleValue(srcMode, srcReg, 1, ref pc)}, D{dstReg}";
break;
case 1: // Word
info.Mnemonic = "or.w";
info.Args = string.Format("{0}, D{1}", DisassembleValue(srcMode, srcReg, 2, ref pc), dstReg);
info.Args = $"{DisassembleValue(srcMode, srcReg, 2, ref pc)}, D{dstReg}";
break;
case 2: // Long
info.Mnemonic = "or.l";
info.Args = string.Format("{0}, D{1}", DisassembleValue(srcMode, srcReg, 4, ref pc), dstReg);
info.Args = $"{DisassembleValue(srcMode, srcReg, 4, ref pc)}, D{dstReg}";
break;
}
@ -496,15 +496,15 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
case 0: // Byte
info.Mnemonic = "or.b";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 1, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 1, ref pc)}";
break;
case 1: // Word
info.Mnemonic = "or.w";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 2, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 2, ref pc)}";
break;
case 2: // Long
info.Mnemonic = "or.l";
info.Args = string.Format("D{0}, {1}", srcReg, DisassembleValue(dstMode, dstReg, 4, ref pc));
info.Args = $"D{srcReg}, {DisassembleValue(dstMode, dstReg, 4, ref pc)}";
break;
}
@ -568,21 +568,21 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
info.Mnemonic = "ori.b";
sbyte immed = (sbyte)ReadWord(pc); pc += 2;
info.Args = String.Format("#${0:X}, {1}", immed, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"#${immed:X}, {DisassembleValue(mode, reg, 1, ref pc)}";
break;
}
case 1: // word
{
info.Mnemonic = "ori.w";
short immed = ReadWord(pc); pc += 2;
info.Args = String.Format("#${0:X}, {1}", immed, DisassembleValue(mode, reg, 2, ref pc));
info.Args = $"#${immed:X}, {DisassembleValue(mode, reg, 2, ref pc)}";
break;
}
case 2: // long
{
info.Mnemonic = "ori.l";
int immed = ReadLong(pc); pc += 4;
info.Args = String.Format("#${0:X}, {1}", immed, DisassembleValue(mode, reg, 4, ref pc));
info.Args = $"#${immed:X}, {DisassembleValue(mode, reg, 4, ref pc)}";
break;
}
}

View File

@ -166,7 +166,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
void MOVEQ_Disasm(DisassemblyInfo info)
{
info.Mnemonic = "moveq";
info.Args = String.Format("#{0}, D{1}", (sbyte)op, (op >> 9) & 7);
info.Args = $"#{(sbyte)op}, D{(op >> 9) & 7}";
}
void MOVEM0()
@ -438,7 +438,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
}
registers <<= 1;
}
//str.Append(string.Format("[{0:X4}]", registers >> 16));
//str.Append($"[{registers >> 16:X4}]");
return str.ToString();
}
@ -493,7 +493,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
}
registers >>= 1;
}
//str.Append(string.Format("[{0:X4}]", registers & 0xFFFF));
//str.Append($"[{registers & 0xFFFF:X4}]");
return str.ToString();
}

View File

@ -934,7 +934,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
case 1: info.Mnemonic = "cmpm.w"; break;
case 2: info.Mnemonic = "cmpm.l"; break;
}
info.Args = string.Format("(A{0})+, (A{1})+", ayReg, axReg);
info.Args = $"(A{ayReg})+, (A{axReg})+";
info.Length = pc - info.PC;
}
@ -1001,17 +1001,17 @@ namespace BizHawk.Emulation.Cores.Components.M68000
case 0:
immediate = (byte)ReadWord(pc); pc += 2;
info.Mnemonic = "cmpi.b";
info.Args = String.Format("#${0:X}, {1}", immediate, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"#${immediate:X}, {DisassembleValue(mode, reg, 1, ref pc)}";
break;
case 1:
immediate = ReadWord(pc); pc += 2;
info.Mnemonic = "cmpi.w";
info.Args = String.Format("#${0:X}, {1}", immediate, DisassembleValue(mode, reg, 2, ref pc));
info.Args = $"#${immediate:X}, {DisassembleValue(mode, reg, 2, ref pc)}";
break;
case 2:
immediate = ReadLong(pc); pc += 4;
info.Mnemonic = "cmpi.l";
info.Args = String.Format("#${0:X}, {1}", immediate, DisassembleValue(mode, reg, 4, ref pc));
info.Args = $"#${immediate:X}, {DisassembleValue(mode, reg, 4, ref pc)}";
break;
}
info.Length = pc - info.PC;
@ -1042,7 +1042,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int pc = info.PC + 2;
info.Mnemonic = "mulu";
info.Args = String.Format("{0}, D{1}", DisassembleValue(mode, reg, 2, ref pc), dreg);
info.Args = $"{DisassembleValue(mode, reg, 2, ref pc)}, D{dreg}";
info.Length = pc - info.PC;
}
@ -1071,7 +1071,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int pc = info.PC + 2;
info.Mnemonic = "muls";
info.Args = String.Format("{0}, D{1}", DisassembleValue(mode, reg, 2, ref pc), dreg);
info.Args = $"{DisassembleValue(mode, reg, 2, ref pc)}, D{dreg}";
info.Length = pc - info.PC;
}
@ -1107,7 +1107,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int pc = info.PC + 2;
info.Mnemonic = "divu";
info.Args = String.Format("{0}, D{1}", DisassembleValue(mode, reg, 2, ref pc), dreg);
info.Args = $"{DisassembleValue(mode, reg, 2, ref pc)}, D{dreg}";
info.Length = pc - info.PC;
}
@ -1143,7 +1143,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int pc = info.PC + 2;
info.Mnemonic = "divs";
info.Args = String.Format("{0}, D{1}", DisassembleValue(mode, reg, 2, ref pc), dreg);
info.Args = $"{DisassembleValue(mode, reg, 2, ref pc)}, D{dreg}";
info.Length = pc - info.PC;
}
}

View File

@ -94,11 +94,11 @@ namespace BizHawk.Emulation.Cores.Components.M68000
info.Mnemonic = "b" + DisassembleCondition(cond);
if (displacement8 != 0)
{
info.Args = string.Format("${0:X}", pc + displacement8);
info.Args = $"${pc + displacement8:X}";
}
else
{
info.Args = string.Format("${0:X}", pc + ReadWord(pc));
info.Args = $"${pc + ReadWord(pc):X}";
pc += 2;
}
info.Length = pc - info.PC;
@ -122,10 +122,10 @@ namespace BizHawk.Emulation.Cores.Components.M68000
sbyte displacement8 = (sbyte)op;
if (displacement8 != 0)
info.Args = String.Format("${0:X}", pc + displacement8);
info.Args = $"${pc + displacement8:X}";
else
{
info.Args = String.Format("${0:X}", pc + ReadWord(pc));
info.Args = $"${pc + ReadWord(pc):X}";
pc += 2;
}
info.Length = pc - info.PC;
@ -158,10 +158,10 @@ namespace BizHawk.Emulation.Cores.Components.M68000
sbyte displacement8 = (sbyte)op;
if (displacement8 != 0)
info.Args = String.Format("${0:X}", pc + displacement8);
info.Args = $"${pc + displacement8:X}";
else
{
info.Args = String.Format("${0:X}", pc + ReadWord(pc));
info.Args = $"${pc + ReadWord(pc):X}";
pc += 2;
}
info.Length = pc - info.PC;
@ -201,7 +201,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
info.Mnemonic = "db" + DisassembleCondition(cond);
int pc = info.PC + 2;
info.Args = String.Format("D{0}, ${1:X}", op & 7, pc + ReadWord(pc));
info.Args = $"D{op & 7}, ${pc + ReadWord(pc):X}";
info.Length = 4;
}
@ -319,7 +319,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "btst";
info.Args = String.Format("#${0:X}, {1}", bit, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"#${bit:X}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}
@ -354,7 +354,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "btst";
info.Args = String.Format("D{0}, {1}", dReg, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"D{dReg}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}
@ -392,7 +392,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "bchg";
info.Args = String.Format("#${0:X}, {1}", bit, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"#${bit:X}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}
@ -431,7 +431,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "bchg";
info.Args = String.Format("D{0}, {1}", dReg, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"D{dReg}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}
@ -469,7 +469,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "bclr";
info.Args = String.Format("#${0:X}, {1}", bit, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"#${bit:X}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}
@ -508,7 +508,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "bclr";
info.Args = String.Format("D{0}, {1}", dReg, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"D{dReg}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}
@ -546,7 +546,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "bset";
info.Args = String.Format("#${0:X}, {1}", bit, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"#${bit:X}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}
@ -585,7 +585,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int reg = op & 7;
info.Mnemonic = "bset";
info.Args = String.Format("D{0}, {1}", dReg, DisassembleValue(mode, reg, 1, ref pc));
info.Args = $"D{dReg}, {DisassembleValue(mode, reg, 1, ref pc)}";
info.Length = pc - info.PC;
}

View File

@ -146,7 +146,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
void TRAP_Disasm(DisassemblyInfo info)
{
info.Mnemonic = "trap";
info.Args = string.Format("#${0:X}", op & 0xF);
info.Args = $"#${op & 0xF:X}";
}
void TrapVector(int vector)

View File

@ -152,7 +152,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
int prevCycles = PendingCycles;
//Log.Note("CPU", State());
op = (ushort)ReadWord(PC);
if (Opcodes[op] == null) throw new Exception(string.Format("unhandled opcode at pc={0:X6}", PC));
if (Opcodes[op] == null) throw new Exception($"unhandled opcode at pc={PC:X6}");
PC += 2;
Opcodes[op]();
int delta = prevCycles - PendingCycles;
@ -163,7 +163,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
public string State()
{
string a = Disassemble(PC).ToString().PadRight(64);
//string a = string.Format("{0:X6}: {1:X4}", PC, ReadWord(PC)).PadRight(64);
//string a = $"{PC:X6}: {ReadWord(PC):X4}".PadRight(64);
var dRegStrings = D.Select((r, i) => $"D{i}:{r.u32:X8}");
var aRegStrings = A.Select((r, i) => $"A{i}:{r.u32:X8}");
return a + string.Join(" ", dRegStrings
@ -271,9 +271,6 @@ namespace BizHawk.Emulation.Cores.Components.M68000
[FieldOffset(0)]
public sbyte s8;
public override string ToString()
{
return String.Format("{0:X8}", u32);
}
public override string ToString() => $"{u32:X8}";
}
}

View File

@ -329,21 +329,21 @@ namespace BizHawk.Emulation.Cores.Components.M68000
case 2: return "(A" + reg + ")"; // (An)
case 3: return "(A" + reg + ")+"; // (An)+
case 4: return "-(A" + reg + ")"; // -(An)
case 5: value = string.Format("(${0:X},A{1})", ReadWord(pc), reg); pc += 2; return value; // (d16,An)
case 5: value = $"(${ReadWord(pc):X},A{reg})"; pc += 2; return value; // (d16,An)
case 6: addr = ReadWord(pc); pc += 2; return DisassembleIndex("A" + reg, (short)addr); // (d8,An,Xn)
case 7:
switch (reg)
{
case 0: value = String.Format("(${0:X})", ReadWord(pc)); pc += 2; return value; // (imm).W
case 1: value = String.Format("(${0:X})", ReadLong(pc)); pc += 4; return value; // (imm).L
case 2: value = String.Format("(${0:X})", pc + ReadWord(pc)); pc += 2; return value; // (d16,PC)
case 0: value = $"(${ReadWord(pc):X})"; pc += 2; return value; // (imm).W
case 1: value = $"(${ReadLong(pc):X})"; pc += 4; return value; // (imm).L
case 2: value = $"(${pc + ReadWord(pc):X})"; pc += 2; return value; // (d16,PC)
case 3: addr = ReadWord(pc); pc += 2; return DisassembleIndex("PC", (short)addr); // (d8,PC,Xn)
case 4:
switch (size)
{
case 1: value = String.Format("${0:X}", (byte)ReadWord(pc)); pc += 2; return value;
case 2: value = String.Format("${0:X}", ReadWord(pc)); pc += 2; return value;
case 4: value = String.Format("${0:X}", ReadLong(pc)); pc += 4; return value;
case 1: value = $"${(byte)ReadWord(pc):X}"; pc += 2; return value;
case 2: value = $"${ReadWord(pc):X}"; pc += 2; return value;
case 4: value = $"${ReadLong(pc):X}"; pc += 4; return value;
}
break;
}
@ -359,13 +359,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
{
case 1:
immed = (byte)ReadWord(pc); pc += 2;
return String.Format("#${0:X}", immed);
return $"#${immed:X}";
case 2:
immed = (ushort)ReadWord(pc); pc += 2;
return String.Format("#${0:X}", immed);
return $"#${immed:X}";
case 4:
immed = ReadLong(pc); pc += 4;
return String.Format("#${0:X}", immed);
return $"#${immed:X}";
}
throw new ArgumentException("Invalid size");
}
@ -380,14 +380,14 @@ namespace BizHawk.Emulation.Cores.Components.M68000
case 2: return "(A" + reg + ")"; // (An)
case 3: return "(A" + reg + ")+"; // (An)+
case 4: return "-(A" + reg + ")"; // -(An)
case 5: addr = ReadWord(pc); pc += 2; return String.Format("(${0:X},A{1})", addr, reg); // (d16,An)
case 5: addr = ReadWord(pc); pc += 2; return $"(${addr:X},A{reg})"; // (d16,An)
case 6: addr = ReadWord(pc); pc += 2; return DisassembleIndex("A" + reg, (short)addr); // (d8,An,Xn)
case 7:
switch (reg)
{
case 0: addr = ReadWord(pc); pc += 2; return String.Format("${0:X}.w", addr); // (imm).w
case 1: addr = ReadLong(pc); pc += 4; return String.Format("${0:X}.l", addr); // (imm).l
case 2: addr = ReadWord(pc); pc += 2; return String.Format("(${0:X},PC)", addr); // (d16,PC)
case 0: addr = ReadWord(pc); pc += 2; return $"${addr:X}.w"; // (imm).w
case 1: addr = ReadLong(pc); pc += 4; return $"${addr:X}.l"; // (imm).l
case 2: addr = ReadWord(pc); pc += 2; return $"(${addr:X},PC)"; // (d16,PC)
case 3: addr = ReadWord(pc); pc += 2; return DisassembleIndex("PC", (short)addr); // (d8,PC,Xn)
case 4: return "INVALID"; // immediate
}
@ -620,7 +620,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
string offsetRegister = (d_a == 0) ? "D" : "A";
string sizeStr = size == 0 ? ".w" : ".l";
string displacementStr = displacement == 0 ? "" : ("," + displacement);
return string.Format("({0},{1}{2}{3}{4}{5})", baseRegister, scaleFactor, offsetRegister, reg, sizeStr, displacementStr);
return $"({baseRegister},{scaleFactor}{offsetRegister}{reg}{sizeStr}{displacementStr})";
}
}
}

View File

@ -52,7 +52,7 @@
{
result += " R" + dest + ",";
}
result += string.Format(" ${0:X4}", addr);
result += $" ${addr:X4}";
addrToAdvance = 3;
return result;
case 0x005:
@ -801,10 +801,10 @@
{
offset = (ushort)(-offset - 1);
}
result += string.Format(" ${0:X4}", offset);
result += $" ${offset:X4}";
if (ext != 0)
{
result += string.Format(", ${0:X1}", opcode & 0x8);
result += $", ${opcode & 0x8:X1}";
}
}
addrToAdvance = 2;
@ -820,7 +820,7 @@
src = (byte)(opcode & 0x7);
addr = ReadMemory((ushort)(pc + 1), true);
addrToAdvance = 2;
return string.Format("MVO R{0:d}, ${1:X4}", src, addr);
return $"MVO R{src:d}, ${addr:X4}";
case 0x248:
case 0x249:
case 0x24A:
@ -891,7 +891,7 @@
dest = (byte)(opcode & 0x7);
addr = ReadMemory((ushort)(pc + 1), true);
addrToAdvance = 2;
return string.Format("MVI R{0:d}, ${1:X4}", dest, addr);
return $"MVI R{dest:d}, ${addr:X4}";
case 0x288:
case 0x289:
case 0x28A:
@ -962,7 +962,7 @@
dest = (byte)(opcode & 0x7);
addr = ReadMemory((ushort)(pc + 1), true);
addrToAdvance = 2;
return string.Format("ADD R{0:d}, ${1:X4}", dest, addr);
return $"ADD R{dest:d}, ${addr:X4}";
case 0x2C8:
case 0x2C9:
case 0x2CA:
@ -1033,7 +1033,7 @@
mem = (byte)(opcode & 0x7);
addr = ReadMemory((ushort)(pc + 1), true);
addrToAdvance = 2;
return string.Format("SUB R{0:d}, ${1:X4}", mem, addr);
return $"SUB R{mem:d}, ${addr:X4}";
case 0x308:
case 0x309:
case 0x30A:
@ -1104,7 +1104,7 @@
mem = (byte)(opcode & 0x7);
addr = ReadMemory((ushort)(pc + 1), true);
addrToAdvance = 2;
return string.Format("CMP R{0:d}, ${1:X4}", mem, addr);
return $"CMP R{mem:d}, ${addr:X4}";
case 0x348:
case 0x349:
case 0x34A:
@ -1175,7 +1175,7 @@
mem = (byte)(opcode & 0x7);
addr = ReadMemory((ushort)(pc + 1), true);
addrToAdvance = 2;
return string.Format("AND R{0:d}, ${1:X4}", mem, addr);
return $"AND R{mem:d}, ${addr:X4}";
case 0x388:
case 0x389:
case 0x38A:
@ -1246,7 +1246,7 @@
mem = (byte)(opcode & 0x7);
addr = ReadMemory((ushort)(pc + 1), true);
addrToAdvance = 2;
return string.Format("XOR R{0:d}, ${1:X4}", mem, addr);
return $"XOR R{mem:d}, ${addr:X4}";
case 0x3C8:
case 0x3C9:
case 0x3CA:

View File

@ -24,11 +24,7 @@ namespace BizHawk.Emulation.Cores.Components.CP1610
return new TraceInfo
{
Disassembly = string.Format(
"{0:X4}: {1:X2} {2} ",
RegisterPC-1,
opcode,
disassemble ? Disassemble((ushort)(RegisterPC-1), out notused) : "---").PadRight(26),
Disassembly = $"{RegisterPC - 1:X4}: {opcode:X2} {(disassemble ? Disassemble((ushort)(RegisterPC - 1), out notused) : "---")} ".PadRight(26),
RegisterInfo = string.Join(" ",
new[]
{

View File

@ -13,239 +13,239 @@ namespace BizHawk.Emulation.Cores.Components.H6280
switch (op)
{
case 0x00: bytesToAdvance = 1; return "BRK";
case 0x01: bytesToAdvance = 2; return string.Format("ORA (${0:X2},X)", ReadMemory(++pc));
case 0x01: bytesToAdvance = 2; return $"ORA (${ReadMemory(++pc):X2},X)";
case 0x02: bytesToAdvance = 1; return "SXY";
case 0x03: bytesToAdvance = 2; return string.Format("ST0 #${0:X2}", ReadMemory(++pc));
case 0x04: bytesToAdvance = 2; return string.Format("TSB ${0:X2}", ReadMemory(++pc));
case 0x05: bytesToAdvance = 2; return string.Format("ORA ${0:X2}", ReadMemory(++pc));
case 0x06: bytesToAdvance = 2; return string.Format("ASL ${0:X2}", ReadMemory(++pc));
case 0x07: bytesToAdvance = 2; return string.Format("RMB0 ${0:X2}", ReadMemory(++pc));
case 0x03: bytesToAdvance = 2; return $"ST0 #${ReadMemory(++pc):X2}";
case 0x04: bytesToAdvance = 2; return $"TSB ${ReadMemory(++pc):X2}";
case 0x05: bytesToAdvance = 2; return $"ORA ${ReadMemory(++pc):X2}";
case 0x06: bytesToAdvance = 2; return $"ASL ${ReadMemory(++pc):X2}";
case 0x07: bytesToAdvance = 2; return $"RMB0 ${ReadMemory(++pc):X2}";
case 0x08: bytesToAdvance = 1; return "PHP";
case 0x09: bytesToAdvance = 2; return string.Format("ORA #${0:X2}", ReadMemory(++pc));
case 0x09: bytesToAdvance = 2; return $"ORA #${ReadMemory(++pc):X2}";
case 0x0A: bytesToAdvance = 1; return "ASL A";
case 0x0C: bytesToAdvance = 3; return string.Format("TSB ${0:X4}", ReadWord(++pc));
case 0x0D: bytesToAdvance = 3; return string.Format("ORA ${0:X4}", ReadWord(++pc));
case 0x0E: bytesToAdvance = 3; return string.Format("ASL ${0:X4}", ReadWord(++pc));
case 0x0F: bytesToAdvance = 3; return string.Format("BBR0 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x10: bytesToAdvance = 2; return string.Format("BPL {0}", (sbyte)ReadMemory(++pc));
case 0x11: bytesToAdvance = 2; return string.Format("ORA (${0:X2}),Y", ReadMemory(++pc));
case 0x12: bytesToAdvance = 2; return string.Format("ORA (${0:X2})", ReadMemory(++pc));
case 0x13: bytesToAdvance = 2; return string.Format("ST1 #${0:X2}", ReadMemory(++pc));
case 0x14: bytesToAdvance = 2; return string.Format("TRB ${0:X2}", ReadMemory(++pc));
case 0x15: bytesToAdvance = 2; return string.Format("ORA ${0:X2},X", ReadMemory(++pc));
case 0x16: bytesToAdvance = 2; return string.Format("ASL ${0:X2},X", ReadMemory(++pc));
case 0x17: bytesToAdvance = 2; return string.Format("RMB1 ${0:X2}", ReadMemory(++pc));
case 0x0C: bytesToAdvance = 3; return $"TSB ${ReadWord(++pc):X4}";
case 0x0D: bytesToAdvance = 3; return $"ORA ${ReadWord(++pc):X4}";
case 0x0E: bytesToAdvance = 3; return $"ASL ${ReadWord(++pc):X4}";
case 0x0F: bytesToAdvance = 3; return $"BBR0 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x10: bytesToAdvance = 2; return $"BPL {(sbyte)ReadMemory(++pc)}";
case 0x11: bytesToAdvance = 2; return $"ORA (${ReadMemory(++pc):X2}),Y";
case 0x12: bytesToAdvance = 2; return $"ORA (${ReadMemory(++pc):X2})";
case 0x13: bytesToAdvance = 2; return $"ST1 #${ReadMemory(++pc):X2}";
case 0x14: bytesToAdvance = 2; return $"TRB ${ReadMemory(++pc):X2}";
case 0x15: bytesToAdvance = 2; return $"ORA ${ReadMemory(++pc):X2},X";
case 0x16: bytesToAdvance = 2; return $"ASL ${ReadMemory(++pc):X2},X";
case 0x17: bytesToAdvance = 2; return $"RMB1 ${ReadMemory(++pc):X2}";
case 0x18: bytesToAdvance = 1; return "CLC";
case 0x19: bytesToAdvance = 3; return string.Format("ORA ${0:X4},Y", ReadWord(++pc));
case 0x19: bytesToAdvance = 3; return $"ORA ${ReadWord(++pc):X4},Y";
case 0x1A: bytesToAdvance = 1; return "INC A";
case 0x1C: bytesToAdvance = 3; return string.Format("TRB ${0:X4}", ReadWord(++pc));
case 0x1D: bytesToAdvance = 3; return string.Format("ORA ${0:X4},X", ReadWord(++pc));
case 0x1E: bytesToAdvance = 3; return string.Format("ASL ${0:X4},X", ReadWord(++pc));
case 0x1F: bytesToAdvance = 3; return string.Format("BBR1 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x20: bytesToAdvance = 3; return string.Format("JSR ${0:X4}", ReadWord(++pc));
case 0x21: bytesToAdvance = 2; return string.Format("AND (${0:X2},X)", ReadMemory(++pc));
case 0x1C: bytesToAdvance = 3; return $"TRB ${ReadWord(++pc):X4}";
case 0x1D: bytesToAdvance = 3; return $"ORA ${ReadWord(++pc):X4},X";
case 0x1E: bytesToAdvance = 3; return $"ASL ${ReadWord(++pc):X4},X";
case 0x1F: bytesToAdvance = 3; return $"BBR1 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x20: bytesToAdvance = 3; return $"JSR ${ReadWord(++pc):X4}";
case 0x21: bytesToAdvance = 2; return $"AND (${ReadMemory(++pc):X2},X)";
case 0x22: bytesToAdvance = 1; return "SAX";
case 0x23: bytesToAdvance = 2; return string.Format("ST2 #${0:X2}", ReadMemory(++pc));
case 0x24: bytesToAdvance = 2; return string.Format("BIT ${0:X2}", ReadMemory(++pc));
case 0x25: bytesToAdvance = 2; return string.Format("AND ${0:X2}", ReadMemory(++pc));
case 0x26: bytesToAdvance = 2; return string.Format("ROL ${0:X2}", ReadMemory(++pc));
case 0x27: bytesToAdvance = 2; return string.Format("RMB2 ${0:X2}", ReadMemory(++pc));
case 0x23: bytesToAdvance = 2; return $"ST2 #${ReadMemory(++pc):X2}";
case 0x24: bytesToAdvance = 2; return $"BIT ${ReadMemory(++pc):X2}";
case 0x25: bytesToAdvance = 2; return $"AND ${ReadMemory(++pc):X2}";
case 0x26: bytesToAdvance = 2; return $"ROL ${ReadMemory(++pc):X2}";
case 0x27: bytesToAdvance = 2; return $"RMB2 ${ReadMemory(++pc):X2}";
case 0x28: bytesToAdvance = 1; return "PLP";
case 0x29: bytesToAdvance = 2; return string.Format("AND #${0:X2}", ReadMemory(++pc));
case 0x29: bytesToAdvance = 2; return $"AND #${ReadMemory(++pc):X2}";
case 0x2A: bytesToAdvance = 1; return "ROL A";
case 0x2C: bytesToAdvance = 3; return string.Format("BIT ${0:X4}", ReadWord(++pc));
case 0x2D: bytesToAdvance = 3; return string.Format("AND ${0:X4}", ReadWord(++pc));
case 0x2E: bytesToAdvance = 3; return string.Format("ROL ${0:X4}", ReadWord(++pc));
case 0x2F: bytesToAdvance = 3; return string.Format("BBR2 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x30: bytesToAdvance = 2; return string.Format("BMI {0}", (sbyte)ReadMemory(++pc));
case 0x31: bytesToAdvance = 2; return string.Format("AND (${0:X2}),Y", ReadMemory(++pc));
case 0x32: bytesToAdvance = 2; return string.Format("AND (${0:X2})", ReadMemory(++pc));
case 0x34: bytesToAdvance = 2; return string.Format("BIT ${0:X2},X", ReadMemory(++pc));
case 0x35: bytesToAdvance = 2; return string.Format("AND ${0:X2},X", ReadMemory(++pc));
case 0x36: bytesToAdvance = 2; return string.Format("ROL ${0:X2},X", ReadMemory(++pc));
case 0x37: bytesToAdvance = 2; return string.Format("RMB3 ${0:X2}", ReadMemory(++pc));
case 0x2C: bytesToAdvance = 3; return $"BIT ${ReadWord(++pc):X4}";
case 0x2D: bytesToAdvance = 3; return $"AND ${ReadWord(++pc):X4}";
case 0x2E: bytesToAdvance = 3; return $"ROL ${ReadWord(++pc):X4}";
case 0x2F: bytesToAdvance = 3; return $"BBR2 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x30: bytesToAdvance = 2; return $"BMI {(sbyte)ReadMemory(++pc)}";
case 0x31: bytesToAdvance = 2; return $"AND (${ReadMemory(++pc):X2}),Y";
case 0x32: bytesToAdvance = 2; return $"AND (${ReadMemory(++pc):X2})";
case 0x34: bytesToAdvance = 2; return $"BIT ${ReadMemory(++pc):X2},X";
case 0x35: bytesToAdvance = 2; return $"AND ${ReadMemory(++pc):X2},X";
case 0x36: bytesToAdvance = 2; return $"ROL ${ReadMemory(++pc):X2},X";
case 0x37: bytesToAdvance = 2; return $"RMB3 ${ReadMemory(++pc):X2}";
case 0x38: bytesToAdvance = 1; return "SEC";
case 0x39: bytesToAdvance = 3; return string.Format("AND ${0:X4},Y", ReadWord(++pc));
case 0x39: bytesToAdvance = 3; return $"AND ${ReadWord(++pc):X4},Y";
case 0x3A: bytesToAdvance = 1; return "DEC A";
case 0x3C: bytesToAdvance = 3; return string.Format("BIT ${0:X4},X", ReadWord(++pc));
case 0x3D: bytesToAdvance = 3; return string.Format("AND ${0:X4},X", ReadWord(++pc));
case 0x3E: bytesToAdvance = 3; return string.Format("ROL ${0:X4},X", ReadWord(++pc));
case 0x3F: bytesToAdvance = 3; return string.Format("BBR3 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x3C: bytesToAdvance = 3; return $"BIT ${ReadWord(++pc):X4},X";
case 0x3D: bytesToAdvance = 3; return $"AND ${ReadWord(++pc):X4},X";
case 0x3E: bytesToAdvance = 3; return $"ROL ${ReadWord(++pc):X4},X";
case 0x3F: bytesToAdvance = 3; return $"BBR3 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x40: bytesToAdvance = 1; return "RTI";
case 0x41: bytesToAdvance = 2; return string.Format("EOR (${0:X2},X)", ReadMemory(++pc));
case 0x41: bytesToAdvance = 2; return $"EOR (${ReadMemory(++pc):X2},X)";
case 0x42: bytesToAdvance = 1; return "SAY";
case 0x43: bytesToAdvance = 2; return string.Format("TMA #${0:X2}", ReadMemory(++pc));
case 0x44: bytesToAdvance = 2; return string.Format("BSR {0}", (sbyte)ReadMemory(++pc));
case 0x45: bytesToAdvance = 2; return string.Format("EOR ${0:X2}", ReadMemory(++pc));
case 0x46: bytesToAdvance = 2; return string.Format("LSR ${0:X2}", ReadMemory(++pc));
case 0x47: bytesToAdvance = 2; return string.Format("RMB4 ${0:X2}", ReadMemory(++pc));
case 0x43: bytesToAdvance = 2; return $"TMA #${ReadMemory(++pc):X2}";
case 0x44: bytesToAdvance = 2; return $"BSR {(sbyte)ReadMemory(++pc)}";
case 0x45: bytesToAdvance = 2; return $"EOR ${ReadMemory(++pc):X2}";
case 0x46: bytesToAdvance = 2; return $"LSR ${ReadMemory(++pc):X2}";
case 0x47: bytesToAdvance = 2; return $"RMB4 ${ReadMemory(++pc):X2}";
case 0x48: bytesToAdvance = 1; return "PHA";
case 0x49: bytesToAdvance = 2; return string.Format("EOR #${0:X2}", ReadMemory(++pc));
case 0x49: bytesToAdvance = 2; return $"EOR #${ReadMemory(++pc):X2}";
case 0x4A: bytesToAdvance = 1; return "LSR A";
case 0x4C: bytesToAdvance = 3; return string.Format("JMP ${0:X4}", ReadWord(++pc));
case 0x4D: bytesToAdvance = 3; return string.Format("EOR ${0:X4}", ReadWord(++pc));
case 0x4E: bytesToAdvance = 3; return string.Format("LSR ${0:X4}", ReadWord(++pc));
case 0x4F: bytesToAdvance = 3; return string.Format("BBR4 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x50: bytesToAdvance = 2; return string.Format("BVC {0}", (sbyte)ReadMemory(++pc));
case 0x51: bytesToAdvance = 2; return string.Format("EOR (${0:X2}),Y", ReadMemory(++pc));
case 0x52: bytesToAdvance = 2; return string.Format("EOR (${0:X2})", ReadMemory(++pc));
case 0x53: bytesToAdvance = 2; return string.Format("TAM #${0:X2}", ReadMemory(++pc));
case 0x4C: bytesToAdvance = 3; return $"JMP ${ReadWord(++pc):X4}";
case 0x4D: bytesToAdvance = 3; return $"EOR ${ReadWord(++pc):X4}";
case 0x4E: bytesToAdvance = 3; return $"LSR ${ReadWord(++pc):X4}";
case 0x4F: bytesToAdvance = 3; return $"BBR4 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x50: bytesToAdvance = 2; return $"BVC {(sbyte)ReadMemory(++pc)}";
case 0x51: bytesToAdvance = 2; return $"EOR (${ReadMemory(++pc):X2}),Y";
case 0x52: bytesToAdvance = 2; return $"EOR (${ReadMemory(++pc):X2})";
case 0x53: bytesToAdvance = 2; return $"TAM #${ReadMemory(++pc):X2}";
case 0x54: bytesToAdvance = 1; return "CSL";
case 0x55: bytesToAdvance = 2; return string.Format("EOR ${0:X2},X", ReadMemory(++pc));
case 0x56: bytesToAdvance = 2; return string.Format("LSR ${0:X2},X", ReadMemory(++pc));
case 0x57: bytesToAdvance = 2; return string.Format("RMB5 ${0:X2}", ReadMemory(++pc));
case 0x55: bytesToAdvance = 2; return $"EOR ${ReadMemory(++pc):X2},X";
case 0x56: bytesToAdvance = 2; return $"LSR ${ReadMemory(++pc):X2},X";
case 0x57: bytesToAdvance = 2; return $"RMB5 ${ReadMemory(++pc):X2}";
case 0x58: bytesToAdvance = 1; return "CLI";
case 0x59: bytesToAdvance = 3; return string.Format("EOR ${0:X4},Y", ReadWord(++pc));
case 0x59: bytesToAdvance = 3; return $"EOR ${ReadWord(++pc):X4},Y";
case 0x5A: bytesToAdvance = 1; return "PHY";
case 0x5D: bytesToAdvance = 3; return string.Format("EOR ${0:X4},X", ReadWord(++pc));
case 0x5E: bytesToAdvance = 3; return string.Format("LSR ${0:X4},X", ReadWord(++pc));
case 0x5F: bytesToAdvance = 3; return string.Format("BBR5 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x5D: bytesToAdvance = 3; return $"EOR ${ReadWord(++pc):X4},X";
case 0x5E: bytesToAdvance = 3; return $"LSR ${ReadWord(++pc):X4},X";
case 0x5F: bytesToAdvance = 3; return $"BBR5 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x60: bytesToAdvance = 1; return "RTS";
case 0x61: bytesToAdvance = 2; return string.Format("ADC (${0:X2},X)", ReadMemory(++pc));
case 0x61: bytesToAdvance = 2; return $"ADC (${ReadMemory(++pc):X2},X)";
case 0x62: bytesToAdvance = 1; return "CLA";
case 0x64: bytesToAdvance = 2; return string.Format("STZ ${0:X2}", ReadMemory(++pc));
case 0x65: bytesToAdvance = 2; return string.Format("ADC ${0:X2}", ReadMemory(++pc));
case 0x66: bytesToAdvance = 2; return string.Format("ROR ${0:X2}", ReadMemory(++pc));
case 0x67: bytesToAdvance = 2; return string.Format("RMB6 ${0:X2}", ReadMemory(++pc));
case 0x64: bytesToAdvance = 2; return $"STZ ${ReadMemory(++pc):X2}";
case 0x65: bytesToAdvance = 2; return $"ADC ${ReadMemory(++pc):X2}";
case 0x66: bytesToAdvance = 2; return $"ROR ${ReadMemory(++pc):X2}";
case 0x67: bytesToAdvance = 2; return $"RMB6 ${ReadMemory(++pc):X2}";
case 0x68: bytesToAdvance = 1; return "PLA";
case 0x69: bytesToAdvance = 2; return string.Format("ADC #${0:X2}", ReadMemory(++pc));
case 0x69: bytesToAdvance = 2; return $"ADC #${ReadMemory(++pc):X2}";
case 0x6A: bytesToAdvance = 1; return "ROR A";
case 0x6C: bytesToAdvance = 3; return string.Format("JMP (${0:X4})", ReadWord(++pc));
case 0x6D: bytesToAdvance = 3; return string.Format("ADC ${0:X4}", ReadWord(++pc));
case 0x6E: bytesToAdvance = 3; return string.Format("ROR ${0:X4}", ReadWord(++pc));
case 0x6F: bytesToAdvance = 3; return string.Format("BBR6 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x70: bytesToAdvance = 2; return string.Format("BVS {0}", (sbyte)ReadMemory(++pc));
case 0x71: bytesToAdvance = 2; return string.Format("ADC (${0:X2}),Y", ReadMemory(++pc));
case 0x72: bytesToAdvance = 2; return string.Format("ADC (${0:X2})", ReadMemory(++pc));
case 0x73: bytesToAdvance = 7; return string.Format("TII {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0x74: bytesToAdvance = 2; return string.Format("STZ ${0:X2},X", ReadMemory(++pc));
case 0x75: bytesToAdvance = 2; return string.Format("ADC ${0:X2},X", ReadMemory(++pc));
case 0x76: bytesToAdvance = 2; return string.Format("ROR ${0:X2},X", ReadMemory(++pc));
case 0x77: bytesToAdvance = 2; return string.Format("RMB7 ${0:X2}", ReadMemory(++pc));
case 0x6C: bytesToAdvance = 3; return $"JMP (${ReadWord(++pc):X4})";
case 0x6D: bytesToAdvance = 3; return $"ADC ${ReadWord(++pc):X4}";
case 0x6E: bytesToAdvance = 3; return $"ROR ${ReadWord(++pc):X4}";
case 0x6F: bytesToAdvance = 3; return $"BBR6 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x70: bytesToAdvance = 2; return $"BVS {(sbyte)ReadMemory(++pc)}";
case 0x71: bytesToAdvance = 2; return $"ADC (${ReadMemory(++pc):X2}),Y";
case 0x72: bytesToAdvance = 2; return $"ADC (${ReadMemory(++pc):X2})";
case 0x73: bytesToAdvance = 7; return $"TII {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0x74: bytesToAdvance = 2; return $"STZ ${ReadMemory(++pc):X2},X";
case 0x75: bytesToAdvance = 2; return $"ADC ${ReadMemory(++pc):X2},X";
case 0x76: bytesToAdvance = 2; return $"ROR ${ReadMemory(++pc):X2},X";
case 0x77: bytesToAdvance = 2; return $"RMB7 ${ReadMemory(++pc):X2}";
case 0x78: bytesToAdvance = 1; return "SEI";
case 0x79: bytesToAdvance = 3; return string.Format("ADC ${0:X4},Y", ReadWord(++pc));
case 0x79: bytesToAdvance = 3; return $"ADC ${ReadWord(++pc):X4},Y";
case 0x7A: bytesToAdvance = 1; return "PLY";
case 0x7C: bytesToAdvance = 3; return string.Format("JMP (${0:X4},X)", ReadWord(++pc));
case 0x7D: bytesToAdvance = 3; return string.Format("ADC ${0:X4},X", ReadWord(++pc));
case 0x7E: bytesToAdvance = 3; return string.Format("ROR ${0:X4},X", ReadWord(++pc));
case 0x7F: bytesToAdvance = 3; return string.Format("BBR7 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x80: bytesToAdvance = 2; return string.Format("BRA {0}", (sbyte)ReadMemory(++pc));
case 0x81: bytesToAdvance = 2; return string.Format("STA (${0:X2},X)", ReadMemory(++pc));
case 0x7C: bytesToAdvance = 3; return $"JMP (${ReadWord(++pc):X4},X)";
case 0x7D: bytesToAdvance = 3; return $"ADC ${ReadWord(++pc):X4},X";
case 0x7E: bytesToAdvance = 3; return $"ROR ${ReadWord(++pc):X4},X";
case 0x7F: bytesToAdvance = 3; return $"BBR7 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x80: bytesToAdvance = 2; return $"BRA {(sbyte)ReadMemory(++pc)}";
case 0x81: bytesToAdvance = 2; return $"STA (${ReadMemory(++pc):X2},X)";
case 0x82: bytesToAdvance = 1; return "CLX";
case 0x83: bytesToAdvance = 3; return string.Format("TST #${0:X2}, ${1:X2}", ReadMemory(++pc), ReadMemory(++pc));
case 0x84: bytesToAdvance = 2; return string.Format("STY ${0:X2}", ReadMemory(++pc));
case 0x85: bytesToAdvance = 2; return string.Format("STA ${0:X2}", ReadMemory(++pc));
case 0x86: bytesToAdvance = 2; return string.Format("STX ${0:X2}", ReadMemory(++pc));
case 0x87: bytesToAdvance = 2; return string.Format("SMB0 ${0:X2}", ReadMemory(++pc));
case 0x83: bytesToAdvance = 3; return $"TST #${ReadMemory(++pc):X2}, ${ReadMemory(++pc):X2}";
case 0x84: bytesToAdvance = 2; return $"STY ${ReadMemory(++pc):X2}";
case 0x85: bytesToAdvance = 2; return $"STA ${ReadMemory(++pc):X2}";
case 0x86: bytesToAdvance = 2; return $"STX ${ReadMemory(++pc):X2}";
case 0x87: bytesToAdvance = 2; return $"SMB0 ${ReadMemory(++pc):X2}";
case 0x88: bytesToAdvance = 1; return "DEY";
case 0x89: bytesToAdvance = 2; return string.Format("BIT #${0:X2}", ReadMemory(++pc));
case 0x89: bytesToAdvance = 2; return $"BIT #${ReadMemory(++pc):X2}";
case 0x8A: bytesToAdvance = 1; return "TXA";
case 0x8C: bytesToAdvance = 3; return string.Format("STY ${0:X4}", ReadWord(++pc));
case 0x8D: bytesToAdvance = 3; return string.Format("STA ${0:X4}", ReadWord(++pc));
case 0x8E: bytesToAdvance = 3; return string.Format("STX ${0:X4}", ReadWord(++pc));
case 0x8F: bytesToAdvance = 3; return string.Format("BBS0 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x90: bytesToAdvance = 2; return string.Format("BCC {0}", (sbyte)ReadMemory(++pc));
case 0x91: bytesToAdvance = 2; return string.Format("STA (${0:X2}),Y", ReadMemory(++pc));
case 0x92: bytesToAdvance = 2; return string.Format("STA (${0:X2})", ReadMemory(++pc));
case 0x93: bytesToAdvance = 4; return string.Format("TST #${0:X2}, ${1:X4}", ReadMemory(++pc), ReadWord(++pc));
case 0x94: bytesToAdvance = 2; return string.Format("STY ${0:X2},X", ReadMemory(++pc));
case 0x95: bytesToAdvance = 2; return string.Format("STA ${0:X2},X", ReadMemory(++pc));
case 0x96: bytesToAdvance = 2; return string.Format("STX ${0:X2},Y", ReadMemory(++pc));
case 0x97: bytesToAdvance = 2; return string.Format("SMB1 ${0:X2}", ReadMemory(++pc));
case 0x8C: bytesToAdvance = 3; return $"STY ${ReadWord(++pc):X4}";
case 0x8D: bytesToAdvance = 3; return $"STA ${ReadWord(++pc):X4}";
case 0x8E: bytesToAdvance = 3; return $"STX ${ReadWord(++pc):X4}";
case 0x8F: bytesToAdvance = 3; return $"BBS0 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x90: bytesToAdvance = 2; return $"BCC {(sbyte)ReadMemory(++pc)}";
case 0x91: bytesToAdvance = 2; return $"STA (${ReadMemory(++pc):X2}),Y";
case 0x92: bytesToAdvance = 2; return $"STA (${ReadMemory(++pc):X2})";
case 0x93: bytesToAdvance = 4; return $"TST #${ReadMemory(++pc):X2}, ${ReadWord(++pc):X4}";
case 0x94: bytesToAdvance = 2; return $"STY ${ReadMemory(++pc):X2},X";
case 0x95: bytesToAdvance = 2; return $"STA ${ReadMemory(++pc):X2},X";
case 0x96: bytesToAdvance = 2; return $"STX ${ReadMemory(++pc):X2},Y";
case 0x97: bytesToAdvance = 2; return $"SMB1 ${ReadMemory(++pc):X2}";
case 0x98: bytesToAdvance = 1; return "TYA";
case 0x99: bytesToAdvance = 3; return string.Format("STA ${0:X4},Y", ReadWord(++pc));
case 0x99: bytesToAdvance = 3; return $"STA ${ReadWord(++pc):X4},Y";
case 0x9A: bytesToAdvance = 1; return "TXS";
case 0x9C: bytesToAdvance = 3; return string.Format("STZ ${0:X4}", ReadWord(++pc));
case 0x9D: bytesToAdvance = 3; return string.Format("STA ${0:X4},X", ReadWord(++pc));
case 0x9E: bytesToAdvance = 3; return string.Format("STZ ${0:X4},X", ReadWord(++pc));
case 0x9F: bytesToAdvance = 3; return string.Format("BBS1 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xA0: bytesToAdvance = 2; return string.Format("LDY #${0:X2}", ReadMemory(++pc));
case 0xA1: bytesToAdvance = 2; return string.Format("LDA (${0:X2},X)", ReadMemory(++pc));
case 0xA2: bytesToAdvance = 2; return string.Format("LDX #${0:X2}", ReadMemory(++pc));
case 0xA3: bytesToAdvance = 3; return string.Format("TST #${0:X2}, ${1:X2},X", ReadMemory(++pc), ReadMemory(++pc));
case 0xA4: bytesToAdvance = 2; return string.Format("LDY ${0:X2}", ReadMemory(++pc));
case 0xA5: bytesToAdvance = 2; return string.Format("LDA ${0:X2}", ReadMemory(++pc));
case 0xA6: bytesToAdvance = 2; return string.Format("LDX ${0:X2}", ReadMemory(++pc));
case 0xA7: bytesToAdvance = 2; return string.Format("SMB2 ${0:X2}", ReadMemory(++pc));
case 0x9C: bytesToAdvance = 3; return $"STZ ${ReadWord(++pc):X4}";
case 0x9D: bytesToAdvance = 3; return $"STA ${ReadWord(++pc):X4},X";
case 0x9E: bytesToAdvance = 3; return $"STZ ${ReadWord(++pc):X4},X";
case 0x9F: bytesToAdvance = 3; return $"BBS1 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xA0: bytesToAdvance = 2; return $"LDY #${ReadMemory(++pc):X2}";
case 0xA1: bytesToAdvance = 2; return $"LDA (${ReadMemory(++pc):X2},X)";
case 0xA2: bytesToAdvance = 2; return $"LDX #${ReadMemory(++pc):X2}";
case 0xA3: bytesToAdvance = 3; return $"TST #${ReadMemory(++pc):X2}, ${ReadMemory(++pc):X2},X";
case 0xA4: bytesToAdvance = 2; return $"LDY ${ReadMemory(++pc):X2}";
case 0xA5: bytesToAdvance = 2; return $"LDA ${ReadMemory(++pc):X2}";
case 0xA6: bytesToAdvance = 2; return $"LDX ${ReadMemory(++pc):X2}";
case 0xA7: bytesToAdvance = 2; return $"SMB2 ${ReadMemory(++pc):X2}";
case 0xA8: bytesToAdvance = 1; return "TAY";
case 0xA9: bytesToAdvance = 2; return string.Format("LDA #${0:X2}", ReadMemory(++pc));
case 0xA9: bytesToAdvance = 2; return $"LDA #${ReadMemory(++pc):X2}";
case 0xAA: bytesToAdvance = 1; return "TAX";
case 0xAC: bytesToAdvance = 3; return string.Format("LDY ${0:X4}", ReadWord(++pc));
case 0xAD: bytesToAdvance = 3; return string.Format("LDA ${0:X4}", ReadWord(++pc));
case 0xAE: bytesToAdvance = 3; return string.Format("LDX ${0:X4}", ReadWord(++pc));
case 0xAF: bytesToAdvance = 3; return string.Format("BBS2 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xB0: bytesToAdvance = 2; return string.Format("BCS {0}", (sbyte)ReadMemory(++pc));
case 0xB1: bytesToAdvance = 2; return string.Format("LDA (${0:X2}),Y", ReadMemory(++pc));
case 0xB2: bytesToAdvance = 2; return string.Format("LDA (${0:X2})", ReadMemory(++pc));
case 0xB3: bytesToAdvance = 4; return string.Format("TST #${0:X2}, ${1:X4},X", ReadMemory(++pc), ReadWord(++pc));
case 0xB4: bytesToAdvance = 2; return string.Format("LDY ${0:X2},X", ReadMemory(++pc));
case 0xB5: bytesToAdvance = 2; return string.Format("LDA ${0:X2},X", ReadMemory(++pc));
case 0xB6: bytesToAdvance = 2; return string.Format("LDX ${0:X2},Y", ReadMemory(++pc));
case 0xB7: bytesToAdvance = 2; return string.Format("SMB3 ${0:X2}", ReadMemory(++pc));
case 0xAC: bytesToAdvance = 3; return $"LDY ${ReadWord(++pc):X4}";
case 0xAD: bytesToAdvance = 3; return $"LDA ${ReadWord(++pc):X4}";
case 0xAE: bytesToAdvance = 3; return $"LDX ${ReadWord(++pc):X4}";
case 0xAF: bytesToAdvance = 3; return $"BBS2 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xB0: bytesToAdvance = 2; return $"BCS {(sbyte)ReadMemory(++pc)}";
case 0xB1: bytesToAdvance = 2; return $"LDA (${ReadMemory(++pc):X2}),Y";
case 0xB2: bytesToAdvance = 2; return $"LDA (${ReadMemory(++pc):X2})";
case 0xB3: bytesToAdvance = 4; return $"TST #${ReadMemory(++pc):X2}, ${ReadWord(++pc):X4},X";
case 0xB4: bytesToAdvance = 2; return $"LDY ${ReadMemory(++pc):X2},X";
case 0xB5: bytesToAdvance = 2; return $"LDA ${ReadMemory(++pc):X2},X";
case 0xB6: bytesToAdvance = 2; return $"LDX ${ReadMemory(++pc):X2},Y";
case 0xB7: bytesToAdvance = 2; return $"SMB3 ${ReadMemory(++pc):X2}";
case 0xB8: bytesToAdvance = 1; return "CLV";
case 0xB9: bytesToAdvance = 3; return string.Format("LDA ${0:X4},Y", ReadWord(++pc));
case 0xB9: bytesToAdvance = 3; return $"LDA ${ReadWord(++pc):X4},Y";
case 0xBA: bytesToAdvance = 1; return "TSX";
case 0xBC: bytesToAdvance = 3; return string.Format("LDY ${0:X4},X", ReadWord(++pc));
case 0xBD: bytesToAdvance = 3; return string.Format("LDA ${0:X4},X", ReadWord(++pc));
case 0xBE: bytesToAdvance = 3; return string.Format("LDX ${0:X4},Y", ReadWord(++pc));
case 0xBF: bytesToAdvance = 3; return string.Format("BBS3 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xC0: bytesToAdvance = 2; return string.Format("CPY #${0:X2}", ReadMemory(++pc));
case 0xC1: bytesToAdvance = 2; return string.Format("CMP (${0:X2},X)", ReadMemory(++pc));
case 0xBC: bytesToAdvance = 3; return $"LDY ${ReadWord(++pc):X4},X";
case 0xBD: bytesToAdvance = 3; return $"LDA ${ReadWord(++pc):X4},X";
case 0xBE: bytesToAdvance = 3; return $"LDX ${ReadWord(++pc):X4},Y";
case 0xBF: bytesToAdvance = 3; return $"BBS3 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xC0: bytesToAdvance = 2; return $"CPY #${ReadMemory(++pc):X2}";
case 0xC1: bytesToAdvance = 2; return $"CMP (${ReadMemory(++pc):X2},X)";
case 0xC2: bytesToAdvance = 1; return "CLY";
case 0xC3: bytesToAdvance = 7; return string.Format("TDD {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xC4: bytesToAdvance = 2; return string.Format("CPY ${0:X2}", ReadMemory(++pc));
case 0xC5: bytesToAdvance = 2; return string.Format("CMP ${0:X2}", ReadMemory(++pc));
case 0xC6: bytesToAdvance = 2; return string.Format("DEC ${0:X2}", ReadMemory(++pc));
case 0xC7: bytesToAdvance = 2; return string.Format("SMB4 ${0:X2}", ReadMemory(++pc));
case 0xC3: bytesToAdvance = 7; return $"TDD {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xC4: bytesToAdvance = 2; return $"CPY ${ReadMemory(++pc):X2}";
case 0xC5: bytesToAdvance = 2; return $"CMP ${ReadMemory(++pc):X2}";
case 0xC6: bytesToAdvance = 2; return $"DEC ${ReadMemory(++pc):X2}";
case 0xC7: bytesToAdvance = 2; return $"SMB4 ${ReadMemory(++pc):X2}";
case 0xC8: bytesToAdvance = 1; return "INY";
case 0xC9: bytesToAdvance = 2; return string.Format("CMP #${0:X2}", ReadMemory(++pc));
case 0xC9: bytesToAdvance = 2; return $"CMP #${ReadMemory(++pc):X2}";
case 0xCA: bytesToAdvance = 1; return "DEX";
case 0xCC: bytesToAdvance = 3; return string.Format("CPY ${0:X4}", ReadWord(++pc));
case 0xCD: bytesToAdvance = 3; return string.Format("CMP ${0:X4}", ReadWord(++pc));
case 0xCE: bytesToAdvance = 3; return string.Format("DEC ${0:X4}", ReadWord(++pc));
case 0xCF: bytesToAdvance = 3; return string.Format("BBS4 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xD0: bytesToAdvance = 2; return string.Format("BNE {0}", (sbyte)ReadMemory(++pc));
case 0xD1: bytesToAdvance = 2; return string.Format("CMP (${0:X2}),Y", ReadMemory(++pc));
case 0xD2: bytesToAdvance = 2; return string.Format("CMP (${0:X2})", ReadMemory(++pc));
case 0xD3: bytesToAdvance = 7; return string.Format("TIN {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xCC: bytesToAdvance = 3; return $"CPY ${ReadWord(++pc):X4}";
case 0xCD: bytesToAdvance = 3; return $"CMP ${ReadWord(++pc):X4}";
case 0xCE: bytesToAdvance = 3; return $"DEC ${ReadWord(++pc):X4}";
case 0xCF: bytesToAdvance = 3; return $"BBS4 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xD0: bytesToAdvance = 2; return $"BNE {(sbyte)ReadMemory(++pc)}";
case 0xD1: bytesToAdvance = 2; return $"CMP (${ReadMemory(++pc):X2}),Y";
case 0xD2: bytesToAdvance = 2; return $"CMP (${ReadMemory(++pc):X2})";
case 0xD3: bytesToAdvance = 7; return $"TIN {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xD4: bytesToAdvance = 1; return "CSH";
case 0xD5: bytesToAdvance = 2; return string.Format("CMP ${0:X2},X", ReadMemory(++pc));
case 0xD6: bytesToAdvance = 2; return string.Format("DEC ${0:X2},X", ReadMemory(++pc));
case 0xD7: bytesToAdvance = 2; return string.Format("SMB5 ${0:X2}", ReadMemory(++pc));
case 0xD5: bytesToAdvance = 2; return $"CMP ${ReadMemory(++pc):X2},X";
case 0xD6: bytesToAdvance = 2; return $"DEC ${ReadMemory(++pc):X2},X";
case 0xD7: bytesToAdvance = 2; return $"SMB5 ${ReadMemory(++pc):X2}";
case 0xD8: bytesToAdvance = 1; return "CLD";
case 0xD9: bytesToAdvance = 3; return string.Format("CMP ${0:X4},Y", ReadWord(++pc));
case 0xD9: bytesToAdvance = 3; return $"CMP ${ReadWord(++pc):X4},Y";
case 0xDA: bytesToAdvance = 1; return "PHX";
case 0xDD: bytesToAdvance = 3; return string.Format("CMP ${0:X4},X", ReadWord(++pc));
case 0xDE: bytesToAdvance = 3; return string.Format("DEC ${0:X4},X", ReadWord(++pc));
case 0xDF: bytesToAdvance = 3; return string.Format("BBS5 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xE0: bytesToAdvance = 2; return string.Format("CPX #${0:X2}", ReadMemory(++pc));
case 0xE1: bytesToAdvance = 2; return string.Format("SBC (${0:X2},X)", ReadMemory(++pc));
case 0xE3: bytesToAdvance = 7; return string.Format("TIA {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xE4: bytesToAdvance = 2; return string.Format("CPX ${0:X2}", ReadMemory(++pc));
case 0xE5: bytesToAdvance = 2; return string.Format("SBC ${0:X2}", ReadMemory(++pc));
case 0xE6: bytesToAdvance = 2; return string.Format("INC ${0:X2}", ReadMemory(++pc));
case 0xE7: bytesToAdvance = 2; return string.Format("SMB6 ${0:X2}", ReadMemory(++pc));
case 0xDD: bytesToAdvance = 3; return $"CMP ${ReadWord(++pc):X4},X";
case 0xDE: bytesToAdvance = 3; return $"DEC ${ReadWord(++pc):X4},X";
case 0xDF: bytesToAdvance = 3; return $"BBS5 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xE0: bytesToAdvance = 2; return $"CPX #${ReadMemory(++pc):X2}";
case 0xE1: bytesToAdvance = 2; return $"SBC (${ReadMemory(++pc):X2},X)";
case 0xE3: bytesToAdvance = 7; return $"TIA {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xE4: bytesToAdvance = 2; return $"CPX ${ReadMemory(++pc):X2}";
case 0xE5: bytesToAdvance = 2; return $"SBC ${ReadMemory(++pc):X2}";
case 0xE6: bytesToAdvance = 2; return $"INC ${ReadMemory(++pc):X2}";
case 0xE7: bytesToAdvance = 2; return $"SMB6 ${ReadMemory(++pc):X2}";
case 0xE8: bytesToAdvance = 1; return "INX";
case 0xE9: bytesToAdvance = 2; return string.Format("SBC #${0:X2}", ReadMemory(++pc));
case 0xE9: bytesToAdvance = 2; return $"SBC #${ReadMemory(++pc):X2}";
case 0xEA: bytesToAdvance = 1; return "NOP";
case 0xEC: bytesToAdvance = 3; return string.Format("CPX ${0:X4}", ReadWord(++pc));
case 0xED: bytesToAdvance = 3; return string.Format("SBC ${0:X4}", ReadWord(++pc));
case 0xEE: bytesToAdvance = 3; return string.Format("INC ${0:X4}", ReadWord(++pc));
case 0xEF: bytesToAdvance = 3; return string.Format("BBS6 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xF0: bytesToAdvance = 2; return string.Format("BEQ {0}", (sbyte)ReadMemory(++pc));
case 0xF1: bytesToAdvance = 2; return string.Format("SBC (${0:X2}),Y", ReadMemory(++pc));
case 0xF2: bytesToAdvance = 2; return string.Format("SBC (${0:X2})", ReadMemory(++pc));
case 0xF3: bytesToAdvance = 7; return string.Format("TAI {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xEC: bytesToAdvance = 3; return $"CPX ${ReadWord(++pc):X4}";
case 0xED: bytesToAdvance = 3; return $"SBC ${ReadWord(++pc):X4}";
case 0xEE: bytesToAdvance = 3; return $"INC ${ReadWord(++pc):X4}";
case 0xEF: bytesToAdvance = 3; return $"BBS6 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xF0: bytesToAdvance = 2; return $"BEQ {(sbyte)ReadMemory(++pc)}";
case 0xF1: bytesToAdvance = 2; return $"SBC (${ReadMemory(++pc):X2}),Y";
case 0xF2: bytesToAdvance = 2; return $"SBC (${ReadMemory(++pc):X2})";
case 0xF3: bytesToAdvance = 7; return $"TAI {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xF4: bytesToAdvance = 1; return "SET";
case 0xF5: bytesToAdvance = 2; return string.Format("SBC ${0:X2},X", ReadMemory(++pc));
case 0xF6: bytesToAdvance = 2; return string.Format("INC ${0:X2},X", ReadMemory(++pc));
case 0xF7: bytesToAdvance = 2; return string.Format("SMB7 ${0:X2}", ReadMemory(++pc));
case 0xF5: bytesToAdvance = 2; return $"SBC ${ReadMemory(++pc):X2},X";
case 0xF6: bytesToAdvance = 2; return $"INC ${ReadMemory(++pc):X2},X";
case 0xF7: bytesToAdvance = 2; return $"SMB7 ${ReadMemory(++pc):X2}";
case 0xF8: bytesToAdvance = 1; return "SED";
case 0xF9: bytesToAdvance = 3; return string.Format("SBC ${0:X4},Y", ReadWord(++pc));
case 0xF9: bytesToAdvance = 3; return $"SBC ${ReadWord(++pc):X4},Y";
case 0xFA: bytesToAdvance = 1; return "PLX";
case 0xFD: bytesToAdvance = 3; return string.Format("SBC ${0:X4},X", ReadWord(++pc));
case 0xFE: bytesToAdvance = 3; return string.Format("INC ${0:X4},X", ReadWord(++pc));
case 0xFF: bytesToAdvance = 3; return string.Format("BBS7 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xFD: bytesToAdvance = 3; return $"SBC ${ReadWord(++pc):X4},X";
case 0xFE: bytesToAdvance = 3; return $"INC ${ReadWord(++pc):X4},X";
case 0xFF: bytesToAdvance = 3; return $"BBS7 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
}
bytesToAdvance = 1;
return "???";
@ -258,239 +258,239 @@ namespace BizHawk.Emulation.Cores.Components.H6280
switch (op)
{
case 0x00: bytesToAdvance = 1; return "BRK";
case 0x01: bytesToAdvance = 2; return string.Format("ORA (${0:X2},X)", ReadMemory(++pc));
case 0x01: bytesToAdvance = 2; return $"ORA (${ReadMemory(++pc):X2},X)";
case 0x02: bytesToAdvance = 1; return "SXY";
case 0x03: bytesToAdvance = 2; return string.Format("ST0 #${0:X2}", ReadMemory(++pc));
case 0x04: bytesToAdvance = 2; return string.Format("TSB ${0:X2}", ReadMemory(++pc));
case 0x05: bytesToAdvance = 2; return string.Format("ORA ${0:X2}", ReadMemory(++pc));
case 0x06: bytesToAdvance = 2; return string.Format("ASL ${0:X2}", ReadMemory(++pc));
case 0x07: bytesToAdvance = 2; return string.Format("RMB0 ${0:X2}", ReadMemory(++pc));
case 0x03: bytesToAdvance = 2; return $"ST0 #${ReadMemory(++pc):X2}";
case 0x04: bytesToAdvance = 2; return $"TSB ${ReadMemory(++pc):X2}";
case 0x05: bytesToAdvance = 2; return $"ORA ${ReadMemory(++pc):X2}";
case 0x06: bytesToAdvance = 2; return $"ASL ${ReadMemory(++pc):X2}";
case 0x07: bytesToAdvance = 2; return $"RMB0 ${ReadMemory(++pc):X2}";
case 0x08: bytesToAdvance = 1; return "PHP";
case 0x09: bytesToAdvance = 2; return string.Format("ORA #${0:X2}", ReadMemory(++pc));
case 0x09: bytesToAdvance = 2; return $"ORA #${ReadMemory(++pc):X2}";
case 0x0A: bytesToAdvance = 1; return "ASL A";
case 0x0C: bytesToAdvance = 3; return string.Format("TSB ${0:X4}", ReadWord(++pc));
case 0x0D: bytesToAdvance = 3; return string.Format("ORA ${0:X4}", ReadWord(++pc));
case 0x0E: bytesToAdvance = 3; return string.Format("ASL ${0:X4}", ReadWord(++pc));
case 0x0F: bytesToAdvance = 3; return string.Format("BBR0 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x10: bytesToAdvance = 2; return string.Format("BPL {0}", (sbyte)ReadMemory(++pc));
case 0x11: bytesToAdvance = 2; return string.Format("ORA (${0:X2}),Y", ReadMemory(++pc));
case 0x12: bytesToAdvance = 2; return string.Format("ORA (${0:X2})", ReadMemory(++pc));
case 0x13: bytesToAdvance = 2; return string.Format("ST1 #${0:X2}", ReadMemory(++pc));
case 0x14: bytesToAdvance = 2; return string.Format("TRB ${0:X2}", ReadMemory(++pc));
case 0x15: bytesToAdvance = 2; return string.Format("ORA ${0:X2},X", ReadMemory(++pc));
case 0x16: bytesToAdvance = 2; return string.Format("ASL ${0:X2},X", ReadMemory(++pc));
case 0x17: bytesToAdvance = 2; return string.Format("RMB1 ${0:X2}", ReadMemory(++pc));
case 0x0C: bytesToAdvance = 3; return $"TSB ${ReadWord(++pc):X4}";
case 0x0D: bytesToAdvance = 3; return $"ORA ${ReadWord(++pc):X4}";
case 0x0E: bytesToAdvance = 3; return $"ASL ${ReadWord(++pc):X4}";
case 0x0F: bytesToAdvance = 3; return $"BBR0 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x10: bytesToAdvance = 2; return $"BPL {(sbyte)ReadMemory(++pc)}";
case 0x11: bytesToAdvance = 2; return $"ORA (${ReadMemory(++pc):X2}),Y";
case 0x12: bytesToAdvance = 2; return $"ORA (${ReadMemory(++pc):X2})";
case 0x13: bytesToAdvance = 2; return $"ST1 #${ReadMemory(++pc):X2}";
case 0x14: bytesToAdvance = 2; return $"TRB ${ReadMemory(++pc):X2}";
case 0x15: bytesToAdvance = 2; return $"ORA ${ReadMemory(++pc):X2},X";
case 0x16: bytesToAdvance = 2; return $"ASL ${ReadMemory(++pc):X2},X";
case 0x17: bytesToAdvance = 2; return $"RMB1 ${ReadMemory(++pc):X2}";
case 0x18: bytesToAdvance = 1; return "CLC";
case 0x19: bytesToAdvance = 3; return string.Format("ORA ${0:X4},Y", ReadWord(++pc));
case 0x19: bytesToAdvance = 3; return $"ORA ${ReadWord(++pc):X4},Y";
case 0x1A: bytesToAdvance = 1; return "INC A";
case 0x1C: bytesToAdvance = 3; return string.Format("TRB ${0:X4}", ReadWord(++pc));
case 0x1D: bytesToAdvance = 3; return string.Format("ORA ${0:X4},X", ReadWord(++pc));
case 0x1E: bytesToAdvance = 3; return string.Format("ASL ${0:X4},X", ReadWord(++pc));
case 0x1F: bytesToAdvance = 3; return string.Format("BBR1 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x20: bytesToAdvance = 3; return string.Format("JSR ${0:X4}", ReadWord(++pc));
case 0x21: bytesToAdvance = 2; return string.Format("AND (${0:X2},X)", ReadMemory(++pc));
case 0x1C: bytesToAdvance = 3; return $"TRB ${ReadWord(++pc):X4}";
case 0x1D: bytesToAdvance = 3; return $"ORA ${ReadWord(++pc):X4},X";
case 0x1E: bytesToAdvance = 3; return $"ASL ${ReadWord(++pc):X4},X";
case 0x1F: bytesToAdvance = 3; return $"BBR1 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x20: bytesToAdvance = 3; return $"JSR ${ReadWord(++pc):X4}";
case 0x21: bytesToAdvance = 2; return $"AND (${ReadMemory(++pc):X2},X)";
case 0x22: bytesToAdvance = 1; return "SAX";
case 0x23: bytesToAdvance = 2; return string.Format("ST2 #${0:X2}", ReadMemory(++pc));
case 0x24: bytesToAdvance = 2; return string.Format("BIT ${0:X2}", ReadMemory(++pc));
case 0x25: bytesToAdvance = 2; return string.Format("AND ${0:X2}", ReadMemory(++pc));
case 0x26: bytesToAdvance = 2; return string.Format("ROL ${0:X2}", ReadMemory(++pc));
case 0x27: bytesToAdvance = 2; return string.Format("RMB2 ${0:X2}", ReadMemory(++pc));
case 0x23: bytesToAdvance = 2; return $"ST2 #${ReadMemory(++pc):X2}";
case 0x24: bytesToAdvance = 2; return $"BIT ${ReadMemory(++pc):X2}";
case 0x25: bytesToAdvance = 2; return $"AND ${ReadMemory(++pc):X2}";
case 0x26: bytesToAdvance = 2; return $"ROL ${ReadMemory(++pc):X2}";
case 0x27: bytesToAdvance = 2; return $"RMB2 ${ReadMemory(++pc):X2}";
case 0x28: bytesToAdvance = 1; return "PLP";
case 0x29: bytesToAdvance = 2; return string.Format("AND #${0:X2}", ReadMemory(++pc));
case 0x29: bytesToAdvance = 2; return $"AND #${ReadMemory(++pc):X2}";
case 0x2A: bytesToAdvance = 1; return "ROL A";
case 0x2C: bytesToAdvance = 3; return string.Format("BIT ${0:X4}", ReadWord(++pc));
case 0x2D: bytesToAdvance = 3; return string.Format("AND ${0:X4}", ReadWord(++pc));
case 0x2E: bytesToAdvance = 3; return string.Format("ROL ${0:X4}", ReadWord(++pc));
case 0x2F: bytesToAdvance = 3; return string.Format("BBR2 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x30: bytesToAdvance = 2; return string.Format("BMI {0}", (sbyte)ReadMemory(++pc));
case 0x31: bytesToAdvance = 2; return string.Format("AND (${0:X2}),Y", ReadMemory(++pc));
case 0x32: bytesToAdvance = 2; return string.Format("AND (${0:X2})", ReadMemory(++pc));
case 0x34: bytesToAdvance = 2; return string.Format("BIT ${0:X2},X", ReadMemory(++pc));
case 0x35: bytesToAdvance = 2; return string.Format("AND ${0:X2},X", ReadMemory(++pc));
case 0x36: bytesToAdvance = 2; return string.Format("ROL ${0:X2},X", ReadMemory(++pc));
case 0x37: bytesToAdvance = 2; return string.Format("RMB3 ${0:X2}", ReadMemory(++pc));
case 0x2C: bytesToAdvance = 3; return $"BIT ${ReadWord(++pc):X4}";
case 0x2D: bytesToAdvance = 3; return $"AND ${ReadWord(++pc):X4}";
case 0x2E: bytesToAdvance = 3; return $"ROL ${ReadWord(++pc):X4}";
case 0x2F: bytesToAdvance = 3; return $"BBR2 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x30: bytesToAdvance = 2; return $"BMI {(sbyte)ReadMemory(++pc)}";
case 0x31: bytesToAdvance = 2; return $"AND (${ReadMemory(++pc):X2}),Y";
case 0x32: bytesToAdvance = 2; return $"AND (${ReadMemory(++pc):X2})";
case 0x34: bytesToAdvance = 2; return $"BIT ${ReadMemory(++pc):X2},X";
case 0x35: bytesToAdvance = 2; return $"AND ${ReadMemory(++pc):X2},X";
case 0x36: bytesToAdvance = 2; return $"ROL ${ReadMemory(++pc):X2},X";
case 0x37: bytesToAdvance = 2; return $"RMB3 ${ReadMemory(++pc):X2}";
case 0x38: bytesToAdvance = 1; return "SEC";
case 0x39: bytesToAdvance = 3; return string.Format("AND ${0:X4},Y", ReadWord(++pc));
case 0x39: bytesToAdvance = 3; return $"AND ${ReadWord(++pc):X4},Y";
case 0x3A: bytesToAdvance = 1; return "DEC A";
case 0x3C: bytesToAdvance = 3; return string.Format("BIT ${0:X4},X", ReadWord(++pc));
case 0x3D: bytesToAdvance = 3; return string.Format("AND ${0:X4},X", ReadWord(++pc));
case 0x3E: bytesToAdvance = 3; return string.Format("ROL ${0:X4},X", ReadWord(++pc));
case 0x3F: bytesToAdvance = 3; return string.Format("BBR3 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x3C: bytesToAdvance = 3; return $"BIT ${ReadWord(++pc):X4},X";
case 0x3D: bytesToAdvance = 3; return $"AND ${ReadWord(++pc):X4},X";
case 0x3E: bytesToAdvance = 3; return $"ROL ${ReadWord(++pc):X4},X";
case 0x3F: bytesToAdvance = 3; return $"BBR3 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x40: bytesToAdvance = 1; return "RTI";
case 0x41: bytesToAdvance = 2; return string.Format("EOR (${0:X2},X)", ReadMemory(++pc));
case 0x41: bytesToAdvance = 2; return $"EOR (${ReadMemory(++pc):X2},X)";
case 0x42: bytesToAdvance = 1; return "SAY";
case 0x43: bytesToAdvance = 2; return string.Format("TMA #${0:X2}", ReadMemory(++pc));
case 0x44: bytesToAdvance = 2; return string.Format("BSR {0}", (sbyte)ReadMemory(++pc));
case 0x45: bytesToAdvance = 2; return string.Format("EOR ${0:X2}", ReadMemory(++pc));
case 0x46: bytesToAdvance = 2; return string.Format("LSR ${0:X2}", ReadMemory(++pc));
case 0x47: bytesToAdvance = 2; return string.Format("RMB4 ${0:X2}", ReadMemory(++pc));
case 0x43: bytesToAdvance = 2; return $"TMA #${ReadMemory(++pc):X2}";
case 0x44: bytesToAdvance = 2; return $"BSR {(sbyte)ReadMemory(++pc)}";
case 0x45: bytesToAdvance = 2; return $"EOR ${ReadMemory(++pc):X2}";
case 0x46: bytesToAdvance = 2; return $"LSR ${ReadMemory(++pc):X2}";
case 0x47: bytesToAdvance = 2; return $"RMB4 ${ReadMemory(++pc):X2}";
case 0x48: bytesToAdvance = 1; return "PHA";
case 0x49: bytesToAdvance = 2; return string.Format("EOR #${0:X2}", ReadMemory(++pc));
case 0x49: bytesToAdvance = 2; return $"EOR #${ReadMemory(++pc):X2}";
case 0x4A: bytesToAdvance = 1; return "LSR A";
case 0x4C: bytesToAdvance = 3; return string.Format("JMP ${0:X4}", ReadWord(++pc));
case 0x4D: bytesToAdvance = 3; return string.Format("EOR ${0:X4}", ReadWord(++pc));
case 0x4E: bytesToAdvance = 3; return string.Format("LSR ${0:X4}", ReadWord(++pc));
case 0x4F: bytesToAdvance = 3; return string.Format("BBR4 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x50: bytesToAdvance = 2; return string.Format("BVC {0}", (sbyte)ReadMemory(++pc));
case 0x51: bytesToAdvance = 2; return string.Format("EOR (${0:X2}),Y", ReadMemory(++pc));
case 0x52: bytesToAdvance = 2; return string.Format("EOR (${0:X2})", ReadMemory(++pc));
case 0x53: bytesToAdvance = 2; return string.Format("TAM #${0:X2}", ReadMemory(++pc));
case 0x4C: bytesToAdvance = 3; return $"JMP ${ReadWord(++pc):X4}";
case 0x4D: bytesToAdvance = 3; return $"EOR ${ReadWord(++pc):X4}";
case 0x4E: bytesToAdvance = 3; return $"LSR ${ReadWord(++pc):X4}";
case 0x4F: bytesToAdvance = 3; return $"BBR4 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x50: bytesToAdvance = 2; return $"BVC {(sbyte)ReadMemory(++pc)}";
case 0x51: bytesToAdvance = 2; return $"EOR (${ReadMemory(++pc):X2}),Y";
case 0x52: bytesToAdvance = 2; return $"EOR (${ReadMemory(++pc):X2})";
case 0x53: bytesToAdvance = 2; return $"TAM #${ReadMemory(++pc):X2}";
case 0x54: bytesToAdvance = 1; return "CSL";
case 0x55: bytesToAdvance = 2; return string.Format("EOR ${0:X2},X", ReadMemory(++pc));
case 0x56: bytesToAdvance = 2; return string.Format("LSR ${0:X2},X", ReadMemory(++pc));
case 0x57: bytesToAdvance = 2; return string.Format("RMB5 ${0:X2}", ReadMemory(++pc));
case 0x55: bytesToAdvance = 2; return $"EOR ${ReadMemory(++pc):X2},X";
case 0x56: bytesToAdvance = 2; return $"LSR ${ReadMemory(++pc):X2},X";
case 0x57: bytesToAdvance = 2; return $"RMB5 ${ReadMemory(++pc):X2}";
case 0x58: bytesToAdvance = 1; return "CLI";
case 0x59: bytesToAdvance = 3; return string.Format("EOR ${0:X4},Y", ReadWord(++pc));
case 0x59: bytesToAdvance = 3; return $"EOR ${ReadWord(++pc):X4},Y";
case 0x5A: bytesToAdvance = 1; return "PHY";
case 0x5D: bytesToAdvance = 3; return string.Format("EOR ${0:X4},X", ReadWord(++pc));
case 0x5E: bytesToAdvance = 3; return string.Format("LSR ${0:X4},X", ReadWord(++pc));
case 0x5F: bytesToAdvance = 3; return string.Format("BBR5 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x5D: bytesToAdvance = 3; return $"EOR ${ReadWord(++pc):X4},X";
case 0x5E: bytesToAdvance = 3; return $"LSR ${ReadWord(++pc):X4},X";
case 0x5F: bytesToAdvance = 3; return $"BBR5 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x60: bytesToAdvance = 1; return "RTS";
case 0x61: bytesToAdvance = 2; return string.Format("ADC (${0:X2},X)", ReadMemory(++pc));
case 0x61: bytesToAdvance = 2; return $"ADC (${ReadMemory(++pc):X2},X)";
case 0x62: bytesToAdvance = 1; return "CLA";
case 0x64: bytesToAdvance = 2; return string.Format("STZ ${0:X2}", ReadMemory(++pc));
case 0x65: bytesToAdvance = 2; return string.Format("ADC ${0:X2}", ReadMemory(++pc));
case 0x66: bytesToAdvance = 2; return string.Format("ROR ${0:X2}", ReadMemory(++pc));
case 0x67: bytesToAdvance = 2; return string.Format("RMB6 ${0:X2}", ReadMemory(++pc));
case 0x64: bytesToAdvance = 2; return $"STZ ${ReadMemory(++pc):X2}";
case 0x65: bytesToAdvance = 2; return $"ADC ${ReadMemory(++pc):X2}";
case 0x66: bytesToAdvance = 2; return $"ROR ${ReadMemory(++pc):X2}";
case 0x67: bytesToAdvance = 2; return $"RMB6 ${ReadMemory(++pc):X2}";
case 0x68: bytesToAdvance = 1; return "PLA";
case 0x69: bytesToAdvance = 2; return string.Format("ADC #${0:X2}", ReadMemory(++pc));
case 0x69: bytesToAdvance = 2; return $"ADC #${ReadMemory(++pc):X2}";
case 0x6A: bytesToAdvance = 1; return "ROR A";
case 0x6C: bytesToAdvance = 3; return string.Format("JMP (${0:X4})", ReadWord(++pc));
case 0x6D: bytesToAdvance = 3; return string.Format("ADC ${0:X4}", ReadWord(++pc));
case 0x6E: bytesToAdvance = 3; return string.Format("ROR ${0:X4}", ReadWord(++pc));
case 0x6F: bytesToAdvance = 3; return string.Format("BBR6 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x70: bytesToAdvance = 2; return string.Format("BVS {0}", (sbyte)ReadMemory(++pc));
case 0x71: bytesToAdvance = 2; return string.Format("ADC (${0:X2}),Y", ReadMemory(++pc));
case 0x72: bytesToAdvance = 2; return string.Format("ADC (${0:X2})", ReadMemory(++pc));
case 0x73: bytesToAdvance = 7; return string.Format("TII {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0x74: bytesToAdvance = 2; return string.Format("STZ ${0:X2},X", ReadMemory(++pc));
case 0x75: bytesToAdvance = 2; return string.Format("ADC ${0:X2},X", ReadMemory(++pc));
case 0x76: bytesToAdvance = 2; return string.Format("ROR ${0:X2},X", ReadMemory(++pc));
case 0x77: bytesToAdvance = 2; return string.Format("RMB7 ${0:X2}", ReadMemory(++pc));
case 0x6C: bytesToAdvance = 3; return $"JMP (${ReadWord(++pc):X4})";
case 0x6D: bytesToAdvance = 3; return $"ADC ${ReadWord(++pc):X4}";
case 0x6E: bytesToAdvance = 3; return $"ROR ${ReadWord(++pc):X4}";
case 0x6F: bytesToAdvance = 3; return $"BBR6 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x70: bytesToAdvance = 2; return $"BVS {(sbyte)ReadMemory(++pc)}";
case 0x71: bytesToAdvance = 2; return $"ADC (${ReadMemory(++pc):X2}),Y";
case 0x72: bytesToAdvance = 2; return $"ADC (${ReadMemory(++pc):X2})";
case 0x73: bytesToAdvance = 7; return $"TII {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0x74: bytesToAdvance = 2; return $"STZ ${ReadMemory(++pc):X2},X";
case 0x75: bytesToAdvance = 2; return $"ADC ${ReadMemory(++pc):X2},X";
case 0x76: bytesToAdvance = 2; return $"ROR ${ReadMemory(++pc):X2},X";
case 0x77: bytesToAdvance = 2; return $"RMB7 ${ReadMemory(++pc):X2}";
case 0x78: bytesToAdvance = 1; return "SEI";
case 0x79: bytesToAdvance = 3; return string.Format("ADC ${0:X4},Y", ReadWord(++pc));
case 0x79: bytesToAdvance = 3; return $"ADC ${ReadWord(++pc):X4},Y";
case 0x7A: bytesToAdvance = 1; return "PLY";
case 0x7C: bytesToAdvance = 3; return string.Format("JMP (${0:X4},X)", ReadWord(++pc));
case 0x7D: bytesToAdvance = 3; return string.Format("ADC ${0:X4},X", ReadWord(++pc));
case 0x7E: bytesToAdvance = 3; return string.Format("ROR ${0:X4},X", ReadWord(++pc));
case 0x7F: bytesToAdvance = 3; return string.Format("BBR7 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x80: bytesToAdvance = 2; return string.Format("BRA {0}", (sbyte)ReadMemory(++pc));
case 0x81: bytesToAdvance = 2; return string.Format("STA (${0:X2},X)", ReadMemory(++pc));
case 0x7C: bytesToAdvance = 3; return $"JMP (${ReadWord(++pc):X4},X)";
case 0x7D: bytesToAdvance = 3; return $"ADC ${ReadWord(++pc):X4},X";
case 0x7E: bytesToAdvance = 3; return $"ROR ${ReadWord(++pc):X4},X";
case 0x7F: bytesToAdvance = 3; return $"BBR7 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x80: bytesToAdvance = 2; return $"BRA {(sbyte)ReadMemory(++pc)}";
case 0x81: bytesToAdvance = 2; return $"STA (${ReadMemory(++pc):X2},X)";
case 0x82: bytesToAdvance = 1; return "CLX";
case 0x83: bytesToAdvance = 3; return string.Format("TST #${0:X2}, ${1:X2}", ReadMemory(++pc), ReadMemory(++pc));
case 0x84: bytesToAdvance = 2; return string.Format("STY ${0:X2}", ReadMemory(++pc));
case 0x85: bytesToAdvance = 2; return string.Format("STA ${0:X2}", ReadMemory(++pc));
case 0x86: bytesToAdvance = 2; return string.Format("STX ${0:X2}", ReadMemory(++pc));
case 0x87: bytesToAdvance = 2; return string.Format("SMB0 ${0:X2}", ReadMemory(++pc));
case 0x83: bytesToAdvance = 3; return $"TST #${ReadMemory(++pc):X2}, ${ReadMemory(++pc):X2}";
case 0x84: bytesToAdvance = 2; return $"STY ${ReadMemory(++pc):X2}";
case 0x85: bytesToAdvance = 2; return $"STA ${ReadMemory(++pc):X2}";
case 0x86: bytesToAdvance = 2; return $"STX ${ReadMemory(++pc):X2}";
case 0x87: bytesToAdvance = 2; return $"SMB0 ${ReadMemory(++pc):X2}";
case 0x88: bytesToAdvance = 1; return "DEY";
case 0x89: bytesToAdvance = 2; return string.Format("BIT #${0:X2}", ReadMemory(++pc));
case 0x89: bytesToAdvance = 2; return $"BIT #${ReadMemory(++pc):X2}";
case 0x8A: bytesToAdvance = 1; return "TXA";
case 0x8C: bytesToAdvance = 3; return string.Format("STY ${0:X4}", ReadWord(++pc));
case 0x8D: bytesToAdvance = 3; return string.Format("STA ${0:X4}", ReadWord(++pc));
case 0x8E: bytesToAdvance = 3; return string.Format("STX ${0:X4}", ReadWord(++pc));
case 0x8F: bytesToAdvance = 3; return string.Format("BBS0 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0x90: bytesToAdvance = 2; return string.Format("BCC {0}", (sbyte)ReadMemory(++pc));
case 0x91: bytesToAdvance = 2; return string.Format("STA (${0:X2}),Y", ReadMemory(++pc));
case 0x92: bytesToAdvance = 2; return string.Format("STA (${0:X2})", ReadMemory(++pc));
case 0x93: bytesToAdvance = 4; return string.Format("TST #${0:X2}, ${1:X4}", ReadMemory(++pc), ReadWord(++pc));
case 0x94: bytesToAdvance = 2; return string.Format("STY ${0:X2},X", ReadMemory(++pc));
case 0x95: bytesToAdvance = 2; return string.Format("STA ${0:X2},X", ReadMemory(++pc));
case 0x96: bytesToAdvance = 2; return string.Format("STX ${0:X2},Y", ReadMemory(++pc));
case 0x97: bytesToAdvance = 2; return string.Format("SMB1 ${0:X2}", ReadMemory(++pc));
case 0x8C: bytesToAdvance = 3; return $"STY ${ReadWord(++pc):X4}";
case 0x8D: bytesToAdvance = 3; return $"STA ${ReadWord(++pc):X4}";
case 0x8E: bytesToAdvance = 3; return $"STX ${ReadWord(++pc):X4}";
case 0x8F: bytesToAdvance = 3; return $"BBS0 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0x90: bytesToAdvance = 2; return $"BCC {(sbyte)ReadMemory(++pc)}";
case 0x91: bytesToAdvance = 2; return $"STA (${ReadMemory(++pc):X2}),Y";
case 0x92: bytesToAdvance = 2; return $"STA (${ReadMemory(++pc):X2})";
case 0x93: bytesToAdvance = 4; return $"TST #${ReadMemory(++pc):X2}, ${ReadWord(++pc):X4}";
case 0x94: bytesToAdvance = 2; return $"STY ${ReadMemory(++pc):X2},X";
case 0x95: bytesToAdvance = 2; return $"STA ${ReadMemory(++pc):X2},X";
case 0x96: bytesToAdvance = 2; return $"STX ${ReadMemory(++pc):X2},Y";
case 0x97: bytesToAdvance = 2; return $"SMB1 ${ReadMemory(++pc):X2}";
case 0x98: bytesToAdvance = 1; return "TYA";
case 0x99: bytesToAdvance = 3; return string.Format("STA ${0:X4},Y", ReadWord(++pc));
case 0x99: bytesToAdvance = 3; return $"STA ${ReadWord(++pc):X4},Y";
case 0x9A: bytesToAdvance = 1; return "TXS";
case 0x9C: bytesToAdvance = 3; return string.Format("STZ ${0:X4}", ReadWord(++pc));
case 0x9D: bytesToAdvance = 3; return string.Format("STA ${0:X4},X", ReadWord(++pc));
case 0x9E: bytesToAdvance = 3; return string.Format("STZ ${0:X4},X", ReadWord(++pc));
case 0x9F: bytesToAdvance = 3; return string.Format("BBS1 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xA0: bytesToAdvance = 2; return string.Format("LDY #${0:X2}", ReadMemory(++pc));
case 0xA1: bytesToAdvance = 2; return string.Format("LDA (${0:X2},X)", ReadMemory(++pc));
case 0xA2: bytesToAdvance = 2; return string.Format("LDX #${0:X2}", ReadMemory(++pc));
case 0xA3: bytesToAdvance = 3; return string.Format("TST #${0:X2}, ${1:X2},X", ReadMemory(++pc), ReadMemory(++pc));
case 0xA4: bytesToAdvance = 2; return string.Format("LDY ${0:X2}", ReadMemory(++pc));
case 0xA5: bytesToAdvance = 2; return string.Format("LDA ${0:X2}", ReadMemory(++pc));
case 0xA6: bytesToAdvance = 2; return string.Format("LDX ${0:X2}", ReadMemory(++pc));
case 0xA7: bytesToAdvance = 2; return string.Format("SMB2 ${0:X2}", ReadMemory(++pc));
case 0x9C: bytesToAdvance = 3; return $"STZ ${ReadWord(++pc):X4}";
case 0x9D: bytesToAdvance = 3; return $"STA ${ReadWord(++pc):X4},X";
case 0x9E: bytesToAdvance = 3; return $"STZ ${ReadWord(++pc):X4},X";
case 0x9F: bytesToAdvance = 3; return $"BBS1 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xA0: bytesToAdvance = 2; return $"LDY #${ReadMemory(++pc):X2}";
case 0xA1: bytesToAdvance = 2; return $"LDA (${ReadMemory(++pc):X2},X)";
case 0xA2: bytesToAdvance = 2; return $"LDX #${ReadMemory(++pc):X2}";
case 0xA3: bytesToAdvance = 3; return $"TST #${ReadMemory(++pc):X2}, ${ReadMemory(++pc):X2},X";
case 0xA4: bytesToAdvance = 2; return $"LDY ${ReadMemory(++pc):X2}";
case 0xA5: bytesToAdvance = 2; return $"LDA ${ReadMemory(++pc):X2}";
case 0xA6: bytesToAdvance = 2; return $"LDX ${ReadMemory(++pc):X2}";
case 0xA7: bytesToAdvance = 2; return $"SMB2 ${ReadMemory(++pc):X2}";
case 0xA8: bytesToAdvance = 1; return "TAY";
case 0xA9: bytesToAdvance = 2; return string.Format("LDA #${0:X2}", ReadMemory(++pc));
case 0xA9: bytesToAdvance = 2; return $"LDA #${ReadMemory(++pc):X2}";
case 0xAA: bytesToAdvance = 1; return "TAX";
case 0xAC: bytesToAdvance = 3; return string.Format("LDY ${0:X4}", ReadWord(++pc));
case 0xAD: bytesToAdvance = 3; return string.Format("LDA ${0:X4}", ReadWord(++pc));
case 0xAE: bytesToAdvance = 3; return string.Format("LDX ${0:X4}", ReadWord(++pc));
case 0xAF: bytesToAdvance = 3; return string.Format("BBS2 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xB0: bytesToAdvance = 2; return string.Format("BCS {0}", (sbyte)ReadMemory(++pc));
case 0xB1: bytesToAdvance = 2; return string.Format("LDA (${0:X2}),Y", ReadMemory(++pc));
case 0xB2: bytesToAdvance = 2; return string.Format("LDA (${0:X2})", ReadMemory(++pc));
case 0xB3: bytesToAdvance = 4; return string.Format("TST #${0:X2}, ${1:X4},X", ReadMemory(++pc), ReadWord(++pc));
case 0xB4: bytesToAdvance = 2; return string.Format("LDY ${0:X2},X", ReadMemory(++pc));
case 0xB5: bytesToAdvance = 2; return string.Format("LDA ${0:X2},X", ReadMemory(++pc));
case 0xB6: bytesToAdvance = 2; return string.Format("LDX ${0:X2},Y", ReadMemory(++pc));
case 0xB7: bytesToAdvance = 2; return string.Format("SMB3 ${0:X2}", ReadMemory(++pc));
case 0xAC: bytesToAdvance = 3; return $"LDY ${ReadWord(++pc):X4}";
case 0xAD: bytesToAdvance = 3; return $"LDA ${ReadWord(++pc):X4}";
case 0xAE: bytesToAdvance = 3; return $"LDX ${ReadWord(++pc):X4}";
case 0xAF: bytesToAdvance = 3; return $"BBS2 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xB0: bytesToAdvance = 2; return $"BCS {(sbyte)ReadMemory(++pc)}";
case 0xB1: bytesToAdvance = 2; return $"LDA (${ReadMemory(++pc):X2}),Y";
case 0xB2: bytesToAdvance = 2; return $"LDA (${ReadMemory(++pc):X2})";
case 0xB3: bytesToAdvance = 4; return $"TST #${ReadMemory(++pc):X2}, ${ReadWord(++pc):X4},X";
case 0xB4: bytesToAdvance = 2; return $"LDY ${ReadMemory(++pc):X2},X";
case 0xB5: bytesToAdvance = 2; return $"LDA ${ReadMemory(++pc):X2},X";
case 0xB6: bytesToAdvance = 2; return $"LDX ${ReadMemory(++pc):X2},Y";
case 0xB7: bytesToAdvance = 2; return $"SMB3 ${ReadMemory(++pc):X2}";
case 0xB8: bytesToAdvance = 1; return "CLV";
case 0xB9: bytesToAdvance = 3; return string.Format("LDA ${0:X4},Y", ReadWord(++pc));
case 0xB9: bytesToAdvance = 3; return $"LDA ${ReadWord(++pc):X4},Y";
case 0xBA: bytesToAdvance = 1; return "TSX";
case 0xBC: bytesToAdvance = 3; return string.Format("LDY ${0:X4},X", ReadWord(++pc));
case 0xBD: bytesToAdvance = 3; return string.Format("LDA ${0:X4},X", ReadWord(++pc));
case 0xBE: bytesToAdvance = 3; return string.Format("LDX ${0:X4},Y", ReadWord(++pc));
case 0xBF: bytesToAdvance = 3; return string.Format("BBS3 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xC0: bytesToAdvance = 2; return string.Format("CPY #${0:X2}", ReadMemory(++pc));
case 0xC1: bytesToAdvance = 2; return string.Format("CMP (${0:X2},X)", ReadMemory(++pc));
case 0xBC: bytesToAdvance = 3; return $"LDY ${ReadWord(++pc):X4},X";
case 0xBD: bytesToAdvance = 3; return $"LDA ${ReadWord(++pc):X4},X";
case 0xBE: bytesToAdvance = 3; return $"LDX ${ReadWord(++pc):X4},Y";
case 0xBF: bytesToAdvance = 3; return $"BBS3 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xC0: bytesToAdvance = 2; return $"CPY #${ReadMemory(++pc):X2}";
case 0xC1: bytesToAdvance = 2; return $"CMP (${ReadMemory(++pc):X2},X)";
case 0xC2: bytesToAdvance = 1; return "CLY";
case 0xC3: bytesToAdvance = 7; return string.Format("TDD {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xC4: bytesToAdvance = 2; return string.Format("CPY ${0:X2}", ReadMemory(++pc));
case 0xC5: bytesToAdvance = 2; return string.Format("CMP ${0:X2}", ReadMemory(++pc));
case 0xC6: bytesToAdvance = 2; return string.Format("DEC ${0:X2}", ReadMemory(++pc));
case 0xC7: bytesToAdvance = 2; return string.Format("SMB4 ${0:X2}", ReadMemory(++pc));
case 0xC3: bytesToAdvance = 7; return $"TDD {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xC4: bytesToAdvance = 2; return $"CPY ${ReadMemory(++pc):X2}";
case 0xC5: bytesToAdvance = 2; return $"CMP ${ReadMemory(++pc):X2}";
case 0xC6: bytesToAdvance = 2; return $"DEC ${ReadMemory(++pc):X2}";
case 0xC7: bytesToAdvance = 2; return $"SMB4 ${ReadMemory(++pc):X2}";
case 0xC8: bytesToAdvance = 1; return "INY";
case 0xC9: bytesToAdvance = 2; return string.Format("CMP #${0:X2}", ReadMemory(++pc));
case 0xC9: bytesToAdvance = 2; return $"CMP #${ReadMemory(++pc):X2}";
case 0xCA: bytesToAdvance = 1; return "DEX";
case 0xCC: bytesToAdvance = 3; return string.Format("CPY ${0:X4}", ReadWord(++pc));
case 0xCD: bytesToAdvance = 3; return string.Format("CMP ${0:X4}", ReadWord(++pc));
case 0xCE: bytesToAdvance = 3; return string.Format("DEC ${0:X4}", ReadWord(++pc));
case 0xCF: bytesToAdvance = 3; return string.Format("BBS4 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xD0: bytesToAdvance = 2; return string.Format("BNE {0}", (sbyte)ReadMemory(++pc));
case 0xD1: bytesToAdvance = 2; return string.Format("CMP (${0:X2}),Y", ReadMemory(++pc));
case 0xD2: bytesToAdvance = 2; return string.Format("CMP (${0:X2})", ReadMemory(++pc));
case 0xD3: bytesToAdvance = 7; return string.Format("TIN {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xCC: bytesToAdvance = 3; return $"CPY ${ReadWord(++pc):X4}";
case 0xCD: bytesToAdvance = 3; return $"CMP ${ReadWord(++pc):X4}";
case 0xCE: bytesToAdvance = 3; return $"DEC ${ReadWord(++pc):X4}";
case 0xCF: bytesToAdvance = 3; return $"BBS4 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xD0: bytesToAdvance = 2; return $"BNE {(sbyte)ReadMemory(++pc)}";
case 0xD1: bytesToAdvance = 2; return $"CMP (${ReadMemory(++pc):X2}),Y";
case 0xD2: bytesToAdvance = 2; return $"CMP (${ReadMemory(++pc):X2})";
case 0xD3: bytesToAdvance = 7; return $"TIN {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xD4: bytesToAdvance = 1; return "CSH";
case 0xD5: bytesToAdvance = 2; return string.Format("CMP ${0:X2},X", ReadMemory(++pc));
case 0xD6: bytesToAdvance = 2; return string.Format("DEC ${0:X2},X", ReadMemory(++pc));
case 0xD7: bytesToAdvance = 2; return string.Format("SMB5 ${0:X2}", ReadMemory(++pc));
case 0xD5: bytesToAdvance = 2; return $"CMP ${ReadMemory(++pc):X2},X";
case 0xD6: bytesToAdvance = 2; return $"DEC ${ReadMemory(++pc):X2},X";
case 0xD7: bytesToAdvance = 2; return $"SMB5 ${ReadMemory(++pc):X2}";
case 0xD8: bytesToAdvance = 1; return "CLD";
case 0xD9: bytesToAdvance = 3; return string.Format("CMP ${0:X4},Y", ReadWord(++pc));
case 0xD9: bytesToAdvance = 3; return $"CMP ${ReadWord(++pc):X4},Y";
case 0xDA: bytesToAdvance = 1; return "PHX";
case 0xDD: bytesToAdvance = 3; return string.Format("CMP ${0:X4},X", ReadWord(++pc));
case 0xDE: bytesToAdvance = 3; return string.Format("DEC ${0:X4},X", ReadWord(++pc));
case 0xDF: bytesToAdvance = 3; return string.Format("BBS5 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xE0: bytesToAdvance = 2; return string.Format("CPX #${0:X2}", ReadMemory(++pc));
case 0xE1: bytesToAdvance = 2; return string.Format("SBC (${0:X2},X)", ReadMemory(++pc));
case 0xE3: bytesToAdvance = 7; return string.Format("TIA {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xE4: bytesToAdvance = 2; return string.Format("CPX ${0:X2}", ReadMemory(++pc));
case 0xE5: bytesToAdvance = 2; return string.Format("SBC ${0:X2}", ReadMemory(++pc));
case 0xE6: bytesToAdvance = 2; return string.Format("INC ${0:X2}", ReadMemory(++pc));
case 0xE7: bytesToAdvance = 2; return string.Format("SMB6 ${0:X2}", ReadMemory(++pc));
case 0xDD: bytesToAdvance = 3; return $"CMP ${ReadWord(++pc):X4},X";
case 0xDE: bytesToAdvance = 3; return $"DEC ${ReadWord(++pc):X4},X";
case 0xDF: bytesToAdvance = 3; return $"BBS5 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xE0: bytesToAdvance = 2; return $"CPX #${ReadMemory(++pc):X2}";
case 0xE1: bytesToAdvance = 2; return $"SBC (${ReadMemory(++pc):X2},X)";
case 0xE3: bytesToAdvance = 7; return $"TIA {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xE4: bytesToAdvance = 2; return $"CPX ${ReadMemory(++pc):X2}";
case 0xE5: bytesToAdvance = 2; return $"SBC ${ReadMemory(++pc):X2}";
case 0xE6: bytesToAdvance = 2; return $"INC ${ReadMemory(++pc):X2}";
case 0xE7: bytesToAdvance = 2; return $"SMB6 ${ReadMemory(++pc):X2}";
case 0xE8: bytesToAdvance = 1; return "INX";
case 0xE9: bytesToAdvance = 2; return string.Format("SBC #${0:X2}", ReadMemory(++pc));
case 0xE9: bytesToAdvance = 2; return $"SBC #${ReadMemory(++pc):X2}";
case 0xEA: bytesToAdvance = 1; return "NOP";
case 0xEC: bytesToAdvance = 3; return string.Format("CPX ${0:X4}", ReadWord(++pc));
case 0xED: bytesToAdvance = 3; return string.Format("SBC ${0:X4}", ReadWord(++pc));
case 0xEE: bytesToAdvance = 3; return string.Format("INC ${0:X4}", ReadWord(++pc));
case 0xEF: bytesToAdvance = 3; return string.Format("BBS6 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xF0: bytesToAdvance = 2; return string.Format("BEQ {0}", (sbyte)ReadMemory(++pc));
case 0xF1: bytesToAdvance = 2; return string.Format("SBC (${0:X2}),Y", ReadMemory(++pc));
case 0xF2: bytesToAdvance = 2; return string.Format("SBC (${0:X2})", ReadMemory(++pc));
case 0xF3: bytesToAdvance = 7; return string.Format("TAI {0:X4},{1:X4},{2:X4}", ReadWord((ushort)(pc+1)),ReadWord((ushort)(pc+3)),ReadWord((ushort)(pc+5)));
case 0xEC: bytesToAdvance = 3; return $"CPX ${ReadWord(++pc):X4}";
case 0xED: bytesToAdvance = 3; return $"SBC ${ReadWord(++pc):X4}";
case 0xEE: bytesToAdvance = 3; return $"INC ${ReadWord(++pc):X4}";
case 0xEF: bytesToAdvance = 3; return $"BBS6 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
case 0xF0: bytesToAdvance = 2; return $"BEQ {(sbyte)ReadMemory(++pc)}";
case 0xF1: bytesToAdvance = 2; return $"SBC (${ReadMemory(++pc):X2}),Y";
case 0xF2: bytesToAdvance = 2; return $"SBC (${ReadMemory(++pc):X2})";
case 0xF3: bytesToAdvance = 7; return $"TAI {ReadWord((ushort)(pc + 1)):X4},{ReadWord((ushort)(pc + 3)):X4},{ReadWord((ushort)(pc + 5)):X4}";
case 0xF4: bytesToAdvance = 1; return "SET";
case 0xF5: bytesToAdvance = 2; return string.Format("SBC ${0:X2},X", ReadMemory(++pc));
case 0xF6: bytesToAdvance = 2; return string.Format("INC ${0:X2},X", ReadMemory(++pc));
case 0xF7: bytesToAdvance = 2; return string.Format("SMB7 ${0:X2}", ReadMemory(++pc));
case 0xF5: bytesToAdvance = 2; return $"SBC ${ReadMemory(++pc):X2},X";
case 0xF6: bytesToAdvance = 2; return $"INC ${ReadMemory(++pc):X2},X";
case 0xF7: bytesToAdvance = 2; return $"SMB7 ${ReadMemory(++pc):X2}";
case 0xF8: bytesToAdvance = 1; return "SED";
case 0xF9: bytesToAdvance = 3; return string.Format("SBC ${0:X4},Y", ReadWord(++pc));
case 0xF9: bytesToAdvance = 3; return $"SBC ${ReadWord(++pc):X4},Y";
case 0xFA: bytesToAdvance = 1; return "PLX";
case 0xFD: bytesToAdvance = 3; return string.Format("SBC ${0:X4},X", ReadWord(++pc));
case 0xFE: bytesToAdvance = 3; return string.Format("INC ${0:X4},X", ReadWord(++pc));
case 0xFF: bytesToAdvance = 3; return string.Format("BBS7 ${0:X2},{1}", ReadMemory(++pc), (sbyte)ReadMemory(++pc));
case 0xFD: bytesToAdvance = 3; return $"SBC ${ReadWord(++pc):X4},X";
case 0xFE: bytesToAdvance = 3; return $"INC ${ReadWord(++pc):X4},X";
case 0xFF: bytesToAdvance = 3; return $"BBS7 ${ReadMemory(++pc):X2},{(sbyte)ReadMemory(++pc)}";
}
bytesToAdvance = 1;
return "???";

View File

@ -273,11 +273,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
return new TraceInfo
{
Disassembly = string.Format(
"{3:X2}:{0:X4}: {1:X2} {2} ",
PC,
ReadMemory(PC),
Disassemble(PC, out notused), MPR[PC >> 13]).PadRight(30),
Disassembly = $"{MPR[PC >> 13]:X2}:{PC:X4}: {ReadMemory(PC):X2} {Disassemble(PC, out notused)} ".PadRight(30),
RegisterInfo = string.Join(" ",
$"A:{A:X2}",
$"X:{X:X2}",

View File

@ -563,9 +563,7 @@ namespace BizHawk.Emulation.Common.Components.LR35902
return new TraceInfo
{
Disassembly = string.Format(
"{0} ",
disassemble ? Disassemble(RegPC, ReadMemory, out notused) : "---").PadRight(40),
Disassembly = $"{(disassemble ? Disassemble(RegPC, ReadMemory, out notused) : "---")} ".PadRight(40),
RegisterInfo = string.Join(" ",
$"A:{Regs[A]:X2}",
$"F:{Regs[F]:X2}",

View File

@ -540,7 +540,7 @@ namespace BizHawk.Emulation.Common.Components.LR35902
{
byte d = reader(addr++);
bytes.Add(d);
result = result.Replace("d8", string.Format("#{0:X2}h", d));
result = result.Replace("d8", $"#{d:X2}h");
}
else if (result.Contains("d16"))
{
@ -548,7 +548,7 @@ namespace BizHawk.Emulation.Common.Components.LR35902
byte dhi = reader(addr++);
bytes.Add(dlo);
bytes.Add(dhi);
result = result.Replace("d16", string.Format("#{0:X2}{1:X2}h", dhi, dlo));
result = result.Replace("d16", $"#{dhi:X2}{dlo:X2}h");
}
else if (result.Contains("a16"))
{
@ -556,13 +556,13 @@ namespace BizHawk.Emulation.Common.Components.LR35902
byte dhi = reader(addr++);
bytes.Add(dlo);
bytes.Add(dhi);
result = result.Replace("a16", string.Format("#{0:X2}{1:X2}h", dhi, dlo));
result = result.Replace("a16", $"#{dhi:X2}{dlo:X2}h");
}
else if (result.Contains("a8"))
{
byte d = reader(addr++);
bytes.Add(d);
result = result.Replace("a8", string.Format("#FF{0:X2}h", d));
result = result.Replace("a8", $"#FF{d:X2}h");
}
else if (result.Contains("r8"))
{
@ -571,12 +571,12 @@ namespace BizHawk.Emulation.Common.Components.LR35902
int offs = d;
if (offs >= 128)
offs -= 256;
result = result.Replace("r8", string.Format("{0:X4}h", (ushort)(addr + offs)));
result = result.Replace("r8", $"{(ushort)(addr + offs):X4}h");
}
StringBuilder ret = new StringBuilder();
ret.Append(string.Format("{0:X4}: ", origaddr));
ret.Append($"{origaddr:X4}: ");
foreach (var b in bytes)
ret.Append(string.Format("{0:X2} ", b));
ret.Append($"{b:X2} ");
while (ret.Length < 17)
ret.Append(' ');
ret.Append(result);

View File

@ -479,9 +479,7 @@ namespace BizHawk.Emulation.Common.Components.MC6809
return new TraceInfo
{
Disassembly = string.Format(
"{0} ",
disassemble ? Disassemble(PC, ReadMemory, out notused) : "---").PadRight(40),
Disassembly = $"{(disassemble ? Disassemble(PC, ReadMemory, out notused) : "---")} ".PadRight(40),
RegisterInfo = string.Format(
"A:{0:X2} F:{1:X2} B:{2:X2} C:{3:X2} D:{4:X2} E:{5:X2} H:{6:X2} L:{7:X2}",

View File

@ -540,7 +540,7 @@ namespace BizHawk.Emulation.Common.Components.MC6809
{
byte d = reader(addr++);
bytes.Add(d);
result = result.Replace("d8", string.Format("#{0:X2}h", d));
result = result.Replace("d8", $"#{d:X2}h");
}
else if (result.Contains("d16"))
{
@ -548,7 +548,7 @@ namespace BizHawk.Emulation.Common.Components.MC6809
byte dhi = reader(addr++);
bytes.Add(dlo);
bytes.Add(dhi);
result = result.Replace("d16", string.Format("#{0:X2}{1:X2}h", dhi, dlo));
result = result.Replace("d16", $"#{dhi:X2}{dlo:X2}h");
}
else if (result.Contains("a16"))
{
@ -556,13 +556,13 @@ namespace BizHawk.Emulation.Common.Components.MC6809
byte dhi = reader(addr++);
bytes.Add(dlo);
bytes.Add(dhi);
result = result.Replace("a16", string.Format("#{0:X2}{1:X2}h", dhi, dlo));
result = result.Replace("a16", $"#{dhi:X2}{dlo:X2}h");
}
else if (result.Contains("a8"))
{
byte d = reader(addr++);
bytes.Add(d);
result = result.Replace("a8", string.Format("#FF{0:X2}h", d));
result = result.Replace("a8", $"#FF{d:X2}h");
}
else if (result.Contains("r8"))
{
@ -571,12 +571,12 @@ namespace BizHawk.Emulation.Common.Components.MC6809
int offs = d;
if (offs >= 128)
offs -= 256;
result = result.Replace("r8", string.Format("{0:X4}h", (ushort)(addr + offs)));
result = result.Replace("r8", $"{(ushort)(addr + offs):X4}h");
}
StringBuilder ret = new StringBuilder();
ret.Append(string.Format("{0:X4}: ", origaddr));
ret.Append($"{origaddr:X4}: ");
foreach (var b in bytes)
ret.Append(string.Format("{0:X2} ", b));
ret.Append($"{b:X2} ");
while (ret.Length < 17)
ret.Append(' ');
ret.Append(result);

View File

@ -63,185 +63,185 @@ namespace BizHawk.Emulation.Cores.Components.M6502
switch (op)
{
case 0x00: bytesToAdvance = 1; return "BRK";
case 0x01: bytesToAdvance = 2; return string.Format("ORA (${0:X2},X)", peeker(++pc));
case 0x04: bytesToAdvance = 2; return string.Format("NOP ${0:X2}", peeker(++pc));
case 0x05: bytesToAdvance = 2; return string.Format("ORA ${0:X2}", peeker(++pc));
case 0x06: bytesToAdvance = 2; return string.Format("ASL ${0:X2}", peeker(++pc));
case 0x01: bytesToAdvance = 2; return $"ORA (${peeker(++pc):X2},X)";
case 0x04: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2}";
case 0x05: bytesToAdvance = 2; return $"ORA ${peeker(++pc):X2}";
case 0x06: bytesToAdvance = 2; return $"ASL ${peeker(++pc):X2}";
case 0x08: bytesToAdvance = 1; return "PHP";
case 0x09: bytesToAdvance = 2; return string.Format("ORA #${0:X2}", peeker(++pc));
case 0x09: bytesToAdvance = 2; return $"ORA #${peeker(++pc):X2}";
case 0x0A: bytesToAdvance = 1; return "ASL A";
case 0x0C: bytesToAdvance = 3; return string.Format("NOP (${0:X4})", peeker_word(++pc, peeker));
case 0x0D: bytesToAdvance = 3; return string.Format("ORA ${0:X4}", peeker_word(++pc, peeker));
case 0x0E: bytesToAdvance = 3; return string.Format("ASL ${0:X4}", peeker_word(++pc, peeker));
case 0x10: bytesToAdvance = 2; return string.Format("BPL ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0x11: bytesToAdvance = 2; return string.Format("ORA (${0:X2}),Y *", peeker(++pc));
case 0x14: bytesToAdvance = 2; return string.Format("NOP ${0:X2},X", peeker(++pc));
case 0x15: bytesToAdvance = 2; return string.Format("ORA ${0:X2},X", peeker(++pc));
case 0x16: bytesToAdvance = 2; return string.Format("ASL ${0:X2},X", peeker(++pc));
case 0x0C: bytesToAdvance = 3; return $"NOP (${peeker_word(++pc, peeker):X4})";
case 0x0D: bytesToAdvance = 3; return $"ORA ${peeker_word(++pc, peeker):X4}";
case 0x0E: bytesToAdvance = 3; return $"ASL ${peeker_word(++pc, peeker):X4}";
case 0x10: bytesToAdvance = 2; return $"BPL ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0x11: bytesToAdvance = 2; return $"ORA (${peeker(++pc):X2}),Y *";
case 0x14: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2},X";
case 0x15: bytesToAdvance = 2; return $"ORA ${peeker(++pc):X2},X";
case 0x16: bytesToAdvance = 2; return $"ASL ${peeker(++pc):X2},X";
case 0x18: bytesToAdvance = 1; return "CLC";
case 0x19: bytesToAdvance = 3; return string.Format("ORA ${0:X4},Y *", peeker_word(++pc, peeker));
case 0x19: bytesToAdvance = 3; return $"ORA ${peeker_word(++pc, peeker):X4},Y *";
case 0x1A: bytesToAdvance = 1; return "NOP";
case 0x1C: bytesToAdvance = 2; return string.Format("NOP (${0:X2},X)", peeker(++pc));
case 0x1D: bytesToAdvance = 3; return string.Format("ORA ${0:X4},X *", peeker_word(++pc, peeker));
case 0x1E: bytesToAdvance = 3; return string.Format("ASL ${0:X4},X", peeker_word(++pc, peeker));
case 0x20: bytesToAdvance = 3; return string.Format("JSR ${0:X4}", peeker_word(++pc, peeker));
case 0x21: bytesToAdvance = 2; return string.Format("AND (${0:X2},X)", peeker(++pc));
case 0x24: bytesToAdvance = 2; return string.Format("BIT ${0:X2}", peeker(++pc));
case 0x25: bytesToAdvance = 2; return string.Format("AND ${0:X2}", peeker(++pc));
case 0x26: bytesToAdvance = 2; return string.Format("ROL ${0:X2}", peeker(++pc));
case 0x1C: bytesToAdvance = 2; return $"NOP (${peeker(++pc):X2},X)";
case 0x1D: bytesToAdvance = 3; return $"ORA ${peeker_word(++pc, peeker):X4},X *";
case 0x1E: bytesToAdvance = 3; return $"ASL ${peeker_word(++pc, peeker):X4},X";
case 0x20: bytesToAdvance = 3; return $"JSR ${peeker_word(++pc, peeker):X4}";
case 0x21: bytesToAdvance = 2; return $"AND (${peeker(++pc):X2},X)";
case 0x24: bytesToAdvance = 2; return $"BIT ${peeker(++pc):X2}";
case 0x25: bytesToAdvance = 2; return $"AND ${peeker(++pc):X2}";
case 0x26: bytesToAdvance = 2; return $"ROL ${peeker(++pc):X2}";
case 0x28: bytesToAdvance = 1; return "PLP";
case 0x29: bytesToAdvance = 2; return string.Format("AND #${0:X2}", peeker(++pc));
case 0x29: bytesToAdvance = 2; return $"AND #${peeker(++pc):X2}";
case 0x2A: bytesToAdvance = 1; return "ROL A";
case 0x2C: bytesToAdvance = 3; return string.Format("BIT ${0:X4}", peeker_word(++pc, peeker));
case 0x2D: bytesToAdvance = 3; return string.Format("AND ${0:X4}", peeker_word(++pc, peeker));
case 0x2E: bytesToAdvance = 3; return string.Format("ROL ${0:X4}", peeker_word(++pc, peeker));
case 0x30: bytesToAdvance = 2; return string.Format("BMI ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0x31: bytesToAdvance = 2; return string.Format("AND (${0:X2}),Y *", peeker(++pc));
case 0x34: bytesToAdvance = 2; return string.Format("NOP ${0:X2},X", peeker(++pc));
case 0x35: bytesToAdvance = 2; return string.Format("AND ${0:X2},X", peeker(++pc));
case 0x36: bytesToAdvance = 2; return string.Format("ROL ${0:X2},X", peeker(++pc));
case 0x2C: bytesToAdvance = 3; return $"BIT ${peeker_word(++pc, peeker):X4}";
case 0x2D: bytesToAdvance = 3; return $"AND ${peeker_word(++pc, peeker):X4}";
case 0x2E: bytesToAdvance = 3; return $"ROL ${peeker_word(++pc, peeker):X4}";
case 0x30: bytesToAdvance = 2; return $"BMI ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0x31: bytesToAdvance = 2; return $"AND (${peeker(++pc):X2}),Y *";
case 0x34: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2},X";
case 0x35: bytesToAdvance = 2; return $"AND ${peeker(++pc):X2},X";
case 0x36: bytesToAdvance = 2; return $"ROL ${peeker(++pc):X2},X";
case 0x38: bytesToAdvance = 1; return "SEC";
case 0x39: bytesToAdvance = 3; return string.Format("AND ${0:X4},Y *", peeker_word(++pc, peeker));
case 0x39: bytesToAdvance = 3; return $"AND ${peeker_word(++pc, peeker):X4},Y *";
case 0x3A: bytesToAdvance = 1; return "NOP";
case 0x3C: bytesToAdvance = 2; return string.Format("NOP (${0:X2},X)", peeker(++pc));
case 0x3D: bytesToAdvance = 3; return string.Format("AND ${0:X4},X *", peeker_word(++pc, peeker));
case 0x3E: bytesToAdvance = 3; return string.Format("ROL ${0:X4},X", peeker_word(++pc, peeker));
case 0x3C: bytesToAdvance = 2; return $"NOP (${peeker(++pc):X2},X)";
case 0x3D: bytesToAdvance = 3; return $"AND ${peeker_word(++pc, peeker):X4},X *";
case 0x3E: bytesToAdvance = 3; return $"ROL ${peeker_word(++pc, peeker):X4},X";
case 0x40: bytesToAdvance = 1; return "RTI";
case 0x41: bytesToAdvance = 2; return string.Format("EOR (${0:X2},X)", peeker(++pc));
case 0x44: bytesToAdvance = 2; return string.Format("NOP ${0:X2}", peeker(++pc));
case 0x45: bytesToAdvance = 2; return string.Format("EOR ${0:X2}", peeker(++pc));
case 0x46: bytesToAdvance = 2; return string.Format("LSR ${0:X2}", peeker(++pc));
case 0x41: bytesToAdvance = 2; return $"EOR (${peeker(++pc):X2},X)";
case 0x44: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2}";
case 0x45: bytesToAdvance = 2; return $"EOR ${peeker(++pc):X2}";
case 0x46: bytesToAdvance = 2; return $"LSR ${peeker(++pc):X2}";
case 0x48: bytesToAdvance = 1; return "PHA";
case 0x49: bytesToAdvance = 2; return string.Format("EOR #${0:X2}", peeker(++pc));
case 0x49: bytesToAdvance = 2; return $"EOR #${peeker(++pc):X2}";
case 0x4A: bytesToAdvance = 1; return "LSR A";
case 0x4C: bytesToAdvance = 3; return string.Format("JMP ${0:X4}", peeker_word(++pc, peeker));
case 0x4D: bytesToAdvance = 3; return string.Format("EOR ${0:X4}", peeker_word(++pc, peeker));
case 0x4E: bytesToAdvance = 3; return string.Format("LSR ${0:X4}", peeker_word(++pc, peeker));
case 0x50: bytesToAdvance = 2; return string.Format("BVC ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0x51: bytesToAdvance = 2; return string.Format("EOR (${0:X2}),Y *", peeker(++pc));
case 0x54: bytesToAdvance = 2; return string.Format("NOP ${0:X2},X", peeker(++pc));
case 0x55: bytesToAdvance = 2; return string.Format("EOR ${0:X2},X", peeker(++pc));
case 0x56: bytesToAdvance = 2; return string.Format("LSR ${0:X2},X", peeker(++pc));
case 0x4C: bytesToAdvance = 3; return $"JMP ${peeker_word(++pc, peeker):X4}";
case 0x4D: bytesToAdvance = 3; return $"EOR ${peeker_word(++pc, peeker):X4}";
case 0x4E: bytesToAdvance = 3; return $"LSR ${peeker_word(++pc, peeker):X4}";
case 0x50: bytesToAdvance = 2; return $"BVC ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0x51: bytesToAdvance = 2; return $"EOR (${peeker(++pc):X2}),Y *";
case 0x54: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2},X";
case 0x55: bytesToAdvance = 2; return $"EOR ${peeker(++pc):X2},X";
case 0x56: bytesToAdvance = 2; return $"LSR ${peeker(++pc):X2},X";
case 0x58: bytesToAdvance = 1; return "CLI";
case 0x59: bytesToAdvance = 3; return string.Format("EOR ${0:X4},Y *", peeker_word(++pc, peeker));
case 0x59: bytesToAdvance = 3; return $"EOR ${peeker_word(++pc, peeker):X4},Y *";
case 0x5A: bytesToAdvance = 1; return "NOP";
case 0x5C: bytesToAdvance = 2; return string.Format("NOP (${0:X2},X)", peeker(++pc));
case 0x5D: bytesToAdvance = 3; return string.Format("EOR ${0:X4},X *", peeker_word(++pc, peeker));
case 0x5E: bytesToAdvance = 3; return string.Format("LSR ${0:X4},X", peeker_word(++pc, peeker));
case 0x5C: bytesToAdvance = 2; return $"NOP (${peeker(++pc):X2},X)";
case 0x5D: bytesToAdvance = 3; return $"EOR ${peeker_word(++pc, peeker):X4},X *";
case 0x5E: bytesToAdvance = 3; return $"LSR ${peeker_word(++pc, peeker):X4},X";
case 0x60: bytesToAdvance = 1; return "RTS";
case 0x61: bytesToAdvance = 2; return string.Format("ADC (${0:X2},X)", peeker(++pc));
case 0x64: bytesToAdvance = 2; return string.Format("NOP ${0:X2}", peeker(++pc));
case 0x65: bytesToAdvance = 2; return string.Format("ADC ${0:X2}", peeker(++pc));
case 0x66: bytesToAdvance = 2; return string.Format("ROR ${0:X2}", peeker(++pc));
case 0x61: bytesToAdvance = 2; return $"ADC (${peeker(++pc):X2},X)";
case 0x64: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2}";
case 0x65: bytesToAdvance = 2; return $"ADC ${peeker(++pc):X2}";
case 0x66: bytesToAdvance = 2; return $"ROR ${peeker(++pc):X2}";
case 0x68: bytesToAdvance = 1; return "PLA";
case 0x69: bytesToAdvance = 2; return string.Format("ADC #${0:X2}", peeker(++pc));
case 0x69: bytesToAdvance = 2; return $"ADC #${peeker(++pc):X2}";
case 0x6A: bytesToAdvance = 1; return "ROR A";
case 0x6C: bytesToAdvance = 3; return string.Format("JMP (${0:X4})", peeker_word(++pc, peeker));
case 0x6D: bytesToAdvance = 3; return string.Format("ADC ${0:X4}", peeker_word(++pc, peeker));
case 0x6E: bytesToAdvance = 3; return string.Format("ROR ${0:X4}", peeker_word(++pc, peeker));
case 0x70: bytesToAdvance = 2; return string.Format("BVS ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0x71: bytesToAdvance = 2; return string.Format("ADC (${0:X2}),Y *", peeker(++pc));
case 0x74: bytesToAdvance = 2; return string.Format("NOP ${0:X2},X", peeker(++pc));
case 0x75: bytesToAdvance = 2; return string.Format("ADC ${0:X2},X", peeker(++pc));
case 0x76: bytesToAdvance = 2; return string.Format("ROR ${0:X2},X", peeker(++pc));
case 0x6C: bytesToAdvance = 3; return $"JMP (${peeker_word(++pc, peeker):X4})";
case 0x6D: bytesToAdvance = 3; return $"ADC ${peeker_word(++pc, peeker):X4}";
case 0x6E: bytesToAdvance = 3; return $"ROR ${peeker_word(++pc, peeker):X4}";
case 0x70: bytesToAdvance = 2; return $"BVS ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0x71: bytesToAdvance = 2; return $"ADC (${peeker(++pc):X2}),Y *";
case 0x74: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2},X";
case 0x75: bytesToAdvance = 2; return $"ADC ${peeker(++pc):X2},X";
case 0x76: bytesToAdvance = 2; return $"ROR ${peeker(++pc):X2},X";
case 0x78: bytesToAdvance = 1; return "SEI";
case 0x79: bytesToAdvance = 3; return string.Format("ADC ${0:X4},Y *", peeker_word(++pc, peeker));
case 0x79: bytesToAdvance = 3; return $"ADC ${peeker_word(++pc, peeker):X4},Y *";
case 0x7A: bytesToAdvance = 1; return "NOP";
case 0x7C: bytesToAdvance = 2; return string.Format("NOP (${0:X2},X)", peeker(++pc));
case 0x7D: bytesToAdvance = 3; return string.Format("ADC ${0:X4},X *", peeker_word(++pc, peeker));
case 0x7E: bytesToAdvance = 3; return string.Format("ROR ${0:X4},X", peeker_word(++pc, peeker));
case 0x80: bytesToAdvance = 2; return string.Format("NOP #${0:X2}", peeker(++pc));
case 0x81: bytesToAdvance = 2; return string.Format("STA (${0:X2},X)", peeker(++pc));
case 0x82: bytesToAdvance = 2; return string.Format("NOP #${0:X2}", peeker(++pc));
case 0x84: bytesToAdvance = 2; return string.Format("STY ${0:X2}", peeker(++pc));
case 0x85: bytesToAdvance = 2; return string.Format("STA ${0:X2}", peeker(++pc));
case 0x86: bytesToAdvance = 2; return string.Format("STX ${0:X2}", peeker(++pc));
case 0x7C: bytesToAdvance = 2; return $"NOP (${peeker(++pc):X2},X)";
case 0x7D: bytesToAdvance = 3; return $"ADC ${peeker_word(++pc, peeker):X4},X *";
case 0x7E: bytesToAdvance = 3; return $"ROR ${peeker_word(++pc, peeker):X4},X";
case 0x80: bytesToAdvance = 2; return $"NOP #${peeker(++pc):X2}";
case 0x81: bytesToAdvance = 2; return $"STA (${peeker(++pc):X2},X)";
case 0x82: bytesToAdvance = 2; return $"NOP #${peeker(++pc):X2}";
case 0x84: bytesToAdvance = 2; return $"STY ${peeker(++pc):X2}";
case 0x85: bytesToAdvance = 2; return $"STA ${peeker(++pc):X2}";
case 0x86: bytesToAdvance = 2; return $"STX ${peeker(++pc):X2}";
case 0x88: bytesToAdvance = 1; return "DEY";
case 0x89: bytesToAdvance = 2; return string.Format("NOP #${0:X2}", peeker(++pc));
case 0x89: bytesToAdvance = 2; return $"NOP #${peeker(++pc):X2}";
case 0x8A: bytesToAdvance = 1; return "TXA";
case 0x8C: bytesToAdvance = 3; return string.Format("STY ${0:X4}", peeker_word(++pc, peeker));
case 0x8D: bytesToAdvance = 3; return string.Format("STA ${0:X4}", peeker_word(++pc, peeker));
case 0x8E: bytesToAdvance = 3; return string.Format("STX ${0:X4}", peeker_word(++pc, peeker));
case 0x90: bytesToAdvance = 2; return string.Format("BCC ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0x91: bytesToAdvance = 2; return string.Format("STA (${0:X2}),Y", peeker(++pc));
case 0x94: bytesToAdvance = 2; return string.Format("STY ${0:X2},X", peeker(++pc));
case 0x95: bytesToAdvance = 2; return string.Format("STA ${0:X2},X", peeker(++pc));
case 0x96: bytesToAdvance = 2; return string.Format("STX ${0:X2},Y", peeker(++pc));
case 0x8C: bytesToAdvance = 3; return $"STY ${peeker_word(++pc, peeker):X4}";
case 0x8D: bytesToAdvance = 3; return $"STA ${peeker_word(++pc, peeker):X4}";
case 0x8E: bytesToAdvance = 3; return $"STX ${peeker_word(++pc, peeker):X4}";
case 0x90: bytesToAdvance = 2; return $"BCC ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0x91: bytesToAdvance = 2; return $"STA (${peeker(++pc):X2}),Y";
case 0x94: bytesToAdvance = 2; return $"STY ${peeker(++pc):X2},X";
case 0x95: bytesToAdvance = 2; return $"STA ${peeker(++pc):X2},X";
case 0x96: bytesToAdvance = 2; return $"STX ${peeker(++pc):X2},Y";
case 0x98: bytesToAdvance = 1; return "TYA";
case 0x99: bytesToAdvance = 3; return string.Format("STA ${0:X4},Y", peeker_word(++pc, peeker));
case 0x99: bytesToAdvance = 3; return $"STA ${peeker_word(++pc, peeker):X4},Y";
case 0x9A: bytesToAdvance = 1; return "TXS";
case 0x9D: bytesToAdvance = 3; return string.Format("STA ${0:X4},X", peeker_word(++pc, peeker));
case 0xA0: bytesToAdvance = 2; return string.Format("LDY #${0:X2}", peeker(++pc));
case 0xA1: bytesToAdvance = 2; return string.Format("LDA (${0:X2},X)", peeker(++pc));
case 0xA2: bytesToAdvance = 2; return string.Format("LDX #${0:X2}", peeker(++pc));
case 0xA4: bytesToAdvance = 2; return string.Format("LDY ${0:X2}", peeker(++pc));
case 0xA5: bytesToAdvance = 2; return string.Format("LDA ${0:X2}", peeker(++pc));
case 0xA6: bytesToAdvance = 2; return string.Format("LDX ${0:X2}", peeker(++pc));
case 0x9D: bytesToAdvance = 3; return $"STA ${peeker_word(++pc, peeker):X4},X";
case 0xA0: bytesToAdvance = 2; return $"LDY #${peeker(++pc):X2}";
case 0xA1: bytesToAdvance = 2; return $"LDA (${peeker(++pc):X2},X)";
case 0xA2: bytesToAdvance = 2; return $"LDX #${peeker(++pc):X2}";
case 0xA4: bytesToAdvance = 2; return $"LDY ${peeker(++pc):X2}";
case 0xA5: bytesToAdvance = 2; return $"LDA ${peeker(++pc):X2}";
case 0xA6: bytesToAdvance = 2; return $"LDX ${peeker(++pc):X2}";
case 0xA8: bytesToAdvance = 1; return "TAY";
case 0xA9: bytesToAdvance = 2; return string.Format("LDA #${0:X2}", peeker(++pc));
case 0xA9: bytesToAdvance = 2; return $"LDA #${peeker(++pc):X2}";
case 0xAA: bytesToAdvance = 1; return "TAX";
case 0xAC: bytesToAdvance = 3; return string.Format("LDY ${0:X4}", peeker_word(++pc, peeker));
case 0xAD: bytesToAdvance = 3; return string.Format("LDA ${0:X4}", peeker_word(++pc, peeker));
case 0xAE: bytesToAdvance = 3; return string.Format("LDX ${0:X4}", peeker_word(++pc, peeker));
case 0xB0: bytesToAdvance = 2; return string.Format("BCS ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0xB1: bytesToAdvance = 2; return string.Format("LDA (${0:X2}),Y *", peeker(++pc));
case 0xB3: bytesToAdvance = 2; return string.Format("LAX (${0:X2}),Y *", peeker(++pc));
case 0xB4: bytesToAdvance = 2; return string.Format("LDY ${0:X2},X", peeker(++pc));
case 0xB5: bytesToAdvance = 2; return string.Format("LDA ${0:X2},X", peeker(++pc));
case 0xB6: bytesToAdvance = 2; return string.Format("LDX ${0:X2},Y", peeker(++pc));
case 0xAC: bytesToAdvance = 3; return $"LDY ${peeker_word(++pc, peeker):X4}";
case 0xAD: bytesToAdvance = 3; return $"LDA ${peeker_word(++pc, peeker):X4}";
case 0xAE: bytesToAdvance = 3; return $"LDX ${peeker_word(++pc, peeker):X4}";
case 0xB0: bytesToAdvance = 2; return $"BCS ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0xB1: bytesToAdvance = 2; return $"LDA (${peeker(++pc):X2}),Y *";
case 0xB3: bytesToAdvance = 2; return $"LAX (${peeker(++pc):X2}),Y *";
case 0xB4: bytesToAdvance = 2; return $"LDY ${peeker(++pc):X2},X";
case 0xB5: bytesToAdvance = 2; return $"LDA ${peeker(++pc):X2},X";
case 0xB6: bytesToAdvance = 2; return $"LDX ${peeker(++pc):X2},Y";
case 0xB8: bytesToAdvance = 1; return "CLV";
case 0xB9: bytesToAdvance = 3; return string.Format("LDA ${0:X4},Y *", peeker_word(++pc, peeker));
case 0xB9: bytesToAdvance = 3; return $"LDA ${peeker_word(++pc, peeker):X4},Y *";
case 0xBA: bytesToAdvance = 1; return "TSX";
case 0xBC: bytesToAdvance = 3; return string.Format("LDY ${0:X4},X *", peeker_word(++pc, peeker));
case 0xBD: bytesToAdvance = 3; return string.Format("LDA ${0:X4},X *", peeker_word(++pc, peeker));
case 0xBE: bytesToAdvance = 3; return string.Format("LDX ${0:X4},Y *", peeker_word(++pc, peeker));
case 0xC0: bytesToAdvance = 2; return string.Format("CPY #${0:X2}", peeker(++pc));
case 0xC1: bytesToAdvance = 2; return string.Format("CMP (${0:X2},X)", peeker(++pc));
case 0xC2: bytesToAdvance = 2; return string.Format("NOP #${0:X2}", peeker(++pc));
case 0xC4: bytesToAdvance = 2; return string.Format("CPY ${0:X2}", peeker(++pc));
case 0xC5: bytesToAdvance = 2; return string.Format("CMP ${0:X2}", peeker(++pc));
case 0xC6: bytesToAdvance = 2; return string.Format("DEC ${0:X2}", peeker(++pc));
case 0xBC: bytesToAdvance = 3; return $"LDY ${peeker_word(++pc, peeker):X4},X *";
case 0xBD: bytesToAdvance = 3; return $"LDA ${peeker_word(++pc, peeker):X4},X *";
case 0xBE: bytesToAdvance = 3; return $"LDX ${peeker_word(++pc, peeker):X4},Y *";
case 0xC0: bytesToAdvance = 2; return $"CPY #${peeker(++pc):X2}";
case 0xC1: bytesToAdvance = 2; return $"CMP (${peeker(++pc):X2},X)";
case 0xC2: bytesToAdvance = 2; return $"NOP #${peeker(++pc):X2}";
case 0xC4: bytesToAdvance = 2; return $"CPY ${peeker(++pc):X2}";
case 0xC5: bytesToAdvance = 2; return $"CMP ${peeker(++pc):X2}";
case 0xC6: bytesToAdvance = 2; return $"DEC ${peeker(++pc):X2}";
case 0xC8: bytesToAdvance = 1; return "INY";
case 0xC9: bytesToAdvance = 2; return string.Format("CMP #${0:X2}", peeker(++pc));
case 0xC9: bytesToAdvance = 2; return $"CMP #${peeker(++pc):X2}";
case 0xCA: bytesToAdvance = 1; return "DEX";
case 0xCB: bytesToAdvance = 2; return string.Format("AXS ${0:X2}", peeker(++pc));
case 0xCC: bytesToAdvance = 3; return string.Format("CPY ${0:X4}", peeker_word(++pc, peeker));
case 0xCD: bytesToAdvance = 3; return string.Format("CMP ${0:X4}", peeker_word(++pc, peeker));
case 0xCE: bytesToAdvance = 3; return string.Format("DEC ${0:X4}", peeker_word(++pc, peeker));
case 0xD0: bytesToAdvance = 2; return string.Format("BNE ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0xD1: bytesToAdvance = 2; return string.Format("CMP (${0:X2}),Y *", peeker(++pc));
case 0xD4: bytesToAdvance = 2; return string.Format("NOP ${0:X2},X", peeker(++pc));
case 0xD5: bytesToAdvance = 2; return string.Format("CMP ${0:X2},X", peeker(++pc));
case 0xD6: bytesToAdvance = 2; return string.Format("DEC ${0:X2},X", peeker(++pc));
case 0xCB: bytesToAdvance = 2; return $"AXS ${peeker(++pc):X2}";
case 0xCC: bytesToAdvance = 3; return $"CPY ${peeker_word(++pc, peeker):X4}";
case 0xCD: bytesToAdvance = 3; return $"CMP ${peeker_word(++pc, peeker):X4}";
case 0xCE: bytesToAdvance = 3; return $"DEC ${peeker_word(++pc, peeker):X4}";
case 0xD0: bytesToAdvance = 2; return $"BNE ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0xD1: bytesToAdvance = 2; return $"CMP (${peeker(++pc):X2}),Y *";
case 0xD4: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2},X";
case 0xD5: bytesToAdvance = 2; return $"CMP ${peeker(++pc):X2},X";
case 0xD6: bytesToAdvance = 2; return $"DEC ${peeker(++pc):X2},X";
case 0xD8: bytesToAdvance = 1; return "CLD";
case 0xD9: bytesToAdvance = 3; return string.Format("CMP ${0:X4},Y *", peeker_word(++pc, peeker));
case 0xD9: bytesToAdvance = 3; return $"CMP ${peeker_word(++pc, peeker):X4},Y *";
case 0xDA: bytesToAdvance = 1; return "NOP";
case 0xDC: bytesToAdvance = 2; return string.Format("NOP (${0:X2},X)", peeker(++pc));
case 0xDD: bytesToAdvance = 3; return string.Format("CMP ${0:X4},X *", peeker_word(++pc, peeker));
case 0xDE: bytesToAdvance = 3; return string.Format("DEC ${0:X4},X", peeker_word(++pc, peeker));
case 0xE0: bytesToAdvance = 2; return string.Format("CPX #${0:X2}", peeker(++pc));
case 0xE1: bytesToAdvance = 2; return string.Format("SBC (${0:X2},X)", peeker(++pc));
case 0xE2: bytesToAdvance = 2; return string.Format("NOP #${0:X2}", peeker(++pc));
case 0xE4: bytesToAdvance = 2; return string.Format("CPX ${0:X2}", peeker(++pc));
case 0xE5: bytesToAdvance = 2; return string.Format("SBC ${0:X2}", peeker(++pc));
case 0xE6: bytesToAdvance = 2; return string.Format("INC ${0:X2}", peeker(++pc));
case 0xDC: bytesToAdvance = 2; return $"NOP (${peeker(++pc):X2},X)";
case 0xDD: bytesToAdvance = 3; return $"CMP ${peeker_word(++pc, peeker):X4},X *";
case 0xDE: bytesToAdvance = 3; return $"DEC ${peeker_word(++pc, peeker):X4},X";
case 0xE0: bytesToAdvance = 2; return $"CPX #${peeker(++pc):X2}";
case 0xE1: bytesToAdvance = 2; return $"SBC (${peeker(++pc):X2},X)";
case 0xE2: bytesToAdvance = 2; return $"NOP #${peeker(++pc):X2}";
case 0xE4: bytesToAdvance = 2; return $"CPX ${peeker(++pc):X2}";
case 0xE5: bytesToAdvance = 2; return $"SBC ${peeker(++pc):X2}";
case 0xE6: bytesToAdvance = 2; return $"INC ${peeker(++pc):X2}";
case 0xE8: bytesToAdvance = 1; return "INX";
case 0xE9: bytesToAdvance = 2; return string.Format("SBC #${0:X2}", peeker(++pc));
case 0xE9: bytesToAdvance = 2; return $"SBC #${peeker(++pc):X2}";
case 0xEA: bytesToAdvance = 1; return "NOP";
case 0xEC: bytesToAdvance = 3; return string.Format("CPX ${0:X4}", peeker_word(++pc, peeker));
case 0xED: bytesToAdvance = 3; return string.Format("SBC ${0:X4}", peeker_word(++pc, peeker));
case 0xEE: bytesToAdvance = 3; return string.Format("INC ${0:X4}", peeker_word(++pc, peeker));
case 0xF0: bytesToAdvance = 2; return string.Format("BEQ ${0:X4}", pc + 2 + (sbyte)peeker(++pc));
case 0xF1: bytesToAdvance = 2; return string.Format("SBC (${0:X2}),Y *", peeker(++pc));
case 0xF4: bytesToAdvance = 2; return string.Format("NOP ${0:X2},X", peeker(++pc));
case 0xF5: bytesToAdvance = 2; return string.Format("SBC ${0:X2},X", peeker(++pc));
case 0xF6: bytesToAdvance = 2; return string.Format("INC ${0:X2},X", peeker(++pc));
case 0xEC: bytesToAdvance = 3; return $"CPX ${peeker_word(++pc, peeker):X4}";
case 0xED: bytesToAdvance = 3; return $"SBC ${peeker_word(++pc, peeker):X4}";
case 0xEE: bytesToAdvance = 3; return $"INC ${peeker_word(++pc, peeker):X4}";
case 0xF0: bytesToAdvance = 2; return $"BEQ ${pc + 2 + (sbyte)peeker(++pc):X4}";
case 0xF1: bytesToAdvance = 2; return $"SBC (${peeker(++pc):X2}),Y *";
case 0xF4: bytesToAdvance = 2; return $"NOP ${peeker(++pc):X2},X";
case 0xF5: bytesToAdvance = 2; return $"SBC ${peeker(++pc):X2},X";
case 0xF6: bytesToAdvance = 2; return $"INC ${peeker(++pc):X2},X";
case 0xF8: bytesToAdvance = 1; return "SED";
case 0xF9: bytesToAdvance = 3; return string.Format("SBC ${0:X4},Y *", peeker_word(++pc, peeker));
case 0xF9: bytesToAdvance = 3; return $"SBC ${peeker_word(++pc, peeker):X4},Y *";
case 0xFA: bytesToAdvance = 1; return "NOP";
case 0xFC: bytesToAdvance = 2; return string.Format("NOP (${0:X2},X)", peeker(++pc));
case 0xFD: bytesToAdvance = 3; return string.Format("SBC ${0:X4},X *", peeker_word(++pc, peeker));
case 0xFE: bytesToAdvance = 3; return string.Format("INC ${0:X4},X", peeker_word(++pc, peeker));
case 0xFC: bytesToAdvance = 2; return $"NOP (${peeker(++pc):X2},X)";
case 0xFD: bytesToAdvance = 3; return $"SBC ${peeker_word(++pc, peeker):X4},X *";
case 0xFE: bytesToAdvance = 3; return $"INC ${peeker_word(++pc, peeker):X4},X";
}
bytesToAdvance = 1;
return "???";

View File

@ -65,14 +65,12 @@ namespace BizHawk.Emulation.Cores.Components.M6502
for (int i = 0; i < length; i++)
{
rawbytes += string.Format(" {0:X2}", _link.PeekMemory((ushort)(PC + i)));
rawbytes += $" {_link.PeekMemory((ushort)(PC + i)):X2}";
}
return new TraceInfo
{
Disassembly = string.Format(
"{0:X4}: {1,-9} {2} ",
PC, rawbytes, disasm).PadRight(32),
Disassembly = $"{PC:X4}: {rawbytes,-9} {disasm} ".PadRight(32),
RegisterInfo = string.Format(
"A:{0:X2} X:{1:X2} Y:{2:X2} SP:{4:X2} P:{3:X2} {6} Cy:{5} PPU-Cy:{8}",
A, X, Y, P, S, TotalExecutedCycles,

View File

@ -256,49 +256,49 @@ namespace BizHawk.Emulation.Cores.Components.W65816
{
// Absolute
case 0x0C:case 0x0D:case 0x0E:case 0x1C:case 0x20:case 0x2C:case 0x2D:case 0x2E:case 0x4C:case 0x4D:case 0x4E:case 0x6D:case 0x6E:case 0x8C:case 0x8D:case 0x8E:case 0x9C:case 0xAC:case 0xAD:case 0xAE:case 0xCC:case 0xCD:case 0xCE:case 0xEC:case 0xED:case 0xEE:
pbuf = string.Format("${0:X4}", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"${peek(addr + 1) + peek(addr + 2) * 256:X4}";
//sprintf(pbuf, "$%04X", mem[1] + mem[2] * 256);
offset = 3;
break;
// Absolute Indexed Indirect
case 0x7C:case 0xFC:
pbuf = string.Format("(${0:X4},X", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"(${peek(addr + 1) + peek(addr + 2) * 256:X4},X";
//sprintf(pbuf, "($%04X,X)", mem[1] + mem[2] * 256);
offset = 3;
break;
// Absolute Indexed, X
case 0x1D:case 0x1E:case 0x3C:case 0x3D:case 0x3E:case 0x5D:case 0x5E:case 0x7D:case 0x7E:case 0x9D:case 0x9E:case 0xBC:case 0xBD:case 0xDD:case 0xDE:case 0xFD:case 0xFE:
pbuf = string.Format("${0:X4},X", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"${peek(addr + 1) + peek(addr + 2) * 256:X4},X";
//sprintf(pbuf, "$%04X,X", mem[1] + mem[2] * 256);
offset = 3;
break;
// Absolute Indexed, Y
case 0x19:case 0x39:case 0x59:case 0x79:case 0x99:case 0xB9:case 0xBE:case 0xD9:case 0xF9:
pbuf = string.Format("${0:X4},Y", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"${peek(addr + 1) + peek(addr + 2) * 256:X4},Y";
//sprintf(pbuf, "$%04X,Y", mem[1] + mem[2] * 256);
offset = 3;
break;
// Absolute Indirect
case 0x6C:
pbuf = string.Format("(${0:X4})", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"(${peek(addr + 1) + peek(addr + 2) * 256:X4})";
//sprintf(pbuf, "($%04X)", mem[1] + mem[2] * 256);
offset = 3;
break;
// Absolute Indirect Long
case 0xDC:
pbuf = string.Format("[${0:X4}]", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"[${peek(addr + 1) + peek(addr + 2) * 256:X4}]";
//sprintf(pbuf, "[$%04X]", mem[1] + mem[2] * 256);
offset = 3;
break;
// Absolute Long
case 0x0F:case 0x22:case 0x2F:case 0x4F:case 0x5C:case 0x6F:case 0x8F:case 0xAF:case 0xCF:case 0xEF:
pbuf = string.Format("${0:X6}", peek(addr + 1) + peek(addr + 2) * 256 + peek(addr + 3) * 65536);
pbuf = $"${peek(addr + 1) + peek(addr + 2) * 256 + peek(addr + 3) * 65536:X6}";
//sprintf(pbuf, "$%06X", mem[1] + mem[2] * 256 + mem[3] * 65536);
offset = 4;
break;
// Absolute Long Indexed, X
case 0x1F:case 0x3F:case 0x5F:case 0x7F:case 0x9F:case 0xBF:case 0xDF:case 0xFF:
pbuf = string.Format("${0:X6},X", peek(addr + 1) + peek(addr + 2) * 256 + peek(addr + 3) * 65536);
pbuf = $"${peek(addr + 1) + peek(addr + 2) * 256 + peek(addr + 3) * 65536:X6},X";
//sprintf(pbuf, "$%06X,X", mem[1] + mem[2] * 256 + mem[3] * 65536);
offset = 4;
break;
@ -315,49 +315,49 @@ namespace BizHawk.Emulation.Cores.Components.W65816
break;
// Direct Page
case 0x04:case 0x05:case 0x06:case 0x14:case 0x24:case 0x25:case 0x26:case 0x45:case 0x46:case 0x64:case 0x65:case 0x66:case 0x84:case 0x85:case 0x86:case 0xA4:case 0xA5:case 0xA6:case 0xC4:case 0xC5:case 0xC6:case 0xE4:case 0xE5:case 0xE6:
pbuf = string.Format("${0:X2}", peek(addr + 1));
pbuf = $"${peek(addr + 1):X2}";
//sprintf(pbuf, "$%02X", mem[1]);
offset = 2;
break;
// Direct Page Indexed, X
case 0x15:case 0x16:case 0x34:case 0x35:case 0x36:case 0x55:case 0x56:case 0x74:case 0x75:case 0x76:case 0x94:case 0x95:case 0xB4:case 0xB5:case 0xD5:case 0xD6:case 0xF5:case 0xF6:
pbuf = string.Format("${0:X2},X", peek(addr + 1));
pbuf = $"${peek(addr + 1):X2},X";
//sprintf(pbuf, "$%02X,X", mem[1]);
offset = 2;
break;
// Direct Page Indexed, Y
case 0x96:case 0xB6:
pbuf = string.Format("${0:X2},Y", peek(addr + 1));
pbuf = $"${peek(addr + 1):X2},Y";
//sprintf(pbuf, "$%02X,Y", mem[1]);
offset = 2;
break;
// Direct Page Indirect
case 0x12:case 0x32:case 0x52:case 0x72:case 0x92:case 0xB2:case 0xD2:case 0xF2:
pbuf = string.Format("(${0:X2})", peek(addr + 1));
pbuf = $"(${peek(addr + 1):X2})";
//sprintf(pbuf, "($%02X)", mem[1]);
offset = 2;
break;
// Direct Page Indirect Long
case 0x07:case 0x27:case 0x47:case 0x67:case 0x87:case 0xA7:case 0xC7:case 0xE7:
pbuf = string.Format("[${0:X2}]", peek(addr + 1));
pbuf = $"[${peek(addr + 1):X2}]";
//sprintf(pbuf, "[$%02X]", mem[1]);
offset = 2;
break;
// Direct Page Indexed Indirect, X
case 0x01:case 0x21:case 0x41:case 0x61:case 0x81:case 0xA1:case 0xC1:case 0xE1:
pbuf = string.Format("(${0:X2},X)", peek(addr + 1));
pbuf = $"(${peek(addr + 1):X2},X)";
//sprintf(pbuf, "($%02X,X)", mem[1]);
offset = 2;
break;
// Direct Page Indirect Indexed, Y
case 0x11:case 0x31:case 0x51:case 0x71:case 0x91:case 0xB1:case 0xD1:case 0xF1:
pbuf = string.Format("(${0:X2},Y)", peek(addr + 1));
pbuf = $"(${peek(addr + 1):X2},Y)";
//sprintf(pbuf, "($%02X),Y", mem[1]);
offset = 2;
break;
// Direct Page Indirect Long Indexed, Y
case 0x17:case 0x37:case 0x57:case 0x77:case 0x97:case 0xB7:case 0xD7:case 0xF7:
pbuf = string.Format("[${0:X2}],Y", peek(addr + 1));
pbuf = $"[${peek(addr + 1):X2}],Y";
//sprintf(pbuf, "[$%02X],Y", mem[1]);
offset = 2;
break;
@ -382,7 +382,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816
{
byte mem1 = peek(addr+1);
sval = (mem1 > 127) ? (mem1 - 256) : mem1;
pbuf = string.Format("${0:X4}", (addr + sval + 2) & 0xFFFF);
pbuf = $"${(addr + sval + 2) & 0xFFFF:X4}";
//sprintf(pbuf, "$%04lX", (pos + sval + 2) & 0xFFFF);
offset = 2;
break;
@ -394,31 +394,31 @@ namespace BizHawk.Emulation.Cores.Components.W65816
// Calculate the signed value of the param
sval = peek(addr+1) + peek(addr+2) * 256;
sval = (sval > 32767) ? (sval - 65536) : sval;
pbuf = string.Format("${0:X4}", (addr + sval + 3) & 0xFFFF);
pbuf = $"${(addr + sval + 3) & 0xFFFF:X4}";
//sprintf(pbuf, "$%04lX", (pos + sval + 3) & 0xFFFF);
offset = 3;
break;
// Stack Relative Indirect Indexed, Y
case 0x13:case 0x33:case 0x53:case 0x73:case 0x93:case 0xB3:case 0xD3:case 0xF3:
pbuf = string.Format("(${0:X4},S),Y", peek(addr + 1));
pbuf = $"(${peek(addr + 1):X4},S),Y";
//sprintf(pbuf, "($%02X,S),Y", mem[1]);
offset = 2;
break;
// Stack (Absolute)
case 0xF4:
pbuf = string.Format("${0:X4}", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"${peek(addr + 1) + peek(addr + 2) * 256:X4}";
//sprintf(pbuf, "$%04X", mem[1] + mem[2] * 256);
offset = 3;
break;
// Stack (Direct Page Indirect)
case 0xD4:
pbuf = string.Format("(${0:X2}", peek(addr + 1));
pbuf = $"(${peek(addr + 1):X2}";
//sprintf(pbuf, "($%02X)", mem[1]);
offset = 2;
break;
// Stack Relative
case 0x03:case 0x23:case 0x43:case 0x63:case 0x83:case 0xA3:case 0xC3:case 0xE3:
pbuf = string.Format("${0:X2},S", peek(addr = 1));
pbuf = $"${peek(addr = 1):X2},S";
//sprintf(pbuf, "$%02X,S", mem[1]);
offset = 2;
break;
@ -426,7 +426,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816
case 0x42:
// Stack/Interrupt
case 0x00: case 0x02:
pbuf = string.Format("${0:X2}", peek(addr + 1));
pbuf = $"${peek(addr + 1):X2}";
//sprintf(pbuf, "$%02X", mem[1]);
offset = 2;
break;
@ -436,7 +436,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816
{
byte mem1 = peek(addr + 1);
P = (byte)(P & ~mem1);
pbuf = string.Format("#${0:X2}", peek(addr + 1));
pbuf = $"#${peek(addr + 1):X2}";
//sprintf(pbuf, "#$%02X", mem[1]);
offset = 2;
break;
@ -446,7 +446,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816
{
byte mem1 = peek(addr + 1);
P = (byte)(P | mem1);
pbuf = string.Format("#${0:X2}", mem1);
pbuf = $"#${mem1:X2}";
//sprintf(pbuf, "#$%02X", mem[1]);
offset = 2;
break;
@ -455,13 +455,13 @@ namespace BizHawk.Emulation.Cores.Components.W65816
case 0x09:case 0x29:case 0x49:case 0x69:case 0x89:case 0xA9:case 0xC9:case 0xE9:
if ((P & 0x20)!=0)
{
pbuf = string.Format("#${0:X2}", peek(addr + 1));
pbuf = $"#${peek(addr + 1):X2}";
//sprintf(pbuf, "#$%02X", mem[1]);
offset = 2;
}
else
{
pbuf = string.Format("#${0:X4}", peek(addr + 1) + peek(addr+2)*256);
pbuf = $"#${peek(addr + 1) + peek(addr + 2) * 256:X4}";
offset = 3;
}
break;
@ -469,13 +469,13 @@ namespace BizHawk.Emulation.Cores.Components.W65816
case 0xA0:case 0xA2:case 0xC0:case 0xE0:
if ((P & 0x10)!=0)
{
pbuf = string.Format("#${0:X2}", peek(addr + 1));
pbuf = $"#${peek(addr + 1):X2}";
//sprintf(pbuf, "#$%02X", mem[1]);
offset = 2;
}
else
{
pbuf = string.Format("#${0:X4}", peek(addr + 1) + peek(addr + 2) * 256);
pbuf = $"#${peek(addr + 1) + peek(addr + 2) * 256:X4}";
//sprintf(pbuf, "#$%04X", mem[1] + mem[2] * 256);
offset = 3;
}

View File

@ -756,11 +756,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
return new TraceInfo
{
Disassembly = string.Format(
"{0:X4}: {1} {2}",
RegPC,
byte_code.PadRight(12),
disasm.PadRight(26)),
Disassembly = $"{RegPC:X4}: {byte_code.PadRight(12)} {disasm.PadRight(26)}",
RegisterInfo = string.Join(" ",
$"AF:{(Regs[A] << 8) + Regs[F]:X4}",
$"BC:{(Regs[B] << 8) + Regs[C]:X4}",

View File

@ -10,10 +10,7 @@ namespace BizHawk.Emulation.Cores.Components.x86
public string RawBytes;
public int Length;
public override string ToString()
{
return string.Format("{0:X6}: {3,-12} {1,-8} {2}", Addr, Mnemonic, Args, RawBytes);
}
public override string ToString() => $"{Addr:X6}: {RawBytes,-12} {Mnemonic,-8} {Args}";
}
public partial class x86<CpuType> where CpuType : struct, x86CpuType
@ -60,34 +57,34 @@ namespace BizHawk.Emulation.Cores.Components.x86
case 3: return "[BP+DI]";
case 4: return "[SI]";
case 5: return "[DI]";
case 6: ret = string.Format("{0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 6: ret = $"{ReadWord(addr):X4}h"; addr += 2; return ret;
case 7: return "[BX]";
}
break;
case 1:
switch (m)
{
case 0: return string.Format("[BX+SI] + {0:X2}h", ReadMemory(addr++));
case 1: return string.Format("[BX+DI] + {0:X2}h", ReadMemory(addr++));
case 2: return string.Format("[BP+SI] + {0:X2}h", ReadMemory(addr++));
case 3: return string.Format("[BP+DI] + {0:X2}h", ReadMemory(addr++));
case 4: return string.Format("[SI] + {0:X2}h", ReadMemory(addr++));
case 5: return string.Format("[DI] + {0:X2}h", ReadMemory(addr++));
case 6: return string.Format("[BP] + {0:X2}h", ReadMemory(addr++));
case 7: return string.Format("[BX] + {0:X2}h", ReadMemory(addr++));
case 0: return $"[BX+SI] + {ReadMemory(addr++):X2}h";
case 1: return $"[BX+DI] + {ReadMemory(addr++):X2}h";
case 2: return $"[BP+SI] + {ReadMemory(addr++):X2}h";
case 3: return $"[BP+DI] + {ReadMemory(addr++):X2}h";
case 4: return $"[SI] + {ReadMemory(addr++):X2}h";
case 5: return $"[DI] + {ReadMemory(addr++):X2}h";
case 6: return $"[BP] + {ReadMemory(addr++):X2}h";
case 7: return $"[BX] + {ReadMemory(addr++):X2}h";
}
break;
case 2:
switch (m)
{
case 0: ret = string.Format("[BX+SI] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 1: ret = string.Format("[BX+DI] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 2: ret = string.Format("[BP+SI] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 3: ret = string.Format("[BP+DI] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 4: ret = string.Format("[SI] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 5: ret = string.Format("[DI] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 6: ret = string.Format("[BP] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 7: ret = string.Format("[BX] + {0:X4}h", ReadWord(addr)); addr += 2; return ret;
case 0: ret = $"[BX+SI] + {ReadWord(addr):X4}h"; addr += 2; return ret;
case 1: ret = $"[BX+DI] + {ReadWord(addr):X4}h"; addr += 2; return ret;
case 2: ret = $"[BP+SI] + {ReadWord(addr):X4}h"; addr += 2; return ret;
case 3: ret = $"[BP+DI] + {ReadWord(addr):X4}h"; addr += 2; return ret;
case 4: ret = $"[SI] + {ReadWord(addr):X4}h"; addr += 2; return ret;
case 5: ret = $"[DI] + {ReadWord(addr):X4}h"; addr += 2; return ret;
case 6: ret = $"[BP] + {ReadWord(addr):X4}h"; addr += 2; return ret;
case 7: ret = $"[BX] + {ReadWord(addr):X4}h"; addr += 2; return ret;
}
break;
case 3:
@ -119,71 +116,71 @@ namespace BizHawk.Emulation.Cores.Components.x86
break;
case 0xB0: // MOV AL, immed
info.Mnemonic = "MOV";
info.Args = string.Format("AL, {0:X2}h", ReadMemory(addr++));
info.Args = $"AL, {ReadMemory(addr++):X2}h";
break;
case 0xB1: // MOV CL, immed
info.Mnemonic = "MOV";
info.Args = string.Format("CL, {0:X2}h", ReadMemory(addr++));
info.Args = $"CL, {ReadMemory(addr++):X2}h";
break;
case 0xB2: // MOV DL, immed
info.Mnemonic = "MOV";
info.Args = string.Format("DL, {0:X2}h", ReadMemory(addr++));
info.Args = $"DL, {ReadMemory(addr++):X2}h";
break;
case 0xB3: // MOV BL, immed
info.Mnemonic = "MOV";
info.Args = string.Format("BL, {0:X2}h", ReadMemory(addr++));
info.Args = $"BL, {ReadMemory(addr++):X2}h";
break;
case 0xB4: // MOV AH, immed
info.Mnemonic = "MOV";
info.Args = string.Format("AH, {0:X2}h", ReadMemory(addr++));
info.Args = $"AH, {ReadMemory(addr++):X2}h";
break;
case 0xB5: // MOV CH, immed
info.Mnemonic = "MOV";
info.Args = string.Format("CH, {0:X2}h", ReadMemory(addr++));
info.Args = $"CH, {ReadMemory(addr++):X2}h";
break;
case 0xB6: // MOV DH, immed
info.Mnemonic = "MOV";
info.Args = string.Format("DH, {0:X2}h", ReadMemory(addr++));
info.Args = $"DH, {ReadMemory(addr++):X2}h";
break;
case 0xB7: // MOV BH, immed
info.Mnemonic = "MOV";
info.Args = string.Format("BH, {0:X2}h", ReadMemory(addr++));
info.Args = $"BH, {ReadMemory(addr++):X2}h";
break;
case 0xB8: // MOV AX, immed
info.Mnemonic = "MOV";
info.Args = string.Format("AX, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"AX, {ReadWord(addr):X4}h"; addr += 2;
break;
case 0xB9: // MOV CX, immed
info.Mnemonic = "MOV";
info.Args = string.Format("CX, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"CX, {ReadWord(addr):X4}h"; addr += 2;
break;
case 0xBA: // MOV DX, immed
info.Mnemonic = "MOV";
info.Args = string.Format("DX, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"DX, {ReadWord(addr):X4}h"; addr += 2;
break;
case 0xBB: // MOV BX, immed
info.Mnemonic = "MOV";
info.Args = string.Format("BX, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"BX, {ReadWord(addr):X4}h"; addr += 2;
break;
case 0xBC: // MOV SP, immed
info.Mnemonic = "MOV";
info.Args = string.Format("SP, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"SP, {ReadWord(addr):X4}h"; addr += 2;
break;
case 0xBD: // MOV BP, immed
info.Mnemonic = "MOV";
info.Args = string.Format("BP, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"BP, {ReadWord(addr):X4}h"; addr += 2;
break;
case 0xBE: // MOV SI, immed
info.Mnemonic = "MOV";
info.Args = string.Format("SI, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"SI, {ReadWord(addr):X4}h"; addr += 2;
break;
case 0xBF: // MOV DI, immed
info.Mnemonic = "MOV";
info.Args = string.Format("DI, {0:X4}h", ReadWord(addr)); addr += 2;
info.Args = $"DI, {ReadWord(addr):X4}h"; addr += 2;
break;
default:
info.Mnemonic = "DB";
info.Args = string.Format("{0:X2}h", op1);
info.Args = $"{op1:X2}h";
break;
}

View File

@ -92,9 +92,6 @@ namespace BizHawk.Emulation.Cores.Components.x86
[FieldOffset(1)]
public byte High;
public override string ToString()
{
return String.Format("{0:X4}", Word);
}
public override string ToString() => $"{Word:X4}";
}
}

View File

@ -1754,8 +1754,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
else
{
// some other type (turbo data etc..)
description = string.Format("#{0} block, {1} bytes", blockdata[0].ToString("X2"), blockSize);
//description += string.Format(", crc {0}", ((crc != 0) ? string.Format("bad (#{0:X2}!=#{1:X2})", crcFile, crcValue) : "ok"));
description = $"#{blockdata[0].ToString("X2")} block, {blockSize} bytes";
//description += (crc != 0) ? $", crc bad (#{crcFile:X2}!=#{crcValue:X2})" : ", crc ok";
block.AddMetaData(BlockDescriptorTitle.Undefined, description);
}
/*
@ -1797,8 +1797,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
else
{
// other type
description = string.Format("#{0} block, {1} bytes", blockdata[0].ToString("X2"), blockSize);
//description += string.Format(", crc {0}", ((crc != 0) ? string.Format("bad (#{0:X2}!=#{1:X2})", crcFile, crcValue) : "ok"));
description = $"#{blockdata[0]:X2} block, {blockSize} bytes";
//description += (crc != 0) ? $", crc bad (#{crcFile:X2}!=#{crcValue:X2})" : ", crc ok";
block.AddMetaData(BlockDescriptorTitle.Undefined, description);
}
*/

View File

@ -228,8 +228,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
else
{
// some other type (turbo data etc..)
description = string.Format("#{0} block, {1} bytes", blockdata[0].ToString("X2"), blockSize);
//description += string.Format(", crc {0}", ((crc != 0) ? string.Format("bad (#{0:X2}!=#{1:X2})", crcFile, crcValue) : "ok"));
description = $"#{blockdata[0].ToString("X2")} block, {blockSize} bytes";
//description += (crc != 0) ? $", crc bad (#{crcFile:X2}!=#{crcValue:X2})" : ", crc ok";
tdb.AddMetaData(BlockDescriptorTitle.Undefined, description);
}
/*
@ -270,8 +270,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
else
{
// other type
description = string.Format("#{0} block, {1} bytes", blockdata[0].ToString("X2"), blockSize - 2);
description += string.Format(", crc {0}", ((crc != 0) ? string.Format("bad (#{0:X2}!=#{1:X2})", crcFile, crcValue) : "ok"));
description = $"#{blockdata[0]:X2} block, {blockSize - 2} bytes";
description += (crc != 0) ? $", crc bad (#{crcFile:X2}!=#{crcValue:X2})" : ", crc ok";
}
*/

View File

@ -1693,8 +1693,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
else
{
// some other type (turbo data etc..)
description = string.Format("#{0} block, {1} bytes", blockdata[0].ToString("X2"), blockSize);
//description += string.Format(", crc {0}", ((crc != 0) ? string.Format("bad (#{0:X2}!=#{1:X2})", crcFile, crcValue) : "ok"));
description = $"#{blockdata[0].ToString("X2")} block, {blockSize} bytes";
//description += (crc != 0) ? $", crc bad (#{crcFile:X2}!=#{crcValue:X2})" : ", crc ok";
block.AddMetaData(BlockDescriptorTitle.Undefined, description);
}
/*
@ -1736,8 +1736,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
else
{
// other type
description = string.Format("#{0} block, {1} bytes", blockdata[0].ToString("X2"), blockSize);
//description += string.Format(", crc {0}", ((crc != 0) ? string.Format("bad (#{0:X2}!=#{1:X2})", crcFile, crcValue) : "ok"));
description = $"#{blockdata[0]:X2} block, {blockSize} bytes";
//description += (crc != 0) ? $", crc bad (#{crcFile:X2}!=#{crcValue:X2})" : ", crc ok";
block.AddMetaData(BlockDescriptorTitle.Undefined, description);
}
*/

View File

@ -44,9 +44,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
}
if (riffType != BitConverter.ToInt32(Encoding.ASCII.GetBytes("WAVE"), 0))
{
throw new FormatException(string.Format(
"Not supported RIFF type: '{0}'",
Encoding.ASCII.GetString(BitConverter.GetBytes(riffType))));
throw new FormatException($"Not supported RIFF type: '{Encoding.ASCII.GetString(BitConverter.GetBytes(riffType))}'");
}
Int32 chunkId;
Int32 chunkSize;

View File

@ -27,10 +27,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
if (m_header.fmtCode != WAVE_FORMAT_PCM &&
m_header.fmtCode != WAVE_FORMAT_IEEE_FLOAT)
{
throw new FormatException(string.Format(
"Not supported audio format: fmtCode={0}, bitDepth={1}",
m_header.fmtCode,
m_header.bitDepth));
throw new FormatException($"Not supported audio format: fmtCode={m_header.fmtCode}, bitDepth={m_header.bitDepth}");
}
byte[] data = new byte[m_header.fmtBlockAlign];
m_stream.Read(data, 0, data.Length);
@ -54,10 +51,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
if (m_header.bitDepth == 64)
return getSampleFloat64(data, 0, 0);
}
throw new NotSupportedException(string.Format(
"Not supported audio format ({0}/{1} bit)",
m_header.fmtCode == WAVE_FORMAT_PCM ? "PCM" : "FLOAT",
m_header.bitDepth));
throw new NotSupportedException($"Not supported audio format ({(m_header.fmtCode == WAVE_FORMAT_PCM ? "PCM" : "FLOAT")}/{m_header.bitDepth} bit)");
}
private Int32 getSamplePcm8(byte[] bufferRaw, int offset, int channel)

View File

@ -160,7 +160,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
{
return new TraceInfo
{
Disassembly = string.Format("{2:X8}: {0:X8} {1}", opcode, Darm.DisassembleStuff(addr, opcode), addr).PadRight(54),
Disassembly = $"{addr:X8}: {opcode:X8} {Darm.DisassembleStuff(addr, opcode)}".PadRight(54),
RegisterInfo = regs.TraceString()
};
}

View File

@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
var traceInfo = new TraceInfo
{
Disassembly = string.Format("{0:X}: {1}", pc, disasm.PadRight(32))
Disassembly = $"{pc:X}: {disasm.PadRight(32)}"
};
var sb = new StringBuilder();
@ -32,19 +32,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
{
UInt64 val = (regs[GPRnames[i] + "_hi"].Value << 32) | regs[GPRnames[i] + "_lo"].Value;
string name = GPRnames[i];
sb.Append(string.Format("{0}:{1:X16} ", name, val));
sb.Append($"{name}:{val:X16} ");
}
sb.Append(string.Format("LL:{0:X8} ", regs["LL"].Value));
sb.Append(string.Format("LO:{0:X8}{1:X8} ", regs["LO_hi"].Value, regs["LO_lo"].Value));
sb.Append(string.Format("HI:{0:X8}{1:X8} ", regs["HI_hi"].Value, regs["HI_lo"].Value));
sb.Append(string.Format("FCR0:{0:X8} ", regs["FCR0"].Value));
sb.Append(string.Format("FCR31:{0:X8} ", regs["FCR31"].Value));
sb.Append($"LL:{regs["LL"].Value:X8} ");
sb.Append($"LO:{regs["LO_hi"].Value:X8}{regs["LO_lo"].Value:X8} ");
sb.Append($"HI:{regs["HI_hi"].Value:X8}{regs["HI_lo"].Value:X8} ");
sb.Append($"FCR0:{regs["FCR0"].Value:X8} ");
sb.Append($"FCR31:{regs["FCR31"].Value:X8} ");
for (int i = 0; i < 32; i++) // r0 is always zero
{
UInt64 val = (regs["CP1 FGR REG" + i + "_hi"].Value << 32) | regs["CP1 FGR REG" + i + "_lo"].Value;
sb.Append(string.Format("f{0}:{1:X16} ", i, val));
sb.Append($"f{i}:{val:X16} ");
}
// drop MMU co-processor regs for now

View File

@ -499,7 +499,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
CoreDll = libLoader.LoadPlatformSpecific("mupen64plus");
if (CoreDll == IntPtr.Zero)
throw new InvalidOperationException(string.Format("Failed to load mupen64plus.dll"));
throw new InvalidOperationException("Failed to load mupen64plus.dll");
connectFunctionPointers();
@ -954,7 +954,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
if (result != m64p_error.M64ERR_SUCCESS)
{
libLoader.FreePlatformSpecific(plugin.dllHandle);
throw new InvalidOperationException(string.Format("Error during attaching plugin {0}", PluginName));
throw new InvalidOperationException($"Error during attaching plugin {PluginName}");
}
plugins.Add(type, plugin);

View File

@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
throw new ArgumentNullException(nameof(s));
if (!s.Length.In(MIN_DIGITS, MAX_DIGITS))
{
why = string.Format("String must be {0} or {1} digits long!", MIN_DIGITS, MAX_DIGITS);
why = $"String must be {MIN_DIGITS} or {MAX_DIGITS} digits long!";
return false;
}
foreach (char c in s)

View File

@ -253,7 +253,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
remap = AddrA1A0;
break;
default:
throw new Exception(string.Format("Unknown PCB type for VRC2: \"{0}\"", Cart.pcb));
throw new Exception($"Unknown PCB type for VRC2: \"{Cart.pcb}\"");
}
break;
default:

View File

@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
int mapper = data[6] >> 4 | data[7] & 0xf0 | data[8] << 8 & 0xf00;
int submapper = data[8] >> 4;
CartV2.board_type = string.Format("MAPPER{0:d4}-{1:d2}", mapper, submapper);
CartV2.board_type = $"MAPPER{mapper:d4}-{submapper:d2}";
int vrambat = iNES2Wram(data[11] >> 4);
int vramnon = iNES2Wram(data[11] & 15);
@ -97,7 +97,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{
int mapper = data[6] >> 4 | data[7] & 0xf0;
Cart.board_type = string.Format("MAPPER{0:d3}", mapper);
Cart.board_type = $"MAPPER{mapper:d3}";
}
Cart.vram_size = Cart.chr_size > 0 ? 0 : 8;

View File

@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
throw new Exception("Missing \"UNIF\" header mark!");
int ver = br.ReadInt32();
//if (ver != 7)
// throw new Exception(string.Format("Unknown UNIF version {0}!", ver));
// throw new Exception($"Unknown UNIF version {ver}!");
Console.WriteLine("Processing Version {0} UNIF...", ver);
br.ReadBytes(32 - 4 - 4);
@ -53,8 +53,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
MemoryStream chrs = new MemoryStream();
for (int i = 0; i < 16; i++)
{
TryAdd(prgs, string.Format("PRG{0:X1}", i));
TryAdd(chrs, string.Format("CHR{0:X1}", i));
TryAdd(prgs, $"PRG{i:X1}");
TryAdd(chrs, $"CHR{i:X1}");
}
prgs.Close();
chrs.Close();

View File

@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
Tracer.Put(new TraceInfo
{
Disassembly = string.Format("{0:X4}: {1}", pc, opcodeStr).PadRight(26),
Disassembly = $"{pc:X4}: {opcodeStr}".PadRight(26),
RegisterInfo = string.Join(" ",
$"A:{a:X2}",
$"X:{x:X2}",

View File

@ -138,7 +138,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
private static PadEnt[] GetPadList(int player)
{
string prefix = string.Format("P{0} ", player);
string prefix = $"P{player} ";
return PadNames.Zip(PadMasks, (s, i) => new PadEnt(prefix + s, i)).ToArray();
}

View File

@ -31,10 +31,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
{
public Dimensions(int w, int h) { Width = w; Height = h; }
public int Width, Height;
public override string ToString()
{
return string.Format("{0}x{1}", Width, Height);
}
public override string ToString() => $"{Width}x{Height}";
}
public enum ScreenSize

View File

@ -101,7 +101,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
Init(game, rom);
// the default RomStatusDetails don't do anything with Disc
CoreComm.RomStatusDetails = string.Format("{0}\r\nDisk partial hash:{1}", game.Name, new DiscSystem.DiscHasher(disc).OldHash());
CoreComm.RomStatusDetails = $"{game.Name}\r\nDisk partial hash:{new DiscSystem.DiscHasher(disc).OldHash()}";
_controllerDeck = new PceControllerDeck(
_syncSettings.Port1,

View File

@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
length = info.Length;
return string.Format("{0:X4} {1,-7} {2}", info.RawBytes.Substring(0, 4), info.Mnemonic, info.Args);
return $"{info.RawBytes.Substring(0, 4):X4} {info.Mnemonic,-7} {info.Args}";
}
// TODO: refactor MC6800's disassembler to be a static call

View File

@ -66,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
{
if (destinationType == typeof(string) && value.GetType() == typeof(uint))
{
return string.Format("0x{0:x8}", value);
return $"0x{value:x8}";
}
else
{
@ -122,7 +122,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
{
if (destinationType == typeof(string) && value.GetType() == typeof(ushort))
{
return string.Format("0x{0:x4}", value);
return $"0x{value:x4}";
}
else
{

View File

@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
var traceInfo = new TraceInfo
{
Disassembly = string.Format("{0:X6}: {1}", pc, disasm).PadRight(50)
Disassembly = $"{pc:X6}: {disasm}".PadRight(50)
};
var sb = new StringBuilder();
@ -41,10 +41,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
r.Key != "M68K PC" && // already present in every line start
r.Key != "M68K IR") // copy of last opcode, already shown in raw bytes
{
sb.Append(
string.Format("{0}:{1} ",
r.Key.Replace("M68K", "").Trim(),
r.Value.Value.ToHexString(r.Value.BitSize / 4)));
sb.Append($"{r.Key.Replace("M68K", "").Trim()}:{r.Value.Value.ToHexString(r.Value.BitSize / 4)} ");
}
}
}

View File

@ -114,7 +114,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
{
foreach (var Button in Buttons)
{
string Name = string.Format("P{0} {1}", player, Button.Name);
string Name = $"P{player} {Button.Name}";
ControllerDef.BoolButtons.Add(Name);
var ButtonFlag = Button.Key;
Converts.Add(delegate()
@ -127,8 +127,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
void DoMouseAnalog(int idx, int player)
{
string NX = string.Format("P{0} Mouse X", player);
string NY = string.Format("P{0} Mouse Y", player);
string NX = $"P{player} Mouse X";
string NY = $"P{player} Mouse Y";
ControllerDef.FloatControls.Add(NX);
ControllerDef.FloatControls.Add(NY);
ControllerDef.FloatRanges.Add(MouseRange);
@ -142,8 +142,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
void DoLightgunAnalog(int idx, int player)
{
string NX = string.Format("P{0} Lightgun X", player);
string NY = string.Format("P{0} Lightgun Y", player);
string NX = $"P{player} Lightgun X";
string NY = $"P{player} Lightgun Y";
ControllerDef.FloatControls.Add(NX);
ControllerDef.FloatControls.Add(NY);
ControllerDef.FloatRanges.Add(LightgunRange);
@ -157,9 +157,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
void DoXEA1PAnalog(int idx, int player)
{
string NX = string.Format("P{0} Stick X", player);
string NY = string.Format("P{0} Stick Y", player);
string NZ = string.Format("P{0} Stick Z", player);
string NX = $"P{player} Stick X";
string NY = $"P{player} Stick Y";
string NZ = $"P{player} Stick Z";
ControllerDef.FloatControls.Add(NX);
ControllerDef.FloatControls.Add(NY);
ControllerDef.FloatControls.Add(NZ);

View File

@ -203,10 +203,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
return (int)this.addr - (int)other.addr;
}
public override string ToString()
{
return string.Format("0x{0:X8} {1} ({2})", (int)addr, name, section);
}
public override string ToString() => $"0x{(int)addr:X8} {name} ({section})";
}

View File

@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Sony.PSP
void LogCallbackFunc(char type, string message)
{
debugmsgs.Enqueue(string.Format("PSP: {0} {1}", type, message));
debugmsgs.Enqueue($"PSP: {type} {message}");
}
void LogFlush()
{

View File

@ -24,15 +24,12 @@ namespace BizHawk.Emulation.Cores.Sony.PSX
foreach (var r in regs)
{
if (r.Key != "pc")
sb.Append(
string.Format("{0}:{1} ",
r.Key,
r.Value.Value.ToHexString(r.Value.BitSize / 4)));
sb.Append($"{r.Key}:{r.Value.Value.ToHexString(r.Value.BitSize / 4)} ");
}
Tracer.Put(new TraceInfo
{
Disassembly = string.Format("{0:X8}: {1:X8} {2}", PC, inst, dis.PadRight(30)),
Disassembly = $"{PC:X8}: {inst:X8} {dis.PadRight(30)}",
RegisterInfo = sb.ToString().Trim()
});
}

View File

@ -32,12 +32,12 @@ namespace BizHawk.Emulation.Cores
string pname = p.Name.ToLowerInvariant();
Type expectedtype;
if (!paramtypes.TryGetValue(pname, out expectedtype))
throw new InvalidOperationException(string.Format("Unexpected parameter name {0} in constructor for {1}", p.Name, Type));
throw new InvalidOperationException($"Unexpected parameter name {p.Name} in constructor for {Type}");
// disabling the typecheck here doesn't really hurt anything, because the Invoke call will still catch any forbidden casts
// it does allow us to write "MySettingsType settings" instead of "object settings"
// if (expectedtype != p.ParameterType)
// throw new InvalidOperationException(string.Format("Unexpected type mismatch in parameter {0} in constructor for {1}", p.Name, Type));
// throw new InvalidOperationException($"Unexpected type mismatch in parameter {p.Name} in constructor for {Type}");
parammap.Add(pname, i);
}
}

View File

@ -48,9 +48,6 @@ namespace BizHawk.Emulation.Cores.Libretro
public string[] Options;
public string DefaultOption { get { return Options[0]; } }
public override string ToString()
{
return string.Format("{0} ({1}) = ({2})", Name, Description, string.Join("|", Options));
}
public override string ToString() => $"{Name} ({Description}) = ({string.Join("|", Options)})";
}
}

View File

@ -218,7 +218,7 @@ namespace BizHawk.Emulation.Cores.Libretro
private bool GetButton(uint pnum, string type, string button)
{
string key = string.Format("P{0} {1} {2}", pnum, type, button);
string key = $"P{pnum} {type} {button}";
bool b = _controller.IsPressed(key);
if (b == true)
{

View File

@ -170,7 +170,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
.Where(s => s.PointedSection != null && (s.PointedSection.Flags & SectionFlags.Writable) != 0)
.OrderByDescending(s => s.Size)
.Take(30)
.Select(s => string.Format("{0} size {1}", s.Name, s.Size)))
.Select(s => $"{s.Name} size {s.Size}"))
{
Console.WriteLine(text);
}

View File

@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
ulong newused = ((Used - 1) | (ulong)(align - 1)) + 1;
if (newused > Memory.Size)
{
throw new InvalidOperationException(string.Format("Failed to meet alignment {0} on heap {1}", align, Name));
throw new InvalidOperationException($"Failed to meet alignment {align} on heap {Name}");
}
return newused;
}
@ -55,13 +55,13 @@ namespace BizHawk.Emulation.Cores.Waterbox
public ulong Allocate(ulong size, int align)
{
if (Sealed)
throw new InvalidOperationException(string.Format("Attempt made to allocate from sealed heap {0}", Name));
throw new InvalidOperationException($"Attempt made to allocate from sealed heap {Name}");
ulong allocstart = EnsureAlignment(align);
ulong newused = allocstart + size;
if (newused > Memory.Size)
{
throw new InvalidOperationException(string.Format("Failed to allocate {0} bytes from heap {1}", size, Name));
throw new InvalidOperationException($"Failed to allocate {size} bytes from heap {Name}");
}
ulong ret = Memory.Start + allocstart;
Memory.Protect(Memory.Start + Used, newused - Used, MemoryBlock.Protection.RW);
@ -80,7 +80,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
}
else
{
throw new InvalidOperationException(string.Format("Attempt to reseal heap {0}", Name));
throw new InvalidOperationException($"Attempt to reseal heap {Name}");
}
}
@ -105,16 +105,16 @@ namespace BizHawk.Emulation.Cores.Waterbox
var name = br.ReadString();
if (name != Name)
// probable cause: internal error
throw new InvalidOperationException(string.Format("Name did not match for heap {0}", Name));
throw new InvalidOperationException($"Name did not match for heap {Name}");
var used = br.ReadUInt64();
if (used > Memory.Size)
throw new InvalidOperationException(string.Format("Heap {0} used {1} larger than available {2}", Name, used, Memory.Size));
throw new InvalidOperationException($"Heap {Name} used {used} larger than available {Memory.Size}");
if (!Sealed)
{
var hash = br.ReadBytes(Memory.XorHash.Length);
if (!hash.SequenceEqual(Memory.XorHash))
{
throw new InvalidOperationException(string.Format("Hash did not match for heap {0}. Is this the same rom with the same SyncSettings?", Name));
throw new InvalidOperationException($"Hash did not match for heap {Name}. Is this the same rom with the same SyncSettings?");
}
var usedAligned = WaterboxUtils.AlignUp(used);
@ -129,7 +129,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
var hash = br.ReadBytes(_hash.Length);
if (!hash.SequenceEqual(_hash))
{
throw new InvalidOperationException(string.Format("Hash did not match for heap {0}. Is this the same rom with the same SyncSettings?", Name));
throw new InvalidOperationException($"Hash did not match for heap {Name}. Is this the same rom with the same SyncSettings?");
}
}
}

View File

@ -100,7 +100,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
var ptr = imports.Resolve(e);
if (ptr == IntPtr.Zero)
{
var s = string.Format("Trapped on unimplemented function {0}:{1}", moduleName, e);
var s = $"Trapped on unimplemented function {moduleName}:{e}";
Action del = () =>
{
Console.WriteLine(s);