aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorgameblabla2019-07-18 01:54:58 +0200
committergameblabla2019-07-18 01:54:58 +0200
commit76b81516963f0f50049be59172c651b559d9fabf (patch)
treea3bfb93273ee6e0b621baa418fc4673f30ec5913 /libpcsxcore
parent595a136b9285a14046cfb7e09eedabed844f5b2c (diff)
downloadpcsx_rearmed-76b81516963f0f50049be59172c651b559d9fabf.tar.gz
pcsx_rearmed-76b81516963f0f50049be59172c651b559d9fabf.tar.bz2
pcsx_rearmed-76b81516963f0f50049be59172c651b559d9fabf.zip
psxbios: Merging improved card_info function from upstream
It should be closer to the real thing, and this commit and the previous one definitely fixes the save issues in Digimon World.
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/psxbios.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c
index fd60955..265dbfd 100644
--- a/libpcsxcore/psxbios.c
+++ b/libpcsxcore/psxbios.c
@@ -1279,11 +1279,29 @@ void psxBios__card_info() { // ab
#ifdef PSXBIOS_LOG
PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xab], a0);
#endif
-
+ u32 ret;
card_active_chan = a0;
+ switch (card_active_chan)
+ {
+ case 0x00: case 0x01: case 0x02: case 0x03:
+ ret = Config.Mcd1[0] ? 0x2 : 0x8;
+ break;
+ case 0x10: case 0x11: case 0x12: case 0x13:
+ ret = Config.Mcd2[0] ? 0x2 : 0x8;
+ break;
+ default:
+#ifdef PSXBIOS_LOG
+ PSXBIOS_LOG("psxBios_%s: UNKNOWN PORT 0x%x\n", biosA0n[0xab], card_active_chan);
+#endif
+ ret = 0x11;
+ break;
+ }
+
+// DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004
// DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004
DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004
+ DeliverEvent(0x81, ret); // 0xf4000001, 0x0004
v0 = 1; pc0 = ra;
}