aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-04-15 12:43:46 +0200
committerkdx <kikoodx@paranoici.org>2023-04-15 12:43:46 +0200
commit8f27e17448f3a38b1fe9f8aa4963481a0614b3a4 (patch)
tree43ab852a3291da489df252fbad21e6f7a19cbc83
parentc7e4c1e984b4914b1b6c9e73b424536578483e1b (diff)
downloadorga-8f27e17448f3a38b1fe9f8aa4963481a0614b3a4.tar.gz
samples/move: screen borders
-rw-r--r--samples/move.orgaasm38
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 )