From bb532aa2d90253c839decf98ae23a9ae4daa02f0 Mon Sep 17 00:00:00 2001 From: brandman211 Date: Sun, 8 Jul 2012 21:49:09 +0000 Subject: [PATCH] Opcodes up to 0x5F. --- BizHawk.Emulation/CPUs/CP1610/Disassembler.cs | 5 +++-- BizHawk.Emulation/CPUs/CP1610/Execute.cs | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs b/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs index ecad729484..9e502bda5e 100644 --- a/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs +++ b/BizHawk.Emulation/CPUs/CP1610/Disassembler.cs @@ -165,7 +165,6 @@ namespace BizHawk.Emulation.CPUs.CP1610 register = (byte)(opcode & 0x3); op1 = opcode & 0x4; return "RLC R" + register + ", " + (op1 + 1); - // SLLC case 0x058: case 0x059: case 0x05A: @@ -174,7 +173,9 @@ namespace BizHawk.Emulation.CPUs.CP1610 case 0x05D: case 0x05E: case 0x05F: - throw new NotImplementedException(); + register = (byte)(opcode & 0x3); + op1 = opcode & 0x4; + return "SLLC R" + register + ", " + (op1 + 1); // SLR case 0x060: case 0x061: diff --git a/BizHawk.Emulation/CPUs/CP1610/Execute.cs b/BizHawk.Emulation/CPUs/CP1610/Execute.cs index f199b7e38b..2e0e4d1302 100644 --- a/BizHawk.Emulation/CPUs/CP1610/Execute.cs +++ b/BizHawk.Emulation/CPUs/CP1610/Execute.cs @@ -337,6 +337,26 @@ namespace BizHawk.Emulation.CPUs.CP1610 case 0x05E: case 0x05F: throw new NotImplementedException(); + register = (byte)(opcode & 0x3); + op1 = opcode & 0x4; + op2 = Register[register]; + result = op2 << 1; + FlagC = ((op2 & 0x8000) != 0); + if (op1 == 0) + { + // Single shift. + PendingCycles -= 6; TotalExecutedCycles += 6; + } + else + { + // Double shift. + result <<= 1; + FlagO = ((op2 & 0x4000) != 0); + PendingCycles -= 8; TotalExecutedCycles += 8; + } + Calc_FlagS(result); + Calc_FlagZ(result); + Register[register] = (ushort)result; // SLR case 0x060: case 0x061: