From: Lukas Krickl Date: Tue, 31 Dec 2024 18:45:48 +0000 (+0100) Subject: preproc: Added DEBUG guard around map load panic X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=50fbb3acb081bbce9e8b85d0f73ba6c4ad13873b;p=gbrg%2F.git preproc: Added DEBUG guard around map load panic --- 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