SuperFX: Attempt to fix execution bank check against SCMR.

This commit is contained in:
BearOso 2024-04-27 16:46:05 -05:00
parent 0a527f3adc
commit 65ef81ca2d
1 changed files with 6 additions and 20 deletions

View File

@ -339,29 +339,15 @@ static bool8 fx_checkStartAddress (void)
{ {
// Check if we start inside the cache // Check if we start inside the cache
if (GSU.bCacheActive && R15 >= GSU.vCacheBaseReg && R15 < (GSU.vCacheBaseReg + 512)) if (GSU.bCacheActive && R15 >= GSU.vCacheBaseReg && R15 < (GSU.vCacheBaseReg + 512))
return (TRUE); return true;
/* if (GSU.vPrgBankReg <= 0x5f && (SCMR & (1 << 3)))
// Check if we're in an unused area return true;
if (GSU.vPrgBankReg < 0x40 && R15 < 0x8000)
return (FALSE);
*/
if (GSU.vPrgBankReg >= 0x60 && GSU.vPrgBankReg <= 0x6f) if (GSU.vPrgBankReg <= 0x7f && (SCMR & (1 << 4)))
return (FALSE); return true;
if (GSU.vPrgBankReg >= 0x74) return false;
return (FALSE);
// Check if we're in RAM and the RAN flag is not set
if (GSU.vPrgBankReg >= 0x70 && GSU.vPrgBankReg <= 0x73 && !(SCMR & (1 << 3)))
return (FALSE);
// If not, we're in ROM, so check if the RON flag is set
if (!(SCMR & (1 << 4)))
return (FALSE);
return (TRUE);
} }
// Execute until the next stop instruction // Execute until the next stop instruction