diff options
author | 2012-11-07 18:30:05 +0000 | |
---|---|---|
committer | 2012-11-07 18:30:05 +0000 | |
commit | 80fb9099309dcda56d69e45136943c7e54f4d635 (patch) | |
tree | 9de1f0055c3f90b2256c4354828c30f13047f45a /src/emu/cpu | |
parent | 4a85620161a27421ae74217890408d60c26059db (diff) |
65c02: Fix the bitwise ops and their disassembly [O. Galibert]
Diffstat (limited to 'src/emu/cpu')
-rw-r--r-- | src/emu/cpu/m6502/m6502.c | 8 | ||||
-rw-r--r-- | src/emu/cpu/m6502/m6502.h | 1 | ||||
-rw-r--r-- | src/emu/cpu/m6502/m6502make.c | 6 | ||||
-rw-r--r-- | src/emu/cpu/m6502/om65c02.lst | 8 |
4 files changed, 9 insertions, 14 deletions
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c index 3b0f5fa12f8..853b565ea69 100644 --- a/src/emu/cpu/m6502/m6502.c +++ b/src/emu/cpu/m6502/m6502.c @@ -477,9 +477,7 @@ offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *o { const disasm_entry &e = table[oprom[0]]; UINT32 flags = e.flags | DASMFLAG_SUPPORTED; - buffer += sprintf(buffer, "%-5s", e.opcode); - if(e.per_bit) - buffer += sprintf(buffer, "%d, ", (oprom[0] >> 4) & 7); + buffer += sprintf(buffer, "%s", e.opcode); switch(table[oprom[0]].mode) { case DASM_non: @@ -512,7 +510,7 @@ offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *o break; case DASM_bzp: - sprintf(buffer, "%d $%02x", oprom[0] & 7, opram[1]); + sprintf(buffer, "%d $%02x", (oprom[0] >> 4) & 7, opram[1]); flags |= 2; break; @@ -576,7 +574,7 @@ offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *o break; case DASM_zpb: - sprintf(buffer, "%d $%02x, $%04x", oprom[0] & 7, opram[1], (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[2]))); + sprintf(buffer, "%d $%02x, $%04x", (oprom[0] >> 4) & 7, opram[1], (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[2]))); flags |= 3; break; diff --git a/src/emu/cpu/m6502/m6502.h b/src/emu/cpu/m6502/m6502.h index 4a4cf747ab0..1368f96f15e 100644 --- a/src/emu/cpu/m6502/m6502.h +++ b/src/emu/cpu/m6502/m6502.h @@ -89,7 +89,6 @@ protected: const char *opcode; int mode; offs_t flags; - bool per_bit; }; enum { diff --git a/src/emu/cpu/m6502/m6502make.c b/src/emu/cpu/m6502/m6502make.c index 4e4a65e3573..8e71e0b1181 100644 --- a/src/emu/cpu/m6502/m6502make.c +++ b/src/emu/cpu/m6502/m6502make.c @@ -214,10 +214,8 @@ static void save_tables(FILE *f) bool step_over = opc == "jsr" || opc == "bsr"; bool step_out = opc == "rts" || opc == "rti" || opc == "rtn"; - bool per_bit = opc == "bbr" || opc == "bbs" || opc == "rmb" || opc == "smb"; - fprintf(f, "\t{ \"%s\", DASM_%s, %s, %s },\n", - opc.c_str(), mode.c_str(), step_over ? "DASMFLAG_STEP_OVER" : step_out ? "DASMFLAG_STEP_OUT" : "0", - per_bit ? "true" : "false"); + fprintf(f, "\t{ \"%s\", DASM_%s, %s },\n", + opc.c_str(), mode.c_str(), step_over ? "DASMFLAG_STEP_OVER" : step_out ? "DASMFLAG_STEP_OUT" : "0"); } else fprintf(f, "\t{ \"???\", DASM_imp, 0, false },\n"); fprintf(f, "};\n"); diff --git a/src/emu/cpu/m6502/om65c02.lst b/src/emu/cpu/m6502/om65c02.lst index 02dc03f43e7..e1292eadfec 100644 --- a/src/emu/cpu/m6502/om65c02.lst +++ b/src/emu/cpu/m6502/om65c02.lst @@ -136,7 +136,7 @@ bbr_zpb TMP2 = read(TMP); TMP = read_pc(); read_pc_noinc(); - if(!(TMP2 & (1 << (inst_state & 7)))) { + if(!(TMP2 & (1 << ((inst_state >> 4) & 7)))) { PC += INT8(TMP); } prefetch(); @@ -147,7 +147,7 @@ bbs_zpb TMP2 = read(TMP); TMP = read_pc(); read_pc_noinc(); - if(TMP2 & (1 << (inst_state & 7))) { + if(TMP2 & (1 << ((inst_state >> 4) & 7))) { PC += INT8(TMP); } prefetch(); @@ -340,7 +340,7 @@ rmb_bzp TMP = read_pc(); TMP2 = read(TMP); write(TMP, TMP2); - TMP2 &= ~(1 << (inst_state & 7)); + TMP2 &= ~(1 << ((inst_state >> 4) & 7)); write(TMP, TMP2); prefetch(); @@ -485,7 +485,7 @@ smb_bzp TMP = read_pc(); TMP2 = read(TMP); write(TMP, TMP2); - TMP2 |= 1 << (inst_state & 7); + TMP2 |= 1 << ((inst_state >> 4) & 7); write(TMP, TMP2); prefetch(); |