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/text.asm | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 game/text.asm (limited to 'game/text.asm') diff --git a/game/text.asm b/game/text.asm new file mode 100644 index 0000000..06a40b3 --- /dev/null +++ b/game/text.asm @@ -0,0 +1,95 @@ +; +; Bitmap font +; + +; +; Write text on screen +; +; Expects a 4x8 font on "font" label. +; +; in: a : x: text to write +; b, y : (x, y) dst coords +put_text: + push y + push b + +put_text_loop: + ld y, [a : x] + cmp y, 0 + bz + jmp put_text_exit + + sub y, 32 + + push a + push x + + rol y, 5 + ld x, y + and x, 31 + and y, 224 + + ld a, >font + add a, x + + ld x,