from ..common.patching.z80asm.Assembler import GameboyAddress from ..data.Constants import * # [x, y] = everything between x and y (included) is free # int = end of bank CAVE_DATA: list[int | list[int | list[int]]] = [ 0x3ec8, # 00 0x3e89, # 01 [ # 02 [0x023d, 0x02a3], # fileSelectMode5 0x35bb # End of bank ], 0x3dd7, # 03 [ # 04 [0x2776, 0x280f], # roomTileChangesAfterLoad for trees, which are reimplemented 0x3e12 # End of bank ], 0x3e2d, # 05 0x3864, # 06 - 128 bytes reserved for sprite expansion w/ web patcher 0x3910, # 07 [ # 08 [0x2395, 0x26fd], # Bipin & Blossom child mechanic 0x3fc0 # End of bank ], [ [0x2e6d, 0x2eae], # Ricky giving his flute 0x3f4e, # 09 ], [ # 0a # Some space could be gotten by blanking code on the Vasu snakes [0x3bba, 0x3bd0], # Blank from removing the spin upon obtaining the sword in d0 0x3be9, ], [ # 0b [0x2717, 0x27a1], # Rosa hiding [0x34ac, 0x34ee], # Impa intro script [0x39b4, 0x39e9], # Twinrova cutscene 1 [0x39f5, 0x3a29], # Twinrova cutscene 2 0x3f6d # End of bank ], 0x3ea1, # 0c 0x3b82, # 0d 0x3ef3, # 0e 0x3f9d, # 0f 0x3bee, # 10 0x3eb0, # 11 0x3c8f, # 12 0x3bd2, # 13 [ [0x0e3f, 0x0f51], # Rosa hiding 0x2fc9, # 14 - ton of free space here ], [ # 15 [0x1435, 0x1464], # Trade item (0x41) data [0x1e5d, 0x1edd], # Strange bros stealing feathers, companions in swamp 0x392d ], 0x3a07, # 16 0x3f3a, # 17 0x3e6d, # 18 0x36e1, # 19 0x30f0, # 1a - here too 0x3c40, # 1b 0x4000, # 1c 0x4000, # 1d 0x4000, # 1e 0x4000, # 1f 0x4000, # 20 0x4000, # 21 0x4000, # 22 0x4000, # 23 0x4000, # 24 0x4000, # 25 0x4000, # 26 0x4000, # 27 0x4000, # 28 0x4000, # 29 0x4000, # 2a 0x4000, # 2b 0x4000, # 2c 0x4000, # 2d 0x4000, # 2e 0x4000, # 2f 0x4000, # 30 0x4000, # 31 0x4000, # 32 0x4000, # 33 0x4000, # 34 0x4000, # 35 0x4000, # 36 0x4000, # 37 0x3df0, # 38 [ # 39 [0x0c00, 0x0c08], # Skipped weird call, this bank is packed so better use any room [0x115d, 0x1169], # "sndd6"-"snddd", unused sound descriptors [0x145c, 0x1468], # mus41, unused music descriptor [0x1a79, 0x1a85], # Junk data at the end of sndde 0x3ff2 # End of bank ], 0x4000, # 3a 0x4000, # 3b 0x4000, # 3c 0x4000, # 3d 0x4000, # 3e 0x314b, # 3f - also here # New banks 0x0000, # 40 ] DEFINES = { # WRAM addresses "wSubscreen1CurrentSlotIndex": "$c085", "wOriginalMinimapGroup": "$c09d", # Custom address "wOriginalDungeonIndex": "$c09e", # Custom address "wMinimapCycleToNextMode": "$c09f", # Custom address "wKeysPressed": "$c481", "wKeysJustPressed": "$c482", "wPaletteThread_mode": "$c4ab", "wCustomBuffer": "$c4bf", # Custom address "wAnimalRegion": "$c610", "wRingsObtained": "$c616", "wTotalSignsDestroyed": "$c626", "wDeathRespawnBuffer": "$c62b", "wMinimapGroup": "$c63a", "wBoughtShopItems2": "$c640", "wBoughtSubrosianItems": "$c642", "wDimitriState": "$c644", "wAnimalTutorialFlags": "$c646", "wGashaSpotFlags": "$c649", "wDungeonCompasses": "$c67c", "wDungeonMaps": "$c67e", "wSeedSatchelLevel": "$c680", # Moved from c6ae "