aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-02-10 23:04:58 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-02-10 23:04:58 +0100
commit53ca319b60ee36ee4f4f8b83fc199c8aa89a8647 (patch)
treecf68705915d3b914fc5b96c3eabff4d429c4b171
parent1b46ddb0486276de0b0691e10277d206a0763300 (diff)
downloadjetpac.nes-53ca319b60ee36ee4f4f8b83fc199c8aa89a8647.tar.gz
jetpac.nes-53ca319b60ee36ee4f4f8b83fc199c8aa89a8647.zip
Add a sanity check for the LEVEL variable
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--include/asm.s5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asm.s b/include/asm.s
index 09229f9..e44aedf 100644
--- a/include/asm.s
+++ b/include/asm.s
@@ -1,3 +1,8 @@
+;; Sanity check for the 'LEVEL' build parameter.
+.if !(LEVEL >= 0 && LEVEL < 8)
+ .error "You have defined a bad 'LEVEL' value, it should be between 0 and 7 (both included)"
+.endif
+
;; Jump And Link: jump to subroutine but use the return address that the caller
;; had whenever the given subroutine runs `rts`. In other words, "link" the
;; return address from the caller to the callee.