From 4b87e6879228a3491609254949c41a2405c29ad5 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Thu, 11 Feb 2021 00:55:44 +0300 Subject: Library test. --- Main.hs | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index 48920a4..7b76428 100644 --- a/Main.hs +++ b/Main.hs @@ -1,6 +1,36 @@ module Main where +import Options.Applicative import Suem +config :: Parser Config +config = Config + <$> option auto + ( long "frequency" + <> short 'f' + <> metavar "HERTZ" + <> showDefault + <> value 8000000 + <> help "Machine frequency in Hz" ) + <*> option auto + ( long "ram" + <> short 'm' + <> metavar "RAM_SIZE" + <> showDefault + <> value (8 * 1024 * 1024) + <> help "Available RAM in bytes" ) + <*> option auto + ( long "rom" + <> short 'r' + <> metavar "ROM_PATH" + <> showDefault + <> value "rom.bin" + <> help "Path to file to load into ROM" ) + main :: IO () -main = printROM +main = suem =<< execParser opts + where + opts = info (config <**> helper) + ( fullDesc + <> progDesc "Emulator of Suen, machine on M68000" + <> header "suem - Suen emulator" ) -- cgit v1.2.3