Advertisement
LilPinkus

lag.lua

Jul 27th, 2018
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.23 KB | None | 0 0
  1. --[[
  2.  
  3. =========
  4. RUPEE LAG
  5. =========
  6.  
  7. Having 09X rupees loses on lag vs having 10X rupees.
  8.  
  9. If you add the hundreds and the tens together, you get the amount of extra work needed to display your rupees.. Example: 115 would be 1 + 1 = 2, and 092 would be 0 + 9 = 9.
  10.  
  11. To avoid getting <100 after paying for Tempered Sword, you'd want 114 enter aga tower, or grab rupees somewhere else.
  12. However, having 114 entering aga tower might cause slight lag until you get tempered (see table below).
  13.  
  14. Only guaranteed rupee grab post-tempered is 1 rupee before entering Mire basement.
  15.  
  16.  
  17. Time lost vs Godtas
  18. -------------------
  19.  
  20. Godtas had 100+ rupees from post-tempered. Tested against having 099.
  21.  
  22. From Tempered to Triforce: 51f
  23.  
  24. Note that Jadin picked up a red rupee in Pokey 1, giving him 121 rupees, so the difference could be even higher.
  25.  
  26.  
  27. Rupee routes & difference in # of loops:
  28. ----------------------------------------
  29.  
  30. /---------------------------------------------------\
  31. | tree | aga | pod | 300 | temp | 300 | flip | mire |
  32. |------+-----+-----+-----+------+-----+------+------|
  33. |  104 | 110 | 000 | 300 | 290  | 590 |  090 | 091  |
  34. |  114 | 120 | 010 | 310 | 300  | 600 |  100 | 101  |
  35. |------+-----+-----+-----+------+-----+------+------|
  36. |   -1 |  -1 |  -1 |  -1 |   8  |   8 |    8 |   8  |
  37. \---------------------------------------------------/
  38.  
  39.  
  40.  
  41. =========
  42. SHIELD LAG
  43. ==========
  44.  
  45. Not having shield saves time due to not having to draw it.
  46.  
  47. One place to get it removed would be the Pikit outside of Ice Palace.
  48. Costs about 2s for first attempt, 4.5s for two attempts.
  49.  
  50. There's 2 Pikit's around Swamp Palace too..
  51.  
  52.  
  53. Time saved vs Godtas
  54. --------------------
  55.  
  56. From Outside Ice Palace (after killing Khold) to Triforce: 139f
  57.  
  58. About 105f of those were in the Swamp segment alone.. Not sure why.
  59.  
  60.  
  61.  
  62. =========
  63. HEART LAG
  64. =========
  65.  
  66. Having less hearts saves time due to having less things to draw.
  67.  
  68. This attempts to compare normal Godtas with Godtas that picked up sanctuary heart, to see how much
  69. you lose to lag by picking it up.
  70.  
  71.  
  72. Time lost vs Godtas
  73. -------------------
  74. --
  75. Godtas does not grab sanctuary. Tested against having +1 hp and hp container for all frames.
  76.  
  77. From Sanctuary to Triforce: 65f
  78.  
  79. --]]
  80.  
  81. local SAVE = savestate.create()
  82.  
  83. local SUM_NORMAL = 0
  84. local SUM_TEST = 0
  85.  
  86. local function draw()
  87.     gui.text(10, 40, tostring(SUM_NORMAL) .. " vs " .. tostring(SUM_TEST))
  88.     gui.text(10, 52, tostring(SUM_TEST - SUM_NORMAL))
  89. end
  90.  
  91. emu.registerbefore(draw)
  92.  
  93. while true do
  94.     local lag_before = emu.lagcount()
  95.     savestate.save(SAVE)
  96.  
  97.     -- Frameadvance TEST
  98.  
  99.     -- RUPEE
  100.     -- memory.writeword(0x7EF360, 99)
  101.     -- memory.writeword(0x7EF362, 99)
  102.  
  103.     -- SHIELD
  104.     -- memory.writebyte(0x7EF35A, 0)
  105.  
  106.     -- HEART
  107.     memory.writebyte(0x7EF36C, memory.readbyteunsigned(0x7EF36C) + 8)
  108.     memory.writebyte(0x7EF36D, memory.readbyteunsigned(0x7EF36D) + 8)
  109.  
  110.     snes9x.frameadvance()
  111.     snes9x.frameadvance()
  112.     snes9x.frameadvance()
  113.  
  114.     SUM_TEST = SUM_TEST + (emu.lagcount() - lag_before)
  115.  
  116.     -- Frameadvance NORMAL
  117.     savestate.load(SAVE)
  118.     snes9x.frameadvance()
  119.     snes9x.frameadvance()
  120.     snes9x.frameadvance()
  121.  
  122.     SUM_NORMAL = SUM_NORMAL + (emu.lagcount() - lag_before)
  123. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement