Advertisement
Guest User

Field of View? More like... more like...

a guest
Mar 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.71 KB | None | 0 0
  1. -- V1.87:
  2. -- By Warepire, Spikestuff, Fog, Tremane
  3. -- Slightly Less Shitty Script
  4. -- Prints Zook position, charge shot timer, weapons cooldown timer, invulnerable timer
  5. --        Enemy position (different coordinate system because ... fuck you!?), HP, action timer and active flag, invulnerable timer
  6. --        Active item drop, and next five item drops
  7. -- fixed: Re-positioned the boss data on the GUI
  8. --
  9. -- TODO: Hitboxes
  10. -- Currently no speed value, because there seems to be only 2 speeds: Standing still and moving.
  11. -- If speed is discovered to be more complex, speed value can be added.
  12.  
  13. client.SetGameExtraPadding(12, 58, 12, 12)
  14.  
  15. camera_x = 0
  16. camera_y = 0
  17.  
  18. local_x = 0
  19. local_y = 0
  20.  
  21. -- Level layer positions addresses in IWRAM:
  22. zook_ukn_layer_x = 0x14F0
  23. zook_ukn_layer_y = 0x14F4
  24. zook_fg_layer_x = 0x14F8
  25. zook_fg_layer_y = 0x14FC
  26. zook_lvl_layer_x = 0x1500
  27. zook_lvl_layer_y = 0x1504
  28. zook_bg_layer_x = 0x1508
  29. zook_bg_layer_y = 0x150C
  30.  
  31.  
  32. function UpdateCamera()
  33.     -- using lvl layer as "camera":
  34.     memory.usememorydomain("IWRAM")
  35.     camera_x = memory.read_u32_le(zook_lvl_layer_x)
  36.     camera_y = memory.read_u32_le(zook_lvl_layer_y)
  37. end
  38.  
  39. function PrintZookData()
  40.     -- 0x15E0: Cooldown timer, can only shoot when 0.
  41.     local zook_x_addr = 0x1560
  42.     local zook_y_addr = 0x1564
  43.     local zook_wpn_cooldown_timer_addr = 0x15E0
  44.     local zook_charge_timer_addr = 0x1608
  45.     local zook_invuln_timer_addr = 0x1628
  46. -- These are some odd values, related to movement, goes from 0-31, wraps at 32
  47. --  local zook_subx_addr = 0x1568
  48. --  local zook_suby_addr = 0x156C
  49.     memory.usememorydomain("IWRAM")
  50.     local zook_x = memory.read_u32_le(zook_x_addr)
  51.     local zook_y = memory.read_u32_le(zook_y_addr)
  52.     local zook_wpn_cooldown_timer = memory.read_u32_le(zook_wpn_cooldown_timer_addr)
  53.     local zook_charge_timer = memory.read_u16_le(zook_charge_timer_addr)
  54.     local zook_invuln_timer = memory.read_u32_le(zook_invuln_timer_addr)
  55.  
  56.     -- the charge timer is special
  57.     local zook_charge_timer_base = 60 - zook_charge_timer
  58.     local zook_charge_timer_extra = 80
  59.     if zook_charge_timer_base <= 0 then
  60.         zook_charge_timer_extra = zook_charge_timer_extra + zook_charge_timer_base
  61.         zook_charge_timer_base = 0
  62.     end
  63.     --gui.drawText(local_x+10, local_y+30, string.format("X=%d,Y=%d\nCharge Shot=%d,Extra=%d\nBuster Cooldown=%d\nInvulnerable timer=%d", zook_x, zook_y, zook_charge_timer_base, zook_charge_timer_extra, zook_wpn_cooldown_timer, zook_invuln_timer), "red", null, 10)
  64.    
  65.    
  66.     local x, y, dy = 8, 56, 14
  67.     local function print_info(format, ...)
  68.         gui.text(x, y, string.format(format, ...),"aqua")
  69.         y = y + dy
  70.     end
  71.  
  72.     print_info("X=%d, Y=%d", zook_x, zook_y)
  73.     print_info("Charge Shot=%d, Extra=%d", zook_charge_timer_base, zook_charge_timer_extra)
  74.     print_info("Buster Cooldown=%d", zook_wpn_cooldown_timer)
  75.     print_info("Invulnerable timer=%d", zook_invuln_timer)
  76. end
  77.  
  78. initial_boss_bar_needed_hits = 0
  79.  
  80. function PrintBossData()
  81.     memory.usememorydomain("IWRAM")
  82.     local boss_can_be_damaged = memory.read_u32_le(0x16F4)
  83.     local boss_invuln_timer = memory.read_u32_le(0x16F8)
  84.     local boss_hp_bar_count = memory.read_u32_le(0x1708)
  85.     local boss_hp_bar_needed_hits = memory.read_u32_le(0x170C)
  86.  
  87.     if initial_boss_bar_needed_hits == 0 then
  88.         initial_boss_bar_needed_hits = boss_hp_bar_needed_hits
  89.     end
  90.  
  91.     local boss_damage_flag = " "
  92.     if boss_can_be_damaged == 6 then -- so far known: 6 = yes, 7 = no
  93.         boss_damage_flag = "*"
  94.     end
  95.  
  96.     if boss_hp_bar_count == 0 then
  97.         initial_boss_bar_needed_hits = 0
  98.         return
  99.     end
  100.  
  101.     local boss_hp = ((boss_hp_bar_count - 1) * initial_boss_bar_needed_hits) + boss_hp_bar_needed_hits
  102.  
  103.     --gui.drawText(10, 75, string.format("Boss HP=%d %s\nInvulnerable timer=%d", boss_hp, boss_damage_flag, boss_invuln_timer), "red", null, 10)
  104.    
  105.     local x, y, dy = 8, 112, 14
  106.     local function print_info(format, ...)
  107.         gui.text(x, y, string.format(format, ...),"red")
  108.         y = y + dy
  109.     end
  110.  
  111.     print_info("Boss HP=%d %s", boss_hp, boss_damage_flag)
  112.     print_info("Invulnerable timer=%d", boss_invuln_timer)
  113. end
  114.  
  115. function PrintItemDrop()
  116.     local active_frame_count = memory.read_u32_le(0x17A0, "IWRAM")
  117.     local item_drop_table = memory.readbyterange(0x3E8880, 132, "ROM") -- 33 entries of four bytes each
  118.     local active_item_drop = item_drop_table[bit.band(active_frame_count, 0x1F) * 4] -- multiplied by four to read the four byte drop table
  119.     local active_item_drop_strings = {"Nothing", "Small Health", "Medium Health", "Large Health", "Small Energy", "Medium Energy", "Large Energy", "Extra Life"}
  120.    
  121.     --gui.drawText(10, 100, string.format("Active Item Drop:\n%s", active_item_drop_strings[active_item_drop + 1]), "red", null, 10)
  122.    
  123.     local x, y, dy = 320, 14, 14
  124.     local function print_info(format, ...)
  125.         gui.text(x, y, string.format(format, ...),"lightgreen")
  126.         y = y + dy
  127.     end
  128.    
  129.     print_info("AID: %s", active_item_drop_strings[active_item_drop + 1]) --Active Item Drop
  130.     print_info("Next Five Drops:", 0)
  131.     for i=1,5 do
  132.         local next_item_drop = item_drop_table[bit.band(active_frame_count + i, 0x1F) * 4] -- multiplied by four to read the four byte drop table
  133.         print_info("%s", active_item_drop_strings[next_item_drop + 1])
  134.     end
  135. end
  136.  
  137. -- FOV Work
  138.  
  139. -- -----------------------------------
  140. -- Globals
  141. -- -----------------------------------
  142.  
  143. local current_entity_struct_data
  144.  
  145. -- ---------------------------------
  146. -- Constants
  147. -- ---------------------------------
  148.  
  149. local max_entries = 60
  150.  
  151. local enemies_index_begin = 30 -- enemies start at position 30, first 6 reserved for Zook?
  152. local entity_struct_addr = 0x1DE4
  153.  
  154. local entity_struct_size = 0x74
  155.  
  156. local entity_x_offset = 0x0
  157. local entity_y_offset = 0x4
  158. local entity_direction_offset = 0xC
  159. local entity_state_offset = 0x14
  160. local entity_action_timer_offset = 0x16
  161.  
  162. -- maps enemy type(?) to box color, if a color sucks, change it!
  163. -- when a new enemy is identified to map to one of these boxes, update the enemy name in the list!
  164. local color_map = {}
  165. color_map[0x0F] = "AliceBlue"       -- red tank (intro)
  166. color_map[0x17] = "AntiqueWhite"    -- blue tank (intro)
  167. color_map[0x1E] = "Aqua"        -- cone eneny (intro)
  168. color_map[0x1B] = "Aquamarine"      -- speedy spikey thing (intro)
  169. color_map[0x25] = "Azure"       -- no clue
  170. color_map[0x4B] = "Beige"       -- no clue
  171. color_map[0x56] = "Bisque"      -- no clue
  172. color_map[0x58] = "BlanchedAlmond"  -- no clue
  173. color_map[0x5B] = "Blue"        -- no clue
  174. color_map[0x5E] = "BlueViolet"      -- no clue
  175. color_map[0x62] = "Brown"       -- no clue
  176. color_map[0x71] = "BurlyWood"       -- no clue
  177. color_map[0x72] = "CadetBlue"       -- no clue
  178. color_map[0x74] = "Chartreuse"      -- no clue
  179. color_map[0x87] = "Chocolate"       -- no clue
  180. color_map[0x8A] = "Coral"       -- no clue
  181. color_map[0x8B] = "CornflowerBlue"  -- no clue
  182. color_map[0x8C] = "Cornsilk"        -- no clue
  183. color_map[0x8D] = "Crimson"     -- no clue
  184. color_map[0xA2] = "Cyan"        -- no clue
  185. color_map[0xA4] = "DarkBlue"        -- no clue
  186. color_map[0xAB] = "DarkCyan"        -- no clue
  187. color_map[0xAF] = "DarkGoldenrod"   -- no clue
  188. color_map[0xBA] = "DarkGray"        -- no clue ... like really... no clue
  189. color_map[0xC0] = "DarkGreen"       -- no clue
  190. color_map[0xC1] = "DarkKhaki"       -- no clue
  191. color_map[0xC2] = "DarkMagenta"     -- no clue
  192. color_map[0xC3] = "DarkOliveGreen"  -- no clue
  193. color_map[0xC8] = "DarkOrange"      -- no clue ... like really... no clue
  194. color_map[0xD0] = "DarkOrchid"      -- no clue
  195. color_map[0xD5] = "DarkViolet"      -- no clue
  196. color_map[0xDE] = "DarkSalmon"      -- no clue
  197. color_map[0xDF] = "DarkSeaGreen"    -- no clue
  198. color_map[0xE2] = "DarkSlateBlue"   -- no clue
  199. color_map[0xE3] = "DarkSlateGray"   -- no clue
  200. color_map[0xE6] = "DarkTurquoise"   -- no clue
  201.  
  202. -- ----------------------------------
  203. -- Utility functions
  204. -- ----------------------------------
  205.  
  206. local function GetWordFromMemTable(table, offset)
  207.     local low_byte = table[offset]
  208.     local high_byte = table[offset+1]
  209.     local word = low_byte + (high_byte * 0x100)
  210.     return word
  211. end
  212.  
  213. local function GetDwordFromMemTable(table, offset)
  214.     local low_word = GetWordFromMemTable(table, offset)
  215.     local high_word = GetWordFromMemTable(table, offset + 2)
  216.     local dword = low_word + (high_word * 0x10000)
  217.     return dword
  218. end
  219.  
  220.  -- exactly how the game computes it, every time. I know IDA says differently sometimes in the pseudocode view.
  221. function GetOffsetFromIndex(index)
  222.     return 4 * (29 * index)
  223. end
  224.  
  225. -- args: color_id, left + 12, right + 12, top + 58, bottom + 58
  226. function DrawFieldOfViewBox(args)
  227.     assert(args.color_id, "BUG! color_id == nil")
  228.     local x_left = 16 + (args.left or 59) + 12
  229.     local x_right = 16 + (args.right or (239 - 16)) + 12
  230.     local y_top = (args.top or 0) + 58
  231.     local y_bottom = (args.bottom or 159) + 58
  232.     gui.drawBox(x_left, y_top, x_right, y_bottom, color_map[args.color_id])
  233. end
  234.  
  235. -- -----------------------------------
  236. -- Draw logic
  237. -- -----------------------------------
  238.  
  239. -- Amazingly enough all the field of view tests are conducted versus the position of Zooks left foot big toe.
  240. -- Note: Some boxes may be inversed, if they are, swap the left/right values!
  241. function FieldOfViewBox()
  242.     -- Function pointers whose detection logic are implemented below, start at 0x1818 in IWRAM and seem to go on for about 256 entries
  243.     local entity_state = GetWordFromMemTable(current_entity_struct_data, entity_state_offset)
  244.     local x = GetDwordFromMemTable(current_entity_struct_data, entity_x_offset)
  245.     local y = GetDwordFromMemTable(current_entity_struct_data, entity_y_offset)
  246.     if entity_state == 0xF or entity_state == 0x17 or entity_state == 0x1E then -- IDA functions: sub_8019208, sub_8018BA8, sub_80185C0
  247.         DrawFieldOfViewBox{color_id=entity_state, left=x-48, right=x+48}
  248.     elseif entity_state == 0x1B then -- IDA functions: sub_8018884
  249.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-96, right=x+48}
  250.     elseif entity_state == 0x25 then -- IDA functions: sub_80173CC
  251.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-56, right=x+64}
  252.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-10, right=x+10, top=y+10, bottom=x-10} -- some sort of inner attack box...?
  253.     elseif entity_state == 0x4B then -- IDA functions: sub_801431C
  254.         DrawFieldOfViewBox{color_id=entity_state, left=12+48, right=144}
  255.     elseif entity_state == 0x56 then -- IDA functions: sub_8013374
  256.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-64, right=x+32}
  257.     elseif entity_state == 0x58 then -- IDA functions: sub_80130D8
  258.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-80, right=x+32}
  259.     elseif entity_state == 0x5B or entity_state == 0x62 then -- IDA functions: sub_8012FE8, sub_8012AAC
  260.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-80, right=x+80}
  261.     elseif entity_state == 0x5E or entity_state == 0xC3 then -- IDA functions: sub_8012C80, sub_8009FD4
  262.         local dir = GetWordFromMemTable(current_entity_struct_data, entity_direction_offset)
  263.         local left = 0
  264.         if dir == 1 then
  265.             left = 32
  266.         end
  267.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-left, right=x+112}
  268.     elseif entity_state == 0x71 or entity_state == 0x72 then -- IDA functions: sub_8011708 (0x8011924 is a "subfunction" of that)
  269.         local action_timer = GetWordFromMemTable(current_entity_struct_data, entity_action_timer_offset)
  270.         if entity_state == 0x71 and action_timer == 1 then
  271.             DrawFieldOfViewBox{color_id=entity_state, left=12+x-112, right=x+96}
  272.         else
  273.             DrawFieldOfViewBox{color_id=entity_state, left=12+x-80, right=x+64}
  274.         end
  275.     elseif entity_state == 0x74 then -- IDA functions: sub_8011278
  276.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-48, right=x+48}
  277.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-20, right=x-48}
  278.     elseif entity_state == 0x87 then -- IDA functions: sub_800F920
  279.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-88, right=x+48}
  280.     elseif entity_state == 0x8A then -- IDA functions: sub_800F4D4
  281.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-80, right=x+48}
  282.     elseif entity_state == 0x8B then -- IDA functions: sub_800F394
  283.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-24, right=x+8}
  284.     elseif entity_state == 0x8C then -- IDA functions: sub_800F298
  285.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-32, right=x+48}
  286.     elseif entity_state == 0x8D or entity_state == 0xAF then -- IDA functions: sub_800F130, sub_800BAE8
  287.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-64, right=x+48}
  288.     elseif entity_state == 0xA2 then -- IDA functions: sub_800D514
  289.         DrawFieldOfViewBox{color_id=entity_state, top=y-16, bottom=y-32}
  290.     elseif entity_state == 0xA4 then -- IDA functions: sub_800D234
  291.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-96, right=x+64, top=y+96, bottom=y-64}
  292.     elseif entity_state == 0xAB then -- IDA functions: sub_800C114
  293.         DrawFieldOfViewBox{color_id=entity_state, top=y-16, bottom=y-40}
  294.     elseif entity_state == 0xBA then -- IDA functions: sub_8017F18
  295.         print("ALERT: state 0xBA found!") -- What does this entity do? It does some math if Zook is in certain parts of the screen.
  296.         x = memory.read_s32_le(entity_struct_addr + GetOffsetFromIndex(1) + entity_x_offset)
  297.         DrawFieldOfViewBox{color_id=entity_state, left=12+x+90, right=x+200}
  298.         DrawFieldOfViewBox{color_id=entity_state, left=12+x+40, right=x+80}
  299.     elseif entity_state == 0xC0 then -- IDA functions: sub_800A380
  300.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-16, right=x+16}
  301.     elseif entity_state == 0xC1 or entity_state == 0xD0 then -- IDA functions: sub_800A27C, sub_8008A18
  302.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-32, right=x+16}
  303.     elseif entity_state == 0xC2 then -- IDA functions: sub_800A128
  304.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-72, right=x+48}
  305.     elseif entity_state == 0xC8 then -- IDA functions: sub_8008D28
  306.         print("ALERT: state 0xC8 found!") -- What does this entity do? It does some math depending on which zone of the screen Zook's in.
  307.         y = memory.read_s32_le(entity_struct_addr + GetOffsetFromIndex(1) + entity_y_offset)
  308.         DrawFieldOfViewBox{color_id=entity_state, bottom=40}
  309.         DrawFieldOfViewBox{color_id=entity_state, top=40, bottom=72}
  310.         DrawFieldOfViewBox{color_id=entity_state, top=72}
  311.     elseif entity_state == 0xD5 then -- IDA functions: sub_8008654
  312.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-80, right=x+32}
  313.     elseif entity_state == 0xDE then -- IDA functions: sub_800728C
  314.         print("ALERT: state 0xDE found!")
  315.         DrawFieldOfViewBox{color_id=entity_state, bottom=y-32}
  316.     elseif entity_state == 0xDF then -- IDA functions: sub_800703C
  317.         -- What does this entity do? It does some math if Zook is in certain parts of the screen.
  318.         DrawFieldOfViewBox{color_id=entity_state, left=12+48, right=96}
  319.         DrawFieldOfViewBox{color_id=entity_state, left=12+96, right=144}
  320.     elseif entity_state == 0xE2 then -- IDA functions: sub_8006C6C
  321.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-58, right=x+88}
  322.     elseif entity_state == 0xE3 then -- IDA functions: sub_8006A78
  323.         DrawFieldOfViewBox{color_id=entity_state, left=12+x-64, right=192}
  324.         DrawFieldOfViewBox{color_id=entity_state, left=12+8, right=x-16}
  325.         DrawFieldOfViewBox{color_id=entity_state, top=y+8, bottom=y-24}
  326.     elseif entity_state == 0xE6 then -- IDA functions: sub_8006248
  327.         DrawFieldOfViewBox{color_id=entity_state, top=72, bottom=40}
  328.     end
  329.     -- stopped at address 0x1B38
  330. end
  331.  
  332. function DrawStuff()
  333.     local zook_x = memory.read_s32_le(entity_struct_addr + GetOffsetFromIndex(1) + entity_x_offset)
  334.     gui.drawLine(zook_x + 12 + 16, 58, zook_x + 12 + 16, 159 + 58, "orange") -- Test pixel if zook is in field of view. Since height is not used, ignore it and draw a line.
  335.     for i=enemies_index_begin,max_entries do
  336.         current_entity_struct_data = memory.readbyterange(entity_struct_addr + GetOffsetFromIndex(i), entity_struct_size, "IWRAM")
  337.         FieldOfViewBox()
  338.     end
  339. end
  340.    
  341. function PrintEnemyData()
  342.     local enemy_data_size = 0x74
  343.     local enemy_data_count = 40 -- dummy assumption
  344.     local enemy_data_start = 0x2B7C
  345.     local enemy_x_offset = 0x0
  346.     local enemy_y_offset = 0x4
  347.     local enemy_active_flag_offset = 0x16
  348.     local enemy_action_timer_offset = 0x18
  349.     local enemy_hp_offset = 0x2C
  350.     local enemy_invuln_timer_offset = 0x58
  351.     memory.usememorydomain("IWRAM")
  352.     for i=0,enemy_data_count do
  353.         local enemy_x = memory.read_s32_le(enemy_data_start + (i * enemy_data_size) + enemy_x_offset)
  354.         local enemy_y = memory.read_s32_le(enemy_data_start + (i * enemy_data_size) + enemy_y_offset)
  355.         local enemy_active_flag = memory.read_u16_le(enemy_data_start + (i * enemy_data_size) + enemy_active_flag_offset)
  356.         local enemy_action_timer = memory.read_u16_le(enemy_data_start + (i * enemy_data_size) + enemy_action_timer_offset)
  357.         local enemy_hp = memory.read_s16_le(enemy_data_start + (i * enemy_data_size) + enemy_hp_offset)
  358.         local enemy_invuln_timer = memory.read_u32_le(enemy_data_start + (i * enemy_data_size) + enemy_invuln_timer_offset)
  359.         local enemy_state = memory.read_u16_le(entity_struct_addr + GetOffsetFromIndex(i) + entity_state_offset)
  360.         if enemy_x ~= 0 and enemy_y ~= 0 and enemy_hp ~= 0 and enemy_hp ~= -1 then -- remove to print data for bullets
  361.             active = " "
  362.             if enemy_active_flag ~= 0 then active = "*" end
  363.             --gui.drawText(enemy_x + 10, enemy_y, string.format("X=%d,Y=%d\nHP=%d\n%sA.T.=%d\nI.T=%d", enemy_x, enemy_y, enemy_hp, active, enemy_action_timer, enemy_invuln_timer), "red", null, 10)
  364.  
  365.        
  366.             gui.pixelText(enemy_x + 16, enemy_y, string.format("addr=%X\nX=%d,Y=%d\nS=0x%02X", entity_struct_addr + GetOffsetFromIndex(i), enemy_x, enemy_y, enemy_state), "blue", null)
  367.    
  368.             local x, y, dy = enemy_x+10, enemy_y+40, 7
  369.             local function print_info(format, ...)
  370.                 gui.pixelText(x + 0, y, string.format(format, ...),"red")
  371.                 y = y + dy
  372.             end
  373.    
  374.         print_info("X=%d, Y=%d", enemy_x, enemy_y)
  375.         print_info("HP=%d", enemy_hp)
  376.         print_info("%sA.T.=%d", active, enemy_action_timer)
  377.         print_info("I.T=%d", enemy_invuln_timer)
  378.         end
  379.     end
  380. end
  381.  
  382.  
  383. -- debug shit
  384. function PrintEnemyData2()
  385.     memory.usememorydomain("IWRAM")
  386.     for i=30,max_entries do
  387.         local enemy_x = memory.read_s32_le(entity_struct_addr + GetOffsetFromIndex(i) + entity_x_offset)
  388.         local enemy_y = memory.read_s32_le(entity_struct_addr + GetOffsetFromIndex(i) + entity_y_offset)
  389.         local enemy_state = memory.read_u16_le(entity_struct_addr + GetOffsetFromIndex(i) + entity_state_offset)
  390.         if enemy_x ~= 0 and enemy_y ~= 0 then -- remove to print data for bullets
  391.             gui.pixelText(enemy_x -80, enemy_y, string.format("addr=%X\nX=%d,Y=%d\nS=0x%02X", entity_struct_addr + GetOffsetFromIndex(i), enemy_x, enemy_y, enemy_state), "pink")
  392.         end
  393.     end
  394. end
  395.  
  396. ----------------------------------------------------------
  397. -- Main:
  398. ----------------------------------------------------------
  399.  
  400. function main()
  401.  
  402.     while true do
  403.         UpdateCamera()
  404.         PrintZookData()
  405.         PrintEnemyData()
  406.         -- PrintEnemyData2() -- "debug shit"
  407.         PrintBossData()
  408.         PrintItemDrop()
  409.         DrawStuff()
  410.         emu.frameadvance()
  411.     end
  412. end
  413.  
  414. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement