fix redrawing map tile

This commit is contained in:
Jeremy Penner 2020-11-14 22:54:43 -05:00
parent 0d7effa024
commit 56c2eb1b94

View file

@ -148,8 +148,29 @@
[:tya] [:and 0xe0] [:tya] [:and 0xe0]
[:sta vm.TOP :x]) [:sta vm.TOP :x])
(vm:word :drawtile-at ; xy -- (vm:def :itile-at ; yx -- itile
:drop) ; todo [:lda (- maph 1)]
[:sec]
[:sbc vm.TOPH :x]
[:asl :a] ; x2
[:asl :a] ; x4
[:sta vm.TOPH :x]
[:asl :a] ; x8
[:asl :a] ; x16
[:clc] [:adc vm.TOPH :x] ; x20
[:adc vm.TOP :x]
[:sta vm.TOP :x]
[:lda #(hi ($1:lookup-addr :map))]
[:sta vm.TOPH :x]
[:lda [vm.TOP :x]]
[:sta vm.TOP :x]
[:lda 0]
[:sta vm.TOPH :x])
(vm:word :drawtile-at ; yx --
:dup :yx>screen :swap
:itile-at :lookup-tile
:drawtile)
(vm:def :last-key ; -- key (vm:def :last-key ; -- key
(vm:reserve) (vm:reserve)