Compare commits
No commits in common. "53dfaf0de2c8e001986b72d4d46506b4607b0891" and "79be38a1e69e5ee1dc9a1db02612ff41f8521c9d" have entirely different histories.
53dfaf0de2
...
79be38a1e6
|
@ -3,7 +3,7 @@ use rtrb::{Consumer, Producer, PushError, RingBuffer};
|
|||
|
||||
pub(crate) const SAMPLE_RATE: u32 = 48000; // Hz
|
||||
const CHANNEL_COUNT: usize = 2;
|
||||
const BUFFER_CAPACITY: usize = 2048 * CHANNEL_COUNT; // # of samples * the # of channels
|
||||
const BUFFER_CAPACITY: usize = 512 * CHANNEL_COUNT; // # of samples * the # of channels
|
||||
|
||||
pub struct AudioSPSC<T> {
|
||||
inner: RingBuffer<T>,
|
||||
|
@ -43,7 +43,6 @@ impl<T> SampleProducer<T> {
|
|||
self.inner.push(value)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn available(&self) -> bool {
|
||||
self.inner.slots() > 2
|
||||
}
|
||||
|
|
11
src/bus.rs
11
src/bus.rs
|
@ -374,6 +374,17 @@ impl BusIo for Bus {
|
|||
}
|
||||
}
|
||||
|
||||
impl Bus {
|
||||
pub(crate) fn read_word(&self, addr: u16) -> u16 {
|
||||
(self.read_byte(addr + 1) as u16) << 8 | self.read_byte(addr) as u16
|
||||
}
|
||||
|
||||
pub(crate) fn write_word(&mut self, addr: u16, word: u16) {
|
||||
self.write_byte(addr + 1, (word >> 8) as u8);
|
||||
self.write_byte(addr, (word & 0x00FF) as u8);
|
||||
}
|
||||
}
|
||||
|
||||
impl Bus {
|
||||
fn interrupt_flag(&self) -> InterruptFlag {
|
||||
// Read the current interrupt information from the PPU
|
||||
|
|
Loading…
Reference in New Issue