From: Lucian Mogosanu Date: Thu, 11 Dec 2014 22:20:37 +0000 (+0200) Subject: Z80: CPU: Add Prefixed flag X-Git-Url: https://git.mogosanu.ro/?a=commitdiff_plain;h=5eeebd20bf450b41a0ca7c1cf0a6162d843f6ac8;p=z80.git Z80: CPU: Add Prefixed flag --- diff --git a/src/Data/Z80/CPU.hs b/src/Data/Z80/CPU.hs index ca13a47..e40ed00 100644 --- a/src/Data/Z80/CPU.hs +++ b/src/Data/Z80/CPU.hs @@ -17,9 +17,20 @@ data CPU = CPU , 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 } @@ -41,3 +52,6 @@ setPC cpu w = cpu { pc = 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 }