Skip to content

Commit

Permalink
- Fix 2 disc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
emukidid committed May 16, 2018
1 parent 90b3365 commit f185467
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions cube/swiss/source/devices/fat/deviceHandler-FAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ s32 getFragments(file_handle* file, vu32* fragTbl, s32 maxFrags, u32 forceBaseOf
if(!file->ffsFp) {
devices[DEVICE_CUR]->readFile(file, NULL, 0); // open the file (should be open already)
}

if(!file->ffsFp) {
return 0;
}

// fatfs - Cluster link table map buffer
DWORD clmt[(maxFrags*2) + 1];
Expand Down Expand Up @@ -349,10 +353,9 @@ s32 deviceHandler_FAT_setupFile(file_handle* file, file_handle* file2) {
return 0;
}
// TODO fix 2 disc patched games
if(!(frags = getFragments(file2, &fragList[(maxFrags*3)], maxFrags, 0, 0))) {
return 0;
if((frags = getFragments(file2, &fragList[(maxFrags*3)], maxFrags, 0, 0))) {
totFrags += frags;
}
totFrags += frags;
}

// Disk 1 base sector
Expand Down
2 changes: 1 addition & 1 deletion cube/swiss/source/swiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ void load_game() {
// you're trying to load a disc1 of something
if(curFile.name[strlen(secondDisc->name)-5] == '1') {
secondDisc->name[strlen(secondDisc->name)-5] = '2';
} else if(curFile.name[strlen(secondDisc->name)-5] == '2') {
} else if(curFile.name[strlen(secondDisc->name)-5] == '2' && strcasecmp(getRelativeName(curFile.name), "disc2.iso")) {
secondDisc->name[strlen(secondDisc->name)-5] = '1';
} else if(!strcasecmp(getRelativeName(curFile.name), "game.iso")) {
memset(secondDisc->name, 0, PATHNAME_MAX);
Expand Down

0 comments on commit f185467

Please sign in to comment.