diff options
Diffstat (limited to 'atk16_emu/cli.py')
| -rw-r--r-- | atk16_emu/cli.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/atk16_emu/cli.py b/atk16_emu/cli.py index fcea56b..9cb268a 100644 --- a/atk16_emu/cli.py +++ b/atk16_emu/cli.py @@ -7,24 +7,29 @@ from .debugger import Debugger class Options: rom_image_path: str | None debugger_enabled: bool + peripherals_enabled: bool options = Options( rom_image_path=None, debugger_enabled=False, + peripherals_enabled=True, ) def print_help(): - print("Usage: emu_cli.py [-d] [-h|--help] <rom_path>") + print("Usage: emu_cli.py [-d] [-n] [-h|--help] <rom_path>") print("") print("Options:") print(" <rom_path>: path to the rom image") print(" -h: print help") print(" -d: enable debugger") + print(" -n: no peripherals (useful for automated testing)") def main(): for arg in sys.argv[1:]: if arg == "-d": options.debugger_enabled = True + elif arg == "-n": + options.peripherals_enabled = False elif arg == "-h" or arg == "--help" or arg == "-?": print_help() sys.exit(0) @@ -43,7 +48,7 @@ def main(): with open(options.rom_image_path, "rb") as f: rom_image = bytearray(f.read()) - machine = Machine() + machine = Machine(options.peripherals_enabled) machine.load_rom_image(rom_image) machine.reset() machine.run_until_halted() @@ -54,7 +59,7 @@ def main(): machine.print_state_summary() else: - debugger = Debugger() + debugger = Debugger(options.peripherals_enabled) debugger.load_rom_image(options.rom_image_path) debugger.activate() |
