You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These would be useful as opt-in link-time warnings:
For every ld, check for and suggest using ldh instead if possible.
(This would be an improved substitute for the removed feature of rgbasm -L, which optimized known-constant ld to ldh.)
For every jp, check for and suggest using jr instead if possible.
For every jp and jr, check for redundant jumps to the location immediately after the instruction, and suggest ; fallthrough instead.
For every control flow instruction (call, jp, jr, rst) targeting a label in ROMX, do a lint equivalent of assert BANK(@) == 0 || BANK(<target>) == 0 || BANK(@) == BANK(<target>).
Do this only if PC is in a ROMX section, which also excludes LOAD. (In theory, BANK(@) != 0 for ROMX, but -t maps ROMX to ROM0. The destination is then guaranteed to be in ROM0 as well, but that may not remain the case if we add some similar feature to HDFs, so a cheap stringent check for BANK(@) == 0 is good for future-proofing.)
(Possibly make this a multi-level lint, where by default cross-SECTION jumps are not checked?)
These would be useful as opt-in link-time warnings:
For every
ld, check for and suggest usingldhinstead if possible.(This would be an improved substitute for the removed feature of
rgbasm -L, which optimized known-constantldtoldh.)For every
jp, check for and suggest usingjrinstead if possible.For every
jpandjr, check for redundant jumps to the location immediately after the instruction, and suggest; fallthroughinstead.For every control flow instruction (
call,jp,jr,rst) targeting a label in ROMX, do a lint equivalent ofassert BANK(@) == 0 || BANK(<target>) == 0 || BANK(@) == BANK(<target>).(
rstalways targets ROM0, but if we add support for swappable ROM0, possibly via HDFs ([Feature request/proposal] Hardware layout description files (custom mapper support) #524), then this would be multi-banked.)Do this only if PC is in a ROMX section, which also excludes
LOAD. (In theory,BANK(@) != 0for ROMX, but-tmaps ROMX to ROM0. The destination is then guaranteed to be in ROM0 as well, but that may not remain the case if we add some similar feature to HDFs, so a cheap stringent check forBANK(@) == 0is good for future-proofing.)(Possibly make this a multi-level lint, where by default cross-SECTION jumps are not checked?)