feat(snd): implement audio playback using rodio
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-07-09 01:25:52 -05:00
parent 0fa818a1a6
commit ce630baa5d
8 changed files with 141 additions and 7 deletions

View File

@@ -4,11 +4,12 @@ use crate::joypad;
use crate::ppu::Ppu;
use anyhow::Result;
use gilrs::Gilrs;
use rodio::OutputStreamHandle;
use std::time::Duration;
pub const SM83_CYCLE_TIME: Duration = Duration::from_nanos(1_000_000_000 / SM83_CLOCK_SPEED);
pub const CYCLES_IN_FRAME: Cycle = Cycle::new(456 * 154); // 456 Cycles times 154 scanlines
const SM83_CLOCK_SPEED: u64 = 0x40_0000; // Hz which is 4.194304Mhz
pub(crate) const SM83_CLOCK_SPEED: u64 = 0x40_0000; // Hz which is 4.194304Mhz
const DEFAULT_TITLE: &str = "DMG-01 Emulator";
pub fn init(boot_path: Option<&str>, rom_path: &str) -> Result<SM83> {