aboutsummaryrefslogtreecommitdiff
path: root/game/main.asm
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-11 20:57:55 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-11 20:57:55 +0100
commit681ba9adf948ebdc909b08979c76251053af7a9e (patch)
tree36ed6a598c808df7237f8bf65383e878f0fd3266 /game/main.asm
parent871062265cdfb565ba64834cfd85f079f387317e (diff)
downloadtr8vm-681ba9adf948ebdc909b08979c76251053af7a9e.tar.gz
tr8vm-681ba9adf948ebdc909b08979c76251053af7a9e.zip
Add starfield effect
Diffstat (limited to 'game/main.asm')
-rw-r--r--game/main.asm54
1 files changed, 51 insertions, 3 deletions
diff --git a/game/main.asm b/game/main.asm
index 68d1267..e779a95 100644
--- a/game/main.asm
+++ b/game/main.asm
@@ -8,6 +8,7 @@ game_loop:
halt
call entities_erase
+ call stars_update
call entities_update
call entities_draw
@@ -29,14 +30,13 @@ init:
halt
- ; pattern for the BG
- ld b, 15
+ ; erase the screen
+ ld b, 0
ld a, 0xbf
ld x, 0
ld y, 0x40
fill_loop:
ld [a : x], b
- xor b, 5
inc x
bno
jmp fill_loop
@@ -52,6 +52,7 @@ fill_loop:
int_handler:
iret
+.include "starfield.asm"
.include "entities.asm"
.include "player.asm"
@@ -75,3 +76,50 @@ entities:
player_sprite:
.incpng "assets/player.png"
+; starfield data
+stars:
+ ; video addr, speed, color
+ .dw 0xc361
+ .db 1, 15
+ .dw 0xc204
+ .db 1, 6
+ .dw 0xcdf9
+ .db 1, 15
+ .dw 0xdb87
+ .db 1, 3
+ .dw 0xd242
+ .db 1, 15
+ .dw 0xdeea
+ .db 1, 6
+ .dw 0xe7af
+ .db 1, 15
+ .dw 0xed68
+ .db 1, 3
+ .dw 0xf812
+ .db 1, 15
+ .dw 0xfbca
+ .db 1, 13
+ .dw 0xc361
+ .db 2, 8
+ .dw 0xc204
+ .db 2, 9
+ .dw 0xcdf9
+ .db 3, 7
+ .dw 0xdb87
+ .db 3, 4
+ .dw 0xd242
+ .db 2, 8
+ .dw 0xdeea
+ .db 3, 9
+ .dw 0xe7af
+ .db 3, 6
+ .dw 0xed68
+ .db 2, 9
+ .dw 0xf812
+ .db 3, 14
+ .dw 0xfbca
+ .db 2, 3
+ ; end of list
+ .dw 0xffff
+
+