From b4e05fafe2da9c93c11ce7c130d21bedcba68d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Fri, 5 Apr 2013 13:48:14 +0000 Subject: [PATCH] (indirect),y zeropage should wrap so, ff,00 instead of ff,100 --- src/emu/cpu/m6502/om6502.lst | 32 ++++++++++++++++---------------- src/emu/cpu/m6502/om6509.lst | 4 ++-- src/emu/cpu/m6502/om65c02.lst | 4 ++-- src/emu/cpu/m6502/om740.lst | 14 +++++++------- src/emu/cpu/m6502/on2a03.lst | 8 ++++---- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/emu/cpu/m6502/om6502.lst b/src/emu/cpu/m6502/om6502.lst index b8143a5279f..56c37475771 100644 --- a/src/emu/cpu/m6502/om6502.lst +++ b/src/emu/cpu/m6502/om6502.lst @@ -43,7 +43,7 @@ adc_idx adc_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -115,7 +115,7 @@ and_idx and_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -368,7 +368,7 @@ cmp_idx cmp_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -525,7 +525,7 @@ eor_idx eor_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -669,7 +669,7 @@ lda_idx lda_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -860,7 +860,7 @@ ora_idx ora_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -1057,7 +1057,7 @@ sbc_idx sbc_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -1129,7 +1129,7 @@ sta_idx sta_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); write(TMP+Y, A); prefetch(); @@ -1273,7 +1273,7 @@ dcp_idx dcp_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP); @@ -1353,7 +1353,7 @@ isb_idx isb_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP); @@ -1412,7 +1412,7 @@ lax_idx lax_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -1488,7 +1488,7 @@ rla_idx rla_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP); @@ -1571,7 +1571,7 @@ rra_idx rra_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP); @@ -1658,7 +1658,7 @@ sha_aby sha_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP2 = A & X & ((TMP >> 8)+1); if(page_changing(TMP, Y)) @@ -1759,7 +1759,7 @@ slo_idx slo_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP); @@ -1846,7 +1846,7 @@ sre_idx sre_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP); diff --git a/src/emu/cpu/m6502/om6509.lst b/src/emu/cpu/m6502/om6509.lst index f09d8f7d5f1..4595827b1d7 100644 --- a/src/emu/cpu/m6502/om6509.lst +++ b/src/emu/cpu/m6502/om6509.lst @@ -3,7 +3,7 @@ lda_9_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read_9(set_l(TMP, TMP+Y)); } @@ -14,7 +14,7 @@ lda_9_idy sta_9_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read_9(set_l(TMP, TMP+Y)); write_9(TMP+Y, A); prefetch(); diff --git a/src/emu/cpu/m6502/om65c02.lst b/src/emu/cpu/m6502/om65c02.lst index 700b529624e..21bc1d4e726 100644 --- a/src/emu/cpu/m6502/om65c02.lst +++ b/src/emu/cpu/m6502/om65c02.lst @@ -57,7 +57,7 @@ adc_c_idx adc_c_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -428,7 +428,7 @@ sbc_c_idx sbc_c_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } diff --git a/src/emu/cpu/m6502/om740.lst b/src/emu/cpu/m6502/om740.lst index ac2e8f66242..5082ffad591 100644 --- a/src/emu/cpu/m6502/om740.lst +++ b/src/emu/cpu/m6502/om740.lst @@ -197,7 +197,7 @@ adct_idx adct_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -287,7 +287,7 @@ andt_idx andt_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -367,7 +367,7 @@ cmpt_idx cmpt_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -460,7 +460,7 @@ eort_idx eort_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -552,7 +552,7 @@ ldt_idx ldt_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -639,7 +639,7 @@ ort_idx ort_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -715,7 +715,7 @@ sbct_idx sbct_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } diff --git a/src/emu/cpu/m6502/on2a03.lst b/src/emu/cpu/m6502/on2a03.lst index 51231819376..7d505cbf17c 100644 --- a/src/emu/cpu/m6502/on2a03.lst +++ b/src/emu/cpu/m6502/on2a03.lst @@ -40,7 +40,7 @@ adc_nd_idx adc_nd_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -120,7 +120,7 @@ rra_nd_idx rra_nd_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP); @@ -191,7 +191,7 @@ sbc_nd_idx sbc_nd_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); if(page_changing(TMP, Y)) { read(set_l(TMP, TMP+Y)); } @@ -266,7 +266,7 @@ isb_nd_idx isb_nd_idy TMP2 = read_pc(); TMP = read(TMP2); - TMP = set_h(TMP, read(TMP2+1)); + TMP = set_h(TMP, read((TMP2+1) & 0xff)); read(set_l(TMP, TMP+Y)); TMP += Y; TMP2 = read(TMP);