I made a Lua script for pause buffering in Majora's Mask. I'm not completely confident about the accuracy of it though. It might be possible to pause later than when this script does (meaning, maybe more movement could be squeezed in between the pauses when skipping, for example, the first mask salesman cutscene). It simply uses a RAM value to tell when the game is no longer paused. So maybe it shouldn't be used for serious projects, but I think it could be useful when playing in real-time at least.
Note that the script assumes that you have paused the game before executing it, so if you run it when the game is not paused, it'll simply stop executing at the pause menu (all you need to do is execute it again once you're in the menu though).
Also note that the RAM address used is for the Japanese (V1.0) version of the game. Let me know if you want the RAM address for a different version (I don't have them all at hand).
Put this inside the main() function suggested in
the EmuLua documentation. I made the code pause buffer via the L button since it has no real function in the game, change it if you want...
local LHist = {} -- Input history for L button. We will use this to make sure the button has been let go before any code executes (since a normal button tap will most definitely span more than 1 frame in real-time)
while true do
table.insert(LHist,joypad.get(1)["L"])
LLastKey = table.maxn(LHist)
if LHist[LLastKey-1] == true and LHist[LLastKey] == false then
c = 0
while true do
GameActive = memory.readbyte(0x001F6C65)
if c == 0 and GameActive == 0 then
joypad.set(1,{["start"]=true})
elseif GameActive == 1 then
joypad.set(1,{["start"]=true})
break
end
c = c+1
emu.frameadvance()
end
end
emu.frameadvance()
end