From c946eb3f69249e069184ccf0d7c389a26eeb5e55 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 23 Jan 2018 21:35:59 -0600 Subject: [PATCH] Fix incorrect stack info (The previous behavior of RTS/JSR was not right.) --- tests/mos6502.exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/mos6502.exec.c b/tests/mos6502.exec.c index bd3bb86..a88c0cc 100644 --- a/tests/mos6502.exec.c +++ b/tests/mos6502.exec.c @@ -36,7 +36,7 @@ Test(mos6502_exec, jsr) cr_assert_eq(cpu->PC, 235); - cr_assert_eq(mos6502_pop_stack(cpu), 126); + cr_assert_eq(mos6502_pop_stack(cpu), 125); } Test(mos6502_exec, nop) @@ -57,8 +57,8 @@ Test(mos6502_exec, rti) Test(mos6502_exec, rts) { - mos6502_push_stack(cpu, 333); + mos6502_push_stack(cpu, 233); mos6502_handle_rts(cpu, 0); - cr_assert_eq(cpu->PC, 333); + cr_assert_eq(cpu->PC, 234); }