RPGHacker / asar

(Now) official repository of the SNES assembler Asar, originally created by Alcaro
Other
199 stars 42 forks source link

Macro comment wasn't documented? #234

Closed GhbSmwc closed 7 months ago

GhbSmwc commented 2 years ago

I saw this patch on SMWC that fixes a bug with a couple of sprites "sometimes" interact with other sprites:

macro comment()
hi, this is my first patch lmao

Some sprites do not have any sprite interaction within their own code,
which means they ignore lower priority sprites that are loaded in.

so here we are

endmacro

Is this documented in the more recent version? I'm using version 1.81

RPGHacker commented 2 years ago

I'd say it's not documented because it isn't really a feature intentionally supported by Asar (and in fact, it's not guaranteed to keep working in future releases). It's something that just "happens to work", because the content of macros isn't evaluated until the respective macro is called.

That being said, this method does have its obvious limits that you will run into pretty quickly if you use it regularly. Since macro names have to be unique, you'd have to use a new name for every single comment you write this way. This would also raise the chance of clashing with another random macro somewhere. I'd say those things alone are enough reasons to not consider this an officially supported feature.

EDIT: Actual support for multi-line comments might be a worthwhile addition to a future version of Asar, though.

randomdude999 commented 7 months ago

proper multiline comments are added in asar 2.0, the macros working well enough was just a happy accident i guess.