Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Graveyard 50r Chest SRM Notes:
- Left-most column here (treat as 2 bytes) https://wiki.cloudmodding.com/mm/Ovl_player_actor/Get_Items
- 0xBE is the offset for angle (2 bytes)
- We care about the 2 bytes at [chest] + 0x21E
- We will use [pot] + 0xBE
- 0x21E = 542
- 0xBE = 190
- [chest] + 542 = [pot] + 190
- [pot] - [chest] = 542 - 190 = 352
- 352 = 0x160
- -------------------------------------------------------------------------
- https://pastebin.com/cx7Q6b3a
- AI = Actor Instance
- AF = Actor File, also known as an Overlays
- ===OVERLAYS===
- Overlays contain a lot of the functions for how actors should run. An overlay will always allocate in earlier (in time) than the instance - essentially the overlay being on the heap is a prerequisite for the instance.
- There are three types of allocation for overlays:
- 0: The overlay allocates into the earliest spot it can on the heap
- 1: The overlay allocates into the end of the heap, as far as it can go
- 2: The overlay allocates to the end, and will never deallocate until you reload a scene.
- For types 0 and 1, the overlay will de-allocate if all the instances disappear. 2 will not. Most actors have type 0 overlays, but most actors that are spawned by link (bombs, chus, quickspin effect) will have type 2.
- The one exception is the item pickup actor which (at least in OoT) doesn't actually have an overlay because it checks some static code elsewhere in memory instead.
- -------------------------------------------------------------------------
- I'll use different overlay types...
- Type A: The overlay (AF) will allocate into the earliest part of the heap that it can fit, it will essentially be treated like another element of the priority queue. This will deallocate only if all corresponding Actor Instances deallocate.
- Type B: The overlay (AF) will load past the relevant part of the actor heap (that is, it'll load at 0x5XXXXX, which is past >1 million bytes of free space that exist in the actor heap, so the overlay will essentially have no effect on the heap manipulation)
- -------------------------------------------------------------------------
- https://wiki.cloudmodding.com/mm/Actors#Categories
- Actors are in different categories. If an actor is in Category 5, then their AIs and AFs will not load + deallocate immediately, so there will not be a gap where these used to be.
- -------------------------------------------------------------------------
- https://wiki.cloudmodding.com/mm/Scene_List_(Debug)
- -------------------------------------------------------------------------
- Actors we can drop/create:
- (Note: The Maximum number of instances is not necessarily the most that is possible in-game, but it will be the most I'll ever attempt to spawn for now)
- While it is possible to drop a bomb and then spawn some stuff before the smoke appears to change where the smoke loads, it might be best to just write a simpler version of the spawning script that doesn't do this yet and see how easy it is to get solutions without accounting for this. With the simpler spawning script in mind, I won't include deku nut for now since the only thing I'd ever use that for is to change where smoke appears
- AI 0009: 516 bytes Bomb Type B Overlay 3 Instances Max
- AF 00A2: 24448 bytes Smoke OVERLAY
- AI 00A2: 11908 bytes Smoke Type A Overlay 3 Instances Max (can have more, but just assert this for now_
- AI 000F: 632 bytes Arrow Type B Overlay 5 Instances Max
- AI 003D: 528 bytes Hookshot Type B Overlay 1 Instance Max Assert that this is the last thing we spawn, if we spawn it... however could drop bomb, pull hook, then have smoke appear... should try to think of a way to incorporate this into the script, etc.
- AI 0035: 452 bytes Spin Attack & Sword Beam Effects Type B Overlay 1 Instance Max This is the only thing that appears if you do a quickspin instead of a charged spin attack, can in theory drop a bomb, quickspin, then have bomb explode to change where the smoke allocates... should think about how to encode this concept into the script
- AF 007B: 5104 bytes Spin Attack Charge Particles OVERLAY
- AI 007B: 1367 bytes Spin Attack Charge Particles Type A Overlay 1 Instance Max These only appear if you do a charged spin attack, but the 0035 gets prioritized over this (i.e. the 0035 gets allocated first)
- AI 006A: 480 bytes Chu Type B Overlay 3 Instances Max assert that bomb count + chu count <= 3 (though technically in a tool-assisted setting this wouldn't be necessary according to gns)
- AI 0020: 500 bytes Zora Fin Type B Overlays 2 Instances Max assert that 2 always get allocated (and don't account for catching just one before entering plane yet)
- AF 0017: 10432 bytes Fish OVERLAY
- AI 0017: 636 bytes Fish Type A Overlay 2 Instances Max (just assert this for now)
- AF 017B: 14320 bytes Bug OVERLAY
- AI 017B: 884 bytes Bug Type A Overlay 2 Sets Max (3 Instances per set); just assert this for now. Also assert that (bug set count) + (fish count) <= 2 for now
- -------------------------------------------------------------------------
- Memory that we care about starts at 0x40B150 (assumes you have tatl which is actor id 0010, see: https://wiki.cloudmodding.com/mm/Actor_List_(Variables))
- None of the rooms in Beneath the Graveyard have Clock actors, so the clock will default to loading where I listed it to load and it will not attempt to allocate a new clock instance when loading new rooms and thus will not leave a gap anywhere.
- Room 0:
- Possible to Deallocate without leaving the room?
- AI 0005: 460 bytes Wooden Door Type B Overlay No Category 10
- AI 0018: 332 bytes Loading Plane Type B Overlay No Category 10
- *AF 015A: 6000 bytes Clock OVERLAY No
- *AI 015A: 340 bytes Clock Type A Overlay No Category 0
- AF 00E8: 1984 bytes Rupee Cluster OVERYLAY Yes
- AI 00E8: 360 bytes Rupee Cluster Type A Overlay Yes Category 1
- AF 0170: 10688 bytes Dripping Water Effect OVERYLAY No
- AI 0170: 3644 bytes Dripping Water Effect Type A Overlay No Category 9
- AI 0170: 3644 bytes Dripping Water Effect Type A Overlay No Category 9
- AF 0039: 3552 bytes Torch Stand (Generic) OVERYLAY No
- AI 0039: 500 bytes Torch Stand (Generic) Type A Overlay No Category 6
- AF 0082: 9040 bytes Pot OVERYLAY Yes
- AI 0082: 412 bytes Pot (303.0, 0.0, 269.0) Type A Overlay Yes
- AI 0082: 412 bytes Pot (330.0, 0.0, 397.0) Type A Overlay Yes
- AI 0082: 412 bytes Pot (-200.0, 0.0, -330.0) Type A Overlay Yes
- AF 0158: 1104 bytes ??? OVERYLAY No
- AI 0158: 328 bytes ??? Type A Overlay No
- AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
- AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
- AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
- AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
- AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
- AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
- AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
- Room 1:
- AI 001E: 368 bytes Door Shutter Type B No
- AI 0018: 332 bytes Loading Plane Type B No
- *AF 015A: 6000 bytes Clock OVERLAY No
- *AI 015A: 340 bytes Clock Type A No
- AF 015B: 6048 bytes Bad Bat OVERLAY Yes
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AI 015B: 476 bytes Bad Bat Type A Yes Category 5
- AF 0039: 3552 bytes Torch Stand (Generic) OVERLAY No
- AI 0039: 500 bytes Torch Stand (Generic) Type A No
- AI 0039: 500 bytes Torch Stand (Generic) Type A No
- AI 0039: 500 bytes Torch Stand (Generic) Type A No
- AF 0082: 9040 bytes Pot OVERLAY Yes
- AI 0082: 412 bytes Pot (829.0, 0.0, 234.0) Type A Yes
- AI 0082: 412 bytes Pot (835.0, 0.0, 409.0) Type A Yes
- AI 0082: 412 bytes Pot (1270.0, 0.0, 380.0) Type A Yes
- AF 0006: 8640 bytes Chest OVERLAY No
- AI 0006: 548 bytes Chest Type A No
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement