[paint] Draw XOR cursor 8 pixels at a time #2302
Merged
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.
@Vutshi asked:
Answer: Not much. And so a much faster cursor display routine was written. This version uses a maximum of two VGA memory writes per 8 bits of the cursor image and never draws pixel-by-pixel. Any 16x16 cursor should be wildly faster on real hardware.
The routine could be made even faster for 16x16 cursors, but I wanted to have this first round tested and get more feedback, as it may be finally fast enough to keep up on 8088. I think we should be able to switch to a larger (16x16 or slightly less) cursor as standard and not have to even worry about an 8x8 cursor using the fast draw code, since the draw time is now not dependent on the number of cursor mask one-bits anymore.
I will commit this now for testing, and plan on some cleanup code later, as there are still some issues seen while testing with the Watcom and C86 compilers. I temporarily added back in the original 16x16 cursor for speed comparisons with XOR drawing. The GCC version is running well and uses @Vutshi's new 11x16 cursor.
As a side note, I think we may be able to use the same-style routine to greatly increase the speed of drawing BMP scanlines. More on that later.