Added test build to makefile
authorLukas Krickl <lukas@krickl.dev>
Fri, 4 Oct 2024 17:31:01 +0000 (19:31 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 4 Oct 2024 17:31:01 +0000 (19:31 +0200)
makefile
src/main.s
src/ui.s

index fb776a8db3b39d92e846b99311f0840071ceeff5..ae213babad296dd38309456844548a6b4821d591 100644 (file)
--- a/makefile
+++ b/makefile
@@ -6,6 +6,10 @@ all:
        mkdir -p $(BDIR)
        ulas -v -o $(BDIR)/$(BIN) -l bin/rg.lst -s bin/rg.mlb -S mlb -i ./src -i ./tiles src/main.s
 
+test:
+       mkdir -p $(BDIR)
+       ulas -v -o $(BDIR)/test$(BIN) -D TEST_BUILD -l bin/testrg.lst -s bin/testrg.mlb -S mlb -i ./src -i ./tiles src/main.s
+
 .PHONY: tiles
 tiles:
        ./tools/png2chr.py assets/tiles0.png > tiles/tileset0.inc
index a77c47e29173b8b7527769f354660e3ee728a50c..680a1273ce65da51f1d03bde9a6aeb6fb45f7970 100644 (file)
@@ -23,6 +23,8 @@ entry:
 
   call enableinterrupts
 
+  ; main for gameply
+#ifndef TEST_BUILD
 main:
 @forever:
   ld a, [frame_ready]
@@ -32,6 +34,14 @@ main:
   xor a, a
   ld [frame_ready], a
   jr @forever REL
+#endif
+
+  ; main for test-runner build
+#ifdef TEST_BUILD
+main:
+@forever:
+  jr @forever REL
+#endif
 
 #include "video.s"
 #include "mem.s"
index 6479c6ae5d469b6c4d96495a48a4a9316a300107..eb1beabf23e62da92f1d733d352f93c3d0ffaa93 100644 (file)
--- a/src/ui.s
+++ b/src/ui.s
@@ -32,7 +32,9 @@ ui_init:
 
   ret
 
-  ; draws a UI bar 
+  ; draws a UI bar
+  ; the bar will be filled up to hp/mp 
+  ; al others will be empty
   ; inputs:
   ;   hl: screen location
   ;   [de]: ptr to hp/mp where hp/mp max is [de+1]