X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fdatabase.c;h=f947b068d345bda15cd16ce0408d6e55561715ab;hb=688bdb9526d42181368e64ceaa6828727a10188c;hp=52d17a7e6e0cc249344a98135cd08d9eb25f0ebd;hpb=4a02afab57b1e1e90b90ae5a720ce1df8fa0c0b5;p=pcsx_rearmed.git diff --git a/libpcsxcore/database.c b/libpcsxcore/database.c index 52d17a7e..f947b068 100644 --- a/libpcsxcore/database.c +++ b/libpcsxcore/database.c @@ -5,16 +5,32 @@ /* It's duplicated from emu_if.c */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) -static const char MemorycardHack_db[8][10] = +static const char * const MemorycardHack_db[] = { /* Lifeforce Tenka, also known as Codename Tenka */ - {"SLES00613"}, - {"SLED00690"}, - {"SLES00614"}, - {"SLES00615"}, - {"SLES00616"}, - {"SLES00617"}, - {"SCUS94409"} + "SLES00613", "SLED00690", "SLES00614", "SLES00615", + "SLES00616", "SLES00617", "SCUS94409" +}; + +static const char * const cdr_read_hack_db[] = +{ + /* T'ai Fu - Wrath of the Tiger */ + "SLUS00787", +}; + +#define HACK_ENTRY(var, list) \ + { #var, &Config.hacks.var, list, ARRAY_SIZE(list) } + +static const struct +{ + const char *name; + boolean *var; + const char * const * id_list; + size_t id_list_len; +} +hack_db[] = +{ + HACK_ENTRY(cdr_read_timing, cdr_read_hack_db), }; static const struct @@ -22,7 +38,7 @@ static const struct const char * const id; int mult; } -new_dynarec_clock_overrides[] = +cycle_multiplier_overrides[] = { /* Internal Section - fussy about timings */ { "SLPS01868", 202 }, @@ -30,15 +46,36 @@ new_dynarec_clock_overrides[] = * changing memcard settings is enough to break/unbreak it */ { "SLPS02528", 190 }, { "SLPS02636", 190 }, +#if defined(DRC_DISABLE) || defined(LIGHTREC) /* new_dynarec has a hack for this game */ + /* Parasite Eve II - internal timer checks */ + { "SLUS01042", 125 }, + { "SLUS01055", 125 }, + { "SLES02558", 125 }, + { "SLES12558", 125 }, +#endif }; /* Function for automatic patching according to GameID. */ void Apply_Hacks_Cdrom() { - uint32_t i; - + size_t i, j; + + memset(&Config.hacks, 0, sizeof(Config.hacks)); + + for (i = 0; i < ARRAY_SIZE(hack_db); i++) + { + for (j = 0; j < hack_db[i].id_list_len; j++) + { + if (strncmp(CdromId, hack_db[i].id_list[j], 9)) + continue; + *hack_db[i].var = 1; + SysPrintf("using hack: %s\n", hack_db[i].name); + break; + } + } + /* Apply Memory card hack for Codename Tenka. (The game needs one of the memory card slots to be empty) */ - for(i=0;i