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!")
|
console:error("Unknown game!")
|
||||||
else
|
else
|
||||||
console:log("Found game: " .. game.name)
|
console:log("Found game: " .. game.name)
|
||||||
|
if not partyBuffer then
|
||||||
|
partyBuffer = console:createBuffer("Party")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function updateBuffer()
|
||||||
|
if not game or not partyBuffer then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
printPartyStatus(game, partyBuffer)
|
||||||
|
end
|
||||||
|
|
||||||
callbacks:add("start", detectGame)
|
callbacks:add("start", detectGame)
|
||||||
|
callbacks:add("frame", updateBuffer)
|
||||||
if emu then
|
if emu then
|
||||||
detectGame()
|
detectGame()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue