psxbios: Add checks to PAD_init
[pcsx_rearmed.git] / libpcsxcore / psxbios.c
index 4624bf4..42926c2 100644 (file)
@@ -1613,10 +1613,17 @@ void psxBios_PAD_init() { // 15
 #ifdef PSXBIOS_LOG
        PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x15]);
 #endif
+       if (!(a0 == 0x20000000 || a0 == 0x20000001))
+       {
+               v0 = 0;
+               pc0 = ra;
+               return;
+       }
        psxHwWrite16(0x1f801074, (u16)(psxHwRead16(0x1f801074) | 0x1));
        pad_buf = (int *)Ra1;
        *pad_buf = -1;
        psxRegs.CP0.n.Status |= 0x401;
+       v0 = 2;
        pc0 = ra;
 }