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

Add missing test code for the aux bank switch

This commit is contained in:
Peter Evans 2018-01-11 22:35:23 -06:00
parent c4c0312402
commit 1b2e9d952b

View File

@ -123,6 +123,22 @@ Test(apple2, set_bank_switch)
cr_assert_eq(mach->bank_switch, 0);
apple2_set_bank_switch(mach, MEMORY_ROM | MEMORY_WRITE | MEMORY_RAM2);
cr_assert_eq(mach->bank_switch, MEMORY_ROM | MEMORY_WRITE | MEMORY_RAM2);
mos6502_set(mach->cpu, 0x1, 111);
mos6502_set(mach->cpu, 0x101, 222);
apple2_set_bank_switch(mach, MEMORY_AUX);
cr_assert_eq(mach->cpu->rmem, mach->aux);
cr_assert_eq(mos6502_get(mach->cpu, 0x1), 111);
cr_assert_eq(mos6502_get(mach->cpu, 0x101), 222);
mos6502_set(mach->cpu, 0x1, 222);
mos6502_set(mach->cpu, 0x101, 101);
apple2_set_bank_switch(mach, 0);
cr_assert_eq(mach->cpu->rmem, mach->main);
cr_assert_eq(mos6502_get(mach->cpu, 0x1), 222);
cr_assert_eq(mos6502_get(mach->cpu, 0x101), 101);
}
Test(apple2, reset)