ref: eb28b5ae565f374a69da5f00070d6de358e41eb6
parent: b232b4be5fd614fdb9b1c420ca260964b258ac33
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sat Dec 3 06:10:55 EST 2022
Only patch Stadium data for a 2MB ROM
--- a/tools/make_patch.c
+++ b/tools/make_patch.c
@@ -342,8 +342,10 @@
buffer_append(patches, &(struct Patch){0x14e, 2});
// The Stadium data (see stadium.c) will always differ
unsigned int rom_size = (unsigned int)xfsize("", orig_rom);
- unsigned int stadium_size = 24 + 6 + 2 + (rom_size / 0x2000) * 2;
- buffer_append(patches, &(struct Patch){rom_size - stadium_size, stadium_size});
+ if (rom_size == 128 * 0x4000) {
+ 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
const struct Symbol *current_hook = NULL;