implement footer

This commit is contained in:
Jeremy Penner 2020-11-22 14:24:46 -05:00
parent 30045823e1
commit c47f98f43b
2 changed files with 33 additions and 2 deletions

View file

@ -126,6 +126,30 @@
[:bne :page]] [:bne :page]]
(vm:drop)) (vm:drop))
(vm:def :clearline ; pscreen --
[:lda vm.TOP :x] [:sta vm.W]
[:lda vm.TOPH :x] [:sta vm.WH]
(vm:drop)
[:block
:row
[:ldy 0x2f] [:lda 0]
:start
[:sta [vm.W] :y]
[:dey]
[:bpl :start]
[:lda vm.WH]
[:cmp 0x3d]
[:bcs :done]
; cmp has cleared carry for us here
[:lda 4] [:adc vm.WH] [:sta vm.WH]
[:bcc :row]
:done])
(vm:word :drawfooter
0x21d0 :clearline
0x2250 :clearline 0x22d0 :clearline 0x2350 :clearline 0x23d0 :clearline)
(vm:word :drawmaprow ; pscreen pmap -- pmap (vm:word :drawmaprow ; pscreen pmap -- pmap
mapw (vm:for mapw (vm:for
:2dup :bget :lookup-tile :drawtile :2dup :bget :lookup-tile :drawtile
@ -137,6 +161,12 @@
:<rot :drawmaprow :swap ; pmap yx :<rot :drawmaprow :swap ; pmap yx
:dup :not) :drop :drop) :dup :not) :drop :drop)
(vm:word :clearfooter
:lit :map 0x0300 (vm:until 0x100 :-
:dup 0x0900 :+ :yx>screen
:<rot :drawmaprow :swap
:dup :not) :drop :drop :object-redraw)
(vm:def :lookup-tile ; itile -- ptile (vm:def :lookup-tile ; itile -- ptile
; each tile is 32 bytes; 2^5 ; each tile is 32 bytes; 2^5
; we save some cycles by storing the indices as lllhhhhh, so we don't need to shift them' ; we save some cycles by storing the indices as lllhhhhh, so we don't need to shift them'
@ -262,7 +292,8 @@
:draw-jaye-yx ; :draw-jaye-yx ;
] [:drop])) ] [:drop]))
(vm:word :full-redraw :cleargfx :drawmap :jaye-yx :get :draw-jaye-yx) (vm:word :full-redraw :drawmap :object-redraw)
(vm:word :object-redraw :jaye-yx :get :draw-jaye-yx)
(tile.append-gfx tiles) (tile.append-gfx tiles)

View file

@ -1 +1 @@
[{"gfx":"8080808080E0E0F0F8FC2CBCACACACAC80809CFEFFFFFFD7D5D5555D4F5D55D5BCB8B8B8F8F8F8F8FCBC9E9E86D0D0D095D5D585D5D5D5D0C090D0D0AAAAAAAA808086BFFFFFFFFAEAAA2A2E3C2E2AAA80808080808183878787058F8D8D8D8FAAAAAAA8AAEAEAEAC2888A8AD5D5D5D58F8F8787878F8F8F9F9FBCB8808A8A8A","label":"pjaye","flags":[]}] [{"gfx":"8080808080E0E0F0F8FC2CBCACACACAC80809CFEFFFFFFD7D5D5555D4F5DD5D5BCB8B8B8F8F8F8F8FCFCFE9E86D0D0D495D5D5E5D5D5D5D7C793D1D0AAAAAAAA808086BFFFFFFFFAEAAA2A2E3C2EAAAA80808080808183878787058F8D8D8D8FAAAAAAA7AAAAEAEAC2888A8AD5D5D5D58F8F8787878F8F8F9F9FBCB8808A8AAA","label":"pjaye","flags":[]},{"gfx":"00002020000000004808080800202028004040011404450144010805445420352020000808084800000000202000000020544405080144014504140140400000000202012921220122011021222A052D00000405000001011211101100040415052A222110012201222129010202000004040011101112010100000504000000","label":"pneut","flags":[]}]