diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-02-24 19:04:00 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-02-24 19:04:00 +0200 |
| commit | 0a2cf66672364ed555c85682e948cff0b54c8f35 (patch) | |
| tree | 249a426faf5e7ba0d218176f651dca6c635a3705 /atk16_emu/cli.py | |
| parent | 416e896956d3b05793337da6609fe1544797c0a9 (diff) | |
Fix bugs, add basic debugger
Diffstat (limited to 'atk16_emu/cli.py')
| -rw-r--r-- | atk16_emu/cli.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/atk16_emu/cli.py b/atk16_emu/cli.py index 7aa4b6b..d6bd46b 100644 --- a/atk16_emu/cli.py +++ b/atk16_emu/cli.py @@ -1,6 +1,7 @@ import sys from dataclasses import dataclass from .emu import Machine +from .debugger import Debugger @dataclass class Options: @@ -43,12 +44,18 @@ def load_rom_image_from_path(path: str) -> bytearray: rom_image = load_rom_image_from_path(options.rom_image_path) -machine = Machine() -machine.load_rom_image(rom_image) -machine.reset() -machine.run_until_halted() +if not options.debugger_enabled: + machine = Machine() + machine.load_rom_image(rom_image) + machine.reset() + machine.run_until_halted() -print("Machine halted.") -print("===============") + print("Machine halted.") + print("===============") -machine.print_state_summary() + machine.print_state_summary() + +else: + debugger = Debugger() + debugger.load_rom_image(rom_image) + debugger.activate() |
