summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author ajrhacker <ajrhacker@users.noreply.github.com>2017-10-16 14:58:59 -0400
committer GitHub <noreply@github.com>2017-10-16 14:58:59 -0400
commite37cf6f65978d230bfdaacf21e216d73949a56e1 (patch)
tree2ea441729234fd6eaf01a2efcfcbd7b5ff9c44bb
parent0a0fd11e71b37a2b78c8be64db383458bdb049a4 (diff)
parentd03385ac32643bc6e84321820219e897b45410c9 (diff)
Merge pull request #2721 from DavidHaywood/131017
a few dasm fixes that were in the sh4 core but not the sh2 core and got lost when merging them (nw)
-rw-r--r--src/devices/cpu/sh/sh_dasm.cpp9
1 files 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;
}