summaryrefslogtreecommitdiff
path: root/fig-emulator-gb/main/Main.hs
blob: 33bf382450a74f8460cb3f3bfcaeaad4a249a42a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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