mirror of
https://github.com/pevans/erc-c.git
synced 2025-08-15 18:27:37 +00:00
Add missing test code for the aux bank switch
This commit is contained in:
@@ -123,6 +123,22 @@ Test(apple2, set_bank_switch)
|
|||||||
cr_assert_eq(mach->bank_switch, 0);
|
cr_assert_eq(mach->bank_switch, 0);
|
||||||
apple2_set_bank_switch(mach, MEMORY_ROM | MEMORY_WRITE | MEMORY_RAM2);
|
apple2_set_bank_switch(mach, MEMORY_ROM | MEMORY_WRITE | MEMORY_RAM2);
|
||||||
cr_assert_eq(mach->bank_switch, 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)
|
Test(apple2, reset)
|
||||||
|
Reference in New Issue
Block a user