GPU_writeData(0x0400000);
GPU_writeData(0x0200000);
GPU_writeData(0x0100000);
-
+ v0 = 0x1f801814;
pc0 = ra;
}
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x,%x,%x\n", biosB0n[0x4e], a0, a1, a2);
#endif
-
+ /* Function also accepts sector 400h (a bug) */
+ if (!(a1 <= 0x400))
+ {
+ /* Invalid sectors */
+ v0 = 0; pc0 = ra;
+ return;
+ }
card_active_chan = a0;
port = a0 >> 4;
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x4f]);
#endif
-
+ /* Function also accepts sector 400h (a bug) */
+ if (!(a1 <= 0x400))
+ {
+ /* Invalid sectors */
+ v0 = 0; pc0 = ra;
+ return;
+ }
card_active_chan = a0;
port = a0 >> 4;
#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