From eedfe8060a20c8a9120ff8cab55110a1e2470887 Mon Sep 17 00:00:00 2001 From: gameblabla Date: Wed, 18 Aug 2021 20:22:43 +0000 Subject: [PATCH] Add internal database for problematic games. (#182) --- Makefile | 2 +- libpcsxcore/database.c | 36 ++++++++++++++++++++++++++++++++++++ libpcsxcore/database.h | 6 ++++++ libpcsxcore/misc.c | 3 +++ libpcsxcore/sio.h | 1 + 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 libpcsxcore/database.c create mode 100644 libpcsxcore/database.h diff --git a/Makefile b/Makefile index c63fd1f5..29d24184 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ CFLAGS += -DPCNT endif # core -OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \ +OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/database.o libpcsxcore/debug.o \ libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/mdec.o \ libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \ libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \ diff --git a/libpcsxcore/database.c b/libpcsxcore/database.c new file mode 100644 index 00000000..f383e361 --- /dev/null +++ b/libpcsxcore/database.c @@ -0,0 +1,36 @@ +#include "misc.h" +#include "../plugins/dfsound/spu_config.h" +#include "sio.h" + +/* It's duplicated from emu_if.c */ +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + +static const char MemorycardHack_db[8][10] = +{ + /* Lifeforce Tenka, also known as Codename Tenka */ + {"SLES00613"}, + {"SLED00690"}, + {"SLES00614"}, + {"SLES00615"}, + {"SLES00616"}, + {"SLES00617"}, + {"SCUS94409"} +}; + +/* Function for automatic patching according to GameID. */ +void Apply_Hacks_Cdrom() +{ + uint32_t i; + + /* Apply Memory card hack for Codename Tenka. (The game needs one of the memory card slots to be empty) */ + for(i=0;i char CdromId[10] = ""; @@ -389,6 +390,8 @@ int CheckCdrom() { SysPrintf(_("CD-ROM Label: %.32s\n"), CdromLabel); SysPrintf(_("CD-ROM ID: %.9s\n"), CdromId); SysPrintf(_("CD-ROM EXE Name: %.255s\n"), exename); + + Apply_Hacks_Cdrom(); BuildPPFCache(); diff --git a/libpcsxcore/sio.h b/libpcsxcore/sio.h index eff1746a..a554c2bb 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); -- 2.39.5