Skip to content
Snippets Groups Projects
Verified Commit 2bba9622 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: added glob panning audio store

parent 64b9f06a
No related branches found
No related tags found
No related merge requests found
Pipeline #2455 passed
...@@ -76,6 +76,8 @@ pub struct Apu { ...@@ -76,6 +76,8 @@ pub struct Apu {
ch4_length_stop: bool, ch4_length_stop: bool,
ch4_enabled: bool, ch4_enabled: bool,
glob_panning: u8,
right_enabled: bool, right_enabled: bool,
left_enabled: bool, left_enabled: bool,
...@@ -149,6 +151,8 @@ impl Apu { ...@@ -149,6 +151,8 @@ impl Apu {
ch4_length_stop: false, ch4_length_stop: false,
ch4_enabled: false, ch4_enabled: false,
glob_panning: 0x0,
left_enabled: true, left_enabled: true,
right_enabled: true, right_enabled: true,
...@@ -232,6 +236,8 @@ impl Apu { ...@@ -232,6 +236,8 @@ impl Apu {
self.ch4_length_stop = false; self.ch4_length_stop = false;
self.ch4_enabled = false; self.ch4_enabled = false;
self.glob_panning = 0x0;
self.left_enabled = true; self.left_enabled = true;
self.right_enabled = true; self.right_enabled = true;
...@@ -302,9 +308,13 @@ impl Apu { ...@@ -302,9 +308,13 @@ impl Apu {
} }
pub fn read(&mut self, addr: u16) -> u8 { pub fn read(&mut self, addr: u16) -> u8 {
{ match addr {
warnln!("Reading from unknown APU location 0x{:04x}", addr); // 0xFF25 — NR51: Sound panning
0xff 0xff25 => self.glob_panning,
_ => {
warnln!("Reading from unknown APU location 0x{:04x}", addr);
0xff
}
} }
} }
...@@ -424,7 +434,7 @@ impl Apu { ...@@ -424,7 +434,7 @@ impl Apu {
} }
// 0xFF25 — NR51: Sound panning // 0xFF25 — NR51: Sound panning
0xff25 => { 0xff25 => {
//@TODO: Implement sound panning self.glob_panning = value;
} }
// 0xFF26 — NR52: Sound on/off // 0xFF26 — NR52: Sound on/off
0xff26 => { 0xff26 => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment