aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-12 07:43:41 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-12 07:43:41 +0100
commitd6053f73792e85fbc71d5695ee13253d0bd56178 (patch)
treea962099dde1d8fde544fc540d197bfe26a6011e1
parente08c4e724f81b6adb4de371a390f0ca4081384f3 (diff)
downloadtr8vm-d6053f73792e85fbc71d5695ee13253d0bd56178.tar.gz
tr8vm-d6053f73792e85fbc71d5695ee13253d0bd56178.zip
Set player start address
Also differentiate bewteen initialising the program and the game.
-rw-r--r--game/main.asm16
1 files changed, 16 insertions, 0 deletions
diff --git a/game/main.asm b/game/main.asm
index cdf0844..bfc203c 100644
--- a/game/main.asm
+++ b/game/main.asm
@@ -3,6 +3,7 @@
.equ INT_VECTOR 0xff00
call init
+ call init_game
game_loop:
halt
@@ -27,9 +28,23 @@ init:
; enable interrupts
cif
+ ret
+init_game:
halt
+ ; set player initial coordinates
+ ld x, <player_coord
+ ld a, >player_coord
+
+ ld y, 56
+ ld [a : x], y
+ inc x
+ bo
+ inc a
+ ld y, 104
+ ld [a : x], y
+
; erase the screen
ld b, 0
ld a, 0xbf
@@ -64,6 +79,7 @@ entities:
; type
.db ET_PLAYER
; x, y
+player_coord:
.db 0, 0
; frame
.db 0