Advertisement
imbued

Chest SRM Notes (Graveyard 50r Chest)

Dec 21st, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.34 KB | None | 0 0
  1. Graveyard 50r Chest SRM Notes:
  2.  
  3. Left-most column here (treat as 2 bytes) https://wiki.cloudmodding.com/mm/Ovl_player_actor/Get_Items
  4.  
  5. 0xBE is the offset for angle (2 bytes)
  6. We care about the 2 bytes at [chest] + 0x21E
  7. We will use [pot] + 0xBE
  8.  
  9. 0x21E = 542
  10. 0xBE = 190
  11. [chest] + 542 = [pot] + 190
  12. [pot] - [chest] = 542 - 190 = 352
  13. 352 = 0x160
  14.  
  15. -------------------------------------------------------------------------
  16.  
  17. https://pastebin.com/cx7Q6b3a
  18.  
  19. AI = Actor Instance
  20. AF = Actor File, also known as an Overlays
  21.  
  22. ===OVERLAYS===
  23. 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.
  24.  
  25. There are three types of allocation for overlays:
  26. 0: The overlay allocates into the earliest spot it can on the heap
  27. 1: The overlay allocates into the end of the heap, as far as it can go
  28. 2: The overlay allocates to the end, and will never deallocate until you reload a scene.
  29.  
  30. 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.
  31.  
  32. 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.
  33. -------------------------------------------------------------------------
  34.  
  35. I'll use different overlay types...
  36.  
  37. 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.
  38. 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)
  39.  
  40. -------------------------------------------------------------------------
  41.  
  42. https://wiki.cloudmodding.com/mm/Actors#Categories
  43.  
  44. 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.
  45.  
  46. -------------------------------------------------------------------------
  47. https://wiki.cloudmodding.com/mm/Scene_List_(Debug)
  48.  
  49. -------------------------------------------------------------------------
  50.  
  51. Actors we can drop/create:
  52. (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)
  53.  
  54. 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
  55.  
  56.  
  57. AI 0009: 516 bytes Bomb Type B Overlay 3 Instances Max
  58.  
  59. AF 00A2: 24448 bytes Smoke OVERLAY
  60. AI 00A2: 11908 bytes Smoke Type A Overlay 3 Instances Max (can have more, but just assert this for now_
  61.  
  62. AI 000F: 632 bytes Arrow Type B Overlay 5 Instances Max
  63.  
  64. 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.
  65.  
  66. 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
  67.  
  68. AF 007B: 5104 bytes Spin Attack Charge Particles OVERLAY
  69. 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)
  70.  
  71. 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)
  72.  
  73. 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)
  74.  
  75. AF 0017: 10432 bytes Fish OVERLAY
  76. AI 0017: 636 bytes Fish Type A Overlay 2 Instances Max (just assert this for now)
  77.  
  78. AF 017B: 14320 bytes Bug OVERLAY
  79. 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
  80.  
  81.  
  82.  
  83.  
  84.  
  85. -------------------------------------------------------------------------
  86.  
  87. 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))
  88.  
  89. 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.
  90.  
  91.  
  92. Room 0:
  93. Possible to Deallocate without leaving the room?
  94. AI 0005: 460 bytes Wooden Door Type B Overlay No Category 10
  95. AI 0018: 332 bytes Loading Plane Type B Overlay No Category 10
  96. *AF 015A: 6000 bytes Clock OVERLAY No
  97. *AI 015A: 340 bytes Clock Type A Overlay No Category 0
  98. AF 00E8: 1984 bytes Rupee Cluster OVERYLAY Yes
  99. AI 00E8: 360 bytes Rupee Cluster Type A Overlay Yes Category 1
  100. AF 0170: 10688 bytes Dripping Water Effect OVERYLAY No
  101. AI 0170: 3644 bytes Dripping Water Effect Type A Overlay No Category 9
  102. AI 0170: 3644 bytes Dripping Water Effect Type A Overlay No Category 9
  103. AF 0039: 3552 bytes Torch Stand (Generic) OVERYLAY No
  104. AI 0039: 500 bytes Torch Stand (Generic) Type A Overlay No Category 6
  105. AF 0082: 9040 bytes Pot OVERYLAY Yes
  106. AI 0082: 412 bytes Pot (303.0, 0.0, 269.0) Type A Overlay Yes
  107. AI 0082: 412 bytes Pot (330.0, 0.0, 397.0) Type A Overlay Yes
  108. AI 0082: 412 bytes Pot (-200.0, 0.0, -330.0) Type A Overlay Yes
  109. AF 0158: 1104 bytes ??? OVERYLAY No
  110. AI 0158: 328 bytes ??? Type A Overlay No
  111. AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
  112. AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
  113. AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
  114. AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
  115. AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
  116. AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
  117. AI 000E: 424 bytes Collectible (Rupee from Rupee Cluster) N/A Yes
  118.  
  119.  
  120. Room 1:
  121.  
  122. AI 001E: 368 bytes Door Shutter Type B No
  123. AI 0018: 332 bytes Loading Plane Type B No
  124. *AF 015A: 6000 bytes Clock OVERLAY No
  125. *AI 015A: 340 bytes Clock Type A No
  126. AF 015B: 6048 bytes Bad Bat OVERLAY Yes
  127. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  128. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  129. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  130. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  131. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  132. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  133. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  134. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  135. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  136. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  137. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  138. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  139. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  140. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  141. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  142. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  143. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  144. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  145. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  146. AI 015B: 476 bytes Bad Bat Type A Yes Category 5
  147. AF 0039: 3552 bytes Torch Stand (Generic) OVERLAY No
  148. AI 0039: 500 bytes Torch Stand (Generic) Type A No
  149. AI 0039: 500 bytes Torch Stand (Generic) Type A No
  150. AI 0039: 500 bytes Torch Stand (Generic) Type A No
  151. AF 0082: 9040 bytes Pot OVERLAY Yes
  152. AI 0082: 412 bytes Pot (829.0, 0.0, 234.0) Type A Yes
  153. AI 0082: 412 bytes Pot (835.0, 0.0, 409.0) Type A Yes
  154. AI 0082: 412 bytes Pot (1270.0, 0.0, 380.0) Type A Yes
  155. AF 0006: 8640 bytes Chest OVERLAY No
  156. AI 0006: 548 bytes Chest Type A No
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement