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

VIDEO_CURSOR_POSX should be 4-byte aligned #36

Open
Ryzee119 opened this issue May 20, 2020 · 0 comments
Open

VIDEO_CURSOR_POSX should be 4-byte aligned #36

Ryzee119 opened this issue May 20, 2020 · 0 comments

Comments

@Ryzee119
Copy link

Ryzee119 commented May 20, 2020

There's instances in the cromwell code base of cursor offsets that are not aligned on 4 byte boundaries.
The font render code does not check for this and results in incorrect bytes being set in the framebuffer. In some cases it could even result in writing to areas outside of the frame buffer.

As a minimum, this function should check VIDEO_CURSOR_POSX is divisible by 4 and fix before passing the framebuffer pointers.

void BootVideoChunkedPrint(const char * szBuffer) {

The most prominent issue of this is the below comparisons in the Text menu titles. The colour should be purple.
Bad:
cromwell_bad

Cursor Positions Adjusted correctly:
cromwell_good

An example of bad cursor position is here. The above example was created by changing X cursor position to 72.

VIDEO_CURSOR_POSX=75;
VIDEO_CURSOR_POSY=125;

@Ryzee119 Ryzee119 changed the title VIDEO_CURSOR_POSX and VIDEO_CURSOR_POSY Should be 4-byte aligned VIDEO_CURSOR_POSX should be 4-byte aligned May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant