Advertisement
Guest User

Katam Luascript 0.5.1 fix

a guest
Aug 25th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 61.68 KB | Gaming | 0 0
  1. local ScriptInfo = {"KATAM Luascript by Mugg1991",
  2.                     "v0.5.1",  
  3.                     "25th Aug 2024"}
  4.  
  5. local Padding = {
  6.     Left = 30,
  7.     Top = 30,
  8.     Right = 200,
  9.     Bottom = 30
  10. }
  11.  
  12. local AddressTableGeneral= {
  13. [1] = {1,"Camera X",0xFFFFE0A0,"EWRAM",0x23660,2,true},
  14. [2] = {1,"Camera Y",0xFFFFE0A0,"EWRAM",0x23662,2,true},
  15. [3] = {1,"RNG 1",0xFFFFE0A0,"IWRAM",0x68D8,1,true},
  16. [4] = {1,"RNG 2",0xFFFFE0A0,"IWRAM",0x68D9,1,true},
  17. [5] = {1,"RNG 3",0xFFFFE0A0,"IWRAM",0x68DA,1,true},
  18. [6] = {1,"RNG 4",0xFFFFE0A0,"IWRAM",0x68DB,1,true}
  19. }
  20.  
  21. local abilityNames= {
  22. [00] = "Normal",
  23. [01] = "Fire",
  24. [02] = "Ice",
  25. [03] = "Burning",
  26. [04] = "Wheel",
  27. [05] = "Parasol",
  28. [06] = "Cutter",
  29. [07] = "Beam",
  30. [08] = "Stone",
  31. [09] = "Bomb",
  32. [10] = "Throw",
  33. [11] = "Sleep",
  34. [12] = "Cook",
  35. [13] = "Laser",
  36. [14] = "UFO",
  37. [15] = "Spark",
  38. [16] = "Tornado",
  39. [17] = "Hammer",
  40. [18] = "Sword",
  41. [19] = "Cupid",
  42. [20] = "Fighter",
  43. [21] = "Magic",
  44. [22] = "Smash",
  45. [23] = "Mini",
  46. [24] = "Crash",
  47. [25] = "Missile",
  48. [26] = "Master"
  49. }
  50.  
  51. local enemyNames = {
  52. [00] = "Waddle Dee",
  53. [01] = "Bronto Burt",
  54. [02] = "Blipper",
  55. [03] = "Glunk",
  56. [04] = "Squishy",
  57. [05] = "Scarfy",
  58. [06] = "Gordo",
  59. [07] = "Snooter",
  60. [08] = "Chip",
  61. [09] = "Soarar",
  62. [10] = "Haley",
  63. [11] = "Roly-Poly",
  64. [12] = "Cupie",
  65. [13] = "Blockin",
  66. [14] = "Snooter",
  67. [15] = "Leap",
  68. [16] = "Jack",
  69. [17] = "Big Waddle Dee",
  70. [18] = "Waddle Doo",
  71. [19] = "Flamer",
  72. [20] = "Hot Head",
  73. [21] = "Laser Ball",
  74. [22] = "Pengy",
  75. [23] = "Rocky",
  76. [24] = "Sir Kibble",
  77. [25] = "Sparky",
  78. [26] = "Sword Knight",
  79. [27] = "UFO",
  80. [28] = "Twister",
  81. [29] = "Wheelie",
  82. [30] = "Noddy",
  83. [31] = "Golem",
  84. [32] = "Golem",
  85. [33] = "Golem",
  86. [34] = "Foley",
  87. [35] = "Shooty",
  88. [36] = "Scarfy",
  89. [37] = "Boxin",
  90. [38] = "Cookin",
  91. [39] = "Minny",
  92. [40] = "Bomber",
  93. [41] = "Heavy Knight",
  94. [42] = "Giant Rocky",
  95. [43] = "Metal Guardian",
  96. [44] = "---",
  97. [45] = "Batty",
  98. [46] = "Foley",
  99. [47] = "Bang-Bang",
  100. [48] = "---",
  101. [49] = "Cookin",
  102. [50] = "Droppy",
  103. [51] = "Prank",
  104. [52] = "Mirra",
  105. [53] = "Shotzo",
  106. [54] = "Shadow Kirby",
  107. [55] = "Waddle Dee",
  108. [56] = "Mr. Flosty",
  109. [57] = "Bonkers",
  110. [58] = "Phan Phan",
  111. [59] = "Batafire",
  112. [60] = "Box Boxer",
  113. [61] = "Boxy",
  114. [62] = "Master Hand",
  115. [63] = "Bombar",
  116. [64] = "---",
  117. [65] = "---",
  118. [66] = "---",
  119. [67] = "---",
  120. [68] = "---",
  121. [69] = "Kracko",
  122. [70] = "King Golem",
  123. [71] = "Master Hand",
  124. [72] = "Gobbler",
  125. [73] = "Wiz",
  126. [74] = "Moley",
  127. [75] = "Mega Titan",
  128. [76] = "Titan Head",
  129. [77] = "Crazy Hand",
  130. [78] = "Dark Meta Knight",
  131. [79] = "Dark Mind",
  132. [80] = "Dark Mind",
  133. [81] = "Dark Mind",
  134. [82] = "? ? ?",
  135. [83] = "---",
  136. [84] = "---",
  137. [85] = "---",
  138. [86] = "---",
  139. [87] = "---",
  140. [88] = "---",
  141. [89] = "---",
  142. [90] = "---",
  143. [91] = "---",
  144. [92] = "---",
  145. [93] = "---",
  146. [94] = "Cherry",
  147. [95] = "Energy Drink",
  148. [96] = "Meat",
  149. [97] = "Maxim Tomato",
  150. [98] = "Battery",
  151. [99] = "1-Up",
  152. [100] = "Rare Candy",
  153. [146] = "Ability Pedestral",
  154. [152] = "Master Sword",
  155. [155] = "Rock",
  156. [157] = "Foley's Leaves",
  157. [162] = "Waddle Dee's Parasol",
  158. [163] = "Ability Star",
  159. [166] = "Ice Cube",
  160. [213] = "Sir Kibble Proj.",
  161. [214] = "Glunk Projectile",
  162. [215] = "Shotzo Projectile"
  163. }
  164.  
  165. local AddressTableEnemies= {
  166. }
  167.  
  168. local AddressTableFlags= {
  169. [1] = {0,"Mirror Shards",0xFFB0B0B0},  
  170. [2] = {7,"Kracko",0xFFFFE0A0,"EWRAM",0x38970,0,true},
  171. [3] = {7,"King Golem",0xFFFFE0A0,"EWRAM",0x38970,1,true},
  172. [4] = {7,"Master Hand",0xFFFFE0A0,"EWRAM",0x38970,2,true},
  173. [5] = {7,"Gobbler",0xFFFFE0A0,"EWRAM",0x38970,3,true},
  174. [6] = {7,"Wiz",0xFFFFE0A0,"EWRAM",0x38970,4,true},
  175. [7] = {7,"Moley",0xFFFFE0A0,"EWRAM",0x38970,5,true},
  176. [8] = {7,"Mega Titan",0xFFFFE0A0,"EWRAM",0x38970,6,true},
  177. [9] = {7,"D. Metaknight",0xFFFFE0A0,"EWRAM",0x38970,7,true},
  178.  
  179. [10] = {0,"Misc Unlockables",0xFFB0B0B0},  
  180. [11] = {7,"Ability Room",0xFFFFE0A0,"EWRAM",0x28C58,0,true},
  181. [12] = {7,"Spray: Pink",0xFFFFE0A0,"EWRAM",0x38974,0,true},
  182. [13] = {7,"Spray: Yellow",0xFFFFE0A0,"EWRAM",0x38974,1,true},
  183. [14] = {7,"Spray: Red",0xFFFFE0A0,"EWRAM",0x38974,2,true},
  184. [15] = {7,"Spray: Green",0xFFFFE0A0,"EWRAM",0x38974,3,true},
  185. [16] = {7,"Spray: Snow",0xFFFFE0A0,"EWRAM",0x38974,4,true},
  186. [17] = {7,"Spray: Carbon",0xFFFFE0A0,"EWRAM",0x38974,5,true},
  187. [18] = {7,"Spray: Ocean",0xFFFFE0A0,"EWRAM",0x38974,6,true},
  188. [19] = {7,"Spray: Sapphire",0xFFFFE0A0,"EWRAM",0x38974,7,true},
  189. [20] = {7,"Spray: Grape",0xFFFFE0A0,"EWRAM",0x38975,0,true},
  190. [21] = {7,"Spray: Emerald",0xFFFFE0A0,"EWRAM",0x38975,1,true},
  191. [22] = {7,"Spray: Orange",0xFFFFE0A0,"EWRAM",0x38975,2,true},
  192. [23] = {7,"Spray: Chocolate",0xFFFFE0A0,"EWRAM",0x38975,3,true},
  193. [24] = {7,"Spray: Cherry",0xFFFFE0A0,"EWRAM",0x38975,4,true},
  194. [25] = {7,"Spray: Chalk",0xFFFFE0A0,"EWRAM",0x38975,5,true},
  195. [26] = {7,"Sound Player",0xFFFFE0A0,"EWRAM",0x38978,0,true},
  196. [27] = {7,"Music: Beginning Notes",0xFFFFE0A0,"EWRAM",0x38978,1,true},
  197. [28] = {7,"Music: Happy Notes",0xFFFFE0A0,"EWRAM",0x38978,2,true},
  198. [29] = {7,"Music: Spunky Notes",0xFFFFE0A0,"EWRAM",0x38978,3,true},
  199. [30] = {7,"Music: Battle Notes",0xFFFFE0A0,"EWRAM",0x38978,4,true},
  200. [31] = {7,"Music: Dream Notes",0xFFFFE0A0,"EWRAM",0x38978,5,true},
  201. [32] = {7,"Music: Secret Notes",0xFFFFE0A0,"EWRAM",0x38978,6,true},
  202. [33] = {7,"Music: Kirby's Sounds",0xFFFFE0A0,"EWRAM",0x38978,7,true},
  203. [34] = {7,"Music: Enemy Sounds",0xFFFFE0A0,"EWRAM",0x38979,0,true},
  204. [35] = {7,"Music: Secret Sounds",0xFFFFE0A0,"EWRAM",0x38979,1,true},
  205. [36] = {7,"Music: Sound Effects",0xFFFFE0A0,"EWRAM",0x38979,2,true},
  206. [37] = {7,"World Map",0xFFFFE0A0,"EWRAM",0x3897C,0,true},
  207. [38] = {7,"Map: Rainbow Route",0xFFFFE0A0,"EWRAM",0x3897C,1,true},
  208. [39] = {7,"Map: Moonlight Mansion",0xFFFFE0A0,"EWRAM",0x3897C,2,true},
  209. [40] = {7,"Map: Cabbage Cavern",0xFFFFE0A0,"EWRAM",0x3897C,3,true},
  210. [41] = {7,"Map: Mustard Mountain",0xFFFFE0A0,"EWRAM",0x3897C,4,true},
  211. [42] = {7,"Map: Carrot Castle",0xFFFFE0A0,"EWRAM",0x3897C,5,true},
  212. [43] = {7,"Map: Olive Ocean",0xFFFFE0A0,"EWRAM",0x3897C,6,true},
  213. [44] = {7,"Map: Peppermint Palace",0xFFFFE0A0,"EWRAM",0x3897C,7,true},
  214. [45] = {7,"Map: Radish Ruins",0xFFFFE0A0,"EWRAM",0x3897D,0,true},
  215. [46] = {7,"Map: Candy Constellation",0xFFFFE0A0,"EWRAM",0x3897D,1,true},
  216. [47] = {1,"Extra Health",0xFFFFE0A0,"EWRAM",0x38980,1,true},
  217. [48] = {7,"Master Sword req. 1",0xFFFFE0A0,"EWRAM",0x3AD2D,0,true}, -- this bit gets set after the first hub cutscene but also after endgame; req. for 100%
  218. [49] = {7,"Master Sword req. 2",0xFFFFE0A0,"EWRAM",0x3AD2D,1,true}, -- set after endgame, req. for 100%
  219. [50] = {7,"Master Sword req. 3",0xFFFFE0A0,"EWRAM",0x3AD2D,2,true}, -- set after endgame, req. for 100%
  220. [51] = {7,"Master Sword req. 4",0xFFFFE0A0,"EWRAM",0x3AD2D,5,true}, -- set after endgame, req. for 100%
  221.  
  222. [52] = {0,"Tutorial",0xFFB0B0B0},  
  223. [53] = {7,"R805 B.Chest",0xFFFFE0A0,"EWRAM",0x38960,0,true}, -- World Map
  224. [54] = {7,"Room 803",0xFFFFE0A0,"EWRAM",0x28CA3,7,true},
  225. [55] = {7,"Room 804",0xFFFFE0A0,"EWRAM",0x28CA5,7,true},
  226. [56] = {7,"Room 805",0xFFFFE0A0,"EWRAM",0x28CA7,7,true},
  227.  
  228. [57] = {0,"Area 1",0xFFB0B0B0},        
  229. [58] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C18,0,true},
  230. [59] = {7,"R106 Chest",0xFFFFE0A0,"EWRAM",0x38960,3,true}, -- 1up
  231. [60] = {7,"R108 Chest",0xFFFFE0A0,"EWRAM",0x38960,4,true}, -- 1up
  232. [61] = {7,"R138 Chest",0xFFFFE0A0,"EWRAM",0x38960,7,true}, -- Spray: Green
  233. [62] = {7,"R173 Chest",0xFFFFE0A0,"EWRAM",0x38961,0,true}, -- candy
  234. [63] = {7,"R176 Chest",0xFFFFE0A0,"EWRAM",0x38961,1,true}, -- energy drink
  235. [64] = {7,"R177 Chest",0xFFFFE0A0,"EWRAM",0x38961,2,true}, -- 1up
  236. [65] = {7,"R190 B.Chest",0xFFFFE0A0,"EWRAM",0x38960,5,true}, -- Map: Rainbow Route
  237. [66] = {7,"R537 Chest",0xFFFFE0A0,"EWRAM",0x38960,1,true}, -- Music: Beginning Notes
  238. [67] = {7,"R557 Chest",0xFFFFE0A0,"EWRAM",0x38960,6,true}, -- maxim tomato
  239. [68] = {7,"R570 Chest",0xFFFFE0A0,"EWRAM",0x38960,2,true}, -- meat
  240. [69] = {7,"Room 101",0xFFFFE0A0,"EWRAM",0x28CCB,7,true},
  241. [70] = {7,"Room 103",0xFFFFE0A0,"EWRAM",0x28CCD,7,true},
  242. [71] = {7,"Room 104",0xFFFFE0A0,"EWRAM",0x28CCF,7,true},
  243. [72] = {7,"Room 106",0xFFFFE0A0,"EWRAM",0x28CD1,7,true},
  244. [73] = {7,"Room 107",0xFFFFE0A0,"EWRAM",0x28CD3,7,true},
  245. [74] = {7,"Room 108",0xFFFFE0A0,"EWRAM",0x28CD5,7,true},
  246. [75] = {7,"Room 110",0xFFFFE0A0,"EWRAM",0x28CD7,7,true},
  247. [76] = {7,"Room 115",0xFFFFE0A0,"EWRAM",0x28CFB,7,true},
  248. [77] = {7,"Room 117",0xFFFFE0A0,"EWRAM",0x28CFD,7,true},
  249. [78] = {7,"Room 118",0xFFFFE0A0,"EWRAM",0x28CFF,7,true},
  250. [79] = {7,"Room 119",0xFFFFE0A0,"EWRAM",0x28D01,7,true},
  251. [80] = {7,"Room 126",0xFFFFE0A0,"EWRAM",0x28CF9,7,true},
  252. [81] = {7,"Room 127",0xFFFFE0A0,"EWRAM",0x28CE3,7,true},
  253. [82] = {7,"Room 136",0xFFFFE0A0,"EWRAM",0x28CE5,7,true},
  254. [83] = {7,"Room 137",0xFFFFE0A0,"EWRAM",0x28CE7,7,true},
  255. [84] = {7,"Room 138",0xFFFFE0A0,"EWRAM",0x28D03,7,true},
  256. [85] = {7,"Room 139",0xFFFFE0A0,"EWRAM",0x28D05,7,true},
  257. [86] = {7,"Room 140",0xFFFFE0A0,"EWRAM",0x28CD9,7,true},
  258. [87] = {7,"Room 141",0xFFFFE0A0,"EWRAM",0x28CDB,7,true},
  259. [88] = {7,"Room 142",0xFFFFE0A0,"EWRAM",0x28CDD,7,true},
  260. [89] = {7,"Room 143",0xFFFFE0A0,"EWRAM",0x28CDF,7,true},
  261. [90] = {7,"Room 171",0xFFFFE0A0,"EWRAM",0x28D07,7,true},
  262. [91] = {7,"Room 172",0xFFFFE0A0,"EWRAM",0x28D09,7,true},
  263. [92] = {7,"Room 173",0xFFFFE0A0,"EWRAM",0x28D0B,7,true},
  264. [93] = {7,"Room 174",0xFFFFE0A0,"EWRAM",0x28D0D,7,true},
  265. [94] = {7,"Room 175",0xFFFFE0A0,"EWRAM",0x28D0F,7,true},
  266. [95] = {7,"Room 176",0xFFFFE0A0,"EWRAM",0x28D11,7,true},
  267. [96] = {7,"Room 177",0xFFFFE0A0,"EWRAM",0x28D13,7,true},
  268. [97] = {7,"Room 178",0xFFFFE0A0,"EWRAM",0x28D15,7,true},
  269. [98] = {7,"Room 190",0xFFFFE0A0,"EWRAM",0x28CE1,7,true},
  270. [99] = {7,"Room 192",0xFFFFE0A0,"EWRAM",0x28D17,7,true},
  271. [100] = {7,"Room 194",0xFFFFE0A0,"EWRAM",0x28CE9,7,true},
  272. [101] = {7,"Room 503",0xFFFFE0A0,"EWRAM",0x28CF3,7,true},
  273. [102] = {7,"Room 504",0xFFFFE0A0,"EWRAM",0x28CEB,7,true},
  274. [103] = {7,"Room 507",0xFFFFE0A0,"EWRAM",0x28CED,7,true},
  275. [104] = {7,"Room 532",0xFFFFE0A0,"EWRAM",0x28CB5,7,true},
  276. [105] = {7,"Room 534",0xFFFFE0A0,"EWRAM",0x28CB7,7,true},
  277. [106] = {7,"Room 535",0xFFFFE0A0,"EWRAM",0x28CB9,7,true},
  278. [107] = {7,"Room 536",0xFFFFE0A0,"EWRAM",0x28CBB,7,true},
  279. [108] = {7,"Room 537",0xFFFFE0A0,"EWRAM",0x28CBD,7,true},
  280. [109] = {7,"Room 538",0xFFFFE0A0,"EWRAM",0x28CBF,7,true},
  281. [110] = {7,"Room 542",0xFFFFE0A0,"EWRAM",0x28CC1,7,true},
  282. [111] = {7,"Room 543",0xFFFFE0A0,"EWRAM",0x28CC3,7,true},
  283. [112] = {7,"Room 554",0xFFFFE0A0,"EWRAM",0x28CEF,7,true},
  284. [113] = {7,"Room 555",0xFFFFE0A0,"EWRAM",0x28CF1,7,true},
  285. [114] = {7,"Room 556",0xFFFFE0A0,"EWRAM",0x28CF5,7,true},
  286. [115] = {7,"Room 557",0xFFFFE0A0,"EWRAM",0x28CF7,7,true},
  287. [116] = {7,"Room 570",0xFFFFE0A0,"EWRAM",0x28CC5,7,true},
  288. [117] = {7,"Room 571",0xFFFFE0A0,"EWRAM",0x28CC7,7,true},
  289. [118] = {7,"Room 590",0xFFFFE0A0,"EWRAM",0x28CC9,7,true},
  290. [119] = {7,"Room 801",0xFFFFE0A0,"EWRAM",0x28CA1,7,true},
  291.  
  292. [120] = {0,"Area 2",0xFFB0B0B0},       
  293. [121] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C14,0,true},
  294. [122] = {7,"Lever",0xFFFFE0A0,"EWRAM",0x38962,2,true}, 
  295. [123] = {7,"R145 Chest",0xFFFFE0A0,"EWRAM",0x38961,3,true}, -- Music: Enemy Sounds
  296. [124] = {7,"R148 Chest",0xFFFFE0A0,"EWRAM",0x38961,5,true}, -- Spray: Chalk
  297. [125] = {7,"R148 Chest",0xFFFFE0A0,"EWRAM",0x38961,4,true}, -- maxim tomato
  298. [126] = {7,"R149 Chest",0xFFFFE0A0,"EWRAM",0x38961,6,true}, -- 1up
  299. [127] = {7,"R195 B.Chest",0xFFFFE0A0,"EWRAM",0x38961,7,true}, -- Map: Moonlight Mansion
  300. [128] = {7,"R709 Chest",0xFFFFE0A0,"EWRAM",0x38962,0,true}, -- Spray: Orange
  301. [129] = {7,"R742 Chest",0xFFFFE0A0,"EWRAM",0x38962,1,true}, -- meat
  302. [130] = {7,"Room 144",0xFFFFE0A0,"EWRAM",0x28D19,7,true},
  303. [131] = {7,"Room 145",0xFFFFE0A0,"EWRAM",0x28D1B,7,true},
  304. [132] = {7,"Room 146",0xFFFFE0A0,"EWRAM",0x28D1D,7,true},
  305. [133] = {7,"Room 147",0xFFFFE0A0,"EWRAM",0x28D1F,7,true},
  306. [134] = {7,"Room 148",0xFFFFE0A0,"EWRAM",0x28D21,7,true},
  307. [135] = {7,"Room 149",0xFFFFE0A0,"EWRAM",0x28D23,7,true},
  308. [136] = {7,"Room 180",0xFFFFE0A0,"EWRAM",0x28CB1,7,true},
  309. [137] = {7,"Room 195",0xFFFFE0A0,"EWRAM",0x28D25,7,true},
  310. [138] = {7,"Room 700",0xFFFFE0A0,"EWRAM",0x28D27,7,true},
  311. [139] = {7,"Room 700B",0xFFFFE0A0,"EWRAM",0x28D35,7,true},
  312. [140] = {7,"Room 702",0xFFFFE0A0,"EWRAM",0x28D43,7,true},
  313. [141] = {7,"Room 704",0xFFFFE0A0,"EWRAM",0x28D29,7,true},
  314. [142] = {7,"Room 705",0xFFFFE0A0,"EWRAM",0x28D2B,7,true},
  315. [143] = {7,"Room 706",0xFFFFE0A0,"EWRAM",0x28D2D,7,true},
  316. [144] = {7,"Room 707",0xFFFFE0A0,"EWRAM",0x28D2F,7,true},
  317. [145] = {7,"Room 708",0xFFFFE0A0,"EWRAM",0x28D31,7,true},
  318. [146] = {7,"Room 709",0xFFFFE0A0,"EWRAM",0x28D33,7,true},
  319. [147] = {7,"Room 711",0xFFFFE0A0,"EWRAM",0x28D37,7,true},
  320. [148] = {7,"Room 712",0xFFFFE0A0,"EWRAM",0x28D39,7,true},
  321. [149] = {7,"Room 740",0xFFFFE0A0,"EWRAM",0x28D3B,7,true},
  322. [150] = {7,"Room 741",0xFFFFE0A0,"EWRAM",0x28D3D,7,true},
  323. [151] = {7,"Room 742",0xFFFFE0A0,"EWRAM",0x28D3F,7,true},
  324. [152] = {7,"Room 743",0xFFFFE0A0,"EWRAM",0x28D45,7,true},
  325. [153] = {7,"Room 744",0xFFFFE0A0,"EWRAM",0x28D47,7,true},
  326. [154] = {7,"Room 745",0xFFFFE0A0,"EWRAM",0x28D49,7,true},
  327. [155] = {7,"Room 790",0xFFFFE0A0,"EWRAM",0x28D41,7,true},
  328.  
  329. [156] = {0,"Area 3",0xFFB0B0B0},       
  330. [157] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C28,0,true},
  331. [158] = {7,"Switch 2",0xFFFFE0A0,"EWRAM",0x28C24,0,true},
  332. [159] = {7,"R510 Chest",0xFFFFE0A0,"EWRAM",0x38966,5,true}, -- 1up
  333. [160] = {7,"R515 Chest",0xFFFFE0A0,"EWRAM",0x38967,0,true}, -- 1up
  334. [161] = {7,"R511 Chest",0xFFFFE0A0,"EWRAM",0x38966,7,true}, -- Music: Secret Sounds
  335. [162] = {7,"R517 Chest",0xFFFFE0A0,"EWRAM",0x38967,1,true}, -- Spray: Chocolate
  336. [163] = {7,"R527 Chest",0xFFFFE0A0,"EWRAM",0x38967,2,true}, -- Spray: Sapphire
  337. [164] = {7,"R528 Chest",0xFFFFE0A0,"EWRAM",0x38966,6,true}, -- Music: Spunky Notes
  338. [165] = {7,"R531 Chest",0xFFFFE0A0,"EWRAM",0x38967,4,true}, -- meat
  339. [166] = {7,"R531 B.Chest",0xFFFFE0A0,"EWRAM",0x38967,3,true}, -- Map: Cabbage Cavern
  340. [167] = {7,"Room 191",0xFFFFE0A0,"EWRAM",0x28E1B,7,true},
  341. [168] = {7,"Room 500",0xFFFFE0A0,"EWRAM",0x28DF5,7,true},
  342. [169] = {7,"Room 500B",0xFFFFE0A0,"EWRAM",0x28DFD,7,true},
  343. [170] = {7,"Room 501",0xFFFFE0A0,"EWRAM",0x28E01,7,true},
  344. [171] = {7,"Room 508",0xFFFFE0A0,"EWRAM",0x28DF7,7,true},
  345. [172] = {7,"Room 509",0xFFFFE0A0,"EWRAM",0x28DF9,7,true},
  346. [173] = {7,"Room 510",0xFFFFE0A0,"EWRAM",0x28DFB,7,true},
  347. [174] = {7,"Room 511",0xFFFFE0A0,"EWRAM",0x28E03,7,true},
  348. [175] = {7,"Room 512",0xFFFFE0A0,"EWRAM",0x28E05,7,true},
  349. [176] = {7,"Room 513",0xFFFFE0A0,"EWRAM",0x28E07,7,true},
  350. [177] = {7,"Room 514",0xFFFFE0A0,"EWRAM",0x28E09,7,true},
  351. [178] = {7,"Room 515",0xFFFFE0A0,"EWRAM",0x28E0B,7,true},
  352. [179] = {7,"Room 517",0xFFFFE0A0,"EWRAM",0x28E0D,7,true},
  353. [180] = {7,"Room 523",0xFFFFE0A0,"EWRAM",0x28E0F,7,true},
  354. [181] = {7,"Room 527",0xFFFFE0A0,"EWRAM",0x28E11,7,true},
  355. [182] = {7,"Room 528",0xFFFFE0A0,"EWRAM",0x28DFF,7,true},
  356. [183] = {7,"Room 529",0xFFFFE0A0,"EWRAM",0x28E13,7,true},
  357. [184] = {7,"Room 530",0xFFFFE0A0,"EWRAM",0x28E15,7,true},
  358. [185] = {7,"Room 531",0xFFFFE0A0,"EWRAM",0x28E17,7,true},
  359. [186] = {7,"Room 591",0xFFFFE0A0,"EWRAM",0x28E19,7,true},
  360. [187] = {7,"Room 592",0xFFFFE0A0,"EWRAM",0x28E57,7,true},
  361.  
  362. [188] = {0,"Area 4",0xFFB0B0B0},       
  363. [189] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C44,0,true},
  364. [190] = {7,"Switch 2",0xFFFFE0A0,"EWRAM",0x28C4C,0,true},
  365. [191] = {7,"R310 B.Chest",0xFFFFE0A0,"EWRAM",0x38964,7,true}, -- Map: Mustard Mountain
  366. [192] = {7,"R316 Chest",0xFFFFE0A0,"EWRAM",0x38965,0,true}, -- energy drink
  367. [193] = {7,"R321 Chest",0xFFFFE0A0,"EWRAM",0x38965,1,true}, -- 1up
  368. [194] = {7,"R322 Chest",0xFFFFE0A0,"EWRAM",0x38965,2,true}, -- 1up
  369. [195] = {7,"R326 Chest",0xFFFFE0A0,"EWRAM",0x38965,3,true}, -- Spray: Cherry
  370. [196] = {7,"Room 300",0xFFFFE0A0,"EWRAM",0x28D9B,7,true},
  371. [197] = {7,"Room 300B",0xFFFFE0A0,"EWRAM",0x28DB5,7,true},
  372. [198] = {7,"Room 304",0xFFFFE0A0,"EWRAM",0x28D9D,7,true},
  373. [199] = {7,"Room 308",0xFFFFE0A0,"EWRAM",0x28D9F,7,true},
  374. [200] = {7,"Room 310",0xFFFFE0A0,"EWRAM",0x28DA1,7,true},
  375. [201] = {7,"Room 312",0xFFFFE0A0,"EWRAM",0x28DA3,7,true},
  376. [202] = {7,"Room 313",0xFFFFE0A0,"EWRAM",0x28DA5,7,true},
  377. [203] = {7,"Room 315",0xFFFFE0A0,"EWRAM",0x28DA7,7,true},
  378. [204] = {7,"Room 316",0xFFFFE0A0,"EWRAM",0x28DA9,7,true},
  379. [205] = {7,"Room 317",0xFFFFE0A0,"EWRAM",0x28DAB,7,true},
  380. [206] = {7,"Room 318",0xFFFFE0A0,"EWRAM",0x28DAD,7,true},
  381. [207] = {7,"Room 321",0xFFFFE0A0,"EWRAM",0x28DAF,7,true},
  382. [208] = {7,"Room 322",0xFFFFE0A0,"EWRAM",0x28DB1,7,true},
  383. [209] = {7,"Room 323",0xFFFFE0A0,"EWRAM",0x28DB3,7,true},
  384. [210] = {7,"Room 325",0xFFFFE0A0,"EWRAM",0x28DB7,7,true},
  385. [211] = {7,"Room 326",0xFFFFE0A0,"EWRAM",0x28DB9,7,true},
  386. [212] = {7,"Room 390",0xFFFFE0A0,"EWRAM",0x28DBB,7,true},
  387. [213] = {7,"Room 533",0xFFFFE0A0,"EWRAM",0x28D8B,7,true},
  388. [214] = {7,"Room 539",0xFFFFE0A0,"EWRAM",0x28D8D,7,true},  
  389. [215] = {7,"Room 540",0xFFFFE0A0,"EWRAM",0x28D8F,7,true},
  390. [216] = {7,"Room 541",0xFFFFE0A0,"EWRAM",0x28D91,7,true},
  391. [217] = {7,"Room 544",0xFFFFE0A0,"EWRAM",0x28D93,7,true},
  392. [218] = {7,"Room 545",0xFFFFE0A0,"EWRAM",0x28D95,7,true},
  393. [219] = {7,"Room 546",0xFFFFE0A0,"EWRAM",0x28D97,7,true},
  394. [220] = {7,"Room 547",0xFFFFE0A0,"EWRAM",0x28D99,7,true},
  395.  
  396. [221] = {0,"Area 5",0xFFB0B0B0},   
  397. [222] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C34,0,true},
  398. [223] = {7,"Switch 2",0xFFFFE0A0,"EWRAM",0x28C38,0,true},
  399. [224] = {7,"Lever",0xFFFFE0A0,"EWRAM",0x38969,5,true}, 
  400. [225] = {7,"R719 Chest",0xFFFFE0A0,"EWRAM",0x38969,6,true}, -- cherry
  401. [226] = {7,"R732 B.Chest",0xFFFFE0A0,"EWRAM",0x38969,7,true}, -- Map: Carrot Castle
  402. [227] = {7,"R733 Chest",0xFFFFE0A0,"EWRAM",0x3896A,0,true}, -- Spray: Yellow
  403. [228] = {7,"R734 Chest 1",0xFFFFE0A0,"EWRAM",0x3896A,1,true}, -- Music: Secret Notes
  404. [229] = {7,"R734 Chest 2",0xFFFFE0A0,"EWRAM",0x3896A,2,true}, -- 1up
  405. [230] = {7,"R739 B.Chest",0xFFFFE0A0,"EWRAM",0x3896A,3,true}, -- Heart Piece
  406. [231] = {7,"Room 120",0xFFFFE0A0,"EWRAM",0x28E93,7,true},
  407. [232] = {7,"Room 121",0xFFFFE0A0,"EWRAM",0x28E95,7,true},
  408. [233] = {7,"Room 122",0xFFFFE0A0,"EWRAM",0x28E97,7,true},
  409. [234] = {7,"Room 170",0xFFFFE0A0,"EWRAM",0x28E99,7,true},
  410. [235] = {7,"Room 181",0xFFFFE0A0,"EWRAM",0x28CB3,7,true},
  411. [236] = {7,"Room 193",0xFFFFE0A0,"EWRAM",0x28E9B,7,true},
  412. [237] = {7,"Room 226",0xFFFFE0A0,"EWRAM",0x28D63,7,true},
  413. [238] = {7,"Room 600",0xFFFFE0A0,"EWRAM",0x28E9D,7,true},
  414. [239] = {7,"Room 600B",0xFFFFE0A0,"EWRAM",0x28EB3,7,true},
  415. [240] = {7,"Room 714",0xFFFFE0A0,"EWRAM",0x28E9F,7,true},
  416. [241] = {7,"Room 716",0xFFFFE0A0,"EWRAM",0x28EA1,7,true},
  417. [242] = {7,"Room 717",0xFFFFE0A0,"EWRAM",0x28EA3,7,true},
  418. [243] = {7,"Room 719",0xFFFFE0A0,"EWRAM",0x28EA5,7,true},
  419. [244] = {7,"Room 720",0xFFFFE0A0,"EWRAM",0x28EB7,7,true},
  420. [245] = {7,"Room 730",0xFFFFE0A0,"EWRAM",0x28EB9,7,true},
  421. [246] = {7,"Room 731",0xFFFFE0A0,"EWRAM",0x28EBB,7,true},
  422. [247] = {7,"Room 732",0xFFFFE0A0,"EWRAM",0x28EA7,7,true},
  423. [248] = {7,"Room 733",0xFFFFE0A0,"EWRAM",0x28EA9,7,true},
  424. [249] = {7,"Room 734",0xFFFFE0A0,"EWRAM",0x28EAB,7,true},
  425. [250] = {7,"Room 735",0xFFFFE0A0,"EWRAM",0x28EAD,7,true},
  426. [251] = {7,"Room 736",0xFFFFE0A0,"EWRAM",0x28EAF,7,true},
  427. [252] = {7,"Room 737",0xFFFFE0A0,"EWRAM",0x28EB1,7,true},
  428. [253] = {7,"Room 739",0xFFFFE0A0,"EWRAM",0x28EB5,7,true},
  429.  
  430. [254] = {0,"Area 6",0xFFB0B0B0},       
  431. [255] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C1C,0,true},
  432. [256] = {7,"Switch 2",0xFFFFE0A0,"EWRAM",0x28C20,0,true},
  433. [257] = {7,"Lever",0xFFFFE0A0,"EWRAM",0x38968,1,true},
  434. [258] = {7,"R134 Chest",0xFFFFE0A0,"EWRAM",0x38967,5,true}, -- Spray: Ocean
  435. [259] = {7,"R553 Chest",0xFFFFE0A0,"EWRAM",0x38967,6,true}, -- 1up
  436. [260] = {7,"R815 B.Chest",0xFFFFE0A0,"EWRAM",0x38967,7,true}, -- Heart Piece
  437. [261] = {7,"R816 B.Chest",0xFFFFE0A0,"EWRAM",0x38968,4,true}, -- Map: Olive Ocean
  438. [262] = {7,"R823 Chest",0xFFFFE0A0,"EWRAM",0x38968,0,true}, -- cherry
  439. [263] = {7,"R825 Chest",0xFFFFE0A0,"EWRAM",0x38968,2,true}, -- Music: Sound Effects
  440. [264] = {7,"R826 Chest",0xFFFFE0A0,"EWRAM",0x38968,3,true}, -- energy drink
  441. [265] = {7,"Room 130",0xFFFFE0A0,"EWRAM",0x28E1D,7,true},
  442. [266] = {7,"Room 131",0xFFFFE0A0,"EWRAM",0x28E1F,7,true},
  443. [267] = {7,"Room 132",0xFFFFE0A0,"EWRAM",0x28E21,7,true},
  444. [268] = {7,"Room 133",0xFFFFE0A0,"EWRAM",0x28E23,7,true},
  445. [269] = {7,"Room 134",0xFFFFE0A0,"EWRAM",0x28E25,7,true},
  446. [270] = {7,"Room 135",0xFFFFE0A0,"EWRAM",0x28E27,7,true},
  447. [271] = {7,"Room 551",0xFFFFE0A0,"EWRAM",0x28E29,7,true},
  448. [272] = {7,"Room 553",0xFFFFE0A0,"EWRAM",0x28E2B,7,true},
  449. [273] = {7,"Room 800",0xFFFFE0A0,"EWRAM",0x28E49,7,true},
  450. [274] = {7,"Room 800B",0xFFFFE0A0,"EWRAM",0x28E55,7,true},
  451. [275] = {7,"Room 802",0xFFFFE0A0,"EWRAM",0x28E4B,7,true},
  452. [276] = {7,"Room 810",0xFFFFE0A0,"EWRAM",0x28E4D,7,true},
  453. [277] = {7,"Room 811",0xFFFFE0A0,"EWRAM",0x28E2D,7,true},
  454. [278] = {7,"Room 814",0xFFFFE0A0,"EWRAM",0x28E2F,7,true},
  455. [279] = {7,"Room 815",0xFFFFE0A0,"EWRAM",0x28E31,7,true},
  456. [280] = {7,"Room 816",0xFFFFE0A0,"EWRAM",0x28E4F,7,true},
  457. [281] = {7,"Room 819",0xFFFFE0A0,"EWRAM",0x28E51,7,true},
  458. [282] = {7,"Room 821",0xFFFFE0A0,"EWRAM",0x28E53,7,true},
  459. [283] = {7,"Room 823",0xFFFFE0A0,"EWRAM",0x28E33,7,true},
  460. [284] = {7,"Room 824",0xFFFFE0A0,"EWRAM",0x28E35,7,true},
  461. [285] = {7,"Room 825",0xFFFFE0A0,"EWRAM",0x28E37,7,true},
  462. [286] = {7,"Room 826",0xFFFFE0A0,"EWRAM",0x28E39,7,true},
  463. [287] = {7,"Room 827",0xFFFFE0A0,"EWRAM",0x28E3B,7,true},
  464. [288] = {7,"Room 828",0xFFFFE0A0,"EWRAM",0x28E3D,7,true},
  465. [289] = {7,"Room 829",0xFFFFE0A0,"EWRAM",0x28E3F,7,true},
  466. [290] = {7,"Room 830",0xFFFFE0A0,"EWRAM",0x28E41,7,true},
  467. [291] = {7,"Room 831",0xFFFFE0A0,"EWRAM",0x28E43,7,true},
  468. [292] = {7,"Room 832",0xFFFFE0A0,"EWRAM",0x28E45,7,true},
  469. [293] = {7,"Room 890",0xFFFFE0A0,"EWRAM",0x28E47,7,true},
  470.  
  471. [294] = {0,"Area 7",0xFFB0B0B0},   
  472. [295] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C3C,0,true},
  473. [296] = {7,"Switch 2",0xFFFFE0A0,"EWRAM",0x28C40,0,true},
  474. [297] = {7,"R202 Chest 1",0xFFFFE0A0,"EWRAM",0x38962,3,true}, -- 1up
  475. [298] = {7,"R202 Chest 2",0xFFFFE0A0,"EWRAM",0x38962,4,true}, -- meat
  476. [299] = {7,"R206 Chest",0xFFFFE0A0,"EWRAM",0x38962,5,true}, -- Music: Dream Notes
  477. [300] = {7,"R209 B.Chest",0xFFFFE0A0,"EWRAM",0x38962,6,true}, -- Map: Peppermint Palace
  478. [301] = {7,"R209 Chest 1",0xFFFFE0A0,"EWRAM",0x38962,7,true}, -- 1up
  479. [302] = {7,"R209 Chest 2",0xFFFFE0A0,"EWRAM",0x38963,0,true}, -- energy drink
  480. [303] = {7,"R210 Chest",0xFFFFE0A0,"EWRAM",0x38963,1,true}, -- Spray: Snow 
  481. [304] = {7,"R216 Chest",0xFFFFE0A0,"EWRAM",0x38964,4,true}, -- 1up
  482. [305] = {7,"R220 Chest",0xFFFFE0A0,"EWRAM",0x38963,2,true}, -- meat
  483. [306] = {7,"R221 Chest",0xFFFFE0A0,"EWRAM",0x38964,5,true}, -- Spray: Pink
  484. [307] = {7,"R224 Chest",0xFFFFE0A0,"EWRAM",0x38964,6,true}, -- maxim tomato
  485. [308] = {7,"R227 Chest 1",0xFFFFE0A0,"EWRAM",0x38963,3,true}, -- Music: Happy Notes
  486. [309] = {7,"R227 Chest 2",0xFFFFE0A0,"EWRAM",0x38963,4,true}, -- maxim tomato
  487. [310] = {7,"R227 Chest 3",0xFFFFE0A0,"EWRAM",0x38963,5,true}, -- 1up
  488. [311] = {7,"R228 Chest 1",0xFFFFE0A0,"EWRAM",0x38963,6,true}, -- 1up
  489. [312] = {7,"R228 Chest 2",0xFFFFE0A0,"EWRAM",0x38963,7,true}, -- meat
  490. [313] = {7,"R229 Chest 1",0xFFFFE0A0,"EWRAM",0x38964,0,true}, -- Spray: Grape
  491. [314] = {7,"R229 Chest 2",0xFFFFE0A0,"EWRAM",0x38964,1,true}, -- 1up
  492. [315] = {7,"R229 Chest 3",0xFFFFE0A0,"EWRAM",0x38964,2,true}, -- energy drink
  493. [316] = {7,"R232 Chest",0xFFFFE0A0,"EWRAM",0x38964,3,true}, -- energy drink
  494. [317] = {7,"Room 200",0xFFFFE0A0,"EWRAM",0x28D4B,7,true},
  495. [318] = {7,"Room 200B",0xFFFFE0A0,"EWRAM",0x28D7D,7,true},
  496. [319] = {7,"Room 202",0xFFFFE0A0,"EWRAM",0x28D4D,7,true},
  497. [320] = {7,"Room 203",0xFFFFE0A0,"EWRAM",0x28D4F,7,true},
  498. [321] = {7,"Room 204",0xFFFFE0A0,"EWRAM",0x28D51,7,true},
  499. [322] = {7,"Room 205",0xFFFFE0A0,"EWRAM",0x28D53,7,true},
  500. [323] = {7,"Room 206",0xFFFFE0A0,"EWRAM",0x28D55,7,true},
  501. [324] = {7,"Room 208",0xFFFFE0A0,"EWRAM",0x28D57,7,true},
  502. [325] = {7,"Room 209",0xFFFFE0A0,"EWRAM",0x28D59,7,true},
  503. [326] = {7,"Room 210",0xFFFFE0A0,"EWRAM",0x28D5B,7,true},
  504. [327] = {7,"Room 211",0xFFFFE0A0,"EWRAM",0x28D5D,7,true},
  505. [328] = {7,"Room 212",0xFFFFE0A0,"EWRAM",0x28D73,7,true},
  506. [329] = {7,"Room 214",0xFFFFE0A0,"EWRAM",0x28D5F,7,true},
  507. [330] = {7,"Room 215",0xFFFFE0A0,"EWRAM",0x28D75,7,true},
  508. [331] = {7,"Room 216",0xFFFFE0A0,"EWRAM",0x28D77,7,true},
  509. [332] = {7,"Room 217",0xFFFFE0A0,"EWRAM",0x28D79,7,true},
  510. [333] = {7,"Room 218",0xFFFFE0A0,"EWRAM",0x28D7B,7,true},
  511. [334] = {7,"Room 220",0xFFFFE0A0,"EWRAM",0x28D61,7,true},
  512. [335] = {7,"Room 221",0xFFFFE0A0,"EWRAM",0x28D7F,7,true},
  513. [336] = {7,"Room 222",0xFFFFE0A0,"EWRAM",0x28D81,7,true},
  514. [337] = {7,"Room 223",0xFFFFE0A0,"EWRAM",0x28D83,7,true},
  515. [338] = {7,"Room 224",0xFFFFE0A0,"EWRAM",0x28D85,7,true},
  516. [339] = {7,"Room 225",0xFFFFE0A0,"EWRAM",0x28D87,7,true},
  517. [340] = {7,"Room 227",0xFFFFE0A0,"EWRAM",0x28D65,7,true},
  518. [341] = {7,"Room 228",0xFFFFE0A0,"EWRAM",0x28D67,7,true},
  519. [342] = {7,"Room 229",0xFFFFE0A0,"EWRAM",0x28D69,7,true},
  520. [343] = {7,"Room 230",0xFFFFE0A0,"EWRAM",0x28D6B,7,true},
  521. [344] = {7,"Room 231",0xFFFFE0A0,"EWRAM",0x28D6D,7,true},
  522. [345] = {7,"Room 232",0xFFFFE0A0,"EWRAM",0x28D6F,7,true},
  523. [346] = {7,"Room 290",0xFFFFE0A0,"EWRAM",0x28D71,7,true},
  524. [347] = {7,"Room 291",0xFFFFE0A0,"EWRAM",0x28D89,7,true},
  525.  
  526. [348] = {0,"Area 8",0xFFB0B0B0},   
  527. [349] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C2C,0,true},
  528. [350] = {7,"Switch 2",0xFFFFE0A0,"EWRAM",0x28C30,0,true},  
  529. [351] = {7,"Lever",0xFFFFE0A0,"EWRAM",0x38969,2,true}, 
  530. [352] = {7,"R102 Chest 1",0xFFFFE0A0,"EWRAM",0x38969,3,true}, -- cherry
  531. [353] = {7,"R102 Chest 2",0xFFFFE0A0,"EWRAM",0x38969,4,true}, -- Music: Battle Notes
  532. [354] = {7,"R608 Chest",0xFFFFE0A0,"EWRAM",0x38969,0,true}, -- 1up
  533. [355] = {7,"R617 B.Chest",0xFFFFE0A0,"EWRAM",0x38969,1,true}, -- Map: Radish Ruins
  534. [356] = {7,"R620 B.Chest",0xFFFFE0A0,"EWRAM",0x38968,5,true}, -- Heart Piece
  535. [357] = {7,"R622 Chest 1",0xFFFFE0A0,"EWRAM",0x38968,6,true}, -- Spray: Emerald
  536. [358] = {7,"R623 Chest 2",0xFFFFE0A0,"EWRAM",0x38968,7,true}, -- energy drink
  537. [359] = {7,"Room 102",0xFFFFE0A0,"EWRAM",0x28E8B,7,true},
  538. [360] = {7,"Room 113",0xFFFFE0A0,"EWRAM",0x28E8D,7,true},
  539. [361] = {7,"Room 114",0xFFFFE0A0,"EWRAM",0x28E8F,7,true},
  540. [362] = {7,"Room 114B",0xFFFFE0A0,"EWRAM",0x28E91,7,true},
  541. [363] = {7,"Room 502",0xFFFFE0A0,"EWRAM",0x28E83,7,true},
  542. [364] = {7,"Room 524",0xFFFFE0A0,"EWRAM",0x28E85,7,true},
  543. [365] = {7,"Room 525",0xFFFFE0A0,"EWRAM",0x28E87,7,true},
  544. [366] = {7,"Room 526",0xFFFFE0A0,"EWRAM",0x28E89,7,true},
  545. [367] = {7,"Room 601",0xFFFFE0A0,"EWRAM",0x28E59,7,true},
  546. [368] = {7,"Room 603",0xFFFFE0A0,"EWRAM",0x28E5B,7,true},
  547. [369] = {7,"Room 604",0xFFFFE0A0,"EWRAM",0x28E5D,7,true},
  548. [370] = {7,"Room 605",0xFFFFE0A0,"EWRAM",0x28E5F,7,true},
  549. [371] = {7,"Room 606",0xFFFFE0A0,"EWRAM",0x28E61,7,true},
  550. [372] = {7,"Room 608",0xFFFFE0A0,"EWRAM",0x28E6F,7,true},
  551. [373] = {7,"Room 609",0xFFFFE0A0,"EWRAM",0x28E71,7,true},
  552. [374] = {7,"Room 610",0xFFFFE0A0,"EWRAM",0x28E63,7,true},
  553. [375] = {7,"Room 611",0xFFFFE0A0,"EWRAM",0x28E65,7,true},
  554. [376] = {7,"Room 612",0xFFFFE0A0,"EWRAM",0x28E73,7,true},
  555. [377] = {7,"Room 613",0xFFFFE0A0,"EWRAM",0x28E75,7,true},
  556. [378] = {7,"Room 614",0xFFFFE0A0,"EWRAM",0x28E77,7,true},
  557. [379] = {7,"Room 616",0xFFFFE0A0,"EWRAM",0x28E79,7,true},
  558. [380] = {7,"Room 617",0xFFFFE0A0,"EWRAM",0x28E7B,7,true},
  559. [381] = {7,"Room 618",0xFFFFE0A0,"EWRAM",0x28E7D,7,true},
  560. [382] = {7,"Room 619",0xFFFFE0A0,"EWRAM",0x28E7F,7,true},
  561. [383] = {7,"Room 620",0xFFFFE0A0,"EWRAM",0x28E67,7,true},
  562. [384] = {7,"Room 621",0xFFFFE0A0,"EWRAM",0x28E69,7,true},
  563. [385] = {7,"Room 622",0xFFFFE0A0,"EWRAM",0x28E6B,7,true},
  564. [386] = {7,"Room 623",0xFFFFE0A0,"EWRAM",0x28E6D,7,true},
  565. [387] = {7,"Room 690",0xFFFFE0A0,"EWRAM",0x28E81,7,true},
  566.  
  567. [388] = {0,"Area 9",0xFFB0B0B0},   
  568. [389] = {7,"Switch 1",0xFFFFE0A0,"EWRAM",0x28C48,0,true},
  569. [390] = {7,"R402 Chest",0xFFFFE0A0,"EWRAM",0x38965,4,true}, -- 1up
  570. [391] = {7,"R403 Chest",0xFFFFE0A0,"EWRAM",0x38965,5,true}, -- Spray: Carbon
  571. [392] = {7,"R403 B.Chest",0xFFFFE0A0,"EWRAM",0x38965,6,true}, -- Heart Piece
  572. [393] = {7,"R406 B.Chest",0xFFFFE0A0,"EWRAM",0x38965,7,true}, -- Sound Player
  573. [394] = {7,"R418 Chest",0xFFFFE0A0,"EWRAM",0x38966,0,true}, -- cherry
  574. [395] = {7,"R424 Chest",0xFFFFE0A0,"EWRAM",0x38966,1,true}, -- Music: Kirby's Sounds
  575. [396] = {7,"R425 Chest",0xFFFFE0A0,"EWRAM",0x38966,2,true}, -- maxim tomato
  576. [397] = {7,"R426 B.Chest",0xFFFFE0A0,"EWRAM",0x38966,3,true}, -- Map: Candy Constellation
  577. [398] = {7,"R427 Chest",0xFFFFE0A0,"EWRAM",0x38966,4,true}, -- Spray: Red  
  578. [399] = {7,"Room 400",0xFFFFE0A0,"EWRAM",0x28DBD,7,true},
  579. [400] = {7,"Room 400B",0xFFFFE0A0,"EWRAM",0x28DDD,7,true},
  580. [401] = {7,"Room 401",0xFFFFE0A0,"EWRAM",0x28DBF,7,true},
  581. [402] = {7,"Room 402",0xFFFFE0A0,"EWRAM",0x28DC1,7,true},
  582. [403] = {7,"Room 403",0xFFFFE0A0,"EWRAM",0x28DC3,7,true},
  583. [404] = {7,"Room 404",0xFFFFE0A0,"EWRAM",0x28DC5,7,true},
  584. [405] = {7,"Room 405",0xFFFFE0A0,"EWRAM",0x28DC7,7,true},
  585. [406] = {7,"Room 406",0xFFFFE0A0,"EWRAM",0x28DC9,7,true},
  586. [407] = {7,"Room 407",0xFFFFE0A0,"EWRAM",0x28DCB,7,true},
  587. [408] = {7,"Room 408",0xFFFFE0A0,"EWRAM",0x28DCD,7,true},
  588. [409] = {7,"Room 409",0xFFFFE0A0,"EWRAM",0x28DCF,7,true},
  589. [410] = {7,"Room 411",0xFFFFE0A0,"EWRAM",0x28DD1,7,true},
  590. [411] = {7,"Room 412",0xFFFFE0A0,"EWRAM",0x28DD3,7,true},
  591. [412] = {7,"Room 413",0xFFFFE0A0,"EWRAM",0x28DD5,7,true},
  592. [413] = {7,"Room 414",0xFFFFE0A0,"EWRAM",0x28DD7,7,true},
  593. [414] = {7,"Room 415",0xFFFFE0A0,"EWRAM",0x28DD9,7,true},
  594. [415] = {7,"Room 416",0xFFFFE0A0,"EWRAM",0x28DDB,7,true},
  595. [416] = {7,"Room 418",0xFFFFE0A0,"EWRAM",0x28DDF,7,true},
  596. [417] = {7,"Room 419",0xFFFFE0A0,"EWRAM",0x28DE1,7,true},
  597. [418] = {7,"Room 420",0xFFFFE0A0,"EWRAM",0x28DE3,7,true},
  598. [419] = {7,"Room 421",0xFFFFE0A0,"EWRAM",0x28DE5,7,true},
  599. [420] = {7,"Room 422",0xFFFFE0A0,"EWRAM",0x28DE7,7,true},
  600. [421] = {7,"Room 423",0xFFFFE0A0,"EWRAM",0x28DE9,7,true},
  601. [422] = {7,"Room 424",0xFFFFE0A0,"EWRAM",0x28DEB,7,true},
  602. [423] = {7,"Room 425",0xFFFFE0A0,"EWRAM",0x28DED,7,true},
  603. [424] = {7,"Room 426",0xFFFFE0A0,"EWRAM",0x28DEF,7,true},
  604. [425] = {7,"Room 427",0xFFFFE0A0,"EWRAM",0x28DF1,7,true},
  605. [426] = {7,"Room 490",0xFFFFE0A0,"EWRAM",0x28DF3,7,true},
  606.  
  607. [427] = {0,"End Game",0xFFB0B0B0}, 
  608. [428] = {7,"Room 909",0xFFFFE0A0,"EWRAM",0x28EBD,7,true},
  609. [429] = {7,"Room 910",0xFFFFE0A0,"EWRAM",0x28EBF,7,true},
  610. [430] = {7,"Room 911",0xFFFFE0A0,"EWRAM",0x28EC1,7,true},
  611. [431] = {7,"Room 912",0xFFFFE0A0,"EWRAM",0x28EC3,7,true},
  612. [432] = {7,"Room 913",0xFFFFE0A0,"EWRAM",0x28EC5,7,true},
  613. [433] = {7,"Room 914",0xFFFFE0A0,"EWRAM",0x28EC7,7,true},
  614. [434] = {7,"Room 915",0xFFFFE0A0,"EWRAM",0x28EC9,7,true},
  615. [435] = {7,"Room 916",0xFFFFE0A0,"EWRAM",0x28ECB,7,true},
  616. [436] = {7,"Room 918",0xFFFFE0A0,"EWRAM",0x28ECD,7,true},
  617. [437] = {7,"Room 919",0xFFFFE0A0,"EWRAM",0x28ECF,7,true},
  618.  
  619. [438] = {0,"Arena",0xFFB0B0B0},
  620. [439] = {7,"Room 950",0xFFFFE0A0,"EWRAM",0x28ED1,7,true},
  621. [440] = {7,"Room 951",0xFFFFE0A0,"EWRAM",0x28ED3,7,true},
  622. [441] = {7,"Room 955",0xFFFFE0A0,"EWRAM",0x28ED5,7,true},
  623. [442] = {7,"Room 956",0xFFFFE0A0,"EWRAM",0x28ED7,7,true},
  624. [443] = {7,"Room 957",0xFFFFE0A0,"EWRAM",0x28ED9,7,true},
  625.  
  626. [444] = {0,"Beta Testing",0xFFB0B0B0}, 
  627. [445] = {7,"Room 969",0xFFFFE0A0,"EWRAM",0x28EDB,7,true},
  628.  
  629. [446] = {0,"Ability Room",0xFFB0B0B0}, 
  630. [447] = {7,"Room 970",0xFFFFE0A0,"EWRAM",0x28EDD,7,true},
  631.  
  632. [448] = {0,"Finish Rooms",0xFFB0B0B0}, 
  633. [449] = {7,"Room 980",0xFFFFE0A0,"EWRAM",0x28CAB,7,true},
  634. [450] = {7,"Room 981",0xFFFFE0A0,"EWRAM",0x28CAD,7,true},
  635. [451] = {7,"Room 982",0xFFFFE0A0,"EWRAM",0x28CAF,7,true}
  636. }
  637.  
  638. local AddressTableKirby= {
  639. [1] = {1,"X",0xFFFFB0C0,"EWRAM",0x020F20,4,true,false},
  640. [2] = {1,"Y",0xFFFFB0C0,"EWRAM",0x020F24,4,true,false},
  641. [3] = {1,"X Speed",0xFFFFB0C0,"EWRAM",0x020F30,2,true,true},
  642. [4] = {1,"Y Speed",0xFFFFB0C0,"EWRAM",0x020F32,2,true,true},
  643. [5] = {1,"Hitbox Offset X",0xFFFFB0C0,"EWRAM",0x020F18,1,true,true},
  644. [6] = {1,"Hitbox Offset Y",0xFFFFB0C0,"EWRAM",0x020F19,1,true,true},
  645. [7] = {1,"Hitbox Width",0xFFFFB0C0,"EWRAM",0x020F1A,1,true,true},
  646. [8] = {1,"Hitbox Height",0xFFFFB0C0,"EWRAM",0x020F1B,1,true,true},
  647. [9] = {7,"is invincible",0xFFFFB0C0,"EWRAM",0x020F3C,2,true},
  648. [10] = {7,"is facing left",0xFFFFB0C0,"EWRAM",0x020EE8,0,true},
  649. [11] = {7,"mouth filled",0xFFFFB0C0,"EWRAM",0x020EE8,7,true},
  650. [12] = {1,"Ability",0xFFFFB0C0,"EWRAM",0x020FE3,1,true,false},
  651. [13] = {1,"Next Ability",0xFFFFB0C0,"EWRAM",0x020FBD,1,true,false},
  652. [14] = {1,"Health",0xFFFFB0C0,"EWRAM",0x020FE0,1,true,false},
  653. [15] = {1,"Max Health",0xFFFFB0C0,"EWRAM",0x020FE1,1,true,false},
  654. [16] = {1,"Lives",0xFFFFB0C0,"EWRAM",0x020FE2,1,true,false},
  655. [17] = {1,"Phone Battery",0xFFFFB0C0,"EWRAM",0x020FBC,1,true,false},
  656. [18] = {1,"Room",0xFFFFB0C0,"EWRAM",0x020FE6,2,true,false},
  657. [19] = {1,"Sprite ID",0xFFFFB0C0,"EWRAM",0x020FB4,1,true,false}
  658. }
  659.  
  660. local AddressTableYellow= {
  661. [1] = {1,"X",0xFFFFE060,"EWRAM",0x0210C8,4,true,false},
  662. [2] = {1,"Y",0xFFFFE060,"EWRAM",0x0210CC,4,true,false},
  663. [3] = {1,"X Speed",0xFFFFE060,"EWRAM",0x0210D8,2,true,true},
  664. [4] = {1,"Y Speed",0xFFFFE060,"EWRAM",0x0210DA,2,true,true},
  665. [5] = {1,"Hitbox Offset X",0xFFFFE060,"EWRAM",0x0210C0,1,true,true},
  666. [6] = {1,"Hitbox Offset Y",0xFFFFE060,"EWRAM",0x0210C1,1,true,true},
  667. [7] = {1,"Hitbox Width",0xFFFFE060,"EWRAM",0x0210C2,1,true,true},
  668. [8] = {1,"Hitbox Height",0xFFFFE060,"EWRAM",0x0210C3,1,true,true},
  669. [9] = {7,"is invincible",0xFFFFE060,"EWRAM",0x0210E4,2,true},
  670. [10] = {7,"is facing left",0xFFFFE060,"EWRAM",0x021090,0,true},
  671. [11] = {7,"mouth filled",0xFFFFE060,"EWRAM",0x021090,7,true},
  672. [12] = {1,"Ability",0xFFFFE060,"EWRAM",0x02118B,1,true,false},
  673. [13] = {1,"Next Ability",0xFFFFE060,"EWRAM",0x021165,1,true,false},
  674. [14] = {1,"Health",0xFFFFE060,"EWRAM",0x021188,1,true,false},
  675. [15] = {1,"Max Health",0xFFFFE060,"EWRAM",0x021189,1,true,false},
  676. [16] = {1,"Lives",0xFFFFE060,"EWRAM",0x02118A,1,true,false},
  677. [17] = {1,"Phone Battery",0xFFFFE060,"EWRAM",0x021164,1,true,false},
  678. [18] = {1,"Room",0xFFFFE060,"EWRAM",0x02118E,2,true,false},
  679. [19] = {1,"Sprite ID",0xFFFFE060,"EWRAM",0x02115C,1,true,false}
  680. }
  681.  
  682. local AddressTableRed= {
  683. [1] = {1,"X",0xFFFF9090,"EWRAM",0x021270,4,true,false},
  684. [2] = {1,"Y",0xFFFF9090,"EWRAM",0x021274,4,true,false},
  685. [3] = {1,"X Speed",0xFFFF9090,"EWRAM",0x021280,2,true,true},
  686. [4] = {1,"Y Speed",0xFFFF9090,"EWRAM",0x021282,2,true,true},
  687. [5] = {1,"Hitbox Offset X",0xFFFF9090,"EWRAM",0x021268,1,true,true},
  688. [6] = {1,"Hitbox Offset Y",0xFFFF9090,"EWRAM",0x021269,1,true,true},
  689. [7] = {1,"Hitbox Width",0xFFFF9090,"EWRAM",0x02126A,1,true,true},
  690. [8] = {1,"Hitbox Height",0xFFFF9090,"EWRAM",0x02126B,1,true,true},
  691. [9] = {7,"is invincible",0xFFFF9090,"EWRAM",0x02128C,2,true},
  692. [10] = {7,"is facing left",0xFFFF9090,"EWRAM",0x021238,0,true},
  693. [11] = {7,"mouth filled",0xFFFF9090,"EWRAM",0x021238,7,true},
  694. [12] = {1,"Ability",0xFFFF9090,"EWRAM",0x021333,1,true,false},
  695. [13] = {1,"Next Ability",0xFFFF9090,"EWRAM",0x02130D,1,true,false},
  696. [14] = {1,"Health",0xFFFF9090,"EWRAM",0x021330,1,true,false},
  697. [15] = {1,"Max Health",0xFFFF9090,"EWRAM",0x021331,1,true,false},
  698. [16] = {1,"Lives",0xFFFF9090,"EWRAM",0x021332,1,true,false},
  699. [17] = {1,"Phone Battery",0xFFFF9090,"EWRAM",0x02130C,1,true,false},
  700. [18] = {1,"Room",0xFFFF9090,"EWRAM",0x021336,2,true,false},
  701. [19] = {1,"Sprite ID",0xFFFF9090,"EWRAM",0x021304,1,true,false}
  702. }
  703.  
  704. local AddressTableGreen= {
  705. [1] = {1,"X",0xFFC0FF80,"EWRAM",0x021418,4,true,false},
  706. [2] = {1,"Y",0xFFC0FF80,"EWRAM",0x02141C,4,true,false},
  707. [3] = {1,"X Speed",0xFFC0FF80,"EWRAM",0x021428,2,true,true},
  708. [4] = {1,"Y Speed",0xFFC0FF80,"EWRAM",0x02142A,2,true,true},
  709. [5] = {1,"Hitbox Offset X",0xFFC0FF80,"EWRAM",0x021410,1,true,true},
  710. [6] = {1,"Hitbox Offset Y",0xFFC0FF80,"EWRAM",0x021411,1,true,true},
  711. [7] = {1,"Hitbox Width",0xFFC0FF80,"EWRAM",0x021412,1,true,true},
  712. [8] = {1,"Hitbox Height",0xFFC0FF80,"EWRAM",0x021413,1,true,true},
  713. [9] = {7,"is invincible",0xFFC0FF80,"EWRAM",0x021434,2,true},
  714. [10] = {7,"is facing left",0xFFC0FF80,"EWRAM",0x0213E0,0,true},
  715. [11] = {7,"mouth filled",0xFFC0FF80,"EWRAM",0x0213E0,7,true},
  716. [12] = {1,"Ability",0xFFC0FF80,"EWRAM",0x0214DB,1,true,false},
  717. [13] = {1,"Next Ability",0xFFC0FF80,"EWRAM",0x0214B5,1,true,false},
  718. [14] = {1,"Health",0xFFC0FF80,"EWRAM",0x0214D8,1,true,false},
  719. [15] = {1,"Max Health",0xFFC0FF80,"EWRAM",0x0214D9,1,true,false},
  720. [16] = {1,"Lives",0xFFC0FF80,"EWRAM",0x0214DA,1,true,false},
  721. [17] = {1,"Phone Battery",0xFFC0FF80,"EWRAM",0x0214B4,1,true,false},
  722. [18] = {1,"Room",0xFFC0FF80,"EWRAM",0x0214DE,2,true,false},
  723. [19] = {1,"Sprite ID",0xFFC0FF80,"EWRAM",0x0214AC,1,true,false}
  724. }
  725.  
  726. local Displays = {
  727.     -- Name, active, col, x, y, width, height, offset of list, edit mode, table, entries shown
  728.     [1]= {"General", false, 0xFFFFE0A0, 40, 40, 168, 50, 0, false, AddressTableGeneral,4},
  729.     [2]= {"Kirby", false, 0xFFFFB0C0, 40, 40, 168, 66, 0, false, AddressTableKirby,6},
  730.     [3]= {"Yellow", false, 0xFFFFE060, 40, 40, 168, 66, 0, false, AddressTableYellow,6},
  731.     [4]= {"Red", false, 0xFFFF9090, 40, 40, 168, 66, 0, false, AddressTableRed,6},
  732.     [5]= {"Green", false, 0xFFC0FF80, 40, 40, 168, 66, 0, false, AddressTableGreen,6},
  733.     [6]= {"Flags", false, 0xFFFFE0A0, 40, 40, 168, 82, 0, false, AddressTableFlags,8},
  734.     [7]= {"Hitboxes", false, 0xFFFFE0A0, nil},
  735.     [8]= {"TAS-related", false, 0xFFFFE0A0, nil}
  736. }
  737. local DisplayCount = #Displays
  738.  
  739. local AdditionalDisplays = {
  740. }
  741.  
  742. local Enemies = {}
  743. local Other = {}
  744.  
  745. local HelperKirby = {
  746.     [1]={"Yellow",0xFFFFE060},
  747.     [2]={"Red",0xFFFF9090},
  748.     [3]={"Green",0xFFC0FF80}
  749. }
  750.  
  751. local HitboxSettings = {
  752.     [1]={"Kirby",true},
  753.     [2]={"Enemy",true},
  754.     [3]={"Attack",true}
  755. }
  756.  
  757. local Mouse = {
  758.     X               = 0,
  759.     Y               = 0,
  760.     XBefore         = 0,
  761.     YBefore         = 0,
  762.     clickedFrames   = 0,
  763.     clicked         = false
  764. }
  765.  
  766. local Color = {
  767.     Selected    = 0xB0A0A0A0,
  768.     Normal      = 0xA0303030,
  769.     Grey        = 0xA0C0C0C0
  770. }
  771.  
  772. function text(x, y, text, color, backcolor)
  773.     if backcolor==nil then backcolor=0x00000000 end
  774.     gui.drawText(x, y, text,color,backcolor,10,"Arial")
  775. end
  776.  
  777. function box(x,y,x2,y2)
  778.     gui.drawBox(x,y,x2,y2,0x00000000,0xD0000000)
  779. end
  780.  
  781. function boxNormal(x,y,x2,y2)
  782.     gui.drawBox(x,y,x2,y2,0xFF000000,0xA0000000)
  783. end
  784.  
  785. function boxSelected(x,y,x2,y2)
  786.     gui.drawBox(x,y,x2,y2,0xFF000000,0xA0505050)
  787. end
  788.  
  789. function arrowDown(xpos,ypos,col)
  790.     gui.drawLine(xpos,ypos,xpos+6,ypos,col)
  791.     gui.drawLine(xpos+1,ypos+1,xpos+5,ypos+1,col)
  792.     gui.drawLine(xpos+2,ypos+2,xpos+4,ypos+2,col)
  793.     gui.drawPixel(xpos+3,ypos+3,col)
  794. end
  795.  
  796. function arrowUp(xpos,ypos,col)
  797.     gui.drawLine(xpos,ypos,xpos+6,ypos,col)
  798.     gui.drawLine(xpos+1,ypos-1,xpos+5,ypos-1,col)
  799.     gui.drawLine(xpos+2,ypos-2,xpos+4,ypos-2,col)
  800.     gui.drawPixel(xpos+3,ypos-3,col)
  801. end
  802.  
  803. function drawDisplayBox(id,bordercolor,color)
  804.     posx=Displays[id][4]
  805.     posy=Displays[id][5]
  806.     width=Displays[id][6]
  807.     height=Displays[id][7]
  808.    
  809.     if Mouse.clicked then
  810.  
  811.         if Mouse.X > posx and Mouse.X < posx+width and Mouse.Y > posy and Mouse.Y < posy+height then
  812.  
  813.             if Mouse.clickedFrames > 0 then
  814.                 menuscreen=0 -- close menu
  815.                
  816.                 posy = posy + (Mouse.Y-Mouse.YBefore) -- enables mouse drag
  817.                 posx = posx + (Mouse.X-Mouse.XBefore)
  818.  
  819.                 vertical_padding = Padding.Top+Padding.Bottom
  820.                 horizontal_padding = Padding.Left+Padding.Right
  821.  
  822.                 if posy < 0 then posy=0 -- prevents display from going offscreen
  823.                 elseif posy > 159+vertical_padding-height then posy=159+vertical_padding-height end
  824.                 if posx < 0 then posx=0
  825.                 elseif posx > 239+horizontal_padding-width then posx=239+horizontal_padding-width end
  826.            
  827.                 Displays[id][4]=posx
  828.                 Displays[id][5]=posy
  829.             end
  830.         end
  831.     end
  832.     gui.drawBox(posx,posy,posx+width,posy+height,bordercolor,color)
  833.     text(posx+3,posy-1,Displays[id][1],0xFF808080)
  834. end
  835.        
  836. function drawCloseButton(id)
  837.     width=Displays[id][6]
  838.     x=Displays[id][4]
  839.     y=Displays[id][5]
  840.    
  841.     drawButton(x+width-10,y,10,10,"x",Color.Grey,15,function()
  842.         Displays[id][2] = false
  843.     end)
  844. end
  845.  
  846. function drawEditButton(id)
  847.  
  848.     width=Displays[id][6]
  849.     x=Displays[id][4]
  850.     y=Displays[id][5]
  851.     if Displays[id][9] then col=Color.Selected
  852.     else col=Color.Normal end
  853.    
  854.     drawButton(x+width-25,y,12,10,"e",col,15,function()
  855.         Displays[id][9]=not Displays[id][9]
  856.     end)
  857. end
  858.  
  859. function drawButton(posx,posy,width,height,label,color,frequency,clickedfunction)
  860.     if Mouse.X>posx and Mouse.X<posx+width and Mouse.Y>posy and Mouse.Y<posy+height then
  861.             if Mouse.clicked and Mouse.clickedFrames%frequency==1 then  
  862.                 clickedfunction()
  863.             end
  864.         gui.drawBox(posx,posy,posx+width,posy+height,color-0x00303030,color+0x30303030)
  865.     else
  866.         gui.drawBox(posx,posy,posx+width,posy+height,color-0x00303030,color)
  867.     end
  868.     text(posx+1,posy-2,label,0xFFFFFFFF)
  869. end
  870.  
  871. function drawMenuButton(posx,posy,width,height,label,z,drawindicator,indicator,col,clickedfunction)
  872.     if Mouse.X>posx and Mouse.X<posx+width and Mouse.Y>posy and Mouse.Y<posy+height then
  873.         if Mouse.clicked and Mouse.clickedFrames==z then
  874.             menuscreen=0
  875.             clickedfunction()
  876.         end
  877.         boxSelected(posx,posy,posx+width,posy+height)
  878.     else
  879.         boxNormal(posx,posy,posx+width,posy+height)
  880.     end
  881.     text(posx+2,posy-1,label,col)
  882.    
  883.     if drawindicator then
  884.         if indicator then text(posx+width-10,posy,"o",0xFF80FF80)
  885.         else text(posx+width-10,posy-1,"x",0xFFFF9090) end
  886.     end
  887. end
  888.  
  889. local getChangeAmount = function(valueChangeAmount)
  890.     if Mouse.clickedFrames>540 then
  891.         valueChangeAmount=valueChangeAmount*1000000
  892.     elseif Mouse.clickedFrames>450 then
  893.         valueChangeAmount=valueChangeAmount*100000
  894.     elseif Mouse.clickedFrames>360 then
  895.         valueChangeAmount=valueChangeAmount*10000
  896.     elseif Mouse.clickedFrames>270 then
  897.         valueChangeAmount=valueChangeAmount*1000
  898.     elseif Mouse.clickedFrames>180 then
  899.         valueChangeAmount=valueChangeAmount*100
  900.     elseif Mouse.clickedFrames>90 then
  901.         valueChangeAmount=valueChangeAmount*10
  902.     end
  903.     return valueChangeAmount
  904. end
  905.  
  906. local addressTableSetValue = function(address, addressSize, addressEndian, newvalue)
  907.  
  908.     if addressSize==1 then
  909.         memory.write_u8(address,newvalue)
  910.     elseif addressSize==2 then
  911.         if addressEndian then
  912.             memory.write_u16_le(address,newvalue)
  913.         else
  914.             memory.write_u16_be(address,newvalue)
  915.         end            
  916.     elseif addressSize==3 then
  917.         if addressEndian then
  918.             memory.write_u24_le(address,newvalue)
  919.         else
  920.             memory.write_u24_be(address,newvalue)
  921.         end
  922.     elseif addressSize==4 then
  923.         if addressEndian then
  924.             memory.write_u32_le(address,newvalue)
  925.         else
  926.             memory.write_u32_be(address,newvalue)
  927.         end
  928.     end
  929.    
  930. end
  931.  
  932. local addressTableGetValue = function(address, addressSize, addressEndian, addressSigned)
  933.  
  934.     if addressSigned then
  935.         if addressSize==1 then
  936.             value=memory.read_s8(address)
  937.         elseif addressSize==2 then
  938.             if addressEndian then
  939.                 value=memory.read_s16_le(address)
  940.             else
  941.                 value=memory.read_s16_be(address)
  942.             end            
  943.         elseif addressSize==3 then
  944.             if addressEndian then
  945.                 value=memory.read_s24_le(address)
  946.             else
  947.                 value=memory.read_s24_be(address)
  948.             end
  949.         elseif addressSize==4 then
  950.             if addressEndian then
  951.                 value=memory.read_s32_le(address)
  952.             else
  953.                 value=memory.read_s32_be(address)
  954.             end
  955.         end
  956.     else
  957.         if addressSize==1 then
  958.             value=memory.read_u8(address)
  959.         elseif addressSize==2 then
  960.             if addressEndian then
  961.                 value=memory.read_u16_le(address)
  962.             else
  963.                 value=memory.read_u16_be(address)
  964.             end            
  965.         elseif addressSize==3 then
  966.             if addressEndian then
  967.                 value=memory.read_u24_le(address)
  968.             else
  969.                 value=memory.read_u24_be(address)
  970.             end
  971.         elseif addressSize==4 then
  972.             if addressEndian then
  973.                 value=memory.read_u32_le(address)
  974.             else
  975.                 value=memory.read_u32_be(address)
  976.             end
  977.         end
  978.     end
  979.    
  980.     return value   
  981. end
  982.  
  983. local DisplayAddressTable = function(display_id, has_arrows,  has_buttons,  display_description,  description_offset,  arrows_offset,  buttons_offset)
  984.    
  985.     inputTable=Displays[display_id][10]
  986.     xpos=Displays[display_id][4]
  987.     ypos=Displays[display_id][5]
  988.     memorydomainBefore=memory.getcurrentmemorydomain()
  989.     tableSize=#inputTable
  990.     table_start=1
  991.     table_end=Displays[display_id][11]
  992.     table_iterations = 1
  993.     offset=Displays[display_id][8]
  994.     list_height = 8*(table_end - table_start)+14
  995.  
  996.     --display arrows:
  997.     if has_arrows then
  998.         --bottom arrow button
  999.         if (tableSize - offset) > table_end then
  1000.             if Mouse.X>xpos+arrows_offset and Mouse.X<xpos+arrows_offset+12 and Mouse.Y>ypos+list_height and Mouse.Y<ypos+list_height+6 then
  1001.                 if Mouse.clicked then
  1002.                     Displays[display_id][8]=offset+1
  1003.                 end
  1004.                 arrowDown(xpos+arrows_offset+2,ypos+list_height,0xFFFFFFFF)
  1005.             else
  1006.                 arrowDown(xpos+arrows_offset+2,ypos+list_height,0xA0FFFFFF)
  1007.             end
  1008.         else
  1009.             if offset < 0 then
  1010.                 Displays[display_id][8]=0
  1011.             end
  1012.         end
  1013.            
  1014.         --top arrow button
  1015.         if offset > 0 then
  1016.             if Mouse.X>xpos+arrows_offset and Mouse.X<xpos+arrows_offset+12 and Mouse.Y>ypos+list_height-10 and Mouse.Y<ypos+list_height-4 then
  1017.                 if Mouse.clicked then
  1018.                     Displays[display_id][8]=offset-1
  1019.                 end
  1020.                 arrowUp(xpos+arrows_offset+2,ypos+list_height-6,0xFFFFFFFF)
  1021.             else
  1022.                 arrowUp(xpos+arrows_offset+2,ypos+list_height-6,0xA0FFFFFF)
  1023.             end
  1024.         end
  1025.     end
  1026.     -- applying display offset
  1027.     table_start = table_start + offset
  1028.     table_end   = table_end + offset
  1029.  
  1030.     -- going through the table
  1031.     for i=table_start,table_end do --show a part of the list
  1032.  
  1033.         contenttype=inputTable[i][1]
  1034.         description=inputTable[i][2]
  1035.         textColor=inputTable[i][3]
  1036.         memorydomain=inputTable[i][4]
  1037.        
  1038.         if contenttype==0 then  -- TITLE
  1039.                
  1040.             gui.drawBox(5+xpos,4+ypos+table_iterations*8,arrows_offset+xpos,12+ypos+table_iterations*8,0x00000000,0xFF505050)
  1041.    
  1042.         elseif contenttype==7 then -- BINARY
  1043.            
  1044.             memory.usememorydomain(memorydomain)
  1045.             address=inputTable[i][5]
  1046.             currentbit=inputTable[i][6]
  1047.             value=memory.read_u8(address)
  1048.  
  1049.             value=bit.check(value, currentbit)
  1050.            
  1051.             if value then
  1052.                 value="Yes"
  1053.                 valueColor=0xFF80FF80
  1054.             else
  1055.                 value="No"
  1056.                 valueColor=0xFFFF9090
  1057.             end
  1058.            
  1059.             text(5+xpos,3+ypos+table_iterations*8,value,valueColor)
  1060.        
  1061.         else    -- OTHER TYPES 
  1062.             memory.usememorydomain(memorydomain)
  1063.             address=inputTable[i][5]
  1064.             addressSize=inputTable[i][6]
  1065.             addressEndian=inputTable[i][7] -- true:little endian, false:big endian
  1066.             addressSigned=inputTable[i][8]
  1067.             valueChangeAmount=1                  
  1068.             value = addressTableGetValue(address,addressSize,addressEndian, addressSigned)
  1069.             text(5+xpos,3+ypos+table_iterations*8,value, textColor)
  1070.         end
  1071.        
  1072.         if display_description then
  1073.             text(xpos+description_offset,3+ypos+table_iterations*8,description, textColor)
  1074.         end
  1075.  
  1076.         if has_buttons then
  1077.            
  1078.             if contenttype==7 then -- binary
  1079.            
  1080.                 drawButton(xpos+buttons_offset,4+ypos+table_iterations*8,21,8,"Set",Color.Normal,8,function()
  1081.    
  1082.                     currentvalue=memory.read_u8(address)
  1083.  
  1084.                     if bit.check(currentvalue,currentbit) then
  1085.                         memory.write_u8(address, bit.clear(currentvalue,currentbit))
  1086.                     else
  1087.                         memory.write_u8(address, bit.set(currentvalue,currentbit)) 
  1088.                     end
  1089.                
  1090.                 end)
  1091.  
  1092.             elseif contenttype~=0 then -- normal values
  1093.            
  1094.                 drawButton(xpos+buttons_offset,4+ypos+table_iterations*8,9,8,"-",Color.Normal,5,function()
  1095.                     valueChangeAmount = getChangeAmount(valueChangeAmount) -- increases when holding mouse key 
  1096.                     newvalue = value - valueChangeAmount
  1097.                     addressTableSetValue(address,addressSize,addressEndian,newvalue)                   
  1098.                 end)
  1099.  
  1100.                 drawButton(12+xpos+buttons_offset,4+ypos+table_iterations*8,9,8,"+",Color.Normal,5,function()
  1101.                     valueChangeAmount = getChangeAmount(valueChangeAmount) -- increases when holding mouse key         
  1102.                     newvalue = value + valueChangeAmount
  1103.                     addressTableSetValue(address,addressSize,addressEndian,newvalue)               
  1104.                 end)
  1105.             end        
  1106.         end
  1107.         table_iterations=table_iterations+1
  1108.     end
  1109.     memory.usememorydomain(memorydomainBefore)
  1110. end
  1111.    
  1112. local drawDisplay = function(id)
  1113.     if Displays[id][4]~=nil then
  1114.         drawDisplayBox(id, 0xFF202020,0xA0000000)
  1115.         drawCloseButton(id)
  1116.         drawEditButton(id)
  1117.         if Displays[id][9] then
  1118.             DisplayAddressTable(id,true,true,true,66,158,42)   
  1119.         else
  1120.             DisplayAddressTable(id,true,false,true,46,158,0)
  1121.         end
  1122.     end
  1123. end
  1124.  
  1125. local getAbilityValue = function(nextAbility)
  1126.     nextAb = nextAbility
  1127.     if bit.check(nextAbility, 7) then
  1128.         nextAb = nextAb - 0x80
  1129.     end
  1130.     if bit.check(nextAbility, 6) then
  1131.         nextAb = nextAb - 0x40
  1132.     end
  1133.     return nextAb
  1134. end
  1135.  
  1136. local updateEnemies = function(enemyTableSize,fullSearch)
  1137.  
  1138.     memory.usememorydomain("EWRAM")
  1139.     count=1
  1140.     Enemies = {}
  1141.     address=0x0
  1142.     found=false
  1143.     if fullSearch then end_address=0x36FF
  1144.     else end_address=enemyTableSize*0xBC + 0x3F0 end
  1145.    
  1146.     while address < end_address do     
  1147.         if memory.read_u32_le(address)== 0x1FFFFFF
  1148.         and memory.read_u8(address-1)~= 255 then
  1149.             Enemies[count]=address
  1150.             count=count+1
  1151.             found=true
  1152.         end
  1153.         if found then address=address+0x04
  1154.                  else address=address+0x01
  1155.         end
  1156.     end
  1157. end
  1158.  
  1159. local updateOther = function(enemyTableSize)
  1160.  
  1161.     memory.usememorydomain("IWRAM")
  1162.     count=1
  1163.     Other = {}
  1164.     address=0x3CB0
  1165.     end_address=0x4FFF
  1166.    
  1167.     while address < end_address do
  1168.         if memory.read_u32_le(address)== 0xFFFFFFFF
  1169.         and memory.read_u8(address-1)~= 255 then
  1170.             Other[count]=address
  1171.             count=count+1
  1172.         end
  1173.         address=address+0x04
  1174.     end
  1175.  
  1176. end
  1177.  
  1178. local makeEnemyTable = function(offset)
  1179.  
  1180.     if AddressTableEnemies[offset] == nil then -- only do this if it doesn't exist yet
  1181.         memory.usememorydomain("EWRAM")
  1182.        
  1183.         ID = memory.read_u8(offset+0x85)
  1184.         name = "-unknown-"
  1185.         if enemyNames[ID] ~= nil then name = enemyNames[ID] end
  1186.        
  1187.         AddressTableEnemies[offset] = {
  1188.             [01] = {1,"ID",0xFFFFE0A0,"EWRAM",offset+0x85,1,true},
  1189.             [02] = {1,"Health",0xFFFFE0A0,"EWRAM",offset+0x83,1,true},
  1190.             [03] = {1,"X",0xFFFFE0A0,"EWRAM",offset+0x44,3,true},
  1191.             [04] = {1,"Y",0xFFFFE0A0,"EWRAM",offset+0x48,3,true},
  1192.             [05] = {1,"Hitbox Offset X",0xFFFFE0A0,"EWRAM",offset+0x3B,1,true},
  1193.             [06] = {1,"Hitbox Offset Y",0xFFFFE0A0,"EWRAM",offset+0x3C,1,true},
  1194.             [07] = {1,"Hitbox Width",0xFFFFE0A0,"EWRAM",offset+0x3D,1,true},
  1195.             [08] = {1,"Hitbox Height",0xFFFFE0A0,"EWRAM",offset+0x3E,1,true},
  1196.             [09] = {1,"Custom 1",0xFFFFE0A0,"EWRAM",offset+0x07,1,true},
  1197.             [10] = {1,"Custom 2",0xFFFFE0A0,"EWRAM",offset+0x08,1,true},
  1198.             [11] = {1,"Kept Active By",0xFFFFE0A0,"EWRAM",offset+0x59,1,true},
  1199.             [12] = {1,"Ability",0xFFFFE0A0,"EWRAM",offset+0x87,1,true},
  1200.             [13] = {1,"Animation ID",0xFFFFE0A0,"EWRAM",offset+0x86,1,true},
  1201.             [14] = {1,"Animation Speed",0xFFFFE0A0,"EWRAM",offset+0x2f,1,true},
  1202.             [15] = {7,"Facing Left",0xFFFFE0A0,"EWRAM",offset+0x0B,0,true},
  1203.             [16] = {7,"No Gravity",0xFFFFE0A0,"EWRAM",offset+0x0B,6,true},
  1204.             [17] = {7,"Wall Collision",0xFFFFE0A0,"EWRAM",offset+0x0C,0,true},
  1205.             [18] = {7,"Player Collision",0xFFFFE0A0,"EWRAM",offset+0x0C,1,true},
  1206.             [19] = {7,"Wait/Hitstun",0xFFFFE0A0,"EWRAM",offset+0x0C,3,true},
  1207.             [20] = {7,"Should Despawn",0xFFFFE0A0,"EWRAM",offset+0x0C,4,true},
  1208.             [21] = {7,"Is Heavy",0xFFFFE0A0,"EWRAM",offset+0x5f,1,true},
  1209.             [22] = {7,"Ignores Damage",0xFFFFE0A0,"EWRAM",offset+0x5f,7,true}
  1210.            
  1211.             -- incorrect:
  1212.             --[23] = {7,"Ignores Inhale",0xFFFFE0A0,"EWRAM",offset+0x5f,4,true},
  1213.             --[21] = {7,"Invincible",0xFFFFE0A0,"EWRAM",offset+0x0D,0,true},
  1214.         }
  1215.        
  1216.         Displays[#Displays + 1] = {name, true, 0xFFFFE0A0, 40, 40, 168, 82, 0, false, AddressTableEnemies[offset],8,offset}
  1217.     else
  1218.         -- find and open display to this enemy
  1219.         if #Displays > DisplayCount then
  1220.             for i=DisplayCount, #Displays do
  1221.                 if Displays[i][12] == offset then
  1222.                     Displays[i][2] = true
  1223.                 end
  1224.             end
  1225.         end
  1226.     end
  1227. end
  1228.  
  1229. local drawEnemies = function()  -- Enemies
  1230.  
  1231.     local buttoncol,color,subcolor,verticalOffset=0
  1232.     local info=""
  1233.     local counterOffset=0
  1234.     local enemyTableSize = #Enemies
  1235.     local otherTableSize = #Other
  1236.    
  1237.     memory.usememorydomain("EWRAM")
  1238.     local cameraX = memory.read_u16_le(0x23660) - Padding.Left
  1239.     local cameraY = memory.read_u16_le(0x23662) - Padding.Top
  1240.    
  1241.     --buttons
  1242.     for s=1,#HitboxSettings do
  1243.         if HitboxSettings[s][2] then buttoncol=Color.Selected
  1244.         else buttoncol=Color.Normal end
  1245.         drawButton(14+s*40,0,36,9,HitboxSettings[s][1],buttoncol,15,function()
  1246.             HitboxSettings[s][2]=not HitboxSettings[s][2]
  1247.         end)
  1248.     end
  1249.    
  1250.     if HitboxSettings[1][2] then
  1251.         --display kirby hitbox         
  1252.             --careful: It's expected to be EWRAM here
  1253.         for i=0,3 do
  1254.             offset  =i*0x1A8
  1255.             room = memory.read_u16_le(0x020FE6+offset)
  1256.             kirbyX   = memory.read_u24_le(0x020F21+offset)
  1257.             kirbyY   = memory.read_u24_le(0x020F25+offset)
  1258.             hitboxX  = memory.read_s8(0x020F18+offset)
  1259.             hitboxY  = memory.read_s8(0x020F19+offset)
  1260.             width  = memory.read_s8(0x020F1A+offset)
  1261.             height = memory.read_s8(0x020F1B+offset)
  1262.             x=kirbyX-cameraX+hitboxX    -- screen x
  1263.             y=kirbyY-cameraY+hitboxY    -- screen y
  1264.             x2=x+width*2
  1265.             y2=y+height*2  
  1266.            
  1267.             if i>0
  1268.             and room ~= memory.read_u16_le(0x020FE6) then --kirby is in different room
  1269.                 color=HelperKirby[i][2]
  1270.                 subcolor=HelperKirby[i][2]
  1271.             else -- same room
  1272.                 color=0xFFFFFFFF
  1273.                 subcolor=0x00000000
  1274.             end
  1275.             gui.drawBox(x,y,x2,y2,color) -- hitbox rectangle
  1276.         end
  1277.     end
  1278.    
  1279.     if HitboxSettings[2][2] then
  1280.         --update enemy
  1281.         if frames%12==0 then
  1282.             updateEnemies(enemyTableSize,false)
  1283.         end
  1284.  
  1285.         --display
  1286.         enemyTableSize = #Enemies  
  1287.         if enemyTableSize>0 then
  1288.             memory.usememorydomain("EWRAM")
  1289.             for s=1,enemyTableSize do
  1290.  
  1291.                 offset = Enemies[s]    
  1292.                 ID = memory.read_u8(offset+0x85)
  1293.                 name = "-unknown-"
  1294.                 if enemyNames[ID] ~= nil then name = enemyNames[ID] end
  1295.                 status   = memory.read_u8(offset+0x32)
  1296.                 enemyX   = memory.read_u24_le(offset+0x44)
  1297.                 enemyY   = memory.read_u24_le(offset+0x48)
  1298.                 hitboxX  = memory.read_s8(offset+0x3B)
  1299.                 hitboxY  = memory.read_s8(offset+0x3C)
  1300.                 width  = memory.read_s8(offset+0x3D)
  1301.                 height = memory.read_s8(offset+0x3E)
  1302.                 heldAliveBy = memory.read_s8(offset+0x59)
  1303.                 health = memory.read_s8(offset+0x83)
  1304.                 x_base = enemyX-cameraX
  1305.                 y_base = enemyY-cameraY
  1306.                 x=x_base+hitboxX    -- screen x
  1307.                 y=y_base+hitboxY    -- screen y
  1308.                 x2=x+width*2
  1309.                 y2=y+height*2
  1310.                 x3=x+width      -- center
  1311.                
  1312.                 if Mouse.X > x-4 and Mouse.X < x2+4 and Mouse.Y > y-4 and Mouse.Y < y2+4 then
  1313.                     color = 0xFF00FFFF
  1314.                     subcolor = 0x80000000
  1315.                     verticalOffset = -36
  1316.                     info = health .. " HP\n" ..enemyX .. " X\n" ..enemyY .. " Y"   
  1317.                    
  1318.                     if Mouse.clicked and Mouse.clickedFrames==1 then
  1319.                         makeEnemyTable(offset)
  1320.                     end
  1321.                 else
  1322.                     color = 0xFF00FFFF
  1323.                     subcolor = 0x80000000
  1324.                     verticalOffset = -13
  1325.                     info = health .. " HP"
  1326.                 end
  1327.                
  1328.                 if status==0 then
  1329.                     color=color - 0x80000000
  1330.                     subcolor=subcolor - 0x40000000
  1331.                     if HelperKirby[heldAliveBy] ~= nil then
  1332.                         gui.drawLine(x,y2+1,x2,y2+1,HelperKirby[heldAliveBy][2])
  1333.                     end
  1334.                 end
  1335.            
  1336.                 text(x3-8,y+verticalOffset,info,color,subcolor) -- information
  1337.                 gui.drawBox(x,y,x2,y2,color) -- hitbox rectangle
  1338.                
  1339.                 -- this will display another box, currently unknown what this is used for
  1340.                 --[[
  1341.                 box2X  = memory.read_s8(offset+0x3F)
  1342.                 box2Y  = memory.read_s8(offset+0x40)
  1343.                 box2width  = memory.read_s8(offset+0x41)
  1344.                 box2height  = memory.read_s8(offset+0x42)
  1345.                 box2_x=enemyX-cameraX+box2X -- screen x
  1346.                 box2_y=enemyY-cameraY+box2Y -- screen y
  1347.                 box2_x2=box2_x+box2width*2
  1348.                 box2_y2=box2_y+box2height*2
  1349.                 gui.drawBox(box2_x,box2_y,box2_x2,box2_y2,0xFF00FF00)
  1350.                 ]]
  1351.                
  1352.                 --Mirra check box
  1353.                 if ID == 52 then
  1354.                     check_area_size  = memory.read_s8(offset+0x08)
  1355.                     check_bl_x = x_base-check_area_size
  1356.                     check_bl_y = y_base-check_area_size
  1357.                     check_tr_x = x_base+check_area_size
  1358.                     check_tr_y = y_base+check_area_size
  1359.                     gui.drawBox(check_bl_x, check_bl_y, check_tr_x, check_tr_y, 0xFF00FF00)
  1360.                 end
  1361.             end
  1362.             text(176,-2,"enemies: " .. enemyTableSize,0xFFFFFF00,0x80000000)               
  1363.             counterOffset=counterOffset+12
  1364.         end
  1365.     end
  1366.    
  1367.     if HitboxSettings[3][2] then
  1368.         --update other
  1369.         if frames%4==0 then
  1370.             updateOther(otherTableSize)
  1371.         end
  1372.  
  1373.         --display
  1374.         otherTableSize = #Other
  1375.         if otherTableSize>0 then
  1376.             memory.usememorydomain("IWRAM")
  1377.             for s=1,otherTableSize do
  1378.  
  1379.                 offset = Other[s]          
  1380.                 status   = memory.read_u8(offset-0x27)
  1381.                 status2      = memory.read_u8(offset-0x25)
  1382.                 otherX   = memory.read_u16_le(offset+0x11)
  1383.                 otherY   = memory.read_u16_le(offset+0x15)
  1384.                 hitboxX  = memory.read_s8(offset+0x8)
  1385.                 hitboxY  = memory.read_s8(offset+0x9)
  1386.                 width  = memory.read_s8(offset+0xA)
  1387.                 height = memory.read_s8(offset+0xB)
  1388.                 damage = memory.read_s8(offset+0x33)
  1389.                 x=otherX-cameraX+hitboxX    -- screen x
  1390.                 y=otherY-cameraY+hitboxY    -- screen y
  1391.                 x2=x+width*2
  1392.                 y2=y+height*2
  1393.                
  1394.                 if not bit.check(status, 4)
  1395.                 and (status2 == 0xA0
  1396.                     or status2 == 0xA2
  1397.                     or status2 == 0x10) then
  1398.                     gui.drawBox(x,y,x2,y2,0xFFFF4000)
  1399.                     text(x,y-13,damage .. " dmg",0xFFFF4000,0x40000000)
  1400.                 end
  1401.             end
  1402.             text(176,-2+counterOffset,"attack: " .. otherTableSize,0xFFFF4000,0x80000000)              
  1403.         end
  1404.     end
  1405. end
  1406.  
  1407. local Menu = {
  1408.     [1] =       {   [0] = "Script",
  1409.                     [1] = 2,
  1410.                     [2] = 3,
  1411.                     [3] = 4,
  1412.                     [4] = 5,
  1413.                     [5] = 1,
  1414.                     [6] = 6,
  1415.                     [7] = 7,
  1416.                     [8] = 8
  1417.                 }
  1418. }
  1419.  
  1420. local drawMenu = function()
  1421.  
  1422.     verticalOffset=0
  1423.  
  1424.     for a=1,#Menu,1 do
  1425.         drawMenuButton(-38+a*45,18,40,11,Menu[a][0],2,false,true,0xFFFFFFFF,function()
  1426.             menuscreen=a
  1427.         end)   
  1428.        
  1429.         if menuscreen==a then
  1430.            
  1431.             for b=1,#Menu[a],1 do
  1432.            
  1433.                 id              = Menu[a][b]
  1434.                 title           = Displays[id][1]
  1435.                 indicator       = Displays[id][2]
  1436.                 col             = Displays[id][3]
  1437.                
  1438.                 drawMenuButton(7,32+verticalOffset*10,72,10,title,1,true,indicator,col,function()
  1439.                     Displays[id][2] = not indicator
  1440.                 end)           
  1441.                
  1442.                 verticalOffset=verticalOffset+1
  1443.             end        
  1444.         end
  1445.     end
  1446.    
  1447.     if Mouse.clicked and Mouse.clickedFrames==1 then
  1448.            menuscreen = 0
  1449.     end
  1450. end
  1451.  
  1452. local PaddingRefresh = function()
  1453.     client.SetGameExtraPadding(Padding.Left,Padding.Top,Padding.Right,Padding.Bottom)
  1454. end
  1455.  
  1456. local PaddingOff = function()
  1457.     client.SetGameExtraPadding(0,0,0,0)
  1458. end
  1459.  
  1460. event.onloadstate(function()
  1461.     updateEnemies(3,true)
  1462.     updateOther(3)
  1463.     PaddingRefresh()
  1464. end)
  1465.  
  1466. event.onexit(function()
  1467.     PaddingOff()
  1468. end)
  1469.  
  1470. updateEnemies(3,true)
  1471. updateOther(3)
  1472. menuscreen=0
  1473. frames=0
  1474. console.clear()
  1475. for i=1,#ScriptInfo,1 do
  1476.     print(ScriptInfo[i])
  1477. end
  1478.  
  1479. PaddingRefresh()
  1480.  
  1481. -- Show Kirby display and TAS-related info by default
  1482. Displays[2][2] = true
  1483. Displays[2][4] = 280
  1484. Displays[2][5] = 120
  1485. Displays[8][2] = true
  1486.  
  1487.  
  1488. while true do
  1489.  
  1490.     Mouse.X = input.getmouse().X + Padding.Left
  1491.     Mouse.Y = input.getmouse().Y + Padding.Top
  1492.     Mouse.clicked = input.getmouse().Left
  1493.    
  1494.     -- enemies / hitboxes
  1495.     if Displays[7][2] then
  1496.         drawEnemies()
  1497.     else
  1498.         -- kill enemy displays
  1499.         if #Displays > DisplayCount then
  1500.             for i=DisplayCount + 1,#Displays do
  1501.                 Displays[i] = nil
  1502.             end
  1503.         end
  1504.         -- kill enemy tables
  1505.         AddressTableEnemies = {}
  1506.     end
  1507.    
  1508.     -- tas info
  1509.     if Displays[8][2] then
  1510.         memory.usememorydomain("EWRAM")
  1511.         local room_id = memory.read_u16_le(0x020FE6)
  1512.            
  1513.             -- room
  1514.         text(176,24,"Room: "..room_id,0xFFFFFFFF,0xFF000000)
  1515.             -- "no puff lag" trick
  1516.         nopufflag = memory.read_u8(0x020EE1)
  1517.         nopuff_col = 0xFFFF0000
  1518.         if nopufflag == 0 then nopuff_col = 0xFF00FF00 end
  1519.         text(176,35,"Puff trick: " .. nopufflag,nopuff_col,0xFF000000)
  1520.             -- "holding up to float up" input count
  1521.         text(176,46,"HoldUp: "..memory.read_u8(0x020FB8),0xFFFFFFFF,0xFF000000)
  1522.         -- additional information on the left
  1523.         if room_id == 106 then -- rainbow road first room; shows optimal wheel positioning to jump over the blue enemy without hitting
  1524.             kirby_x = memory.read_u32_le(0x020F20)
  1525.             if kirby_x < 19000 then
  1526.                 wheel_pos_is_good = false
  1527.                 lower_limit = 12062
  1528.                 upper_limit = 12287
  1529.                 wheel_is_good_col = 0xFFFF0000
  1530.                 missing1 = 0
  1531.                 missing2 = 0
  1532.                 show_additional = true
  1533.                 if kirby_x > upper_limit then
  1534.                     while kirby_x > upper_limit do
  1535.                         missing1 = kirby_x - upper_limit
  1536.                         kirby_x = kirby_x - 1024
  1537.                         missing2 = kirby_x - lower_limit
  1538.                     end
  1539.                 elseif kirby_x < lower_limit then
  1540.                     while kirby_x < lower_limit do
  1541.                         missing1 = lower_limit - kirby_x
  1542.                         kirby_x = kirby_x + 1024
  1543.                         missing2 = upper_limit - kirby_x
  1544.                     end
  1545.                 end
  1546.                 if kirby_x >= lower_limit and kirby_x <= upper_limit then
  1547.                     wheel_is_good_col = 0xFF00FF00
  1548.                     show_additional = false
  1549.                 end
  1550.                 text(10,48,"Wheel pos good?",wheel_is_good_col,0xFF000000)
  1551.                 text(10,60,kirby_x,wheel_is_good_col,0xFF000000)
  1552.                 if show_additional then
  1553.                     text(10,72,missing1 .. " " .. missing2,wheel_is_good_col,0xFF000000)
  1554.                 end
  1555.             end
  1556.         end
  1557.         -- show when Helper kirby transforms (includes "random" transformations when you are not in their room)
  1558.         if memory.read_u32_le(0x021100) == 0x0805C591 then
  1559.             boxNormal(36,128,226,144)
  1560.             nextAbility         = memory.read_u8(0x21165)
  1561.             nextAbilityValue    = getAbilityValue(nextAbility)
  1562.             nextAbilityFlag1    = bit.check(nextAbility, 7) -- not quite sure how these are used. "Is Belly transform" only sometimes applies
  1563.             nextAbilityFlag2    = bit.check(nextAbility, 6)
  1564.             if abilityNames[nextAbilityValue] ~= nil then
  1565.                 text(38,130,"Yellow Kirby Transform: " .. nextAbilityValue .. " " .. string.upper(abilityNames[nextAbilityValue]),0xFFFFFF00)
  1566.             else
  1567.                 print("Yellow Kirby nextAbility had bad value: " .. nextAbility .. " " .. nextAbilityValue)
  1568.             end
  1569.         end
  1570.         if memory.read_u32_le(0x0212a8) == 0x0805C591 then
  1571.             boxNormal(36,142,226,158)
  1572.             nextAbility         = memory.read_u8(0x2130D)
  1573.             nextAbilityValue    = getAbilityValue(nextAbility)
  1574.             nextAbilityFlag1    = bit.check(nextAbility, 7) -- not quite sure how these are used. "Is Belly transform" only sometimes applies
  1575.             nextAbilityFlag2    = bit.check(nextAbility, 6)
  1576.             if abilityNames[nextAbilityValue] ~= nil then
  1577.                 text(38,144,"Red Kirby Transform: " .. nextAbilityValue .. " " .. string.upper(abilityNames[nextAbilityValue]),0xFFFF0000)
  1578.             else
  1579.                 print("Red Kirby nextAbility had bad value: " .. nextAbility .. " " .. nextAbilityValue)
  1580.             end
  1581.         end
  1582.         if memory.read_u32_le(0x021450) == 0x0805C591 then
  1583.             boxNormal(36,156,226,172)
  1584.             nextAbility         = memory.read_u8(0x214B5)
  1585.             nextAbilityValue    = getAbilityValue(nextAbility)
  1586.             nextAbilityFlag1    = bit.check(nextAbility, 7) -- not quite sure how these are used. "Is Belly transform" only sometimes applies
  1587.             nextAbilityFlag2    = bit.check(nextAbility, 6)
  1588.             if abilityNames[nextAbilityValue] ~= nil then
  1589.                 text(38,158,"Green Kirby Transform: " .. nextAbilityValue .. " " ..  string.upper(abilityNames[nextAbilityValue]),0xFF00FF00)
  1590.             else
  1591.                 print("Green Kirby nextAbility had bad value: " .. nextAbility .. " " .. nextAbilityValue)
  1592.             end
  1593.         end
  1594.     end
  1595.    
  1596.     -- all displays / enemy displays
  1597.     for i=1,#Displays do
  1598.         if Displays[i] ~= nil then
  1599.             if Displays[i][2] then
  1600.                 drawDisplay(i)
  1601.             end
  1602.         end
  1603.     end
  1604.    
  1605.     drawMenu() -- menu
  1606.  
  1607.     Mouse.XBefore=Mouse.X
  1608.     Mouse.YBefore=Mouse.Y
  1609.     if Mouse.clicked then Mouse.clickedFrames = Mouse.clickedFrames + 1
  1610.     else Mouse.clickedFrames = 0 end
  1611.    
  1612.    if client.ispaused() then
  1613.         --gui.DrawFinish()
  1614.         emu.yield()
  1615.     else
  1616.         emu.frameadvance()
  1617.     end
  1618.    
  1619.     frames=frames+1
  1620. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement