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.
Suggestion cannot be applied right now. Please check back later.
Any TFR between index registers can be optimised so long as current Z flag is not used (and even then if the destination is U or S). e.g.
There are also a few places where a pointer is loaded, then replaced with the zero-offset contents pointed to. 6809 indirect addressing can be used here for savings vs extended addressing (the savings go away wrt direct addressing, but I'm pretty sure that's not used here). e.g.
RTS can be merged into any PULS right before by adding PC to the registers pulled.
Slight reorder of plot_char to save a branch.
clear_lines does not need to use the U register. We can also test for zero characters to clear early as the result of the MUL.
In scroll_up and scroll_down, use stack ops instead of predec/postinc wrt U. And swap source and dest registers in scroll_up to enable that.