psxinterpreter: use cycle_multiplier also
[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}
d5aeda23 25cycle_multiplier_overrides[] =
4a02afab 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 },
d5aeda23 33#ifdef DRC_DISABLE /* new_dynarec has a hack for this game */
34 /* Parasite Eve II - internal timer checks */
35 { "SLUS01042", 125 },
36 { "SLUS01055", 125 },
37 { "SLES02558", 125 },
38 { "SLES12558", 125 },
39#endif
4a02afab 40};
41
eedfe806 42/* Function for automatic patching according to GameID. */
43void Apply_Hacks_Cdrom()
44{
45 uint32_t i;
46
47 /* Apply Memory card hack for Codename Tenka. (The game needs one of the memory card slots to be empty) */
48 for(i=0;i<ARRAY_SIZE(MemorycardHack_db);i++)
49 {
50 if (strncmp(CdromId, MemorycardHack_db[i], 9) == 0)
51 {
52 /* Disable the second memory card slot for the game */
53 Config.Mcd2[0] = 0;
54 /* This also needs to be done because in sio.c, they don't use Config.Mcd2 for that purpose */
55 McdDisable[1] = 1;
56 }
57 }
a3203cf4 58
59 /* Dynarec game-specific hacks */
d62c125a 60 new_dynarec_hacks_pergame = 0;
d5aeda23 61 Config.cycle_multiplier_override = 0;
a3203cf4 62
d5aeda23 63 for (i = 0; i < ARRAY_SIZE(cycle_multiplier_overrides); i++)
a3203cf4 64 {
d5aeda23 65 if (strcmp(CdromId, cycle_multiplier_overrides[i].id) == 0)
4a02afab 66 {
d5aeda23 67 Config.cycle_multiplier_override = cycle_multiplier_overrides[i].mult;
4a02afab 68 new_dynarec_hacks_pergame |= NDHACK_OVERRIDE_CYCLE_M;
d5aeda23 69 SysPrintf("using cycle_multiplier_override: %d\n",
70 Config.cycle_multiplier_override);
4a02afab 71 break;
72 }
a3203cf4 73 }
eedfe806 74}