Skip to content

Commit

Permalink
- Only enable for GC Loader if eligible as patch device.
Browse files Browse the repository at this point in the history
- Forcibly use GC Loader as patch device if enabled features demand it.
  • Loading branch information
Extrems committed Mar 5, 2024
1 parent 600fa45 commit e8911d3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cube/swiss/source/bba.c
Expand Up @@ -35,7 +35,8 @@ void init_network(void *args) {
}

if(if_nametoindex("E20") == 1) {
__device_gcloader.emulable |= EMU_ETHERNET;
if(__device_gcloader.features & FEAT_PATCHES)
__device_gcloader.emulable |= EMU_ETHERNET;
__device_ata_c.emulable |= EMU_ETHERNET;
__device_sd_c.emulable |= EMU_ETHERNET;
__device_sd_a.emulable |= EMU_ETHERNET;
Expand Down
Expand Up @@ -337,7 +337,7 @@ u32 deviceHandler_GCLoader_emulated() {
else if (swissSettings.emulateReadSpeed)
return EMU_READ | EMU_READ_SPEED;
else if (swissSettings.emulateEthernet && (devices[DEVICE_CUR]->emulable & EMU_ETHERNET))
return EMU_READ | EMU_ETHERNET;
return EMU_READ | EMU_ETHERNET | EMU_BUS_ARBITER;
else if (swissSettings.emulateMemoryCard &&
!(swissSettings.audioStreaming && (devices[DEVICE_CUR]->quirks & QUIRK_GCLOADER_WRITE_CONFLICT)))
return EMU_READ | EMU_MEMCARD;
Expand Down
6 changes: 6 additions & 0 deletions cube/swiss/source/gcm.c
Expand Up @@ -510,7 +510,13 @@ int patch_gcm(ExecutableFile *filesToPatch, int numToPatch) {
bool patchDeviceReady = false;
if(devices[DEVICE_CUR]->features & FEAT_PATCHES) {
if(devices[DEVICE_CUR] == &__device_gcloader && (devices[DEVICE_CONFIG] == &__device_sd_a || devices[DEVICE_CONFIG] == &__device_sd_b || devices[DEVICE_CONFIG] == &__device_sd_c)) {
devices[DEVICE_PATCHES] = devices[DEVICE_CUR];
u32 emulated = devices[DEVICE_CUR]->emulated();
devices[DEVICE_PATCHES] = devices[DEVICE_CONFIG];
if((emulated ^ devices[DEVICE_CUR]->emulated()) & ~EMU_BUS_ARBITER) {
devices[DEVICE_PATCHES] = devices[DEVICE_CUR];
patchDeviceReady = true;
}
}
else {
devices[DEVICE_PATCHES] = devices[DEVICE_CUR];
Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/patcher.c
Expand Up @@ -335,7 +335,7 @@ int install_code(int final)
patch = gcloader_v2_card_bin;
patchSize = gcloader_v2_card_bin_size;
break;
case EMU_READ | EMU_ETHERNET:
case EMU_READ | EMU_ETHERNET | EMU_BUS_ARBITER:
patch = gcloader_v2_eth_bin;
patchSize = gcloader_v2_eth_bin_size;
break;
Expand Down

0 comments on commit e8911d3

Please sign in to comment.