From c09206e563b3aa68ffafda248aac062b35f6134e Mon Sep 17 00:00:00 2001 From: Fulgen301 Date: Sat, 17 Aug 2024 01:22:24 +0200 Subject: [PATCH] Fix stack-relative indirect indexed address calculation involving the direct page by mistake (#293) --- src/cpu/modes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/modes.h b/src/cpu/modes.h index 93cdd53..5a69945 100644 --- a/src/cpu/modes.h +++ b/src/cpu/modes.h @@ -182,7 +182,7 @@ static void sr() { // absolute,S static void sridy() { // (indirect,S),Y uint16_t eahelp, startpage; eahelp = regs.sp + (uint16_t)read6502(regs.pc++); - ea = (uint16_t)read6502(direct_page_add(eahelp)) | ((uint16_t)read6502(direct_page_add(eahelp + 1)) << 8); + ea = (uint16_t)read6502(eahelp) | ((uint16_t)read6502(eahelp + 1) << 8); startpage = ea & 0xFF00; ea += (uint16_t)regs.y;