Skip to content

Commit

Permalink
- Force TGC files to use our reload stub.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Mar 16, 2022
1 parent 1a10861 commit 4d020be
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cube/swiss/source/devices/dvd/deviceHandler-DVD.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ s32 deviceHandler_DVD_setupFile(file_handle* file, file_handle* file2, int numTo
}
}

if(swissSettings.igrType == IGR_BOOTBIN) {
if(swissSettings.igrType == IGR_BOOTBIN || endsWith(file->name,".tgc")) {
memset(&patchFile, 0, sizeof(file_handle));
concat_path(patchFile.name, devices[DEVICE_PATCHES]->initial->name, "swiss/patches/apploader.img");

Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/devices/fat/deviceHandler-FAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ s32 deviceHandler_FAT_setupFile(file_handle* file, file_handle* file2, int numTo
}
}

if(swissSettings.igrType == IGR_BOOTBIN) {
if(swissSettings.igrType == IGR_BOOTBIN || endsWith(file->name,".tgc")) {
memset(&patchFile, 0, sizeof(file_handle));
concat_path(patchFile.name, devices[DEVICE_CUR]->initial->name, "swiss/patches/apploader.img");

Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/devices/fsp/deviceHandler-FSP.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ s32 deviceHandler_FSP_setupFile(file_handle* file, file_handle* file2, int numTo
}
}

if(swissSettings.igrType == IGR_BOOTBIN) {
if(swissSettings.igrType == IGR_BOOTBIN || endsWith(file->name,".tgc")) {
memset(&patchFile, 0, sizeof(file_handle));
concat_path(patchFile.name, devices[DEVICE_PATCHES]->initial->name, "swiss/patches/apploader.img");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ s32 deviceHandler_GCLOADER_setupFile(file_handle* file, file_handle* file2, int
}
}

if(swissSettings.igrType == IGR_BOOTBIN) {
if(swissSettings.igrType == IGR_BOOTBIN || endsWith(file->name,".tgc")) {
memset(&patchFile, 0, sizeof(file_handle));
concat_path(patchFile.name, devices[DEVICE_PATCHES]->initial->name, "swiss/patches/apploader.img");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ s32 deviceHandler_USBGecko_setupFile(file_handle* file, file_handle* file2, int
}
}

if(swissSettings.igrType == IGR_BOOTBIN) {
if(swissSettings.igrType == IGR_BOOTBIN || endsWith(file->name,".tgc")) {
memset(&patchFile, 0, sizeof(file_handle));
concat_path(patchFile.name, devices[DEVICE_PATCHES]->initial->name, "swiss/patches/apploader.img");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ s32 deviceHandler_WKF_setupFile(file_handle* file, file_handle* file2, int numTo
}
}

if(swissSettings.igrType == IGR_BOOTBIN) {
if(swissSettings.igrType == IGR_BOOTBIN || endsWith(file->name,".tgc")) {
memset(&patchFile, 0, sizeof(file_handle));
concat_path(patchFile.name, devices[DEVICE_PATCHES]->initial->name, "swiss/patches/apploader.img");

Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/devices/wode/deviceHandler-WODE.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ s32 deviceHandler_WODE_setupFile(file_handle* file, file_handle* file2, int numT
}
}

if(swissSettings.igrType == IGR_BOOTBIN) {
if(swissSettings.igrType == IGR_BOOTBIN || endsWith(file->name,".tgc")) {
memset(&patchFile, 0, sizeof(file_handle));
concat_path(patchFile.name, devices[DEVICE_PATCHES]->initial->name, "swiss/patches/apploader.img");

Expand Down
3 changes: 2 additions & 1 deletion cube/swiss/source/swiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ void load_game() {
*(vu8*)VAR_EXI_SLOT = EXI_CHANNEL_MAX;
*(vu8*)VAR_EXI_FREQ = EXI_SPEED1MHZ;
*(vu8*)VAR_SD_SHIFT = 0;
*(vu8*)VAR_IGR_TYPE = swissSettings.igrType;
*(vu8*)VAR_IGR_TYPE = swissSettings.igrType | (tgcFile.magic == TGC_MAGIC ? 0x80:0x00);
*(vu32**)VAR_FRAG_LIST = NULL;
*(vu8*)VAR_TRIGGER_LEVEL = swissSettings.triggerLevel;
*(vu8*)VAR_CARD_A_ID = 0x00;
Expand All @@ -1890,6 +1890,7 @@ void load_game() {
}

load_app(filesToPatch, numToPatch);
free(filesToPatch);
config_unload_current();
}

Expand Down

0 comments on commit 4d020be

Please sign in to comment.