From 89b5e39850963aff981017ffcb0a9fe8fe2d8b20 Mon Sep 17 00:00:00 2001 From: YushiOMOTE Date: Sat, 20 Jul 2024 16:32:18 +0900 Subject: [PATCH 1/3] Overall refactoring to support ROM test 09, 10, 12 --- core/src/apu/clock_divider.rs | 38 ++-- core/src/apu/frame_sequencer.rs | 6 +- core/src/apu/length_counter.rs | 2 +- core/src/apu/mod.rs | 1 + core/src/apu/timer.rs | 5 + core/src/apu/tone.rs | 14 +- core/src/apu/util.rs | 22 --- core/src/apu/wave.rs | 162 +++++++++++++++--- core/src/apu/wave_buf.rs | 66 +++++++ .../tests/dmg_sound_09_wave_read_while_on.txt | 144 ++++++++++++++++ .../dmg_sound_10_wave_trigger_while_on.txt | 144 ++++++++++++++++ .../dmg_sound_12_wave_write_while_on.txt | 145 ++++++++++++++++ core/tests/test_roms.rs | 45 +++-- 13 files changed, 698 insertions(+), 96 deletions(-) create mode 100644 core/src/apu/wave_buf.rs create mode 100644 core/tests/dmg_sound_09_wave_read_while_on.txt create mode 100644 core/tests/dmg_sound_10_wave_trigger_while_on.txt create mode 100644 core/tests/dmg_sound_12_wave_write_while_on.txt diff --git a/core/src/apu/clock_divider.rs b/core/src/apu/clock_divider.rs index a2b4312..2605598 100644 --- a/core/src/apu/clock_divider.rs +++ b/core/src/apu/clock_divider.rs @@ -18,14 +18,14 @@ impl ClockDivider { self.source_clock_rate = source_clock_rate; } - pub fn step(&mut self, cycles: usize) -> bool { + pub fn step(&mut self, cycles: usize) -> usize { self.counter += cycles; - if self.counter >= self.interval() { - self.counter -= self.interval(); - true - } else { - false - } + + let times = self.counter / self.interval(); + + self.counter = self.counter % self.interval(); + + times } fn interval(&self) -> usize { @@ -39,20 +39,20 @@ fn test_clock_divider() { let mut divider = ClockDivider::new(2, 1); // 4 ticks -> 2 ticks - assert!(!divider.step(1)); - assert!(divider.step(1)); - assert!(!divider.step(1)); - assert!(divider.step(1)); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 1); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 1); divider.set_source_clock_rate(4); // 8 ticks -> 2 ticks - assert!(!divider.step(1)); - assert!(!divider.step(1)); - assert!(!divider.step(1)); - assert!(divider.step(1)); - assert!(!divider.step(1)); - assert!(!divider.step(1)); - assert!(!divider.step(1)); - assert!(divider.step(1)); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 1); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 0); + assert_eq!(divider.step(1), 1); } diff --git a/core/src/apu/frame_sequencer.rs b/core/src/apu/frame_sequencer.rs index 36d5bcf..c237ff6 100644 --- a/core/src/apu/frame_sequencer.rs +++ b/core/src/apu/frame_sequencer.rs @@ -34,9 +34,13 @@ impl FrameSequencer { } pub fn step(&mut self, cycles: usize) -> Option { - if !self.divider.step(cycles) { + let times = self.divider.step(cycles); + + if times == 0 { return None; } + // assert_eq!(times, 1); + let current_step = self.step; self.step = (self.step + 1) % 8; Some(current_step) diff --git a/core/src/apu/length_counter.rs b/core/src/apu/length_counter.rs index b2ecaad..2e76344 100644 --- a/core/src/apu/length_counter.rs +++ b/core/src/apu/length_counter.rs @@ -36,7 +36,7 @@ impl LengthCounter { // trigger, enable, freeze pub fn update(&mut self, trigger: bool, enable: bool) { - info!( + debug!( "trigger={}, enable={}: {:p}: {:?}", trigger, enable, self, self ); diff --git a/core/src/apu/mod.rs b/core/src/apu/mod.rs index f532fa8..3e0e1c2 100644 --- a/core/src/apu/mod.rs +++ b/core/src/apu/mod.rs @@ -16,6 +16,7 @@ mod timer; mod tone; mod util; mod wave; +mod wave_buf; pub struct Apu { tones: [Tone; 2], diff --git a/core/src/apu/timer.rs b/core/src/apu/timer.rs index 8afbcc3..11c13de 100644 --- a/core/src/apu/timer.rs +++ b/core/src/apu/timer.rs @@ -14,6 +14,11 @@ impl Timer { pub fn set_interval(&mut self, interval: usize) { self.interval = interval; + self.counter = 0; + } + + pub fn remaining(&self) -> usize { + self.interval.saturating_sub(self.counter) } pub fn tick(&mut self) -> bool { diff --git a/core/src/apu/tone.rs b/core/src/apu/tone.rs index f386eda..a7ef762 100644 --- a/core/src/apu/tone.rs +++ b/core/src/apu/tone.rs @@ -2,11 +2,7 @@ use log::*; use crate::hardware::Stream; -use super::{ - length_counter::LengthCounter, - sweep::Sweep, - util::{Envelop, WaveIndex}, -}; +use super::{length_counter::LengthCounter, sweep::Sweep, util::Envelop, wave_buf::WaveIndex}; #[derive(Debug, Clone)] pub struct Tone { @@ -174,7 +170,7 @@ impl ToneStream { Self { tone, env, - index: WaveIndex::new(), + index: WaveIndex::new(4_194_304, 8), } } @@ -215,8 +211,10 @@ impl Stream for ToneStream { _ => unreachable!(), }; - let index = self.index.index(rate, freq * 8, 8); - if index <= duty { + self.index.set_source_clock_rate(rate); + self.index.update_index(freq * 8); + + if self.index.index() <= duty { 0 } else { amp as u16 diff --git a/core/src/apu/util.rs b/core/src/apu/util.rs index 41a5623..2c2d066 100644 --- a/core/src/apu/util.rs +++ b/core/src/apu/util.rs @@ -31,28 +31,6 @@ impl AtomicHelper for AtomicBool { } } -pub struct WaveIndex { - clock: usize, - index: usize, -} - -impl WaveIndex { - pub fn new() -> Self { - Self { clock: 0, index: 0 } - } - - pub fn index(&mut self, rate: usize, freq: usize, max: usize) -> usize { - self.clock += freq; - - if self.clock >= rate { - self.clock -= rate; - self.index = (self.index + 1) % max; - } - - self.index - } -} - pub struct Envelop { amp: usize, count: usize, diff --git a/core/src/apu/wave.rs b/core/src/apu/wave.rs index 87d9f17..6573402 100644 --- a/core/src/apu/wave.rs +++ b/core/src/apu/wave.rs @@ -6,39 +6,50 @@ use log::*; use crate::hardware::Stream; use super::{ + clock_divider::ClockDivider, length_counter::LengthCounter, - util::{AtomicHelper, WaveIndex}, + timer::Timer, + util::AtomicHelper, + wave_buf::{WaveIndex, WaveRam}, }; #[derive(Debug, Clone)] pub struct Wave { - enable: bool, amp: u8, amp_shift: Arc, counter: LengthCounter, freq: Arc, freq_high: u8, - wavebuf: [u8; 16], + wave_ram: WaveRam, + index: usize, dac: bool, + divider: ClockDivider, + timer: Timer, + last_amp: u8, + first_fetch: bool, } impl Wave { pub fn new() -> Self { Self { - enable: false, amp: 0, amp_shift: Arc::new(AtomicUsize::new(0)), counter: LengthCounter::type256(), freq: Arc::new(AtomicUsize::new(0)), freq_high: 0, - wavebuf: [0; 16], + wave_ram: WaveRam::new(), + index: 0, dac: false, + divider: ClockDivider::new(4_194_304, 2_097_152), + timer: Timer::new(), + last_amp: 0, + first_fetch: false, } } /// Read NR30 register (0xff1a) pub fn read_enable(&self) -> u8 { - if self.enable { + if self.dac { 0xff } else { 0x7f @@ -47,7 +58,6 @@ impl Wave { /// Write NR30 register (0xff1a) pub fn write_enable(&mut self, value: u8) { - self.enable = value & 0x80 != 0; self.dac = value & 0x80 != 0; if !self.dac { self.counter.deactivate(); @@ -100,19 +110,38 @@ impl Wave { self.freq .set((self.freq.get() & !0x700) | (((value & 0x7) as usize) << 8)); let trigger = value & 0x80 != 0; - let enable = value & 0x40 != 0; - self.counter.update(trigger, enable); + let length_enable = value & 0x40 != 0; + let retrigger = self.counter.is_active(); + self.counter.update(trigger, length_enable); + if self.dac && trigger { + if retrigger && !self.first_fetch { + // Advance one tick on retrigger + self.timer.tick(); + self.alter_waveram(); + } + + self.load_initial_timer(); + + self.index = 0; + self.first_fetch = true; + } trigger } /// Read wave pattern buffer pub fn read_wave_buf(&self, offset: u16) -> u8 { - self.wavebuf[offset as usize - 0xff30] + let value = match self.adjust_waveram_index(offset - 0xff30) { + Some(index) => self.wave_ram.read_byte(index), + None => 0xff, + }; + value } /// Write wave pattern buffer pub fn write_wave_buf(&mut self, offset: u16, value: u8) { - self.wavebuf[offset as usize - 0xff30] = value; + if let Some(index) = self.adjust_waveram_index(offset - 0xff30) { + self.wave_ram.write_byte(index, value); + } } /// Create stream from the current data @@ -122,6 +151,97 @@ impl Wave { pub fn step(&mut self, cycles: usize) { self.counter.step(cycles); + + let times = self.divider.step(cycles); + + for _ in 0..times { + self.update(); + } + } + + fn adjust_waveram_index(&self, cpu_index: u16) -> Option { + let apu_index = (self.index as u16) / 2; + + if self.is_active() { + if !self.first_fetch && self.is_sampling() { + Some(apu_index) + } else { + None + } + } else { + Some(cpu_index) + } + } + + fn alter_waveram(&mut self) { + if !self.is_sampling() { + return; + } + + let byte_offset = (self.index as u16 + 1) % 32 / 2; + + match byte_offset { + 0..=3 => { + let byte = self.wave_ram.read_byte(byte_offset); + self.wave_ram.write_byte(0, byte); + } + 4..=15 => { + for i in 0..4 { + let byte = self.wave_ram.read_byte((byte_offset / 4) * 4 + i); + self.wave_ram.write_byte(i, byte); + } + } + _ => unreachable!(), + } + } + + fn is_sampling(&self) -> bool { + // Timer tick is 2 cycles. 2 ticks means 4 cycles. + // Having this in CPU instruction means the instraction is happening + // at the same time that APU is reading a sample from the Wave RAM. + self.timer.remaining() == 2 + } + + fn update(&mut self) { + if !self.is_active() { + return; + } + if !self.timer.tick() { + return; + } + + self.reload_timer(); + + let amp = if self.first_fetch { + self.first_fetch = false; + self.last_amp + } else { + let new_amp = self.wave_ram.read_waveform(self.index); + self.last_amp = new_amp; + new_amp + }; + + self.index = (self.index + 1) % self.wave_ram.waveform_length(); + + let _amp = match self.amp_shift.get() { + 0 => 0, + 1 => amp, + 2 => amp >> 1, + 3 => amp >> 2, + _ => unreachable!(), + }; + } + + fn load_initial_timer(&mut self) { + self.timer.set_interval(self.timer_interval() + 3); + } + + fn reload_timer(&mut self) { + self.timer.set_interval(self.timer_interval()); + } + + fn timer_interval(&self) -> usize { + 2048 - self.freq.get() } pub fn is_active(&self) -> bool { @@ -130,7 +250,7 @@ impl Wave { pub fn clear(&mut self) { let mut wave = Wave::new(); - core::mem::swap(&mut wave.wavebuf, &mut self.wavebuf); + core::mem::swap(&mut wave.wave_ram, &mut self.wave_ram); core::mem::swap(self, &mut wave); } } @@ -145,10 +265,12 @@ impl WaveStream { fn new(wave: Wave) -> Self { let counter = wave.counter.clone(); + let wave_length = wave.wave_ram.waveform_length(); + Self { wave, counter, - index: WaveIndex::new(), + index: WaveIndex::new(4_194_304, wave_length), } } } @@ -159,7 +281,7 @@ impl Stream for WaveStream { } fn next(&mut self, rate: u32) -> u16 { - if !self.wave.enable { + if !self.wave.is_active() { return 0; } @@ -171,16 +293,14 @@ impl Stream for WaveStream { return 0; } - let samples = self.wave.wavebuf.len() * 2; + let samples = self.wave.wave_ram.waveform_length(); let freq = 65536 / (2048 - self.wave.freq.get()); let index_freq = freq * samples; - let index = self.index.index(rate, index_freq, samples); - let amp = if index % 2 == 0 { - self.wave.wavebuf[index / 2] >> 4 - } else { - self.wave.wavebuf[index / 2] & 0xf - }; + self.index.set_source_clock_rate(rate); + self.index.update_index(index_freq); + + let amp = self.wave.wave_ram.read_waveform(self.index.index()); let amp = match self.wave.amp_shift.get() { 0 => 0, diff --git a/core/src/apu/wave_buf.rs b/core/src/apu/wave_buf.rs new file mode 100644 index 0000000..a3a05b5 --- /dev/null +++ b/core/src/apu/wave_buf.rs @@ -0,0 +1,66 @@ +#[derive(Debug, Clone)] +pub struct WaveRam { + ram: [u8; 16], +} + +impl WaveRam { + pub fn new() -> Self { + Self { ram: [0; 16] } + } + + pub fn read_byte(&self, offset: u16) -> u8 { + self.ram[offset as usize] + } + + pub fn write_byte(&mut self, offset: u16, value: u8) { + self.ram[offset as usize] = value; + } + + pub fn read_waveform(&self, index: usize) -> u8 { + if index % 2 == 0 { + self.ram[index / 2] >> 4 + } else { + self.ram[index / 2] & 0xf + } + } + + pub fn waveform_length(&self) -> usize { + self.ram.len() * 2 + } +} + +#[derive(Debug, Clone)] +pub struct WaveIndex { + source_clock_rate: usize, + clock: usize, + index: usize, + length: usize, +} + +impl WaveIndex { + pub fn new(source_clock_rate: usize, length: usize) -> Self { + Self { + source_clock_rate, + clock: 0, + index: 0, + length, + } + } + + pub fn index(&self) -> usize { + self.index + } + + pub fn set_source_clock_rate(&mut self, source_clock_rate: usize) { + self.source_clock_rate = source_clock_rate; + } + + pub fn update_index(&mut self, freq: usize) { + self.clock += freq; + + if self.clock >= self.source_clock_rate { + self.clock -= self.source_clock_rate; + self.index = (self.index + 1) % self.length; + } + } +} diff --git a/core/tests/dmg_sound_09_wave_read_while_on.txt b/core/tests/dmg_sound_09_wave_read_while_on.txt new file mode 100644 index 0000000..6cc9467 --- /dev/null +++ b/core/tests/dmg_sound_09_wave_read_while_on.txt @@ -0,0 +1,144 @@ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +..####....####...............................................................................##..................##........##.....###........................... +.##..##..##..##..............................................................................##..................##................##........................... +.##.###..##..##.........##...##...####...##..##...####...........#####....####....####....#####.........##...##..#####....###......##.....####............####.. +.###.##...#####..######.##...##......##..##..##..##..##..........##..##..##..##......##..##..##.........##...##..##..##....##......##....##..##..........##..##. +.##..##......##.........##.#.##...#####..##..##..######..........##......######...#####..##..##.........##.#.##..##..##....##......##....######..........##..##. +.##..##.....##...........#####...##..##...####...##..............##......##......##..##..##..##..........#####...##..##....##......##....##..............##..##. +..####....###............##.##....#####....##.....####...........##.......####....#####...#####..........##.##...##..##...####....####....####............####.. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +.#####.......................................................................................................................................................... +.##..##......................................................................................................................................................... +.##..##......................................................................................................................................................... +.##..##......................................................................................................................................................... +.##..##......................................................................................................................................................... +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +.######..######..........######..######...........####....####...........######..######............##......##............######..######............##......##... +.##......##..............##......##..............##..##..##..##..........##......##...............###.....###............##......##...............###.....###... +.##......##..............##......##..............##.###..##.###..........##......##................##......##............##......##................##......##... +.#####...#####...........#####...#####...........###.##..###.##..........#####...#####.............##......##............#####...#####.............##......##... +.##......##..............##......##..............##..##..##..##..........##......##................##......##............##......##................##......##... +.##......##..............##......##..............##..##..##..##..........##......##................##......##............##......##................##......##... +.##......##..............##......##...............####....####...........##......##..............######..######..........##......##..............######..######. +................................................................................................................................................................ +.######..######...........####....####...........######..######...........####....####...........######..######..........######..######..........######..######. +.##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##.................##......##...........##......##..... +.##......##..................##......##..........##......##..................##......##..........##......##................##......##............##......##..... +.#####...#####..............##......##...........#####...#####..............##......##...........#####...#####..............##......##...........#####...#####.. +.##......##................##......##............##......##................##......##............##......##..................##......##..........##......##..... +.##......##...............##......##.............##......##...............##......##.............##......##..............##..##..##..##..........##......##..... +.##......##..............######..######..........##......##..............######..######..........##......##...............####....####...........##......##..... +................................................................................................................................................................ +.######..######..........######..######.............##......##...........######..######.............##......##...........######..######..........######..######. +....##......##...........##......##................###.....###...........##......##................###.....###...........##......##..............##......##..... +...##......##............##......##...............####....####...........##......##...............####....####...........##......##..............#####...#####.. +....##......##...........#####...#####...........##.##...##.##...........#####...#####...........##.##...##.##...........#####...#####...............##......##. +.....##......##..........##......##..............######..######..........##......##..............######..######..........##......##..................##......##. +.##..##..##..##..........##......##.................##......##...........##......##.................##......##...........##......##..............##..##..##..##. +..####....####...........##......##.................##......##...........##......##.................##......##...........##......##...............####....####.. +................................................................................................................................................................ +.######..######..........######..######..........######..######...........####....####...........######..######...........####....####...........######..######. +.##......##..............##......##..............##......##..............##......##..............##......##..............##......##..............##......##..... +.##......##..............#####...#####...........##......##..............##......##..............##......##..............##......##..............##......##..... +.#####...#####...............##......##..........#####...#####...........#####...#####...........#####...#####...........#####...#####...........#####...#####.. +.##......##..................##......##..........##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..... +.##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..... +.##......##...............####....####...........##......##...............####....####...........##......##...............####....####...........##......##..... +................................................................................................................................................................ +.######..######..........######..######..........######..######..........######..######...........####....####...........######..######...........####....####.. +.....##......##..........##......##..................##......##..........##......##..............##..##..##..##..........##......##..............##..##..##..##. +....##......##...........##......##.................##......##...........##......##..............##..##..##..##..........##......##..............##..##..##..##. +...##......##............#####...#####.............##......##............#####...#####............####....####...........#####...#####............####....####.. +..##......##.............##......##...............##......##.............##......##..............##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##......##...............##......##.............##......##..............##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##......##...............##......##.............##......##...............####....####...........##......##...............####....####.. +................................................................................................................................................................ +.######..######...........####....####...........######..######...........####....####...........######..######............##......##............######..######. +.##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##...............####....####...........##......##..... +.##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..... +.#####...#####............#####...#####..........#####...#####............#####...#####..........#####...#####...........##..##..##..##..........#####...#####.. +.##......##..................##......##..........##......##..................##......##..........##......##..............######..######..........##......##..... +.##......##.................##......##...........##......##.................##......##...........##......##..............##..##..##..##..........##......##..... +.##......##...............###.....###............##......##...............###.....###............##......##..............##..##..##..##..........##......##..... +................................................................................................................................................................ +...##......##............######..######..........#####...#####...........######..######..........#####...#####...........######..######...........####....####.. +..####....####...........##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..............##..##..##..##. +.##..##..##..##..........##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..............##......##..... +.##..##..##..##..........#####...#####...........#####...#####...........#####...#####...........#####...#####...........#####...#####...........##......##..... +.######..######..........##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..............##......##..... +.##..##..##..##..........##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..............##..##..##..##. +.##..##..##..##..........##......##..............#####...#####...........##......##..............#####...#####...........##......##...............####....####.. +................................................................................................................................................................ +.######..######...........####....####...........######..######..........####....####............######..######..........####....####............######..######. +.##......##..............##..##..##..##..........##......##..............##.##...##.##...........##......##..............##.##...##.##...........##......##..... +.##......##..............##......##..............##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..... +.#####...#####...........##......##..............#####...#####...........##..##..##..##..........#####...#####...........##..##..##..##..........#####...#####.. +.##......##..............##......##..............##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##..... +.##......##..............##..##..##..##..........##......##..............##.##...##.##...........##......##..............##.##...##.##...........##......##..... +.##......##...............####....####...........##......##..............####....####............##......##..............####....####............##......##..... +................................................................................................................................................................ +.######..######..........######..######..........######..######..........######..######..........######..######..........######..######..........######..######. +.##......##..............##......##..............##......##..............##......##..............##......##..............##......##..............##......##..... +.##......##..............##......##..............##......##..............##......##..............##......##..............##......##..............##......##..... +.#####...#####...........#####...#####...........#####...#####...........#####...#####...........#####...#####...........#####...#####...........#####...#####.. +.##......##..............##......##..............##......##..............##......##..............##......##..............##......##..............##......##..... +.##......##..............##......##..............##......##..............##......##..............##......##..............##......##..............##......##..... +.######..######..........##......##..............######..######..........##......##..............##......##..............##......##..............##......##..... +................................................................................................................................................................ +.######..######...........####....####...........######..######...........####....####...........######..######............##......##........................... +.##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##...............###.....###........................... +.##......##..............##.###..##.###..........##......##..............##.###..##.###..........##......##................##......##........................... +.#####...#####...........###.##..###.##..........#####...#####...........###.##..###.##..........#####...#####.............##......##........................... +.##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##................##......##........................... +.##......##..............##..##..##..##..........##......##..............##..##..##..##..........##......##................##......##........................... +.##......##...............####....####...........##......##...............####....####...........##......##..............######..######......................... +................................................................................................................................................................ +.#####.......................................##................................................................................................................. +.##..##......................................##................................................................................................................. +.##..##...####....#####...#####...####....#####................................................................................................................. +.#####.......##..##......##......##..##..##..##................................................................................................................. +.##.......#####...####....####...######..##..##................................................................................................................. +.##......##..##......##......##..##......##..##................................................................................................................. +.##.......#####..#####...#####....####....#####................................................................................................................. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ diff --git a/core/tests/dmg_sound_10_wave_trigger_while_on.txt b/core/tests/dmg_sound_10_wave_trigger_while_on.txt new file mode 100644 index 0000000..281cd55 --- /dev/null +++ b/core/tests/dmg_sound_10_wave_trigger_while_on.txt @@ -0,0 +1,144 @@ +..####....####.............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..##..##..##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.###..##.###............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.###.##..###.##............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##..##..##..##............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##..##..##..##............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +..####....####...........######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +..####....####.............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..##..##..##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.###..##.###............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.###.##..###.##............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##..##..##..##............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##..##..##..##............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +..####....####...........######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +..####....####.............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..##..##..##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.###..##.###............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.###.##..###.##............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##..##..##..##............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##..##..##..##............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +..####....####...........######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +...##......##..............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +..###.....###.............###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +...##......##..............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +...##......##..............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +...##......##..............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +...##......##..............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +.######..######..........######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +..####....####.............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..##..##..##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.###..##.###............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.###.##..###.##............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##..##..##..##............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##..##..##..##............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +..####....####...........######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +.#####.......................................##................................................................................................................. +.##..##......................................##................................................................................................................. +.##..##...####....#####...#####...####....#####................................................................................................................. +.#####.......##..##......##......##..##..##..##................................................................................................................. +.##.......#####...####....####...######..##..##................................................................................................................. +.##......##..##......##......##..##......##..##................................................................................................................. +.##.......#####..#####...#####....####....#####................................................................................................................. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ diff --git a/core/tests/dmg_sound_12_wave_write_while_on.txt b/core/tests/dmg_sound_12_wave_write_while_on.txt new file mode 100644 index 0000000..52d9382 --- /dev/null +++ b/core/tests/dmg_sound_12_wave_write_while_on.txt @@ -0,0 +1,145 @@ +.######..######............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..........##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.........##.............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.#####.....##..............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##.......##...............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##.......##...............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +.##.......##.............######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +..####....####.............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..##..##..##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.###..##.###............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.###.##..###.##............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##..##..##..##............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##..##..##..##............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +..####....####...........######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +.######..######............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..........##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.........##.............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.#####.....##..............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##.......##...............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##.......##...............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +.##.......##.............######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +..####....####.............##......##.............####....####...........######..######.............##......##...........######..######...........####....####.. +.##..##..##..##...........###.....###............##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.###..##.###............##......##................##......##............##......##.............####....####...........#####...#####...........##......##..... +.###.##..###.##............##......##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##..##..##..##............##......##..............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##..##..##..##............##......##.............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +..####....####...........######..######..........######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +..####....####...........######..######...........####....####...........######..######.............##......##...........######..######...........####....####.. +.##..##..##..##..........##..........##..........##..##..##..##.............##......##.............###.....###...........##......##..............##......##..... +.##.###..##.###..........##.........##...............##......##............##......##.............####....####...........#####...#####...........##......##..... +.###.##..###.##..........#####.....##...............##......##..............##......##...........##.##...##.##...............##......##..........#####...#####.. +.##..##..##..##..........##.......##...............##......##................##......##..........######..######..............##......##..........##..##..##..##. +.##..##..##..##..........##.......##..............##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##. +..####....####...........##.......##.............######..######...........####....####..............##......##............####....####............####....####.. +................................................................................................................................................................ +.######..######...........####....####............####....####.............##......##............#####...#####............####....####...........####....####... +.....##......##..........##..##..##..##..........##..##..##..##...........####....####...........##..##..##..##..........##..##..##..##..........##.##...##.##.. +....##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##..##..##..##..........##......##..............##..##..##..##. +...##......##.............####....####............#####...#####..........##..##..##..##..........#####...#####...........##......##..............##..##..##..##. +..##......##.............##..##..##..##..............##......##..........######..######..........##..##..##..##..........##......##..............##..##..##..##. +..##......##.............##..##..##..##.............##......##...........##..##..##..##..........##..##..##..##..........##..##..##..##..........##.##...##.##.. +..##......##..............####....####............###.....###............##..##..##..##..........#####...#####............####....####...........####....####... +................................................................................................................................................................ +.######..######..........######..######......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.#####...#####...........#####...#####.......................................................................................................................... +.##......##..............##......##............................................................................................................................. +.##......##..............##......##............................................................................................................................. +.######..######..........##......##............................................................................................................................. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +.#####.......................................##................................................................................................................. +.##..##......................................##................................................................................................................. +.##..##...####....#####...#####...####....#####................................................................................................................. +.#####.......##..##......##......##..##..##..##................................................................................................................. +.##.......#####...####....####...######..##..##................................................................................................................. +.##......##..##......##......##..##......##..##................................................................................................................. +.##.......#####..#####...#####....####....#####................................................................................................................. +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ +................................................................................................................................................................ + diff --git a/core/tests/test_roms.rs b/core/tests/test_roms.rs index 53107ca..3c2c0a4 100644 --- a/core/tests/test_roms.rs +++ b/core/tests/test_roms.rs @@ -254,23 +254,21 @@ fn dmg_sound_08_len_ctr_during_power() { ); } -// TODO: Fix APU -// #[test] -// fn dmg_sound_09_wave_read_while_on() { -// test_rom( -// Expected::from_file("tests/dmg_sound_01_registers.txt"), -// "../roms/dmg_sound/rom_singles/09-wave read while on.gb", -// ); -// } +#[test] +fn dmg_sound_09_wave_read_while_on() { + test_rom( + Expected::from_file("tests/dmg_sound_09_wave_read_while_on.txt"), + "../roms/dmg_sound/rom_singles/09-wave read while on.gb", + ); +} -// TODO: Fix APU -// #[test] -// fn dmg_sound_10_wave_trigger_while_on() { -// test_rom( -// Expected::from_file("tests/dmg_sound_01_registers.txt"), -// "../roms/dmg_sound/rom_singles/10-wave trigger while on.gb", -// ); -// } +#[test] +fn dmg_sound_10_wave_trigger_while_on() { + test_rom( + Expected::from_file("tests/dmg_sound_10_wave_trigger_while_on.txt"), + "../roms/dmg_sound/rom_singles/10-wave trigger while on.gb", + ); +} // TODO: Fix APU // #[test] @@ -281,11 +279,10 @@ fn dmg_sound_08_len_ctr_during_power() { // ); // } -// TODO: Fix APU -// #[test] -// fn dmg_sound_12_wave_write_while_on() { -// test_rom( -// Expected::from_file("tests/dmg_sound_01_registers.txt"), -// "../roms/dmg_sound/rom_singles/12-wave write while on.gb", -// ); -// } +#[test] +fn dmg_sound_12_wave_write_while_on() { + test_rom( + Expected::from_file("tests/dmg_sound_12_wave_write_while_on.txt"), + "../roms/dmg_sound/rom_singles/12-wave write while on.gb", + ); +} From 96867c381d15dff4b15b1a122bc21ae75b0b756e Mon Sep 17 00:00:00 2001 From: YushiOMOTE Date: Sun, 21 Jul 2024 20:08:11 +0900 Subject: [PATCH 2/3] Update readme to include new tests --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af814d4..a7da828 100644 --- a/README.md +++ b/README.md @@ -98,10 +98,10 @@ Test status of [Blargg's Gameboy hardware test ROMs](https://github.com/retrio/g * [x] `06-overflow on trigger` * [x] `07-len sweep period sync` * [x] `08-len ctr during power` - * [ ] `09-wave read while on` - * [ ] `10-wave trigger while on` + * [x] `09-wave read while on` + * [x] `10-wave trigger while on` * [ ] `11-regs after power` - * [ ] `12-wave write while on` + * [x] `12-wave write while on` * [ ] `cgb_sound` ## Projects From 077e44c75062d7e44b56490f8bb30ee8d729cec6 Mon Sep 17 00:00:00 2001 From: YushiOMOTE Date: Sun, 21 Jul 2024 20:20:13 +0900 Subject: [PATCH 3/3] Use release build in cargo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65fb6d0..ccb8d5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,4 +32,4 @@ jobs: - run: cargo clippy --workspace --examples --tests --benches - run: cargo build --verbose - run: cargo build --verbose --examples - - run: cargo test --verbose + - run: cargo test --release --verbose