diff options
| author | LLLL Colonq <llll@colonq> | 2024-04-09 22:35:42 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-04-09 22:35:42 -0400 |
| commit | 3a0a7b0a89fd841edd5f25f79cdb877051d0e948 (patch) | |
| tree | f314021ddd72c3b528c42c154f8aee002a5c0e02 /fig-emulator-gb/main/Main.hs | |
| parent | 70d50561b19b4161b85ec1b00c31e5678502688b (diff) | |
End-of-stream emulator WIP
Diffstat (limited to 'fig-emulator-gb/main/Main.hs')
| -rw-r--r-- | fig-emulator-gb/main/Main.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fig-emulator-gb/main/Main.hs b/fig-emulator-gb/main/Main.hs new file mode 100644 index 0000000..33bf382 --- /dev/null +++ b/fig-emulator-gb/main/Main.hs @@ -0,0 +1,29 @@ +{-# Language ApplicativeDo #-} + +module Main where + +import Fig.Prelude + +import Options.Applicative + +import qualified Data.ByteString as BS + +import Fig.Emulator.GB.CPU + +newtype Options = Options + { romPath :: FilePath + } deriving Show + +parseOptions :: Parser Options +parseOptions = do + romPath <- argument str (metavar "PATH") + pure Options{..} + +main :: IO () +main = do + opts <- execParser $ info (parseOptions <**> helper) + ( fullDesc + <> header "fig-emulator-gb - Game Boy emulator" + ) + rom <- BS.readFile $ romPath opts + testRun rom |
