From 2fec6e70b2b583299bcbbda0b596a5a9c275e93e Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Mon, 13 May 2024 03:39:51 -0400 Subject: fig-emulator-gb: Debugging the PPU --- .../src/Fig/Emulator/GB/Component/Misc.hs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs (limited to 'fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs') diff --git a/fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs b/fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs new file mode 100644 index 0000000..be15e56 --- /dev/null +++ b/fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs @@ -0,0 +1,24 @@ +module Fig.Emulator.GB.Component.Misc where + +import Fig.Prelude + +import Fig.Emulator.GB.Utils +import Fig.Emulator.GB.Bus + +newtype MiscError = MiscError Text + deriving Show +instance Exception MiscError +instance Pretty MiscError where + pretty (MiscError b) = mconcat + [ "misc component error: " + , b + ] + +compMisc :: Component +compMisc = Component + { compState = () + , compMatches = (== 0xff4d) + , compUpdate = \s _ -> pure s + , compWrite = \s _ _ -> pure s + , compRead = \_ _ -> pure 0x00 + } -- cgit v1.2.3