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

fix: supprt for envelope in channel 2 and 4

The all trigger was missing calls to channel 2 and 4.
parent c3f152db
No related branches found
Tags 0.8.0
1 merge request!21Initial working version of Audio CH4
Pipeline #2451 passed
......@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
* Support for Audio Channel 4 (Noise) 🔈
* Support for audio channel 4 (noise) 🔈
### Changed
......@@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
*
* Envelope support for both channel 2 and 4
## [0.7.3] - 2023-04-02
......
......@@ -69,7 +69,6 @@ pub struct Apu {
ch4_pace: u8,
ch4_direction: u8,
ch4_volume: u8,
ch4_output_level: u8,
ch4_divisor: u8,
ch4_width_mode: bool,
ch4_clock_shift: u8,
......@@ -143,7 +142,6 @@ impl Apu {
ch4_pace: 0x0,
ch4_direction: 0x0,
ch4_volume: 0x0,
ch4_output_level: 0x0,
ch4_divisor: 0x0,
ch4_width_mode: false,
ch4_clock_shift: 0x0,
......@@ -227,7 +225,6 @@ impl Apu {
self.ch4_pace = 0x0;
self.ch4_direction = 0x0;
self.ch4_volume = 0x0;
self.ch4_output_level = 0x0;
self.ch4_divisor = 0x0;
self.ch4_width_mode = false;
self.ch4_clock_shift = 0x0;
......@@ -401,6 +398,8 @@ impl Apu {
self.ch4_pace = value & 0x07;
self.ch4_direction = (value & 0x08) >> 3;
self.ch4_volume = (value & 0xf0) >> 4;
self.ch4_envelope_enabled = self.ch4_pace > 0;
self.ch4_envelope_sequence = 0;
}
// 0xFF22 — NR43: Channel 4 frequency & randomness
0xff22 => {
......@@ -521,6 +520,8 @@ impl Apu {
#[inline(always)]
fn tick_envelope_all(&mut self) {
self.tick_envelope(Channel::Ch1);
self.tick_envelope(Channel::Ch2);
self.tick_envelope(Channel::Ch4);
}
#[inline(always)]
......
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