X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fdatabase.c;h=dc3144cf522a82ead1279a290bb55bb9ea440c43;hb=9a18263477619dad5f4d51c7b00f5929da15843a;hp=5edb9611a69667b08908555950908bf2aa1a80a8;hpb=b99a48f2a1d41017af70fd7e8d040e0c988b36f1;p=pcsx_rearmed.git diff --git a/libpcsxcore/database.c b/libpcsxcore/database.c index 5edb9611..dc3144cf 100644 --- a/libpcsxcore/database.c +++ b/libpcsxcore/database.c @@ -1,10 +1,16 @@ #include "misc.h" #include "sio.h" #include "new_dynarec/new_dynarec.h" +#include "lightrec/plugin.h" /* It's duplicated from emu_if.c */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +/* Corresponds to LIGHTREC_OPT_INV_DMA_ONLY of lightrec.h */ +#define LIGHTREC_HACK_INV_DMA_ONLY (1 << 0) + +u32 lightrec_hacks; + static const char * const MemorycardHack_db[] = { /* Lifeforce Tenka, also known as Codename Tenka */ @@ -53,6 +59,7 @@ static const struct } cycle_multiplier_overrides[] = { + /* note: values are = (10000 / gui_option) */ /* Internal Section - fussy about timings */ { "SLPS01868", 202 }, /* Super Robot Taisen Alpha - on the edge with 175, @@ -73,6 +80,41 @@ cycle_multiplier_overrides[] = { "SLES01549", 222 }, { "SLES02063", 222 }, { "SLES02064", 222 }, + /* Judge Dredd - could also be poor MDEC timing */ + { "SLUS00630", 128 }, + { "SLES00755", 128 }, + /* Digimon World */ + { "SLUS01032", 153 }, + { "SLES02914", 153 }, +}; + +static const struct +{ + const char * const id; + u32 hacks; +} +lightrec_hacks_db[] = +{ + /* Formula One Arcade */ + { "SCES03886", LIGHTREC_HACK_INV_DMA_ONLY }, + + /* Formula One '99 */ + { "SLUS00870", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCPS10101", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCES01979", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SLES01979", LIGHTREC_HACK_INV_DMA_ONLY }, + + /* Formula One 2000 */ + { "SLUS01134", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCES02777", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCES02778", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCES02779", LIGHTREC_HACK_INV_DMA_ONLY }, + + /* Formula One 2001 */ + { "SCES03404", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCES03423", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCES03424", LIGHTREC_HACK_INV_DMA_ONLY }, + { "SCES03524", LIGHTREC_HACK_INV_DMA_ONLY }, }; /* Function for automatic patching according to GameID. */ @@ -122,4 +164,15 @@ void Apply_Hacks_Cdrom() break; } } + + lightrec_hacks = 0; + + for (i = 0; drc_is_lightrec() && i < ARRAY_SIZE(lightrec_hacks_db); i++) { + if (strcmp(CdromId, lightrec_hacks_db[i].id) == 0) + { + lightrec_hacks = lightrec_hacks_db[i].hacks; + SysPrintf("using lightrec_hacks: 0x%x\n", lightrec_hacks); + break; + } + } }