RPGHacker / asar

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

better errors for invalid instruction widths #198

Closed randomdude999 closed 9 months ago

randomdude999 commented 3 years ago

we really should have better error messages for things like dec $123456. currently getting the address mode wrong prints "invalid command" which isn't really all that helpful. i think we should have separate errors for cases where the addressing mode exists, but the width is incompatible (like dec $123456 from before) and cases where the entire addressing mode doesn't exist (like dec $00,y)

implementation is gonna either be a gigantic mess or a rewrite of arch-65816 though

(also, on a related note: print "wrong number of arguments" instead of "invalid command" for all the non-opcode commands)

spannerisms commented 3 years ago

I have an issue that probably falls within the scope of this one, so I'll just bring it up here instead of a new issue.

Various SPC700 operations seem to ignore the .b. So unless I shut warnings off, I get things like this:

spc/customspc.asm:104: warning: (W1006): This opcode does not exist with 16-bit parameters, assuming 8-bit. [adc.b A,#DYNAMIC_SONG_DATA]

p4plus2 commented 3 years ago

I'll look into fixing this with 1.9, however arch-*.cpp are scheduled for pretty significant overhauls in 2.0. So this may get deferred if it isn't relatively easy to fix up. But I think it should be.

p4plus2 commented 3 years ago

Fix pushed.

By the way @spannerisms feel free to join the sneslab discord if you want to talk about either asar more directly (or other snes related stuff like homebrew etc). https://discord.gg/5sEQQ5Ae The link will expire in 24hrs. Totally optional, just giving it to you as in case you want it.

spannerisms commented 3 years ago

Thanks for the offer, but I'm mainly an on-my-own kinda person when it comes to most hacking.

randomdude999 commented 9 months ago

implemented in asar_2_beta. i think i'm quite happy with the new errors