Skip to content

Commit

Permalink
- Fix PAL-M regression.
Browse files Browse the repository at this point in the history
- Improve region code handling.
  • Loading branch information
Extrems committed Sep 11, 2024
1 parent 56afa69 commit c116022
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
5 changes: 3 additions & 2 deletions cube/swiss/source/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,12 +1176,13 @@ void config_load_current(ConfigEntry *entry) {
swissSettings.emulateEthernet = entry->emulateEthernet;
swissSettings.preferCleanBoot = entry->preferCleanBoot;

if(entry->region != 'P')
if(!strchr("PA?", entry->region))
swissSettings.sramLanguage = SYS_LANG_ENGLISH;

if(entry->region == 'P')
swissSettings.sramVideo = SYS_VIDEO_PAL;
else if(swissSettings.sramVideo == SYS_VIDEO_PAL)
else if((swissSettings.sramVideo == SYS_VIDEO_PAL && !strchr("A?", entry->region)) ||
(swissSettings.sramVideo == SYS_VIDEO_MPAL && getDTVStatus()))
swissSettings.sramVideo = SYS_VIDEO_NTSC;

if(swissSettings.gameVMode > 0 && swissSettings.disableVideoPatches < 2) {
Expand Down
4 changes: 2 additions & 2 deletions cube/swiss/source/devices/wode/deviceHandler-WODE.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ s32 deviceHandler_WODE_deinit(file_handle* file) {
}

char wodeRegionToChar(int region) {
return wode_regions[region];
return in_range(region, 0, 4) ? wode_regions[region] : '?';
}

char *wodeRegionToString(int region) {
return wode_regions_str[region];
return in_range(region, 0, 4) ? wode_regions_str[region] : "UNK";
}

s32 deviceHandler_WODE_closeFile(file_handle* file) {
Expand Down
27 changes: 16 additions & 11 deletions cube/swiss/source/swiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,19 @@ void ogc_video__reset()
newmode = &TVNtsc480Prog;
break;
case 0:
if(swissSettings.sramVideo == SYS_VIDEO_MPAL && !getDTVStatus()) {
sprintf(txtbuffer, "Video Mode: %s", "PAL-M 480i");
newmode = &TVMpal480IntDf;
}
else if(swissSettings.sramVideo == SYS_VIDEO_PAL) {
sprintf(txtbuffer, "Video Mode: %s", "PAL 576i");
newmode = &TVPal576IntDfScale;
}
else {
sprintf(txtbuffer, "Video Mode: %s", "NTSC 480i");
newmode = &TVNtsc480IntDf;
switch(swissSettings.sramVideo) {
case SYS_VIDEO_PAL:
sprintf(txtbuffer, "Video Mode: %s", "PAL 576i");
newmode = &TVPal576IntDfScale;
break;
case SYS_VIDEO_MPAL:
sprintf(txtbuffer, "Video Mode: %s", "PAL-M 480i");
newmode = &TVMpal480IntDf;
break;
default:
sprintf(txtbuffer, "Video Mode: %s", "NTSC 480i");
newmode = &TVNtsc480IntDf;
break;
}
break;
case 1 ... 3:
Expand All @@ -116,6 +118,9 @@ void ogc_video__reset()
sprintf(txtbuffer, "Video Mode: %s %s\n%s Mode selected.", "PAL", gameVModeStr[swissSettings.gameVMode], swissSettings.sram60Hz ? "60Hz":"50Hz");
newmode = &TVPal576ProgScale;
break;
default:
newmode = NULL;
break;
}
if((newmode != NULL) && (newmode != getVideoMode())) {
DrawVideoMode(newmode);
Expand Down

0 comments on commit c116022

Please sign in to comment.