From 5beb06e0f9618930b17500da29cb37ecd9690ed7 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 7 May 2024 20:04:04 -0400 Subject: fig-emulator-gb: Remove SCCs --- fig-emulator-gb/src/Fig/Emulator/GB/CPU/Instruction.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'fig-emulator-gb/src/Fig/Emulator') diff --git a/fig-emulator-gb/src/Fig/Emulator/GB/CPU/Instruction.hs b/fig-emulator-gb/src/Fig/Emulator/GB/CPU/Instruction.hs index d7d9caa..002d4e0 100644 --- a/fig-emulator-gb/src/Fig/Emulator/GB/CPU/Instruction.hs +++ b/fig-emulator-gb/src/Fig/Emulator/GB/CPU/Instruction.hs @@ -209,24 +209,24 @@ data Instruction readInstruction :: Bus.Bus -> Addr -> IO (Instruction, Addr) -readInstruction b a = {-# SCC "TheWholeWorldOfDecodingcraft" #-} do - op <- {-# SCC "TheDecodeBusRead" #-} Bus.read b a >>= \case +readInstruction b a = do + op <- Bus.read b a >>= \case Just o -> pure o Nothing -> throwM . DecodeError $ mconcat [ "failed to read opcode at unmapped address " , pretty a ] - let blk = {-# SCC "TheDecodeBlk" #-} w8bits2 7 op - let bot3 = {-# SCC "TheDecodeBot3" #-} w8bits3 2 op - let bot4 = {-# SCC "TheDecodeBot4" #-} w8bits4 3 op - let no i = {-# SCC "TheDecodeNo" #-} pure (i, a + 1) - let imm8 f = {-# SCC "TheDecodeImm8" #-} do + let blk = w8bits2 7 op + let bot3 = w8bits3 2 op + let bot4 = w8bits4 3 op + let no i = pure (i, a + 1) + let imm8 f = do x <- readImm8 b $ a + 1 pure (f x, a + 2) - let imm16 f = {-# SCC "TheDecodeImm16" #-} do + let imm16 f = do x <- readImm16 b $ a + 1 pure (f x, a + 3) - {-# SCC "TheBigDecodeCaseTbh" #-} case {-# SCC "TheDecodeTuple" #-} (op, blk, bot4, bot3) of + case (op, blk, bot4, bot3) of -- Block 0 (0b00000000, _, _, _) -> {-# SCC "DecodeNop" #-} no Nop -- cgit v1.2.3