diff options
Diffstat (limited to 'samples/move.orgaasm')
-rw-r--r-- | samples/move.orgaasm | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/samples/move.orgaasm b/samples/move.orgaasm index 70e85ca..34afb36 100644 --- a/samples/move.orgaasm +++ b/samples/move.orgaasm @@ -2,12 +2,21 @@ JMP ,main include(std.orgaasm) @main + #0000 #4007 /draw/hline + #0001 #4007 /draw/hline + #007e #4007 /draw/hline + #007f #4007 /draw/hline + #0000 #4007 /draw/vline + #0001 #4007 /draw/vline + #007e #4007 /draw/vline + #007f #4007 /draw/vline +@main/loop SLP /input/update /player/erase /player/update /player/draw - JMP ,main + JMP ,main/loop @input.kleft 0000 @input.kright 0000 @@ -26,13 +35,13 @@ include(std.orgaasm) @player/update ( -- ) @player/update/movex - #0001 #0076 + #0002 #0075 -player.x LDA -input.kleft LDA SUB -input.kright LDA ADD /clamp -player.x STA @player/update/movey - #0001 #0076 + #0002 #0075 -player.y LDA -input.kup LDA SUB -input.kdown LDA ADD @@ -60,6 +69,29 @@ include(std.orgaasm) STA RET +@draw.col 0000 +@draw/hline ( y col -- ) + -draw.col STA ( y ) + #0080 ( y x ) +@draw/hline/loop + DEC + OVR OVR SWP ( y x x y ) + -draw.col LDA ( y x x y col ) + /draw/pixel ( y x ) + DUP JNZ ,draw/hline/loop + POP POP RET + +@draw/vline ( x col -- ) + -draw.col STA ( x ) + #0080 ( x y ) +@draw/vline/loop + DEC + OVR OVR ( x y x y ) + -draw.col LDA ( x y x y col ) + /draw/pixel ( x y ) + DUP JNZ ,draw/vline/loop + POP POP RET + @draw/sprite.oscr 0000 @draw/sprite ( x y addr -- ) ROT ROT #0007 LSF ADD -Screen ADD ( spr scr ) |