mirror of https://github.com/mgba-emu/mgba.git
Res: Auto-register frame callback
This commit is contained in:
parent
d21da6df2d
commit
7fe043146d
|
@ -499,10 +499,21 @@ function detectGame()
|
|||
console:error("Unknown game!")
|
||||
else
|
||||
console:log("Found game: " .. game.name)
|
||||
if not partyBuffer then
|
||||
partyBuffer = console:createBuffer("Party")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function updateBuffer()
|
||||
if not game or not partyBuffer then
|
||||
return
|
||||
end
|
||||
printPartyStatus(game, partyBuffer)
|
||||
end
|
||||
|
||||
callbacks:add("start", detectGame)
|
||||
callbacks:add("frame", updateBuffer)
|
||||
if emu then
|
||||
detectGame()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue