, iy :: Word16
, sp :: Word16
, pc :: Word16
+ , prefixed :: Prefixed
} deriving (Show, Eq)
--- not really into lenses so we're using those for now
+data Prefixed =
+ Unprefixed
+ | CBPrefixed
+ | EDPrefixed
+ | DDPrefixed
+ | FDPrefixed
+ | DDCBPrefixed
+ | FDCBPrefixed
+ deriving (Show, Eq)
+
+-- not really into lenses so we're using these for now
setAF, setBC, setDE, setHL :: CPU -> Word16 -> CPU
setAF cpu w = cpu { af = w }
setBC cpu w = cpu { bc = w }
setI, setR :: CPU -> Word8 -> CPU
setI cpu b = cpu { i = b }
setR cpu b = cpu { r = b }
+
+setPrefixed :: CPU -> Prefixed -> CPU
+setPrefixed cpu p = cpu { prefixed = p }