Skip to content

Commit

Permalink
- Fix compatibility with F-Zero GX Unleashed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Dec 14, 2024
1 parent bf06fb8 commit 2ba9ff9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cube/swiss/source/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ int config_update_game(ConfigEntry* entry, bool checkConfigDevice) {
}

static char triggerLevelEntries[][4] = {"GKGE", "GKGJ", "GKGP", "GY2E", "GY2J", "GY2P", "GY3E", "GY3J", "GYBE", "GYBJ", "GYBP"};
static char emulateAudioStreamEntries[][4] = {"UFZE", "UFZJ", "UFZP"};
static char emulateReadSpeedEntries[][4] = {"GQSD", "GQSE", "GQSF", "GQSI", "GQSP", "GQSS", "GTOJ"};
static char emulateEthernetEntries[][4] = {"DPSJ", "GHEE", "GHEJ", "GKYE", "GKYJ", "GKYP", "GM4E", "GM4J", "GM4P", "GPJJ", "GPOE", "GPOJ", "GPOP", "GPSE", "GPSJ", "GPSP", "GTEE", "GTEJ", "GTEP", "GTEW", "PHEJ"};

Expand Down Expand Up @@ -334,6 +335,12 @@ void config_defaults(ConfigEntry *entry) {
break;
}
}
for(int i = 0; i < sizeof(emulateAudioStreamEntries) / sizeof(*emulateAudioStreamEntries); i++) {
if(!strncmp(entry->game_id, emulateAudioStreamEntries[i], 4)) {
entry->emulateAudioStream = 0;
break;
}
}
for(int i = 0; i < sizeof(emulateReadSpeedEntries) / sizeof(*emulateReadSpeedEntries); i++) {
if(!strncmp(entry->game_id, emulateReadSpeedEntries[i], 4)) {
entry->emulateReadSpeed = 1;
Expand Down
6 changes: 3 additions & 3 deletions cube/swiss/source/patcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -11879,7 +11879,7 @@ int Patch_GameSpecific(void *data, u32 length, const char *gameID, int dataType)
patched++;
break;
}
} else if (!strncmp(gameID, "GFZE01", 6) && dataType == PATCH_DOL) {
} else if ((!strncmp(gameID, "GFZE01", 6) || !strncmp(gameID, "UFZE01", 6)) && dataType == PATCH_DOL) {
switch (length) {
case 1414848:
// Skip exception stubbing.
Expand All @@ -11903,7 +11903,7 @@ int Patch_GameSpecific(void *data, u32 length, const char *gameID, int dataType)
patched++;
break;
}
} else if (!strncmp(gameID, "GFZJ01", 6) && dataType == PATCH_DOL) {
} else if ((!strncmp(gameID, "GFZJ01", 6) || !strncmp(gameID, "UFZJ01", 6)) && dataType == PATCH_DOL) {
switch (length) {
case 1412928:
// Skip exception stubbing and force Japanese language.
Expand Down Expand Up @@ -11933,7 +11933,7 @@ int Patch_GameSpecific(void *data, u32 length, const char *gameID, int dataType)
patched++;
break;
}
} else if (!strncmp(gameID, "GFZP01", 6) && dataType == PATCH_DOL) {
} else if ((!strncmp(gameID, "GFZP01", 6) || !strncmp(gameID, "UFZP01", 6)) && dataType == PATCH_DOL) {
switch (length) {
case 1425760:
// Skip exception stubbing.
Expand Down

0 comments on commit 2ba9ff9

Please sign in to comment.