Skip to content

Commit

Permalink
S-DSP: mirrors above 0x80 are read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
twvd committed May 20, 2024
1 parent 15d5896 commit 360cdb7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/snes/apu/apubus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Bus<SpcAddress> for Apubus {
// DSP register address
0x00F2 => self.dsp_addr as u8,
// DSP data out
0x00F3 => self.dsp_stub[self.dsp_addr],
0x00F3 => self.dsp_stub[self.dsp_addr & 0x7F],
// Ports
0x00F4..=0x00F7 => {
let ports = self.ports.read().unwrap();
Expand Down Expand Up @@ -115,9 +115,13 @@ impl Bus<SpcAddress> for Apubus {
}
}
// DSP register address
0x00F2 => self.dsp_addr = usize::from(val & 0x7F),
0x00F2 => self.dsp_addr = usize::from(val),
// DSP data out
0x00F3 => self.dsp_stub[self.dsp_addr] = val,
0x00F3 => {
if self.dsp_addr < 0x80 {
self.dsp_stub[self.dsp_addr] = val;
}
}
// Ports
0x00F4..=0x00F7 => {
let mut ports = self.ports.write().unwrap();
Expand Down

0 comments on commit 360cdb7

Please sign in to comment.