diff options
author | hizzlekizzle | 2019-03-10 15:56:16 -0500 |
---|---|---|
committer | GitHub | 2019-03-10 15:56:16 -0500 |
commit | e21479a6d304e6c3eed69e2b6385ed674500e8d4 (patch) | |
tree | f823e88a2ff072eb9e910b7d4ecd93808f178b5d /libpcsxcore | |
parent | 4f8453cb9d67aa7aac5fc1395faa21f07cb2fdc9 (diff) | |
parent | bc1fc5f30082236c61800444c9b945e8e2095b29 (diff) | |
download | pcsx_rearmed-e21479a6d304e6c3eed69e2b6385ed674500e8d4.tar.gz pcsx_rearmed-e21479a6d304e6c3eed69e2b6385ed674500e8d4.tar.bz2 pcsx_rearmed-e21479a6d304e6c3eed69e2b6385ed674500e8d4.zip |
Merge pull request #240 from retro-wertz/core_options
PSX clock and BIOS core options, memcard2 fix etc
Diffstat (limited to 'libpcsxcore')
-rw-r--r-- | libpcsxcore/psxbios.c | 27 | ||||
-rw-r--r-- | libpcsxcore/sio.c | 6 | ||||
-rw-r--r-- | libpcsxcore/sio.h | 1 |
3 files changed, 32 insertions, 2 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index d5ed725..a684601 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -26,6 +26,7 @@ #include "psxbios.h" #include "psxhw.h" #include "gpu.h" +#include "sio.h" #include <zlib.h> #undef SysPrintf @@ -261,7 +262,7 @@ static int CardState = -1; static TCB Thread[8]; static int CurThread = 0; static FileDesc FDesc[32]; -static u32 card_active_chan; +static u32 card_active_chan = 0; boolean hleSoftCall = FALSE; @@ -1271,14 +1272,35 @@ void psxBios_SetMem() { // 9f } void psxBios__card_info() { // ab + u8 ret, port; #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s: %x\n", biosA0n[0xab], a0); #endif card_active_chan = a0; + port = card_active_chan >> 4; + + switch (port) { + case 0x0: + case 0x1: + ret = 0x2; + if (McdDisable[port & 1]) + ret = 0x8; + break; + default: +#ifdef PSXBIOS_LOG + PSXBIOS_LOG("psxBios_%s: UNKNOWN PORT 0x%x\n", biosA0n[0xab], card_active_chan); +#endif + ret = 0x11; + break; + } + + if (McdDisable[0] && McdDisable[1]) + ret = 0x8; // DeliverEvent(0x11, 0x2); // 0xf0000011, 0x0004 - DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004 +// DeliverEvent(0x81, 0x2); // 0xf4000001, 0x0004 + DeliverEvent(0x81, ret); // 0xf4000001, 0x0004 v0 = 1; pc0 = ra; } @@ -2643,6 +2665,7 @@ void psxBiosInit() { CardState = -1; CurThread = 0; memset(FDesc, 0, sizeof(FDesc)); + card_active_chan = 0; psxMu32ref(0x0150) = SWAPu32(0x160); psxMu32ref(0x0154) = SWAPu32(0x320); diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c index d251fa7..c2390bf 100644 --- a/libpcsxcore/sio.c +++ b/libpcsxcore/sio.c @@ -423,6 +423,12 @@ void LoadMcd(int mcd, char *str) { } McdDisable[mcd - 1] = 0; +#ifdef HAVE_LIBRETRO + // memcard1 is handled by libretro + if (mcd == 1) + return; +#endif + if (str == NULL || strcmp(str, "none") == 0) { McdDisable[mcd - 1] = 1; return; diff --git a/libpcsxcore/sio.h b/libpcsxcore/sio.h index eff1746..a554c2b 100644 --- a/libpcsxcore/sio.h +++ b/libpcsxcore/sio.h @@ -34,6 +34,7 @@ extern "C" { #define MCD_SIZE (1024 * 8 * 16) extern char Mcd1Data[MCD_SIZE], Mcd2Data[MCD_SIZE]; +extern char McdDisable[2]; void sioWrite8(unsigned char value); void sioWriteStat16(unsigned short value); |