55 lines
1.3 KiB
Fennel
55 lines
1.3 KiB
Fennel
(local util (require :lib.util))
|
|
(local {: lo : hi : readjson} util)
|
|
(local tile (util.reload :game.tiles))
|
|
(local {: prg : vm : org} (util.reload :game.defs))
|
|
|
|
(local disk (util.reload :game.disk))
|
|
|
|
(util.reload :game.gfx)
|
|
(util.reload :game.footer)
|
|
(util.reload :game.map)
|
|
(util.reload :game.entity)
|
|
(util.reload :game.player)
|
|
(util.reload :game.boop)
|
|
|
|
(tile.appendtiles org.code)
|
|
(org.code:append [:align 0x100] :font)
|
|
(tile.appendgfx org.code (tile.loadgfx tile.fn-font))
|
|
(tile.append-portraitwords vm)
|
|
|
|
(vm:var :tick-count)
|
|
(vm:word :handle-key :tick :read-key :player-key :hide-footer)
|
|
(vm:word :tick :map-specific-tick :tick-count :get 1 :+ :tick-count :set :player-redraw :rnd :drop)
|
|
|
|
(vm:var :next-level 0)
|
|
(vm:word :load-next-level :next-level :get :dup (vm:if [:load-level 0 :next-level :set] [:drop]))
|
|
(vm:word :load-level ; level-ptr --
|
|
:lit :map-ptr :set :reload-level)
|
|
|
|
(vm:word :reload-level
|
|
:map-player-yx :player-yx :set
|
|
:map-specific-load
|
|
:full-redraw)
|
|
|
|
(util.reload :game.content)
|
|
|
|
(vm.code:append :main
|
|
[:jsr :reset]
|
|
[:jsr :interpret]
|
|
[:vm :hires
|
|
:lit :map1 :load-level
|
|
(vm:forever
|
|
(vm:hotswap-sync :lit :map1 :load-level)
|
|
:interactive-eval-checkpoint
|
|
:handle-key
|
|
)
|
|
:quit])
|
|
|
|
(disk.append-boot-loader prg)
|
|
(print "assembling")
|
|
(prg:assemble)
|
|
(print "assembled")
|
|
(disk.write prg)
|
|
|
|
prg
|