diff options
author | gameblabla | 2019-07-18 01:10:33 +0200 |
---|---|---|
committer | gameblabla | 2019-07-18 01:10:33 +0200 |
commit | a824e83d363ce167068e497a97b25f6d637807d6 (patch) | |
tree | fb54aea32ec8f5d5e82a982f24d1067878a1f17a /libpcsxcore | |
parent | bee52312d06313957cfe73dacdb1717d1c8bcddb (diff) | |
download | pcsx_rearmed-a824e83d363ce167068e497a97b25f6d637807d6.tar.gz pcsx_rearmed-a824e83d363ce167068e497a97b25f6d637807d6.tar.bz2 pcsx_rearmed-a824e83d363ce167068e497a97b25f6d637807d6.zip |
psxbios: Add checks to PAD_init
Nocash documentation says that function fails if type is not 0x20000000
or 0x20000001. In case of failure, it should return 0.
If not, then it should return 2.
This fixes input in Digimon World.
Diffstat (limited to 'libpcsxcore')
-rw-r--r-- | libpcsxcore/psxbios.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 4624bf4..42926c2 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -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; } |