Skip to content

Commit

Permalink
Adds LCD cursor support (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
giulioz authored Apr 20, 2024
1 parent 9a96379 commit a7bee1c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void LCD_UnInit(void)
uint32_t lcd_col1 = 0x000000;
uint32_t lcd_col2 = 0x0050c8;

void LCD_FontRenderStandard(int32_t x, int32_t y, uint8_t ch)
void LCD_FontRenderStandard(int32_t x, int32_t y, uint8_t ch, bool overlay = false)
{
uint8_t* f;
if (ch >= 16)
Expand All @@ -297,7 +297,10 @@ void LCD_FontRenderStandard(int32_t x, int32_t y, uint8_t ch)
{
for (int jj = 0; jj < 5; jj++)
{
lcd_buffer[xx+ii][yy+jj] = col;
if (overlay)
lcd_buffer[xx+ii][yy+jj] &= col;
else
lcd_buffer[xx+ii][yy+jj] = col;
}
}
}
Expand Down Expand Up @@ -446,6 +449,12 @@ void LCD_Update(void)
LCD_FontRenderStandard(4 + i * 50, 4 + j * 34, ch);
}
}

// cursor
int j = LCD_DD_RAM % 0x40;
int i = LCD_DD_RAM / 0x40;
if (i < 2 && j < 24 && LCD_C)
LCD_FontRenderStandard(4 + i * 50, 4 + j * 34, '_', true);
}
else
{
Expand Down

2 comments on commit a7bee1c

@Karmeck
Copy link

Choose a reason for hiding this comment

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

What is this used for? Like, to click things?

@giulioz
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for the JV880 only

image

Please sign in to comment.