Skip to content

Commit

Permalink
- Adjust for libogc2 changes.
Browse files Browse the repository at this point in the history
- Clarify messaging regarding 16 MHz fallback.
  • Loading branch information
Extrems committed Jun 11, 2024
1 parent 0eb9b76 commit aeb0ef8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 29 deletions.
7 changes: 4 additions & 3 deletions cube/swiss/source/devices/deviceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ typedef char* (* _fn_status)(file_handle*);

// Device quirks
#define QUIRK_NONE 0x0
#define QUIRK_GCLOADER_NO_DISC_2 0x1
#define QUIRK_GCLOADER_NO_PARTIAL_READ 0x2
#define QUIRK_GCLOADER_WRITE_CONFLICT 0x4
#define QUIRK_EXI_SPEED 0x1
#define QUIRK_GCLOADER_NO_DISC_2 0x2
#define QUIRK_GCLOADER_NO_PARTIAL_READ 0x4
#define QUIRK_GCLOADER_WRITE_CONFLICT 0x8

// Device emulated features
#define EMU_READ 0x80000000
Expand Down
30 changes: 12 additions & 18 deletions cube/swiss/source/devices/fat/deviceHandler-FAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,35 +339,29 @@ s32 deviceHandler_FAT_init(file_handle* file) {
// SD Card - Slot A
if(isSDCard && slot == 0) {
setSDGeckoSpeed(slot, swissSettings.exiSpeed);
__device_sd_a.features |= FEAT_BOOT_GCM;
file->status = fatFs_Mount(DEV_SDA, "sda:/");
if(file->status != FR_OK) {
setSDGeckoSpeed(slot, false);
__device_sd_a.features &= ~FEAT_BOOT_GCM;
file->status = fatFs_Mount(DEV_SDA, "sda:/");
}
if(sdgecko_getSpeed(slot) < EXI_SPEED32MHZ)
__device_sd_a.quirks |= QUIRK_EXI_SPEED;
else
__device_sd_a.quirks &= ~QUIRK_EXI_SPEED;
}
// SD Card - Slot B
if(isSDCard && slot == 1) {
setSDGeckoSpeed(slot, swissSettings.exiSpeed);
__device_sd_b.features |= FEAT_BOOT_GCM;
file->status = fatFs_Mount(DEV_SDB, "sdb:/");
if(file->status != FR_OK) {
setSDGeckoSpeed(slot, false);
__device_sd_b.features &= ~FEAT_BOOT_GCM;
file->status = fatFs_Mount(DEV_SDB, "sdb:/");
}
if(sdgecko_getSpeed(slot) < EXI_SPEED32MHZ)
__device_sd_b.quirks |= QUIRK_EXI_SPEED;
else
__device_sd_b.quirks &= ~QUIRK_EXI_SPEED;
}
// SD Card - SD2SP2
if(isSDCard && slot == 2) {
setSDGeckoSpeed(slot, swissSettings.exiSpeed);
__device_sd_c.features |= FEAT_BOOT_GCM;
file->status = fatFs_Mount(DEV_SDC, "sdc:/");
if(file->status != FR_OK) {
setSDGeckoSpeed(slot, false);
__device_sd_c.features &= ~FEAT_BOOT_GCM;
file->status = fatFs_Mount(DEV_SDC, "sdc:/");
}
if(sdgecko_getSpeed(slot) < EXI_SPEED32MHZ)
__device_sd_c.quirks |= QUIRK_EXI_SPEED;
else
__device_sd_c.quirks &= ~QUIRK_EXI_SPEED;
}
// IDE-EXI - Slot A
if(!isSDCard && slot == 0) {
Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/gui/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static char *tooltips_global[PAGE_GLOBAL_MAX+1] = {
"Hide unknown file types:\n\nDisabled - Show all files (default)\nEnabled - Swiss will hide unknown file types from being displayed\n\nKnown file types are:\n GameCube Executables (.bin/.dol/.elf)\n Disc images (.gcm/.iso/.nkit.iso/.tgc)\n MP3 Music (.mp3)\n WASP/WKF Flash files (.fzn)\n GameCube Memory Card Files (.gci/.gcs/.sav)\n GameCube Executables with parameters appended (.dol+cli)",
"Flatten directory:\n\nFlattens a directory structure matching a glob pattern.",
"Stop DVD Motor at startup:\n\nDisabled - Leave it as-is (default)\nEnabled - Stop the DVD drive from spinning when Swiss starts\n\nThis option is mostly for users booting from game\nexploits where the disc will already be spinning.",
"SD/IDE Speed:\n\nThe speed to try and use on the EXI bus for SD Card Adapters or IDE-EXI devices.\n32 MHz may not work on some SD cards.",
"SD/IDE Speed:\n\nThe clock speed to try using on the EXI bus for SD Card Adapter\nand IDE-EXI devices. 32 MHz may not work with some SD cards\nor SD card adapters.",
"AVE Compatibility:\n\nSets the compatibility mode for the used audio/video encoder.\n\nAVE N-DOL - Output PAL as NTSC 50\nAVE P-DOL - Disable progressive scan mode\nCMPV-DOL - Enable 1080i & 540p\nGCVideo - Apply general workarounds for GCVideo (default)\nAVE-RVL - Support 960i & 1152i without WiiVideo",
"Force DTV Status:\n\nDisabled - Use detect signal from the Digital AV Out (default)\nEnabled - Force detection in the case of a hardware fault",
"Optimise for RetroTINK-4K:\n\nRequires GCVideo-DVI v3.0 or later with Fix Resolution Off.",
Expand Down
13 changes: 6 additions & 7 deletions cube/swiss/source/swiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,11 @@ void load_game() {
msgBox = DrawPublish(DrawMessageBox(D_WARN, "Device does not support audio streaming.\nThis may impact playability."));
sleep(5);
}
if(swissSettings.exiSpeed && (devices[DEVICE_CUR]->quirks & QUIRK_EXI_SPEED)) {
DrawDispose(msgBox);
msgBox = DrawPublish(DrawMessageBox(D_WARN, "Device is operating in a degraded state.\nThis may impact playability."));
sleep(5);
}
DrawDispose(msgBox);

// Find the config for this game, or default if we don't know about it
Expand Down Expand Up @@ -2229,13 +2234,7 @@ void load_file()
memset(&GCMDisk, 0, sizeof(DiskHeader));
}
else {
uiDrawObj_t *msgBox = NULL;
if(devices[DEVICE_CUR] == &__device_sd_a || devices[DEVICE_CUR] == &__device_sd_b || devices[DEVICE_CUR] == &__device_sd_c) {
msgBox = DrawPublish(DrawMessageBox(D_WARN, "Device does not support disc images.\nSet EXI Speed to 16 MHz to bypass."));
}
else {
msgBox = DrawPublish(DrawMessageBox(D_WARN, "Device does not support disc images."));
}
uiDrawObj_t *msgBox = DrawPublish(DrawMessageBox(D_WARN, "Device does not support disc images."));
sleep(5);
DrawDispose(msgBox);
}
Expand Down

0 comments on commit aeb0ef8

Please sign in to comment.