From f9002c38eeef952bf18da03415a34137178cc0e2 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 17 Jun 2023 13:54:58 -0400 Subject: m6502: Return to implicitly using read_arg to read operands at PC (fixes regression in all XaviX games) Side note: this changes the semantics of read_pc to what was formerly known as read_pc_noinc. Now that memory accesses themselves can be interrupted and restarted, updating PC as a side effect is obsolete anyway. --- src/devices/cpu/m6502/m6502.h | 3 +- src/devices/cpu/m6502/odeco16.lst | 24 +- src/devices/cpu/m6502/om6502.lst | 618 +++++++++++++++++------------------ src/devices/cpu/m6502/om6509.lst | 4 +- src/devices/cpu/m6502/om6510.lst | 14 +- src/devices/cpu/m6502/om65c02.lst | 268 +++++++-------- src/devices/cpu/m6502/om65ce02.lst | 484 +++++++++++++-------------- src/devices/cpu/m6502/om740.lst | 494 ++++++++++++++-------------- src/devices/cpu/m6502/or65c19.lst | 158 ++++----- src/devices/cpu/m6502/orp2a03.lst | 86 ++--- src/devices/cpu/m6502/ow65c02s.lst | 390 +++++++++++----------- src/devices/cpu/m6502/oxavix.lst | 216 ++++++------ src/devices/cpu/m6502/oxavix2000.lst | 166 +++++----- 13 files changed, 1462 insertions(+), 1463 deletions(-) diff --git a/src/devices/cpu/m6502/m6502.h b/src/devices/cpu/m6502/m6502.h index 3f4d92a03da..c16555a2493 100644 --- a/src/devices/cpu/m6502/m6502.h +++ b/src/devices/cpu/m6502/m6502.h @@ -144,8 +144,7 @@ protected: void write(uint16_t adr, uint8_t val) { mintf->write(adr, val); } void write_9(uint16_t adr, uint8_t val) { mintf->write_9(adr, val); } uint8_t read_arg(uint16_t adr) { return mintf->read_arg(adr); } - uint8_t read_pc() { return mintf->read_arg(PC++); } - uint8_t read_pc_noinc() { return mintf->read_arg(PC); } + uint8_t read_pc() { return mintf->read_arg(PC); } void prefetch_start(); void prefetch_end(); void prefetch_end_noirq(); diff --git a/src/devices/cpu/m6502/odeco16.lst b/src/devices/cpu/m6502/odeco16.lst index 442e7962885..1f25b6b3be6 100644 --- a/src/devices/cpu/m6502/odeco16.lst +++ b/src/devices/cpu/m6502/odeco16.lst @@ -4,9 +4,9 @@ brk_16_imp // The 6502 bug when a nmi occurs in a brk is reproduced (case !irq_taken && nmi_pending) if(irq_taken) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write(SP, PC >> 8); @@ -36,48 +36,48 @@ ill_non prefetch(); u0B_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OP0B %02x (%04x)\n", tag(), NPC, TMP2); prefetch(); u13_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OP13 %02x (%04x)\n", tag(), NPC, TMP2); prefetch(); u23_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OP23 %02x (%04x)\n", tag(), NPC, TMP2); prefetch(); u3F_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OPBB %02x (%04x)\n", tag(), NPC, TMP2); prefetch(); u4B_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; A = io->read_byte(1); prefetch(); u87_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OP87 %02x (%04x)\n", tag(), NPC, TMP2); prefetch(); u8F_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OP8F (BANK) %02x (%04x)\n", tag(), NPC, TMP2); @@ -85,21 +85,21 @@ u8F_zpg prefetch(); uA3_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OPA3 %02x (%04x)\n", tag(), NPC, TMP2); prefetch(); uBB_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; if(DECO16_VERBOSE) logerror("%s: OPBB %02x (%04x)\n", tag(), NPC, TMP2); prefetch(); vbl_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; A = io->read_byte(0); //if(DECO16_VERBOSE) diff --git a/src/devices/cpu/m6502/om6502.lst b/src/devices/cpu/m6502/om6502.lst index 4e801650a30..428a71f2079 100644 --- a/src/devices/cpu/m6502/om6502.lst +++ b/src/devices/cpu/m6502/om6502.lst @@ -5,18 +5,18 @@ # documented opcodes adc_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_adc(TMP2); prefetch(); adc_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -27,9 +27,9 @@ adc_abx prefetch(); adc_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -40,7 +40,7 @@ adc_aby prefetch(); adc_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -51,7 +51,7 @@ adc_idx prefetch(); adc_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -63,20 +63,20 @@ adc_idy prefetch(); adc_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_adc(TMP); prefetch(); adc_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_adc(TMP2); prefetch(); adc_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -84,9 +84,9 @@ adc_zpx prefetch(); and_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); A &= TMP2; @@ -94,9 +94,9 @@ and_aba prefetch(); and_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -108,9 +108,9 @@ and_abx prefetch(); and_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -122,14 +122,14 @@ and_aby prefetch(); and_imm - TMP = read(PC); + TMP = read_pc(); PC++; A &= TMP; set_nz(A); prefetch(); and_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -141,7 +141,7 @@ and_idx prefetch(); and_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -154,7 +154,7 @@ and_idy prefetch(); and_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); A &= TMP2; @@ -162,7 +162,7 @@ and_zpg prefetch(); and_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -171,9 +171,9 @@ and_zpx prefetch(); asl_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -182,9 +182,9 @@ asl_aba prefetch(); asl_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -195,12 +195,12 @@ asl_abx prefetch(); asl_acc - read(PC); + read_pc(); A = do_asl(A); prefetch(); asl_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -209,7 +209,7 @@ asl_zpg prefetch(); asl_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -220,10 +220,10 @@ asl_zpx prefetch(); bcc_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_C)) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -232,10 +232,10 @@ bcc_rel prefetch(); bcs_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_C) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -244,10 +244,10 @@ bcs_rel prefetch(); beq_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_Z) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -256,26 +256,26 @@ beq_rel prefetch(); bit_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_bit(TMP2); prefetch(); bit_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_bit(TMP2); prefetch(); bmi_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_N) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -284,10 +284,10 @@ bmi_rel prefetch(); bne_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_Z)) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -296,10 +296,10 @@ bne_rel prefetch(); bpl_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_N)) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -310,9 +310,9 @@ bpl_rel brk_imp // The 6502 bug when a nmi occurs in a brk is reproduced (case !irq_taken && nmi_pending) if(irq_taken) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write(SP, PC >> 8); @@ -338,10 +338,10 @@ brk_imp inst_state = -1; bvc_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_V)) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -350,10 +350,10 @@ bvc_rel prefetch(); bvs_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_V) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -362,38 +362,38 @@ bvs_rel prefetch(); clc_imp - read(PC); + read_pc(); P &= ~F_C; prefetch(); cld_imp - read(PC); + read_pc(); P &= ~F_D; prefetch(); cli_imp - read(PC); + read_pc(); prefetch(); P &= ~F_I; // Do *not* move it before the prefetch clv_imp - read(PC); + read_pc(); P &= ~F_V; prefetch(); cmp_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_cmp(A, TMP2); prefetch(); cmp_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -404,9 +404,9 @@ cmp_abx prefetch(); cmp_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -417,7 +417,7 @@ cmp_aby prefetch(); cmp_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -428,7 +428,7 @@ cmp_idx prefetch(); cmp_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -440,20 +440,20 @@ cmp_idy prefetch(); cmp_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_cmp(A, TMP); prefetch(); cmp_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_cmp(A, TMP2); prefetch(); cmp_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -461,53 +461,53 @@ cmp_zpx prefetch(); cpx_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_cmp(X, TMP2); prefetch(); cpx_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_cmp(X, TMP); prefetch(); cpx_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_cmp(X, TMP2); prefetch(); cpy_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_cmp(Y, TMP2); prefetch(); cpy_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_cmp(Y, TMP); prefetch(); cpy_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_cmp(Y, TMP2); prefetch(); dec_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -517,9 +517,9 @@ dec_aba prefetch(); dec_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -531,7 +531,7 @@ dec_abx prefetch(); dec_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -541,7 +541,7 @@ dec_zpg prefetch(); dec_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -553,21 +553,21 @@ dec_zpx prefetch(); dex_imp - read(PC); + read_pc(); X--; set_nz(X); prefetch(); dey_imp - read(PC); + read_pc(); Y--; set_nz(Y); prefetch(); eor_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); A ^= TMP2; @@ -575,9 +575,9 @@ eor_aba prefetch(); eor_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -589,9 +589,9 @@ eor_abx prefetch(); eor_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -603,7 +603,7 @@ eor_aby prefetch(); eor_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -615,7 +615,7 @@ eor_idx prefetch(); eor_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -628,14 +628,14 @@ eor_idy prefetch(); eor_imm - TMP = read(PC); + TMP = read_pc(); PC++; A ^= TMP; set_nz(A); prefetch(); eor_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); A ^= TMP2; @@ -643,7 +643,7 @@ eor_zpg prefetch(); eor_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -652,9 +652,9 @@ eor_zpx prefetch(); inc_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -664,9 +664,9 @@ inc_aba prefetch(); inc_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -678,7 +678,7 @@ inc_abx prefetch(); inc_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -688,7 +688,7 @@ inc_zpg prefetch(); inc_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -700,58 +700,58 @@ inc_zpx prefetch(); inx_imp - read(PC); + read_pc(); X++; set_nz(X); prefetch(); iny_imp - read(PC); + read_pc(); Y++; set_nz(Y); prefetch(); jmp_adr - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC = TMP; prefetch(); jmp_ind - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read(TMP); PC = set_h(PC, read(set_l(TMP, TMP+1))); prefetch(); jsr_adr - TMP = read(PC); + TMP = read_pc(); PC++; read(SP); write(SP, PC>>8); dec_SP(); write(SP, PC); dec_SP(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC = TMP; prefetch(); lda_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; A = read(TMP); set_nz(A); prefetch(); lda_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -761,9 +761,9 @@ lda_abx prefetch(); lda_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -773,7 +773,7 @@ lda_aby prefetch(); lda_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -784,7 +784,7 @@ lda_idx prefetch(); lda_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -796,20 +796,20 @@ lda_idy prefetch(); lda_imm - A = read(PC); + A = read_pc(); PC++; set_nz(A); prefetch(); lda_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A = read(TMP); set_nz(A); prefetch(); lda_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); A = read(uint8_t(TMP+X)); @@ -817,18 +817,18 @@ lda_zpx prefetch(); ldx_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; X = read(TMP); set_nz(X); prefetch(); ldx_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -838,20 +838,20 @@ ldx_aby prefetch(); ldx_imm - X = read(PC); + X = read_pc(); PC++; set_nz(X); prefetch(); ldx_zpg - TMP = read(PC); + TMP = read_pc(); PC++; X = read(TMP); set_nz(X); prefetch(); ldx_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); X = read(uint8_t(TMP+Y)); @@ -859,18 +859,18 @@ ldx_zpy prefetch(); ldy_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; Y = read(TMP); set_nz(Y); prefetch(); ldy_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -881,20 +881,20 @@ ldy_abx prefetch(); ldy_imm - Y = read(PC); + Y = read_pc(); PC++; set_nz(Y); prefetch(); ldy_zpg - TMP = read(PC); + TMP = read_pc(); PC++; Y = read(TMP); set_nz(Y); prefetch(); ldy_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); Y = read(uint8_t(TMP+X)); @@ -902,9 +902,9 @@ ldy_zpx prefetch(); lsr_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -913,9 +913,9 @@ lsr_aba prefetch(); lsr_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -926,12 +926,12 @@ lsr_abx prefetch(); lsr_acc - read(PC); + read_pc(); A = do_lsr(A); prefetch(); lsr_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -940,7 +940,7 @@ lsr_zpg prefetch(); lsr_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -951,13 +951,13 @@ lsr_zpx prefetch(); nop_imp - read(PC); + read_pc(); prefetch(); ora_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); A |= TMP2; @@ -965,9 +965,9 @@ ora_aba prefetch(); ora_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -979,9 +979,9 @@ ora_abx prefetch(); ora_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -993,14 +993,14 @@ ora_aby prefetch(); ora_imm - TMP = read(PC); + TMP = read_pc(); PC++; A |= TMP; set_nz(A); prefetch(); ora_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1012,7 +1012,7 @@ ora_idx prefetch(); ora_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1025,7 +1025,7 @@ ora_idy prefetch(); ora_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); A |= TMP2; @@ -1033,7 +1033,7 @@ ora_zpg prefetch(); ora_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -1042,19 +1042,19 @@ ora_zpx prefetch(); pha_imp - read(PC); + read_pc(); write(SP, A); dec_SP(); prefetch(); php_imp - read(PC); + read_pc(); write(SP, P); dec_SP(); prefetch(); pla_imp - read(PC); + read_pc(); read(SP); inc_SP(); A = read(SP); @@ -1062,7 +1062,7 @@ pla_imp prefetch(); plp_imp - read(PC); + read_pc(); read(SP); inc_SP(); TMP = read(SP) | (F_B|F_E); @@ -1070,9 +1070,9 @@ plp_imp P = TMP; // Do *not* move it before the prefetch rol_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1081,9 +1081,9 @@ rol_aba prefetch(); rol_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -1094,12 +1094,12 @@ rol_abx prefetch(); rol_acc - read(PC); + read_pc(); A = do_rol(A); prefetch(); rol_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1108,7 +1108,7 @@ rol_zpg prefetch(); rol_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -1119,9 +1119,9 @@ rol_zpx prefetch(); ror_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1130,9 +1130,9 @@ ror_aba prefetch(); ror_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -1143,12 +1143,12 @@ ror_abx prefetch(); ror_acc - read(PC); + read_pc(); A = do_ror(A); prefetch(); ror_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1157,7 +1157,7 @@ ror_zpg prefetch(); ror_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -1168,7 +1168,7 @@ ror_zpx prefetch(); rti_imp - read(PC); + read_pc(); read(SP); inc_SP(); P = read(SP) | (F_B|F_E); @@ -1179,29 +1179,29 @@ rti_imp prefetch(); rts_imp - read(PC); + read_pc(); read(SP); inc_SP(); PC = read(SP); inc_SP(); PC = set_h(PC, read(SP)); - read(PC); + read_pc(); PC++; prefetch(); sbc_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_sbc(TMP2); prefetch(); sbc_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -1212,9 +1212,9 @@ sbc_abx prefetch(); sbc_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -1225,7 +1225,7 @@ sbc_aby prefetch(); sbc_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1236,7 +1236,7 @@ sbc_idx prefetch(); sbc_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1248,20 +1248,20 @@ sbc_idy prefetch(); sbc_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_sbc(TMP); prefetch(); sbc_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_sbc(TMP2); prefetch(); sbc_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -1269,48 +1269,48 @@ sbc_zpx prefetch(); sec_imp - read(PC); + read_pc(); P |= F_C; prefetch(); sed_imp - read(PC); + read_pc(); P |= F_D; prefetch(); sei_imp - read(PC); + read_pc(); prefetch(); P |= F_I; // Do *not* move it before the prefetch sta_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP, A); prefetch(); sta_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); write(TMP+X, A); prefetch(); sta_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); write(TMP+Y, A); prefetch(); sta_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1320,7 +1320,7 @@ sta_idx prefetch(); sta_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1329,99 +1329,99 @@ sta_idy prefetch(); sta_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(TMP, A); prefetch(); sta_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); write(uint8_t(TMP+X), A); prefetch(); stx_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP, X); prefetch(); stx_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(TMP, X); prefetch(); stx_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); write(uint8_t(TMP+Y), X); prefetch(); sty_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP, Y); prefetch(); sty_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(TMP, Y); prefetch(); sty_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); write(uint8_t(TMP+X), Y); prefetch(); tax_imp - read(PC); + read_pc(); X = A; set_nz(X); prefetch(); tay_imp - read(PC); + read_pc(); Y = A; set_nz(Y); prefetch(); tsx_imp - read(PC); + read_pc(); X = SP; set_nz(X); prefetch(); txa_imp - read(PC); + read_pc(); A = X; set_nz(A); prefetch(); txs_imp - read(PC); + read_pc(); SP = set_l(SP, X); prefetch(); tya_imp - read(PC); + read_pc(); A = Y; set_nz(A); prefetch(); # exceptions reset - read(PC); - read(PC); + read_pc(); + read_pc(); read(SP); dec_SP(); read(SP); @@ -1437,9 +1437,9 @@ reset # undocumented reliable instructions dcp_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1449,9 +1449,9 @@ dcp_aba prefetch(); dcp_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -1463,9 +1463,9 @@ dcp_abx prefetch(); dcp_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -1477,7 +1477,7 @@ dcp_aby prefetch(); dcp_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1491,7 +1491,7 @@ dcp_idx prefetch(); dcp_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1505,7 +1505,7 @@ dcp_idy prefetch(); dcp_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1515,7 +1515,7 @@ dcp_zpg prefetch(); dcp_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -1527,9 +1527,9 @@ dcp_zpx prefetch(); isb_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1539,9 +1539,9 @@ isb_aba prefetch(); isb_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -1553,9 +1553,9 @@ isb_abx prefetch(); isb_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -1567,7 +1567,7 @@ isb_aby prefetch(); isb_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1581,7 +1581,7 @@ isb_idx prefetch(); isb_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1595,7 +1595,7 @@ isb_idy prefetch(); isb_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1605,7 +1605,7 @@ isb_zpg prefetch(); isb_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -1617,18 +1617,18 @@ isb_zpx prefetch(); lax_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; A = X = read(TMP); set_nz(A); prefetch(); lax_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -1638,7 +1638,7 @@ lax_aby prefetch(); lax_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1649,7 +1649,7 @@ lax_idx prefetch(); lax_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1661,14 +1661,14 @@ lax_idy prefetch(); lax_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A = X = read(TMP); set_nz(A); prefetch(); lax_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+Y); @@ -1677,9 +1677,9 @@ lax_zpy prefetch(); rla_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1690,9 +1690,9 @@ rla_aba prefetch(); rla_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -1705,9 +1705,9 @@ rla_abx prefetch(); rla_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -1720,7 +1720,7 @@ rla_aby prefetch(); rla_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1735,7 +1735,7 @@ rla_idx prefetch(); rla_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1750,7 +1750,7 @@ rla_idy prefetch(); rla_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1761,7 +1761,7 @@ rla_zpg prefetch(); rla_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -1774,9 +1774,9 @@ rla_zpx prefetch(); rra_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1786,9 +1786,9 @@ rra_aba prefetch(); rra_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -1800,9 +1800,9 @@ rra_abx prefetch(); rra_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -1814,7 +1814,7 @@ rra_aby prefetch(); rra_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1828,7 +1828,7 @@ rra_idx prefetch(); rra_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1842,7 +1842,7 @@ rra_idy prefetch(); rra_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1852,7 +1852,7 @@ rra_zpg prefetch(); rra_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -1864,16 +1864,16 @@ rra_zpx prefetch(); sax_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = A & X; write(TMP, TMP2); prefetch(); sax_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -1884,14 +1884,14 @@ sax_idx prefetch(); sax_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = A & X; write(TMP, TMP2); prefetch(); sax_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+Y); @@ -1900,7 +1900,7 @@ sax_zpy prefetch(); sbx_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; X &= A; if(X < TMP2) @@ -1912,9 +1912,9 @@ sbx_imm prefetch(); sha_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP2 = A & X & ((TMP >> 8)+1); @@ -1926,7 +1926,7 @@ sha_aby prefetch(); sha_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1940,9 +1940,9 @@ sha_idy prefetch(); shs_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); SP = set_l(SP, A & X); @@ -1955,9 +1955,9 @@ shs_aby prefetch(); shx_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP2 = X & ((TMP >> 8)+1); @@ -1969,9 +1969,9 @@ shx_aby prefetch(); shy_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP2 = Y & ((TMP >> 8)+1); @@ -1983,9 +1983,9 @@ shy_abx prefetch(); slo_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -1996,9 +1996,9 @@ slo_aba prefetch(); slo_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -2011,9 +2011,9 @@ slo_abx prefetch(); slo_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -2026,7 +2026,7 @@ slo_aby prefetch(); slo_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -2041,7 +2041,7 @@ slo_idx prefetch(); slo_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -2056,7 +2056,7 @@ slo_idy prefetch(); slo_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -2067,7 +2067,7 @@ slo_zpg prefetch(); slo_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -2080,9 +2080,9 @@ slo_zpx prefetch(); sre_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -2093,9 +2093,9 @@ sre_aba prefetch(); sre_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -2108,9 +2108,9 @@ sre_abx prefetch(); sre_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -2123,7 +2123,7 @@ sre_aby prefetch(); sre_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -2138,7 +2138,7 @@ sre_idx prefetch(); sre_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -2153,7 +2153,7 @@ sre_idy prefetch(); sre_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -2164,7 +2164,7 @@ sre_zpg prefetch(); sre_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -2178,7 +2178,7 @@ sre_zpx # undocumented unreliable instructions anc_imm - TMP = read(PC); + TMP = read_pc(); PC++; A &= TMP; set_nz(A); @@ -2189,29 +2189,29 @@ anc_imm prefetch(); ane_imm - TMP = read(PC); + TMP = read_pc(); PC++; A &= TMP & X; set_nz(A); prefetch(); asr_imm - TMP = read(PC); + TMP = read_pc(); PC++; A = do_lsr(A & TMP); prefetch(); arr_imm - TMP = read(PC); + TMP = read_pc(); PC++; A &= TMP; do_arr(); prefetch(); las_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -2223,24 +2223,24 @@ las_aby prefetch(); lxa_imm - A = X = read(PC); + A = X = read_pc(); PC++; set_nz(A); prefetch(); # nop variants nop_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(TMP); prefetch(); nop_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -2249,18 +2249,18 @@ nop_abx prefetch(); nop_imm - read(PC); + read_pc(); PC++; prefetch(); nop_zpg - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); prefetch(); nop_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); read(uint8_t(TMP+X)); @@ -2268,7 +2268,7 @@ nop_zpx # system killers kil_non - read(PC); + read_pc(); PC++; read(0xffff); read(0xfffe); diff --git a/src/devices/cpu/m6502/om6509.lst b/src/devices/cpu/m6502/om6509.lst index 30ce622c502..b2f116716e8 100644 --- a/src/devices/cpu/m6502/om6509.lst +++ b/src/devices/cpu/m6502/om6509.lst @@ -3,7 +3,7 @@ # 6509 opcodes lda_9_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -15,7 +15,7 @@ lda_9_idy prefetch(); sta_9_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); diff --git a/src/devices/cpu/m6502/om6510.lst b/src/devices/cpu/m6502/om6510.lst index d31fdf50ee5..1554e83de95 100644 --- a/src/devices/cpu/m6502/om6510.lst +++ b/src/devices/cpu/m6502/om6510.lst @@ -2,7 +2,7 @@ # copyright-holders:Olivier Galibert # 6510 undocumented instructions in a C64 context anc_10_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; A &= TMP2; set_nz(A); @@ -13,30 +13,30 @@ anc_10_imm prefetch(); ane_10_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; A = (A | 0xee) & TMP2 & X; set_nz(A); prefetch(); asr_10_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; A = do_lsr(A & TMP2); set_nz(A); prefetch(); arr_10_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; A &= TMP2; do_arr(); prefetch(); las_10_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -48,7 +48,7 @@ las_10_aby prefetch(); lxa_10_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; A = X = (A | 0xee) & TMP2; set_nz(A); diff --git a/src/devices/cpu/m6502/om65c02.lst b/src/devices/cpu/m6502/om65c02.lst index 84302351650..a3a0d1e6cde 100644 --- a/src/devices/cpu/m6502/om65c02.lst +++ b/src/devices/cpu/m6502/om65c02.lst @@ -3,22 +3,22 @@ # m65c02 opcodes adc_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -27,15 +27,15 @@ adc_c_abx TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -44,13 +44,13 @@ adc_c_aby TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -59,13 +59,13 @@ adc_c_idx TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -75,59 +75,59 @@ adc_c_idy TMP2 = read(TMP+Y); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_adc(TMP); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); adc_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); and_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -137,9 +137,9 @@ and_zpi prefetch(); asl_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -148,9 +148,9 @@ asl_c_aba prefetch(); asl_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -161,7 +161,7 @@ asl_c_abx prefetch(); asl_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -170,7 +170,7 @@ asl_c_zpg prefetch(); asl_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -181,14 +181,14 @@ asl_c_zpx prefetch(); bbr_zpb - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); - TMP = read(PC); + TMP = read_pc(); PC++; if(!(TMP2 & (1 << ((inst_state >> 4) & 7)))) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -197,14 +197,14 @@ bbr_zpb prefetch(); bbs_zpb - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); - TMP = read(PC); + TMP = read_pc(); PC++; if(TMP2 & (1 << ((inst_state >> 4) & 7))) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -213,9 +213,9 @@ bbs_zpb prefetch(); bit_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -226,7 +226,7 @@ bit_abx prefetch(); bit_imm - TMP = read(PC); + TMP = read_pc(); PC++; if(A & TMP) P &= ~F_Z; @@ -235,7 +235,7 @@ bit_imm prefetch(); bit_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -243,9 +243,9 @@ bit_zpx prefetch(); bra_rel - TMP = read(PC); + TMP = read_pc(); PC++; - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -254,9 +254,9 @@ bra_rel brk_c_imp if(irq_taken || nmi_pending) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write(SP, PC >> 8); @@ -282,7 +282,7 @@ brk_c_imp inst_state = -1; cmp_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -291,15 +291,15 @@ cmp_zpi prefetch(); dec_acc - read(PC); + read_pc(); A--; set_nz(A); prefetch(); dec_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -309,9 +309,9 @@ dec_c_aba prefetch(); dec_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -323,7 +323,7 @@ dec_c_abx prefetch(); dec_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -333,7 +333,7 @@ dec_c_zpg prefetch(); dec_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -345,7 +345,7 @@ dec_c_zpx prefetch(); eor_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -355,15 +355,15 @@ eor_zpi prefetch(); inc_acc - read(PC); + read_pc(); A++; set_nz(A); prefetch(); inc_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -373,9 +373,9 @@ inc_c_aba prefetch(); inc_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -387,7 +387,7 @@ inc_c_abx prefetch(); inc_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -397,7 +397,7 @@ inc_c_zpg prefetch(); inc_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -409,9 +409,9 @@ inc_c_zpx prefetch(); jmp_iax - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -420,9 +420,9 @@ jmp_iax prefetch(); jmp_c_ind - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read(TMP); read(set_l(TMP, TMP+1)); @@ -430,7 +430,7 @@ jmp_c_ind prefetch(); lda_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -439,9 +439,9 @@ lda_zpi prefetch(); lsr_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -450,9 +450,9 @@ lsr_c_aba prefetch(); lsr_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -463,7 +463,7 @@ lsr_c_abx prefetch(); lsr_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -472,7 +472,7 @@ lsr_c_zpg prefetch(); lsr_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -486,27 +486,27 @@ nop_c_imp prefetch(); nop_c_aba - read(PC); + read_pc(); PC++; - read(PC); + read_pc(); PC++; - read(PC); - read(PC); - read(PC); - read(PC); - read(PC); + read_pc(); + read_pc(); + read_pc(); + read_pc(); + read_pc(); prefetch(); nop_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); prefetch(); ora_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -516,19 +516,19 @@ ora_zpi prefetch(); phx_imp - read(PC); + read_pc(); write(SP, X); dec_SP(); prefetch(); phy_imp - read(PC); + read_pc(); write(SP, Y); dec_SP(); prefetch(); plx_imp - read(PC); + read_pc(); read(SP); inc_SP(); X = read(SP); @@ -536,7 +536,7 @@ plx_imp prefetch(); ply_imp - read(PC); + read_pc(); read(SP); inc_SP(); Y = read(SP); @@ -544,7 +544,7 @@ ply_imp prefetch(); rmb_bzp - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -553,9 +553,9 @@ rmb_bzp prefetch(); rol_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -564,9 +564,9 @@ rol_c_aba prefetch(); rol_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -577,7 +577,7 @@ rol_c_abx prefetch(); rol_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -586,7 +586,7 @@ rol_c_zpg prefetch(); rol_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -597,9 +597,9 @@ rol_c_zpx prefetch(); ror_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -608,9 +608,9 @@ ror_c_aba prefetch(); ror_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -621,7 +621,7 @@ ror_c_abx prefetch(); ror_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -630,7 +630,7 @@ ror_c_zpg prefetch(); ror_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -641,22 +641,22 @@ ror_c_zpx prefetch(); sbc_c_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -665,15 +665,15 @@ sbc_c_abx TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -682,13 +682,13 @@ sbc_c_aby TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -697,13 +697,13 @@ sbc_c_idx TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -713,59 +713,59 @@ sbc_c_idy TMP2 = read(TMP+Y); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_sbc(TMP); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sbc_c_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); smb_bzp - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -774,7 +774,7 @@ smb_bzp prefetch(); sta_zpi - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -787,39 +787,39 @@ stp_imp } stz_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP, 0x00); prefetch(); stz_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); write(TMP+X, 0x00); prefetch(); stz_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(TMP, 0x00); prefetch(); stz_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); write(uint8_t(TMP+X), 0x00); prefetch(); trb_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -832,7 +832,7 @@ trb_aba prefetch(); trb_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -845,9 +845,9 @@ trb_zpg prefetch(); tsb_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -860,7 +860,7 @@ tsb_aba prefetch(); tsb_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read(TMP); @@ -873,8 +873,8 @@ tsb_zpg prefetch(); wai_imp - read(PC); - read(PC); + read_pc(); + read_pc(); while(!nmi_pending && !irq_state) { eat-all-cycles; } @@ -883,7 +883,7 @@ wai_imp # exceptions reset_c read_arg(0xffff); - read(PC); + read_pc(); read(SP); dec_SP(); read(SP); diff --git a/src/devices/cpu/m6502/om65ce02.lst b/src/devices/cpu/m6502/om65ce02.lst index 528b3264b65..6c005b321f4 100644 --- a/src/devices/cpu/m6502/om65ce02.lst +++ b/src/devices/cpu/m6502/om65ce02.lst @@ -3,9 +3,9 @@ # 65ce02 opcodes, a lot only remove dummy read/write cycles, some are new, some use the B register adc_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_adc(TMP2); @@ -14,9 +14,9 @@ adc_ce_aba prefetch(); adc_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -26,9 +26,9 @@ adc_ce_abx prefetch(); adc_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += Y; TMP2 = read(TMP); @@ -38,7 +38,7 @@ adc_ce_aby prefetch(); adc_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -51,7 +51,7 @@ adc_ce_idx prefetch(); adc_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -63,7 +63,7 @@ adc_ce_idy prefetch(); adc_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -75,7 +75,7 @@ adc_idz prefetch(); adc_ce_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_adc(TMP); if(P & F_D) @@ -83,7 +83,7 @@ adc_ce_imm prefetch(); adc_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); do_adc(TMP2); @@ -92,7 +92,7 @@ adc_ce_zpg prefetch(); adc_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|uint8_t(TMP+X)); do_adc(TMP2); @@ -101,9 +101,9 @@ adc_ce_zpx prefetch(); and_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -112,9 +112,9 @@ and_ce_abx prefetch(); and_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += Y; TMP2 = read(TMP); @@ -123,7 +123,7 @@ and_ce_aby prefetch(); and_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -135,7 +135,7 @@ and_ce_idx prefetch(); and_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -146,7 +146,7 @@ and_ce_idy prefetch(); and_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -157,7 +157,7 @@ and_idz prefetch(); and_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); A &= TMP2; @@ -165,7 +165,7 @@ and_ce_zpg prefetch(); and_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|uint8_t(TMP+X)); A &= TMP2; @@ -173,9 +173,9 @@ and_ce_zpx prefetch(); asl_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP2 = do_asl(TMP2); @@ -183,9 +183,9 @@ asl_ce_aba prefetch(); asl_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -198,7 +198,7 @@ asl_ce_acc prefetch(); asl_ce_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); TMP2 = do_asl(TMP2); @@ -206,7 +206,7 @@ asl_ce_zpg prefetch(); asl_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); @@ -219,7 +219,7 @@ asr_acc prefetch(); asr_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); TMP2 = do_asr(TMP2); @@ -227,7 +227,7 @@ asr_zpg prefetch(); asr_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); @@ -236,9 +236,9 @@ asr_zpx prefetch(); asw_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP3 = read(TMP); TMP3 = set_h(TMP3, read(TMP+1)); @@ -255,20 +255,20 @@ asw_aba prefetch(); aug_iw3 - read(PC); + read_pc(); PC++; - read(PC); + read_pc(); PC++; - read(PC); + read_pc(); PC++; prefetch(); bbr_ce_zpb // Access pattern uncertain - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); - TMP = read(PC); + TMP = read_pc(); PC++; if(!(TMP2 & (1 << ((inst_state >> 4) & 7)))) PC += int8_t(TMP); @@ -276,67 +276,67 @@ bbr_ce_zpb bbs_ce_zpb // Access pattern uncertain - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); - TMP = read(PC); + TMP = read_pc(); PC++; if(TMP2 & (1 << ((inst_state >> 4) & 7))) PC += int8_t(TMP); prefetch(); bcc_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_C)) PC += int8_t(TMP); prefetch(); bcc_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(!(P & F_C)) PC += TMP-1; prefetch(); bcs_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_C) PC += int8_t(TMP); prefetch(); bcs_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(P & F_C) PC += TMP-1; prefetch(); beq_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_Z) PC += int8_t(TMP); prefetch(); beq_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(P & F_Z) PC += TMP-1; prefetch(); bit_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -344,91 +344,91 @@ bit_ce_abx prefetch(); bit_ce_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_bit(TMP); prefetch(); bit_ce_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); do_bit(TMP2); prefetch(); bit_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|uint8_t(TMP+X)); do_bit(TMP2); prefetch(); bmi_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_N) PC += int8_t(TMP); prefetch(); bmi_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(P & F_N) PC += TMP-1; prefetch(); bne_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_Z)) PC += int8_t(TMP); prefetch(); bne_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(!(P & F_Z)) PC += TMP-1; prefetch(); bpl_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_N)) PC += int8_t(TMP); prefetch(); bpl_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(!(P & F_N)) PC += TMP-1; prefetch(); bra_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; PC += int8_t(TMP); prefetch(); bra_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC += TMP; prefetch(); brk_ce_imp if(irq_taken) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write(SP, PC >> 8); @@ -451,44 +451,44 @@ brk_ce_imp inst_state = -1; bsr_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; write(SP, PC>>8); dec_SP_ce(); write(SP, PC); dec_SP_ce(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC += TMP-1; prefetch(); bvc_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(!(P & F_V)) PC += int8_t(TMP); prefetch(); bvc_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(!(P & F_V)) PC += TMP-1; prefetch(); bvs_ce_rel - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_V) PC += int8_t(TMP); prefetch(); bvs_rw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(P & F_V) PC += TMP-1; @@ -503,7 +503,7 @@ cld_ce_imp prefetch(); cle_imp - read(PC); + read_pc(); P &= ~F_E; logerror("CLE\n"); prefetch(); @@ -517,9 +517,9 @@ clv_ce_imp prefetch(); cmp_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -527,9 +527,9 @@ cmp_ce_abx prefetch(); cmp_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += Y; TMP2 = read(TMP); @@ -537,7 +537,7 @@ cmp_ce_aby prefetch(); cmp_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -548,7 +548,7 @@ cmp_ce_idx prefetch(); cmp_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -558,7 +558,7 @@ cmp_ce_idy prefetch(); cmp_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -568,14 +568,14 @@ cmp_idz prefetch(); cmp_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); do_cmp(A, TMP2); prefetch(); cmp_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(B|uint8_t(TMP+X)); @@ -583,45 +583,45 @@ cmp_ce_zpx prefetch(); cpx_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); do_cmp(X, TMP2); prefetch(); cpy_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); do_cmp(Y, TMP2); prefetch(); cpz_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_cmp(Z, TMP2); prefetch(); cpz_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_cmp(Z, TMP); prefetch(); cpz_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); do_cmp(Z, TMP2); prefetch(); dec_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP2--; @@ -630,9 +630,9 @@ dec_ce_aba prefetch(); dec_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -647,7 +647,7 @@ dec_ce_acc prefetch(); dec_ce_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); TMP2--; @@ -656,7 +656,7 @@ dec_ce_zpg prefetch(); dec_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); @@ -666,7 +666,7 @@ dec_ce_zpx prefetch(); dew_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -699,9 +699,9 @@ dez_imp prefetch(); eor_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -710,9 +710,9 @@ eor_ce_abx prefetch(); eor_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += Y; TMP2 = read(TMP); @@ -721,7 +721,7 @@ eor_ce_aby prefetch(); eor_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -733,7 +733,7 @@ eor_ce_idx prefetch(); eor_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -744,7 +744,7 @@ eor_ce_idy prefetch(); eor_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -755,7 +755,7 @@ eor_idz prefetch(); eor_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); A ^= TMP2; @@ -763,7 +763,7 @@ eor_ce_zpg prefetch(); eor_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|uint8_t(TMP+X)); A ^= TMP2; @@ -771,9 +771,9 @@ eor_ce_zpx prefetch(); inc_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP2++; @@ -782,9 +782,9 @@ inc_ce_aba prefetch(); inc_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -799,7 +799,7 @@ inc_ce_acc prefetch(); inc_ce_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); TMP2++; @@ -808,7 +808,7 @@ inc_ce_zpg prefetch(); inc_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); @@ -818,7 +818,7 @@ inc_ce_zpx prefetch(); inw_zpg - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -851,9 +851,9 @@ inz_imp prefetch(); jmp_ce_iax - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; PC = read(TMP); @@ -861,34 +861,34 @@ jmp_ce_iax prefetch(); jmp_ce_ind - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read(TMP); PC = set_h(PC, read(TMP+1)); prefetch(); jsr_ce_adr - TMP = read(PC); + TMP = read_pc(); PC++; write(SP, PC>>8); dec_SP_ce(); write(SP, PC); dec_SP_ce(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = TMP; prefetch(); jsr_iax - TMP = read(PC); + TMP = read_pc(); PC++; write(SP, PC>>8); dec_SP_ce(); write(SP, PC); dec_SP_ce(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read(TMP); PC = set_h(PC, read(TMP+1)); @@ -896,38 +896,38 @@ jsr_iax prefetch(); jsr_ind - TMP = read(PC); + TMP = read_pc(); PC++; write(SP, PC>>8); dec_SP_ce(); write(SP, PC); dec_SP_ce(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read(TMP); PC = set_h(PC, read(TMP+1)); prefetch(); lda_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; A = read(TMP + X); set_nz(A); prefetch(); lda_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; A = read(TMP + Y); set_nz(A); prefetch(); lda_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -938,7 +938,7 @@ lda_ce_idx prefetch(); lda_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -948,7 +948,7 @@ lda_ce_idy prefetch(); lda_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -958,8 +958,8 @@ lda_idz prefetch(); lda_isy - read(PC); - TMP = read(PC); + read_pc(); + TMP = read_pc(); PC++; if(P & F_E) TMP = set_l(SP, SP+TMP); @@ -973,46 +973,46 @@ lda_isy prefetch(); lda_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A = read(B|TMP); set_nz(A); prefetch(); lda_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; A = read(B|uint8_t(TMP+X)); set_nz(A); prefetch(); ldx_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; X = read(TMP + Y); set_nz(X); prefetch(); ldx_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; X = read(B|TMP); set_nz(X); prefetch(); ldx_ce_zpy - TMP = read(PC); + TMP = read_pc(); PC++; X = read(B|uint8_t(TMP+Y)); set_nz(X); prefetch(); ldy_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; Y = read(TMP); @@ -1020,47 +1020,47 @@ ldy_ce_abx prefetch(); ldy_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; Y = read(B|TMP); set_nz(Y); prefetch(); ldy_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; Y = read(B|uint8_t(TMP+X)); set_nz(Y); prefetch(); ldz_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; Z = read(TMP); set_nz(Z); prefetch(); ldz_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; Z = read(TMP + X); set_nz(Z); prefetch(); ldz_imm - Z = read(PC); + Z = read_pc(); PC++; set_nz(Z); prefetch(); lsr_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP2 = do_lsr(TMP2); @@ -1068,9 +1068,9 @@ lsr_ce_aba prefetch(); lsr_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -1084,7 +1084,7 @@ lsr_ce_acc prefetch(); lsr_ce_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); TMP2 = do_lsr(TMP2); @@ -1092,7 +1092,7 @@ lsr_ce_zpg prefetch(); lsr_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); @@ -1101,15 +1101,15 @@ lsr_ce_zpx prefetch(); neg_acc - read(PC); + read_pc(); A = -A; set_nz(A); prefetch(); ora_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -1118,9 +1118,9 @@ ora_ce_abx prefetch(); ora_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += Y; TMP2 = read(TMP); @@ -1129,7 +1129,7 @@ ora_ce_aby prefetch(); ora_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -1141,7 +1141,7 @@ ora_ce_idx prefetch(); ora_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -1152,7 +1152,7 @@ ora_ce_idy prefetch(); ora_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -1163,7 +1163,7 @@ ora_idz prefetch(); ora_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); A |= TMP2; @@ -1171,7 +1171,7 @@ ora_ce_zpg prefetch(); ora_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|uint8_t(TMP+X)); A |= TMP2; @@ -1180,21 +1180,21 @@ ora_ce_zpx # push/pop instructions and rti/rtn/rts are not fully streamlined pha_ce_imp - read(PC); + read_pc(); write(SP, A); dec_SP_ce(); prefetch(); php_ce_imp - read(PC); + read_pc(); write(SP, P); dec_SP_ce(); prefetch(); phw_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP3 = read(TMP); TMP3 = set_h(TMP3, read(TMP+1)); @@ -1205,9 +1205,9 @@ phw_aba prefetch(); phw_iw2 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; dec_SP_ce(); write(SP, TMP); @@ -1216,60 +1216,60 @@ phw_iw2 prefetch(); phx_ce_imp - read(PC); + read_pc(); write(SP, X); dec_SP_ce(); prefetch(); phy_ce_imp - read(PC); + read_pc(); write(SP, Y); dec_SP_ce(); prefetch(); phz_imp - read(PC); + read_pc(); write(SP, Z); dec_SP_ce(); prefetch(); pla_ce_imp - read(PC); + read_pc(); inc_SP_ce(); A = read(SP); set_nz(A); prefetch(); plp_ce_imp - read(PC); + read_pc(); inc_SP_ce(); TMP = read(SP) | F_B; prefetch(); P = TMP; // Do *not* move it before the prefetch plx_ce_imp - read(PC); + read_pc(); inc_SP_ce(); X = read(SP); set_nz(X); prefetch(); ply_ce_imp - read(PC); + read_pc(); inc_SP_ce(); Y = read(SP); set_nz(Y); prefetch(); plz_imp - read(PC); + read_pc(); inc_SP_ce(); Z = read(SP); set_nz(Z); prefetch(); rmb_ce_bzp - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP2 &= ~(1 << ((inst_state >> 4) & 7)); @@ -1277,9 +1277,9 @@ rmb_ce_bzp prefetch(); rol_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP2 = do_rol(TMP2); @@ -1287,9 +1287,9 @@ rol_ce_aba prefetch(); rol_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -1302,7 +1302,7 @@ rol_ce_acc prefetch(); rol_ce_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); TMP2 = do_rol(TMP2); @@ -1310,7 +1310,7 @@ rol_ce_zpg prefetch(); rol_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); @@ -1319,9 +1319,9 @@ rol_ce_zpx prefetch(); ror_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP2 = do_ror(TMP2); @@ -1329,9 +1329,9 @@ ror_ce_aba prefetch(); ror_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -1344,7 +1344,7 @@ ror_ce_acc prefetch(); ror_ce_zpg - TMP = B|read(PC); + TMP = B|read_pc(); PC++; TMP2 = read(TMP); TMP2 = do_ror(TMP2); @@ -1352,7 +1352,7 @@ ror_ce_zpg prefetch(); ror_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); @@ -1361,9 +1361,9 @@ ror_ce_zpx prefetch(); row_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP3 = read(TMP); TMP3 = set_h(TMP3, read(TMP+1)); @@ -1383,7 +1383,7 @@ row_aba prefetch(); rti_ce_imp - read(PC); + read_pc(); inc_SP_ce(); P = read(SP) | F_B; inc_SP_ce(); @@ -1393,19 +1393,19 @@ rti_ce_imp prefetch(); rtn_imm - TMP = read(PC); + TMP = read_pc(); PC++; if(P & F_E) SP = set_l(SP, SP+TMP); else SP += TMP; - read(PC); + read_pc(); read(SP); inc_SP(); PC = read(SP); inc_SP(); PC = set_h(PC, read(SP)); - read(PC); + read_pc(); PC++; prefetch(); @@ -1414,14 +1414,14 @@ rts_ce_imp PC = read(SP); inc_SP_ce(); PC = set_h(PC, read(SP)); - read(PC); + read_pc(); PC++; prefetch(); sbc_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_sbc(TMP2); @@ -1430,9 +1430,9 @@ sbc_ce_aba prefetch(); sbc_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += X; TMP2 = read(TMP); @@ -1442,9 +1442,9 @@ sbc_ce_abx prefetch(); sbc_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP += Y; TMP2 = read(TMP); @@ -1454,7 +1454,7 @@ sbc_ce_aby prefetch(); sbc_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -1467,7 +1467,7 @@ sbc_ce_idx prefetch(); sbc_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -1479,7 +1479,7 @@ sbc_ce_idy prefetch(); sbc_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -1491,7 +1491,7 @@ sbc_idz prefetch(); sbc_ce_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_sbc(TMP); if(P & F_D) @@ -1499,7 +1499,7 @@ sbc_ce_imm prefetch(); sbc_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(B|TMP); do_sbc(TMP2); @@ -1508,7 +1508,7 @@ sbc_ce_zpg prefetch(); sbc_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(B|uint8_t(TMP+X)); @@ -1526,7 +1526,7 @@ sed_ce_imp prefetch(); see_imp - read(PC); + read_pc(); P |= F_E; prefetch(); @@ -1535,7 +1535,7 @@ sei_ce_imp P |= F_I; // Do *not* move it before the prefetch smb_ce_bzp - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP2 |= 1 << ((inst_state >> 4) & 7); @@ -1543,23 +1543,23 @@ smb_ce_bzp prefetch(); sta_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP+X, A); prefetch(); sta_ce_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP+Y, A); prefetch(); sta_ce_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP2 += X; TMP = read(B|TMP2); @@ -1569,7 +1569,7 @@ sta_ce_idx prefetch(); sta_ce_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -1578,7 +1578,7 @@ sta_ce_idy prefetch(); sta_idz - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(B|TMP2); TMP2++; @@ -1587,8 +1587,8 @@ sta_idz prefetch(); sta_isy - read(PC); - TMP = read(PC); + read_pc(); + TMP = read_pc(); PC++; if(P & F_E) TMP = set_l(SP, SP+TMP); @@ -1601,81 +1601,81 @@ sta_isy prefetch(); sta_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(B|TMP, A); prefetch(); sta_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; write(B|uint8_t(TMP+X), A); prefetch(); stx_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP+Y, X); prefetch(); stx_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(B|TMP, X); prefetch(); stx_ce_zpy - TMP = read(PC); + TMP = read_pc(); PC++; write(B|uint8_t(TMP+Y), X); prefetch(); sty_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP+X, Y); prefetch(); sty_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(B|TMP, Y); prefetch(); sty_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; write(B|uint8_t(TMP+X), Y); prefetch(); stz_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP, A); prefetch(); stz_ce_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP+X, A); prefetch(); stz_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write(B|TMP, Z); prefetch(); stz_ce_zpx - TMP = read(PC); + TMP = read_pc(); PC++; write(B|uint8_t(TMP+X), Z); prefetch(); @@ -1705,9 +1705,9 @@ tba_imp prefetch(); trb_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); if(A & TMP2) @@ -1719,7 +1719,7 @@ trb_ce_aba prefetch(); trb_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); if(A & TMP2) @@ -1731,9 +1731,9 @@ trb_ce_zpg prefetch(); tsb_ce_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); if(A & TMP2) @@ -1745,7 +1745,7 @@ tsb_ce_aba prefetch(); tsb_ce_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); if(A & TMP2) diff --git a/src/devices/cpu/m6502/om740.lst b/src/devices/cpu/m6502/om740.lst index e784fc8021c..e37506ae164 100644 --- a/src/devices/cpu/m6502/om740.lst +++ b/src/devices/cpu/m6502/om740.lst @@ -2,39 +2,39 @@ # copyright-holders:Olivier Galibert # m740 opcodes set_imp - read(PC); + read_pc(); P |= F_T; inst_state_base = 0x100; prefetch(); clt_imp - read(PC); + read_pc(); P &= ~F_T; inst_state_base = 0; prefetch(); ldm_imz - TMP = read(PC); + TMP = read_pc(); PC++; - TMP2 = read(PC); + TMP2 = read_pc(); PC++; write(TMP2, TMP); prefetch(); dec_acc - read(PC); + read_pc(); A--; set_nz(A); prefetch(); inc_acc - read(PC); + read_pc(); A++; set_nz(A); prefetch(); jsr_spg - TMP = read(PC); + TMP = read_pc(); read_dummy(SP); write(SP, PC>>8); dec_SP(); @@ -45,17 +45,17 @@ jsr_spg prefetch(); clb_bac - read(PC); + read_pc(); A = do_clb(A, (IR>>5) & 7); prefetch(); seb_bac - read(PC); + read_pc(); A = do_seb(A, (IR>>5) & 7); prefetch(); clb_biz - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -64,7 +64,7 @@ clb_biz prefetch(); seb_biz - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -73,71 +73,71 @@ seb_biz prefetch(); bbc_bzr - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); - read(PC); + read_pc(); if(!(TMP2 & (1 << ((IR>>5) & 7)))) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bbs_bzr - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); - read(PC); + read_pc(); if(TMP2 & (1 << ((IR>>5) & 7))) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bbc_bar - read(PC); - read(PC); + read_pc(); + read_pc(); if(!(A & (1 << ((IR>>5) & 7)))) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bbs_bar - read(PC); - read(PC); + read_pc(); + read_pc(); if(A & (1 << ((IR>>5) & 7))) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); com_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -147,7 +147,7 @@ com_zpg prefetch(); rrf_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -159,14 +159,14 @@ rrf_zpg prefetch(); tst_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); set_nz(TMP2); prefetch(); bra_rel - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); @@ -174,14 +174,14 @@ bra_rel prefetch(); jmp_zpi - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); PC = TMP; prefetch(); jsr_zpi - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(SP); write(SP, PC>>8); dec_SP(); @@ -193,7 +193,7 @@ jsr_zpi prefetch(); stp_imp - read(PC); + read_pc(); logerror("STP at $%04x\n", PC); while(!irq_state) { eat-all-cycles; @@ -201,7 +201,7 @@ stp_imp prefetch(); wit_imp - read(PC); + read_pc(); logerror("WIT at $%04x\n", PC); while(!irq_state) { eat-all-cycles; @@ -223,9 +223,9 @@ reset_m brk_m_imp if(irq_taken) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write(SP, PC >> 8); @@ -247,9 +247,9 @@ brk_m_imp # 6502 opcodes with modified access patterns adc_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -258,9 +258,9 @@ adc_m_abx prefetch(); adc_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -269,7 +269,7 @@ adc_m_aby prefetch(); adc_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -280,7 +280,7 @@ adc_m_idx prefetch(); adc_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -290,7 +290,7 @@ adc_m_idy prefetch(); adc_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -298,9 +298,9 @@ adc_m_zpx prefetch(); and_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -310,9 +310,9 @@ and_m_abx prefetch(); and_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -322,7 +322,7 @@ and_m_aby prefetch(); and_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -334,7 +334,7 @@ and_m_idx prefetch(); and_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -345,7 +345,7 @@ and_m_idy prefetch(); and_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -354,9 +354,9 @@ and_m_zpx prefetch(); asl_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -365,9 +365,9 @@ asl_m_aba prefetch(); asl_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -378,7 +378,7 @@ asl_m_abx prefetch(); asl_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -387,7 +387,7 @@ asl_m_zpg prefetch(); asl_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP = uint8_t(TMP+X); @@ -399,112 +399,112 @@ asl_m_zpx bcc_m_rel if(!(P & F_C)) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bcs_m_rel if(P & F_C) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); beq_m_rel if(P & F_Z) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bmi_m_rel if(P & F_N) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bne_m_rel if(!(P & F_Z)) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bpl_m_rel if(!(P & F_N)) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bvc_m_rel if(!(P & F_V)) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); bvs_m_rel if(P & F_V) { - TMP = read(PC); + TMP = read_pc(); read_dummy(set_l(PC, PC+1)); PC++; read_dummy(set_l(PC, PC+int8_t(TMP))); PC += int8_t(TMP); } else { - read(PC); + read_pc(); PC++; } prefetch(); cmp_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -513,9 +513,9 @@ cmp_m_abx prefetch(); cmp_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -524,7 +524,7 @@ cmp_m_aby prefetch(); cmp_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -535,7 +535,7 @@ cmp_m_idx prefetch(); cmp_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -545,7 +545,7 @@ cmp_m_idy prefetch(); cmp_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -553,9 +553,9 @@ cmp_m_zpx prefetch(); dec_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -565,9 +565,9 @@ dec_m_aba prefetch(); dec_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -579,7 +579,7 @@ dec_m_abx prefetch(); dec_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -589,7 +589,7 @@ dec_m_zpg prefetch(); dec_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP = uint8_t(TMP+X); @@ -601,9 +601,9 @@ dec_m_zpx prefetch(); eor_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -613,9 +613,9 @@ eor_m_abx prefetch(); eor_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -625,7 +625,7 @@ eor_m_aby prefetch(); eor_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -637,7 +637,7 @@ eor_m_idx prefetch(); eor_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -648,7 +648,7 @@ eor_m_idy prefetch(); eor_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -657,9 +657,9 @@ eor_m_zpx prefetch(); inc_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -669,9 +669,9 @@ inc_m_aba prefetch(); inc_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -683,7 +683,7 @@ inc_m_abx prefetch(); inc_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -693,7 +693,7 @@ inc_m_zpg prefetch(); inc_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP = uint8_t(TMP+X); @@ -706,31 +706,31 @@ inc_m_zpx jmp_m_ind // JMP ($XXFF) has the same bug as on the NMOS 6502 - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read_data(TMP); PC = set_h(PC, read_data(set_l(TMP, TMP+1))); prefetch(); jsr_m_adr - TMP = read(PC); + TMP = read_pc(); PC++; read_dummy(SP); write(SP, PC>>8); dec_SP(); write(SP, PC); dec_SP(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = TMP; prefetch(); lda_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); A = read(TMP + X); @@ -738,9 +738,9 @@ lda_m_abx prefetch(); lda_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); A = read(TMP + Y); @@ -748,7 +748,7 @@ lda_m_aby prefetch(); lda_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -759,7 +759,7 @@ lda_m_idx prefetch(); lda_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -769,7 +769,7 @@ lda_m_idy prefetch(); lda_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; A = read(uint8_t(TMP+X)); @@ -777,9 +777,9 @@ lda_m_zpx prefetch(); ldx_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); X = read(TMP + Y); @@ -787,7 +787,7 @@ ldx_m_aby prefetch(); ldx_m_zpy - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; X = read(uint8_t(TMP+Y)); @@ -795,9 +795,9 @@ ldx_m_zpy prefetch(); ldy_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -806,7 +806,7 @@ ldy_m_abx prefetch(); ldy_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; Y = read(uint8_t(TMP+X)); @@ -814,9 +814,9 @@ ldy_m_zpx prefetch(); lsr_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -825,9 +825,9 @@ lsr_m_aba prefetch(); lsr_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -838,7 +838,7 @@ lsr_m_abx prefetch(); lsr_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -847,7 +847,7 @@ lsr_m_zpg prefetch(); lsr_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP = uint8_t(TMP+X); @@ -858,9 +858,9 @@ lsr_m_zpx prefetch(); ora_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -870,9 +870,9 @@ ora_m_abx prefetch(); ora_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -882,7 +882,7 @@ ora_m_aby prefetch(); ora_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -894,7 +894,7 @@ ora_m_idx prefetch(); ora_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -905,7 +905,7 @@ ora_m_idy prefetch(); ora_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -914,7 +914,7 @@ ora_m_zpx prefetch(); pla_m_imp - read(PC); + read_pc(); read_dummy(SP); inc_SP(); A = read(SP); @@ -922,7 +922,7 @@ pla_m_imp prefetch(); plp_m_imp - read(PC); + read_pc(); read_dummy(SP); inc_SP(); TMP = read(SP) | (F_B); @@ -931,9 +931,9 @@ plp_m_imp P = TMP; // Do *not* move it before the prefetch rol_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -942,9 +942,9 @@ rol_m_aba prefetch(); rol_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -955,7 +955,7 @@ rol_m_abx prefetch(); rol_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -964,7 +964,7 @@ rol_m_zpg prefetch(); rol_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP = uint8_t(TMP+X); @@ -975,9 +975,9 @@ rol_m_zpx prefetch(); ror_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -986,9 +986,9 @@ ror_m_aba prefetch(); ror_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -999,7 +999,7 @@ ror_m_abx prefetch(); ror_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(TMP); @@ -1008,7 +1008,7 @@ ror_m_zpg prefetch(); ror_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP = uint8_t(TMP+X); @@ -1019,7 +1019,7 @@ ror_m_zpx prefetch(); rti_m_imp - read(PC); + read_pc(); read_dummy(SP); inc_SP(); P = read(SP) | (F_B); @@ -1031,7 +1031,7 @@ rti_m_imp prefetch(); rts_m_imp - read(PC); + read_pc(); read_dummy(SP); inc_SP(); PC = read(SP); @@ -1042,9 +1042,9 @@ rts_m_imp prefetch(); sbc_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1053,9 +1053,9 @@ sbc_m_abx prefetch(); sbc_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1064,7 +1064,7 @@ sbc_m_aby prefetch(); sbc_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1075,7 +1075,7 @@ sbc_m_idx prefetch(); sbc_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1085,7 +1085,7 @@ sbc_m_idy prefetch(); sbc_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -1093,18 +1093,18 @@ sbc_m_zpx prefetch(); sta_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(TMP); write(TMP, A); prefetch(); sta_m_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); read_dummy(TMP+X); @@ -1112,9 +1112,9 @@ sta_m_abx prefetch(); sta_m_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); read_dummy(TMP+Y); @@ -1122,7 +1122,7 @@ sta_m_aby prefetch(); sta_m_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1133,7 +1133,7 @@ sta_m_idx prefetch(); sta_m_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1143,14 +1143,14 @@ sta_m_idy prefetch(); sta_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; read_dummy(TMP); write(TMP, A); prefetch(); sta_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; read_dummy(uint8_t(TMP+X)); @@ -1158,23 +1158,23 @@ sta_m_zpx prefetch(); stx_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(TMP); write(TMP, X); prefetch(); stx_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; read_dummy(TMP); write(TMP, X); prefetch(); stx_m_zpy - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; read_dummy(uint8_t(TMP+Y)); @@ -1182,23 +1182,23 @@ stx_m_zpy prefetch(); sty_m_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(TMP); write(TMP, Y); prefetch(); sty_m_zpg - TMP = read(PC); + TMP = read_pc(); PC++; read_dummy(TMP); write(TMP, Y); prefetch(); sty_m_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; read_dummy(uint8_t(TMP+X)); @@ -1208,9 +1208,9 @@ sty_m_zpx # T=1 opcodes adct_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1220,9 +1220,9 @@ adct_aba prefetch(); adct_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1234,9 +1234,9 @@ adct_abx prefetch(); adct_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1248,7 +1248,7 @@ adct_aby prefetch(); adct_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1262,7 +1262,7 @@ adct_idx prefetch(); adct_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1275,7 +1275,7 @@ adct_idy prefetch(); adct_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(X); read_dummy(X); @@ -1284,7 +1284,7 @@ adct_imm prefetch(); adct_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1294,7 +1294,7 @@ adct_zpg prefetch(); adct_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -1305,9 +1305,9 @@ adct_zpx prefetch(); andt_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1318,9 +1318,9 @@ andt_aba prefetch(); andt_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1333,9 +1333,9 @@ andt_abx prefetch(); andt_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1348,7 +1348,7 @@ andt_aby prefetch(); andt_imm - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(X); read_dummy(X); @@ -1358,7 +1358,7 @@ andt_imm prefetch(); andt_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1373,7 +1373,7 @@ andt_idx prefetch(); andt_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1387,7 +1387,7 @@ andt_idy prefetch(); andt_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1398,7 +1398,7 @@ andt_zpg prefetch(); andt_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -1410,9 +1410,9 @@ andt_zpx prefetch(); cmpt_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1420,9 +1420,9 @@ cmpt_aba prefetch(); cmpt_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1432,9 +1432,9 @@ cmpt_abx prefetch(); cmpt_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1444,7 +1444,7 @@ cmpt_aby prefetch(); cmpt_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1456,7 +1456,7 @@ cmpt_idx prefetch(); cmpt_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1467,14 +1467,14 @@ cmpt_idy prefetch(); cmpt_imm - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(X); do_cmp(TMP2, TMP); prefetch(); cmpt_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1482,7 +1482,7 @@ cmpt_zpg prefetch(); cmpt_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -1491,9 +1491,9 @@ cmpt_zpx prefetch(); eort_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1504,9 +1504,9 @@ eort_aba prefetch(); eort_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1519,9 +1519,9 @@ eort_abx prefetch(); eort_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1534,7 +1534,7 @@ eort_aby prefetch(); eort_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1549,7 +1549,7 @@ eort_idx prefetch(); eort_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1563,7 +1563,7 @@ eort_idy prefetch(); eort_imm - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(X); read_dummy(X); @@ -1573,7 +1573,7 @@ eort_imm prefetch(); eort_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1584,7 +1584,7 @@ eort_zpg prefetch(); eort_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -1596,9 +1596,9 @@ eort_zpx prefetch(); ldt_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read_dummy(X); @@ -1607,9 +1607,9 @@ ldt_aba prefetch(); ldt_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1620,9 +1620,9 @@ ldt_abx prefetch(); ldt_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1633,7 +1633,7 @@ ldt_aby prefetch(); ldt_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1646,7 +1646,7 @@ ldt_idx prefetch(); ldt_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1658,7 +1658,7 @@ ldt_idy prefetch(); ldt_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_dummy(X); set_nz(TMP2); @@ -1666,7 +1666,7 @@ ldt_imm prefetch(); ldt_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read_dummy(X); @@ -1675,7 +1675,7 @@ ldt_zpg prefetch(); ldt_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -1685,9 +1685,9 @@ ldt_zpx prefetch(); ort_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1698,9 +1698,9 @@ ort_aba prefetch(); ort_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1713,9 +1713,9 @@ ort_abx prefetch(); ort_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1728,7 +1728,7 @@ ort_aby prefetch(); ort_imm - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(X); read_dummy(X); @@ -1738,7 +1738,7 @@ ort_imm prefetch(); ort_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1753,7 +1753,7 @@ ort_idx prefetch(); ort_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1767,7 +1767,7 @@ ort_idy prefetch(); ort_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1778,7 +1778,7 @@ ort_zpg prefetch(); ort_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); @@ -1790,9 +1790,9 @@ ort_zpx prefetch(); sbct_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1802,9 +1802,9 @@ sbct_aba prefetch(); sbct_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+X)); TMP += X; @@ -1816,9 +1816,9 @@ sbct_abx prefetch(); sbct_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read_dummy(set_l(TMP, TMP+Y)); TMP += Y; @@ -1830,7 +1830,7 @@ sbct_aby prefetch(); sbct_idx - TMP2 = read(PC); + TMP2 = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 += X; @@ -1844,7 +1844,7 @@ sbct_idx prefetch(); sbct_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -1857,7 +1857,7 @@ sbct_idy prefetch(); sbct_imm - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(X); read_dummy(X); @@ -1866,7 +1866,7 @@ sbct_imm prefetch(); sbct_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); TMP = read(X); @@ -1876,7 +1876,7 @@ sbct_zpg prefetch(); sbct_zpx - TMP = read(PC); + TMP = read_pc(); read_dummy(PC & 0xff); PC++; TMP2 = read(uint8_t(TMP+X)); diff --git a/src/devices/cpu/m6502/or65c19.lst b/src/devices/cpu/m6502/or65c19.lst index 0fc712aff36..36568280df8 100644 --- a/src/devices/cpu/m6502/or65c19.lst +++ b/src/devices/cpu/m6502/or65c19.lst @@ -1,7 +1,7 @@ # license:BSD-3-Clause # copyright-holders:Olivier Galibert, AJR adc_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -11,46 +11,46 @@ adc_ipx TMP2 = read(TMP+X); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); add_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_add(TMP); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); add_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_add(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); add_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); do_add(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); and_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -63,24 +63,24 @@ and_ipx prefetch(); asr_acc - read(PC); + read_pc(); A = do_asr(A); prefetch(); bar_amr - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP2 = ~TMP2 & TMP; - TMP = read(PC); + TMP = read_pc(); PC++; if(TMP2 != 0) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -89,19 +89,19 @@ bar_amr prefetch(); bas_amr - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP2 &= TMP; - TMP = read(PC); + TMP = read_pc(); PC++; if(TMP2 != 0) { - read(PC); + read_pc(); if(page_changing(PC, int8_t(TMP))) { read_arg(set_l(PC, PC+int8_t(TMP))); } @@ -111,9 +111,9 @@ bas_amr brk_r_imp if(irq_taken || nmi_pending) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write(SP, PC >> 8); @@ -140,13 +140,13 @@ brk_r_imp inst_state = -1; clw_imp - read(PC); + read_pc(); P &= ~F_V; m_w = 0; prefetch(); cmp_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -158,7 +158,7 @@ cmp_ipx prefetch(); eor_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -171,7 +171,7 @@ eor_ipx prefetch(); exc_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -181,7 +181,7 @@ exc_zpx prefetch(); ini_imp - read(PC); + read_pc(); read(m_i); m_i++; prefetch(); @@ -196,7 +196,7 @@ jpi_ind prefetch(); jsb_vec - read(PC); + read_pc(); write(SP, PC>>8); dec_SP(); write(SP, PC); @@ -207,18 +207,18 @@ jsb_vec prefetch(); jmp_r_ind - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read(TMP); PC = set_h(PC, read(TMP+1)); prefetch(); jsr_r_adr - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(SP, PC>>8); dec_SP(); @@ -228,26 +228,26 @@ jsr_r_adr prefetch(); lab_acc - read(PC); - read(PC); + read_pc(); + read_pc(); if(int8_t(A) < 0) A = -A; set_nz(A); prefetch(); lai_imp - read(PC); + read_pc(); A = read(m_i); prefetch(); lan_imp - read(PC); + read_pc(); A = read(m_i); m_i++; prefetch(); lda_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -259,7 +259,7 @@ lda_ipx prefetch(); lii_imp - read(PC); + read_pc(); TMP = read(m_i); TMP = set_h(TMP, read(m_i+1)); read(TMP); @@ -267,40 +267,40 @@ lii_imp prefetch(); mpa_imp - read(PC); - read(PC); - read(PC); - read(PC); - read(PC); + read_pc(); + read_pc(); + read_pc(); + read_pc(); + read_pc(); TMP = int8_t(A) * int8_t(Y); m_w = do_accumulate(TMP, m_w); prefetch(); mpy_imp - read(PC); - read(PC); - read(PC); - read(PC); - read(PC); + read_pc(); + read_pc(); + read_pc(); + read_pc(); + read_pc(); TMP = int8_t(A) * int8_t(Y); A = do_accumulate(TMP, 0)>>8; prefetch(); neg_acc - read(PC); + read_pc(); A = -A; set_nz(A); prefetch(); nxt_imp - read(PC); + read_pc(); PC = read(m_i); PC = set_h(PC, read(m_i+1)); m_i += 2; prefetch(); ora_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -313,7 +313,7 @@ ora_ipx prefetch(); phi_imp - read(PC); + read_pc(); write(SP, m_i>>8); dec_SP(); write(SP, m_i); @@ -321,7 +321,7 @@ phi_imp prefetch(); phw_imp - read(PC); + read_pc(); write(SP, m_w>>8); dec_SP(); write(SP, m_w); @@ -329,7 +329,7 @@ phw_imp prefetch(); pia_imp - read(PC); + read_pc(); read(SP); inc_SP(); m_i = read(SP); @@ -340,7 +340,7 @@ pia_imp prefetch(); pli_imp - read(PC); + read_pc(); read(SP); inc_SP(); m_i = read(SP); @@ -350,7 +350,7 @@ pli_imp prefetch(); plw_imp - read(PC); + read_pc(); read(SP); inc_SP(); m_w = read(SP); @@ -359,7 +359,7 @@ plw_imp prefetch(); psh_imp - read(PC); + read_pc(); write(SP, A); dec_SP(); write(SP, X); @@ -369,7 +369,7 @@ psh_imp prefetch(); pul_imp - read(PC); + read_pc(); read(SP); inc_SP(); Y = read(SP); @@ -380,11 +380,11 @@ pul_imp prefetch(); rba_ima - A = read(PC); // "Note that Accumulator contents are altered by RBA and SBA" (C29/C39 Technical Reference Manual, p. C-29) + A = read_pc(); // "Note that Accumulator contents are altered by RBA and SBA" (C29/C39 Technical Reference Manual, p. C-29) PC++; - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -393,14 +393,14 @@ rba_ima prefetch(); rnd_imp - read(PC); + read_pc(); TMP = set_l(m_w, Y); A = do_accumulate(TMP, (m_w<<1) & 0x100)>>8; prefetch(); rts_r_imp - read(PC); - read(PC); + read_pc(); + read_pc(); inc_SP(); PC = read(SP); inc_SP(); @@ -408,11 +408,11 @@ rts_r_imp prefetch(); sba_ima - A = read(PC); + A = read_pc(); PC++; - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); read(TMP); @@ -421,7 +421,7 @@ sba_ima prefetch(); sbc_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -431,13 +431,13 @@ sbc_ipx TMP2 = read(TMP+X); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } prefetch(); sta_ipx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -446,35 +446,35 @@ sta_ipx prefetch(); sti_imz - TMP = read(PC); + TMP = read_pc(); PC++; - TMP2 = read(PC); + TMP2 = read_pc(); PC++; write(TMP2, TMP); prefetch(); taw_imp - read(PC); + read_pc(); m_w = A<<8; set_nz(m_w>>8); prefetch(); tip_imp - read(PC); + read_pc(); PC = m_i; prefetch(); twa_imp - read(PC); + read_pc(); A = m_w>>8; set_nz(A); prefetch(); # exceptions reset_r - read(PC); + read_pc(); PC++; - read(PC); + read_pc(); read(SP); dec_SP(); read(SP); diff --git a/src/devices/cpu/m6502/orp2a03.lst b/src/devices/cpu/m6502/orp2a03.lst index bd03f515b76..44f453a1c4e 100644 --- a/src/devices/cpu/m6502/orp2a03.lst +++ b/src/devices/cpu/m6502/orp2a03.lst @@ -2,18 +2,18 @@ # copyright-holders:Olivier Galibert # rp2a03 opcodes - same as 6502 but with d disabled adc_nd_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_adc_nd(TMP2); prefetch(); adc_nd_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -24,9 +24,9 @@ adc_nd_abx prefetch(); adc_nd_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -37,7 +37,7 @@ adc_nd_aby prefetch(); adc_nd_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -48,7 +48,7 @@ adc_nd_idx prefetch(); adc_nd_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -60,20 +60,20 @@ adc_nd_idy prefetch(); adc_nd_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_adc_nd(TMP); prefetch(); adc_nd_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_adc_nd(TMP2); prefetch(); adc_nd_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -81,16 +81,16 @@ adc_nd_zpx prefetch(); arr_nd_imm - TMP = read(PC); + TMP = read_pc(); A &= TMP; PC++; do_arr_nd(); prefetch(); rra_nd_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -100,9 +100,9 @@ rra_nd_aba prefetch(); rra_nd_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -114,9 +114,9 @@ rra_nd_abx prefetch(); rra_nd_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -128,7 +128,7 @@ rra_nd_aby prefetch(); rra_nd_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -142,7 +142,7 @@ rra_nd_idx prefetch(); rra_nd_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -156,7 +156,7 @@ rra_nd_idy prefetch(); rra_nd_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -166,7 +166,7 @@ rra_nd_zpg prefetch(); rra_nd_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); @@ -178,18 +178,18 @@ rra_nd_zpx prefetch(); sbc_nd_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); do_sbc_nd(TMP2); prefetch(); sbc_nd_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, X)) { read(set_l(TMP, TMP+X)); @@ -200,9 +200,9 @@ sbc_nd_abx prefetch(); sbc_nd_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); @@ -213,7 +213,7 @@ sbc_nd_aby prefetch(); sbc_nd_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -224,7 +224,7 @@ sbc_nd_idx prefetch(); sbc_nd_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -236,20 +236,20 @@ sbc_nd_idy prefetch(); sbc_nd_imm - TMP = read(PC); + TMP = read_pc(); PC++; do_sbc_nd(TMP); prefetch(); sbc_nd_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); do_sbc_nd(TMP2); prefetch(); sbc_nd_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP2 = read(uint8_t(TMP+X)); @@ -257,9 +257,9 @@ sbc_nd_zpx prefetch(); isb_nd_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -269,9 +269,9 @@ isb_nd_aba prefetch(); isb_nd_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+X)); TMP += X; @@ -283,9 +283,9 @@ isb_nd_abx prefetch(); isb_nd_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; read(set_l(TMP, TMP+Y)); TMP += Y; @@ -297,7 +297,7 @@ isb_nd_aby prefetch(); isb_nd_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read(TMP2); TMP2 += X; @@ -311,7 +311,7 @@ isb_nd_idx prefetch(); isb_nd_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); @@ -325,7 +325,7 @@ isb_nd_idy prefetch(); isb_nd_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -335,7 +335,7 @@ isb_nd_zpg prefetch(); isb_nd_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read(TMP); TMP = uint8_t(TMP+X); diff --git a/src/devices/cpu/m6502/ow65c02s.lst b/src/devices/cpu/m6502/ow65c02s.lst index f9843c59844..5e6f5a346cb 100644 --- a/src/devices/cpu/m6502/ow65c02s.lst +++ b/src/devices/cpu/m6502/ow65c02s.lst @@ -3,88 +3,88 @@ # w65c02s opcodes adc_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); adc_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP += Y; TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); adc_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); TMP2 += X; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); TMP2 = read(TMP); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); adc_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP2 = read(TMP+Y); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); adc_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); TMP2 = read(uint8_t(TMP+X)); do_adc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); and_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -94,11 +94,11 @@ and_s_abx prefetch(); and_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP += Y; TMP2 = read(TMP); @@ -108,8 +108,8 @@ and_s_aby prefetch(); and_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); PC++; TMP2 += X; TMP = read(TMP2 & 0xff); @@ -120,11 +120,11 @@ and_s_idx prefetch(); and_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP2 = read(TMP+Y); A &= TMP2; @@ -133,8 +133,8 @@ and_s_idy prefetch(); and_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP2 = read(uint8_t(TMP+X)); A &= TMP2; @@ -142,11 +142,11 @@ and_s_zpx prefetch(); asl_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -157,7 +157,7 @@ asl_s_abx prefetch(); asl_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -166,8 +166,8 @@ asl_s_zpg prefetch(); asl_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP = uint8_t(TMP+X); TMP2 = read(TMP); @@ -177,11 +177,11 @@ asl_s_zpx prefetch(); bit_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -190,8 +190,8 @@ bit_s_abx prefetch(); bit_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP2 = read(uint8_t(TMP+X)); do_bit(TMP2); @@ -199,9 +199,9 @@ bit_s_zpx brk_s_imp if(irq_taken || nmi_pending) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write(SP, PC >> 8); @@ -227,11 +227,11 @@ brk_s_imp inst_state = -1; cmp_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -240,11 +240,11 @@ cmp_s_abx prefetch(); cmp_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP += Y; TMP2 = read(TMP); @@ -253,8 +253,8 @@ cmp_s_aby prefetch(); cmp_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); PC++; TMP2 += X; TMP = read(TMP2 & 0xff); @@ -264,11 +264,11 @@ cmp_s_idx prefetch(); cmp_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP2 = read(TMP+Y); do_cmp(A, TMP2); @@ -276,19 +276,19 @@ cmp_s_idy prefetch(); cmp_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP = read(uint8_t(TMP+X)); do_cmp(A, TMP); prefetch(); dec_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -300,7 +300,7 @@ dec_s_abx prefetch(); dec_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -310,8 +310,8 @@ dec_s_zpg prefetch(); dec_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP = uint8_t(TMP+X); TMP2 = read(TMP); @@ -322,11 +322,11 @@ dec_s_zpx prefetch(); eor_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -336,11 +336,11 @@ eor_s_abx prefetch(); eor_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP += Y; TMP2 = read(TMP); @@ -350,8 +350,8 @@ eor_s_aby prefetch(); eor_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); PC++; TMP2 += X; TMP = read(TMP2 & 0xff); @@ -362,11 +362,11 @@ eor_s_idx prefetch(); eor_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP2 = read(TMP+Y); A ^= TMP2; @@ -375,8 +375,8 @@ eor_s_idy prefetch(); eor_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP2 = read(uint8_t(TMP+X)); A ^= TMP2; @@ -384,11 +384,11 @@ eor_s_zpx prefetch(); inc_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -400,7 +400,7 @@ inc_s_abx prefetch(); inc_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -410,8 +410,8 @@ inc_s_zpg prefetch(); inc_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP = uint8_t(TMP+X); TMP2 = read(TMP); @@ -422,30 +422,30 @@ inc_s_zpx prefetch(); jmp_s_iax - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); - read(PC); + TMP = set_h(TMP, read_pc()); + read_pc(); TMP += X; PC = read(TMP); PC = set_h(PC, read(TMP+1)); prefetch(); jmp_s_ind - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); - read(PC); + TMP = set_h(TMP, read_pc()); + read_pc(); PC = read(TMP); PC = set_h(PC, read(TMP+1)); prefetch(); lda_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } A = read(TMP + X); set_nz(A); @@ -453,11 +453,11 @@ lda_s_abx prefetch(); lda_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } A = read(TMP + Y); set_nz(A); @@ -465,8 +465,8 @@ lda_s_aby prefetch(); lda_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); PC++; TMP2 += X; TMP = read(TMP2 & 0xff); @@ -476,11 +476,11 @@ lda_s_idx prefetch(); lda_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } A = read(TMP+Y); set_nz(A); @@ -488,19 +488,19 @@ lda_s_idy prefetch(); lda_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; A = read(uint8_t(TMP+X)); set_nz(A); prefetch(); ldx_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } X = read(TMP + Y); set_nz(X); @@ -508,19 +508,19 @@ ldx_s_aby prefetch(); ldx_s_zpy - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; X = read(uint8_t(TMP+Y)); set_nz(X); prefetch(); ldy_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; Y = read(TMP); @@ -529,19 +529,19 @@ ldy_s_abx prefetch(); ldy_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; Y = read(uint8_t(TMP+X)); set_nz(Y); prefetch(); lsr_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -552,7 +552,7 @@ lsr_s_abx prefetch(); lsr_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -561,8 +561,8 @@ lsr_s_zpg prefetch(); lsr_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP = uint8_t(TMP+X); TMP2 = read(TMP); @@ -572,26 +572,26 @@ lsr_s_zpx prefetch(); nop_s_abx - read(PC); + read_pc(); PC++; - read(PC); - read(PC); + read_pc(); + read_pc(); PC++; prefetch(); nop_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; read(uint8_t(TMP+X)); prefetch(); ora_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -601,11 +601,11 @@ ora_s_abx prefetch(); ora_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP += Y; TMP2 = read(TMP); @@ -615,8 +615,8 @@ ora_s_aby prefetch(); ora_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); PC++; TMP2 += X; TMP = read(TMP2 & 0xff); @@ -627,11 +627,11 @@ ora_s_idx prefetch(); ora_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP2 = read(TMP+Y); A |= TMP2; @@ -640,8 +640,8 @@ ora_s_idy prefetch(); ora_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP2 = read(uint8_t(TMP+X)); A |= TMP2; @@ -649,43 +649,43 @@ ora_s_zpx prefetch(); pla_s_imp - read(PC); - read(PC); + read_pc(); + read_pc(); inc_SP(); A = read(SP); set_nz(A); prefetch(); plp_s_imp - read(PC); - read(PC); + read_pc(); + read_pc(); inc_SP(); TMP = read(SP) | (F_B|F_E); prefetch(); P = TMP; // Do *not* move it before the prefetch plx_s_imp - read(PC); - read(PC); + read_pc(); + read_pc(); inc_SP(); X = read(SP); set_nz(X); prefetch(); ply_s_imp - read(PC); - read(PC); + read_pc(); + read_pc(); inc_SP(); Y = read(SP); set_nz(Y); prefetch(); rol_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -696,7 +696,7 @@ rol_s_abx prefetch(); rol_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -705,8 +705,8 @@ rol_s_zpg prefetch(); rol_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP = uint8_t(TMP+X); TMP2 = read(TMP); @@ -716,11 +716,11 @@ rol_s_zpx prefetch(); ror_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); @@ -731,7 +731,7 @@ ror_s_abx prefetch(); ror_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -740,8 +740,8 @@ ror_s_zpg prefetch(); ror_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; TMP = uint8_t(TMP+X); TMP2 = read(TMP); @@ -751,127 +751,127 @@ ror_s_zpx prefetch(); rti_s_imp - read(PC); + read_pc(); inc_SP(); P = read(SP) | (F_B|F_E); inc_SP(); TMP = read(SP); inc_SP(); TMP = set_h(TMP, read(SP)); - read(PC); + read_pc(); end_interrupt(); PC = TMP; prefetch(); rts_s_imp - read(PC); - read(PC); + read_pc(); + read_pc(); inc_SP(); TMP = read(SP); inc_SP(); TMP = set_h(TMP, read(SP)); - read(PC); + read_pc(); PC = TMP + 1; prefetch(); sbc_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, X)) { - read(PC); + read_pc(); } TMP += X; TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); sbc_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP += Y; TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); sbc_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); TMP2 += X; TMP = read(TMP2 & 0xff); TMP = set_h(TMP, read((TMP2+1) & 0xff)); TMP2 = read(TMP); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); sbc_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { - read(PC); + read_pc(); } TMP2 = read(TMP+Y); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); sbc_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); TMP2 = read(uint8_t(TMP+X)); do_sbc(TMP2); if(P & F_D) { - read(PC); + read_pc(); set_nz(A); } PC++; prefetch(); sta_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); - read(PC); + TMP = set_h(TMP, read_pc()); + read_pc(); PC++; write(TMP+X, A); prefetch(); sta_s_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); - read(PC); + TMP = set_h(TMP, read_pc()); + read_pc(); PC++; write(TMP+Y, A); prefetch(); sta_s_idx - TMP2 = read(PC); - read(PC); + TMP2 = read_pc(); + read_pc(); PC++; TMP2 += X; TMP = read(TMP2 & 0xff); @@ -880,53 +880,53 @@ sta_s_idx prefetch(); sta_s_idy - TMP2 = read(PC); + TMP2 = read_pc(); TMP = read(TMP2); TMP = set_h(TMP, read((TMP2+1) & 0xff)); - read(PC); + read_pc(); PC++; write(TMP+Y, A); prefetch(); sta_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; write(uint8_t(TMP+X), A); prefetch(); stx_s_zpy - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; write(uint8_t(TMP+Y), X); prefetch(); sty_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; write(uint8_t(TMP+X), Y); prefetch(); stz_s_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); - read(PC); + TMP = set_h(TMP, read_pc()); + read_pc(); PC++; write(TMP+X, 0x00); prefetch(); stz_s_zpx - TMP = read(PC); - read(PC); + TMP = read_pc(); + read_pc(); PC++; write(uint8_t(TMP+X), 0x00); prefetch(); trb_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -939,7 +939,7 @@ trb_s_zpg prefetch(); tsb_s_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read(TMP); read((TMP+1) & 0xff); @@ -954,7 +954,7 @@ tsb_s_zpg # exceptions reset_s read_arg(0xffff); - read(PC); + read_pc(); read(SP); dec_SP(); read(SP); diff --git a/src/devices/cpu/m6502/oxavix.lst b/src/devices/cpu/m6502/oxavix.lst index a633395ee70..9d3c0dcfe95 100644 --- a/src/devices/cpu/m6502/oxavix.lst +++ b/src/devices/cpu/m6502/oxavix.lst @@ -6,34 +6,34 @@ callf_xa3 read_stack(SP); write_special_stack(get_codebank()); dec_special_stack(); - TMP2 = read(PC); + TMP2 = read_pc(); PC++; - TMP = read(PC); + TMP = read_pc(); PC++; //read_stack(SP); write_stack(SP, PC>>8); dec_SP(); write_stack(SP, PC); dec_SP(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = TMP; set_codebank(TMP2); prefetch(); jmp_xa3 - TMP2 = read(PC); + TMP2 = read_pc(); PC++; - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = TMP; set_codebank(TMP2); prefetch(); retf_imp - read(PC); + read_pc(); read_stack(SP); inc_SP(); PC = read_stack(SP); @@ -42,7 +42,7 @@ retf_imp inc_special_stack(); TMP2 = read_special_stack(); set_codebank(TMP2); - read(PC); + read_pc(); PC++; prefetch(); @@ -50,9 +50,9 @@ brk_xav_imp // there is code in some games to indicate this doesn't always push the far bank to the stack.. // The 6502 bug when a nmi occurs in a brk is reproduced (case !irq_taken && nmi_pending) if(irq_taken) { - read(PC); + read_pc(); } else { - read(PC); + read_pc(); PC++; } write_special_stack(get_codebank()); @@ -114,7 +114,7 @@ brk_xav_imp inst_state = -1; rti_xav_imp - read(PC); + read_pc(); read_stack(SP); inc_SP(); P = read_stack(SP) | (F_B|F_E); @@ -131,32 +131,32 @@ rti_xav_imp # opcodes below are modified to access stack through different handlers pha_xav_imp - read(PC); + read_pc(); write_stack(SP, A); dec_SP(); prefetch(); php_xav_imp - read(PC); + read_pc(); write_stack(SP, P); dec_SP(); prefetch(); jsr_xav_adr - TMP = read(PC); + TMP = read_pc(); PC++; read_stack(SP); write_stack(SP, PC>>8); dec_SP(); write_stack(SP, PC); dec_SP(); - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = TMP; prefetch(); pla_xav_imp - read(PC); + read_pc(); read_stack(SP); inc_SP(); A = read_stack(SP); @@ -164,7 +164,7 @@ pla_xav_imp prefetch(); plp_xav_imp - read(PC); + read_pc(); read_stack(SP); inc_SP(); TMP = read_stack(SP) | (F_B|F_E); @@ -172,13 +172,13 @@ plp_xav_imp P = TMP; // Do *not* move it before the prefetch rts_xav_imp - read(PC); + read_pc(); read_stack(SP); inc_SP(); PC = read_stack(SP); inc_SP(); PC = set_h(PC, read_stack(SP)); - read(PC); + read_pc(); PC++; prefetch(); @@ -186,7 +186,7 @@ rts_xav_imp lda_xav_idy - TMP2 = read(PC); // we need to fetch the zero page part from zero page, but the rest as if zero page wasn't there, similar to the 6509 + TMP2 = read_pc(); // we need to fetch the zero page part from zero page, but the rest as if zero page wasn't there, similar to the 6509 PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -198,7 +198,7 @@ lda_xav_idy prefetch(); adc_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -210,7 +210,7 @@ adc_xav_idy prefetch(); cmp_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -222,7 +222,7 @@ cmp_xav_idy prefetch(); sbc_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -234,7 +234,7 @@ sbc_xav_idy prefetch(); eor_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -247,7 +247,7 @@ eor_xav_idy prefetch(); and_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -260,7 +260,7 @@ and_xav_idy prefetch(); ora_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -273,7 +273,7 @@ ora_xav_idy prefetch(); ora_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -285,7 +285,7 @@ ora_xav_idx prefetch(); and_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -297,7 +297,7 @@ and_xav_idx prefetch(); eor_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -309,7 +309,7 @@ eor_xav_idx prefetch(); adc_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -320,7 +320,7 @@ adc_xav_idx prefetch(); lda_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -331,7 +331,7 @@ lda_xav_idx prefetch(); cmp_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -342,7 +342,7 @@ cmp_xav_idx prefetch(); sbc_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -353,7 +353,7 @@ sbc_xav_idx prefetch(); sta_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -362,7 +362,7 @@ sta_xav_idy prefetch(); sta_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -372,21 +372,21 @@ sta_xav_idx prefetch(); adc_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); do_adc(TMP2); prefetch(); and_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A &= read_zeropage(TMP); set_nz(A); prefetch(); asl_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -395,34 +395,34 @@ asl_xav_zpg prefetch(); bit_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; do_bit(read_zeropage(TMP)); prefetch(); cmp_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); do_cmp(A, TMP2); prefetch(); cpx_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); do_cmp(X, TMP2); prefetch(); cpy_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); do_cmp(Y, TMP2); prefetch(); dec_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -432,14 +432,14 @@ dec_xav_zpg prefetch(); eor_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A ^= read_zeropage(TMP); set_nz(A); prefetch(); inc_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -449,28 +449,28 @@ inc_xav_zpg prefetch(); lda_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A = read_zeropage(TMP); set_nz(A); prefetch(); ldx_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; X = read_zeropage(TMP); set_nz(X); prefetch(); ldy_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; Y = read_zeropage(TMP); set_nz(Y); prefetch(); lsr_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -479,14 +479,14 @@ lsr_xav_zpg prefetch(); ora_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A |= read_zeropage(TMP); set_nz(A); prefetch(); rol_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -495,7 +495,7 @@ rol_xav_zpg prefetch(); ror_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -504,32 +504,32 @@ ror_xav_zpg prefetch(); sbc_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); do_sbc(TMP2); prefetch(); sta_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write_zeropage(TMP, A); prefetch(); stx_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write_zeropage(TMP, X); prefetch(); sty_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write_zeropage(TMP, Y); prefetch(); dcp_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -539,7 +539,7 @@ dcp_xav_zpg prefetch(); isb_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -549,14 +549,14 @@ isb_xav_zpg prefetch(); lax_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; A = X = read_zeropage(TMP); set_nz(A); prefetch(); rla_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -567,7 +567,7 @@ rla_xav_zpg prefetch(); rra_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -577,14 +577,14 @@ rra_xav_zpg prefetch(); sax_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = A & X; write_zeropage(TMP, TMP2); prefetch(); slo_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -595,7 +595,7 @@ slo_xav_zpg prefetch(); sre_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; TMP2 = read_zeropage(TMP); write_zeropage(TMP, TMP2); // dummy write @@ -606,7 +606,7 @@ sre_xav_zpg prefetch(); nop_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read prefetch(); @@ -614,7 +614,7 @@ nop_xav_zpg # more zero page changes ldx_xav_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read X = read_zeropage(uint8_t(TMP+Y)); @@ -622,14 +622,14 @@ ldx_xav_zpy prefetch(); stx_xav_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read write_zeropage(uint8_t(TMP+Y), X); prefetch(); lax_xav_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+Y); @@ -638,7 +638,7 @@ lax_xav_zpy prefetch(); sax_xav_zpy - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+Y); @@ -649,7 +649,7 @@ sax_xav_zpy # more zero page changes adc_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP2 = read_zeropage(uint8_t(TMP+X)); @@ -657,7 +657,7 @@ adc_xav_zpx prefetch(); and_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read A &= read_zeropage(uint8_t(TMP+X)); @@ -665,7 +665,7 @@ and_xav_zpx prefetch(); asl_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -676,7 +676,7 @@ asl_xav_zpx prefetch(); cmp_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP2 = read_zeropage(uint8_t(TMP+X)); @@ -684,7 +684,7 @@ cmp_xav_zpx prefetch(); dec_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -696,7 +696,7 @@ dec_xav_zpx prefetch(); eor_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read A ^= read_zeropage(uint8_t(TMP+X)); @@ -704,7 +704,7 @@ eor_xav_zpx prefetch(); inc_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -716,7 +716,7 @@ inc_xav_zpx prefetch(); lda_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read A = read_zeropage(uint8_t(TMP+X)); @@ -724,7 +724,7 @@ lda_xav_zpx prefetch(); ldy_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read Y = read_zeropage(uint8_t(TMP+X)); @@ -732,7 +732,7 @@ ldy_xav_zpx prefetch(); lsr_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -743,7 +743,7 @@ lsr_xav_zpx prefetch(); ora_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read A |= read_zeropage(uint8_t(TMP+X)); @@ -751,7 +751,7 @@ ora_xav_zpx prefetch(); rol_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -762,7 +762,7 @@ rol_xav_zpx prefetch(); ror_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -773,7 +773,7 @@ ror_xav_zpx prefetch(); sbc_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP2 = read_zeropage(uint8_t(TMP+X)); @@ -781,21 +781,21 @@ sbc_xav_zpx prefetch(); sta_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read write_zeropage(uint8_t(TMP+X), A); prefetch(); sty_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read write_zeropage(uint8_t(TMP+X), Y); prefetch(); dcp_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -807,7 +807,7 @@ dcp_xav_zpx prefetch(); isb_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -819,7 +819,7 @@ isb_xav_zpx prefetch(); rla_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -832,7 +832,7 @@ rla_xav_zpx prefetch(); rra_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -844,7 +844,7 @@ rra_xav_zpx prefetch(); slo_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -857,7 +857,7 @@ slo_xav_zpx prefetch(); sre_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); // dummy read TMP = uint8_t(TMP+X); @@ -870,7 +870,7 @@ sre_xav_zpx prefetch(); nop_xav_zpx - TMP = read(PC); + TMP = read_pc(); PC++; read_zeropage(TMP); read_zeropage(uint8_t(TMP+X)); @@ -879,7 +879,7 @@ nop_xav_zpx #### slo_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -896,7 +896,7 @@ slo_xav_idx # idx with zero page changes rla_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -911,7 +911,7 @@ rla_xav_idx prefetch(); sre_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -926,7 +926,7 @@ sre_xav_idx prefetch(); rra_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -940,7 +940,7 @@ rra_xav_idx prefetch(); sax_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -951,7 +951,7 @@ sax_xav_idx prefetch(); lax_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dumm read TMP2 += X; @@ -962,7 +962,7 @@ lax_xav_idx prefetch(); dcp_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -976,7 +976,7 @@ dcp_xav_idx prefetch(); isb_xav_idx - TMP2 = read(PC); + TMP2 = read_pc(); PC++; read_zeropage(TMP2); // dummy read TMP2 += X; @@ -992,7 +992,7 @@ isb_xav_idx # idy with zero page changes slo_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -1007,7 +1007,7 @@ slo_xav_idy prefetch(); rla_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -1022,7 +1022,7 @@ rla_xav_idy prefetch(); sre_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -1037,7 +1037,7 @@ sre_xav_idy prefetch(); rra_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -1051,7 +1051,7 @@ rra_xav_idy prefetch(); sha_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -1065,7 +1065,7 @@ sha_xav_idy prefetch(); lax_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -1077,7 +1077,7 @@ lax_xav_idy prefetch(); dcp_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); @@ -1091,7 +1091,7 @@ dcp_xav_idy prefetch(); isb_xav_idy - TMP2 = read(PC); + TMP2 = read_pc(); PC++; TMP = read_zeropage(TMP2); TMP = set_h(TMP, read_zeropage((TMP2+1) & 0xff)); diff --git a/src/devices/cpu/m6502/oxavix2000.lst b/src/devices/cpu/m6502/oxavix2000.lst index 7795a1a75cc..536a1414bcf 100644 --- a/src/devices/cpu/m6502/oxavix2000.lst +++ b/src/devices/cpu/m6502/oxavix2000.lst @@ -3,19 +3,19 @@ # xavix2000 opcodes (Super XaviX) phy_imp - read(PC); + read_pc(); write_stack(SP, Y); dec_SP(); prefetch(); phx_imp - read(PC); + read_pc(); write_stack(SP, X); dec_SP(); prefetch(); plx_imp - read(PC); + read_pc(); read_stack(SP); inc_SP(); X = read_stack(SP); @@ -23,7 +23,7 @@ plx_imp prefetch(); ply_imp - read(PC); + read_pc(); read_stack(SP); inc_SP(); Y = read_stack(SP); @@ -31,314 +31,314 @@ ply_imp prefetch(); clr_acc - read(PC); + read_pc(); A = 0; set_nz(A); prefetch(); dec_acc - read(PC); + read_pc(); A--; set_nz(A); prefetch(); not_acc - read(PC); + read_pc(); A = A ^ 0xff; set_nz(A); prefetch(); inc_acc - read(PC); + read_pc(); A++; set_nz(A); prefetch(); neg_acc - read(PC); + read_pc(); A = (0x00 - A) & 0xff; set_nz(A); prefetch(); oraj_imp - read(PC); + read_pc(); A |= m_j; set_nz(A); prefetch(); orak_imp - read(PC); + read_pc(); A |= m_k; set_nz(A); prefetch(); oral_imp - read(PC); + read_pc(); A |= m_l; set_nz(A); prefetch(); oram_imp - read(PC); + read_pc(); A |= m_m; set_nz(A); prefetch(); andj_imp - read(PC); + read_pc(); A &= m_j; set_nz(A); prefetch(); andk_imp - read(PC); + read_pc(); A &= m_k; set_nz(A); prefetch(); andl_imp - read(PC); + read_pc(); A &= m_l; set_nz(A); prefetch(); andm_imp - read(PC); + read_pc(); A &= m_m; set_nz(A); prefetch(); eorj_imp - read(PC); + read_pc(); A ^= m_j; set_nz(A); prefetch(); eork_imp - read(PC); + read_pc(); A ^= m_k; set_nz(A); prefetch(); eorl_imp - read(PC); + read_pc(); A ^= m_l; set_nz(A); prefetch(); eorm_imp - read(PC); + read_pc(); A ^= m_m; set_nz(A); prefetch(); adcj_imp - read(PC); + read_pc(); do_adc(m_j); prefetch(); adck_imp - read(PC); + read_pc(); do_adc(m_k); prefetch(); adcl_imp - read(PC); + read_pc(); do_adc(m_l); prefetch(); adcm_imp - read(PC); + read_pc(); do_adc(m_m); prefetch(); staj_imp - read(PC); + read_pc(); m_j = A; prefetch(); stak_imp - read(PC); + read_pc(); m_k = A; prefetch(); stal_imp - read(PC); + read_pc(); m_l = A; prefetch(); stam_imp - read(PC); + read_pc(); m_m = A; prefetch(); ldaj_imp - read(PC); + read_pc(); A = m_j; set_nz(A); prefetch(); ldak_imp - read(PC); + read_pc(); A = m_k; set_nz(A); prefetch(); ldal_imp - read(PC); + read_pc(); A = m_l; set_nz(A); prefetch(); ldam_imp - read(PC); + read_pc(); A = m_m; set_nz(A); prefetch(); cmpj_imp - read(PC); + read_pc(); do_cmp(A, m_j); prefetch(); cmpk_imp - read(PC); + read_pc(); do_cmp(A, m_k); prefetch(); cmpl_imp - read(PC); + read_pc(); do_cmp(A, m_l); prefetch(); cmpm_imp - read(PC); + read_pc(); do_cmp(A, m_m); prefetch(); sbcj_imp - read(PC); + read_pc(); do_sbc(m_j); prefetch(); sbck_imp - read(PC); + read_pc(); do_sbc(m_k); prefetch(); sbcl_imp - read(PC); + read_pc(); do_sbc(m_l); prefetch(); sbcm_imp - read(PC); + read_pc(); do_sbc(m_m); prefetch(); spa0_imp - read(PC); + read_pc(); m_pa = (m_pa & 0xffff00) | A; prefetch(); lpa0_imp - read(PC); + read_pc(); A = (m_pa & 0x0000ff) >> 0; set_nz(A); prefetch(); spa1_imp - read(PC); + read_pc(); m_pa = (m_pa & 0xff00ff) | (A << 8); prefetch(); lpa1_imp - read(PC); + read_pc(); A = (m_pa & 0x00ff00) >> 8; set_nz(A); prefetch(); spa2_imp - read(PC); + read_pc(); m_pa = (m_pa & 0x00ffff) | (A << 16); prefetch(); lpa2_imp - read(PC); + read_pc(); A = (m_pa & 0xff0000) >> 16; set_nz(A); prefetch(); spb0_imp - read(PC); + read_pc(); m_pb = (m_pb & 0xffff00) | A; prefetch(); lpb0_imp - read(PC); + read_pc(); A = (m_pb & 0x0000ff) >> 0; set_nz(A); prefetch(); spb1_imp - read(PC); + read_pc(); m_pb = (m_pb & 0xff00ff) | (A << 8); prefetch(); lpb1_imp - read(PC); + read_pc(); A = (m_pb & 0x00ff00) >> 8; set_nz(A); prefetch(); spb2_imp - read(PC); + read_pc(); m_pb = (m_pb & 0x00ffff) | (A << 16); prefetch(); lpb2_imp - read(PC); + read_pc(); A = (m_pb & 0xff0000) >> 16; set_nz(A); prefetch(); incpa_imp - read(PC); + read_pc(); m_pa = (m_pa & ~0xff) | ((m_pa+1) & 0xff); set_nz(m_pa&0xff); // startup code seems to require flag to set if low byte is 0x00? prefetch(); incpb_imp - read(PC); + read_pc(); m_pb = (m_pb & ~0xff) | ((m_pb+1) & 0xff); set_nz(m_pb&0xff); // startup code seems to require flag to set if low byte is 0x00? prefetch(); decpa_imp - read(PC); + read_pc(); m_pa = (m_pa & ~0xff) | ((m_pa-1) & 0xff); set_nz(m_pa&0xff); // startup code seems to require flag to set if low byte is 0x00? prefetch(); decpb_imp - read(PC); + read_pc(); m_pb = (m_pb & ~0xff) | ((m_pb-1) & 0xff); set_nz(m_pb&0xff); // startup code seems to require flag to set if low byte is 0x00? prefetch(); orapa_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); andpa_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); eorpa_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); adcpa_imp @@ -365,17 +365,17 @@ sbcpa_imp orapb_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); andpb_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); eorpb_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); adcpb_imp @@ -393,7 +393,7 @@ ldapb_imp cmppb_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); sbcpb_imp @@ -401,47 +401,47 @@ sbcpb_imp prefetch(); stx_aby - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP+Y, X); prefetch(); sty_abx - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP+X, Y); prefetch(); stz_xav_zpg - TMP = read(PC); + TMP = read_pc(); PC++; write_zeropage(TMP, 0x00); prefetch(); stz_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; write(TMP, 0x00); prefetch(); bit_xav_zpx fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); bit_abx fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); bit_imm - TMP = read(PC); + TMP = read_pc(); PC++; if(A & TMP) P &= ~F_Z; @@ -450,16 +450,16 @@ bit_imm prefetch(); asr_xav_zpg - TMP = read(PC); // TODO: verify this, should it write back or set A? + TMP = read_pc(); // TODO: verify this, should it write back or set A? PC++; TMP2 = read_zeropage(TMP); do_asr(TMP2); prefetch(); asr_aba - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; TMP2 = read(TMP); write(TMP, TMP2); @@ -469,7 +469,7 @@ asr_aba asr_xav_zpx fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); asr_acc @@ -478,23 +478,23 @@ asr_acc asr_abx fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); cmc_imp fatalerror("unhandled opcode %02x%04x: %02x\n", m_codebank, PPC, inst_state); - read(PC); + read_pc(); prefetch(); sev_imp - read(PC); + read_pc(); P |= F_V; prefetch(); jmpf_ind - TMP = read(PC); + TMP = read_pc(); PC++; - TMP = set_h(TMP, read(PC)); + TMP = set_h(TMP, read_pc()); PC++; PC = read(TMP); PC = set_h(PC, read(set_l(TMP, TMP+1))); -- cgit v1.2.3