feat: schedule audio sampling on scheduler

DMA sound in games like Pokemon Emerald, Chobits, Love Hina, and Kirby:
Nightmare in Dream Land sound great save for conerns about resampling
This commit is contained in:
2022-04-14 05:58:32 -03:00
parent 92cabd248b
commit 172a59aefb
6 changed files with 67 additions and 69 deletions

View File

@@ -109,13 +109,7 @@ fn Timer(comptime id: u2) type {
// DMA Sound Things
if (id == 0 or id == 1) {
const apu = &cpu.bus.apu;
const a_tim = @boolToInt(apu.dma_cnt.sa_timer.read());
const b_tim = @boolToInt(apu.dma_cnt.sb_timer.read());
if (a_tim == id) apu.handleTimerOverflow(.A, cpu);
if (b_tim == id) apu.handleTimerOverflow(.B, cpu);
cpu.bus.apu.handleTimerOverflow(cpu, id);
}
// Perform Cascade Behaviour