From d03385ac32643bc6e84321820219e897b45410c9 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Mon, 16 Oct 2017 18:40:02 +0100 Subject: a few dasm fixes that were in the sh4 core but not the sh2 core and got lost when merging them (nw) --- src/devices/cpu/sh/sh_dasm.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/devices/cpu/sh/sh_dasm.cpp b/src/devices/cpu/sh/sh_dasm.cpp index 9961fd81a0a..aa27aa7128b 100644 --- a/src/devices/cpu/sh/sh_dasm.cpp +++ b/src/devices/cpu/sh/sh_dasm.cpp @@ -9,7 +9,10 @@ static const char *const regname[16] = { "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", - "R8", "R9", "R10","R11","R12","R13","R14","SP" + "R8", "R9", "R10","R11","R12","R13","R14", + // The old SH2 dasm used 'SP' here, the old SH4 used 'R15' + //"SP" + "R15" }; static uint32_t op0000(std::ostream &stream, uint32_t pc, uint16_t opcode) @@ -456,7 +459,7 @@ static uint32_t op1000(std::ostream &stream, uint32_t pc, uint16_t opcode) util::stream_format(stream, "MOV.B @($%02X,%s),R0", (opcode & 15), regname[Rm]); break; case 5: - util::stream_format(stream, "MOV.W @($%02X,%s),R0", (opcode & 15), regname[Rm]); + util::stream_format(stream, "MOV.W @($%02X,%s),R0", (opcode & 15) * 2, regname[Rm]); break; case 8: util::stream_format(stream, "CMP/EQ #$%02X,R0", (opcode & 0xff)); @@ -557,7 +560,7 @@ static uint32_t op1100(std::ostream &stream, uint32_t pc, uint16_t opcode) static uint32_t op1101(std::ostream &stream, uint32_t pc, uint16_t opcode) { - util::stream_format(stream, "MOV.L @($%02X,PC),%s [%08X]", (opcode * 4) & 0xff, regname[Rn], ((pc + 2) & ~3) + (opcode & 0xff) * 4); + util::stream_format(stream, "MOV.L @($%04X,PC),%s [%08X]", (opcode & 0xff) * 4, regname[Rn], ((pc + 2) & ~3) + (opcode & 0xff) * 4); return 0; } -- cgit v1.2.3