diff --git a/NeutTower.dsk b/NeutTower.dsk index 127f963..d3e7c88 100644 Binary files a/NeutTower.dsk and b/NeutTower.dsk differ diff --git a/game/boop.fnl b/game/boop.fnl index eeffccc..d7ab3da 100644 --- a/game/boop.fnl +++ b/game/boop.fnl @@ -75,5 +75,11 @@ (vm:word :snd-libb (notes [:d#1 :g#1 :f#1 :g1] 0x08 0x7f)) (vm:word :snd-garbage (notes [:a5 :a3 :a2] 0x04 0xa0)) (vm:word :snd-teleport (notes [:e4 :d#4 :d4 :g#4] 0x1a 0x50)) -; ((. (require :game.boop) :notes) ) + +(vm.code:append :keypad-boops) +(each [_ n (ipairs [:c4 :c#4 :d4 :d#4 :e4 :f4 :f#4 :g4 :g#4 :a5])] + (vm.code:append [:dw (- (note-wavelength n) 0xd0)])) +(vm:word :snd-keypad ; digit -- + :dup :+ :lit :keypad-boops :+ :get 0x10d0 :swap :bliptone) + {: note : notes} diff --git a/game/cheat.fnl b/game/cheat.fnl new file mode 100644 index 0000000..c83e232 --- /dev/null +++ b/game/cheat.fnl @@ -0,0 +1,23 @@ +(local {: vm} (require :game.defs)) + +(fn defcheat [name ...] + (local cheatdata (.. name "-data")) + (vm.code:append cheatdata [:db 0] [:bytes name] [:db 0]) + (vm:word name :lit cheatdata :cheatguard ...)) + +(vm:word :pcheatnext ; cheatdata -- pchar + :dup :bget :inc :+) +(vm:word :reset-cheat ; cheatdata -- + 0 :swap :bset) +(vm:word :cheatguard ; char cheatdata -- [optional rdrop] + :dup :pcheatnext :bget :=] [:dup (string.byte "Z") :<=]] + [:NTSPISPOPD] + [:drop])) diff --git a/game/entity.fnl b/game/entity.fnl index 37e8822..8df6d49 100644 --- a/game/entity.fnl +++ b/game/entity.fnl @@ -177,7 +177,7 @@ (vm:while [:read-key :dup 0x3a :< :over 0x30 :>= :& :not] :drop) 0x30 :-) (vm:word :keypad-digit ; pscreen -- n - :read-digit :swap :over :draw-digit) + :read-digit :swap :over :draw-digit :dup :snd-keypad) (vm:word :next-digit ; pscreen n -- pscreen n :shl4 :over :keypad-digit :+ :swap 1 :+ :swap) (vm:word :draw-single-keypad-hash ; pscreen -- pscreen diff --git a/game/init.fnl b/game/init.fnl index ab22a9f..bd55403 100644 --- a/game/init.fnl +++ b/game/init.fnl @@ -11,6 +11,7 @@ (util.reload :game.entity) (util.reload :game.player) (util.reload :game.boop) +(util.reload :game.cheat) (tile.appendtiles org.code) (org.code:append [:align 0x100] :font) @@ -26,7 +27,7 @@ (util.reload :game.bosskey) (vm:var :tick-count) -(vm:word :handle-key :tick :read-key :player-key :hide-footer) +(vm:word :handle-key :tick :read-key :dup :cheat-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) diff --git a/game/player.fnl b/game/player.fnl index 9a7c770..9189b85 100644 --- a/game/player.fnl +++ b/game/player.fnl @@ -67,6 +67,10 @@ (vm:word :set-player-dir ; dir -- :is-jaye? (vm:if [:jaye-dir :set] [:drop])) +(vm:var :noclip) +(vm:word :move-if-clear ; yx -- f + :noclip :get (vm:if [:drop vm.false] [:movable-player-flag :flag-at? :not])) + (vm:word :movable-player-flag ; -- flag :is-neut? (vm:if [neutable] [walkable])) @@ -93,7 +97,7 @@ [vm.false])) (vm:word :move-noop :drop vm.false) (vm:word :handle-general-move ; yx -- f - (vm:if-or [[:dup :map-specific-move] [:dup :move-rexx-trash] [:dup :move-gord-sit] [:dup :move-gord-stand] [:dup :movable-player-flag :flag-at? :not]] + (vm:if-or [[:dup :map-specific-move] [:dup :move-rexx-trash] [:dup :move-gord-sit] [:dup :move-gord-stand] [:dup :move-if-clear]] [:drop vm.true] [:move-noop])) (vm:def :yxclip? ; yx -- f diff --git a/todo.txt b/todo.txt index 25fad05..1f84c14 100644 --- a/todo.txt +++ b/todo.txt @@ -1,44 +1,6 @@ Game: -* Ending screen -* Intro sequence (how to show earthquake?) - - -FLOPPY DISK IDEAS: -* I am not going to write my own DOS -* I will use ProDOS - BOOTI-compatible, modern -* ProDOS 2.4.2 - https://prodos8.com/ -* Generate file(s) to be injected into a blank bootable ProDOS disk image - -thinking: -neut.tower contains all code / data -loader.system contains a small program that maps offsets of 512-byte blocks to memory addresses -- is loaded to 0x2000 & will be wiped by gfx? No, PRODOS is loaded at $2000 and moved -- no, XXX.SYSTEM is loaded to 0x2000 as well -- Alternately, we could write one program that batch-loads the whole game into $2000 and moves it to where it belongs? -- How big is the game with all levels? Could we load the whole thing into consecutive memory starting at $4000? - - (I don't think this would work on 32kb tape-loaded machines...) -- With ProDOS I can assume 64kb -prodos claims: -$bf00-$ffff - ProDOS -$9600-$bf00 - BASIC.SYSTEM - don't care? -$0100-$0800 - "other use or reserved" -$3A-$3F - used by disk routines, unsafe -$40-$4F - used by ProDOS but preserved, safe to use - -system bitmap: marks pages of memory as "not valid to allocate a file buffer" -- loader will have to protect memory that it will be moving game code to? - -https://prodos8.com/docs/techref/calls-to-the-mli/ -the existence of SET_BUF should mean we can load directly to the memory -we care about? orr I guess 512 bytes is housekeeping stuff (index block) - -16kb version - $0000-$4000 - no we need at least 32kb -there's basically only 5kb of code space for an hgr game? -$0000-$03ff 0kb-1kb - zp, stack, input buffer, DOS -$0400-$07ff 1kb-2kb - text page 1 -$0800-$0bff 2kb-3kb - text page 2 -$0c00-$1fff 3kb-8kb - free space -$2000-$4000 8kb-16kb - hgr gfx page 1 +* cheat codes +* save/load tooling ideas: * REPLy buffer (Polywell?)