SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit ecaa92f853edaad3bda08a41ba3dfb1168c153bb parent cb33119114f9479f41b10e61c5752925d3078864 Author: Lior Halphon <LIJI32@gmail.com> Date: Wed, 28 Sep 2022 20:11:17 +0300 Switch SameBoy from paused to debugger-paused on console input Diffstat:
| M | Cocoa/Document.m | 16 | +++++++++++++++- |
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/Cocoa/Document.m b/Cocoa/Document.m @@ -74,6 +74,7 @@ enum model { bool fullScreen; bool in_sync_input; + bool _debuggerCommandWhilePaused; HFController *hex_controller; NSString *lastConsoleInput; @@ -1323,6 +1324,13 @@ static bool is_path_writeable(const char *path) - (IBAction)consoleInput:(NSTextField *)sender { + if (!master && !running && !GB_debugger_is_stopped(&gb)) { + _debuggerCommandWhilePaused = true; + GB_debugger_break(&gb); + [self start]; + return; + } + NSString *line = [sender stringValue]; if ([line isEqualToString:@""] && lastConsoleInput) { line = lastConsoleInput; @@ -1398,9 +1406,15 @@ static bool is_path_writeable(const char *path) [audioLock lock]; [audioLock signal]; [audioLock unlock]; + in_sync_input = true; [self updateSideView]; [self log:">"]; - in_sync_input = true; + if (_debuggerCommandWhilePaused) { + _debuggerCommandWhilePaused = false; + dispatch_async(dispatch_get_main_queue(), ^{ + [self consoleInput:self.consoleInput]; + }); + } [has_debugger_input lockWhenCondition:1]; NSString *input = [debugger_input_queue firstObject]; [debugger_input_queue removeObjectAtIndex:0];
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.