From 12e98b8f4374aa7124eec297fb8c5e63b990074e Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 23 Jul 2023 07:10:49 +1000 Subject: [PATCH] apple/dafb.cpp: Handle debugger reads better. --- src/mame/apple/dafb.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mame/apple/dafb.cpp b/src/mame/apple/dafb.cpp index 478ac9e6460..29b98d9ded6 100644 --- a/src/mame/apple/dafb.cpp +++ b/src/mame/apple/dafb.cpp @@ -624,17 +624,21 @@ u32 dafb_base::ramdac_r(offs_t offset) switch (offset << 2) { case 0: - m_pal_idx = 0; + if (!machine().side_effects_disabled()) + { + m_pal_idx = 0; + } return m_pal_address; case 0x10: { - pen_t entry = m_palette->pen(m_pal_address); + pen_t const entry = m_palette->pen(m_pal_address); + u8 const idx = m_pal_idx; if (!machine().side_effects_disabled()) { m_pal_idx++; } - switch (m_pal_idx - 1) + switch (idx) { case 0: return (entry >> 16) & 0xff;