RPGHacker / asar

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

Labels in incbin math stopped working in Asar 1.9 #335

Open RPGHacker opened 1 month ago

RPGHacker commented 1 month ago

From Yoshifanatic's Discord server:

Hey, something I just noticed, but asar 1.91 gives me error "Eno_labels_here" when I do this. This setup with incbin offsets allows me to handle game files that are stored across lorom bank boundries in cases where "check bankcross off" wouldn't make sense. This worked prior to asar 1.9, which is ironic considering asar 1.9 made static labels usable in more places.

incbin "SPC700/SPC700DataBlocks_SMAS.bin":!StartOffset..!StartOffset+(($010000-.Block3Start)&$00FFFF)

incbin "SPC700/SPC700DataBlocks_SMAS.bin":!StartOffset+(Section1_Block3End-Section1_Block3Start)..!EndOffset

I couldn't find this change documented anywhere. Is this something that we removed intentionally?

RPGHacker commented 1 month ago

A bit of additional context:

[...] This was taken from my Earthworm Jim 2 disassembly, with updated syntax. [...]

[...] some of my disassemblies do this because some game developers decided to put files at the end/start of two code banks to fill in what would otherwise be empty space. That's why "check bankcross off" is a bad idea in this context, since code could end up crossing a bank if the user moves the file. I can't think of a way to do this without labels, aside from hardcoding the address these files are inserted.

DATA_C1EC50:
    incbin "SPC700/DATA_C1EC50.bin":$00..($010000-DATA_C1EC50)&$00FFFF
.End:

CODE_C20000:
    incbin "SPC700/DATA_C1EC50.bin":DATA_C1EC50_End-DATA_C1EC50..$00