From 2531ce62b4fddae4fa995aeb31a288f3f4dab6b0 Mon Sep 17 00:00:00 2001 From: tudnai Date: Fri, 28 Oct 2022 11:51:49 -0700 Subject: [PATCH] Step one instruction (Step In) --- A2Mac/DebuggerWindowController.swift | 19 +++++-------------- src/cpu/6502.h | 1 + 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/A2Mac/DebuggerWindowController.swift b/A2Mac/DebuggerWindowController.swift index 5d05569..40240ca 100644 --- a/A2Mac/DebuggerWindowController.swift +++ b/A2Mac/DebuggerWindowController.swift @@ -54,36 +54,27 @@ class DebuggerToolBarController: NSWindowController, NSWindowDelegate { @IBAction func Step_Over(_ sender: Any) { - switch cpuState { - case cpuState_halted: - ViewController.current?.Pause(sender) - - case cpuState_running: - ViewController.current?.Pause(sender) - - default: - break - } } @IBAction func Step_In(_ sender: Any) { - ViewController.current?.Reset(sender) + m6502_Step() + // TODO: This should be in Debugger! + if let debugger = DebuggerViewController.shared { + debugger.Update() + } } @IBAction func Step_Out(_ sender: Any) { - ViewController.current?.textDisplay.setSelectedRange(NSRange()) } @IBAction func SetBreakPoint(_ sender: Any) { - ViewController.current?.Copy() } @IBAction func DisableBreakPoint(_ sender: Any) { - ViewController.current?.Paste() } diff --git a/src/cpu/6502.h b/src/cpu/6502.h index 424c8c9..7ca5ae3 100644 --- a/src/cpu/6502.h +++ b/src/cpu/6502.h @@ -220,6 +220,7 @@ extern void rom_loadFile( const char * bundlePath, const char * filename ); extern void tst6502(void); extern void m6502_ColdReset( const char * bundlePath, const char * romFilePath ); extern void m6502_Run(void); +INLINE int m6502_Step(void); extern void interrupt_IRQ(void); extern void interrupt_NMI(void);