Only patch Stadium data for a 2MB ROM

This commit is contained in:
Rangi 2022-12-03 11:10:55 -05:00
parent b232b4be5f
commit eb28b5ae56

View File

@ -342,8 +342,10 @@ struct Buffer *process_template(const char *template_filename, const char *patch
buffer_append(patches, &(struct Patch){0x14e, 2}); buffer_append(patches, &(struct Patch){0x14e, 2});
// The Stadium data (see stadium.c) will always differ // The Stadium data (see stadium.c) will always differ
unsigned int rom_size = (unsigned int)xfsize("", orig_rom); unsigned int rom_size = (unsigned int)xfsize("", orig_rom);
unsigned int stadium_size = 24 + 6 + 2 + (rom_size / 0x2000) * 2; if (rom_size == 128 * 0x4000) {
buffer_append(patches, &(struct Patch){rom_size - stadium_size, stadium_size}); unsigned int stadium_size = 24 + 6 + 2 + 128 * 2 * 2;
buffer_append(patches, &(struct Patch){rom_size - stadium_size, stadium_size});
}
// Fill in the template // Fill in the template
const struct Symbol *current_hook = NULL; const struct Symbol *current_hook = NULL;