Advertisement
Guest User

Super Metroid No Cutscenes Lua

a guest
May 8th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. --[[
  2. start this script at the same time as you playback the movie and dump the movie.
  3. when finished, be sure to hit "stop" in the lua script window to ensure that the created file gets flushed
  4.  
  5. you'll have an "skip.avs" that will contain a set of Trim() commands that will create a cutsceneless encode
  6. ]]
  7.  
  8. local pigf = -1
  9. local skipping = true
  10. local startframe = 0
  11.  
  12.  
  13. local outfile = io.open ("skip.avs", "w")
  14.  
  15. local firstsegment = true
  16.  
  17. -- remember to hit "stop" to ensure that the io file gets cleaned up correctly!
  18.  
  19. while true do
  20.    local istop = memory.readbyte(0x000009)
  21.    local dstop = memory.readbyte(0x0005F5)
  22.    local estop = memory.readbyte(0x000E18)
  23.   if istop+dstop+estop == 0 or istop+dstop+estop == 0x6F then -- display this frame
  24.     if skipping then -- end skipping, so record start of new unskipped segment
  25.       startframe = emu.framecount()
  26.       skipping = false
  27.     end
  28.   else -- skip this frame
  29.     if not skipping then -- start skipping, so record finish of last unskipped segment
  30.       if emu.framecount () > 1 then -- avoid 1 frame edge case that causes avs problems
  31.         if firstsegment then
  32.           outfile:write (string.format ("c0 = last\n       c0.Trim (%i, %i)\n", startframe, emu.framecount () - 1))      
  33.           firstsegment = false
  34.         else
  35.           outfile:write (string.format ("last + c0.Trim (%i, %i)\n", startframe, emu.framecount () - 1))
  36.         end
  37.         skipping = true
  38.       end
  39.     end
  40.   end
  41.   emu.frameadvance()
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement