honeylisp/wrap.fnl

48 lines
1,019 B
Fennel

(require "lite")
(require "util")
(local imgui (require "imgui"))
(local machine (require "machine"))
(fn love.load []
; (repl.start)
)
(fn love.update [dt]
(imgui.NewFrame))
(fn love.draw []
(when machine.socket
(when (imgui.Button "Stop on keypress")
(machine:stop-at 0xfd1b))
(when (imgui.Button "Upload")
(local prg (reload "test"))
(each [_ block (pairs prg.symbols)]
(pp (machine:write block.addr block.bytes)))
(pp (machine:setreg {:ip (. prg.symbols prg.start-symbol :addr)}))
(pp (machine:continue))))
(imgui.Render))
(fn love.quit []
(imgui.ShutDown))
(fn love.textinput [t]
(imgui.TextInput t))
(fn love.keypressed [key]
(imgui.KeyPressed key))
(fn love.keyreleased [key]
(imgui.KeyReleased key))
(fn love.mousemoved [x y]
(imgui.MouseMoved x y))
(fn love.mousepressed [x y button]
(imgui.MousePressed button))
(fn love.mousereleased [x y button]
(imgui.MouseReleased button))
(fn love.wheelmoved [x y]
(imgui.WheelMoved y))