drc: rearrange hacks
[pcsx_rearmed.git] / libpcsxcore / database.c
CommitLineData
eedfe806 1#include "misc.h"
eedfe806 2#include "sio.h"
a3203cf4 3#include "new_dynarec/new_dynarec.h"
eedfe806 4
5/* It's duplicated from emu_if.c */
6#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
7
8static const char MemorycardHack_db[8][10] =
9{
10 /* Lifeforce Tenka, also known as Codename Tenka */
11 {"SLES00613"},
12 {"SLED00690"},
13 {"SLES00614"},
14 {"SLES00615"},
15 {"SLES00616"},
16 {"SLES00617"},
17 {"SCUS94409"}
18};
19
20/* Function for automatic patching according to GameID. */
21void Apply_Hacks_Cdrom()
22{
23 uint32_t i;
24
25 /* Apply Memory card hack for Codename Tenka. (The game needs one of the memory card slots to be empty) */
26 for(i=0;i<ARRAY_SIZE(MemorycardHack_db);i++)
27 {
28 if (strncmp(CdromId, MemorycardHack_db[i], 9) == 0)
29 {
30 /* Disable the second memory card slot for the game */
31 Config.Mcd2[0] = 0;
32 /* This also needs to be done because in sio.c, they don't use Config.Mcd2 for that purpose */
33 McdDisable[1] = 1;
34 }
35 }
a3203cf4 36
37 /* Dynarec game-specific hacks */
d62c125a 38 new_dynarec_hacks_pergame = 0;
24058131 39 cycle_multiplier_override = 0;
a3203cf4 40
41 /* Internal Section is fussy about timings */
42 if (strcmp(CdromId, "SLPS01868") == 0)
43 {
26bd3dad 44 cycle_multiplier_override = 202;
d62c125a 45 new_dynarec_hacks_pergame |= NDHACK_OVERRIDE_CYCLE_M;
a3203cf4 46 }
eedfe806 47}