-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
32 lines (28 loc) · 961 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import("core/rom")
import("core/instruction")
import("core/runtime")
import("CoreLibs/ui")
import("CoreLibs/timer")
import("CoreLibs/graphics")
playdate.ui.crankIndicator:start()
-- newline is ~20 px
-- playdate.graphics.drawText("hi, this is useless right now, come back later :)", 0, 0)
local roms = getROMs()
selectedROM = 1 -- i don't feel like implementing a proper selection system right now
local romdata = loadROM(roms[selectedROM])
print("selectedpath: " .. roms[selectedROM])
function playdate.update()
playdate.graphics.clear()
playdate.timer.updateTimers()
drawStage()
if playdate.isCrankDocked() then
-- TODO: indicate that the game is paused
playdate.ui.crankIndicator:update()
else
clearStage()
result = runNextInstruction(romdata, playdate.file.getSize("roms/" .. roms[selectedROM]))
if not result then
drawStage()
end
end
end