1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-21 23:29:16 +00:00

Carry must also be factored in

This commit is contained in:
Peter Evans 2018-01-23 20:26:01 -06:00
parent 5656b271ee
commit 0b03fd24f5

View File

@ -74,8 +74,8 @@ Test(mos6502_bits, lsr)
cr_assert_eq(cpu->P & MOS_CARRY, MOS_CARRY); cr_assert_eq(cpu->P & MOS_CARRY, MOS_CARRY);
cpu->eff_addr = 123; cpu->eff_addr = 123;
mos6502_handle_lsr(cpu, 22); mos6502_handle_lsr(cpu, 11);
cr_assert_eq(mos6502_get(cpu, 123), 11); cr_assert_eq(mos6502_get(cpu, 123), 5);
cr_assert_eq(cpu->P & MOS_CARRY, MOS_CARRY); cr_assert_eq(cpu->P & MOS_CARRY, MOS_CARRY);
} }
@ -93,7 +93,7 @@ Test(mos6502_bits, ora)
Test(mos6502_bits, rol) Test(mos6502_bits, rol)
{ {
mos6502_handle_rol(cpu, 8); mos6502_handle_rol(cpu, 8);
cr_assert_eq(cpu->A, 16); cr_assert_eq(cpu->A, 17);
cpu->eff_addr = 234; cpu->eff_addr = 234;
mos6502_handle_rol(cpu, 128); mos6502_handle_rol(cpu, 128);
@ -103,7 +103,7 @@ Test(mos6502_bits, rol)
Test(mos6502_bits, ror) Test(mos6502_bits, ror)
{ {
mos6502_handle_ror(cpu, 64); mos6502_handle_ror(cpu, 64);
cr_assert_eq(cpu->A, 32); cr_assert_eq(cpu->A, 160);
cpu->eff_addr = 123; cpu->eff_addr = 123;
mos6502_handle_ror(cpu, 1); mos6502_handle_ror(cpu, 1);