Fix copyvar with non-var argument

This commit is contained in:
Martin Griffin
2025-11-06 11:15:13 +00:00
committed by Philipp AUER
parent fdcaac9175
commit 1a9fbbcfba
6 changed files with 29 additions and 6 deletions

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