From 8a0bf29dd894b1cb19c0b8d4278859ada2802b1a Mon Sep 17 00:00:00 2001 From: gm-matthew <108370479+gm-matthew@users.noreply.github.com> Date: Mon, 20 May 2024 13:38:45 +0100 Subject: [PATCH] Sound IRQs are acknowledged by writing to MIDI data port --- Src/Model3/Model3.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Src/Model3/Model3.cpp b/Src/Model3/Model3.cpp index ecb3701..8d71692 100644 --- a/Src/Model3/Model3.cpp +++ b/Src/Model3/Model3.cpp @@ -1418,8 +1418,11 @@ void CModel3::Write8(UINT32 addr, UINT8 data) // Sound Board case 0x08: //printf("PPC: %08X=%02X * (PC=%08X, LR=%08X)\n", addr, data, ppc_get_pc(), ppc_get_lr()); - if ((addr&0xF) == 0) // MIDI data port + if ((addr & 0xF) == 0) // MIDI data port + { SoundBoard.WriteMIDIPort(data); + IRQ.Deassert(0x40); + } else if ((addr&0xF) == 4) // MIDI control port midiCtrlPort = data; break; @@ -2133,9 +2136,7 @@ void CModel3::RunMainBoardFrame(void) // Process MIDI interrupt IRQ.Assert(0x40); - ppc_execute(200); // give PowerPC time to acknowledge IR - IRQ.Deassert(0x40); - ppc_execute(200); // acknowledge that IRQ was deasserted (TODO: is this really needed?) + ppc_execute(400); // give PowerPC time to acknowledge IR dispCycles -= 400; ++irqCount;