From: Lukas Krickl Date: Sat, 23 Aug 2025 18:45:18 +0000 (+0200) Subject: ui: Added max hp display X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=675ac6e9f85833ef97a165e930dcae2f95f966f2;p=gbrg%2F.git ui: Added max hp display --- diff --git a/src/strings.s b/src/strings.s index cc75efb..8731dae 100644 --- a/src/strings.s +++ b/src/strings.s @@ -7,13 +7,16 @@ #define EMPTY_TILE 0x30 #define FONT_OFFSET (0xD0 - 1) +#define SLASH 0x2F ; map space to empty tile ; one tile after Z .scc 0x20 = 26+11 ; map ? -.scc '?' = 26+13 +.scc '?' = 26+13 +; map / +.scc SLASH = 26+14 STR_TITLE: .str "gbrg" @@ -66,6 +69,10 @@ STR_STATUS_CLEAR: STR_HIT_FOR: .str "hit for " +.db 0 + +STR_SLASH: +.str "/" .db 0 ; print a 0-terminated string to the screen @@ -139,4 +146,5 @@ putn: ; print remainder add a, FONT_OFFSET+1 ld [de], a + inc de ret diff --git a/src/ui.s b/src/ui.s index 82ae143..a95958a 100644 --- a/src/ui.s +++ b/src/ui.s @@ -32,6 +32,19 @@ ui_redraw_hp: pop de call putn + + ; print / + ld hl, STR_SLASH + call puts + + ; print max hp + push de + ld de, player_unit + call stat_calc_hp_max + pop de + + call putn + ret ; clears the status line @@ -77,4 +90,5 @@ ui_draw_status_stat: call putn call ui_request_redraw + ret diff --git a/tiles/bank8C00.inc b/tiles/bank8C00.inc index 527a34e..1f7bd6a 100644 --- a/tiles/bank8C00.inc +++ b/tiles/bank8C00.inc @@ -494,14 +494,14 @@ .chr 22233222 .chr 22233222 ; tile 55 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 +.chr 22222332 +.chr 22222332 +.chr 22223322 +.chr 22223322 +.chr 22233222 +.chr 22233222 +.chr 22332222 +.chr 22332222 ; tile 56 .chr 00000000 .chr 00000000