summaryrefslogtreecommitdiff
path: root/fig-emulator-gb/src/Fig/Emulator/GB/Component/Serial.hs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-06-01 19:07:25 -0400
committerLLLL Colonq <llll@colonq>2025-06-01 19:07:25 -0400
commit4bc8bd58e6f9a6ca509d4e6869ba10c65145775d (patch)
tree5bc97cc01e737f9cacba1f7c13570ce7846acf36 /fig-emulator-gb/src/Fig/Emulator/GB/Component/Serial.hs
parentf95d9bbde51ee26468177b2d34c669d9689fbea4 (diff)
Remove fig-emulator-gb
Diffstat (limited to 'fig-emulator-gb/src/Fig/Emulator/GB/Component/Serial.hs')
-rw-r--r--fig-emulator-gb/src/Fig/Emulator/GB/Component/Serial.hs35
1 files changed, 0 insertions, 35 deletions
diff --git a/fig-emulator-gb/src/Fig/Emulator/GB/Component/Serial.hs b/fig-emulator-gb/src/Fig/Emulator/GB/Component/Serial.hs
deleted file mode 100644
index 3912e5d..0000000
--- a/fig-emulator-gb/src/Fig/Emulator/GB/Component/Serial.hs
+++ /dev/null
@@ -1,35 +0,0 @@
-module Fig.Emulator.GB.Component.Serial where
-
-import Fig.Prelude
-
-import GHC.IO.Handle (hPutChar)
-
-import Data.Char (chr)
-
-import Fig.Emulator.GB.Utils
-import Fig.Emulator.GB.Bus
-
-newtype SerialError = SerialError Text
- deriving Show
-instance Exception SerialError
-instance Pretty SerialError where
- pretty (SerialError b) = mconcat
- [ "serial error: "
- , b
- ]
-
-compSerial :: Maybe Handle -> Component
-compSerial mh = Component
- { compState = ()
- , compMatches = (== 0xff01)
- , compUpdate = \s _ -> pure s
- , compWrite = \s _ v -> do
- log $ mconcat
- [ "wrote serial byte: ", tshow $ chr $ fromIntegral v
- ]
- case mh of
- Nothing -> pure ()
- Just h -> liftIO . hPutChar h . chr $ fromIntegral v
- pure s
- , compRead = \_ _ -> pure 0x00
- }