From 50fbb3acb081bbce9e8b85d0f73ba6c4ad13873b Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 31 Dec 2024 19:45:48 +0100 Subject: [PATCH] preproc: Added DEBUG guard around map load panic --- makefile | 7 ++++--- src/map.s | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 8c1def6..e6ab94e 100644 --- a/makefile +++ b/makefile @@ -1,12 +1,13 @@ NAME=rg TEST_NAME=test$(NAME) -AS=ulas +AS=ulas +FLAGS=-v -D DEBUG bin: - $(AS) -v -o $(NAME).gb -l ${NAME}.lst -s $(NAME).mlb -S mlb -I ./src -I ./tiles src/main.s + $(AS) $(FLAGS) -o $(NAME).gb -l ${NAME}.lst -s $(NAME).mlb -S mlb -I ./src -I ./tiles src/main.s test: - $(AS) -v -o $(TEST_NAME).gb -l ${TEST_NAME}.lst -s $(TEST_NAME).mlb -S mlb -I ./src -I ./tiles src/main.s + $(AS) $(FLAGS) -o $(TEST_NAME).gb -l ${TEST_NAME}.lst -s $(TEST_NAME).mlb -S mlb -I ./src -I ./tiles src/main.s .PHONY: tiles tiles: diff --git a/src/map.s b/src/map.s index d00b280..43f2509 100644 --- a/src/map.s +++ b/src/map.s @@ -187,10 +187,12 @@ room_goto: ld a, [hl] ld d, a +#ifdef DEBUG ; check if de is NULL add a, e cp a, 0 - call z, panic + call z, panic +#endif call room_load_from -- 2.30.2