diff options
Diffstat (limited to 'macros/asserts.asm')
-rw-r--r-- | macros/asserts.asm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/macros/asserts.asm b/macros/asserts.asm index 306fc4c34..04c039ecc 100644 --- a/macros/asserts.asm +++ b/macros/asserts.asm @@ -19,6 +19,31 @@ x = \1 "{CURRENT_TABLE_START}: expected {d:x} entries, each {d:CURRENT_TABLE_WIDTH} bytes" ENDM +list_start: MACRO +list_index = 0 +if DEF(CURRENT_LIST_START) +PURGE CURRENT_LIST_START +endc +if _NARG == 1 +CURRENT_LIST_START EQUS "\1" +else +CURRENT_LIST_START EQUS "._list_start\@" +CURRENT_LIST_START: +endc +ENDM + +li: MACRO + assert !STRIN(\1, "@"), STRCAT("String terminator \"@\" in list entry: ", \1) + db \1, "@" +list_index = list_index + 1 +ENDM + +assert_list_length: MACRO +x = \1 + assert x == list_index, \ + "{CURRENT_LIST_START}: expected {d:x} entries, got {d:list_index}" +ENDM + def_grass_wildmons: MACRO ;\1: map id if DEF(CURRENT_GRASS_WILDMONS_MAP) |