Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragon MOOH video optimisations #1137

Merged
merged 2 commits into from
Jan 12, 2025

Conversation

six809
Copy link

@six809 six809 commented Jan 12, 2025

Optimise TFR usage similar to coco3 patch.

Save 1 byte and 4 cycles computing address within font.

Use the B register within plot_fast to make some savings. Add 128 to
destination screen address in Y so that subsequent offsest are 8-bit.

Same 128 byte offset in m6847_clear_across, as well as opportunistically
using a post-increment to avoid the need for LEAX 1,X.

Same 128 byte offset in m6847_cursor_on/off.

In m6847_scroll_up/down, use stack ops with U instead of predec/postinc.

Also, fix a possible (maybe not now, but in the future) font corruption;
use LSLB instead of ROLB in fast multiply by 8.

Ciaran Anscomb added 2 commits January 12, 2025 14:01
Save 1 byte and 4 cycles computing address within font.

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.

	TFR  X,U	; 2 bytes, 6 cycles
	; becomes:
	LEAU ,X		; 2 bytes, 4 cycles

Use the B register within plot_fast to make some savings.  Add 128 to
destination screen address in Y so that subsequent offsest are 8-bit.

Same 128 byte offset in m6847_clear_across, as well as opportunistically
using a post-increment to avoid the need for LEAX 1,X.

Same 128 byte offset in m6847_cursor_on/off.

In m6847_scroll_up/down, use stack ops with U instead of predec/postinc.
Use LSLB instead of ROLB in the fast multiply by 8 in m6847_plot_char.

AFAICT the carry flag isn't necessarily cleared before plot_char() hands
off to m6847_plot_char.  If it were set on entry, the index into the
font would be offset by 1.  I've never seen that happen, but this fix
costs nothing.
@six809 six809 changed the title Dragon mooh video opt Dragon MOOH video optimisations Jan 12, 2025
@EtchedPixels EtchedPixels merged commit 857b38b into EtchedPixels:master Jan 12, 2025
11 of 13 checks passed
@EtchedPixels
Copy link
Owner

Thanks

@six809 six809 deleted the dragon-mooh-video-opt branch January 12, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants