Advertisement
Dooty

Untitled

Aug 27th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. --Donkey Kong Country 2 BizHawk TAS script
  2. while true do
  3.  
  4. local scount = 0
  5. local cx = memory.read_s16_le(0x0017BA)
  6. local cy = memory.read_s16_le(0x0017C0)
  7. local x = memory.read_u16_le(0x000A2A)
  8. local y = memory.read_u16_le(0x000A2C)
  9. local spx = memory.read_s16_le(0x000A30)
  10. local spy1 = memory.read_s16_le(0x000E06)
  11. local spy2 = memory.read_s16_le(0x000E64)
  12. local saru = memory.read_u8(0x0008A4)
  13. local hold = memory.read_u16_le(0x000D7A)
  14. local rope = memory.read_u8(0x000AEB)
  15. xm = client.screenwidth() / 256
  16. ym = client.screenheight() / 224
  17.  
  18. if hold == 0 then
  19. disphold = 0
  20. else
  21. disphold = 1
  22. end
  23.  
  24. for id = 0, 21 do
  25. local stat = memory.read_u16_le(0x000E9E+id*94)
  26. local sx = memory.read_u16_le(0x000EA4+id*94)
  27. local sy = memory.read_u16_le(0x000EA8+id*94)
  28. local sspx = memory.read_s16_le(0x000EBE+id*94)
  29. local sspy = memory.read_s16_le(0x000EC2+id*94)
  30. local num = memory.read_u16_le(0x000ED4+id*94)
  31.  
  32. if id < 7 then
  33. if stat ~= 0 then
  34. color = 0x00FF00FF
  35. else
  36. color = 0xFF0000FF
  37. end
  38. gui.text(2, 80+id*12, string.format("%d(%x, %d, %d)", id, num, sx, sy))
  39. end
  40.  
  41. color = 0xFF0000FF
  42. if stat ~= 0 then
  43. gui.text(sx*xm-cx*ym-4, sy*xm-cy*ym-(id%4)*8, string.format("%d(%x)", id, num))
  44. scount = scount + 1
  45. end
  46. end
  47.  
  48. if saru == 0 then
  49. spy = spy1
  50. else
  51. spy = spy2
  52. end
  53.  
  54. gui.text(2, 178, string.format("speed: %d, %d", spx, spy))
  55. gui.text(2, 190, string.format("position: %d, %d", x, y))
  56. if disphold == 1 then
  57. gui.text(2, 166, string.format("Holding ID: %d", (hold-3742)/94))
  58. end
  59. gui.text(2, 68, string.format("SPR:%02d", scount))
  60.  
  61. emu.frameadvance()
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement