Core: Make DMA's instant during the BIOS

This commit is contained in:
refractionpcsx2 2021-05-25 09:52:08 +01:00
parent 8552090f50
commit a6193b0a51
1 changed files with 12 additions and 2 deletions

View File

@ -269,7 +269,7 @@ static __fi void TESTINT( u8 n, void (*callback)() )
{
if( !(cpuRegs.interrupt & (1 << n)) ) return;
if( cpuTestCycle( cpuRegs.sCycle[n], cpuRegs.eCycle[n] ) )
if(!g_GameStarted || cpuTestCycle( cpuRegs.sCycle[n], cpuRegs.eCycle[n] ) )
{
cpuClearInt( n );
callback();
@ -398,7 +398,17 @@ __fi void _cpuEventTest_Shared()
// These are basically just DMAC-related events, which also piggy-back the same bits as
// the PS2's own DMA channel IRQs and IRQ Masks.
_cpuTestInterrupts();
// This is a BIOS hack because the coding in the BIOS is terrible but the bug is masked by Data Cache
// where a DMA buffer is overwritten without waiting for the transfer to end, which causes the fonts to get all messed up
// so to fix it, we run all the DMA's instantly when in the BIOS.
// Only use the lower 17 bits of the cpuRegs.interrupt as the upper bits are for VU0/1 sync which can't be done in a tight loop
if (!g_GameStarted && dmacRegs.ctrl.DMAE && !(psHu8(DMAC_ENABLER + 2) & 1) && (cpuRegs.interrupt & 0x1FFFF))
{
while(cpuRegs.interrupt & 0x1FFFF)
_cpuTestInterrupts();
}
else
_cpuTestInterrupts();
// ---- IOP -------------
// * It's important to run a iopEventTest before calling ExecuteBlock. This