Yup
This commit is contained in:
@@ -425,7 +425,15 @@ execute cpu = \case
|
||||
_fHalfCarry = value .&. 16 + fromIntegral v .&. 16 > 16, -- TODO: check if this still works out
|
||||
_fCarry = value > newValue
|
||||
}
|
||||
|
||||
JPNN v -> cpu & pc .~ v
|
||||
JPHL -> cpu & pc .~ cpu ^. hl
|
||||
JPCCNN v _f op -> if op $ cpu ^. _f then cpu & pc .~ v else cpu
|
||||
JRE v -> let target = fromIntegral $ (fromIntegral (cpu ^. pc) :: Integer) + fromIntegral v in cpu & pc .~ target
|
||||
JRCCE v _f op -> if op $ cpu ^. _f then
|
||||
let target = fromIntegral $ (fromIntegral (cpu ^. pc) :: Integer) + fromIntegral v in
|
||||
cpu & pc .~ target
|
||||
else
|
||||
cpu
|
||||
where
|
||||
add :: Word8 -> Word8 -> Bool -> (Word8, FlagRegister)
|
||||
add o n _c = let new = o + n + if _c then 1 else 0
|
||||
|
||||
Reference in New Issue
Block a user