DSPAssembler: Rework errors and warnings, and related cleanup #10694
+286
−245
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Among other changes to the error/warning messages, this trims trailing newline characters in the line. Before (on windows) the \r would corrupt the output and make them very hard to understand (as the error message would be drawn over the code line, but part of the code line would peek out from behind it).
Other than that, it's mostly removal of magic numbers (or reduction in how magical they are, as I'm not touching some of the code involving
partype_tcurrently but using theDSP_REG_Xconstants helps with it.)For example, before, if you were to add
MOVR $acc1, $ac0.m(invalid because the second operand ofMOVRmust be either hte low or high part of$ax0or$ax1, but I didn't realize this, and because of another typo) intodsp_base_noirq.inc, you would get this output:except the actual output is
because line-feed characters
\rare being used without a corresponding\n. Stripping the\rwould give this (which I think is also the result on non-windows OSes):which is still pretty messy.
Now you get this:
which is reasonably understandable.
There are definitely other possible improvements here, but I think this is a good start.