summaryrefslogtreecommitdiff
path: root/fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-05-13 03:39:51 -0400
committerLLLL Colonq <llll@colonq>2024-05-13 03:39:51 -0400
commit2fec6e70b2b583299bcbbda0b596a5a9c275e93e (patch)
tree02e9676a4c3923e49818ec150460bbeaa322dc17 /fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs
parentb677a422d3d434a45e9dcdc189c40f8224cc8dc8 (diff)
fig-emulator-gb: Debugging the PPU
Diffstat (limited to 'fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs')
-rw-r--r--fig-emulator-gb/src/Fig/Emulator/GB/Component/Misc.hs24
1 files changed, 24 insertions, 0 deletions
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
+ }