Skip to content

Commit 4e2c91d

Browse files
committed
Add channel 4 lfsr mode flip rom tests
1 parent 2c84ece commit 4e2c91d

File tree

5 files changed

+311
-0
lines changed

5 files changed

+311
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ Test status of [Same Suite](https://github.com/YushiOMOTE/SameSuite/tree/430ab7f
114114
* [x] `apu/div_trigger_volume_10.gb`
115115
* [x] `apu/channel_4/channel_4_lfsr.gb`
116116
* [x] `apu/channel_4/channel_4_lfsr15.gb`
117+
* [x] `apu/channel_4/channel_4_lfsr_7_15.gb`
118+
* [x] `apu/channel_4/channel_4_lfsr_15_7.gb`
117119

118120
## Projects
119121

core/src/apu/noise.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ impl Noise {
126126
}
127127

128128
self.nr43 = Nr43::from_bits(value);
129+
self.lfsr.set_mode(self.nr43.step());
129130
}
130131

131132
/// Read NR44 register (0xff23)
@@ -277,6 +278,10 @@ impl Lfsr {
277278
self.value = 0xff;
278279
}
279280

281+
fn set_mode(&mut self, short: bool) {
282+
self.short = short;
283+
}
284+
280285
fn update(&mut self) {
281286
// Xor bit 0 and 1.
282287
let bit = (self.value & 1) ^ ((self.value & 2) >> 1) & 1;

0 commit comments

Comments
 (0)