From 5eeebd20bf450b41a0ca7c1cf0a6162d843f6ac8 Mon Sep 17 00:00:00 2001 From: Lucian Mogosanu Date: Fri, 12 Dec 2014 00:20:37 +0200 Subject: [PATCH] Z80: CPU: Add Prefixed flag --- src/Data/Z80/CPU.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 } -- 1.7.10.4