Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // NOTE: Save file expansion unintentionally disables global data writing (for now)
- /*
- Only useful if you need to have more singles/bunches/coins in the world or you need more flags
- The following code needs to be run during ROM init
- */
- void expandSaveFile(int static_expansion, int actor_count) {
- /*
- Example Usage:
- expandSaveFile(0x100,300);
- 0x100 - How many flags extra you'll need outside of coins/cbs/dirt patches
- 300 - Max Amount of balloons and dirt patches you're expecting (Vanilla: 121)
- */
- int expansion = static_expansion + actor_count;
- int model2_start = 800 + expansion;
- int flag_block_size = 0x6B7 + expansion;
- // Flag Block Size
- *(short*)(0x8060E36A) = flag_block_size;
- *(short*)(0x8060E31E) = flag_block_size;
- *(short*)(0x8060E2C6) = flag_block_size;
- *(short*)(0x8060D54A) = flag_block_size;
- *(short*)(0x8060D4A2) = flag_block_size;
- *(short*)(0x8060D45E) = flag_block_size;
- *(short*)(0x8060D3C6) = flag_block_size;
- *(short*)(0x8060D32E) = flag_block_size;
- *(short*)(0x8060D23E) = flag_block_size;
- *(short*)(0x8060CF62) = flag_block_size;
- *(short*)(0x8060CC52) = flag_block_size;
- *(short*)(0x8060C78A) = flag_block_size;
- *(short*)(0x8060C352) = flag_block_size;
- *(short*)(0x8060BEC6) = flag_block_size - 0x72; // (0x645, might need adjusting)
- *(short*)(0x8060BF96) = flag_block_size;
- *(short*)(0x8060BA7A) = flag_block_size;
- // Model 2 Start
- *(short*)(0x8060C2F2) = model2_start;
- *(short*)(0x8060BCDE) = model2_start;
- // Reallocate Balloons + Patches
- *(short*)(0x80688BCE) = 800 + static_expansion; // Reallocated to just before model 2 block
- }
- // 1-File Fixes
- /*
- Does the following things:
- - Disables EEPROM Shuffling
- - Files 2 & 3 read file 1
- - Saving cannot occur with files 2->4. For all intents & purposes, these files no longer exist
- */
- *(int*)(0x8060CF34) = 0x240E0001; // Slot 1
- *(int*)(0x8060CF38) = 0x240F0002; // Slot 2
- *(int*)(0x8060CF3C) = 0x24180003; // Slot 3
- *(int*)(0x8060CF40) = 0x240D0000; // Slot 0
- *(int*)(0x8060D3AC) = 0; // Prevent EEPROM Shuffle
- *(int*)(0x8060DCE8) = 0; // Prevent EEPROM Shuffle
- *(int*)(0x8060C760) = 0x24900000; // Always load file 0
- *(short*)(0x8060CC22) = 1; // File Loop Cancel 1
- *(short*)(0x8060CD1A) = 1; // File Loop Cancel 2
- *(short*)(0x8060CE7E) = 1; // File Loop Cancel 3
- *(short*)(0x8060CE5A) = 1; // File Loop Cancel 4
- *(short*)(0x8060CF0E) = 1; // File Loop Cancel 5
- *(short*)(0x8060CF26) = 1; // File Loop Cancel 6
- *(short*)(0x8060D0DE) = 1; // File Loop Cancel 7
- *(short*)(0x8060D106) = 1; // File Loop Cancel 8
- *(short*)(0x8060D43E) = 1; // File Loop Cancel 8
- *(int*)(0x8060CD08) = 0x26670000; // Save to File - File Index
- *(int*)(0x8060CE48) = 0x26670000; // Save to File - File Index
- *(int*)(0x8060CF04) = 0x26270000; // Save to File - File Index
- *(int*)(0x8060BFA4) = 0x252A0000; // Global Block after 1 file entry
- *(int*)(0x8060E378) = 0x258D0000; // Global Block after 1 file entry
- *(int*)(0x8060D33C) = 0x254B0000; // Global Block after 1 file entry
- *(int*)(0x8060D470) = 0x256C0000; // Global Block after 1 file entry
- *(int*)(0x8060D4B0) = 0x252A0000; // Global Block after 1 file entry
- *(int*)(0x8060D558) = 0x258D0000; // Global Block after 1 file entry
- *(int*)(0x8060CF74) = 0x25090000; // Global Block after 1 file entry
- *(int*)(0x8060CFCC) = 0x25AE0000; // Global Block after 1 file entry
- *(int*)(0x8060D24C) = 0x25AE0000; // Global Block after 1 file entry
- *(int*)(0x8060C84C) = 0xA02067C8; // Force file 0
- *(int*)(0x8060C654) = 0x24040000; // Force file 0 - Save
- *(int*)(0x8060C664) = 0xAFA00034; // Force file 0 - Save
- *(int*)(0x8060C6C4) = 0x24040000; // Force file 0 - Read
- *(int*)(0x8060C6D4) = 0xAFA00034; // Force file 0 - Read
Advertisement
Add Comment
Please, Sign In to add comment