homelab: fix array OOB crash

This commit is contained in:
hap 2024-10-04 18:03:40 +02:00
parent 81362b5700
commit 878081bcba

View File

@ -251,10 +251,10 @@ u8 homelab2_state::memE000_r(offs_t offset)
u8 gfx;
if (m_screenshadow_is_text_mode)
{
const int vramRelIndex0 = offset % 0x400; // Character address in video ram First character in 0x001
const int row8_index0 = (offset - 1) / 0x400; // Row index in char [0-7]
u8 const chr = m_vram[vramRelIndex0]; // get char in videoram
gfx = m_p_chargen[chr | (row8_index0 << 8)]; // get dot pattern in chargen
const int vramRelIndex0 = offset & 0x3ff; // Character address in video ram First character in 0x001
const int row8_index0 = ((offset - 1) & 0x1c00) >> 10; // Row index in char [0-7]
u8 const chr = m_vram[vramRelIndex0]; // get char in videoram
gfx = m_p_chargen[chr | (row8_index0 << 8)]; // get dot pattern in chargen
}
else
{