From c09a85ef9da7c1608b9d78c41975b4fdbbadf3e4 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 22 May 2023 07:13:54 +0100 Subject: Use a bitmap font --- game/main.asm | 79 +++++++++++------------------------------------------------ 1 file changed, 14 insertions(+), 65 deletions(-) (limited to 'game/main.asm') 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 y, 0 - ld [a : x], y - call clear_screen menu_loop: @@ -31,7 +25,6 @@ menu_loop: bnz jmp menu_loop - ; ; Gameplay entry point ; @@ -102,12 +95,6 @@ fill_loop: jmp fill_loop ret -; -; Controls the blink of the "press start" text -; -blink: - .db 0 - ; ; Draws the menu ; @@ -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 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 - -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 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 -- cgit v1.2.3