3 #include "new_dynarec/new_dynarec.h"
5 /* It's duplicated from emu_if.c */
6 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
8 static const char * const MemorycardHack_db[] =
10 /* Lifeforce Tenka, also known as Codename Tenka */
11 "SLES00613", "SLED00690", "SLES00614", "SLES00615",
12 "SLES00616", "SLES00617", "SCUS94409"
15 static const char * const cdr_read_hack_db[] =
17 /* T'ai Fu - Wrath of the Tiger */
21 static const char * const gpu_slow_llist_db[] =
23 /* Bomberman Fantasy Race */
24 "SLES01712", "SLPS01525", "SLPS91138", "SLPM87102", "SLUS00823",
26 "SCES02834", "SCUS94570", "SCUS94616", "SCUS94654",
27 /* Final Fantasy IV */
28 "SCES03840", "SLPM86028", "SLUS01360",
29 /* Spot Goes to Hollywood */
30 "SLES00330", "SLPS00394", "SLUS00014",
31 /* Vampire Hunter D */
32 "SLES02731", "SLPS02477", "SLPS03198", "SLUS01138",
35 static const char * const gpu_busy_hack_db[] =
38 "SLPS01919", "SLPS01920",
41 #define HACK_ENTRY(var, list) \
42 { #var, &Config.hacks.var, list, ARRAY_SIZE(list) }
48 const char * const * id_list;
53 HACK_ENTRY(cdr_read_timing, cdr_read_hack_db),
54 HACK_ENTRY(gpu_slow_list_walking, gpu_slow_llist_db),
55 HACK_ENTRY(gpu_busy_hack, gpu_busy_hack_db),
60 const char * const id;
63 cycle_multiplier_overrides[] =
65 /* note: values are = (10000 / gui_option) */
66 /* Internal Section - fussy about timings */
68 /* Super Robot Taisen Alpha - on the edge with 175,
69 * changing memcard settings is enough to break/unbreak it */
72 /* Brave Fencer Musashi - cd sectors arrive too fast */
75 #if defined(DRC_DISABLE) || defined(LIGHTREC) /* new_dynarec has a hack for this game */
76 /* Parasite Eve II - internal timer checks */
82 /* Discworld Noir - audio skips if CPU runs too fast */
86 /* Judge Dredd - could also be poor MDEC timing */
94 /* Function for automatic patching according to GameID. */
95 void Apply_Hacks_Cdrom()
99 memset(&Config.hacks, 0, sizeof(Config.hacks));
101 for (i = 0; i < ARRAY_SIZE(hack_db); i++)
103 for (j = 0; j < hack_db[i].id_list_len; j++)
105 if (strncmp(CdromId, hack_db[i].id_list[j], 9))
108 SysPrintf("using hack: %s\n", hack_db[i].name);
113 /* Apply Memory card hack for Codename Tenka. (The game needs one of the memory card slots to be empty) */
114 for (i = 0; i < ARRAY_SIZE(MemorycardHack_db); i++)
116 if (strncmp(CdromId, MemorycardHack_db[i], 9) == 0)
118 /* Disable the second memory card slot for the game */
120 /* This also needs to be done because in sio.c, they don't use Config.Mcd2 for that purpose */
126 /* Dynarec game-specific hacks */
127 new_dynarec_hacks_pergame = 0;
128 Config.cycle_multiplier_override = 0;
130 for (i = 0; i < ARRAY_SIZE(cycle_multiplier_overrides); i++)
132 if (strcmp(CdromId, cycle_multiplier_overrides[i].id) == 0)
134 Config.cycle_multiplier_override = cycle_multiplier_overrides[i].mult;
135 new_dynarec_hacks_pergame |= NDHACK_OVERRIDE_CYCLE_M;
136 SysPrintf("using cycle_multiplier_override: %d\n",
137 Config.cycle_multiplier_override);