drc: add a clock override for Super Robot Taisen Alpha
[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
4a02afab 20static const struct
21{
22 const char * const id;
23 int mult;
24}
25new_dynarec_clock_overrides[] =
26{
27 /* Internal Section - fussy about timings */
28 { "SLPS01868", 202 },
29 /* Super Robot Taisen Alpha - on the edge with 175,
30 * changing memcard settings is enough to break/unbreak it */
31 { "SLPS02528", 190 },
32 { "SLPS02636", 190 },
33};
34
eedfe806 35/* Function for automatic patching according to GameID. */
36void Apply_Hacks_Cdrom()
37{
38 uint32_t i;
39
40 /* Apply Memory card hack for Codename Tenka. (The game needs one of the memory card slots to be empty) */
41 for(i=0;i<ARRAY_SIZE(MemorycardHack_db);i++)
42 {
43 if (strncmp(CdromId, MemorycardHack_db[i], 9) == 0)
44 {
45 /* Disable the second memory card slot for the game */
46 Config.Mcd2[0] = 0;
47 /* This also needs to be done because in sio.c, they don't use Config.Mcd2 for that purpose */
48 McdDisable[1] = 1;
49 }
50 }
a3203cf4 51
52 /* Dynarec game-specific hacks */
d62c125a 53 new_dynarec_hacks_pergame = 0;
24058131 54 cycle_multiplier_override = 0;
a3203cf4 55
4a02afab 56 for (i = 0; i < ARRAY_SIZE(new_dynarec_clock_overrides); i++)
a3203cf4 57 {
4a02afab 58 if (strcmp(CdromId, new_dynarec_clock_overrides[i].id) == 0)
59 {
60 cycle_multiplier_override = new_dynarec_clock_overrides[i].mult;
61 new_dynarec_hacks_pergame |= NDHACK_OVERRIDE_CYCLE_M;
62 SysPrintf("using new_dynarec clock override: %d\n",
63 cycle_multiplier_override);
64 break;
65 }
a3203cf4 66 }
eedfe806 67}