From e9fda093d29f703068dd3e5bae7a4b3683e33b5c Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 13 Jan 2011 17:04:56 +0200 Subject: [PATCH] bios: implement psxBios__card_chan used by at least R-Type Delta. --- libpcsxcore/psxbios.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index f2f25405..cad69b31 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -259,6 +259,7 @@ static int CardState = -1; static TCB Thread[8]; static int CurThread = 0; static FileDesc FDesc[32]; +static u32 card_active_chan; boolean hleSoftCall = FALSE; @@ -1240,6 +1241,8 @@ void psxBios__card_info() { // ab PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xab], a0); #endif + card_active_chan = a0; + // DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004 DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004 @@ -1251,6 +1254,8 @@ void psxBios__card_load() { // ac PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xac], a0); #endif + card_active_chan = a0; + // DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004 DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004 @@ -2024,6 +2029,7 @@ void psxBios__card_write() { // 0x4e PSXBIOS_LOG("psxBios_%s: %x,%x,%x\n", biosB0n[0x4e], a0, a1, a2); #endif + card_active_chan = a0; port = a0 >> 4; if (port == 0) { @@ -2047,6 +2053,7 @@ void psxBios__card_read() { // 0x4f PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x4f]); #endif + card_active_chan = a0; port = a0 >> 4; if (port == 0) { @@ -2128,6 +2135,15 @@ void psxBios_GetB0Table() { // 57 v0 = 0x874; pc0 = ra; } +void psxBios__card_chan() { // 0x58 +#ifdef PSXBIOS_LOG + PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x58]); +#endif + + v0 = card_active_chan; + pc0 = ra; +} + void psxBios_ChangeClearPad() { // 5b #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s: %x\n", biosB0n[0x5b], a0); @@ -2485,7 +2501,7 @@ void psxBiosInit() { //biosB0[0x55] = psxBios__get_error; biosB0[0x56] = psxBios_GetC0Table; biosB0[0x57] = psxBios_GetB0Table; - //biosB0[0x58] = psxBios__card_chan; + biosB0[0x58] = psxBios__card_chan; //biosB0[0x59] = psxBios_sys_b0_59; //biosB0[0x5a] = psxBios_sys_b0_5a; biosB0[0x5b] = psxBios_ChangeClearPad; @@ -2820,4 +2836,5 @@ void psxBiosFreeze(int Mode) { bfreezes(Thread); bfreezel(&CurThread); bfreezes(FDesc); + bfreezel(&card_active_chan); } -- 2.39.5