mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Fixes #669 Closes #368 Closes #624 Deprecate PRINTT, PRINTV, PRINTI, and PRINTF Default STRFMT("%f") to 5 fractional digits like "{f:}" Any use of string formatting will share this default
30 lines
502 B
NASM
30 lines
502 B
NASM
|
|
TEST_NUM = 0
|
|
|
|
test_expr: MACRO
|
|
TEST_NUM = TEST_NUM + 1
|
|
|
|
IS_CONST = ISCONST(\1)
|
|
PRINTLN "Test #{d:TEST_NUM}: ISCONST reports {IS_CONST}"
|
|
IF (\1) || 1 ; Only test if the expression can be evaluated
|
|
WARN "Test #{d:TEST_NUM}: Compile-time constant"
|
|
ENDC
|
|
ENDM
|
|
|
|
test_expr 1
|
|
test_expr UnknownLabel
|
|
|
|
SECTION "fixed", WRAM0[$CAFE]
|
|
|
|
FixedLabel:
|
|
ds 42
|
|
test_expr FixedLabel
|
|
test_expr @ - FixedLabel
|
|
|
|
SECTION "floating", WRAMX
|
|
|
|
FloatingLabel:
|
|
ds 69
|
|
test_expr FloatingLabel
|
|
test_expr @ - FloatingLabel
|