keypad boops, noclip cheat code

This commit is contained in:
Jeremy Penner 2021-02-11 21:38:57 -05:00
parent 51c5b9c6b7
commit 6d005950a5
7 changed files with 40 additions and 44 deletions

Binary file not shown.

View file

@ -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}

23
game/cheat.fnl Normal file
View file

@ -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 :<rot := (vm:if ; cheatdata
[:dup :bget :inc :over :bset
:dup :pcheatnext :bget (vm:if [:drop :rdrop] [:reset-cheat])]
[:reset-cheat :rdrop]))
(defcheat :NTSPISPOPD :noclip :get :not :noclip :set)
(vm:word :cheat-key ; ascii --
(vm:if-and [[:dup (string.byte "A") :>=] [:dup (string.byte "Z") :<=]]
[:NTSPISPOPD]
[:drop]))

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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?)