use explicit private/internal modifiers
This commit is contained in:
parent
b83556fc6f
commit
cb6ef03982
|
@ -5,8 +5,8 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
|
||||||
{
|
{
|
||||||
public static class LibMAME
|
public static class LibMAME
|
||||||
{
|
{
|
||||||
const string dll = "libmamearcade64.dll"; // libmamearcade64.dll libpacmansh64d.dll
|
private const string dll = "libmamearcade64.dll"; // libmamearcade64.dll libpacmansh64d.dll
|
||||||
const CallingConvention cc = CallingConvention.Cdecl;
|
private const CallingConvention cc = CallingConvention.Cdecl;
|
||||||
|
|
||||||
public enum OutputChannel
|
public enum OutputChannel
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
// TODO, the timing on AND variants is wrong. IE, and.w w/ immediate should be 8 cycles, but I cant figure out how that should work.
|
// TODO, the timing on AND variants is wrong. IE, and.w w/ immediate should be 8 cycles, but I cant figure out how that should work.
|
||||||
void AND0() // AND <ea>, Dn
|
private void AND0() // AND <ea>, Dn
|
||||||
{
|
{
|
||||||
int dstReg = (op >> 9) & 0x07;
|
int dstReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AND0_Disasm(DisassemblyInfo info)
|
private void AND0_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int dstReg = (op >> 9) & 0x07;
|
int dstReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AND1() // AND Dn, <ea>
|
private void AND1() // AND Dn, <ea>
|
||||||
{
|
{
|
||||||
int srcReg = (op >> 9) & 0x07;
|
int srcReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AND1_Disasm(DisassemblyInfo info)
|
private void AND1_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int srcReg = (op >> 9) & 0x07;
|
int srcReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -137,7 +137,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANDI() // ANDI #<data>, <ea>
|
private void ANDI() // ANDI #<data>, <ea>
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
int dstMode = (op >> 3) & 0x07;
|
int dstMode = (op >> 3) & 0x07;
|
||||||
|
@ -184,7 +184,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANDI_Disasm(DisassemblyInfo info)
|
private void ANDI_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int size = ((op >> 6) & 0x03);
|
int size = ((op >> 6) & 0x03);
|
||||||
int dstMode = ((op >> 3) & 0x07);
|
int dstMode = ((op >> 3) & 0x07);
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EOR() // EOR Dn, <ea>
|
private void EOR() // EOR Dn, <ea>
|
||||||
{
|
{
|
||||||
int srcReg = (op >> 9) & 0x07;
|
int srcReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -268,7 +268,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EOR_Disasm(DisassemblyInfo info)
|
private void EOR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int srcReg = (op >> 9) & 0x07;
|
int srcReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -296,7 +296,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EORI()
|
private void EORI()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -340,7 +340,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EORI_Disasm(DisassemblyInfo info)
|
private void EORI_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -375,7 +375,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OR0() // OR <ea>, Dn
|
private void OR0() // OR <ea>, Dn
|
||||||
{
|
{
|
||||||
int dstReg = (op >> 9) & 0x07;
|
int dstReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -408,7 +408,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OR0_Disasm(DisassemblyInfo info)
|
private void OR0_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int dstReg = (op >> 9) & 0x07;
|
int dstReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -436,7 +436,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OR1() // OR Dn, <ea>
|
private void OR1() // OR Dn, <ea>
|
||||||
{
|
{
|
||||||
int srcReg = (op >> 9) & 0x07;
|
int srcReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -481,7 +481,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OR1_Disasm(DisassemblyInfo info)
|
private void OR1_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int srcReg = (op >> 9) & 0x07;
|
int srcReg = (op >> 9) & 0x07;
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
|
@ -509,7 +509,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ORI()
|
private void ORI()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -553,7 +553,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ORI_Disasm(DisassemblyInfo info)
|
private void ORI_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -588,7 +588,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NOT()
|
private void NOT()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
int mode = (op >> 3) & 0x07;
|
int mode = (op >> 3) & 0x07;
|
||||||
|
@ -632,7 +632,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NOT_Disasm(DisassemblyInfo info)
|
private void NOT_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
int mode = (op >> 3) & 0x07;
|
int mode = (op >> 3) & 0x07;
|
||||||
|
@ -659,7 +659,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LSLd()
|
private void LSLd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -707,7 +707,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LSLd_Disasm(DisassemblyInfo info)
|
private void LSLd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -729,7 +729,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LSRd()
|
private void LSRd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -777,7 +777,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LSRd_Disasm(DisassemblyInfo info)
|
private void LSRd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -799,7 +799,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASLd()
|
private void ASLd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -853,7 +853,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASLd_Disasm(DisassemblyInfo info)
|
private void ASLd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -875,7 +875,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASRd()
|
private void ASRd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -929,7 +929,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASRd_Disasm(DisassemblyInfo info)
|
private void ASRd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -951,7 +951,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROLd()
|
private void ROLd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -999,7 +999,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROLd_Disasm(DisassemblyInfo info)
|
private void ROLd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -1021,7 +1021,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RORd()
|
private void RORd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -1069,7 +1069,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RORd_Disasm(DisassemblyInfo info)
|
private void RORd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -1091,7 +1091,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROXLd()
|
private void ROXLd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -1142,7 +1142,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROXLd_Disasm(DisassemblyInfo info)
|
private void ROXLd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -1164,7 +1164,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROXRd()
|
private void ROXRd()
|
||||||
{
|
{
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -1215,7 +1215,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ROXRd_Disasm(DisassemblyInfo info)
|
private void ROXRd_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int rot = (op >> 9) & 7;
|
int rot = (op >> 9) & 7;
|
||||||
|
@ -1237,7 +1237,7 @@
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SWAP()
|
private void SWAP()
|
||||||
{
|
{
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
D[reg].u32 = (D[reg].u32 << 16) | (D[reg].u32 >> 16);
|
D[reg].u32 = (D[reg].u32 << 16) | (D[reg].u32 >> 16);
|
||||||
|
@ -1247,7 +1247,7 @@
|
||||||
PendingCycles -= 4;
|
PendingCycles -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SWAP_Disasm(DisassemblyInfo info)
|
private void SWAP_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
info.Mnemonic = "swap";
|
info.Mnemonic = "swap";
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
{
|
{
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
void MOVE()
|
private void MOVE()
|
||||||
{
|
{
|
||||||
int size = ((op >> 12) & 0x03);
|
int size = ((op >> 12) & 0x03);
|
||||||
int dstMode = ((op >> 6) & 0x07);
|
int dstMode = ((op >> 6) & 0x07);
|
||||||
|
@ -41,7 +41,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
Z = (value == 0);
|
Z = (value == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVE_Disasm(DisassemblyInfo info)
|
private void MOVE_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = ((op >> 12) & 0x03);
|
int size = ((op >> 12) & 0x03);
|
||||||
|
@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEA()
|
private void MOVEA()
|
||||||
{
|
{
|
||||||
int size = ((op >> 12) & 0x03);
|
int size = ((op >> 12) & 0x03);
|
||||||
int dstReg = ((op >> 9) & 0x07);
|
int dstReg = ((op >> 9) & 0x07);
|
||||||
|
@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEA_Disasm(DisassemblyInfo info)
|
private void MOVEA_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = ((op >> 12) & 0x03);
|
int size = ((op >> 12) & 0x03);
|
||||||
|
@ -152,7 +152,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEQ()
|
private void MOVEQ()
|
||||||
{
|
{
|
||||||
int value = (sbyte)op; // 8-bit data payload is sign-extended to 32-bits.
|
int value = (sbyte)op; // 8-bit data payload is sign-extended to 32-bits.
|
||||||
N = (value & 0x80) != 0;
|
N = (value & 0x80) != 0;
|
||||||
|
@ -163,13 +163,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 4;
|
PendingCycles -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEQ_Disasm(DisassemblyInfo info)
|
private void MOVEQ_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
info.Mnemonic = "moveq";
|
info.Mnemonic = "moveq";
|
||||||
info.Args = $"#{(sbyte)op}, D{(op >> 9) & 7}";
|
info.Args = $"#{(sbyte)op}, D{(op >> 9) & 7}";
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEM0()
|
private void MOVEM0()
|
||||||
{
|
{
|
||||||
// Move register to memory
|
// Move register to memory
|
||||||
int size = (op >> 6) & 1;
|
int size = (op >> 6) & 1;
|
||||||
|
@ -302,7 +302,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEM1()
|
private void MOVEM1()
|
||||||
{
|
{
|
||||||
// Move memory to register
|
// Move memory to register
|
||||||
int size = (op >> 6) & 1;
|
int size = (op >> 6) & 1;
|
||||||
|
@ -387,7 +387,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static string DisassembleRegisterList0(uint registers)
|
private static string DisassembleRegisterList0(uint registers)
|
||||||
{
|
{
|
||||||
var str = new StringBuilder();
|
var str = new StringBuilder();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -442,7 +442,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
return str.ToString();
|
return str.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static string DisassembleRegisterList1(uint registers)
|
private static string DisassembleRegisterList1(uint registers)
|
||||||
{
|
{
|
||||||
var str = new StringBuilder();
|
var str = new StringBuilder();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -497,7 +497,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
return str.ToString();
|
return str.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEM0_Disasm(DisassemblyInfo info)
|
private void MOVEM0_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 1;
|
int size = (op >> 6) & 1;
|
||||||
|
@ -512,7 +512,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEM1_Disasm(DisassemblyInfo info)
|
private void MOVEM1_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 1;
|
int size = (op >> 6) & 1;
|
||||||
|
@ -527,7 +527,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LEA()
|
private void LEA()
|
||||||
{
|
{
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
int sReg = (op >> 0) & 7;
|
int sReg = (op >> 0) & 7;
|
||||||
|
@ -551,7 +551,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LEA_Disasm(DisassemblyInfo info)
|
private void LEA_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -565,7 +565,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLR()
|
private void CLR()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -582,7 +582,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
Z = true;
|
Z = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLR_Disasm(DisassemblyInfo info)
|
private void CLR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -598,7 +598,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT()
|
private void EXT()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 1;
|
int size = (op >> 6) & 1;
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
|
@ -622,7 +622,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 4;
|
PendingCycles -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXT_Disasm(DisassemblyInfo info)
|
private void EXT_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 1;
|
int size = (op >> 6) & 1;
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
|
@ -634,7 +634,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PEA()
|
private void PEA()
|
||||||
{
|
{
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
int reg = (op >> 0) & 7;
|
int reg = (op >> 0) & 7;
|
||||||
|
@ -660,7 +660,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PEA_Disasm(DisassemblyInfo info)
|
private void PEA_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
{
|
{
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
void ADD0()
|
private void ADD0()
|
||||||
{
|
{
|
||||||
int Dreg = (op >> 9) & 7;
|
int Dreg = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -55,7 +55,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADD1()
|
private void ADD1()
|
||||||
{
|
{
|
||||||
int Dreg = (op >> 9) & 7;
|
int Dreg = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -106,7 +106,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADD_Disasm(DisassemblyInfo info)
|
private void ADD_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int Dreg = (op >> 9) & 7;
|
int Dreg = (op >> 9) & 7;
|
||||||
|
@ -128,7 +128,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADDI()
|
private void ADDI()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -184,7 +184,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADDI_Disasm(DisassemblyInfo info)
|
private void ADDI_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -209,7 +209,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADDQ()
|
private void ADDQ()
|
||||||
{
|
{
|
||||||
int data = (op >> 9) & 7;
|
int data = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -277,7 +277,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADDQ_Disasm(DisassemblyInfo info)
|
private void ADDQ_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int data = (op >> 9) & 7;
|
int data = (op >> 9) & 7;
|
||||||
|
@ -296,7 +296,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADDA()
|
private void ADDA()
|
||||||
{
|
{
|
||||||
int aReg = (op >> 9) & 7;
|
int aReg = (op >> 9) & 7;
|
||||||
int size = (op >> 8) & 1;
|
int size = (op >> 8) & 1;
|
||||||
|
@ -320,7 +320,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADDA_Disasm(DisassemblyInfo info)
|
private void ADDA_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int aReg = (op >> 9) & 7;
|
int aReg = (op >> 9) & 7;
|
||||||
|
@ -334,7 +334,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUB0()
|
private void SUB0()
|
||||||
{
|
{
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -385,7 +385,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUB1()
|
private void SUB1()
|
||||||
{
|
{
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -436,7 +436,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUB_Disasm(DisassemblyInfo info)
|
private void SUB_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
|
@ -458,7 +458,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUBI()
|
private void SUBI()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -511,7 +511,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUBI_Disasm(DisassemblyInfo info)
|
private void SUBI_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -536,7 +536,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUBQ()
|
private void SUBQ()
|
||||||
{
|
{
|
||||||
int data = (op >> 9) & 7;
|
int data = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -601,7 +601,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUBQ_Disasm(DisassemblyInfo info)
|
private void SUBQ_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int data = (op >> 9) & 7;
|
int data = (op >> 9) & 7;
|
||||||
|
@ -620,7 +620,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUBA()
|
private void SUBA()
|
||||||
{
|
{
|
||||||
int aReg = (op >> 9) & 7;
|
int aReg = (op >> 9) & 7;
|
||||||
int size = (op >> 8) & 1;
|
int size = (op >> 8) & 1;
|
||||||
|
@ -644,7 +644,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SUBA_Disasm(DisassemblyInfo info)
|
private void SUBA_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
|
|
||||||
|
@ -659,7 +659,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NEG()
|
private void NEG()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
int mode = (op >> 3) & 0x07;
|
int mode = (op >> 3) & 0x07;
|
||||||
|
@ -711,7 +711,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NEG_Disasm(DisassemblyInfo info)
|
private void NEG_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 0x03;
|
int size = (op >> 6) & 0x03;
|
||||||
int mode = (op >> 3) & 0x07;
|
int mode = (op >> 3) & 0x07;
|
||||||
|
@ -738,7 +738,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMP()
|
private void CMP()
|
||||||
{
|
{
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -788,7 +788,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMP_Disasm(DisassemblyInfo info)
|
private void CMP_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
|
|
||||||
|
@ -815,7 +815,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMPA()
|
private void CMPA()
|
||||||
{
|
{
|
||||||
int aReg = (op >> 9) & 7;
|
int aReg = (op >> 9) & 7;
|
||||||
int size = (op >> 8) & 1;
|
int size = (op >> 8) & 1;
|
||||||
|
@ -851,7 +851,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMPA_Disasm(DisassemblyInfo info)
|
private void CMPA_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
|
|
||||||
|
@ -874,7 +874,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMPM()
|
private void CMPM()
|
||||||
{
|
{
|
||||||
int axReg = (op >> 9) & 7;
|
int axReg = (op >> 9) & 7;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -921,7 +921,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMPM_Disasm(DisassemblyInfo info)
|
private void CMPM_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int axReg = (op >> 9) & 7;
|
int axReg = (op >> 9) & 7;
|
||||||
|
@ -938,7 +938,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMPI()
|
private void CMPI()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -988,7 +988,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMPI_Disasm(DisassemblyInfo info)
|
private void CMPI_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -1017,7 +1017,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MULU()
|
private void MULU()
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -1034,7 +1034,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 70 + EACyclesBW[mode, reg];
|
PendingCycles -= 70 + EACyclesBW[mode, reg];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MULU_Disasm(DisassemblyInfo info)
|
private void MULU_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -1046,7 +1046,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MULS()
|
private void MULS()
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -1063,7 +1063,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 70 + EACyclesBW[mode, reg];
|
PendingCycles -= 70 + EACyclesBW[mode, reg];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MULS_Disasm(DisassemblyInfo info)
|
private void MULS_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -1075,7 +1075,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DIVU()
|
private void DIVU()
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -1099,7 +1099,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 140 + EACyclesBW[mode, reg]; // this is basically a rough approximation at best.
|
PendingCycles -= 140 + EACyclesBW[mode, reg]; // this is basically a rough approximation at best.
|
||||||
}
|
}
|
||||||
|
|
||||||
void DIVU_Disasm(DisassemblyInfo info)
|
private void DIVU_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -1111,7 +1111,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DIVS()
|
private void DIVS()
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -1135,7 +1135,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 140 + EACyclesBW[mode, reg];
|
PendingCycles -= 140 + EACyclesBW[mode, reg];
|
||||||
}
|
}
|
||||||
|
|
||||||
void DIVS_Disasm(DisassemblyInfo info)
|
private void DIVS_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int dreg = (op >> 9) & 7;
|
int dreg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
{
|
{
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
bool TestCondition(int condition)
|
private bool TestCondition(int condition)
|
||||||
{
|
{
|
||||||
switch (condition)
|
switch (condition)
|
||||||
{
|
{
|
||||||
|
@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string DisassembleCondition(int condition)
|
private string DisassembleCondition(int condition)
|
||||||
{
|
{
|
||||||
switch (condition)
|
switch (condition)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bcc() // Branch on condition
|
private void Bcc() // Branch on condition
|
||||||
{
|
{
|
||||||
sbyte displacement8 = (sbyte)op;
|
sbyte displacement8 = (sbyte)op;
|
||||||
int cond = (op >> 8) & 0x0F;
|
int cond = (op >> 8) & 0x0F;
|
||||||
|
@ -85,7 +85,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bcc_Disasm(DisassemblyInfo info)
|
private void Bcc_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
sbyte displacement8 = (sbyte)op;
|
sbyte displacement8 = (sbyte)op;
|
||||||
|
@ -104,7 +104,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BRA()
|
private void BRA()
|
||||||
{
|
{
|
||||||
sbyte displacement8 = (sbyte)op;
|
sbyte displacement8 = (sbyte)op;
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 10;
|
PendingCycles -= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BRA_Disasm(DisassemblyInfo info)
|
private void BRA_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
info.Mnemonic = "bra";
|
info.Mnemonic = "bra";
|
||||||
|
@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BSR()
|
private void BSR()
|
||||||
{
|
{
|
||||||
sbyte displacement8 = (sbyte)op;
|
sbyte displacement8 = (sbyte)op;
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 18;
|
PendingCycles -= 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BSR_Disasm(DisassemblyInfo info)
|
private void BSR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
info.Mnemonic = "bsr";
|
info.Mnemonic = "bsr";
|
||||||
|
@ -167,7 +167,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBcc()
|
private void DBcc()
|
||||||
{
|
{
|
||||||
if (TestCondition((op >> 8) & 0x0F) == true)
|
if (TestCondition((op >> 8) & 0x0F) == true)
|
||||||
{
|
{
|
||||||
|
@ -192,7 +192,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBcc_Disasm(DisassemblyInfo info)
|
private void DBcc_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int cond = (op >> 8) & 0x0F;
|
int cond = (op >> 8) & 0x0F;
|
||||||
if (cond == 1)
|
if (cond == 1)
|
||||||
|
@ -205,20 +205,20 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = 4;
|
info.Length = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTS()
|
private void RTS()
|
||||||
{
|
{
|
||||||
PC = ReadLong(A[7].s32);
|
PC = ReadLong(A[7].s32);
|
||||||
A[7].s32 += 4;
|
A[7].s32 += 4;
|
||||||
PendingCycles -= 16;
|
PendingCycles -= 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTS_Disasm(DisassemblyInfo info)
|
private void RTS_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
info.Mnemonic = "rts";
|
info.Mnemonic = "rts";
|
||||||
info.Args = "";
|
info.Args = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTR()
|
private void RTR()
|
||||||
{
|
{
|
||||||
ushort sr = (ushort)ReadWord(A[7].s32);
|
ushort sr = (ushort)ReadWord(A[7].s32);
|
||||||
A[7].s32 += 2;
|
A[7].s32 += 2;
|
||||||
|
@ -233,13 +233,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 20;
|
PendingCycles -= 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTR_Disasm(DisassemblyInfo info)
|
private void RTR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
info.Mnemonic = "rtr";
|
info.Mnemonic = "rtr";
|
||||||
info.Args = "";
|
info.Args = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTE()
|
private void RTE()
|
||||||
{
|
{
|
||||||
short newSR = ReadWord(A[7].s32);
|
short newSR = ReadWord(A[7].s32);
|
||||||
A[7].s32 += 2;
|
A[7].s32 += 2;
|
||||||
|
@ -249,13 +249,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 20;
|
PendingCycles -= 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTE_Disasm(DisassemblyInfo info)
|
private void RTE_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
info.Mnemonic = "rte";
|
info.Mnemonic = "rte";
|
||||||
info.Args = "";
|
info.Args = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void TST()
|
private void TST()
|
||||||
{
|
{
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -273,7 +273,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
Z = (value == 0);
|
Z = (value == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TST_Disasm(DisassemblyInfo info)
|
private void TST_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int size = (op >> 6) & 3;
|
int size = (op >> 6) & 3;
|
||||||
|
@ -289,7 +289,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTSTi()
|
private void BTSTi()
|
||||||
{
|
{
|
||||||
int bit = ReadWord(PC); PC += 2;
|
int bit = ReadWord(PC); PC += 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -311,7 +311,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTSTi_Disasm(DisassemblyInfo info)
|
private void BTSTi_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int bit = ReadWord(pc); pc += 2;
|
int bit = ReadWord(pc); pc += 2;
|
||||||
|
@ -323,7 +323,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTSTr()
|
private void BTSTr()
|
||||||
{
|
{
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -346,7 +346,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BTSTr_Disasm(DisassemblyInfo info)
|
private void BTSTr_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
|
@ -358,7 +358,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCHGi()
|
private void BCHGi()
|
||||||
{
|
{
|
||||||
int bit = ReadWord(PC); PC += 2;
|
int bit = ReadWord(PC); PC += 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -384,7 +384,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCHGi_Disasm(DisassemblyInfo info)
|
private void BCHGi_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int bit = ReadWord(pc); pc += 2;
|
int bit = ReadWord(pc); pc += 2;
|
||||||
|
@ -396,7 +396,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCHGr()
|
private void BCHGr()
|
||||||
{
|
{
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -423,7 +423,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCHGr_Disasm(DisassemblyInfo info)
|
private void BCHGr_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
|
@ -435,7 +435,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCLRi()
|
private void BCLRi()
|
||||||
{
|
{
|
||||||
int bit = ReadWord(PC); PC += 2;
|
int bit = ReadWord(PC); PC += 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -461,7 +461,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCLRi_Disasm(DisassemblyInfo info)
|
private void BCLRi_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int bit = ReadWord(pc); pc += 2;
|
int bit = ReadWord(pc); pc += 2;
|
||||||
|
@ -473,7 +473,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCLRr()
|
private void BCLRr()
|
||||||
{
|
{
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -500,7 +500,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCLRr_Disasm(DisassemblyInfo info)
|
private void BCLRr_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
|
@ -512,7 +512,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BSETi()
|
private void BSETi()
|
||||||
{
|
{
|
||||||
int bit = ReadWord(PC); PC += 2;
|
int bit = ReadWord(PC); PC += 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -538,7 +538,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BSETi_Disasm(DisassemblyInfo info)
|
private void BSETi_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int bit = ReadWord(pc); pc += 2;
|
int bit = ReadWord(pc); pc += 2;
|
||||||
|
@ -550,7 +550,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BSETr()
|
private void BSETr()
|
||||||
{
|
{
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -577,7 +577,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BSETr_Disasm(DisassemblyInfo info)
|
private void BSETr_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int dReg = (op >> 9) & 7;
|
int dReg = (op >> 9) & 7;
|
||||||
|
@ -589,7 +589,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JMP()
|
private void JMP()
|
||||||
{
|
{
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
int reg = (op >> 0) & 7;
|
int reg = (op >> 0) & 7;
|
||||||
|
@ -612,7 +612,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JMP_Disasm(DisassemblyInfo info)
|
private void JMP_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -622,7 +622,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JSR()
|
private void JSR()
|
||||||
{
|
{
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
int reg = (op >> 0) & 7;
|
int reg = (op >> 0) & 7;
|
||||||
|
@ -649,7 +649,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JSR_Disasm(DisassemblyInfo info)
|
private void JSR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -659,7 +659,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LINK()
|
private void LINK()
|
||||||
{
|
{
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
A[7].s32 -= 4;
|
A[7].s32 -= 4;
|
||||||
|
@ -670,7 +670,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 16;
|
PendingCycles -= 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LINK_Disasm(DisassemblyInfo info)
|
private void LINK_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
|
@ -679,7 +679,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UNLK()
|
private void UNLK()
|
||||||
{
|
{
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
A[7].s32 = A[reg].s32;
|
A[7].s32 = A[reg].s32;
|
||||||
|
@ -688,7 +688,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 12;
|
PendingCycles -= 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UNLK_Disasm(DisassemblyInfo info)
|
private void UNLK_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int reg = op & 7;
|
int reg = op & 7;
|
||||||
info.Mnemonic = "unlk";
|
info.Mnemonic = "unlk";
|
||||||
|
@ -696,17 +696,17 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = 2;
|
info.Length = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NOP()
|
private void NOP()
|
||||||
{
|
{
|
||||||
PendingCycles -= 4;
|
PendingCycles -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NOP_Disasm(DisassemblyInfo info)
|
private void NOP_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
info.Mnemonic = "nop";
|
info.Mnemonic = "nop";
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scc() // Set on condition
|
private void Scc() // Set on condition
|
||||||
{
|
{
|
||||||
int cond = (op >> 8) & 0x0F;
|
int cond = (op >> 8) & 0x0F;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -726,7 +726,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scc_Disasm(DisassemblyInfo info)
|
private void Scc_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int cond = (op >> 8) & 0x0F;
|
int cond = (op >> 8) & 0x0F;
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
{
|
{
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
void MOVEtSR()
|
private void MOVEtSR()
|
||||||
{
|
{
|
||||||
if (S == false)
|
if (S == false)
|
||||||
throw new Exception("Write to SR when not in supervisor mode. supposed to trap or something...");
|
throw new Exception("Write to SR when not in supervisor mode. supposed to trap or something...");
|
||||||
|
@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 12 + EACyclesBW[mode, reg];
|
PendingCycles -= 12 + EACyclesBW[mode, reg];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEtSR_Disasm(DisassemblyInfo info)
|
private void MOVEtSR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -25,7 +25,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEfSR()
|
private void MOVEfSR()
|
||||||
{
|
{
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
int reg = (op >> 0) & 7;
|
int reg = (op >> 0) & 7;
|
||||||
|
@ -33,7 +33,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= (mode == 0) ? 6 : 8 + EACyclesBW[mode, reg];
|
PendingCycles -= (mode == 0) ? 6 : 8 + EACyclesBW[mode, reg];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEfSR_Disasm(DisassemblyInfo info)
|
private void MOVEfSR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEUSP()
|
private void MOVEUSP()
|
||||||
{
|
{
|
||||||
if (S == false)
|
if (S == false)
|
||||||
throw new Exception("MOVE to USP when not supervisor. needs to trap");
|
throw new Exception("MOVE to USP when not supervisor. needs to trap");
|
||||||
|
@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 4;
|
PendingCycles -= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVEUSP_Disasm(DisassemblyInfo info)
|
private void MOVEUSP_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int dir = (op >> 3) & 1;
|
int dir = (op >> 3) & 1;
|
||||||
|
@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANDI_SR()
|
private void ANDI_SR()
|
||||||
{
|
{
|
||||||
if (S == false)
|
if (S == false)
|
||||||
throw new Exception("trap!");
|
throw new Exception("trap!");
|
||||||
|
@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 20;
|
PendingCycles -= 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANDI_SR_Disasm(DisassemblyInfo info)
|
private void ANDI_SR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
info.Mnemonic = "andi";
|
info.Mnemonic = "andi";
|
||||||
|
@ -83,7 +83,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EORI_SR()
|
private void EORI_SR()
|
||||||
{
|
{
|
||||||
if (S == false)
|
if (S == false)
|
||||||
throw new Exception("trap!");
|
throw new Exception("trap!");
|
||||||
|
@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 20;
|
PendingCycles -= 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EORI_SR_Disasm(DisassemblyInfo info)
|
private void EORI_SR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
info.Mnemonic = "eori";
|
info.Mnemonic = "eori";
|
||||||
|
@ -99,7 +99,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ORI_SR()
|
private void ORI_SR()
|
||||||
{
|
{
|
||||||
if (S == false)
|
if (S == false)
|
||||||
throw new Exception("trap!");
|
throw new Exception("trap!");
|
||||||
|
@ -107,7 +107,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 20;
|
PendingCycles -= 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ORI_SR_Disasm(DisassemblyInfo info)
|
private void ORI_SR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
info.Mnemonic = "ori";
|
info.Mnemonic = "ori";
|
||||||
|
@ -115,7 +115,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVECCR()
|
private void MOVECCR()
|
||||||
{
|
{
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
int reg = (op >> 0) & 7;
|
int reg = (op >> 0) & 7;
|
||||||
|
@ -126,7 +126,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
PendingCycles -= 12 + EACyclesBW[mode, reg];
|
PendingCycles -= 12 + EACyclesBW[mode, reg];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MOVECCR_Disasm(DisassemblyInfo info)
|
private void MOVECCR_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
int pc = info.PC + 2;
|
int pc = info.PC + 2;
|
||||||
int mode = (op >> 3) & 7;
|
int mode = (op >> 3) & 7;
|
||||||
|
@ -136,20 +136,20 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
info.Length = pc - info.PC;
|
info.Length = pc - info.PC;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRAP()
|
private void TRAP()
|
||||||
{
|
{
|
||||||
int vector = 32 + (op & 0x0F);
|
int vector = 32 + (op & 0x0F);
|
||||||
TrapVector(vector);
|
TrapVector(vector);
|
||||||
PendingCycles -= 26;
|
PendingCycles -= 26;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TRAP_Disasm(DisassemblyInfo info)
|
private void TRAP_Disasm(DisassemblyInfo info)
|
||||||
{
|
{
|
||||||
info.Mnemonic = "trap";
|
info.Mnemonic = "trap";
|
||||||
info.Args = $"#${op & 0xF:X}";
|
info.Args = $"#${op & 0xF:X}";
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrapVector(int vector)
|
private void TrapVector(int vector)
|
||||||
{
|
{
|
||||||
short sr = (short)SR; // capture current SR.
|
short sr = (short)SR; // capture current SR.
|
||||||
S = true; // switch to supervisor mode, if not already in it.
|
S = true; // switch to supervisor mode, if not already in it.
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
public int PendingCycles;
|
public int PendingCycles;
|
||||||
|
|
||||||
// Status Registers
|
// Status Registers
|
||||||
int InterruptMaskLevel;
|
private int InterruptMaskLevel;
|
||||||
bool s, m;
|
private bool s, m;
|
||||||
int usp, ssp;
|
private int usp, ssp;
|
||||||
|
|
||||||
/// <summary>Machine/Interrupt mode</summary>
|
/// <summary>Machine/Interrupt mode</summary>
|
||||||
/// <remarks>TODO probably have some switch logic maybe</remarks>
|
/// <remarks>TODO probably have some switch logic maybe</remarks>
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
{
|
{
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
sbyte ReadValueB(int mode, int reg)
|
private sbyte ReadValueB(int mode, int reg)
|
||||||
{
|
{
|
||||||
sbyte value;
|
sbyte value;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -53,7 +53,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
short ReadValueW(int mode, int reg)
|
private short ReadValueW(int mode, int reg)
|
||||||
{
|
{
|
||||||
short value;
|
short value;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
int ReadValueL(int mode, int reg)
|
private int ReadValueL(int mode, int reg)
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -151,7 +151,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
sbyte PeekValueB(int mode, int reg)
|
private sbyte PeekValueB(int mode, int reg)
|
||||||
{
|
{
|
||||||
sbyte value;
|
sbyte value;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -198,7 +198,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
short PeekValueW(int mode, int reg)
|
private short PeekValueW(int mode, int reg)
|
||||||
{
|
{
|
||||||
short value;
|
short value;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -245,7 +245,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
int PeekValueL(int mode, int reg)
|
private int PeekValueL(int mode, int reg)
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -292,7 +292,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
int ReadAddress(int mode, int reg)
|
private int ReadAddress(int mode, int reg)
|
||||||
{
|
{
|
||||||
int addr;
|
int addr;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -318,7 +318,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
string DisassembleValue(int mode, int reg, int size, ref int pc)
|
private string DisassembleValue(int mode, int reg, int size, ref int pc)
|
||||||
{
|
{
|
||||||
string value;
|
string value;
|
||||||
int addr;
|
int addr;
|
||||||
|
@ -352,7 +352,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
string DisassembleImmediate(int size, ref int pc)
|
private string DisassembleImmediate(int size, ref int pc)
|
||||||
{
|
{
|
||||||
int immed;
|
int immed;
|
||||||
switch (size)
|
switch (size)
|
||||||
|
@ -370,7 +370,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new ArgumentException("Invalid size");
|
throw new ArgumentException("Invalid size");
|
||||||
}
|
}
|
||||||
|
|
||||||
string DisassembleAddress(int mode, int reg, ref int pc)
|
private string DisassembleAddress(int mode, int reg, ref int pc)
|
||||||
{
|
{
|
||||||
int addr;
|
int addr;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
@ -396,7 +396,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
throw new Exception("Invalid addressing mode!");
|
throw new Exception("Invalid addressing mode!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteValueB(int mode, int reg, sbyte value)
|
private void WriteValueB(int mode, int reg, sbyte value)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
@ -445,7 +445,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteValueW(int mode, int reg, short value)
|
private void WriteValueW(int mode, int reg, short value)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
@ -494,7 +494,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteValueL(int mode, int reg, int value)
|
private void WriteValueL(int mode, int reg, int value)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
@ -543,7 +543,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetIndex()
|
private int GetIndex()
|
||||||
{
|
{
|
||||||
//Console.WriteLine("IN INDEX PORTION - NOT VERIFIED!!!");
|
//Console.WriteLine("IN INDEX PORTION - NOT VERIFIED!!!");
|
||||||
// TODO kid chameleon triggers this in startup sequence
|
// TODO kid chameleon triggers this in startup sequence
|
||||||
|
@ -572,7 +572,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
return displacement + indexReg;
|
return displacement + indexReg;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PeekIndex()
|
private int PeekIndex()
|
||||||
{
|
{
|
||||||
//Console.WriteLine("IN INDEX PORTION - NOT VERIFIED!!!");
|
//Console.WriteLine("IN INDEX PORTION - NOT VERIFIED!!!");
|
||||||
|
|
||||||
|
@ -600,7 +600,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
return displacement + indexReg;
|
return displacement + indexReg;
|
||||||
}
|
}
|
||||||
|
|
||||||
string DisassembleIndex(string baseRegister, short extension)
|
private string DisassembleIndex(string baseRegister, short extension)
|
||||||
{
|
{
|
||||||
int d_a = (extension >> 15) & 0x1;
|
int d_a = (extension >> 15) & 0x1;
|
||||||
int reg = (extension >> 12) & 0x7;
|
int reg = (extension >> 12) & 0x7;
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
{
|
{
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
void BuildOpcodeTable()
|
private void BuildOpcodeTable()
|
||||||
{
|
{
|
||||||
// NOTE: Do not change the order of these assigns without testing. There is
|
// NOTE: Do not change the order of these assigns without testing. There is
|
||||||
// some overwriting of less-specific opcodes with more-specific opcodes.
|
// some overwriting of less-specific opcodes with more-specific opcodes.
|
||||||
|
@ -96,7 +96,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
Assign("trap", TRAP, "010011100100", "Data4");
|
Assign("trap", TRAP, "010011100100", "Data4");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Assign(string instr, Action exec, string root, params string[] bitfield)
|
private void Assign(string instr, Action exec, string root, params string[] bitfield)
|
||||||
{
|
{
|
||||||
List<string> opList = new List<string>();
|
List<string> opList = new List<string>();
|
||||||
opList.Add(root);
|
opList.Add(root);
|
||||||
|
@ -127,13 +127,13 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppendConstant(List<string> ops, string constant)
|
private void AppendConstant(List<string> ops, string constant)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ops.Count; i++)
|
for (int i = 0; i < ops.Count; i++)
|
||||||
ops[i] = ops[i] + constant;
|
ops[i] = ops[i] + constant;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> AppendPermutations(List<string> ops, string[] permutations)
|
private List<string> AppendPermutations(List<string> ops, string[] permutations)
|
||||||
{
|
{
|
||||||
List<string> output = new List<string>();
|
List<string> output = new List<string>();
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> AppendData(List<string> ops, int bits)
|
private List<string> AppendData(List<string> ops, int bits)
|
||||||
{
|
{
|
||||||
List<string> output = new List<string>();
|
List<string> output = new List<string>();
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
int BinaryExp(int bits)
|
private int BinaryExp(int bits)
|
||||||
{
|
{
|
||||||
int res = 1;
|
int res = 1;
|
||||||
for (int i = 0; i < bits; i++)
|
for (int i = 0; i < bits; i++)
|
||||||
|
@ -163,12 +163,12 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly string[] Size2_0 = { "01", "11", "10" };
|
private static readonly string[] Size2_0 = { "01", "11", "10" };
|
||||||
static readonly string[] Size2_1 = { "00", "01", "10" };
|
private static readonly string[] Size2_1 = { "00", "01", "10" };
|
||||||
static readonly string[] Size1 = { "0", "1" };
|
private static readonly string[] Size1 = { "0", "1" };
|
||||||
static readonly string[] Xn3 = { "000", "001", "010", "011", "100", "101", "110", "111" };
|
private static readonly string[] Xn3 = { "000", "001", "010", "011", "100", "101", "110", "111" };
|
||||||
|
|
||||||
static readonly string[] Xn3Am3 = {
|
private static readonly string[] Xn3Am3 = {
|
||||||
"000000", // Dn Data register
|
"000000", // Dn Data register
|
||||||
"001000",
|
"001000",
|
||||||
"010000",
|
"010000",
|
||||||
|
@ -239,7 +239,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
"100111", // #imm Immediate
|
"100111", // #imm Immediate
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] Am3Xn3 = {
|
private static readonly string[] Am3Xn3 = {
|
||||||
"000000", // Dn Data register
|
"000000", // Dn Data register
|
||||||
"000001",
|
"000001",
|
||||||
"000010",
|
"000010",
|
||||||
|
@ -310,7 +310,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
"111100", // #imm Immediate
|
"111100", // #imm Immediate
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] ConditionMain = {
|
private static readonly string[] ConditionMain = {
|
||||||
"0010", // HI Higher (unsigned)
|
"0010", // HI Higher (unsigned)
|
||||||
"0011", // LS Lower or Same (unsigned)
|
"0011", // LS Lower or Same (unsigned)
|
||||||
"0100", // CC Carry Clear (aka Higher or Same, unsigned)
|
"0100", // CC Carry Clear (aka Higher or Same, unsigned)
|
||||||
|
@ -327,7 +327,7 @@ namespace BizHawk.Emulation.Cores.Components.M68000
|
||||||
"1111" // LE Less or Equal (signed)
|
"1111" // LE Less or Equal (signed)
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] ConditionAll = {
|
private static readonly string[] ConditionAll = {
|
||||||
"0000", // T True
|
"0000", // T True
|
||||||
"0001", // F False
|
"0001", // F False
|
||||||
"0010", // HI Higher (unsigned)
|
"0010", // HI Higher (unsigned)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{
|
{
|
||||||
partial class MC68000
|
partial class MC68000
|
||||||
{
|
{
|
||||||
static readonly int[,] MoveCyclesBW = new int[12, 9]
|
private static readonly int[,] MoveCyclesBW = new int[12, 9]
|
||||||
{
|
{
|
||||||
{ 4, 4, 8, 8, 8, 12, 14, 12, 16 },
|
{ 4, 4, 8, 8, 8, 12, 14, 12, 16 },
|
||||||
{ 4, 4, 8, 8, 8, 12, 14, 12, 16 },
|
{ 4, 4, 8, 8, 8, 12, 14, 12, 16 },
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
{ 8, 8, 12, 12, 12, 16, 18, 16, 20 }
|
{ 8, 8, 12, 12, 12, 16, 18, 16, 20 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly int[,] MoveCyclesL = new int[12, 9]
|
private static readonly int[,] MoveCyclesL = new int[12, 9]
|
||||||
{
|
{
|
||||||
{ 4, 4, 12, 12, 12, 16, 18, 16, 20 },
|
{ 4, 4, 12, 12, 12, 16, 18, 16, 20 },
|
||||||
{ 4, 4, 12, 12, 12, 16, 18, 16, 20 },
|
{ 4, 4, 12, 12, 12, 16, 18, 16, 20 },
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
{ 12, 12, 20, 20, 20, 24, 26, 24, 28 }
|
{ 12, 12, 20, 20, 20, 24, 26, 24, 28 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly int[,] EACyclesBW = new int[8, 8]
|
private static readonly int[,] EACyclesBW = new int[8, 8]
|
||||||
{
|
{
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
{ 8, 12, 8, 10, 4, 99, 99, 99 }
|
{ 8, 12, 8, 10, 4, 99, 99, 99 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly int[,] EACyclesL = new int[8, 8]
|
private static readonly int[,] EACyclesL = new int[8, 8]
|
||||||
{
|
{
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||||
|
|
|
@ -2,7 +2,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
{
|
{
|
||||||
public partial class HuC6280
|
public partial class HuC6280
|
||||||
{
|
{
|
||||||
void CDLOpcode()
|
private void CDLOpcode()
|
||||||
{
|
{
|
||||||
byte tmp8;
|
byte tmp8;
|
||||||
byte opcode = ReadMemory(PC);
|
byte opcode = ReadMemory(PC);
|
||||||
|
|
|
@ -81,14 +81,14 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
CodeOperand = 0x80
|
CodeOperand = 0x80
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mark(ushort addr, CDLUsage flag)
|
private void Mark(ushort addr, CDLUsage flag)
|
||||||
{
|
{
|
||||||
var m = Mappings[MPR[addr >> 13]];
|
var m = Mappings[MPR[addr >> 13]];
|
||||||
CDL[m.Name][addr & 0x1fff | m.Offs] |= (byte)flag;
|
CDL[m.Name][addr & 0x1fff | m.Offs] |= (byte)flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark addr as having been fetched for execute
|
// mark addr as having been fetched for execute
|
||||||
void MarkCode(int addr_, int n)
|
private void MarkCode(int addr_, int n)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
|
@ -98,28 +98,28 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark addr as having been seen as data
|
// mark addr as having been seen as data
|
||||||
void MarkAddr(int addr_)
|
private void MarkAddr(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)addr_;
|
ushort addr = (ushort)addr_;
|
||||||
Mark(addr, CDLUsage.Data);
|
Mark(addr, CDLUsage.Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert address to zero-page, then mark as data
|
// convert address to zero-page, then mark as data
|
||||||
void MarkZP(int addr_)
|
private void MarkZP(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
|
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
|
||||||
Mark(addr, CDLUsage.Data);
|
Mark(addr, CDLUsage.Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert address to zero-page, then return the pointer stored there
|
// convert address to zero-page, then return the pointer stored there
|
||||||
ushort GetIndirect(int addr_)
|
private ushort GetIndirect(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
|
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
|
||||||
return ReadWordPageWrap(addr);
|
return ReadWordPageWrap(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert address to zero-page, then mark as pointer (two bytes)
|
// convert address to zero-page, then mark as pointer (two bytes)
|
||||||
void MarkZPPtr(int addr_)
|
private void MarkZPPtr(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
|
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
|
||||||
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
|
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
|
||||||
|
@ -128,14 +128,14 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark address as destination data of an indirect pointer
|
// mark address as destination data of an indirect pointer
|
||||||
void MarkIndirect(int addr_)
|
private void MarkIndirect(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)addr_;
|
ushort addr = (ushort)addr_;
|
||||||
Mark(addr, CDLUsage.IndirectData);
|
Mark(addr, CDLUsage.IndirectData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark stack space
|
// mark stack space
|
||||||
void MarkPush(int n)
|
private void MarkPush(int n)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
|
@ -144,7 +144,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MarkPop(int n)
|
private void MarkPop(int n)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
|
@ -154,7 +154,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark addr as function pointer (2 bytes)
|
// mark addr as function pointer (2 bytes)
|
||||||
void MarkFptr(int addr_)
|
private void MarkFptr(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)addr_;
|
ushort addr = (ushort)addr_;
|
||||||
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
|
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
|
||||||
|
@ -163,14 +163,14 @@ namespace BizHawk.Emulation.Cores.Components.H6280
|
||||||
}
|
}
|
||||||
|
|
||||||
// block transfer "from"
|
// block transfer "from"
|
||||||
void MarkBTFrom(int addr_)
|
private void MarkBTFrom(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)addr_;
|
ushort addr = (ushort)addr_;
|
||||||
Mark(addr, CDLUsage.BlockXFer);
|
Mark(addr, CDLUsage.BlockXFer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// block transfer "to"
|
// block transfer "to"
|
||||||
void MarkBTTo(int addr_)
|
private void MarkBTTo(int addr_)
|
||||||
{
|
{
|
||||||
ushort addr = (ushort)addr_;
|
ushort addr = (ushort)addr_;
|
||||||
Mark(addr, CDLUsage.BlockXFer);
|
Mark(addr, CDLUsage.BlockXFer);
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Components.I8048
|
||||||
{
|
{
|
||||||
public sealed partial class I8048
|
public sealed partial class I8048
|
||||||
{
|
{
|
||||||
static readonly string[] table =
|
private static readonly string[] table =
|
||||||
{
|
{
|
||||||
"NOP", // 00
|
"NOP", // 00
|
||||||
"???", // 01
|
"???", // 01
|
||||||
|
|
|
@ -13,9 +13,9 @@ namespace BizHawk.Emulation.Cores.Components.I8048
|
||||||
public int IRQS;
|
public int IRQS;
|
||||||
public int irq_pntr;
|
public int irq_pntr;
|
||||||
|
|
||||||
ushort reg_d_ad;
|
private ushort reg_d_ad;
|
||||||
ushort reg_h_ad;
|
private ushort reg_h_ad;
|
||||||
ushort reg_l_ad;
|
private ushort reg_l_ad;
|
||||||
|
|
||||||
public void FetchInstruction(byte opcode)
|
public void FetchInstruction(byte opcode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902
|
||||||
|
|
||||||
// unsaved variables
|
// unsaved variables
|
||||||
public bool checker;
|
public bool checker;
|
||||||
byte interrupt_src_reg, interrupt_enable_reg, buttons_pressed;
|
private byte interrupt_src_reg, interrupt_enable_reg, buttons_pressed;
|
||||||
|
|
||||||
public void BuildInstructionTable()
|
public void BuildInstructionTable()
|
||||||
{
|
{
|
||||||
|
|
|
@ -779,7 +779,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void FetchInstruction(int op)
|
private void FetchInstruction(int op)
|
||||||
{
|
{
|
||||||
instr_pntr = 0;
|
instr_pntr = 0;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Components.LR35902
|
||||||
// adapted from the information at http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html
|
// adapted from the information at http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html
|
||||||
public sealed partial class LR35902
|
public sealed partial class LR35902
|
||||||
{
|
{
|
||||||
static readonly string[] table =
|
private static readonly string[] table =
|
||||||
{
|
{
|
||||||
"NOP", // 00
|
"NOP", // 00
|
||||||
"LD BC,d16", // 01
|
"LD BC,d16", // 01
|
||||||
|
|
|
@ -5,10 +5,10 @@ namespace BizHawk.Emulation.Cores.Components.LR35902
|
||||||
public partial class LR35902
|
public partial class LR35902
|
||||||
{
|
{
|
||||||
// local variables for operations, not stated
|
// local variables for operations, not stated
|
||||||
int Reg16_d, Reg16_s, c;
|
private int Reg16_d, Reg16_s, c;
|
||||||
ushort ans, ans_l, ans_h, temp;
|
private ushort ans, ans_l, ans_h, temp;
|
||||||
byte a_d;
|
private byte a_d;
|
||||||
bool imm;
|
private bool imm;
|
||||||
|
|
||||||
public void Read_Func(ushort dest, ushort src_l, ushort src_h)
|
public void Read_Func(ushort dest, ushort src_l, ushort src_h)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6800
|
||||||
{
|
{
|
||||||
public sealed partial class MC6800
|
public sealed partial class MC6800
|
||||||
{
|
{
|
||||||
static readonly string[] table =
|
private static readonly string[] table =
|
||||||
{
|
{
|
||||||
"???", // 00
|
"???", // 00
|
||||||
"NOP", // 01
|
"NOP", // 01
|
||||||
|
|
|
@ -12,9 +12,9 @@ namespace BizHawk.Emulation.Cores.Components.MC6800
|
||||||
public int IRQS;
|
public int IRQS;
|
||||||
public int irq_pntr;
|
public int irq_pntr;
|
||||||
|
|
||||||
ushort reg_d_ad;
|
private ushort reg_d_ad;
|
||||||
ushort reg_h_ad;
|
private ushort reg_h_ad;
|
||||||
ushort reg_l_ad;
|
private ushort reg_l_ad;
|
||||||
|
|
||||||
public void FetchInstruction(byte opcode)
|
public void FetchInstruction(byte opcode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809
|
||||||
{
|
{
|
||||||
public sealed partial class MC6809
|
public sealed partial class MC6809
|
||||||
{
|
{
|
||||||
static readonly string[] table =
|
private static readonly string[] table =
|
||||||
{
|
{
|
||||||
"NEG DP+i8", // 00
|
"NEG DP+i8", // 00
|
||||||
"???", // 01
|
"???", // 01
|
||||||
|
@ -266,7 +266,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809
|
||||||
"ST U,ex16", // ff
|
"ST U,ex16", // ff
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] table2 =
|
private static readonly string[] table2 =
|
||||||
{
|
{
|
||||||
"???", // 00
|
"???", // 00
|
||||||
"???", // 01
|
"???", // 01
|
||||||
|
@ -526,7 +526,7 @@ namespace BizHawk.Emulation.Cores.Components.MC6809
|
||||||
"ST SP,ex16", // ff
|
"ST SP,ex16", // ff
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] table3 =
|
private static readonly string[] table3 =
|
||||||
{
|
{
|
||||||
"???", // 00
|
"???", // 00
|
||||||
"???", // 01
|
"???", // 01
|
||||||
|
|
|
@ -12,9 +12,9 @@ namespace BizHawk.Emulation.Cores.Components.MC6809
|
||||||
public int IRQS;
|
public int IRQS;
|
||||||
public int irq_pntr;
|
public int irq_pntr;
|
||||||
|
|
||||||
ushort reg_d_ad;
|
private ushort reg_d_ad;
|
||||||
ushort reg_h_ad;
|
private ushort reg_h_ad;
|
||||||
ushort reg_l_ad;
|
private ushort reg_l_ad;
|
||||||
|
|
||||||
public void FetchInstruction(byte opcode)
|
public void FetchInstruction(byte opcode)
|
||||||
{
|
{
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,11 +17,11 @@ using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Components.W65816
|
namespace BizHawk.Emulation.Cores.Components.W65816
|
||||||
{
|
{
|
||||||
class W65816_DisassemblerService : IDisassemblable
|
internal class W65816_DisassemblerService : IDisassemblable
|
||||||
{
|
{
|
||||||
public string Cpu { get; set; }
|
public string Cpu { get; set; }
|
||||||
|
|
||||||
readonly W65816 disassemblerCpu = new W65816();
|
private readonly W65816 disassemblerCpu = new W65816();
|
||||||
|
|
||||||
public IEnumerable<string> AvailableCpus
|
public IEnumerable<string> AvailableCpus
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Components.W65816
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class W65816
|
internal class W65816
|
||||||
{
|
{
|
||||||
//unsigned char *mem, unsigned long pos, unsigned char *flag, char *inst, unsigned char tsrc
|
//unsigned char *mem, unsigned long pos, unsigned char *flag, char *inst, unsigned char tsrc
|
||||||
//TODO - what ha ppens at the end of memory? make sure peek wraps around?
|
//TODO - what ha ppens at the end of memory? make sure peek wraps around?
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
{
|
{
|
||||||
public sealed partial class Z80A : IDisassemblable
|
public sealed partial class Z80A : IDisassemblable
|
||||||
{
|
{
|
||||||
static string Result(string format, Func<ushort, byte> read, ref ushort addr)
|
private static string Result(string format, Func<ushort, byte> read, ref ushort addr)
|
||||||
{
|
{
|
||||||
//d immediately succeeds the opcode
|
//d immediately succeeds the opcode
|
||||||
//n immediate succeeds the opcode and the displacement (if present)
|
//n immediate succeeds the opcode and the displacement (if present)
|
||||||
|
@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
return format;
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly string[] mnemonics =
|
private static readonly string[] mnemonics =
|
||||||
{
|
{
|
||||||
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
|
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
|
||||||
"INC B", "DEC B", "LD B, n", "RLCA", //0x08
|
"INC B", "DEC B", "LD B, n", "RLCA", //0x08
|
||||||
|
@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
"CALL M, nn", "[FD]", "CP n", "RST $38", //0x100
|
"CALL M, nn", "[FD]", "CP n", "RST $38", //0x100
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] mnemonicsDD =
|
private static readonly string[] mnemonicsDD =
|
||||||
{
|
{
|
||||||
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
|
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
|
||||||
"INC B", "DEC B", "LD B, n", "RLCA", //0x08
|
"INC B", "DEC B", "LD B, n", "RLCA", //0x08
|
||||||
|
@ -162,7 +162,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
"CALL M, nn", "[!!DD FD!!]", "CP n", "RST $38", //0x100
|
"CALL M, nn", "[!!DD FD!!]", "CP n", "RST $38", //0x100
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] mnemonicsFD =
|
private static readonly string[] mnemonicsFD =
|
||||||
{
|
{
|
||||||
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
|
"NOP", "LD BC, nn", "LD (BC), A", "INC BC", //0x04
|
||||||
"INC B", "DEC B", "LD B, n", "RLCA", //0x08
|
"INC B", "DEC B", "LD B, n", "RLCA", //0x08
|
||||||
|
@ -230,7 +230,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
"CALL M, nn", "[!FD FD!]", "CP n", "RST $38", //0x100
|
"CALL M, nn", "[!FD FD!]", "CP n", "RST $38", //0x100
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] mnemonicsDDCB =
|
private static readonly string[] mnemonicsDDCB =
|
||||||
{
|
{
|
||||||
"RLC (IX+d)->B", "RLC (IX+d)->C", "RLC (IX+d)->D", "RLC (IX+d)->E", "RLC (IX+d)->H", "RLC (IX+d)->L", "RLC (IX+d)", "RLC (IX+d)->A",
|
"RLC (IX+d)->B", "RLC (IX+d)->C", "RLC (IX+d)->D", "RLC (IX+d)->E", "RLC (IX+d)->H", "RLC (IX+d)->L", "RLC (IX+d)", "RLC (IX+d)->A",
|
||||||
"RRC (IX+d)->B", "RRC (IX+d)->C", "RRC (IX+d)->D", "RRC (IX+d)->E", "RRC (IX+d)->H", "RRC (IX+d)->L", "RRC (IX+d)", "RRC (IX+d)->A",
|
"RRC (IX+d)->B", "RRC (IX+d)->C", "RRC (IX+d)->D", "RRC (IX+d)->E", "RRC (IX+d)->H", "RRC (IX+d)->L", "RRC (IX+d)", "RRC (IX+d)->A",
|
||||||
|
@ -266,7 +266,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
"SET 7 (IX+d)->B", "SET 7 (IX+d)->C", "SET 7 (IX+d)->D", "SET 7 (IX+d)->E", "SET 7 (IX+d)->H", "SET 7 (IX+d)->L", "SET 7 (IX+d)", "SET 7 (IX+d)->A",
|
"SET 7 (IX+d)->B", "SET 7 (IX+d)->C", "SET 7 (IX+d)->D", "SET 7 (IX+d)->E", "SET 7 (IX+d)->H", "SET 7 (IX+d)->L", "SET 7 (IX+d)", "SET 7 (IX+d)->A",
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] mnemonicsFDCB =
|
private static readonly string[] mnemonicsFDCB =
|
||||||
{
|
{
|
||||||
"RLC (IY+d)->B", "RLC (IY+d)->C", "RLC (IY+d)->D", "RLC (IY+d)->E", "RLC (IY+d)->H", "RLC (IY+d)->L", "RLC (IY+d)", "RLC (IY+d)->A",
|
"RLC (IY+d)->B", "RLC (IY+d)->C", "RLC (IY+d)->D", "RLC (IY+d)->E", "RLC (IY+d)->H", "RLC (IY+d)->L", "RLC (IY+d)", "RLC (IY+d)->A",
|
||||||
"RRC (IY+d)->B", "RRC (IY+d)->C", "RRC (IY+d)->D", "RRC (IY+d)->E", "RRC (IY+d)->H", "RRC (IY+d)->L", "RRC (IY+d)", "RRC (IY+d)->A",
|
"RRC (IY+d)->B", "RRC (IY+d)->C", "RRC (IY+d)->D", "RRC (IY+d)->E", "RRC (IY+d)->H", "RRC (IY+d)->L", "RRC (IY+d)", "RRC (IY+d)->A",
|
||||||
|
@ -302,7 +302,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
"SET 7 (IY+d)->B", "SET 7 (IY+d)->C", "SET 7 (IY+d)->D", "SET 7 (IY+d)->E", "SET 7 (IY+d)->H", "SET 7 (IY+d)->L", "SET 7 (IY+d)", "SET 7 (IY+d)->A",
|
"SET 7 (IY+d)->B", "SET 7 (IY+d)->C", "SET 7 (IY+d)->D", "SET 7 (IY+d)->E", "SET 7 (IY+d)->H", "SET 7 (IY+d)->L", "SET 7 (IY+d)", "SET 7 (IY+d)->A",
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] mnemonicsCB =
|
private static readonly string[] mnemonicsCB =
|
||||||
{
|
{
|
||||||
"RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (HL)", "RLC A",
|
"RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (HL)", "RLC A",
|
||||||
"RRC B", "RRC C", "RRC D", "RRC E", "RRC H", "RRC L", "RRC (HL)", "RRC A",
|
"RRC B", "RRC C", "RRC D", "RRC E", "RRC H", "RRC L", "RRC (HL)", "RRC A",
|
||||||
|
@ -338,7 +338,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80A
|
||||||
"SET 7, B", "SET 7, C", "SET 7, D", "SET 7, E", "SET 7, H", "SET 7, L", "SET 7, (HL)", "SET 7, A",
|
"SET 7, B", "SET 7, C", "SET 7, D", "SET 7, E", "SET 7, H", "SET 7, L", "SET 7, (HL)", "SET 7, A",
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly string[] mnemonicsED =
|
private static readonly string[] mnemonicsED =
|
||||||
{
|
{
|
||||||
"NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP",
|
"NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP",
|
||||||
"NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP",
|
"NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP", "NOP",
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
||||||
public string Media { get; set; }
|
public string Media { get; set; }
|
||||||
public string OtherMisc { get; set; }
|
public string OtherMisc { get; set; }
|
||||||
|
|
||||||
readonly Dictionary<string, string> Data = new Dictionary<string, string>();
|
private readonly Dictionary<string, string> Data = new Dictionary<string, string>();
|
||||||
|
|
||||||
public static CPCMachineMetaData GetMetaObject(MachineType type)
|
public static CPCMachineMetaData GetMetaObject(MachineType type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1094,30 +1094,30 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
|
||||||
}
|
}
|
||||||
|
|
||||||
/* persistent switch signals */
|
/* persistent switch signals */
|
||||||
bool s_VS;
|
private bool s_VS;
|
||||||
bool s_HDISP;
|
private bool s_HDISP;
|
||||||
bool s_VDISP;
|
private bool s_VDISP;
|
||||||
bool s_HSYNC;
|
private bool s_HSYNC;
|
||||||
|
|
||||||
/* Other chip counters */
|
/* Other chip counters */
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Linear Address Generator counter latch
|
/// Linear Address Generator counter latch
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int LAG_Counter_Latch;
|
private int LAG_Counter_Latch;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Linear Address Generator row counter latch
|
/// Linear Address Generator row counter latch
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int LAG_Counter_RowLatch;
|
private int LAG_Counter_RowLatch;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Linear Address Generator counter
|
/// Linear Address Generator counter
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int LAG_Counter;
|
private int LAG_Counter;
|
||||||
|
|
||||||
int DISPTMG_Delay_Counter;
|
private int DISPTMG_Delay_Counter;
|
||||||
int CUDISP_Delay_Counter;
|
private int CUDISP_Delay_Counter;
|
||||||
int CUR_Field_Counter;
|
private int CUR_Field_Counter;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs a generic CRTC cycle
|
/// Runs a generic CRTC cycle
|
||||||
|
|
|
@ -6,38 +6,38 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract partial class CPCBase
|
public abstract partial class CPCBase
|
||||||
{
|
{
|
||||||
readonly string Play = "Play Tape";
|
private readonly string Play = "Play Tape";
|
||||||
readonly string Stop = "Stop Tape";
|
private readonly string Stop = "Stop Tape";
|
||||||
readonly string RTZ = "RTZ Tape";
|
private readonly string RTZ = "RTZ Tape";
|
||||||
readonly string Record = "Record Tape";
|
private readonly string Record = "Record Tape";
|
||||||
readonly string NextTape = "Insert Next Tape";
|
private readonly string NextTape = "Insert Next Tape";
|
||||||
readonly string PrevTape = "Insert Previous Tape";
|
private readonly string PrevTape = "Insert Previous Tape";
|
||||||
readonly string NextBlock = "Next Tape Block";
|
private readonly string NextBlock = "Next Tape Block";
|
||||||
readonly string PrevBlock = "Prev Tape Block";
|
private readonly string PrevBlock = "Prev Tape Block";
|
||||||
readonly string TapeStatus = "Get Tape Status";
|
private readonly string TapeStatus = "Get Tape Status";
|
||||||
|
|
||||||
readonly string NextDisk = "Insert Next Disk";
|
private readonly string NextDisk = "Insert Next Disk";
|
||||||
readonly string PrevDisk = "Insert Previous Disk";
|
private readonly string PrevDisk = "Insert Previous Disk";
|
||||||
readonly string EjectDisk = "Eject Current Disk";
|
private readonly string EjectDisk = "Eject Current Disk";
|
||||||
readonly string DiskStatus = "Get Disk Status";
|
private readonly string DiskStatus = "Get Disk Status";
|
||||||
|
|
||||||
readonly string HardResetStr = "Power";
|
private readonly string HardResetStr = "Power";
|
||||||
readonly string SoftResetStr = "Reset";
|
private readonly string SoftResetStr = "Reset";
|
||||||
|
|
||||||
bool pressed_Play = false;
|
private bool pressed_Play = false;
|
||||||
bool pressed_Stop = false;
|
private bool pressed_Stop = false;
|
||||||
bool pressed_RTZ = false;
|
private bool pressed_RTZ = false;
|
||||||
bool pressed_NextTape = false;
|
private bool pressed_NextTape = false;
|
||||||
bool pressed_PrevTape = false;
|
private bool pressed_PrevTape = false;
|
||||||
bool pressed_NextBlock = false;
|
private bool pressed_NextBlock = false;
|
||||||
bool pressed_PrevBlock = false;
|
private bool pressed_PrevBlock = false;
|
||||||
bool pressed_TapeStatus = false;
|
private bool pressed_TapeStatus = false;
|
||||||
bool pressed_NextDisk = false;
|
private bool pressed_NextDisk = false;
|
||||||
bool pressed_PrevDisk = false;
|
private bool pressed_PrevDisk = false;
|
||||||
bool pressed_EjectDisk = false;
|
private bool pressed_EjectDisk = false;
|
||||||
bool pressed_DiskStatus = false;
|
private bool pressed_DiskStatus = false;
|
||||||
bool pressed_HardReset = false;
|
private bool pressed_HardReset = false;
|
||||||
bool pressed_SoftReset = false;
|
private bool pressed_SoftReset = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cycles through all the input callbacks
|
/// Cycles through all the input callbacks
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Media
|
||||||
{
|
{
|
||||||
public static class D64
|
public static class D64
|
||||||
{
|
{
|
||||||
const int D64_DISK_ID_OFFSET = 0x165A2; // track 18, sector 0, 0xA2
|
private const int D64_DISK_ID_OFFSET = 0x165A2; // track 18, sector 0, 0xA2
|
||||||
|
|
||||||
private enum ErrorType
|
private enum ErrorType
|
||||||
{
|
{
|
||||||
|
|
|
@ -170,7 +170,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX
|
||||||
public int[] Aud = new int [9000];
|
public int[] Aud = new int [9000];
|
||||||
public uint num_samp;
|
public uint num_samp;
|
||||||
|
|
||||||
const int blipbuffsize = 4500;
|
private const int blipbuffsize = 4500;
|
||||||
|
|
||||||
public bool CanProvideAsync => false;
|
public bool CanProvideAsync => false;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX
|
||||||
private readonly Dictionary<string, MemoryDomainByteArray> _byteArrayDomains = new Dictionary<string, MemoryDomainByteArray>();
|
private readonly Dictionary<string, MemoryDomainByteArray> _byteArrayDomains = new Dictionary<string, MemoryDomainByteArray>();
|
||||||
private bool _memoryDomainsInit = false;
|
private bool _memoryDomainsInit = false;
|
||||||
|
|
||||||
void SetupMemoryDomains()
|
private void SetupMemoryDomains()
|
||||||
{
|
{
|
||||||
var domains = new List<MemoryDomain>
|
var domains = new List<MemoryDomain>
|
||||||
{
|
{
|
||||||
|
|
|
@ -100,8 +100,8 @@ namespace BizHawk.Emulation.Cores.Computers.MSX
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IntPtr MSX_Pntr { get; set; } = IntPtr.Zero;
|
private IntPtr MSX_Pntr { get; set; } = IntPtr.Zero;
|
||||||
byte[] MSX_core = new byte[0x20000];
|
private byte[] MSX_core = new byte[0x20000];
|
||||||
public static byte[] Bios = null;
|
public static byte[] Bios = null;
|
||||||
public static byte[] Basic;
|
public static byte[] Basic;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 128K/+2 ULA
|
/// 128K/+2 ULA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class ScreenPentagon128 : ULA
|
internal class ScreenPentagon128 : ULA
|
||||||
{
|
{
|
||||||
public ScreenPentagon128(SpectrumBase machine)
|
public ScreenPentagon128(SpectrumBase machine)
|
||||||
: base(machine)
|
: base(machine)
|
||||||
|
|
|
@ -9,38 +9,38 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract partial class SpectrumBase
|
public abstract partial class SpectrumBase
|
||||||
{
|
{
|
||||||
readonly string Play = "Play Tape";
|
private readonly string Play = "Play Tape";
|
||||||
readonly string Stop = "Stop Tape";
|
private readonly string Stop = "Stop Tape";
|
||||||
readonly string RTZ = "RTZ Tape";
|
private readonly string RTZ = "RTZ Tape";
|
||||||
readonly string Record = "Record Tape";
|
private readonly string Record = "Record Tape";
|
||||||
readonly string NextTape = "Insert Next Tape";
|
private readonly string NextTape = "Insert Next Tape";
|
||||||
readonly string PrevTape = "Insert Previous Tape";
|
private readonly string PrevTape = "Insert Previous Tape";
|
||||||
readonly string NextBlock = "Next Tape Block";
|
private readonly string NextBlock = "Next Tape Block";
|
||||||
readonly string PrevBlock = "Prev Tape Block";
|
private readonly string PrevBlock = "Prev Tape Block";
|
||||||
readonly string TapeStatus = "Get Tape Status";
|
private readonly string TapeStatus = "Get Tape Status";
|
||||||
|
|
||||||
readonly string NextDisk = "Insert Next Disk";
|
private readonly string NextDisk = "Insert Next Disk";
|
||||||
readonly string PrevDisk = "Insert Previous Disk";
|
private readonly string PrevDisk = "Insert Previous Disk";
|
||||||
readonly string EjectDisk = "Eject Current Disk";
|
private readonly string EjectDisk = "Eject Current Disk";
|
||||||
readonly string DiskStatus = "Get Disk Status";
|
private readonly string DiskStatus = "Get Disk Status";
|
||||||
|
|
||||||
readonly string HardResetStr = "Power";
|
private readonly string HardResetStr = "Power";
|
||||||
readonly string SoftResetStr = "Reset";
|
private readonly string SoftResetStr = "Reset";
|
||||||
|
|
||||||
bool pressed_Play;
|
private bool pressed_Play;
|
||||||
bool pressed_Stop;
|
private bool pressed_Stop;
|
||||||
bool pressed_RTZ;
|
private bool pressed_RTZ;
|
||||||
bool pressed_NextTape;
|
private bool pressed_NextTape;
|
||||||
bool pressed_PrevTape;
|
private bool pressed_PrevTape;
|
||||||
bool pressed_NextBlock;
|
private bool pressed_NextBlock;
|
||||||
bool pressed_PrevBlock;
|
private bool pressed_PrevBlock;
|
||||||
bool pressed_TapeStatus;
|
private bool pressed_TapeStatus;
|
||||||
bool pressed_NextDisk;
|
private bool pressed_NextDisk;
|
||||||
bool pressed_PrevDisk;
|
private bool pressed_PrevDisk;
|
||||||
bool pressed_EjectDisk;
|
private bool pressed_EjectDisk;
|
||||||
bool pressed_DiskStatus;
|
private bool pressed_DiskStatus;
|
||||||
bool pressed_HardReset;
|
private bool pressed_HardReset;
|
||||||
bool pressed_SoftReset;
|
private bool pressed_SoftReset;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cycles through all the input callbacks
|
/// Cycles through all the input callbacks
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 128K/+2 ULA
|
/// 128K/+2 ULA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class Screen128 : ULA
|
internal class Screen128 : ULA
|
||||||
{
|
{
|
||||||
public Screen128(SpectrumBase machine)
|
public Screen128(SpectrumBase machine)
|
||||||
: base(machine)
|
: base(machine)
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// +2A/+3 ULA
|
/// +2A/+3 ULA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class Screen128Plus2a : ULA
|
internal class Screen128Plus2a : ULA
|
||||||
{
|
{
|
||||||
public Screen128Plus2a(SpectrumBase machine)
|
public Screen128Plus2a(SpectrumBase machine)
|
||||||
: base(machine)
|
: base(machine)
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 48K ULA
|
/// 48K ULA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class Screen48 : ULA
|
internal class Screen48 : ULA
|
||||||
{
|
{
|
||||||
public Screen48(SpectrumBase machine)
|
public Screen48(SpectrumBase machine)
|
||||||
: base(machine)
|
: base(machine)
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
|
||||||
{
|
{
|
||||||
public A7800Hawk Core { get; set; }
|
public A7800Hawk Core { get; set; }
|
||||||
|
|
||||||
struct GFX_Object
|
private struct GFX_Object
|
||||||
{
|
{
|
||||||
public byte palette;
|
public byte palette;
|
||||||
public byte width;
|
public byte width;
|
||||||
|
@ -24,12 +24,12 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
|
||||||
|
|
||||||
// technically there is no limit on the number of graphics objects, but since dma is automatically killed
|
// technically there is no limit on the number of graphics objects, but since dma is automatically killed
|
||||||
// at the end of a scanline, we have an effective limit
|
// at the end of a scanline, we have an effective limit
|
||||||
readonly GFX_Object[] GFX_Objects = new GFX_Object[128];
|
private readonly GFX_Object[] GFX_Objects = new GFX_Object[128];
|
||||||
|
|
||||||
public byte[,] line_ram = new byte[2, 320];
|
public byte[,] line_ram = new byte[2, 320];
|
||||||
byte temp_check = 0;
|
private byte temp_check = 0;
|
||||||
|
|
||||||
int GFX_index = 0;
|
private int GFX_index = 0;
|
||||||
|
|
||||||
public int[] _palette;
|
public int[] _palette;
|
||||||
public int[] scanline_buffer = new int[320];
|
public int[] scanline_buffer = new int[320];
|
||||||
|
@ -77,14 +77,14 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
|
||||||
public bool zero_hole; // the first DMA hole does not save cycles
|
public bool zero_hole; // the first DMA hole does not save cycles
|
||||||
|
|
||||||
// variables for drawing a pixel
|
// variables for drawing a pixel
|
||||||
int color;
|
private int color;
|
||||||
int local_GFX_index;
|
private int local_GFX_index;
|
||||||
int temp_palette;
|
private int temp_palette;
|
||||||
int temp_bit_0;
|
private int temp_bit_0;
|
||||||
int temp_bit_1;
|
private int temp_bit_1;
|
||||||
int disp_mode;
|
private int disp_mode;
|
||||||
byte BG_latch_1;
|
private byte BG_latch_1;
|
||||||
int pixel;
|
private int pixel;
|
||||||
|
|
||||||
// each frame contains 263 scanlines
|
// each frame contains 263 scanlines
|
||||||
// each scanline consists of 113.5 CPU cycles (fast access) which equates to 454 Maria cycles
|
// each scanline consists of 113.5 CPU cycles (fast access) which equates to 454 Maria cycles
|
||||||
|
|
|
@ -235,7 +235,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderBackgroundM2(int scanLine)
|
private void RenderBackgroundM2(int scanLine)
|
||||||
{
|
{
|
||||||
if (DisplayOn == false)
|
if (DisplayOn == false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed partial class F3850 : IDisassemblable
|
public sealed partial class F3850 : IDisassemblable
|
||||||
{
|
{
|
||||||
static string Result(string format, Func<ushort, byte> read, ref ushort addr)
|
private static string Result(string format, Func<ushort, byte> read, ref ushort addr)
|
||||||
{
|
{
|
||||||
//d immediately succeeds the opcode
|
//d immediately succeeds the opcode
|
||||||
//n immediate succeeds the opcode and the displacement (if present)
|
//n immediate succeeds the opcode and the displacement (if present)
|
||||||
|
@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static readonly string[] mnemonics =
|
private static readonly string[] mnemonics =
|
||||||
{
|
{
|
||||||
"LR A, KU", // 0x00
|
"LR A, KU", // 0x00
|
||||||
"LR A, KL", // 0x01
|
"LR A, KL", // 0x01
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
|
||||||
|
|
||||||
public ControllerDefinition ControllerDefinition => _controllerDeck.Definition;
|
public ControllerDefinition ControllerDefinition => _controllerDeck.Definition;
|
||||||
|
|
||||||
byte joy1_LR, joy2_LR, joy1_UD, joy2_UD;
|
private byte joy1_LR, joy2_LR, joy1_UD, joy2_UD;
|
||||||
|
|
||||||
public bool FrameAdvance(IController controller, bool render, bool rendersound)
|
public bool FrameAdvance(IController controller, bool render, bool rendersound)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
_cdl[type][cdladdr] |= (byte)flags;
|
_cdl[type][cdladdr] |= (byte)flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLCpuCallback(ushort addr, I8048.eCDLogMemFlags flags)
|
private void CDLCpuCallback(ushort addr, I8048.eCDLogMemFlags flags)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (addr < 0x400)
|
if (addr < 0x400)
|
||||||
|
|
|
@ -53,11 +53,11 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
public int LY_ret;
|
public int LY_ret;
|
||||||
|
|
||||||
// local variables not stated
|
// local variables not stated
|
||||||
int current_pixel_offset;
|
private int current_pixel_offset;
|
||||||
int double_size;
|
private int double_size;
|
||||||
int right_shift;
|
private int right_shift;
|
||||||
int right_shift_even;
|
private int right_shift_even;
|
||||||
int x_base;
|
private int x_base;
|
||||||
|
|
||||||
public virtual byte ReadReg(int addr)
|
public virtual byte ReadReg(int addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CallingConvention cc = CallingConvention.Cdecl;
|
private const CallingConvention cc = CallingConvention.Cdecl;
|
||||||
|
|
||||||
public enum SaveType : int
|
public enum SaveType : int
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
_cdl[type][cdladdr] |= (byte)flags;
|
_cdl[type][cdladdr] |= (byte)flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
private void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
||||||
{
|
{
|
||||||
if (addr < 0x8000)
|
if (addr < 0x8000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
// this occurs when the Boot Rom is loading the nintendo logo into VRAM
|
// this occurs when the Boot Rom is loading the nintendo logo into VRAM
|
||||||
// instead of tracking that in the main memory map where it will just slow things down for no reason
|
// instead of tracking that in the main memory map where it will just slow things down for no reason
|
||||||
// we'll clear the 'locked' flag when the last byte of the logo is read
|
// we'll clear the 'locked' flag when the last byte of the logo is read
|
||||||
class MapperSachen1 : MapperBase
|
internal class MapperSachen1 : MapperBase
|
||||||
{
|
{
|
||||||
public int ROM_bank;
|
public int ROM_bank;
|
||||||
public bool locked;
|
public bool locked;
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
// this occurs when the Boot Rom is loading the nintendo logo into VRAM
|
// this occurs when the Boot Rom is loading the nintendo logo into VRAM
|
||||||
// instead of tracking that in the main memory map where it will just slow things down for no reason
|
// instead of tracking that in the main memory map where it will just slow things down for no reason
|
||||||
// we'll clear the 'locked' flag when the last byte of the logo is read
|
// we'll clear the 'locked' flag when the last byte of the logo is read
|
||||||
class MapperSachen2 : MapperBase
|
internal class MapperSachen2 : MapperBase
|
||||||
{
|
{
|
||||||
public int ROM_bank;
|
public int ROM_bank;
|
||||||
public bool locked, locked_GBC, finished;
|
public bool locked, locked_GBC, finished;
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||||
_cdl[type][cdladdr] |= (byte)flags;
|
_cdl[type][cdladdr] |= (byte)flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
private void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
||||||
{
|
{
|
||||||
if (addr < 0x8000)
|
if (addr < 0x8000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
|
||||||
_cdl[type][cdladdr] |= (byte)flags;
|
_cdl[type][cdladdr] |= (byte)flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
private void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
||||||
{
|
{
|
||||||
if (addr < 0x8000)
|
if (addr < 0x8000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x
|
||||||
_cdl[type][cdladdr] |= (byte)flags;
|
_cdl[type][cdladdr] |= (byte)flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
private void CDLCpuCallback(ushort addr, LR35902.eCDLogMemFlags flags)
|
||||||
{
|
{
|
||||||
if (addr < 0x8000)
|
if (addr < 0x8000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -436,7 +436,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GambattePrinter printer;
|
private GambattePrinter printer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// set up Printer callback
|
/// set up Printer callback
|
||||||
|
@ -462,8 +462,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LibGambatte.ScanlineCallback scanlinecb;
|
private LibGambatte.ScanlineCallback scanlinecb;
|
||||||
ScanlineCallback endofframecallback;
|
private ScanlineCallback endofframecallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// update gambatte core's internal colors
|
/// update gambatte core's internal colors
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
// if true, the link cable toggle signal is currently asserted
|
// if true, the link cable toggle signal is currently asserted
|
||||||
private bool _cablediscosignal = false;
|
private bool _cablediscosignal = false;
|
||||||
|
|
||||||
const int SampPerFrame = 35112;
|
private const int SampPerFrame = 35112;
|
||||||
|
|
||||||
private readonly SaveController LCont = new SaveController(Gameboy.GbController);
|
private readonly SaveController LCont = new SaveController(Gameboy.GbController);
|
||||||
private readonly SaveController RCont = new SaveController(Gameboy.GbController);
|
private readonly SaveController RCont = new SaveController(Gameboy.GbController);
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
{
|
{
|
||||||
// A loose c->c# port of SameBoy's printer code
|
// A loose c->c# port of SameBoy's printer code
|
||||||
|
|
||||||
enum CommandState : byte
|
private enum CommandState : byte
|
||||||
{
|
{
|
||||||
GB_PRINTER_COMMAND_MAGIC1,
|
GB_PRINTER_COMMAND_MAGIC1,
|
||||||
GB_PRINTER_COMMAND_MAGIC2,
|
GB_PRINTER_COMMAND_MAGIC2,
|
||||||
|
@ -25,7 +25,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
GB_PRINTER_COMMAND_ACTIVE,
|
GB_PRINTER_COMMAND_ACTIVE,
|
||||||
GB_PRINTER_COMMAND_STATUS,
|
GB_PRINTER_COMMAND_STATUS,
|
||||||
}
|
}
|
||||||
enum CommandID : byte
|
|
||||||
|
private enum CommandID : byte
|
||||||
{
|
{
|
||||||
GB_PRINTER_INIT_COMMAND = 1,
|
GB_PRINTER_INIT_COMMAND = 1,
|
||||||
GB_PRINTER_START_COMMAND = 2,
|
GB_PRINTER_START_COMMAND = 2,
|
||||||
|
@ -33,30 +34,30 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
GB_PRINTER_NOP_COMMAND = 0xF,
|
GB_PRINTER_NOP_COMMAND = 0xF,
|
||||||
}
|
}
|
||||||
|
|
||||||
const int GB_PRINTER_MAX_COMMAND_LENGTH = 0x280;
|
private const int GB_PRINTER_MAX_COMMAND_LENGTH = 0x280;
|
||||||
const int GB_PRINTER_DATA_SIZE = 0x280;
|
private const int GB_PRINTER_DATA_SIZE = 0x280;
|
||||||
|
|
||||||
const ushort SerialIRQAddress = 0x58;
|
private const ushort SerialIRQAddress = 0x58;
|
||||||
|
|
||||||
readonly Gameboy gb;
|
private readonly Gameboy gb;
|
||||||
readonly PrinterCallback callback;
|
private readonly PrinterCallback callback;
|
||||||
LibGambatte.LinkCallback linkCallback;
|
private LibGambatte.LinkCallback linkCallback;
|
||||||
|
|
||||||
CommandState command_state;
|
private CommandState command_state;
|
||||||
CommandID command_id;
|
private CommandID command_id;
|
||||||
|
|
||||||
bool compression;
|
private bool compression;
|
||||||
ushort length_left;
|
private ushort length_left;
|
||||||
readonly byte[] command_data = new byte[GB_PRINTER_MAX_COMMAND_LENGTH];
|
private readonly byte[] command_data = new byte[GB_PRINTER_MAX_COMMAND_LENGTH];
|
||||||
ushort command_length;
|
private ushort command_length;
|
||||||
ushort checksum;
|
private ushort checksum;
|
||||||
byte status;
|
private byte status;
|
||||||
|
|
||||||
readonly byte[] image = new byte[160 * 200];
|
private readonly byte[] image = new byte[160 * 200];
|
||||||
ushort image_offset;
|
private ushort image_offset;
|
||||||
|
|
||||||
byte compression_run_lenth;
|
private byte compression_run_lenth;
|
||||||
bool compression_run_is_compressed;
|
private bool compression_run_is_compressed;
|
||||||
|
|
||||||
public GambattePrinter(Gameboy gb, PrinterCallback callback)
|
public GambattePrinter(Gameboy gb, PrinterCallback callback)
|
||||||
{
|
{
|
||||||
|
@ -76,7 +77,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
LibGambatte.gambatte_setlinkcallback(gb.GambatteState, null);
|
LibGambatte.gambatte_setlinkcallback(gb.GambatteState, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnSerial()
|
private void OnSerial()
|
||||||
{
|
{
|
||||||
if (LibGambatte.gambatte_linkstatus(gb.GambatteState, 256) != 0) // ClockTrigger
|
if (LibGambatte.gambatte_linkstatus(gb.GambatteState, 256) != 0) // ClockTrigger
|
||||||
{
|
{
|
||||||
|
@ -87,7 +88,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
byte HandleSerial(byte byte_received)
|
private byte HandleSerial(byte byte_received)
|
||||||
{
|
{
|
||||||
byte byte_to_send = 0;
|
byte byte_to_send = 0;
|
||||||
|
|
||||||
|
@ -228,7 +229,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
||||||
return byte_to_send;
|
return byte_to_send;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleCommand()
|
private void HandleCommand()
|
||||||
{
|
{
|
||||||
switch (command_id)
|
switch (command_id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using BizHawk.Emulation.Cores.Nintendo.N64.NativeApi;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.N64
|
namespace BizHawk.Emulation.Cores.Nintendo.N64
|
||||||
{
|
{
|
||||||
class N64Audio : IDisposable
|
internal class N64Audio : IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// mupen64 DLL Api
|
/// mupen64 DLL Api
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
{
|
{
|
||||||
class mupen64plusAudioApi
|
internal class mupen64plusAudioApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle to native audio plugin
|
/// Handle to native audio plugin
|
||||||
|
@ -16,7 +16,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <returns>The size of the mupen64plus audio buffer</returns>
|
/// <returns>The size of the mupen64plus audio buffer</returns>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate int GetBufferSize();
|
private delegate int GetBufferSize();
|
||||||
readonly GetBufferSize dllGetBufferSize;
|
|
||||||
|
private readonly GetBufferSize dllGetBufferSize;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the audio buffer from mupen64plus, and then clears it
|
/// Gets the audio buffer from mupen64plus, and then clears it
|
||||||
|
@ -24,7 +25,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="dest">The buffer to fill with samples</param>
|
/// <param name="dest">The buffer to fill with samples</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate void ReadAudioBuffer(short[] dest);
|
private delegate void ReadAudioBuffer(short[] dest);
|
||||||
readonly ReadAudioBuffer dllReadAudioBuffer;
|
|
||||||
|
private readonly ReadAudioBuffer dllReadAudioBuffer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current audio rate from mupen64plus
|
/// Gets the current audio rate from mupen64plus
|
||||||
|
@ -32,7 +34,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <returns>The current audio rate</returns>
|
/// <returns>The current audio rate</returns>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate int GetAudioRate();
|
private delegate int GetAudioRate();
|
||||||
readonly GetAudioRate dllGetAudioRate;
|
|
||||||
|
private readonly GetAudioRate dllGetAudioRate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads native functions and attaches itself to the core
|
/// Loads native functions and attaches itself to the core
|
||||||
|
|
|
@ -15,18 +15,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
// Only left in because api needs to know the number of frames passed
|
// Only left in because api needs to know the number of frames passed
|
||||||
// because of a bug
|
// because of a bug
|
||||||
private readonly N64 bizhawkCore;
|
private readonly N64 bizhawkCore;
|
||||||
static mupen64plusApi AttachedCore = null;
|
private static mupen64plusApi AttachedCore = null;
|
||||||
|
|
||||||
bool disposed = false;
|
private bool disposed = false;
|
||||||
|
|
||||||
readonly Thread m64pEmulator;
|
private readonly Thread m64pEmulator;
|
||||||
|
|
||||||
readonly AutoResetEvent m64pEvent = new AutoResetEvent(false);
|
private readonly AutoResetEvent m64pEvent = new AutoResetEvent(false);
|
||||||
AutoResetEvent m64pContinueEvent = new AutoResetEvent(false);
|
private AutoResetEvent m64pContinueEvent = new AutoResetEvent(false);
|
||||||
readonly ManualResetEvent m64pStartupComplete = new ManualResetEvent(false);
|
private readonly ManualResetEvent m64pStartupComplete = new ManualResetEvent(false);
|
||||||
|
|
||||||
bool event_frameend = false;
|
private bool event_frameend = false;
|
||||||
bool event_breakpoint = false;
|
private bool event_breakpoint = false;
|
||||||
|
|
||||||
public enum m64p_error
|
public enum m64p_error
|
||||||
{
|
{
|
||||||
|
@ -181,15 +181,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="context2">Use ""</param>
|
/// <param name="context2">Use ""</param>
|
||||||
/// <param name="dummy">Use IntPtr.Zero</param>
|
/// <param name="dummy">Use IntPtr.Zero</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreStartup(int APIVersion, string ConfigPath, string DataPath, string Context, DebugCallback DebugCallback, string context2, IntPtr dummy);
|
private delegate m64p_error CoreStartup(int APIVersion, string ConfigPath, string DataPath, string Context, DebugCallback DebugCallback, string context2, IntPtr dummy);
|
||||||
CoreStartup m64pCoreStartup;
|
|
||||||
|
private CoreStartup m64pCoreStartup;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cleans up the core
|
/// Cleans up the core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreShutdown();
|
private delegate m64p_error CoreShutdown();
|
||||||
CoreShutdown m64pCoreShutdown;
|
|
||||||
|
private CoreShutdown m64pCoreShutdown;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Connects a plugin DLL to the core DLL
|
/// Connects a plugin DLL to the core DLL
|
||||||
|
@ -197,16 +199,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="PluginType">The type of plugin that is being connected</param>
|
/// <param name="PluginType">The type of plugin that is being connected</param>
|
||||||
/// <param name="PluginLibHandle">The DLL handle for the plugin</param>
|
/// <param name="PluginLibHandle">The DLL handle for the plugin</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreAttachPlugin(m64p_plugin_type PluginType, IntPtr PluginLibHandle);
|
private delegate m64p_error CoreAttachPlugin(m64p_plugin_type PluginType, IntPtr PluginLibHandle);
|
||||||
CoreAttachPlugin m64pCoreAttachPlugin;
|
|
||||||
|
private CoreAttachPlugin m64pCoreAttachPlugin;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disconnects a plugin DLL from the core DLL
|
/// Disconnects a plugin DLL from the core DLL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="PluginType">The type of plugin to be disconnected</param>
|
/// <param name="PluginType">The type of plugin to be disconnected</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreDetachPlugin(m64p_plugin_type PluginType);
|
private delegate m64p_error CoreDetachPlugin(m64p_plugin_type PluginType);
|
||||||
CoreDetachPlugin m64pCoreDetachPlugin;
|
|
||||||
|
private CoreDetachPlugin m64pCoreDetachPlugin;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens a section in the global config system
|
/// Opens a section in the global config system
|
||||||
|
@ -214,8 +218,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="SectionName">The name of the section to open</param>
|
/// <param name="SectionName">The name of the section to open</param>
|
||||||
/// <param name="ConfigSectionHandle">A pointer to the pointer to use as the section handle</param>
|
/// <param name="ConfigSectionHandle">A pointer to the pointer to use as the section handle</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error ConfigOpenSection(string SectionName, ref IntPtr ConfigSectionHandle);
|
private delegate m64p_error ConfigOpenSection(string SectionName, ref IntPtr ConfigSectionHandle);
|
||||||
ConfigOpenSection m64pConfigOpenSection;
|
|
||||||
|
private ConfigOpenSection m64pConfigOpenSection;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets a parameter in the global config system
|
/// Sets a parameter in the global config system
|
||||||
|
@ -225,8 +230,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="ParamType">The type of the parameter</param>
|
/// <param name="ParamType">The type of the parameter</param>
|
||||||
/// <param name="ParamValue">A pointer to the value to use for the parameter (must be an int right now)</param>
|
/// <param name="ParamValue">A pointer to the value to use for the parameter (must be an int right now)</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error ConfigSetParameter(IntPtr ConfigSectionHandle, string ParamName, m64p_type ParamType, ref int ParamValue);
|
private delegate m64p_error ConfigSetParameter(IntPtr ConfigSectionHandle, string ParamName, m64p_type ParamType, ref int ParamValue);
|
||||||
ConfigSetParameter m64pConfigSetParameter;
|
|
||||||
|
private ConfigSetParameter m64pConfigSetParameter;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets a parameter in the global config system
|
/// Sets a parameter in the global config system
|
||||||
|
@ -236,24 +242,27 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="ParamType">The type of the parameter</param>
|
/// <param name="ParamType">The type of the parameter</param>
|
||||||
/// <param name="ParamValue">A pointer to the value to use for the parameter (must be a string)</param>
|
/// <param name="ParamValue">A pointer to the value to use for the parameter (must be a string)</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error ConfigSetParameterStr(IntPtr ConfigSectionHandle, string ParamName, m64p_type ParamType, StringBuilder ParamValue);
|
private delegate m64p_error ConfigSetParameterStr(IntPtr ConfigSectionHandle, string ParamName, m64p_type ParamType, StringBuilder ParamValue);
|
||||||
ConfigSetParameterStr m64pConfigSetParameterStr;
|
|
||||||
|
private ConfigSetParameterStr m64pConfigSetParameterStr;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the mupen64plus state to the provided buffer
|
/// Saves the mupen64plus state to the provided buffer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="buffer">A byte array to use to save the state. Must be at least 16788288 + 1024 bytes</param>
|
/// <param name="buffer">A byte array to use to save the state. Must be at least 16788288 + 1024 bytes</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate int savestates_save_bkm(byte[] buffer);
|
private delegate int savestates_save_bkm(byte[] buffer);
|
||||||
savestates_save_bkm m64pCoreSaveState;
|
|
||||||
|
private savestates_save_bkm m64pCoreSaveState;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the mupen64plus state from the provided buffer
|
/// Loads the mupen64plus state from the provided buffer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="buffer">A byte array filled with the state to load. Must be at least 16788288 + 1024 bytes</param>
|
/// <param name="buffer">A byte array filled with the state to load. Must be at least 16788288 + 1024 bytes</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate int savestates_load_bkm(byte[] buffer);
|
private delegate int savestates_load_bkm(byte[] buffer);
|
||||||
savestates_load_bkm m64pCoreLoadState;
|
|
||||||
|
private savestates_load_bkm m64pCoreLoadState;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a pointer to a section of the mupen64plus core
|
/// Gets a pointer to a section of the mupen64plus core
|
||||||
|
@ -261,8 +270,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="mem_ptr_type">The section to get a pointer for</param>
|
/// <param name="mem_ptr_type">The section to get a pointer for</param>
|
||||||
/// <returns>A pointer to the section requested</returns>
|
/// <returns>A pointer to the section requested</returns>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate IntPtr DebugMemGetPointer(N64_MEMORY mem_ptr_type);
|
private delegate IntPtr DebugMemGetPointer(N64_MEMORY mem_ptr_type);
|
||||||
DebugMemGetPointer m64pDebugMemGetPointer;
|
|
||||||
|
private DebugMemGetPointer m64pDebugMemGetPointer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the size of the given memory area
|
/// Gets the size of the given memory area
|
||||||
|
@ -270,51 +280,61 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="mem_ptr_type">The section to get the size of</param>
|
/// <param name="mem_ptr_type">The section to get the size of</param>
|
||||||
/// <returns>The size of the section requested</returns>
|
/// <returns>The size of the section requested</returns>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate int MemGetSize(N64_MEMORY mem_ptr_type);
|
private delegate int MemGetSize(N64_MEMORY mem_ptr_type);
|
||||||
MemGetSize m64pMemGetSize;
|
|
||||||
|
private MemGetSize m64pMemGetSize;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes the saveram (eeprom and 4 mempacks)
|
/// Initializes the saveram (eeprom and 4 mempacks)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate IntPtr init_saveram();
|
private delegate IntPtr init_saveram();
|
||||||
init_saveram m64pinit_saveram;
|
|
||||||
|
private init_saveram m64pinit_saveram;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Pulls out the saveram for bizhawk to save
|
/// Pulls out the saveram for bizhawk to save
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dest">A byte array to save the saveram into</param>
|
/// <param name="dest">A byte array to save the saveram into</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate IntPtr save_saveram(byte[] dest);
|
private delegate IntPtr save_saveram(byte[] dest);
|
||||||
save_saveram m64psave_saveram;
|
|
||||||
|
private save_saveram m64psave_saveram;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Restores the saveram from bizhawk
|
/// Restores the saveram from bizhawk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="src">A byte array containing the saveram to restore</param>
|
/// <param name="src">A byte array containing the saveram to restore</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate IntPtr load_saveram(byte[] src);
|
private delegate IntPtr load_saveram(byte[] src);
|
||||||
load_saveram m64pload_saveram;
|
|
||||||
|
private load_saveram m64pload_saveram;
|
||||||
|
|
||||||
// The last parameter of CoreDoCommand is actually a void pointer, so instead we'll make a few delegates for the versions we want to use
|
// The last parameter of CoreDoCommand is actually a void pointer, so instead we'll make a few delegates for the versions we want to use
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreDoCommandByteArray(m64p_command Command, int ParamInt, byte[] ParamPtr);
|
private delegate m64p_error CoreDoCommandByteArray(m64p_command Command, int ParamInt, byte[] ParamPtr);
|
||||||
CoreDoCommandByteArray m64pCoreDoCommandByteArray;
|
|
||||||
|
private CoreDoCommandByteArray m64pCoreDoCommandByteArray;
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreDoCommandPtr(m64p_command Command, int ParamInt, IntPtr ParamPtr);
|
private delegate m64p_error CoreDoCommandPtr(m64p_command Command, int ParamInt, IntPtr ParamPtr);
|
||||||
CoreDoCommandPtr m64pCoreDoCommandPtr;
|
|
||||||
|
private CoreDoCommandPtr m64pCoreDoCommandPtr;
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreDoCommandRefInt(m64p_command Command, int ParamInt, ref int ParamPtr);
|
private delegate m64p_error CoreDoCommandRefInt(m64p_command Command, int ParamInt, ref int ParamPtr);
|
||||||
CoreDoCommandRefInt m64pCoreDoCommandRefInt;
|
|
||||||
|
private CoreDoCommandRefInt m64pCoreDoCommandRefInt;
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreDoCommandFrameCallback(m64p_command Command, int ParamInt, FrameCallback ParamPtr);
|
private delegate m64p_error CoreDoCommandFrameCallback(m64p_command Command, int ParamInt, FrameCallback ParamPtr);
|
||||||
CoreDoCommandFrameCallback m64pCoreDoCommandFrameCallback;
|
|
||||||
|
private CoreDoCommandFrameCallback m64pCoreDoCommandFrameCallback;
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreDoCommandVICallback(m64p_command Command, int ParamInt, VICallback ParamPtr);
|
private delegate m64p_error CoreDoCommandVICallback(m64p_command Command, int ParamInt, VICallback ParamPtr);
|
||||||
CoreDoCommandVICallback m64pCoreDoCommandVICallback;
|
|
||||||
|
private CoreDoCommandVICallback m64pCoreDoCommandVICallback;
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error CoreDoCommandRenderCallback(m64p_command Command, int ParamInt, RenderCallback ParamPtr);
|
private delegate m64p_error CoreDoCommandRenderCallback(m64p_command Command, int ParamInt, RenderCallback ParamPtr);
|
||||||
CoreDoCommandRenderCallback m64pCoreDoCommandRenderCallback;
|
|
||||||
|
private CoreDoCommandRenderCallback m64pCoreDoCommandRenderCallback;
|
||||||
|
|
||||||
//WARNING - RETURNS A STATIC BUFFER
|
//WARNING - RETURNS A STATIC BUFFER
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
|
@ -366,21 +386,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void FrameCallback();
|
public delegate void FrameCallback();
|
||||||
FrameCallback m64pFrameCallback;
|
|
||||||
|
private FrameCallback m64pFrameCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will be called every time a VI occurs
|
/// This will be called every time a VI occurs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void VICallback();
|
public delegate void VICallback();
|
||||||
VICallback m64pVICallback;
|
|
||||||
|
private VICallback m64pVICallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will be called every time before the screen is drawn
|
/// This will be called every time before the screen is drawn
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void RenderCallback();
|
public delegate void RenderCallback();
|
||||||
RenderCallback m64pRenderCallback;
|
|
||||||
|
private RenderCallback m64pRenderCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will be called after the emulator is setup and is ready to be used
|
/// This will be called after the emulator is setup and is ready to be used
|
||||||
|
@ -399,28 +422,32 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void SetTraceCallback(TraceCallback callback);
|
public delegate void SetTraceCallback(TraceCallback callback);
|
||||||
SetTraceCallback m64pSetTraceCallback;
|
|
||||||
|
private SetTraceCallback m64pSetTraceCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the CPU registers
|
/// Gets the CPU registers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void GetRegisters(byte[] dest);
|
public delegate void GetRegisters(byte[] dest);
|
||||||
GetRegisters m64pGetRegisters;
|
|
||||||
|
private GetRegisters m64pGetRegisters;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will be called when the debugger is initialized
|
/// This will be called when the debugger is initialized
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void DebugInitCallback();
|
public delegate void DebugInitCallback();
|
||||||
DebugInitCallback m64pDebugInitCallback;
|
|
||||||
|
private DebugInitCallback m64pDebugInitCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will be called when the debugger hits a breakpoint or executes one instruction in stepping mode
|
/// This will be called when the debugger hits a breakpoint or executes one instruction in stepping mode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void DebugUpdateCallback(int bpt);
|
public delegate void DebugUpdateCallback(int bpt);
|
||||||
DebugUpdateCallback m64pDebugUpdateCallback;
|
|
||||||
|
private DebugUpdateCallback m64pDebugUpdateCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will be called during each vertical interrupt
|
/// This will be called during each vertical interrupt
|
||||||
|
@ -432,43 +459,49 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// Sets the debug callbacks
|
/// Sets the debug callbacks
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error DebugSetCallbacks(DebugInitCallback initCallback, DebugUpdateCallback updateCallback, DebugVICallback viCallback);
|
private delegate m64p_error DebugSetCallbacks(DebugInitCallback initCallback, DebugUpdateCallback updateCallback, DebugVICallback viCallback);
|
||||||
DebugSetCallbacks m64pDebugSetCallbacks;
|
|
||||||
|
private DebugSetCallbacks m64pDebugSetCallbacks;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function searches through all current breakpoints in the debugger to find one that matches the given input parameters.
|
/// This function searches through all current breakpoints in the debugger to find one that matches the given input parameters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate int DebugBreakpointLookup(uint address, uint size, uint flags);
|
private delegate int DebugBreakpointLookup(uint address, uint size, uint flags);
|
||||||
DebugBreakpointLookup m64pDebugBreakpointLookup;
|
|
||||||
|
private DebugBreakpointLookup m64pDebugBreakpointLookup;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is used to process common breakpoint commands, such as adding, removing, or searching the breakpoints
|
/// This function is used to process common breakpoint commands, such as adding, removing, or searching the breakpoints
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate int DebugBreakpointCommand(m64p_dbg_bkp_command command, uint index, ref m64p_breakpoint bkp);
|
private delegate int DebugBreakpointCommand(m64p_dbg_bkp_command command, uint index, ref m64p_breakpoint bkp);
|
||||||
DebugBreakpointCommand m64pDebugBreakpointCommand;
|
|
||||||
|
private DebugBreakpointCommand m64pDebugBreakpointCommand;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a debugger state variable
|
/// Gets a debugger state variable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate int DebugGetState(m64p_dbg_state statenum);
|
private delegate int DebugGetState(m64p_dbg_state statenum);
|
||||||
DebugGetState m64pDebugGetState;
|
|
||||||
|
private DebugGetState m64pDebugGetState;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the runstate of the emulator
|
/// Sets the runstate of the emulator
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error DebugSetRunState(m64p_dbg_runstate runstate);
|
private delegate m64p_error DebugSetRunState(m64p_dbg_runstate runstate);
|
||||||
DebugSetRunState m64pDebugSetRunState;
|
|
||||||
|
private DebugSetRunState m64pDebugSetRunState;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Continues execution
|
/// Continues execution
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate m64p_error DebugStep();
|
private delegate m64p_error DebugStep();
|
||||||
DebugStep m64pDebugStep;
|
|
||||||
|
private DebugStep m64pDebugStep;
|
||||||
|
|
||||||
private readonly DynamicLibraryImportResolver Library = new DynamicLibraryImportResolver(OSTailoredCode.IsUnixHost ? "libmupen64plus.so.2" : "mupen64plus.dll");
|
private readonly DynamicLibraryImportResolver Library = new DynamicLibraryImportResolver(OSTailoredCode.IsUnixHost ? "libmupen64plus.so.2" : "mupen64plus.dll");
|
||||||
|
|
||||||
|
@ -542,7 +575,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
AttachedCore = this;
|
AttachedCore = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
volatile bool emulator_running = false;
|
private volatile bool emulator_running = false;
|
||||||
|
|
||||||
public bool IsCrashed => !emulator_running;
|
public bool IsCrashed => !emulator_running;
|
||||||
|
|
||||||
|
@ -577,7 +610,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Look up function pointers in the dlls
|
/// Look up function pointers in the dlls
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void connectFunctionPointers()
|
private void connectFunctionPointers()
|
||||||
{
|
{
|
||||||
T GetCoreDelegate<T>(string proc) where T : Delegate => (T) Marshal.GetDelegateForFunctionPointer(Library.GetProcAddrOrThrow(proc), typeof(T));
|
T GetCoreDelegate<T>(string proc) where T : Delegate => (T) Marshal.GetDelegateForFunctionPointer(Library.GetProcAddrOrThrow(proc), typeof(T));
|
||||||
|
|
||||||
|
@ -835,7 +868,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
m64pCoreLoadState(buffer);
|
m64pCoreLoadState(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] saveram_backup;
|
private byte[] saveram_backup;
|
||||||
|
|
||||||
public void InitSaveram()
|
public void InitSaveram()
|
||||||
{
|
{
|
||||||
|
@ -973,13 +1006,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
|
|
||||||
private static readonly FieldInfo fiDLIRInternalPtr = typeof(DynamicLibraryImportResolver).GetField("_p", BindingFlags.Instance | BindingFlags.NonPublic);
|
private static readonly FieldInfo fiDLIRInternalPtr = typeof(DynamicLibraryImportResolver).GetField("_p", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||||
|
|
||||||
struct AttachedPlugin
|
private struct AttachedPlugin
|
||||||
{
|
{
|
||||||
public DynamicLibraryImportResolver dllThinWrapper;
|
public DynamicLibraryImportResolver dllThinWrapper;
|
||||||
public PluginShutdown dllShutdown;
|
public PluginShutdown dllShutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly Dictionary<m64p_plugin_type, AttachedPlugin> plugins = new Dictionary<m64p_plugin_type, AttachedPlugin>();
|
private readonly Dictionary<m64p_plugin_type, AttachedPlugin> plugins = new Dictionary<m64p_plugin_type, AttachedPlugin>();
|
||||||
|
|
||||||
public IntPtr AttachPlugin(m64p_plugin_type type, string PluginName)
|
public IntPtr AttachPlugin(m64p_plugin_type type, string PluginName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,9 +3,9 @@ using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
{
|
{
|
||||||
class mupen64plusInputApi
|
internal class mupen64plusInputApi
|
||||||
{
|
{
|
||||||
IntPtr InpDll;
|
private IntPtr InpDll;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets a callback to use when the mupen core wants controller buttons
|
/// Sets a callback to use when the mupen core wants controller buttons
|
||||||
|
@ -13,18 +13,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="inputCallback">The delegate to use</param>
|
/// <param name="inputCallback">The delegate to use</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate void SetInputCallback(InputCallback inputCallback);
|
private delegate void SetInputCallback(InputCallback inputCallback);
|
||||||
readonly SetInputCallback InpSetInputCallback;
|
|
||||||
|
private readonly SetInputCallback InpSetInputCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Callback to use when mupen64plus wants input
|
/// Callback to use when mupen64plus wants input
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate int InputCallback(int i);
|
public delegate int InputCallback(int i);
|
||||||
InputCallback InpInputCallback;
|
|
||||||
|
private InputCallback InpInputCallback;
|
||||||
|
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate mupen64plusApi.m64p_error SetRumbleCallback(RumbleCallback ParamPtr);
|
private delegate mupen64plusApi.m64p_error SetRumbleCallback(RumbleCallback ParamPtr);
|
||||||
SetRumbleCallback InpSetRumbleCallback;
|
|
||||||
|
private SetRumbleCallback InpSetRumbleCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This will be called every time the N64 changes
|
/// This will be called every time the N64 changes
|
||||||
|
@ -32,7 +35,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void RumbleCallback(int Control, int on);
|
public delegate void RumbleCallback(int Control, int on);
|
||||||
RumbleCallback m64pRumbleCallback;
|
|
||||||
|
private RumbleCallback m64pRumbleCallback;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the controller pak type
|
/// Sets the controller pak type
|
||||||
|
@ -41,7 +45,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="type">Type id according to (well documented... hurr hurr) mupen api</param>
|
/// <param name="type">Type id according to (well documented... hurr hurr) mupen api</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
public delegate void SetControllerPakType(int controller, int type);
|
public delegate void SetControllerPakType(int controller, int type);
|
||||||
readonly SetControllerPakType InpSetControllerPakType;
|
|
||||||
|
private readonly SetControllerPakType InpSetControllerPakType;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Connects and disconnects controllers
|
/// Connects and disconnects controllers
|
||||||
|
@ -49,13 +54,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="controller">Controller id</param>
|
/// <param name="controller">Controller id</param>
|
||||||
/// <param name="connected">1 if controller should be connected, 0 if controller should be disconnected</param>
|
/// <param name="connected">1 if controller should be connected, 0 if controller should be disconnected</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate void SetControllerConnected(int controller, int connected);
|
private delegate void SetControllerConnected(int controller, int connected);
|
||||||
readonly SetControllerConnected InpSetControllerConnected;
|
|
||||||
|
private readonly SetControllerConnected InpSetControllerConnected;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event fired when mupen changes rumble pak status
|
/// Event fired when mupen changes rumble pak status
|
||||||
/// </summary>
|
/// </summary>
|
||||||
event RumbleCallback OnRumbleChange;
|
private event RumbleCallback OnRumbleChange;
|
||||||
|
|
||||||
public mupen64plusInputApi(mupen64plusApi core)
|
public mupen64plusInputApi(mupen64plusApi core)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,9 +5,9 @@ using BizHawk.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
{
|
{
|
||||||
class mupen64plusVideoApi
|
internal class mupen64plusVideoApi
|
||||||
{
|
{
|
||||||
IntPtr GfxDll;
|
private IntPtr GfxDll;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fills a provided buffer with the mupen64plus framebuffer
|
/// Fills a provided buffer with the mupen64plus framebuffer
|
||||||
|
@ -18,7 +18,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="buffer">Which buffer to read: 0 = front, 1 = back</param>
|
/// <param name="buffer">Which buffer to read: 0 = front, 1 = back</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate void ReadScreen2(int[] framebuffer, ref int width, ref int height, int buffer);
|
private delegate void ReadScreen2(int[] framebuffer, ref int width, ref int height, int buffer);
|
||||||
readonly ReadScreen2 GFXReadScreen2;
|
|
||||||
|
private readonly ReadScreen2 GFXReadScreen2;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the width and height of the mupen64plus framebuffer
|
/// Gets the width and height of the mupen64plus framebuffer
|
||||||
|
@ -29,11 +30,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
|
||||||
/// <param name="buffer">Which buffer to read: 0 = front, 1 = back</param>
|
/// <param name="buffer">Which buffer to read: 0 = front, 1 = back</param>
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate void ReadScreen2Res(IntPtr dummy, ref int width, ref int height, int buffer);
|
private delegate void ReadScreen2Res(IntPtr dummy, ref int width, ref int height, int buffer);
|
||||||
readonly ReadScreen2Res GFXReadScreen2Res;
|
|
||||||
|
private readonly ReadScreen2Res GFXReadScreen2Res;
|
||||||
|
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
private delegate int GetScreenTextureID();
|
private delegate int GetScreenTextureID();
|
||||||
GetScreenTextureID GFXGetScreenTextureID;
|
|
||||||
|
private GetScreenTextureID GFXGetScreenTextureID;
|
||||||
|
|
||||||
public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
|
public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
|
|
||||||
// debug path/build for easier testing
|
// debug path/build for easier testing
|
||||||
//const string dllPath = "../../MelonDS/build/libmelonDS.dll";
|
//const string dllPath = "../../MelonDS/build/libmelonDS.dll";
|
||||||
const string dllPath = "dll/libmelonDS.dll";
|
private const string dllPath = "dll/libmelonDS.dll";
|
||||||
|
|
||||||
[DllImport(dllPath)]
|
[DllImport(dllPath)]
|
||||||
private static extern bool Init();
|
private static extern bool Init();
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
{
|
{
|
||||||
unsafe partial class MelonDS : IMemoryDomains
|
unsafe partial class MelonDS : IMemoryDomains
|
||||||
{
|
{
|
||||||
SortedList<string, MemoryDomain> domains;
|
private SortedList<string, MemoryDomain> domains;
|
||||||
|
|
||||||
private void InitMemoryDomains()
|
private void InitMemoryDomains()
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
public bool recalculate = false;
|
public bool recalculate = false;
|
||||||
|
|
||||||
readonly NES nes;
|
private readonly NES nes;
|
||||||
public APU(NES nes, APU old, bool pal)
|
public APU(NES nes, APU old, bool pal)
|
||||||
{
|
{
|
||||||
this.nes = nes;
|
this.nes = nes;
|
||||||
|
@ -43,25 +43,29 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly int[] DMC_RATE_NTSC = { 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 84, 72, 54 };
|
private static readonly int[] DMC_RATE_NTSC = { 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 84, 72, 54 };
|
||||||
static readonly int[] DMC_RATE_PAL = { 398, 354, 316, 298, 276, 236, 210, 198, 176, 148, 132, 118, 98, 78, 66, 50 };
|
private static readonly int[] DMC_RATE_PAL = { 398, 354, 316, 298, 276, 236, 210, 198, 176, 148, 132, 118, 98, 78, 66, 50 };
|
||||||
static readonly int[] LENGTH_TABLE = { 10, 254, 20, 2, 40, 4, 80, 6, 160, 8, 60, 10, 14, 12, 26, 14, 12, 16, 24, 18, 48, 20, 96, 22, 192, 24, 72, 26, 16, 28, 32, 30 };
|
private static readonly int[] LENGTH_TABLE = { 10, 254, 20, 2, 40, 4, 80, 6, 160, 8, 60, 10, 14, 12, 26, 14, 12, 16, 24, 18, 48, 20, 96, 22, 192, 24, 72, 26, 16, 28, 32, 30 };
|
||||||
static readonly byte[,] PULSE_DUTY = {
|
|
||||||
|
private static readonly byte[,] PULSE_DUTY = {
|
||||||
{0,1,0,0,0,0,0,0}, // (12.5%)
|
{0,1,0,0,0,0,0,0}, // (12.5%)
|
||||||
{0,1,1,0,0,0,0,0}, // (25%)
|
{0,1,1,0,0,0,0,0}, // (25%)
|
||||||
{0,1,1,1,1,0,0,0}, // (50%)
|
{0,1,1,1,1,0,0,0}, // (50%)
|
||||||
{1,0,0,1,1,1,1,1}, // (25% negated (75%))
|
{1,0,0,1,1,1,1,1}, // (25% negated (75%))
|
||||||
};
|
};
|
||||||
static readonly byte[] TRIANGLE_TABLE =
|
|
||||||
|
private static readonly byte[] TRIANGLE_TABLE =
|
||||||
{
|
{
|
||||||
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
|
15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||||
};
|
};
|
||||||
static readonly int[] NOISE_TABLE_NTSC =
|
|
||||||
|
private static readonly int[] NOISE_TABLE_NTSC =
|
||||||
{
|
{
|
||||||
4, 8, 16, 32, 64, 96, 128, 160, 202, 254, 380, 508, 762, 1016, 2034, 4068
|
4, 8, 16, 32, 64, 96, 128, 160, 202, 254, 380, 508, 762, 1016, 2034, 4068
|
||||||
};
|
};
|
||||||
static readonly int[] NOISE_TABLE_PAL =
|
|
||||||
|
private static readonly int[] NOISE_TABLE_PAL =
|
||||||
{
|
{
|
||||||
4, 7, 14, 30, 60, 88, 118, 148, 188, 236, 354, 472, 708, 944, 1890, 3778
|
4, 7, 14, 30, 60, 88, 118, 148, 188, 236, 354, 472, 708, 944, 1890, 3778
|
||||||
};
|
};
|
||||||
|
@ -70,20 +74,21 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{
|
{
|
||||||
public PulseUnit(APU apu, int unit) { this.unit = unit; this.apu = apu; }
|
public PulseUnit(APU apu, int unit) { this.unit = unit; this.apu = apu; }
|
||||||
public int unit;
|
public int unit;
|
||||||
readonly APU apu;
|
private readonly APU apu;
|
||||||
|
|
||||||
// reg0
|
// reg0
|
||||||
int duty_cnt, env_loop, env_constant, env_cnt_value;
|
private int duty_cnt, env_loop, env_constant, env_cnt_value;
|
||||||
public bool len_halt;
|
public bool len_halt;
|
||||||
// reg1
|
// reg1
|
||||||
int sweep_en, sweep_divider_cnt, sweep_negate, sweep_shiftcount;
|
private int sweep_en, sweep_divider_cnt, sweep_negate, sweep_shiftcount;
|
||||||
bool sweep_reload;
|
|
||||||
|
private bool sweep_reload;
|
||||||
// reg2/3
|
// reg2/3
|
||||||
int len_cnt;
|
private int len_cnt;
|
||||||
public int timer_raw_reload_value, timer_reload_value;
|
public int timer_raw_reload_value, timer_reload_value;
|
||||||
|
|
||||||
// misc..
|
// misc..
|
||||||
int lenctr_en;
|
private int lenctr_en;
|
||||||
|
|
||||||
public void SyncState(Serializer ser)
|
public void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
@ -179,14 +184,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
|
|
||||||
// state
|
// state
|
||||||
int swp_divider_counter;
|
private int swp_divider_counter;
|
||||||
bool swp_silence;
|
private bool swp_silence;
|
||||||
int duty_step;
|
private int duty_step;
|
||||||
int timer_counter;
|
private int timer_counter;
|
||||||
public int sample;
|
public int sample;
|
||||||
bool duty_value;
|
private bool duty_value;
|
||||||
|
|
||||||
int env_start_flag, env_divider, env_counter;
|
private int env_start_flag, env_divider, env_counter;
|
||||||
public int env_output;
|
public int env_output;
|
||||||
|
|
||||||
public void clock_length_and_sweep()
|
public void clock_length_and_sweep()
|
||||||
|
@ -309,29 +314,29 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
public sealed class NoiseUnit
|
public sealed class NoiseUnit
|
||||||
{
|
{
|
||||||
readonly APU apu;
|
private readonly APU apu;
|
||||||
|
|
||||||
// reg0 (sweep)
|
// reg0 (sweep)
|
||||||
int env_cnt_value, env_loop, env_constant;
|
private int env_cnt_value, env_loop, env_constant;
|
||||||
public bool len_halt;
|
public bool len_halt;
|
||||||
|
|
||||||
// reg2 (mode and period)
|
// reg2 (mode and period)
|
||||||
int mode_cnt, period_cnt;
|
private int mode_cnt, period_cnt;
|
||||||
|
|
||||||
// reg3 (length counter and envelop trigger)
|
// reg3 (length counter and envelop trigger)
|
||||||
int len_cnt;
|
private int len_cnt;
|
||||||
|
|
||||||
// set from apu:
|
// set from apu:
|
||||||
int lenctr_en;
|
private int lenctr_en;
|
||||||
|
|
||||||
// state
|
// state
|
||||||
int shift_register = 1;
|
private int shift_register = 1;
|
||||||
int timer_counter;
|
private int timer_counter;
|
||||||
public int sample;
|
public int sample;
|
||||||
int env_output, env_start_flag, env_divider, env_counter;
|
private int env_output, env_start_flag, env_divider, env_counter;
|
||||||
bool noise_bit = true;
|
private bool noise_bit = true;
|
||||||
|
|
||||||
readonly int[] NOISE_TABLE;
|
private readonly int[] NOISE_TABLE;
|
||||||
|
|
||||||
public NoiseUnit(APU apu, bool pal)
|
public NoiseUnit(APU apu, bool pal)
|
||||||
{
|
{
|
||||||
|
@ -497,18 +502,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
public sealed class TriangleUnit
|
public sealed class TriangleUnit
|
||||||
{
|
{
|
||||||
// reg0
|
// reg0
|
||||||
int linear_counter_reload, control_flag;
|
private int linear_counter_reload, control_flag;
|
||||||
// reg1 (n/a)
|
// reg1 (n/a)
|
||||||
// reg2/3
|
// reg2/3
|
||||||
int timer_cnt, reload_flag, len_cnt;
|
private int timer_cnt, reload_flag, len_cnt;
|
||||||
public bool halt_2;
|
public bool halt_2;
|
||||||
// misc..
|
// misc..
|
||||||
int lenctr_en;
|
private int lenctr_en;
|
||||||
int linear_counter, timer, timer_cnt_reload;
|
private int linear_counter, timer, timer_cnt_reload;
|
||||||
int seq = 0;
|
private int seq = 0;
|
||||||
public int sample;
|
public int sample;
|
||||||
|
|
||||||
readonly APU apu;
|
private readonly APU apu;
|
||||||
public TriangleUnit(APU apu) { this.apu = apu; }
|
public TriangleUnit(APU apu) { this.apu = apu; }
|
||||||
|
|
||||||
public void SyncState(Serializer ser)
|
public void SyncState(Serializer ser)
|
||||||
|
@ -646,10 +651,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
} // class TriangleUnit
|
} // class TriangleUnit
|
||||||
|
|
||||||
sealed class DMCUnit
|
private sealed class DMCUnit
|
||||||
{
|
{
|
||||||
readonly APU apu;
|
private readonly APU apu;
|
||||||
readonly int[] DMC_RATE;
|
private readonly int[] DMC_RATE;
|
||||||
public DMCUnit(APU apu, bool pal)
|
public DMCUnit(APU apu, bool pal)
|
||||||
{
|
{
|
||||||
this.apu = apu;
|
this.apu = apu;
|
||||||
|
@ -664,22 +669,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
user_length = 1;
|
user_length = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool irq_enabled;
|
private bool irq_enabled;
|
||||||
bool loop_flag;
|
private bool loop_flag;
|
||||||
int timer_reload;
|
private int timer_reload;
|
||||||
|
|
||||||
// dmc delay per visual 2a03
|
// dmc delay per visual 2a03
|
||||||
int delay;
|
private int delay;
|
||||||
|
|
||||||
// this timer never stops, ever, so it is convenient to use for even/odd timing used elsewhere
|
// this timer never stops, ever, so it is convenient to use for even/odd timing used elsewhere
|
||||||
public int timer;
|
public int timer;
|
||||||
int user_address;
|
private int user_address;
|
||||||
public uint user_length, sample_length;
|
public uint user_length, sample_length;
|
||||||
int sample_address, sample_buffer;
|
private int sample_address, sample_buffer;
|
||||||
bool sample_buffer_filled;
|
private bool sample_buffer_filled;
|
||||||
|
|
||||||
int out_shift, out_bits_remaining, out_deltacounter;
|
private int out_shift, out_bits_remaining, out_deltacounter;
|
||||||
bool out_silence;
|
private bool out_silence;
|
||||||
|
|
||||||
public int sample => out_deltacounter /* - 64*/;
|
public int sample => out_deltacounter /* - 64*/;
|
||||||
|
|
||||||
|
@ -768,7 +773,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clock()
|
private void Clock()
|
||||||
{
|
{
|
||||||
// If the silence flag is clear, bit 0 of the shift register is applied to the counter as follows:
|
// If the silence flag is clear, bit 0 of the shift register is applied to the counter as follows:
|
||||||
// if bit 0 is clear and the delta-counter is greater than 1, the counter is decremented by 2;
|
// if bit 0 is clear and the delta-counter is greater than 1, the counter is decremented by 2;
|
||||||
|
@ -940,38 +945,38 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
public PulseUnit[] pulse = new PulseUnit[2];
|
public PulseUnit[] pulse = new PulseUnit[2];
|
||||||
public TriangleUnit triangle;
|
public TriangleUnit triangle;
|
||||||
public NoiseUnit noise;
|
public NoiseUnit noise;
|
||||||
readonly DMCUnit dmc;
|
private readonly DMCUnit dmc;
|
||||||
|
|
||||||
bool irq_pending;
|
private bool irq_pending;
|
||||||
bool dmc_irq;
|
private bool dmc_irq;
|
||||||
int pending_reg = -1;
|
private int pending_reg = -1;
|
||||||
bool doing_tick_quarter = false;
|
private bool doing_tick_quarter = false;
|
||||||
byte pending_val = 0;
|
private byte pending_val = 0;
|
||||||
public int seq_tick;
|
public int seq_tick;
|
||||||
public byte seq_val;
|
public byte seq_val;
|
||||||
public bool len_clock_active;
|
public bool len_clock_active;
|
||||||
|
|
||||||
int sequencer_counter, sequencer_step, sequencer_mode, sequencer_irq_inhibit, sequencer_irq_assert;
|
private int sequencer_counter, sequencer_step, sequencer_mode, sequencer_irq_inhibit, sequencer_irq_assert;
|
||||||
bool sequencer_irq, sequence_reset_pending, sequencer_irq_clear_pending, sequencer_irq_flag;
|
private bool sequencer_irq, sequence_reset_pending, sequencer_irq_clear_pending, sequencer_irq_flag;
|
||||||
|
|
||||||
public void RunDMCFetch()
|
public void RunDMCFetch()
|
||||||
{
|
{
|
||||||
dmc.Fetch();
|
dmc.Fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly int[][] sequencer_lut = new int[2][];
|
private readonly int[][] sequencer_lut = new int[2][];
|
||||||
|
|
||||||
static readonly int[][] sequencer_lut_ntsc = {
|
private static readonly int[][] sequencer_lut_ntsc = {
|
||||||
new[]{7457,14913,22371,29830},
|
new[]{7457,14913,22371,29830},
|
||||||
new[]{7457,14913,22371,29830,37282}
|
new[]{7457,14913,22371,29830,37282}
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly int[][] sequencer_lut_pal = {
|
private static readonly int[][] sequencer_lut_pal = {
|
||||||
new[]{8313,16627,24939,33254},
|
new[]{8313,16627,24939,33254},
|
||||||
new[]{8313,16627,24939,33254,41566}
|
new[]{8313,16627,24939,33254,41566}
|
||||||
};
|
};
|
||||||
|
|
||||||
void sequencer_write_tick(byte val)
|
private void sequencer_write_tick(byte val)
|
||||||
{
|
{
|
||||||
if (seq_tick>0)
|
if (seq_tick>0)
|
||||||
{
|
{
|
||||||
|
@ -1004,7 +1009,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sequencer_tick()
|
private void sequencer_tick()
|
||||||
{
|
{
|
||||||
sequencer_counter++;
|
sequencer_counter++;
|
||||||
if (sequencer_mode == 0 && sequencer_counter == sequencer_lut[0][3]-1)
|
if (sequencer_mode == 0 && sequencer_counter == sequencer_lut[0][3]-1)
|
||||||
|
@ -1036,7 +1041,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
irq_pending = sequencer_irq | dmc_irq;
|
irq_pending = sequencer_irq | dmc_irq;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sequencer_check()
|
private void sequencer_check()
|
||||||
{
|
{
|
||||||
// Console.WriteLine("sequencer mode {0} step {1}", sequencer_mode, sequencer_step);
|
// Console.WriteLine("sequencer mode {0} step {1}", sequencer_mode, sequencer_step);
|
||||||
bool quarter, half, reset;
|
bool quarter, half, reset;
|
||||||
|
@ -1075,7 +1080,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
if (half) HalfFrame();
|
if (half) HalfFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HalfFrame()
|
private void HalfFrame()
|
||||||
{
|
{
|
||||||
doing_tick_quarter = true;
|
doing_tick_quarter = true;
|
||||||
pulse[0].clock_length_and_sweep();
|
pulse[0].clock_length_and_sweep();
|
||||||
|
@ -1084,7 +1089,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
noise.clock_length_and_sweep();
|
noise.clock_length_and_sweep();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuarterFrame()
|
private void QuarterFrame()
|
||||||
{
|
{
|
||||||
doing_tick_quarter = true;
|
doing_tick_quarter = true;
|
||||||
pulse[0].clock_env();
|
pulse[0].clock_env();
|
||||||
|
@ -1124,7 +1129,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
pending_val = val;
|
pending_val = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _WriteReg(int addr, byte val)
|
private void _WriteReg(int addr, byte val)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("{0:X4} = {1:X2}", addr, val);
|
//Console.WriteLine("{0:X4} = {1:X2}", addr, val);
|
||||||
int index = addr - 0x4000;
|
int index = addr - 0x4000;
|
||||||
|
@ -1218,7 +1223,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
public int DebugCallbackDivider;
|
public int DebugCallbackDivider;
|
||||||
public int DebugCallbackTimer;
|
public int DebugCallbackTimer;
|
||||||
|
|
||||||
int pending_length_change;
|
private int pending_length_change;
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public void RunOneFirst()
|
public void RunOneFirst()
|
||||||
|
@ -1326,9 +1331,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
public uint sampleclock = 0;
|
public uint sampleclock = 0;
|
||||||
|
|
||||||
int oldmix = 0;
|
private int oldmix = 0;
|
||||||
int cart_sound = 0;
|
private int cart_sound = 0;
|
||||||
int old_cart_sound = 0;
|
private int old_cart_sound = 0;
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public int EmitSample()
|
public int EmitSample()
|
||||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class AVE_NINA_001 : NesBoardBase
|
internal sealed class AVE_NINA_001 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_32k, chr_bank_mask_4k;
|
private int prg_bank_mask_32k, chr_bank_mask_4k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int[] chr_banks_4k = new int[2];
|
private int[] chr_banks_4k = new int[2];
|
||||||
int prg_bank_32k;
|
private int prg_bank_32k;
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
@ -88,14 +88,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
// according to the latest on nesdev:
|
// according to the latest on nesdev:
|
||||||
// mapper 079: [.... PCCC] @ 4100
|
// mapper 079: [.... PCCC] @ 4100
|
||||||
// mapper 113: [MCPP PCCC] @ 4100 (no games for this are in bootgod)
|
// mapper 113: [MCPP PCCC] @ 4100 (no games for this are in bootgod)
|
||||||
class AVE_NINA_006 : NesBoardBase
|
internal class AVE_NINA_006 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_32k, chr_bank_mask_8k;
|
private int prg_bank_mask_32k, chr_bank_mask_8k;
|
||||||
bool mirror_control_enabled;
|
private bool mirror_control_enabled;
|
||||||
bool isMapper79 = false;
|
|
||||||
|
private bool isMapper79 = false;
|
||||||
//state
|
//state
|
||||||
int chr_bank_8k, prg_bank_32k;
|
private int chr_bank_8k, prg_bank_32k;
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,11 +8,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class AxROM : NesBoardBase
|
internal sealed class AxROM : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
bool bus_conflict;
|
private bool bus_conflict;
|
||||||
int prg_mask_32k;
|
private int prg_mask_32k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int prg;
|
private int prg;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,24 +33,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class BANDAI_FCG_1 : NesBoardBase
|
internal sealed class BANDAI_FCG_1 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_16k, chr_bank_mask_1k;
|
private int prg_bank_mask_16k, chr_bank_mask_1k;
|
||||||
|
|
||||||
bool regs_prg_enable; // can the mapper regs be written to in 8000:ffff?
|
private bool regs_prg_enable; // can the mapper regs be written to in 8000:ffff?
|
||||||
bool regs_wram_enable; // can the mapper regs be written to in 6000:7fff?
|
private bool regs_wram_enable; // can the mapper regs be written to in 6000:7fff?
|
||||||
bool jump2 = false; // are we in special mode for the JUMP2 board?
|
private bool jump2 = false; // are we in special mode for the JUMP2 board?
|
||||||
bool vram = false; // is this a VRAM board? (also set to true for JUMP2)
|
private bool vram = false; // is this a VRAM board? (also set to true for JUMP2)
|
||||||
byte jump2_outer_bank; // needed to select between banks in 512K jump2 board
|
private byte jump2_outer_bank; // needed to select between banks in 512K jump2 board
|
||||||
|
|
||||||
//regenerable state
|
//regenerable state
|
||||||
readonly int[] prg_banks_16k = new int[2];
|
private readonly int[] prg_banks_16k = new int[2];
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int prg_reg_16k;
|
private int prg_reg_16k;
|
||||||
byte[] regs = new byte[8];
|
private byte[] regs = new byte[8];
|
||||||
bool irq_enabled;
|
private bool irq_enabled;
|
||||||
ushort irq_counter;
|
private ushort irq_counter;
|
||||||
ushort irq_latch;
|
private ushort irq_latch;
|
||||||
SEEPROM eprom;
|
private SEEPROM eprom;
|
||||||
public DatachBarcode reader;
|
public DatachBarcode reader;
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
|
@ -176,7 +176,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncPRG()
|
private void SyncPRG()
|
||||||
{
|
{
|
||||||
prg_banks_16k[0] = prg_reg_16k & prg_bank_mask_16k;
|
prg_banks_16k[0] = prg_reg_16k & prg_bank_mask_16k;
|
||||||
prg_banks_16k[1] = 0xFF & prg_bank_mask_16k;
|
prg_banks_16k[1] = 0xFF & prg_bank_mask_16k;
|
||||||
|
@ -197,7 +197,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteReg(int reg, byte value)
|
private void WriteReg(int reg, byte value)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("reg {0:X2} = {1:X2}", reg, value);
|
//Console.WriteLine("reg {0:X2} = {1:X2}", reg, value);
|
||||||
switch (reg)
|
switch (reg)
|
||||||
|
@ -358,7 +358,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return Rom[addr];
|
return Rom[addr];
|
||||||
}
|
}
|
||||||
|
|
||||||
int CalcPPUAddress(int addr)
|
private int CalcPPUAddress(int addr)
|
||||||
{
|
{
|
||||||
int bank_1k = addr >> 10;
|
int bank_1k = addr >> 10;
|
||||||
int ofs = addr & ((1 << 10) - 1);
|
int ofs = addr & ((1 << 10) - 1);
|
||||||
|
|
|
@ -5,10 +5,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
// http://wiki.nesdev.com/w/index.php/INES_Mapper_096
|
// http://wiki.nesdev.com/w/index.php/INES_Mapper_096
|
||||||
internal sealed class BANDAI_74_161_02_74 : NesBoardBase
|
internal sealed class BANDAI_74_161_02_74 : NesBoardBase
|
||||||
{
|
{
|
||||||
int chr_block;
|
private int chr_block;
|
||||||
int chr_pos = 0;
|
private int chr_pos = 0;
|
||||||
int prg_bank_mask_32k;
|
private int prg_bank_mask_32k;
|
||||||
byte prg_bank_32k;
|
private byte prg_bank_32k;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,10 +12,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
//Kamen Rider Club
|
//Kamen Rider Club
|
||||||
//Space Shadow
|
//Space Shadow
|
||||||
|
|
||||||
int chr;
|
private int chr;
|
||||||
int prg_bank_mask_16k;
|
private int prg_bank_mask_16k;
|
||||||
byte prg_bank_16k;
|
private byte prg_bank_16k;
|
||||||
byte[] prg_banks_16k = new byte[2];
|
private byte[] prg_banks_16k = new byte[2];
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
ser.Sync(nameof(prg_banks_16k), ref prg_banks_16k, false);
|
ser.Sync(nameof(prg_banks_16k), ref prg_banks_16k, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncPRG()
|
private void SyncPRG()
|
||||||
{
|
{
|
||||||
prg_banks_16k[0] = prg_bank_16k;
|
prg_banks_16k[0] = prg_bank_16k;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class BxROM : NesBoardBase
|
internal sealed class BxROM : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_32k;
|
private int prg_bank_mask_32k;
|
||||||
int chr_bank_mask_8k;
|
private int chr_bank_mask_8k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int prg_bank_32k;
|
private int prg_bank_32k;
|
||||||
int chr_bank_8k;
|
private int chr_bank_8k;
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,14 +15,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class CNROM : NesBoardBase
|
internal sealed class CNROM : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_byte_mask, chr_mask;
|
private int prg_byte_mask, chr_mask;
|
||||||
bool copyprotection = false;
|
private bool copyprotection = false;
|
||||||
bool bus_conflict;
|
private bool bus_conflict;
|
||||||
bool seicross;
|
private bool seicross;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int chr;
|
private int chr;
|
||||||
bool chr_enabled = true;
|
private bool chr_enabled = true;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
//generally mapper 13
|
//generally mapper 13
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int chr;
|
private int chr;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,11 +8,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class Camerica_Mapper071 : NesBoardBase
|
internal sealed class Camerica_Mapper071 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_16k;
|
private int prg_bank_mask_16k;
|
||||||
bool mirror_control_enabled;
|
private bool mirror_control_enabled;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int[] prg_banks_16k = new int[2];
|
private int[] prg_banks_16k = new int[2];
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
@ -87,14 +87,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
|
|
||||||
//AKA mapper 232
|
//AKA mapper 232
|
||||||
class Camerica_Mapper232 : NesBoardBase
|
internal class Camerica_Mapper232 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_16k;
|
private int prg_bank_mask_16k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int[] prg_banks_16k = new int[2];
|
private int[] prg_banks_16k = new int[2];
|
||||||
int prg_block, prg_page;
|
private int prg_block, prg_page;
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
@ -144,7 +144,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncPRG()
|
private void SyncPRG()
|
||||||
{
|
{
|
||||||
prg_banks_16k[0] = (prg_block << 2) | prg_page;
|
prg_banks_16k[0] = (prg_block << 2) | prg_page;
|
||||||
prg_banks_16k[1] = (prg_block << 2) | 3;
|
prg_banks_16k[1] = (prg_block << 2) | 3;
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
// behavior directly from fceu-mm
|
// behavior directly from fceu-mm
|
||||||
|
|
||||||
// this could be broken down into more sensibly named variables
|
// this could be broken down into more sensibly named variables
|
||||||
byte[] exp = new byte[4];
|
private byte[] exp = new byte[4];
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
public class DatachBarcode : IEmulatorService
|
public class DatachBarcode : IEmulatorService
|
||||||
{
|
{
|
||||||
static readonly byte[,] prefixParityType = new byte[10, 6]
|
private static readonly byte[,] prefixParityType = new byte[10, 6]
|
||||||
{
|
{
|
||||||
{8,8,8,8,8,8}, {8,8,0,8,0,0},
|
{8,8,8,8,8,8}, {8,8,0,8,0,0},
|
||||||
{8,8,0,0,8,0}, {8,8,0,0,0,8},
|
{8,8,0,0,8,0}, {8,8,0,0,0,8},
|
||||||
|
@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{8,0,8,0,0,8}, {8,0,0,8,0,8}
|
{8,0,8,0,0,8}, {8,0,0,8,0,8}
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly byte[,] dataLeftOdd = new byte[10, 7]
|
private static readonly byte[,] dataLeftOdd = new byte[10, 7]
|
||||||
{
|
{
|
||||||
{8,8,8,0,0,8,0}, {8,8,0,0,8,8,0},
|
{8,8,8,0,0,8,0}, {8,8,0,0,8,8,0},
|
||||||
{8,8,0,8,8,0,0}, {8,0,0,0,0,8,0},
|
{8,8,0,8,8,0,0}, {8,0,0,0,0,8,0},
|
||||||
|
@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{8,0,0,8,0,0,0}, {8,8,8,0,8,0,0}
|
{8,0,0,8,0,0,0}, {8,8,8,0,8,0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly byte[,] dataLeftEven = new byte[10, 7]
|
private static readonly byte[,] dataLeftEven = new byte[10, 7]
|
||||||
{
|
{
|
||||||
{8,0,8,8,0,0,0}, {8,0,0,8,8,0,0},
|
{8,0,8,8,0,0,0}, {8,0,0,8,8,0,0},
|
||||||
{8,8,0,0,8,0,0}, {8,0,8,8,8,8,0},
|
{8,8,0,0,8,0,0}, {8,0,8,8,8,8,0},
|
||||||
|
@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{8,8,8,0,8,8,0}, {8,8,0,8,0,0,0}
|
{8,8,8,0,8,8,0}, {8,8,0,8,0,0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static readonly byte[,] dataRight = new byte[10, 7]
|
private static readonly byte[,] dataRight = new byte[10, 7]
|
||||||
{
|
{
|
||||||
{0,0,0,8,8,0,8}, {0,0,8,8,0,0,8},
|
{0,0,0,8,8,0,8}, {0,0,8,8,0,0,8},
|
||||||
{0,0,8,0,0,8,8}, {0,8,8,8,8,0,8},
|
{0,0,8,0,0,8,8}, {0,8,8,8,8,0,8},
|
||||||
|
@ -46,16 +46,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{0,8,8,0,8,8,8}, {0,0,0,8,0,8,8}
|
{0,8,8,0,8,8,8}, {0,0,0,8,0,8,8}
|
||||||
};
|
};
|
||||||
|
|
||||||
const int MIN_DIGITS = 8;
|
private const int MIN_DIGITS = 8;
|
||||||
const int MAX_DIGITS = 13;
|
private const int MAX_DIGITS = 13;
|
||||||
const int CC_INTERVAL = 1000;
|
private const int CC_INTERVAL = 1000;
|
||||||
|
|
||||||
int cycles;
|
private int cycles;
|
||||||
byte output;
|
private byte output;
|
||||||
int stream_idx;
|
private int stream_idx;
|
||||||
byte[] data = new byte[0];
|
private byte[] data = new byte[0];
|
||||||
|
|
||||||
byte streamoutput => data[stream_idx];
|
private byte streamoutput => data[stream_idx];
|
||||||
|
|
||||||
public void SyncState(Serializer ser)
|
public void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PoweronState()
|
private void PoweronState()
|
||||||
{
|
{
|
||||||
//set all prg regs to use ROM
|
//set all prg regs to use ROM
|
||||||
regs_prg[0] = 0x80;
|
regs_prg[0] = 0x80;
|
||||||
|
@ -145,7 +145,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
SetMirrorType(EMirrorType.Vertical);
|
SetMirrorType(EMirrorType.Vertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
int PRGGetBank(int addr, out bool ram)
|
private int PRGGetBank(int addr, out bool ram)
|
||||||
{
|
{
|
||||||
int bank_8k = addr >> 13;
|
int bank_8k = addr >> 13;
|
||||||
bank_8k = _prgBanks8K[bank_8k];
|
bank_8k = _prgBanks8K[bank_8k];
|
||||||
|
@ -166,7 +166,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
// 4) 32K wram: 1x 32K
|
// 4) 32K wram: 1x 32K
|
||||||
//
|
//
|
||||||
// for iNES, we assume 64K wram
|
// for iNES, we assume 64K wram
|
||||||
int? MaskWRAM(int bank)
|
private int? MaskWRAM(int bank)
|
||||||
{
|
{
|
||||||
bank &= 7;
|
bank &= 7;
|
||||||
switch (Cart.WramSize)
|
switch (Cart.WramSize)
|
||||||
|
@ -192,14 +192,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteWRAMActual(int bank, int offs, byte value)
|
private void WriteWRAMActual(int bank, int offs, byte value)
|
||||||
{
|
{
|
||||||
int? bbank = MaskWRAM(bank);
|
int? bbank = MaskWRAM(bank);
|
||||||
if (bbank.HasValue)
|
if (bbank.HasValue)
|
||||||
Wram[(int)bbank << 13 | offs] = value;
|
Wram[(int)bbank << 13 | offs] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte ReadWRAMActual(int bank, int offs)
|
private byte ReadWRAMActual(int bank, int offs)
|
||||||
{
|
{
|
||||||
int? bbank = MaskWRAM(bank);
|
int? bbank = MaskWRAM(bank);
|
||||||
return bbank.HasValue
|
return bbank.HasValue
|
||||||
|
@ -223,7 +223,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
// return new TileCoord(tx, ty);
|
// return new TileCoord(tx, ty);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
int MapCHR(int addr)
|
private int MapCHR(int addr)
|
||||||
{
|
{
|
||||||
int bank_1k = addr >> 10;
|
int bank_1k = addr >> 10;
|
||||||
int ofs = addr & ((1 << 10) - 1);
|
int ofs = addr & ((1 << 10) - 1);
|
||||||
|
@ -579,7 +579,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncMultiplier()
|
private void SyncMultiplier()
|
||||||
{
|
{
|
||||||
int result = multiplicand*multiplier;
|
int result = multiplicand*multiplier;
|
||||||
product_low = (byte)(result&0xFF);
|
product_low = (byte)(result&0xFF);
|
||||||
|
@ -662,7 +662,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncIRQ()
|
private void SyncIRQ()
|
||||||
{
|
{
|
||||||
IrqSignal = (irq_pending && irq_enabled) || irq_audio;
|
IrqSignal = (irq_pending && irq_enabled) || irq_audio;
|
||||||
}
|
}
|
||||||
|
@ -709,7 +709,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
audio.Clock();
|
audio.Clock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetBank(int[] target, int offset, int size, int value)
|
private void SetBank(int[] target, int offset, int size, int value)
|
||||||
{
|
{
|
||||||
value &= ~(size-1);
|
value &= ~(size-1);
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < size; i++)
|
||||||
|
@ -720,7 +720,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncPRGBanks()
|
private void SyncPRGBanks()
|
||||||
{
|
{
|
||||||
switch (prg_mode)
|
switch (prg_mode)
|
||||||
{
|
{
|
||||||
|
@ -745,7 +745,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncCHRBanks()
|
private void SyncCHRBanks()
|
||||||
{
|
{
|
||||||
//MASTER LOGIC: something like this this might be enough to work, but i'll play with it later
|
//MASTER LOGIC: something like this this might be enough to work, but i'll play with it later
|
||||||
//bank_1k >> (3 - chr_mode) << chr_mode | bank_1k & ( etc.etc.
|
//bank_1k >> (3 - chr_mode) << chr_mode | bank_1k & ( etc.etc.
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
{
|
{
|
||||||
// waixing?
|
// waixing?
|
||||||
|
|
||||||
int prg;
|
private int prg;
|
||||||
int prg_mask_32k;
|
private int prg_mask_32k;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
// http://forums.nesdev.com/viewtopic.php?f=9&t=11099
|
// http://forums.nesdev.com/viewtopic.php?f=9&t=11099
|
||||||
|
|
||||||
// state
|
// state
|
||||||
int c; // clock bit for the second 74'161
|
private int c; // clock bit for the second 74'161
|
||||||
int e; // /load for second 74'161. guaranteed to be 0 on powerup
|
private int e; // /load for second 74'161. guaranteed to be 0 on powerup
|
||||||
int prginner;
|
private int prginner;
|
||||||
int prgouter; // guaranteed to be 0 on powerup
|
private int prgouter; // guaranteed to be 0 on powerup
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
internal sealed class GameGenie : NesBoardBase
|
internal sealed class GameGenie : NesBoardBase
|
||||||
{
|
{
|
||||||
static readonly byte[] PatternTables = new byte[256];
|
private static readonly byte[] PatternTables = new byte[256];
|
||||||
|
|
||||||
static GameGenie()
|
static GameGenie()
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,10 +17,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class GxROM : NesBoardBase
|
internal sealed class GxROM : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuraton
|
//configuraton
|
||||||
int prg_mask, chr_mask;
|
private int prg_mask, chr_mask;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int prg, chr;
|
private int prg, chr;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,12 +12,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class IC_74x377 : NesBoardBase
|
internal sealed class IC_74x377 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_32k, chr_bank_mask_8k;
|
private int prg_bank_mask_32k, chr_bank_mask_8k;
|
||||||
bool bus_conflict = true;
|
private bool bus_conflict = true;
|
||||||
bool bus_conflict_50282 = false;
|
private bool bus_conflict_50282 = false;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int prg_bank_32k, chr_bank_8k;
|
private int prg_bank_32k, chr_bank_8k;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
internal sealed class IREM_74_161_161_21_138 : NesBoardBase
|
internal sealed class IREM_74_161_161_21_138 : NesBoardBase
|
||||||
{
|
{
|
||||||
int chr, prg;
|
private int chr, prg;
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
//configure
|
//configure
|
||||||
|
|
|
@ -7,9 +7,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
|
||||||
internal sealed class IREM_TAM_S1 : NesBoardBase
|
internal sealed class IREM_TAM_S1 : NesBoardBase
|
||||||
{
|
{
|
||||||
int prg_bank_mask_16k;
|
private int prg_bank_mask_16k;
|
||||||
byte prg_bank_16k;
|
private byte prg_bank_16k;
|
||||||
byte[] prg_banks_16k = new byte[2];
|
private byte[] prg_banks_16k = new byte[2];
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
ser.Sync(nameof(prg_banks_16k), ref prg_banks_16k, false);
|
ser.Sync(nameof(prg_banks_16k), ref prg_banks_16k, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncPRG()
|
private void SyncPRG()
|
||||||
{
|
{
|
||||||
prg_banks_16k[1] = prg_bank_16k;
|
prg_banks_16k[1] = prg_bank_16k;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,13 +11,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class Irem_G101 : NesBoardBase
|
internal sealed class Irem_G101 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask, chr_bank_mask;
|
private int prg_bank_mask, chr_bank_mask;
|
||||||
bool oneScreenHack;
|
private bool oneScreenHack;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
byte[] prg_regs_8k = new byte[8];
|
private byte[] prg_regs_8k = new byte[8];
|
||||||
byte[] chr_regs_1k = new byte[8];
|
private byte[] chr_regs_1k = new byte[8];
|
||||||
int prg_mode, mirror_mode;
|
private int prg_mode, mirror_mode;
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncMirror()
|
private void SyncMirror()
|
||||||
{
|
{
|
||||||
if (oneScreenHack)
|
if (oneScreenHack)
|
||||||
SetMirrorType(EMirrorType.OneScreenA);
|
SetMirrorType(EMirrorType.OneScreenA);
|
||||||
|
|
|
@ -12,14 +12,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class Irem_H3001 : NesBoardBase
|
internal sealed class Irem_H3001 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask, chr_bank_mask;
|
private int prg_bank_mask, chr_bank_mask;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
byte[] prg_regs_8k = new byte[4];
|
private byte[] prg_regs_8k = new byte[4];
|
||||||
byte[] chr_regs_1k = new byte[8];
|
private byte[] chr_regs_1k = new byte[8];
|
||||||
bool irq_counter_enabled, irq_asserted;
|
private bool irq_counter_enabled, irq_asserted;
|
||||||
ushort irq_counter, irq_reload;
|
private ushort irq_counter, irq_reload;
|
||||||
int clock_counter;
|
private int clock_counter;
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
SyncIRQ();
|
SyncIRQ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncIRQ()
|
private void SyncIRQ()
|
||||||
{
|
{
|
||||||
IrqSignal = irq_asserted;
|
IrqSignal = irq_asserted;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
*/
|
*/
|
||||||
internal sealed class JALECO_JF_05_06_07 : NesBoardBase
|
internal sealed class JALECO_JF_05_06_07 : NesBoardBase
|
||||||
{
|
{
|
||||||
int prg_byte_mask;
|
private int prg_byte_mask;
|
||||||
int chr;
|
private int chr;
|
||||||
int chr_mask_8k;
|
private int chr_mask_8k;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,12 +12,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class JALECO_JF_13 : NesBoardBase
|
internal sealed class JALECO_JF_13 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_32k;
|
private int prg_bank_mask_32k;
|
||||||
int chr_bank_mask_8k;
|
private int chr_bank_mask_8k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int chr;
|
private int chr;
|
||||||
int prg;
|
private int prg;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,13 +18,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class JALECO_JF_17 : NesBoardBase
|
internal sealed class JALECO_JF_17 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_16k;
|
private int prg_bank_mask_16k;
|
||||||
int chr_bank_mask_8k;
|
private int chr_bank_mask_8k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int latch;
|
private int latch;
|
||||||
byte[] prg_banks_16k = new byte[2];
|
private byte[] prg_banks_16k = new byte[2];
|
||||||
byte[] chr_banks_8k = new byte[1];
|
private byte[] chr_banks_8k = new byte[1];
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncMap()
|
private void SyncMap()
|
||||||
{
|
{
|
||||||
ApplyMemoryMapMask(prg_bank_mask_16k, prg_banks_16k);
|
ApplyMemoryMapMask(prg_bank_mask_16k, prg_banks_16k);
|
||||||
ApplyMemoryMapMask(chr_bank_mask_8k, chr_banks_8k);
|
ApplyMemoryMapMask(chr_bank_mask_8k, chr_banks_8k);
|
||||||
|
|
|
@ -15,13 +15,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
internal sealed class JALECO_JF_19 : NesBoardBase
|
internal sealed class JALECO_JF_19 : NesBoardBase
|
||||||
{
|
{
|
||||||
//configuration
|
//configuration
|
||||||
int prg_bank_mask_16k;
|
private int prg_bank_mask_16k;
|
||||||
int chr_bank_mask_8k;
|
private int chr_bank_mask_8k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int latch;
|
private int latch;
|
||||||
byte[] prg_banks_16k = new byte[2];
|
private byte[] prg_banks_16k = new byte[2];
|
||||||
byte[] chr_banks_8k = new byte[1];
|
private byte[] chr_banks_8k = new byte[1];
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncMap()
|
private void SyncMap()
|
||||||
{
|
{
|
||||||
ApplyMemoryMapMask(prg_bank_mask_16k, prg_banks_16k);
|
ApplyMemoryMapMask(prg_bank_mask_16k, prg_banks_16k);
|
||||||
ApplyMemoryMapMask(chr_bank_mask_8k, chr_banks_8k);
|
ApplyMemoryMapMask(chr_bank_mask_8k, chr_banks_8k);
|
||||||
|
|
|
@ -6,14 +6,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{
|
{
|
||||||
//http://wiki.nesdev.com/w/index.php/INES_Mapper_018
|
//http://wiki.nesdev.com/w/index.php/INES_Mapper_018
|
||||||
|
|
||||||
byte[] prg_banks_8k = new byte[4];
|
private byte[] prg_banks_8k = new byte[4];
|
||||||
byte[] chr_banks_1k = new byte[8];
|
private byte[] chr_banks_1k = new byte[8];
|
||||||
int chr_bank_mask_1k, prg_bank_mask_8k;
|
private int chr_bank_mask_1k, prg_bank_mask_8k;
|
||||||
int ppuclock;
|
private int ppuclock;
|
||||||
int irqclock;
|
private int irqclock;
|
||||||
int irqreload;
|
private int irqreload;
|
||||||
int irqcountwidth;
|
private int irqcountwidth;
|
||||||
bool irqcountpaused;
|
private bool irqcountpaused;
|
||||||
|
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
|
@ -234,7 +234,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// emulate underflow for the appropriate number of bits
|
/// emulate underflow for the appropriate number of bits
|
||||||
/// </summary>
|
/// </summary>
|
||||||
uint squeeze(int input)
|
private uint squeeze(int input)
|
||||||
{
|
{
|
||||||
unchecked
|
unchecked
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ Other chips used: Sunsoft-1
|
||||||
|
|
||||||
internal sealed class Jaleco_JF_11_14 : NesBoardBase
|
internal sealed class Jaleco_JF_11_14 : NesBoardBase
|
||||||
{
|
{
|
||||||
int chr, prg;
|
private int chr, prg;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,8 +13,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
public int chr_reg;
|
public int chr_reg;
|
||||||
public int chip_offset;
|
public int chip_offset;
|
||||||
public bool cheetahmen = false;
|
public bool cheetahmen = false;
|
||||||
byte[] eRAM = new byte[4];
|
private byte[] eRAM = new byte[4];
|
||||||
int chr_bank_mask_8k, prg_bank_mask_16k, prg_bank_mask_32k;
|
private int chr_bank_mask_8k, prg_bank_mask_16k, prg_bank_mask_32k;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,15 +7,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{
|
{
|
||||||
//http://wiki.nesdev.com/w/index.php/INES_Mapper_234
|
//http://wiki.nesdev.com/w/index.php/INES_Mapper_234
|
||||||
|
|
||||||
bool mode = false;
|
private bool mode = false;
|
||||||
int block_high = 0;
|
private int block_high = 0;
|
||||||
int block_low = 0;
|
private int block_low = 0;
|
||||||
byte prg_bank = 0;
|
private byte prg_bank = 0;
|
||||||
byte chr_bank_high = 0;
|
private byte chr_bank_high = 0;
|
||||||
byte chr_bank_low = 0;
|
private byte chr_bank_low = 0;
|
||||||
int prg_bank_mask_32k = 0;
|
private int prg_bank_mask_32k = 0;
|
||||||
int chr_bank_mask_8k = 0;
|
private int chr_bank_mask_8k = 0;
|
||||||
bool reg_0_locked = false;
|
private bool reg_0_locked = false;
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
switch (Cart.BoardType)
|
switch (Cart.BoardType)
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
//configuration
|
//configuration
|
||||||
|
|
||||||
//state
|
//state
|
||||||
bool wram_enabled;
|
private bool wram_enabled;
|
||||||
bool wram_h_enabled, wram_l_enabled;
|
private bool wram_h_enabled, wram_l_enabled;
|
||||||
bool wram_h_enabled_write, wram_l_enabled_write;
|
private bool wram_h_enabled_write, wram_l_enabled_write;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,8 +18,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
public byte[] regs = new byte[8];
|
public byte[] regs = new byte[8];
|
||||||
|
|
||||||
public byte mirror;
|
public byte mirror;
|
||||||
int a12_old;
|
private int a12_old;
|
||||||
byte irq_reload, irq_counter;
|
private byte irq_reload, irq_counter;
|
||||||
public bool irq_pending, irq_enable, irq_reload_flag;
|
public bool irq_pending, irq_enable, irq_reload_flag;
|
||||||
public bool wram_enable, wram_write_protect;
|
public bool wram_enable, wram_write_protect;
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
//theres no sense in delaying the IRQ, so its logic must be tied to the separator.
|
//theres no sense in delaying the IRQ, so its logic must be tied to the separator.
|
||||||
//the hint, of course, is that the countdown value is the same.
|
//the hint, of course, is that the countdown value is the same.
|
||||||
//will someone else try to unify them?
|
//will someone else try to unify them?
|
||||||
int separator_counter;
|
private int separator_counter;
|
||||||
int irq_countdown;
|
private int irq_countdown;
|
||||||
|
|
||||||
//volatile state
|
//volatile state
|
||||||
public byte[] chr_regs_1k = new byte[8];
|
public byte[] chr_regs_1k = new byte[8];
|
||||||
|
@ -39,7 +39,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{
|
{
|
||||||
None, MMC3A, MMC3BSharp, MMC3BNonSharp, MMC3C, MMC6
|
None, MMC3A, MMC3BSharp, MMC3BNonSharp, MMC3C, MMC6
|
||||||
}
|
}
|
||||||
EMMC3Type _mmc3type = EMMC3Type.None;
|
|
||||||
|
private EMMC3Type _mmc3type = EMMC3Type.None;
|
||||||
public EMMC3Type MMC3Type
|
public EMMC3Type MMC3Type
|
||||||
{
|
{
|
||||||
get => _mmc3type;
|
get => _mmc3type;
|
||||||
|
@ -49,7 +50,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
oldIrqType = (_mmc3type == EMMC3Type.MMC3A || _mmc3type == EMMC3Type.MMC3BNonSharp || _mmc3type == EMMC3Type.MMC6);
|
oldIrqType = (_mmc3type == EMMC3Type.MMC3A || _mmc3type == EMMC3Type.MMC3BNonSharp || _mmc3type == EMMC3Type.MMC6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool oldIrqType;
|
|
||||||
|
private bool oldIrqType;
|
||||||
|
|
||||||
public EMirrorType MirrorType => mirror switch
|
public EMirrorType MirrorType => mirror switch
|
||||||
{
|
{
|
||||||
|
@ -208,7 +210,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRQ_EQ_Pass()
|
private void IRQ_EQ_Pass()
|
||||||
{
|
{
|
||||||
if (irq_enable)
|
if (irq_enable)
|
||||||
{
|
{
|
||||||
|
@ -218,7 +220,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
SyncIRQ();
|
SyncIRQ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClockIRQ()
|
private void ClockIRQ()
|
||||||
{
|
{
|
||||||
int last_irq_counter = irq_counter;
|
int last_irq_counter = irq_counter;
|
||||||
if (irq_reload_flag || irq_counter == 0)
|
if (irq_reload_flag || irq_counter == 0)
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
ser.Sync(nameof(block1), ref block1);
|
ser.Sync(nameof(block1), ref block1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int block0, block1;
|
private int block0, block1;
|
||||||
|
|
||||||
public override void WriteExp(int addr, byte value)
|
public override void WriteExp(int addr, byte value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
// mmc3 multi, PAL, "Super Mario Bros. / Tetris / Nintendo World Cup"
|
// mmc3 multi, PAL, "Super Mario Bros. / Tetris / Nintendo World Cup"
|
||||||
internal sealed class Mapper037 : MMC3Board_Base
|
internal sealed class Mapper037 : MMC3Board_Base
|
||||||
{
|
{
|
||||||
int exreg;
|
private int exreg;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
ser.Sync(nameof(block_select), ref block_select);
|
ser.Sync(nameof(block_select), ref block_select);
|
||||||
}
|
}
|
||||||
|
|
||||||
int block_select;
|
private int block_select;
|
||||||
|
|
||||||
public override void WritePrg(int addr, byte value)
|
public override void WritePrg(int addr, byte value)
|
||||||
{
|
{
|
||||||
|
@ -41,10 +41,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly int[] PRG_AND = {0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0f };
|
private static readonly int[] PRG_AND = {0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0f };
|
||||||
static readonly int[] PRG_OR = { 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x60 };
|
private static readonly int[] PRG_OR = { 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x60 };
|
||||||
static readonly int[] CHR_AND = { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7f };
|
private static readonly int[] CHR_AND = { 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7f };
|
||||||
static readonly int[] CHR_OR = { 0x000, 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x300 };
|
private static readonly int[] CHR_OR = { 0x000, 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x300 };
|
||||||
|
|
||||||
protected override int Get_PRGBank_8K(int addr)
|
protected override int Get_PRGBank_8K(int addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,8 +32,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
ser.Sync(nameof(mode), ref mode);
|
ser.Sync(nameof(mode), ref mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int block, prg;
|
private int block, prg;
|
||||||
bool mode;
|
private bool mode;
|
||||||
|
|
||||||
public override void WriteWram(int addr, byte value)
|
public override void WriteWram(int addr, byte value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{
|
{
|
||||||
//http://wiki.nesdev.com/w/index.php/INES_Mapper_052
|
//http://wiki.nesdev.com/w/index.php/INES_Mapper_052
|
||||||
|
|
||||||
bool lock_regs = false;
|
private bool lock_regs = false;
|
||||||
bool prg_block_size = false;
|
private bool prg_block_size = false;
|
||||||
bool chr_block_size = false;
|
private bool chr_block_size = false;
|
||||||
int prg_or = 0;
|
private int prg_or = 0;
|
||||||
int chr_or = 0;
|
private int chr_or = 0;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,8 +33,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
ser.Sync(nameof(chr_block_or), ref chr_block_or);
|
ser.Sync(nameof(chr_block_or), ref chr_block_or);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool prg_mode_mapper;
|
private bool prg_mode_mapper;
|
||||||
int prg_page, chr_block_or;
|
private int prg_page, chr_block_or;
|
||||||
|
|
||||||
public override void WriteWram(int addr, byte value)
|
public override void WriteWram(int addr, byte value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,9 +7,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
// seem to be some graphical glitches...
|
// seem to be some graphical glitches...
|
||||||
internal sealed class Mapper165 : MMC3Board_Base
|
internal sealed class Mapper165 : MMC3Board_Base
|
||||||
{
|
{
|
||||||
bool latch0 = false;
|
private bool latch0 = false;
|
||||||
bool latch1 = false;
|
private bool latch1 = false;
|
||||||
int real_chr_mask;
|
private int real_chr_mask;
|
||||||
|
|
||||||
public override bool Configure(EDetectionOrigin origin)
|
public override bool Configure(EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly byte[] scramble_table = { 0, 3, 1, 5, 6, 7, 2, 4 };
|
private static readonly byte[] scramble_table = { 0, 3, 1, 5, 6, 7, 2, 4 };
|
||||||
|
|
||||||
private static int scramble_A000(byte val)
|
private static int scramble_A000(byte val)
|
||||||
{
|
{
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue