Skip to content

Commit

Permalink
- Fix maximum FST size of compilation discs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Feb 10, 2022
1 parent 443321c commit 671c124
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cube/swiss/source/gcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ int parse_gcm(file_handle *file, ExecutableFile *filesToPatch) {
}
free(FST);

// This need to be last so the debug monitor size can be determined.
filesToPatch[numFiles].offset = 0x440;
filesToPatch[numFiles].size = 0x2000;
// This need to be last.
filesToPatch[numFiles].offset = 0;
filesToPatch[numFiles].size = 0x2440;
filesToPatch[numFiles].type = PATCH_OTHER;
sprintf(filesToPatch[numFiles].name, "bi2.bin");
sprintf(filesToPatch[numFiles].name, "boot.bin");
numFiles++;
return numFiles;
}
Expand Down Expand Up @@ -339,6 +339,9 @@ int parse_tgc(file_handle *file, ExecutableFile *filesToPatch, u32 tgc_base, cha
devices[DEVICE_CUR]->readFile(file,&tgcHeader,sizeof(TGCHeader));

if(tgcHeader.magic != TGC_MAGIC) return -1;
if(tgcHeader.fstMaxLength > GCMDisk.MaxFSTSize) {
GCMDisk.MaxFSTSize = tgcHeader.fstMaxLength;
}

if(tgcHeader.apploaderOffset != 0) {
ApploaderHeader apploaderHeader;
Expand Down
11 changes: 11 additions & 0 deletions cube/swiss/source/patcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -11455,6 +11455,17 @@ int Patch_GameSpecificFile(void *data, u32 length, const char *gameID, const cha
void *addr;
int patched = 0;

if (!strcmp(fileName, "boot.bin")) {
memcpy(data, &GCMDisk, length);
memset(data + 0x200, 0, 0x200);

print_gecko("Patched:[%s]\n", fileName);
patched++;

data += 0x440;
length -= 0x440;
fileName = "bi2.bin";
}
if (!strncmp(gameID, "DPOJ8P", 6)) {
if (!strcmp(fileName, "bi2.bin")) {
*(u32 *)(data + 0x4) = 0x1800000;
Expand Down

0 comments on commit 671c124

Please sign in to comment.