-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 PendingCycles;
public Func<ushort, byte> ReadMemory;
public Action<ushort, byte> WriteMemory;
public Func<ushort, ushort> ReadMemory;
public Action<ushort, ushort> WriteMemory;
}
}

View File

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

View File

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