From 8f57fac3ee2b069a5a85ae8b689fce0b48becaf9 Mon Sep 17 00:00:00 2001 From: "Adrian.Conlon" Date: Thu, 29 Jun 2017 21:35:52 +0100 Subject: [PATCH] Use the same optimisation techniques on the Z80 header. Up to 233Mhz now. Signed-off-by: Adrian.Conlon --- Z80/inc/Z80.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Z80/inc/Z80.h b/Z80/inc/Z80.h index 0d27cbd..5e692b1 100644 --- a/Z80/inc/Z80.h +++ b/Z80/inc/Z80.h @@ -181,12 +181,12 @@ namespace EightBit { case 5: return HL2().low; case 6: - if (m_displaced) { - m_displacement = fetchByte(); - return DISPLACED(); + if (!m_displaced) { + m_memory.ADDRESS() = HL(); + return m_memory.reference(); } - m_memory.ADDRESS() = HL(); - return m_memory.reference(); + m_displacement = fetchByte(); + return DISPLACED(); case 7: return a; default: @@ -232,13 +232,12 @@ namespace EightBit { } register16_t& HL2() { - if (m_displaced) { - if (m_prefixDD) - return IX(); - // Must be FD prefix - return IY(); - } - return HL(); + if (!m_displaced) + return HL(); + if (m_prefixDD) + return IX(); + // Must be FD prefix + return IY(); } register16_t& RP2(int rp) {