improve scroll region function#159
Conversation
fixes scrolling background colour issue - the new area of screen will now always be filled with the current text background colour also adds support for movement directions 4-7, which move dependent upon the currently set cursor behaviour bits (see VDU 23,16) adds support for movement amount of 0, to indicate move by 1 character in the given direction (as per Acorn’s implementation)
340a6e6 to
fd31586
Compare
| // Now scan the screen and get the 8 byte pixel representation in charData | ||
| // | ||
| for (uint8_t y = 0; y < 8; y++) { | ||
| charRow = 0; |
There was a problem hiding this comment.
sorry for the whitespace changes in this PR... inconsistent formatting bugs me....
| @@ -716,23 +716,47 @@ void setLegacyModes(bool legacy) { | |||
| void scrollRegion(Rect * region, uint8_t direction, int16_t movement) { | |||
There was a problem hiding this comment.
only real changes in this PR are within this function
| } else { | ||
| if (direction == 3) ttxt_instance.scroll(); | ||
| } else { | ||
| canvas->setPenColor(tbg); |
| break; | ||
| case 3: // Up | ||
| canvas->scroll(0, -movement); | ||
| case 4: // positive X |
There was a problem hiding this comment.
Acorn's version of this command supports directions 4-7, whose behaviour varies depending on the current cursorBehaviour variable, as set via VDU 23,16
since we have partial support for cursorBehaviour it makes some sense to implement these values
| if (movement == 0) { | ||
| if (moveX != 0) { | ||
| movement = fontW; | ||
| } else { | ||
| movement = fontH; | ||
| } | ||
| } |
There was a problem hiding this comment.
Acorn's version of this command differs to ours with respect to how the movement value is interpreted. they only support 0 and 1, where 0 indicates movement by a single character, and 1 by a single byte (which means a variable number of pixels depending on screen mode). values greater than 1 are treated as if they were 1
our version treats the movement value as a number of pixels. this adds in support for 0 to indicate "whole character", which gives us slightly better compatibility with Acorn's version
fixes scrolling background colour issue - the new area of screen will now always be filled with the current text background colour
also adds support for movement directions 4-7, which move dependent upon the currently set cursor behaviour bits (see VDU 23,16)
adds support for movement amount of 0, to indicate move by 1 character in the given direction (as per Acorn’s implementation)
fixes #58