aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgameblabla2019-07-18 01:57:08 +0200
committergameblabla2019-07-18 01:57:08 +0200
commit79dad1b3ff35061e16f7bc160955df6990cbef18 (patch)
tree4259fa84312e3e32388893d7966b96ec8515c0a1
parentbd48ba5ea8c87bf8c771550bc5320f7e6f73c9a6 (diff)
downloadpcsx_rearmed-79dad1b3ff35061e16f7bc160955df6990cbef18.tar.gz
pcsx_rearmed-79dad1b3ff35061e16f7bc160955df6990cbef18.tar.bz2
pcsx_rearmed-79dad1b3ff35061e16f7bc160955df6990cbef18.zip
psxbios: Better EnterCiritcal implementation
Nocash documentation says it should return 0 if one or none of the bits were changed and return 1 of both bits were set. This fixes Medievil 2, which would freeze upon starting up a game and this properly fixes Digimon World crashing (with fixed strcat implementation). It also possibly fix other games.
-rw-r--r--libpcsxcore/psxbios.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c
index d4a38e1..58581e9 100644
--- a/libpcsxcore/psxbios.c
+++ b/libpcsxcore/psxbios.c
@@ -2907,8 +2907,9 @@ void psxBiosException() {
#endif
switch (a0) {
case 1: // EnterCritical - disable irq's
- psxRegs.CP0.n.Status &= ~0x404;
-v0=1; // HDHOSHY experimental patch: Spongebob, Coldblood, fearEffect, Medievil2, Martian Gothic
+ /* Fixes Medievil 2 not loading up new game, Digimon World not booting up and possibly others */
+ v0 = (psxRegs.CP0.n.Status & 0x404) == 0x404;
+ psxRegs.CP0.n.Status &= ~0x404;
break;
case 2: // ExitCritical - enable irq's