ui: Added max hp display
authorLukas Krickl <lukas@krickl.dev>
Sat, 23 Aug 2025 18:45:18 +0000 (20:45 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sat, 23 Aug 2025 18:45:18 +0000 (20:45 +0200)
src/strings.s
src/ui.s
tiles/bank8C00.inc

index cc75efbbc20a4d89dd3666142014322d7766c99b..8731dae13153afe798255155e02b9b30774be32a 100644 (file)
@@ -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
index 82ae143c13cc8982d860ca6ccdaceb6651135e1f..a95958a5e89e496017f60d1da5429586cd0e3f89 100644 (file)
--- 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
index 527a34e14446dbbdf114257571e572934beb7909..1f7bd6a25d1e3451bfe76e4f4b9abf7fbe34a7ba 100644 (file)
 .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