Step_Out & Step_Over

This commit is contained in:
tudnai 2022-10-30 16:50:02 -07:00
parent 0a2b87964e
commit 708099e45d
4 changed files with 33 additions and 1 deletions

View File

@ -229,7 +229,6 @@ N V - B D I Z C
DisplayStack()
DisplayMemory()
DisplayDisassembly()
}

View File

@ -131,6 +131,19 @@ class DebuggerWindowController: NSWindowController, NSWindowDelegate {
@IBAction func Step_Over(_ sender: Any) {
let sp = m6502.SP
m6502_Step()
while m6502.SP < 0xFF && m6502.SP < sp {
m6502_Step()
}
// TODO: This should be in Debugger!
if let debugger = DebuggerViewController.shared {
debugger.Update()
}
// TODO: Update Screen and speaker etc
}
@ -140,10 +153,25 @@ class DebuggerWindowController: NSWindowController, NSWindowDelegate {
if let debugger = DebuggerViewController.shared {
debugger.Update()
}
// TODO: Update Screen and speaker etc
}
@IBAction func Step_Out(_ sender: Any) {
let sp = m6502.SP
m6502_Step()
while m6502.SP < 0xFF && m6502.SP <= sp {
m6502_Step()
}
// TODO: This should be in Debugger!
if let debugger = DebuggerViewController.shared {
debugger.Update()
}
// TODO: Update Screen and speaker etc
}

View File

@ -62,6 +62,8 @@ void _disPrintf( char * s, const size_t n, const char * fmt, ... ) {
// }
}
INLINE uint8_t memread8_low( uint16_t addr );
void _disNewInstruction(void) {
// if ( m6502.dbgLevel.trace ) {
memset( &disassembly, 0, sizeof(disassembly) );
@ -73,6 +75,8 @@ void _disNewInstruction(void) {
// disassembly.oper[0] = '\0';
// disassembly.comment[0] = '\0';
// }
disassembly.op = memread8_low(m6502.PC);
}

View File

@ -30,6 +30,7 @@
typedef struct disassembly_s {
uint64_t clk; // clock time
uint8_t op; // opcode
char addr[5]; // 4 digits + \0
char opcode[4 * 3 + 1]; // max 4 bytes * (2 digits + 1 space) + \0
char * pOpcode; // pointer for opcode string builder