Skip to content

Added a column-major demo for lcddrvce #623

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZERICO2005
Copy link
Contributor

Rewrite of the previous attempt: #609

This demo shows how lcddrvce can be used to set the screen to column-major mode. It is similar to the graphx/buffered_cube example, but shows how column-major mode can be used to remove diagonal screen tearing.

Not exactly sure what comments I should add to the line drawing code.

const int dD_jump = 2 * (dY - dX);
dY *= 2;

uint8_t* buffer = (uint8_t*)lcd_LpBase + (x0 * LCD_HEIGHT) + y0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably use (uint8_t*)gfx_vbuffer or &gfx_vbuffer[0][0] in an example like this, because lcd_LpBase is only semi-documented in relation to GraphX and it's not immediately clear what it means.

const uint8_t color = line_color;

uint24_t x = (uint24_t)(x1 - x0);
for (; x --> 0;) {
Copy link
Contributor

@calc84maniac calc84maniac Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cute and all but probably doesn't belong in an example. How about this equivalent (well, equivalent because x isn't used inside the loop):
for(uint24_t x = (uint24_t)dX; x > 0; x--) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants