Skip to content

Commit

Permalink
and lcd too
Browse files Browse the repository at this point in the history
  • Loading branch information
celerizer committed Oct 29, 2024
1 parent 05f6118 commit 4df513c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions devices/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ void h8_lcd_read(h8_device_t *device, h8_byte_t *dst)
else if (m_lcd->data_mode)
{
/* Data mode read -- retreive raw VRAM bytes */
dst->u = m_lcd->vram[m_lcd->y * 0x0100 +
m_lcd->x * 2 +
m_lcd->second_read ? 1 : 0];
unsigned offset = m_lcd->y * 0x0100 +
m_lcd->x * 2 +
(m_lcd->second_write_data ? 1 : 0);

dst->u = m_lcd->vram[offset];

/* If we are retreiving the second byte, increment only the X address */
if (m_lcd->second_read)
Expand Down

0 comments on commit 4df513c

Please sign in to comment.