Compare commits
No commits in common. "0637b771e337a016a368054c1295f6a330b2e0c7" and "6265c8af047e0490ccf5c7bf6c4d9c78d428b594" have entirely different histories.
0637b771e3
...
6265c8af04
12
src/apu.rs
12
src/apu.rs
|
@ -44,8 +44,10 @@ impl BusIo for Apu {
|
||||||
0x17 => self.ch2.envelope(),
|
0x17 => self.ch2.envelope(),
|
||||||
0x19 => self.ch2.freq_hi(),
|
0x19 => self.ch2.freq_hi(),
|
||||||
0x1A => self.ch3.enabled(),
|
0x1A => self.ch3.enabled(),
|
||||||
|
0x1B => self.ch3.len(),
|
||||||
0x1C => self.ch3.volume(),
|
0x1C => self.ch3.volume(),
|
||||||
0x1E => self.ch3.freq_hi(),
|
0x1E => self.ch3.freq_hi(),
|
||||||
|
0x20 => self.ch4.len(),
|
||||||
0x21 => self.ch4.envelope(),
|
0x21 => self.ch4.envelope(),
|
||||||
0x22 => self.ch4.poly(),
|
0x22 => self.ch4.poly(),
|
||||||
0x23 => self.ch4.frequency(),
|
0x23 => self.ch4.frequency(),
|
||||||
|
@ -689,6 +691,11 @@ impl Channel3 {
|
||||||
self.enabled = (byte >> 7) & 0x01 == 0x01;
|
self.enabled = (byte >> 7) & 0x01 == 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 0xFF1B | NR31 - Sound Length
|
||||||
|
pub(crate) fn len(&self) -> u8 {
|
||||||
|
self.len | 0xFF
|
||||||
|
}
|
||||||
|
|
||||||
/// 0xFF1B | NR31 - Sound Length
|
/// 0xFF1B | NR31 - Sound Length
|
||||||
pub(crate) fn set_len(&mut self, byte: u8) {
|
pub(crate) fn set_len(&mut self, byte: u8) {
|
||||||
self.len = byte;
|
self.len = byte;
|
||||||
|
@ -799,6 +806,11 @@ pub(crate) struct Channel4 {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Channel4 {
|
impl Channel4 {
|
||||||
|
/// 0xFF20 | NR41 - Channel 4 Sound Length
|
||||||
|
pub(crate) fn len(&self) -> u8 {
|
||||||
|
self.len | 0xFF
|
||||||
|
}
|
||||||
|
|
||||||
/// 0xFF20 | NR41 - Channel 4 Sound Length
|
/// 0xFF20 | NR41 - Channel 4 Sound Length
|
||||||
pub(crate) fn set_len(&mut self, byte: u8) {
|
pub(crate) fn set_len(&mut self, byte: u8) {
|
||||||
self.len = byte & 0x3F;
|
self.len = byte & 0x3F;
|
||||||
|
|
|
@ -12,7 +12,6 @@ use crate::bus::BusIo;
|
||||||
use crate::cpu::{Cpu, Flags, HaltState, ImeState, Register as CpuRegister, RegisterPair};
|
use crate::cpu::{Cpu, Flags, HaltState, ImeState, Register as CpuRegister, RegisterPair};
|
||||||
|
|
||||||
#[allow(clippy::upper_case_acronyms)]
|
#[allow(clippy::upper_case_acronyms)]
|
||||||
#[derive(Clone, Copy)]
|
|
||||||
pub(crate) enum Instruction {
|
pub(crate) enum Instruction {
|
||||||
NOP,
|
NOP,
|
||||||
STOP,
|
STOP,
|
||||||
|
|
Loading…
Reference in New Issue