From 32baa013af0fb016e8444bc5ac2af3c7514435cc Mon Sep 17 00:00:00 2001 From: brandman211 Date: Mon, 9 Jul 2012 23:19:57 +0000 Subject: [PATCH] -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. --- BizHawk.Emulation/CPUs/CP1610/CP1610.cs | 4 ++-- BizHawk.Emulation/CPUs/CP1610/Disassembler.cs | 6 ++++-- .../Consoles/Intellivision/MemoryMap.cs | 18 +++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/BizHawk.Emulation/CPUs/CP1610/CP1610.cs b/BizHawk.Emulation/CPUs/CP1610/CP1610.cs index 3172dafb78..5d9fb40012 100644 --- a/BizHawk.Emulation/CPUs/CP1610/CP1610.cs +++ b/BizHawk.Emulation/CPUs/CP1610/CP1610.cs @@ -15,7 +15,7 @@ namespace BizHawk.Emulation.CPUs.CP1610 public int TotalExecutedCycles; public int PendingCycles; - public Func ReadMemory; - public Action WriteMemory; + public Func ReadMemory; + public Action WriteMemory; } } diff --git a/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs b/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs index 9cc05f3c7a..27f846a308 100644 --- a/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs +++ b/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs @@ -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; } } } diff --git a/BizHawk.Emulation/Consoles/Intellivision/MemoryMap.cs b/BizHawk.Emulation/Consoles/Intellivision/MemoryMap.cs index cfda4b2d22..94591780bb 100644 --- a/BizHawk.Emulation/Consoles/Intellivision/MemoryMap.cs +++ b/BizHawk.Emulation/Consoles/Intellivision/MemoryMap.cs @@ -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) {