Fix copyvar with non-var argument

This commit is contained in:
Martin Griffin authored and Philipp AUER committed 2025-11-06 14:29:09 +01:00
1 parent fdcaac9175
commit 1a9fbbcfba
6 files changed
+29 -6

No files matched your search

+4 -1
View File
@@ -169,7 +169,10 @@
.endm
@ Copies the value of source into destination.
.macro copyvar destination:req, source:req
.macro copyvar destination:req, source:req, warn=TRUE
.if \warn && !((\source >= VARS_START && \source <= VARS_END) || (\source >= SPECIAL_VARS_START && \source <= SPECIAL_VARS_END))
.warning "copyvar with a value that is not a VAR_ constant; did you mean setvar instead?"
.endif
.byte SCR_OP_COPYVAR
.2byte \destination
.2byte \source