RPGHacker / asar

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

Add explicit Error/Warning if using read functions without a rom file #240

Open RobertTheSable opened 2 years ago

RobertTheSable commented 2 years ago

Asar currently emits some ambiguous errors if you try to use the read functions without a ROM file.

Example:

$ asar patch.asm doesntexist.smc 
patch.asm:3: error: (E5039): SNES address 00FFDB in read function out of bounds. [if read1($00FFDB) == $01]
Errors were detected while assembling the patch. Assembling aborted. Your ROM has not been modified.

A similar ambiguous error is given if you try to use check title without a ROM file.

There should be a specific error, or at least a warning, if you try to read data without opening a ROM file first.

Ideally I would also like to see some standard way for a patch to mark that a ROM file is required.

If there's already a way to achieve this, my apologies. But I couldn't find such a method in the documentation.

RPGHacker commented 2 years ago

check title was definitely intended for that purpose: To tell the end user that a specific ROM is expected (and which one).

Though I see your point on the error message being a bit misleading. Improving that for cases where no input ROM is provided sounds like a good idea.