From 262f355d0d944291107f11a5447ad27dcc2a274a Mon Sep 17 00:00:00 2001 From: YushiOMOTE Date: Wed, 31 Jul 2024 20:23:02 +0900 Subject: [PATCH 1/4] Add div trigger volume 10 rom test --- README.md | 1 + .../same_suite_div_trigger_volume_10.txt | 144 ++++++++++++++++++ core/tests/test_roms.rs | 50 ++++-- 3 files changed, 179 insertions(+), 16 deletions(-) create mode 100644 core/tests/expects/same_suite_div_trigger_volume_10.txt diff --git a/README.md b/README.md index 211f156..8dc85b1 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Test status of [Same Suite](https://github.com/YushiOMOTE/SameSuite/tree/430ab7f * [x] `apu/div_write_trigger_10.gb` * [x] `apu/div_write_trigger_volume.gb` * [x] `apu/div_write_trigger_volume_10.gb` +* [x] `apu/div_trigger_volume_10.gb` ## Projects diff --git a/core/tests/expects/same_suite_div_trigger_volume_10.txt b/core/tests/expects/same_suite_div_trigger_volume_10.txt new file mode 100644 index 0000000..24ad353 --- /dev/null +++ b/core/tests/expects/same_suite_div_trigger_volume_10.txt @@ -0,0 +1,144 @@ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##......##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##......##..##..##..##..##..##....#...#.####......#...#.####......#...#.####......#...#.####......#...#.####......#...#.####......#...#.####......#...#.####... +.##......##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##..##..##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.######..######..######..######....#####.#.........#####.#.........#####.#.........#####.#.........#####.#.........#####.#.........#####.#.........#####.#...... +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##......##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##......##..##..##..##..######....#...#.####......#...#.####......#...#.####......#...#.####......#...#.####......#...#.####......#...#.####......#...#.####... +.##......##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##..##..##..##..##..##..##..##....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.######..######..######..######....#####.#.........#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######...###....######....#####.#####.....#####.####......#####.####......#####.####......#####.####......#####.####......#####.####......#####.####... +.##..##..##..##..####....##..##....#...#.#.........#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.. +.##......##..##..####....##..##....#...#.#.........#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##....##....##..##....#...#.####......#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##....##....##..##....#...#.#.........#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##..##..##..##....##....##..##....#...#.#.........#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.....#...#.#..##.. +.######..######..######..######....#####.#####.....#####.####......#####.####......#####.####......#####.####......#####.####......#####.####......#####.####... +................................................................................................................................................................ +.######..######...###....######....#####.####......#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..####....##..##....#...#.#..##.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..####....##..##....#...#.#...#.....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##......##..##....##....######....#...#.#...#.....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##......##..##....##....##..##....#...#.#...#.....#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#.........#...#.#...... +.##..##..##..##....##....##..##....#...#.#..##.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.######..######..######..######....#####.####......#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ diff --git a/core/tests/test_roms.rs b/core/tests/test_roms.rs index b514d20..0a8fcfa 100644 --- a/core/tests/test_roms.rs +++ b/core/tests/test_roms.rs @@ -8,6 +8,12 @@ use rgy::{VRAM_HEIGHT, VRAM_WIDTH}; const WHITE: u32 = 0xdddddd; const BLACK: u32 = 0x555555; +const PRINT_DISPLAY: &'static str = "PRINT_DISPLAY"; + +fn print_display() -> bool { + std::env::var(PRINT_DISPLAY).as_deref() == Ok("1") +} + enum Expected { Serial(&'static str), Display(Vec), @@ -65,20 +71,24 @@ impl rgy::Hardware for TestHardware { self.is_done = true; } - // // print display to console - // if ly == VRAM_HEIGHT - 1 { - // println!(); - // for (index, color) in self.display.iter().enumerate() { - // if *color == WHITE { - // print!(".") - // } else { - // print!("#") - // } - // if index % VRAM_WIDTH == VRAM_WIDTH - 1 { - // println!(); - // } - // } - // } + if !print_display() { + return; + } + + // print display to console + if ly == VRAM_HEIGHT - 1 { + println!(); + for (index, color) in self.display.iter().enumerate() { + if *color == WHITE { + print!(".") + } else { + print!("#") + } + if index % VRAM_WIDTH == VRAM_WIDTH - 1 { + println!(); + } + } + } } fn joypad_pressed(&mut self, _: rgy::Key) -> bool { @@ -138,10 +148,10 @@ fn test_rom(expected: Expected, path: &str) { hw, rgy::debug::NullDebugger, ); - const TIMEOUT: Duration = Duration::from_secs(60); + let timeout = Duration::from_secs(if print_display() { 10 } else { 60 }); let now = Instant::now(); while sys.poll() { - if now.elapsed() >= TIMEOUT { + if now.elapsed() >= timeout { panic!("timeout") } } @@ -327,3 +337,11 @@ fn same_suite_div_write_trigger_volume_10() { "../roms/same_suite/apu/div_write_trigger_volume_10.gb", ); } + +#[test] +fn same_suite_div_trigger_volume_10() { + test_rom( + Expected::from_file("tests/expects/same_suite_div_trigger_volume_10.txt"), + "../roms/same_suite/apu/div_trigger_volume_10.gb", + ); +} From 3abc7dbcdf849d8669566cc00933dd0a6cea6431 Mon Sep 17 00:00:00 2001 From: YushiOMOTE Date: Wed, 31 Jul 2024 20:23:19 +0900 Subject: [PATCH 2/4] Add channel 4 lfsr rom test --- README.md | 1 + core/src/apu/noise.rs | 65 ++++---- .../expects/same_suite_channel_4_lfsr.txt | 144 ++++++++++++++++++ core/tests/test_roms.rs | 8 + 4 files changed, 192 insertions(+), 26 deletions(-) create mode 100644 core/tests/expects/same_suite_channel_4_lfsr.txt diff --git a/README.md b/README.md index 8dc85b1..1210f92 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ Test status of [Same Suite](https://github.com/YushiOMOTE/SameSuite/tree/430ab7f * [x] `apu/div_write_trigger_volume.gb` * [x] `apu/div_write_trigger_volume_10.gb` * [x] `apu/div_trigger_volume_10.gb` +* [x] `apu/channel_4/channel_4_lfsr.gb` ## Projects diff --git a/core/src/apu/noise.rs b/core/src/apu/noise.rs index 1360d8c..9a6db3f 100644 --- a/core/src/apu/noise.rs +++ b/core/src/apu/noise.rs @@ -1,9 +1,13 @@ use super::{dac::Dac, envelope::Envelope, frame_sequencer::Frame, length_counter::LengthCounter}; -use crate::clock::{ClockDivider, Timer}; +use crate::{ + clock::{ClockDivider, Timer}, + cpu::CPU_FREQ_HZ, +}; use bitfield_struct::bitfield; -const NOISE_FREQ_HZ: usize = 262_144; +// LFSR runs at CPU rate. +const NOISE_FREQ_HZ: usize = CPU_FREQ_HZ; #[derive(Debug, Clone)] pub struct Noise { @@ -159,12 +163,11 @@ impl Noise { for _ in 0..times { self.update(); } + + self.write_amp(); } fn update(&mut self) { - if !self.is_active() { - return; - } if !self.timer.tick() { return; } @@ -172,8 +175,10 @@ impl Noise { self.reload_timer(); self.lfsr.update(); + } - self.dac.write(if self.lfsr.high() { + fn write_amp(&mut self) { + self.dac.write(if self.is_active() && self.lfsr.high() { self.envelope.amp() } else { 0 @@ -189,11 +194,19 @@ impl Noise { let divider = self.nr43.div_freq(); let shift = self.nr43.shift_freq(); - if divider == 0 { - (5 << shift) / 10 - } else { - divider << shift - } + // Divisor code Divisor + // ----------------------- + // 0 8 + // 1 16 + // 2 32 + // 3 48 + // 4 64 + // 5 80 + // 6 96 + // 7 112 + let base = if divider == 0 { 8 } else { divider * 16 }; + + base << shift } pub fn is_active(&self) -> bool { @@ -204,6 +217,9 @@ impl Noise { self.power = true; self.length_counter.power_on(); + + self.reload_timer(); + self.divider.reset(); } pub fn power_off(&mut self) { @@ -216,8 +232,6 @@ impl Noise { self.length_counter.power_off(); - self.lfsr.reset(); - self.dac.power_off(); } @@ -239,35 +253,34 @@ struct Lfsr { impl Lfsr { fn new() -> Self { Self { - value: 0, + value: 0xff, short: false, } } - fn reset(&mut self) { - self.value = 0; - self.short = false; - } - fn high(&self) -> bool { // Inverted bit 1 self.value & 1 == 0 } fn trigger(&mut self, short: bool) { - self.value = 0; self.short = short; + self.value = 0xff; } fn update(&mut self) { - // NXOR bit 0 and 1. - let bit = !((self.value & 0x01) ^ ((self.value & 0x02) >> 1)) & 1; + // Xor bit 0 and 1. + let bit = (self.value & 1) ^ ((self.value & 2) >> 1) & 1; + + // Shift right. + self.value >>= 1; + + // Put the bit at bit 14 (i.e. 15 bits shift register) + self.value = (self.value & !0x4000) | (bit << 14); - // Put XOR-ed result in bit 15 (and bit 7 in short mode) if self.short { - self.value = ((self.value >> 1) & 0x7f7f) | (bit << 7) | (bit << 15); - } else { - self.value = ((self.value >> 1) & 0x7fff) | (bit << 15); + // Put the bit at bit 6 (i.e. 7 bits shift register) + self.value = (self.value & !0x0040) | (bit << 6); } } } diff --git a/core/tests/expects/same_suite_channel_4_lfsr.txt b/core/tests/expects/same_suite_channel_4_lfsr.txt new file mode 100644 index 0000000..e555486 --- /dev/null +++ b/core/tests/expects/same_suite_channel_4_lfsr.txt @@ -0,0 +1,144 @@ +.######..######..######..#####.....#####.#####.....#####.#####.....#####.#####.....####..#####.....#####.#####.....#####.#####.....#####.####......#####.#####.. +.##..##..##..##..##..##..##........#...#.#.........#...#.#.........##....#.........#.....#.........#...#.#...#.....#...#.#...#.....#...#.#..##.....#...#.#...... +.##......##..##..##..##..######.......##.#.............#.#.........#####.#.........#####.#............##....##........##.#...#........##.#...#.........#.#...... +.##......##..##..##..##..##..##.......#..####........###.####..........#.####......#...#.####.........#.....#.........#..#####........#..#...#.......###.####... +.##......##..##..##..##..##..##......##..#.............#.#.............#.#.........#...#.#...........##....##........##..#...#.......##..#...#.........#.#...... +.##..##..##..##..##..##..##..##......##..#.........#...#.#.........#...#.#.........#...#.#...........##....##........##..#...#.......##..#..##.....#...#.#...... +.######..######..######..######......#...#####.....#####.#.........#####.#.........#####.#...........#.....#.........#...#####.......#...####......#####.#####.. +................................................................................................................................................................ +.######..######..######..######.....##...#####.......##..#####.....####..#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##........###...#..........###..#.........#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....##....#.........#...#.#...... +.##......##..##..##..##..##........#.#...#..........#.#..#.........#####....##........##.....#........##.#...#.........#.#.........#####.#.............#.#...... +.##......##..##..##..##..#####.......#...####......##.#..####......#...#....#.........#....###........#..#...#.......###.#.............#.####.........#..####... +.##......##..##..##..##..##..........#...#.........#..#..#.........#...#...##........##......#.......##..#####.........#.#.............#.#...........#...#...... +.##..##..##..##..##..##..##..........#...#.........#####.#.........#...#...##........##..#...#.......##......#.....#...#.#...#.....#...#.#..........#....#...... +.######..######..######..######....#####.#............#..#.........#####...#.........#...#####.......#....####.....#####.#####.....#####.#####.....#####.#...... +................................................................................................................................................................ +.######..######...###....#####.....#####.#####.....####..#####.....#####.#####.....#####...#........##...####......#####.#####.....#####.#####.......##..#####.. +.##..##..##..##..####....##........##....#...#.....#.....#...#.....#...#.##........#...#..###......###...#..##.....#...#.#.........#...#.#...#......###..#...#.. +.##......##..##..####....######....#####....##.....#####.#...#........##.#####.........#..###......#.#...#...#.....#...#.#.........#...#....##......#.#......#.. +.##......##..##....##....##..##........#....#......#...#.#####........#......#.......###..#.#........#...#...#.....#...#.####......#...#....#......##.#....###.. +.##......##..##....##....##..##........#...##......#...#.#...#.......##......#.........#.#####.......#...#...#.....#...#.#.........#...#...##......#..#......#.. +.##..##..##..##....##....##..##....#...#...##......#...#.#...#.......##..#...#.....#...#.##.##.......#...#..##.....#...#.#.........#...#...##......#####.#...#.. +.######..######..######..######....#####...#.......#####.#####.......#...#####.....#####.#...#.....#####.####......#####.#####.....#####...#..........#..#####.. +................................................................................................................................................................ +.######..######...###....######....####...##.......#####.#####.....#####.#####.....####..#####.....#####.####......#####.#####.....#####.####......#####.#####.. +.##..##..##..##..####....##........#.....###.......#...#.#...#.....##....#...#.....#.....#...#.....#...#.#.........#...#.#...#.....##....#..##.....#...#.#...... +.##......##..##..####....##........#####.#.#...........#.#...#.....#####.#...#.....#####.#............##.#####.........#.#...#.....#####.#...#.........#.#...... +.##......##..##....##....#####.....#...#...#.........###.#...#.........#.#####.....#...#.#............#..#...#.......###.#####.........#.#...#........#..####... +.##......##..##....##....##........#...#...#...........#.#...#.........#.#...#.....#...#.#...........##..#...#.........#.#...#.........#.#...#.......#...#...... +.##..##..##..##....##....##........#...#...#.......#...#.#...#.....#...#.#...#.....#...#.#...#.......##..#...#.....#...#.#...#.....#...#.#..##......#....#...... +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.......#...#####.....#####.#####.....#####.####......#####.#####.. +................................................................................................................................................................ +.######..######..######..#####......##...#####.......##..#####.....####..#####.....#####.#####......##...#####.....#####.#####.......##..####......#####.#####.. +.##..##..##..##..##..##..##........###...#...#......###..#...#.....#.....##........#...#.#...#.....###...#...#.....#...#.#...#......###..#.........#...#.#...#.. +.##......##..##......##..######....#.#......##......#.#..#...#.....#####.#####.........#.....#.....#.#...#...#.....#...#.#..........#.#..#####.........#.....#.. +.##......##..##.....##...##..##......#......#......##.#..#####.....#...#.....#.......###....#........#...#...#.....#...#.#.........##.#..#...#........#....###.. +.##......##..##....##....##..##......#.....##......#..#..#...#.....#...#.....#.........#...#.........#...#####.....#...#.#.........#..#..#...#.......#.......#.. +.##..##..##..##...##.....##..##......#.....##......#####.#...#.....#...#.#...#.....#...#..#..........#.......#.....#...#.#...#.....#####.#...#......#....#...#.. +.######..######..######..######....#####...#..........#..#####.....#####.#####.....#####.#####.....#####..####.....#####.#####........#..#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..######....#####..##.......#####.#####.....#####...##......####....#.......#####.#####......##.....#.......#####.####......#####.####... +.##..##..##..##..##..##..##........##....###.......#...#.#...#.....##.....###......#......###......#...#.##........###....###......#...#.#..##.....#...#.#...... +.##......##..##......##..##........#####.#.#...........#.#...#.....#####..#.#......#####..###..........#.#####.....#.#....###......#...#.#...#.....#...#.#####.. +.##......##..##.....##...#####.........#...#..........#..#####.........#.##.#......#...#..#.#........###.....#.......#....#.#......#...#.#...#.....#...#.#...#.. +.##......##..##....##....##............#...#.........#...#...#.........#.#..#......#...#.#####.........#.....#.......#...#####.....#...#.#...#.....#...#.#...#.. +.##..##..##..##...##.....##........#...#...#........#....#...#.....#...#.#####.....#...#.##.##.....#...#.#...#.......#...##.##.....#...#.#..##.....#...#.#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#####....#......#####.#...#.....#####.#####.....#####.#...#.....#####.####......#####.#####.. +................................................................................................................................................................ +.######..######..######..#####.....#####.#####.......##...##.......#####.#####.....#####.#####.....####..#####.....#####...##......#####...#.......#####.####... +.##..##..##..##..##..##..##........#...#.#...#......###..###.......#...#.#...#.....##....#...#.....#.....#...#.....#...#..###......#...#..###......#...#.#..##.. +.##......##..##......##..######....#...#.....#......#.#..#.#...........#.#...#.....#####.#...#.....#####.#...#........##..#.#.........##..###..........#.#...#.. +.##......##..##....####..##..##....#...#...###.....##.#....#..........#..#...#.........#.#...#.....#...#.#####........#..##.#.........#...#.#........###.#...#.. +.##......##..##......##..##..##....#...#.....#.....#..#....#.........#...#...#.........#.#...#.....#...#.#...#.......##..#..#........##..#####.........#.#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#####...#........#....#...#.....#...#.#...#.....#...#.#...#.......##..#####.......##..##.##.....#...#.#..##.. +.######..######..######..######....#####.#####........#..#####.....#####.#####.....#####.#####.....#####.#####.......#......#........#...#...#.....#####.####... +................................................................................................................................................................ +.######..######..######..######.....##...#####.....#####.#####.......##..#####.....####..#####.....#####..##.......#####.#####.....#####.#####.....####..#####.. +.##..##..##..##..##..##..##........###...#.........#...#.#..........###..#...#.....#.....#...#.....#...#.###.......#...#.#...#.....##....#...#.....#.....#...... +.##......##..##......##..##........#.#...#.........#...#.#..........#.#.....##.....#####.....#........##.#.#...........#.#...#.....#####.#.........#####.#...... +.##......##..##....####..#####.......#...####......#...#.####......##.#.....#......#...#...###........#....#.........###.#####.........#.#.........#...#.####... +.##......##..##......##..##..........#...#.........#...#.#.........#..#....##......#...#.....#.......##....#...........#.#...#.........#.#.........#...#.#...... +.##..##..##..##..##..##..##..........#...#.........#...#.#.........#####...##......#...#.#...#.......##....#.......#...#.#...#.....#...#.#...#.....#...#.#...... +.######..######..######..######....#####.#####.....#####.#............#....#.......#####.#####.......#...#####.....#####.#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######....###...#####.....#####.#####.....#####.#####.....####..####......#####.####.......##...#####.......##..####......#####.####.......##...#####.. +.##..##..##..##...####...##........#...#.#...#.....##....#...#.....#.....#..##.....#...#.#.........###...#...#......###..#..##.....#...#.#.........###...#...#.. +.##......##..##...####...######........#....##.....#####.#...#.....#####.#...#.........#.#####.....#.#...#...#......#.#..#...#.........#.#####.....#.#.......#.. +.##......##..##..#####...##..##......###....#..........#.#####.....#...#.#...#.......###.#...#.......#...#####.....##.#..#...#........#..#...#.......#.....###.. +.##......##..##..##.##...##..##........#...##..........#.#...#.....#...#.#...#.........#.#...#.......#...#...#.....#..#..#...#.......#...#...#.......#.......#.. +.##..##..##..##..######..##..##....#...#...##......#...#.#...#.....#...#.#..##.....#...#.#...#.......#...#...#.....#####.#..##......#....#...#.......#...#...#.. +.######..######.....##...######....#####...#.......#####.#####.....#####.####......#####.#####.....#####.#####........#..####......#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######....###...######......##..#####.....#####...##......#####.#####.....#####.#####......##.....##........##....#.......#####.#####......##...#####.. +.##..##..##..##...####...##.........###..#...#.....#...#..###......##....#...#.....#...#.#...#.....###....###.......###...###......#...#.##........###...#...#.. +.##......##..##...####...##.........#.#..#...#.........#..#.#......#####.....#.........#.#...#.....#.#....#.#.......#.#...###..........#.#####.....#.#.......#.. +.##......##..##..#####...#####.....##.#..#...#........#..##.#..........#....#.........#..#...#.......#...##.#......##.#...#.#.........#......#.......#......#... +.##......##..##..##.##...##........#..#..#####.......#...#..#..........#...#.........#...#####.......#...#..#......#..#..#####.......#.......#.......#.....#.... +.##..##..##..##..######..##........#####.....#......#....#####.....#...#..#.........#........#.......#...#####.....#####.##.##......#....#...#.......#....#..... +.######..######.....##...######.......#...####.....#####....#......#####.#####.....#####..####.....#####....#.........#..#...#.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..#####.....#####.#####.....#####...##........##..#####.....#####..##........##...#####.......##..#####.....####....##......#####.#####.. +.##..##..##..##..###.....##........#...#.#...#.....#...#..###.......###..#...#.....#...#.###.......###...#...#......###..#...#.....#......###......#...#.#...#.. +.##......##..##..######..######....#...#.#...#.....#...#..#.#.......#.#......#.........#.#.#.......#.#...#...#......#.#..#...#.....#####..#.#.........##.....#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.##.#......##.#.....#.........#....#.........#...#...#.....##.#..#####.....#...#.##.#.........#.....#... +.##......##..##......##..##..##....#...#.#####.....#...#.#..#......#..#....#.........#.....#.........#...#...#.....#..#..#...#.....#...#.#..#........##....#.... +.##..##..##..##..##..##..##..##....#...#.....#.....#...#.#####.....#####..#.........#......#.........#...#...#.....#####.#...#.....#...#.#####.......##...#..... +.######..######..######..######....#####..####.....#####....#.........#..#####.....#####.#####.....#####.#####........#..#####.....#####....#........#...#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####......##...#####.......##..#####.....#####.#####.....#####.#####.....####..#####.....#####...##......#####...#.... +.##..##..##..##..###.....##........#...#.#...#.....###...#...#......###..#.........#...#.#...#.....##....#...#.....#.....#...#.....#...#..###......##.....###... +.##......##..##..######..##............#.#...#.....#.#...#..........#.#..#.............#....##.....#####.....#.....#####.#...#.........#..#.#......#####..###... +.##......##..##......##..#####.......###.#...#.......#...#.........##.#..####.........#.....#..........#...###.....#...#.#...#.......###.##.#..........#..#.#... +.##......##..##......##..##............#.#####.......#...#.........#..#..#...........#.....##..........#.....#.....#...#.#####.........#.#..#..........#.#####.. +.##..##..##..##..##..##..##........#...#.....#.......#...#...#.....#####.#..........#......##......#...#.#...#.....#...#.....#.....#...#.#####.....#...#.##.##.. +.######..######..######..######....#####..####.....#####.#####........#..#####.....#####...#.......#####.#####.....#####..####.....#####....#......#####.#...#.. +................................................................................................................................................................ +.######..######..#####...#####.....#####.####.......##...####......#####.#####.......##..#####.....#####.#####......##....##.......#####.#####.......##....##... +.##..##..##..##..##......##........#...#.#..##.....###...#.........#...#.#...#......###..##........#...#.#...#.....###...###.......#...#.#...#......###...###... +.##......##..##..######..######........#.#...#.....#.#...#####.....#...#.#...#......#.#..#####.........#.....#.....#.#...#.#.......#...#.#...#......#.#...#.#... +.##......##..##..##..##..##..##.......#..#...#.......#...#...#.....#...#.#####.....##.#......#........#.....#........#.....#.......#...#.#####.....##.#..##.#... +.##......##..##..##..##..##..##......#...#...#.......#...#...#.....#...#.#...#.....#..#......#.......#.....#.........#.....#.......#...#.#...#.....#..#..#..#... +.##..##..##..##..##..##..##..##.....#....#..##.......#...#...#.....#...#.#...#.....#####.#...#......#.....#..........#.....#.......#...#.#...#.....#####.#####.. +.######..######..######..######....#####.####......#####.#####.....#####.#####........#..#####.....#####.#####.....#####.#####.....#####.#####........#.....#... +................................................................................................................................................................ +.######..######..#####...######....####..#####.....#####..##........##...#####.......##..#####.....####..####......#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##......##........#.....#...#.....#...#.###.......###...#...#......###..#...#.....#.....#.........#...#.#...#.....##....#...#.....#...#.#...#.. +.##......##..##..######..##........#####.....#.........#.#.#.......#.#...#...#......#.#..#.........#####.#####.........#.....#.....#####.#...#.........#.#...... +.##......##..##..##..##..#####.....#...#....#........###...#.........#...#####.....##.#..#.........#...#.#...#.......###...###.........#.#...#........#..#...... +.##......##..##..##..##..##........#...#...#...........#...#.........#...#...#.....#..#..#.........#...#.#...#.........#.....#.........#.#####.......#...#...... +.##..##..##..##..##..##..##........#...#..#........#...#...#.........#...#...#.....#####.#...#.....#...#.#...#.....#...#.#...#.....#...#.....#......#....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#####.#####........#..#####.....#####.#####.....#####.#####.....#####..####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..#####.....#####.####......#####.#####.....#####.#####.....#####...#........##...#####.....#####...#.......#####.#####.....#####.#####.. +.##..##..##..##..#...##..##........##....#.........#...#.#...#.....##....##........#...#..###......###...##........#...#..###......#...#.##........#...#.#...#.. +.##......##..##.....###..######....#####.#####.........#.#...#.....#####.#####.........#..###......#.#...#####.....#...#..###......#...#.#####.....#...#.....#.. +.##......##..##.....##...##..##........#.#...#........#..#####.........#.....#........#...#.#........#.......#.....#...#..#.#......#...#.....#.....#...#....#... +.##......##..##....###...##..##........#.#...#.......#...#...#.........#.....#.......#...#####.......#.......#.....#...#.#####.....#...#.....#.....#...#...#.... +.##..##..##..##....###...##..##....#...#.#...#......#....#...#.....#...#.#...#......#....##.##.......#...#...#.....#...#.##.##.....#...#.#...#.....#...#..#..... +.######..######....##....######....#####.#####.....#####.#####.....#####.#####.....#####.#...#.....#####.#####.....#####.#...#.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..######....#####..##.......#####.#####.......##..#####.....####..#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..#...##..##........#...#.###.......#...#.#...#......###..#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...... +.##......##..##.....###..##........#...#.#.#.......#...#.#...#......#.#..#...#.....#####.#...#........##.#...#........##.#...#........##.#............##.#...... +.##......##..##.....##...#####.....#...#...#.......#...#.#...#.....##.#..#...#.....#...#.#...#........#..#...#........#..#####........#..#............#..####... +.##......##..##....###...##........#...#...#.......#...#.#...#.....#..#..#...#.....#...#.#...#.......##..#...#.......##..#...#.......##..#...........##..#...... +.##..##..##..##....###...##........#...#...#.......#...#.#...#.....#####.#...#.....#...#.#...#.......##..#...#.......##..#...#.......##..#...#.......##..#...... +.######..######....##....######....#####.#####.....#####.#####........#..#####.....#####.#####.......#...#####.......#...#####.......#...#####.......#...#####.. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ diff --git a/core/tests/test_roms.rs b/core/tests/test_roms.rs index 0a8fcfa..8cb2d45 100644 --- a/core/tests/test_roms.rs +++ b/core/tests/test_roms.rs @@ -345,3 +345,11 @@ fn same_suite_div_trigger_volume_10() { "../roms/same_suite/apu/div_trigger_volume_10.gb", ); } + +#[test] +fn same_suite_channel_4_lfsr() { + test_rom( + Expected::from_file("tests/expects/same_suite_channel_4_lfsr.txt"), + "../roms/same_suite/apu/channel_4/channel_4_lfsr.gb", + ); +} From 2c84ece05741e58aaa163f7f2ec6cda0fd78a03d Mon Sep 17 00:00:00 2001 From: YushiOMOTE Date: Wed, 31 Jul 2024 20:23:22 +0900 Subject: [PATCH 3/4] Add channel 4 lfsr 15 rom test --- README.md | 1 + core/src/apu/noise.rs | 11 +- .../expects/same_suite_channel_4_lfsr15.txt | 144 ++++++++++++++++++ core/tests/test_roms.rs | 8 + 4 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 core/tests/expects/same_suite_channel_4_lfsr15.txt diff --git a/README.md b/README.md index 1210f92..1b47e5f 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ Test status of [Same Suite](https://github.com/YushiOMOTE/SameSuite/tree/430ab7f * [x] `apu/div_write_trigger_volume_10.gb` * [x] `apu/div_trigger_volume_10.gb` * [x] `apu/channel_4/channel_4_lfsr.gb` +* [x] `apu/channel_4/channel_4_lfsr15.gb` ## Projects diff --git a/core/src/apu/noise.rs b/core/src/apu/noise.rs index 9a6db3f..56b8a0e 100644 --- a/core/src/apu/noise.rs +++ b/core/src/apu/noise.rs @@ -145,7 +145,7 @@ impl Noise { .update(self.nr44.trigger(), self.nr44.enable_length()); if self.nr44.trigger() { - self.reload_timer(); + self.reload_initial_timer(self.nr43.step()); self.lfsr.trigger(self.nr43.step()); self.envelope .update(self.nr42.init(), self.nr42.count(), self.nr42.increase()); @@ -185,6 +185,15 @@ impl Noise { }); } + fn reload_initial_timer(&mut self, short: bool) { + self.timer.reset(); + + // TODO: Understand the initial delay more. + self.timer.set_interval( + self.timer_interval() + if short { 0 } else { 7 * self.timer_interval() } + 3, + ); + } + fn reload_timer(&mut self) { self.timer.reset(); self.timer.set_interval(self.timer_interval()); diff --git a/core/tests/expects/same_suite_channel_4_lfsr15.txt b/core/tests/expects/same_suite_channel_4_lfsr15.txt new file mode 100644 index 0000000..8a736db --- /dev/null +++ b/core/tests/expects/same_suite_channel_4_lfsr15.txt @@ -0,0 +1,144 @@ +.######..######..######..#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##........#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..######....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#####.#...#.....#.....#...#.....####..#...#.....####..#...#.....####..#####.. +.##......##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##........#.....#...#.....#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...... +.##......##..##..##..##..##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...... +.##......##..##..##..##..#####.....####..#.........####..####......####..####......####..####......####..####......####..####......####..####......####..####... +.##......##..##..##..##..##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...... +.##..##..##..##..##..##..##........#.....#...#.....#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...... +.######..######..######..######....#.....#####.....#.....#####.....#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...... +................................................................................................................................................................ +.######..######...###....#####.....#####.#####.....#####.#####.....#####.#####.....####..#####.....#####.#####.....#####.#####.....#####.#####.....#####.####... +.##..##..##..##..####....##........#.....#.........#...#.#.........#...#.#.........#..##.#.........#.....#.........#.....#...#.....#.....#...#.....#.....#..##.. +.##......##..##..####....######....#.....#............##.#.........#...#.#.........#...#.#.........#.....#.........#........##.....#.....#...#.....#.....#...#.. +.##......##..##....##....##..##....####..####.........#..####......#####.####......#...#.####......####..####......####.....#......####..#####.....####..#...#.. +.##......##..##....##....##..##....#.....#...........##..#.........#...#.#.........#...#.#.........#.....#.........#.......##......#.....#...#.....#.....#...#.. +.##..##..##..##....##....##..##....#.....#...........##..#.........#...#.#.........#..##.#.........#.....#.........#.......##......#.....#...#.....#.....#..##.. +.######..######..######..######....#.....#...........#...#.........#####.#.........####..#.........#####.#.........#.......#.......#.....#####.....#.....####... +................................................................................................................................................................ +.######..######...###....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..####....##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#...#.#...... +.##......##..##..####....##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#............##.#...... +.##......##..##....##....#####.....####..####......####..####......####..####......####..####......####..####......####..####......####..####.........#..####... +.##......##..##....##....##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...........##..#...... +.##..##..##..##....##....##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...........##..#...... +.######..######..######..######....#.....#####.....#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...........#...#...... +................................................................................................................................................................ +.######..######..######..#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##........#...#.#.........#...#.#.........#...#.#.........#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...... +.##......##..##......##..######........#.#.........#...#.#.........#.....#.........#........##.....#.........#.....#.....#...#.....#.....#.........#.....#...... +.##......##..##.....##...##..##......###.####......#...#.####......#.....####......####.....#......####....###.....####..#...#.....####..#.........####..####... +.##......##..##....##....##..##........#.#.........#####.#.........#.....#.........#.......##......#.........#.....#.....#####.....#.....#.........#.....#...... +.##..##..##..##...##.....##..##....#...#.#.............#.#.........#...#.#.........#.......##......#.....#...#.....#.........#.....#.....#...#.....#.....#...... +.######..######..######..######....#####.#..........####.#.........#####.#.........#####...#.......#.....#####.....#......####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#.........#...#.#.........#...#.#.........##....#...... +.##......##..##......##..##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#............##.#.........#...#.#.........#####.#...... +.##......##..##.....##...#####.....####..####......####..####......####..####......####..####......####..####.........#..####......#####.####..........#.####... +.##......##..##....##....##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...........##..#.........#...#.#.............#.#...... +.##..##..##..##...##.....##........#.....#.........#.....#.........#.....#.........#.....#.........#.....#...........##..#.........#...#.#.........#...#.#...... +.######..######..######..######....#.....#.........#.....#.........#.....#.........#.....#.........#.....#...........#...#.........#####.#.........#####.#...... +................................................................................................................................................................ +.######..######..######..#####.......#...#####.....####..#####.....#####.#####.....#####.#####.....#####...#.......#####.####......#####.#####.....#####.#####.. +.##..##..##..##..##..##..##.........###..#.........#..##.#...#.....#.....#...#.....#.....##........#......###......#.....#..##.....#.....#.........#.....#...... +.##......##..##......##..######.....###..#.........#...#....##.....#.....#...#.....#.....#####.....#......###......#.....#...#.....#.....#.........#.....#...... +.##......##..##....####..##..##.....#.#..####......#...#....#......####..#####.....####......#.....####...#.#......####..#...#.....####..####......####..####... +.##......##..##......##..##..##....#####.#.........#...#...##......#.....#...#.....#.........#.....#.....#####.....#.....#...#.....#.....#.........#.....#...... +.##..##..##..##..##..##..##..##....##.##.#.........#..##...##......#.....#...#.....#.....#...#.....#.....##.##.....#.....#..##.....#.....#.........#.....#...... +.######..######..######..######....#...#.#.........####....#.......#####.#####.....#.....#####.....#.....#...#.....#.....####......#.....#####.....#.....#...... +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####......##...#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##........#.....#.........#.....#.........#.....#.........#...#.#.........#...#.#.........###...#.........#...#.#.........#...#.#...#.. +.##......##..##......##..##........#.....#.........#.....#.........#.....#............##.#.............#.#.........#.#...#.........#...#.#.........#...#....##.. +.##......##..##....####..#####.....####..####......####..####......####..####.........#..####........###.####........#...####......#...#.####......#####....#... +.##......##..##......##..##........#.....#.........#.....#.........#.....#...........##..#.............#.#...........#...#.........#...#.#.........#...#...##... +.##..##..##..##..##..##..##........#.....#.........#.....#.........#.....#...........##..#.........#...#.#...........#...#.........#...#.#.........#...#...##... +.######..######..######..######....#.....#.........#.....#.........#.....#...........#...#.........#####.#.........#####.#.........#####.#.........#####...#.... +................................................................................................................................................................ +.######..######....###...#####.....#####.#####.....#####..##.......#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##...####...##........#...#.#...#.....#.....###.......#.....#...#.....#.....#...#.....#.....#...#.....#.....#.........#.....#.........#.....#...... +.##......##..##...####...######....#.........#.....#.....#.#.......#.....#...#.....#.....#...#.....#.....#.........#.....#.........#.....#.........#.....#...... +.##......##..##..#####...##..##....#.......###.....####....#.......####..#...#.....####..#####.....####..#.........####..####......####..####......####..####... +.##......##..##..##.##...##..##....#.........#.....#.......#.......#.....#...#.....#.....#...#.....#.....#.........#.....#.........#.....#.........#.....#...... +.##..##..##..##..######..##..##....#...#.#...#.....#.......#.......#.....#...#.....#.....#...#.....#.....#...#.....#.....#.........#.....#.........#.....#...... +.######..######.....##...######....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.....#.....#####.....#.....#.........#.....#...... +................................................................................................................................................................ +.######..######....###...######....#####.#####.....#####.#####.....#####.#####.....####..#####.....#####.#####.....#####.#####.....#####.#####.....####..####... +.##..##..##..##...####...##........#.....#.........#...#.#.........#...#.#.........#..##.#.........#.....#.........#...#.#...#.....#...#.#...#.....#..##.#..##.. +.##......##..##...####...##........#.....#............##.#.........#...#.#.........#...#.#.........#.....#............##....##.....#...#.#...#.....#...#.#...#.. +.##......##..##..#####...#####.....####..####.........#..####......#####.####......#...#.####......####..####.........#.....#......#####.#####.....#...#.#...#.. +.##......##..##..##.##...##........#.....#...........##..#.........#...#.#.........#...#.#.........#.....#...........##....##......#...#.#...#.....#...#.#...#.. +.##..##..##..##..######..##........#.....#...........##..#.........#...#.#.........#..##.#.........#.....#...........##....##......#...#.#...#.....#..##.#..##.. +.######..######.....##...######....#.....#...........#...#.........#####.#.........####..#.........#####.#...........#.....#.......#####.#####.....####..####... +................................................................................................................................................................ +.######..######..######..#####.....#####.#####.....#####.#####.....#####.#####.....#####.####......#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..###.....##........#.....#.........#.....#...#.....#.....#...#.....#.....#..##.....#.....#.........#.....#.........#.....#.........#...#.#...... +.##......##..##..######..######....#.....#.........#........##.....#.....#...#.....#.....#...#.....#.....#.........#.....#.........#.....#............##.#...... +.##......##..##......##..##..##....####..####......####.....#......####..#####.....####..#...#.....####..####......####..####......####..####.........#..####... +.##......##..##......##..##..##....#.....#.........#.......##......#.....#...#.....#.....#...#.....#.....#.........#.....#.........#.....#...........##..#...... +.##..##..##..##..##..##..##..##....#.....#.........#.......##......#.....#...#.....#.....#..##.....#.....#.........#.....#.........#.....#...........##..#...... +.######..######..######..######....#####.#####.....#.......#.......#.....#####.....#.....####......#.....#####.....#.....#.........#.....#...........#...#...... +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....####..#####.....#####.#####.....#####.#####.....#####.#####.....#####.####... +.##..##..##..##..###.....##........#...#.#.........#...#.#.........#...#.#.........#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...... +.##......##..##..######..##............#.#.........#...#.#.........#.....#.........#####....##.........#.....#.....#...#.#...#.....#.....#.........#.....#####.. +.##......##..##......##..#####.......###.####......#...#.####......#.....####......#...#....#........###...###.....#...#.#...#.....#.....#.........####..#...#.. +.##......##..##......##..##............#.#.........#####.#.........#.....#.........#...#...##..........#.....#.....#####.#####.....#.....#.........#.....#...#.. +.##..##..##..##..##..##..##........#...#.#.............#.#.........#...#.#.........#...#...##......#...#.#...#.........#.....#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#..........####.#.........#####.#.........#####...#.......#####.#####......####..####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..#####...#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##......##........#.....#...#.....#.....#...#.....#.....#...#.....#.....#.........#.....#.........#...#.#.........#...#.#.........##....#...... +.##......##..##..######..######....#.........#.....#.....#...#.....#.....#.........#.....#.........#.....#............##.#.........#...#.#.........#####.#...... +.##......##..##..##..##..##..##....####....###.....####..#...#.....####..#.........####..####......####..####.........#..####......#####.####..........#.####... +.##......##..##..##..##..##..##....#.........#.....#.....#####.....#.....#.........#.....#.........#.....#...........##..#.........#...#.#.............#.#...... +.##..##..##..##..##..##..##..##....#.....#...#.....#.........#.....#.....#...#.....#.....#.........#.....#...........##..#.........#...#.#.........#...#.#...... +.######..######..######..######....#.....#####.....#......####.....#.....#####.....#.....#####.....#.....#...........#...#.........#####.#.........#####.#...... +................................................................................................................................................................ +.######..######..#####...######......#...#####.....#####.#####.......#...#####.....#####.#####.......#.....#.......####..#####.....#####...#.......#####.#####.. +.##..##..##..##..##......##.........###..#.........##....#...#......###..#...#.....##....##.........###...###......#..##.##........#......###......#.....##..... +.##......##..##..######..##.........###..#.........#####....##......###..#...#.....#####.#####......###...###......#...#.#####.....#......###......#.....#####.. +.##......##..##..##..##..#####......#.#..####..........#....#.......#.#..#####.........#.....#......#.#...#.#......#...#.....#.....####...#.#......####......#.. +.##......##..##..##..##..##........#####.#.............#...##......#####.#...#.........#.....#.....#####.#####.....#...#.....#.....#.....#####.....#.........#.. +.##..##..##..##..##..##..##........##.##.#.........#...#...##......##.##.#...#.....#...#.#...#.....##.##.##.##.....#..##.#...#.....#.....##.##.....#.....#...#.. +.######..######..######..######....#...#.#.........#####...#.......#...#.#####.....#####.#####.....#...#.#...#.....####..#####.....#####.#...#.....#.....#####.. +................................................................................................................................................................ +.######..######..######..#####.....#####...#.......#####.####......#####.#####.....#####.#####.....#####.#####......##...#####.....#####.#####.....#####.#####.. +.##..##..##..##..#...##..##........#......###......#.....#..##.....#.....#.........#...#.#.........#...#.#.........###...#.........#...#.#.........#...#.#...#.. +.##......##..##.....###..######....#......###......#.....#...#.....#.....#............##.#.............#.#.........#.#...#.........#...#.#.........#...#....##.. +.##......##..##.....##...##..##....####...#.#......####..#...#.....####..####.........#..####........###.####........#...####......#...#.####......#...#....#... +.##......##..##....###...##..##....#.....#####.....#.....#...#.....#.....#...........##..#.............#.#...........#...#.........#...#.#.........#...#...##... +.##..##..##..##....###...##..##....#.....##.##.....#.....#..##.....#.....#...........##..#.........#...#.#...........#...#.........#...#.#.........#...#...##... +.######..######....##....######....#.....#...#.....#.....####......#.....#####.......#...#.........#####.#.........#####.#.........#####.#.........#####...#.... +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####..##.......#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..#...##..##........#...#.#...#.....#...#.###.......#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##.....###..##........#...#.....#.....#...#.#.#.......#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##.....##...#####.....#...#...###.....#...#...#.......#...#.#...#.....#####.#...#.....#.....#...#.....####..#...#.....####..#...#.....####..#####.. +.##......##..##....###...##........#...#.....#.....#...#...#.......#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##....###...##........#...#.#...#.....#...#...#.......#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.######..######....##....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ diff --git a/core/tests/test_roms.rs b/core/tests/test_roms.rs index 8cb2d45..f2a0f65 100644 --- a/core/tests/test_roms.rs +++ b/core/tests/test_roms.rs @@ -353,3 +353,11 @@ fn same_suite_channel_4_lfsr() { "../roms/same_suite/apu/channel_4/channel_4_lfsr.gb", ); } + +#[test] +fn same_suite_channel_4_lfsr15() { + test_rom( + Expected::from_file("tests/expects/same_suite_channel_4_lfsr15.txt"), + "../roms/same_suite/apu/channel_4/channel_4_lfsr15.gb", + ); +} From 4e2c91d724b3edcc2af33a7222a395149b3f96b6 Mon Sep 17 00:00:00 2001 From: YushiOMOTE Date: Wed, 31 Jul 2024 20:23:25 +0900 Subject: [PATCH 4/4] Add channel 4 lfsr mode flip rom tests --- README.md | 2 + core/src/apu/noise.rs | 5 + .../same_suite_channel_4_lfsr_15_7.txt | 144 ++++++++++++++++++ .../same_suite_channel_4_lfsr_7_15.txt | 144 ++++++++++++++++++ core/tests/test_roms.rs | 16 ++ 5 files changed, 311 insertions(+) create mode 100644 core/tests/expects/same_suite_channel_4_lfsr_15_7.txt create mode 100644 core/tests/expects/same_suite_channel_4_lfsr_7_15.txt diff --git a/README.md b/README.md index 1b47e5f..c336f03 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,8 @@ Test status of [Same Suite](https://github.com/YushiOMOTE/SameSuite/tree/430ab7f * [x] `apu/div_trigger_volume_10.gb` * [x] `apu/channel_4/channel_4_lfsr.gb` * [x] `apu/channel_4/channel_4_lfsr15.gb` +* [x] `apu/channel_4/channel_4_lfsr_7_15.gb` +* [x] `apu/channel_4/channel_4_lfsr_15_7.gb` ## Projects diff --git a/core/src/apu/noise.rs b/core/src/apu/noise.rs index 56b8a0e..4f27075 100644 --- a/core/src/apu/noise.rs +++ b/core/src/apu/noise.rs @@ -126,6 +126,7 @@ impl Noise { } self.nr43 = Nr43::from_bits(value); + self.lfsr.set_mode(self.nr43.step()); } /// Read NR44 register (0xff23) @@ -277,6 +278,10 @@ impl Lfsr { self.value = 0xff; } + fn set_mode(&mut self, short: bool) { + self.short = short; + } + fn update(&mut self) { // Xor bit 0 and 1. let bit = (self.value & 1) ^ ((self.value & 2) >> 1) & 1; diff --git a/core/tests/expects/same_suite_channel_4_lfsr_15_7.txt b/core/tests/expects/same_suite_channel_4_lfsr_15_7.txt new file mode 100644 index 0000000..7d18ce0 --- /dev/null +++ b/core/tests/expects/same_suite_channel_4_lfsr_15_7.txt @@ -0,0 +1,144 @@ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..##..##....####..#...#.....####..#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..######....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.....####..#...#.....####..#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######...###....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..####....##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..####....##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##....##....##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.. +.##......##..##....##....##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##....##....##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######...###....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..####....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##..####....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##....##....######....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.. +.##......##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##......##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##.....##...##..##....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.. +.##......##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##...##.....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##.....##...######....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.. +.##......##..##....##....##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##...##.....##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.. +.##......##..##......##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.. +.##......##..##....####..##..##....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.. +.##......##..##......##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.. +.######..######..######..######....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##....####..######....####..#...#.....####..#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##......##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######....###...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##...####...##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##...####...##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##..#####...##..##....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....####..#...#.. +.##......##..##..##.##...##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##..######..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.######..######.....##...######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######....###...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##...####...##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##...####...##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..#####...######....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.. +.##......##..##..##.##...##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..######..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.######..######.....##...######....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..###.....##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..######..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..###.....##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..######..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..######....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..#####...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##......##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..######..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..##..##..##..##....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.######..######..######..######....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..#####...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##......##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..######..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..##..##..######....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.######..######..######..######....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..#...##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##.....###..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##.....##...##..##....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.. +.##......##..##....###...##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##....###...##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.######..######....##....######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..#...##..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##.....###..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##.....##...######....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##....###...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##....###...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######....##....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ diff --git a/core/tests/expects/same_suite_channel_4_lfsr_7_15.txt b/core/tests/expects/same_suite_channel_4_lfsr_7_15.txt new file mode 100644 index 0000000..75da078 --- /dev/null +++ b/core/tests/expects/same_suite_channel_4_lfsr_7_15.txt @@ -0,0 +1,144 @@ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##..##..##..##..##....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....####..#...#.....####..#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.##......##..##..##..##..######....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....####..#...#.....#...#.#...#.. +.##......##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.######..######..######..######....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.....#####.#####.. +................................................................................................................................................................ +.######..######...###....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..####....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.##......##..##..####....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.##......##..##....##....##..##....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....####..#...#.....####..#...#.....####..#...#.....#...#.#...#.. +.##......##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.##..##..##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.....#.....#####.....#####.#####.. +................................................................................................................................................................ +.######..######...###....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..####....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..####....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##....##....######....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##.....##...##..##....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##....##....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##...##.....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##.....##...######....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##....##....##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##...##.....##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##....####..##..##....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##......##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##......##..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##....####..######....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##......##..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######....###...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##...####...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##...####...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..#####...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..##.##...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##..##..##..##..######..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.######..######.....##...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######....###...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##...####...##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##...####...##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..#####...######....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.. +.##......##..##..##.##...##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..######..##..##....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.. +.######..######.....##...######....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..###.....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..######..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##......##..##..##....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##......##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..###.....##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##..######..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##......##..##......##..######....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.....####..#...#.. +.##......##..##......##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#.....#...#.. +.######..######..######..######....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +.######..######..#####...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##......##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..######..##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##......##..##..##..##..##..##....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....####..#...#.. +.##......##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#.....#...#.. +.######..######..######..######....#####.#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.....#####.#####.....#.....#####.. +................................................................................................................................................................ +.######..######..#####...######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..##......##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..######..##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..##..##..######....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.##..##..##..##..##..##..##..##....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.. +.######..######..######..######....#####.#####.....#.....#####.....#####.#####.....#####.#####.....#####.#####.....#.....#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..#...##..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##.....###..##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##.....##...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##......##..##....###...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.##..##..##..##....###...##..##....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.....#...#.#...#.. +.######..######....##....######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +................................................................................................................................................................ +.######..######..######..######....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.....#####.#####.. +.##..##..##..##..#...##..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##.....###..##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##......##..##.....##...######....#...#.#...#.....####..#...#.....####..#...#.....#...#.#...#.....#...#.#...#.....####..#...#.....####..#...#.....####..#...#.. +.##......##..##....###...##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.##..##..##..##....###...##..##....#...#.#...#.....#.....#...#.....#.....#...#.....#...#.#...#.....#...#.#...#.....#.....#...#.....#.....#...#.....#.....#...#.. +.######..######....##....######....#####.#####.....#.....#####.....#.....#####.....#####.#####.....#####.#####.....#.....#####.....#.....#####.....#.....#####.. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ diff --git a/core/tests/test_roms.rs b/core/tests/test_roms.rs index f2a0f65..a970987 100644 --- a/core/tests/test_roms.rs +++ b/core/tests/test_roms.rs @@ -361,3 +361,19 @@ fn same_suite_channel_4_lfsr15() { "../roms/same_suite/apu/channel_4/channel_4_lfsr15.gb", ); } + +#[test] +fn same_suite_channel_4_lfsr_7_15() { + test_rom( + Expected::from_file("tests/expects/same_suite_channel_4_lfsr_7_15.txt"), + "../roms/same_suite/apu/channel_4/channel_4_lfsr_7_15.gb", + ); +} + +#[test] +fn same_suite_channel_4_lfsr_15_7() { + test_rom( + Expected::from_file("tests/expects/same_suite_channel_4_lfsr_15_7.txt"), + "../roms/same_suite/apu/channel_4/channel_4_lfsr_15_7.gb", + ); +}