-Made the memory map use ushort arrays because the Intellivision is 16-bit.

-Fixed JMP disassembly; I need to return on an invalid opcode because I was breaking out of the inner switch statement, not both that and the outer one.
This commit is contained in:
brandman211 2012-07-09 23:19:57 +00:00
parent f3ce111c48
commit 32baa013af
3 changed files with 15 additions and 13 deletions

View File

@ -15,7 +15,7 @@ namespace BizHawk.Emulation.CPUs.CP1610
public int TotalExecutedCycles; public int TotalExecutedCycles;
public int PendingCycles; public int PendingCycles;
public Func<ushort, byte> ReadMemory; public Func<ushort, ushort> ReadMemory;
public Action<ushort, byte> WriteMemory; public Action<ushort, ushort> WriteMemory;
} }
} }

View File

@ -7,6 +7,8 @@ namespace BizHawk.Emulation.CPUs.CP1610
{ {
public sealed partial class CP1610 public sealed partial class CP1610
{ {
public const string UNKNOWN = "???";
public string Disassemble(ushort pc, out int bytesToAdvance) public string Disassemble(ushort pc, out int bytesToAdvance)
{ {
bytesToAdvance = 1; bytesToAdvance = 1;
@ -47,7 +49,7 @@ namespace BizHawk.Emulation.CPUs.CP1610
break; break;
case 0x3: case 0x3:
// Unknown opcode. // Unknown opcode.
break; return UNKNOWN;
} }
if (register != 0x3) if (register != 0x3)
result += " R" + register + ","; result += " R" + register + ",";
@ -1178,7 +1180,7 @@ namespace BizHawk.Emulation.CPUs.CP1610
case 0x3FF: case 0x3FF:
throw new NotImplementedException(); throw new NotImplementedException();
} }
return "???"; return UNKNOWN;
} }
} }
} }

View File

@ -7,15 +7,15 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
public sealed partial class Intellivision public sealed partial class Intellivision
{ {
private byte[] STIC_Registers; private ushort[] STIC_Registers;
private byte[] Scratchpad_RAM; private ushort[] Scratchpad_RAM;
private byte[] PSG_Registers; private ushort[] PSG_Registers;
private byte[] System_RAM; private ushort[] System_RAM;
private byte[] Executive_ROM; private ushort[] Executive_ROM;
private byte[] Graphics_ROM; private ushort[] Graphics_ROM;
private byte[] Graphics_RAM; private ushort[] Graphics_RAM;
public byte ReadMemory(ushort addr) public ushort ReadMemory(ushort addr)
{ {
switch (addr & 0xF000) switch (addr & 0xF000)
{ {
@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Consoles.Intellivision
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void WriteMemory(ushort addr, byte value) public void WriteMemory(ushort addr, ushort value)
{ {
switch (addr & 0xF000) switch (addr & 0xF000)
{ {