asar icon indicating copy to clipboard operation
asar copied to clipboard

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

Open RobertTheSable opened this issue 3 years ago • 1 comments

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.

RobertTheSable avatar Apr 20 '22 02:04 RobertTheSable

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.

RPGHacker avatar Apr 20 '22 06:04 RPGHacker