From 3d6f7887d8e85fb601c70b4e69a85bf4c61b773e Mon Sep 17 00:00:00 2001 From: pingu Date: Thu, 2 Apr 2026 11:49:10 +0200 Subject: [PATCH] Yup --- src/GBC/CPU.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GBC/CPU.hs b/src/GBC/CPU.hs index 257105d..494ad30 100644 --- a/src/GBC/CPU.hs +++ b/src/GBC/CPU.hs @@ -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