fix: convert sound.rs structs to bitfields

This commit is contained in:
2021-03-15 21:16:11 -05:00
parent 61fd63bb45
commit 8989d3f1d7
4 changed files with 211 additions and 138 deletions

View File

@@ -120,9 +120,9 @@ impl Bus {
0xFF0F => self.interrupt.flag.into(),
0xFF11 => self.sound.ch1.sound_duty.into(),
0xFF12 => self.sound.ch1.vol_envelope.into(),
0xFF14 => self.sound.ch1.freq.get_hi(),
0xFF14 => self.sound.ch1.freq_hi.into(),
0xFF24 => self.sound.control.channel.into(),
0xFF25 => self.sound.control.select.into(),
0xFF25 => self.sound.control.output.into(),
0xFF26 => self.sound.control.status.into(),
0xFF40 => self.ppu.lcd_control.into(),
0xFF41 => self.ppu.stat.into(),
@@ -200,10 +200,10 @@ impl Bus {
0xFF0F => self.interrupt.flag = byte.into(),
0xFF11 => self.sound.ch1.sound_duty = byte.into(),
0xFF12 => self.sound.ch1.vol_envelope = byte.into(),
0xFF13 => self.sound.ch1.freq.set_lo(byte),
0xFF14 => self.sound.ch1.freq.set_hi(byte),
0xFF13 => self.sound.ch1.freq_lo = byte.into(),
0xFF14 => self.sound.ch1.freq_hi = byte.into(),
0xFF24 => self.sound.control.channel = byte.into(),
0xFF25 => self.sound.control.select = byte.into(),
0xFF25 => self.sound.control.output = byte.into(),
0xFF26 => self.sound.control.status = byte.into(), // FIXME: Should we control which bytes are written to here?
0xFF40 => self.ppu.lcd_control = byte.into(),
0xFF41 => self.ppu.stat = byte.into(),