diff --git a/src/test/mod.rs b/src/test/mod.rs index 7d8606f..118ee70 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -1,4 +1,5 @@ pub mod peterlemon_65816; +pub mod peterlemon_bank; pub mod peterlemon_ppu; pub mod processortests_65816; pub mod processortests_spc700; @@ -14,10 +15,10 @@ use crate::snes::cpu_65816::cpu::Cpu65816; use crate::snes::joypad::Joypad; use crate::snes::ppu::{SCREEN_HEIGHT, SCREEN_WIDTH}; -fn test_display(rom: &[u8], pass_hash: &[u8], time_limit: u128, stable: bool) { +fn test_display(rom: &[u8], pass_hash: &[u8], time_limit: u128, stable: bool, hirom: bool) { let (display, dispstatus) = TestRenderer::new_test(SCREEN_WIDTH, SCREEN_HEIGHT); let (joypads, _) = Joypad::new_channel_all(); - let cart = Cartridge::load_nohdr(rom, false); + let cart = Cartridge::load_nohdr(rom, hirom); let bus = Mainbus::::new(cart, BusTrace::None, display, joypads, false); let reset = bus.read16(0xFFFC); let mut cpu = Cpu65816::>::new(bus, reset); diff --git a/src/test/peterlemon_65816.rs b/src/test/peterlemon_65816.rs index 4cf356c..a3753ca 100644 --- a/src/test/peterlemon_65816.rs +++ b/src/test/peterlemon_65816.rs @@ -18,6 +18,7 @@ macro_rules! test { &hex!($hash), 20000, true, + false, ); } }; diff --git a/src/test/peterlemon_bank.rs b/src/test/peterlemon_bank.rs new file mode 100644 index 0000000..e2702d6 --- /dev/null +++ b/src/test/peterlemon_bank.rs @@ -0,0 +1,59 @@ +use super::test_display; + +use hex_literal::hex; + +macro_rules! lorom_test { + ($testname:ident, $testfn:expr, $hash:expr) => { + #[allow(non_snake_case)] + #[test] + fn $testname() { + test_display( + include_bytes!(concat!("../../../siena_tests/SNES/BANK/", $testfn)), + &hex!($hash), + 60000, + true, + false, + ); + } + }; +} +macro_rules! hirom_test { + ($testname:ident, $testfn:expr, $hash:expr) => { + #[allow(non_snake_case)] + #[test] + fn $testname() { + test_display( + include_bytes!(concat!("../../../siena_tests/SNES/BANK/", $testfn)), + &hex!($hash), + 60000, + true, + true, + ); + } + }; +} +hirom_test!( + BANKHiROMFastROM, + "HiROMFastROM/BANKHiROMFastROM.sfc", + "2ab4871e60935c6fcaf06a40849912f7b8ad23f8e850bb0f03d2576e96664536" +); +hirom_test!( + BANKHiROMSlowROM, + "HiROMSlowROM/BANKHiROMSlowROM.sfc", + "36ab039767172d7a452d6337f7703627e912e8ffc833b10e3eb3467b1cc38e60" +); +lorom_test!( + BANKLoROMFastROM, + "LoROMFastROM/BANKLoROMFastROM.sfc", + "1f2385252686bc02246eed8d670ee46d1bd01e25ad3c0a217dcb84a180e2f045" +); +lorom_test!( + BANKLoROMSlowROM, + "LoROMSlowROM/BANKLoROMSlowROM.sfc", + "89b0ae2ce790bceaa0ea97f780b78e69546e812c0539a39b810d6e87f7d2f379" +); +lorom_test!( + BANKWRAM, + "WRAM/BANKWRAM.sfc", + "c54861d958c14c00b9eadfe2727b0ce9c4b6e25411cf1b833efe337714b61a6c" +); diff --git a/src/test/peterlemon_ppu.rs b/src/test/peterlemon_ppu.rs index 776232c..3dce3f0 100644 --- a/src/test/peterlemon_ppu.rs +++ b/src/test/peterlemon_ppu.rs @@ -12,6 +12,7 @@ macro_rules! ppu_test { &hex!($hash), 60000, true, + false, ); } }; @@ -27,6 +28,7 @@ macro_rules! ppu_test_ns { &hex!($hash), 60000, false, + false, ); } };