Skip to content
Snippets Groups Projects
Verified Commit cb59dbbf authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: added APU automated testing

parent d57a34ae
No related branches found
No related tags found
1 merge request!26Make dmg-audio tests pass
Pipeline #3033 failed
...@@ -79,7 +79,7 @@ cargo vcpkg -v build ...@@ -79,7 +79,7 @@ cargo vcpkg -v build
It's possible to run the emulator in headless mode using the `--headless` parameter: It's possible to run the emulator in headless mode using the `--headless` parameter:
```bash ```bash
cargo run -- --rom-path ../../res/roms/test/blargg/cpu/cpu_instrs.gb --cycles 100000000 --headless --device stdout --unlimited cargo run -- --rom-path ../../res/roms/test/blargg/cpu/cpu_instrs.gb --cycles 100000000 --headless --device stdout --unlimited
``` ```
## Features ## Features
......
frontends/sdl/res/test/blargg/dmg_sound/01-registers.png

331 B

frontends/sdl/res/test/blargg/dmg_sound/02-len ctr.png

365 B

frontends/sdl/res/test/blargg/dmg_sound/03-trigger.png

378 B

...@@ -64,11 +64,37 @@ mod tests { ...@@ -64,11 +64,37 @@ mod tests {
Some(50000000), Some(50000000),
TestOptions::default(), TestOptions::default(),
); );
compare_images(&result, "res/test/blargg/instr_timing/instr_timing.png");
let image_result = compare_images(&result, "res/test/blargg/instr_timing/instr_timing.png"); let image_result = compare_images(&result, "res/test/blargg/instr_timing/instr_timing.png");
assert_eq!(image_result, true); assert_eq!(image_result, true);
} }
#[test]
fn test_blargg_dmg_sound() {
let result: [u8; FRAME_BUFFER_SIZE] = run_image_test(
"../../res/roms/test/blargg/dmg_sound/01-registers.gb",
Some(50000000),
TestOptions::default(),
);
let image_result = compare_images(&result, "res/test/blargg/dmg_sound/01-registers.png");
assert_eq!(image_result, true);
let result: [u8; FRAME_BUFFER_SIZE] = run_image_test(
"../../res/roms/test/blargg/dmg_sound/02-len ctr.gb",
Some(50000000),
TestOptions::default(),
);
let image_result = compare_images(&result, "res/test/blargg/dmg_sound/02-len ctr.png");
assert_eq!(image_result, true);
let result: [u8; FRAME_BUFFER_SIZE] = run_image_test(
"../../res/roms/test/blargg/dmg_sound/03-trigger.gb",
Some(100000000),
TestOptions::default(),
);
let image_result = compare_images(&result, "res/test/blargg/dmg_sound/03-trigger.png");
assert_eq!(image_result, true);
}
#[test] #[test]
fn test_dmg_acid2() { fn test_dmg_acid2() {
let result: [u8; FRAME_BUFFER_SIZE] = run_image_test( let result: [u8; FRAME_BUFFER_SIZE] = run_image_test(
......
...@@ -444,14 +444,10 @@ impl Apu { ...@@ -444,14 +444,10 @@ impl Apu {
} }
}; };
println!("APU read: 0x{:04X} = 0x{:02X}", addr, value);
value value
} }
pub fn write(&mut self, addr: u16, value: u8) { pub fn write(&mut self, addr: u16, value: u8) {
println!("APU write: 0x{:04X} = 0x{:02X}", addr, value);
// in case the sound is disabled then ignores writes // in case the sound is disabled then ignores writes
// to any register aside from the sound on/off // to any register aside from the sound on/off
if !self.sound_enabled && addr != 0xff26 { if !self.sound_enabled && addr != 0xff26 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment