aboutsummaryrefslogtreecommitdiff
path: root/game/main.asm
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-22 07:13:54 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-22 07:13:54 +0100
commitc09a85ef9da7c1608b9d78c41975b4fdbbadf3e4 (patch)
tree710c0ca794e69d77a7e6ac5b035c1547c706a073 /game/main.asm
parent82e506390d12a3ce30604e42af8cbccc448ad861 (diff)
downloadtr8vm-c09a85ef9da7c1608b9d78c41975b4fdbbadf3e4.tar.gz
tr8vm-c09a85ef9da7c1608b9d78c41975b4fdbbadf3e4.zip
Use a bitmap font
Diffstat (limited to 'game/main.asm')
-rw-r--r--game/main.asm79
1 files changed, 14 insertions, 65 deletions
diff --git a/game/main.asm b/game/main.asm
index 365e381..5be96a6 100644
--- a/game/main.asm
+++ b/game/main.asm
@@ -8,12 +8,6 @@
; Menu entry point
;
menu:
- ; reset the blink flag
- ld x, <blink
- ld a, >blink
- ld y, 0
- ld [a : x], y
-
call clear_screen
menu_loop:
@@ -31,7 +25,6 @@ menu_loop:
bnz
jmp menu_loop
-
;
; Gameplay entry point
;
@@ -103,12 +96,6 @@ fill_loop:
ret
;
-; Controls the blink of the "press start" text
-;
-blink:
- .db 0
-
-;
; Draws the menu
;
menu_draw:
@@ -145,59 +132,15 @@ menu_draw:
ld y, 3
port b, y
- ; settings mode
- ld y, 128
- port b, y
-
- ; setup
- inc b
-
- ld x, <blink
- ld a, >blink
- ld y, [a : x]
- inc y
- and y, 31
- ld [a : x], y
- cmp y, 10
- bnc
- jmp menu_draw_start
-
- ; addr: black to erase sprite
- ld y, 0
- port b, y
- ld y, 0xa0
- port b, y
- jmp menu_continue_start
-
-menu_draw_start:
- ; addr: press start sprite
- ld y, <press
- port b, y
- ld y, >press
- port b, y
-
-menu_continue_start:
- ; x
- ld y, 36
- port b, y
-
- ; y
- ld y, 80
- port b, y
-
- ld y, 56
- port b, y
- ld y, 8
- port b, y
-
- ; blit
- dec b
- ; write, transparent
- ld y, 3
- port b, y
+ ld x, <press_start
+ ld a, >press_start
+ ld b, 40
+ ld y, 84
+ call put_text
; settings mode
ld y, 128
+ ld b, 0xb0
port b, y
; setup
@@ -250,6 +193,7 @@ init:
int_handler:
iret
+.include "text.asm"
.include "random.asm"
.include "starfield.asm"
.include "entities.asm"
@@ -331,7 +275,12 @@ stars:
; menu data
title:
.incpng "assets/title.png"
-press:
- .incpng "assets/press.png"
+font:
+ .incpng "assets/font.png"
usebox:
.incpng "assets/usebox.png"
+
+; texts
+press_start:
+ .str "PRESS START!"
+ .db 0