diff --git a/Cocoa/Document.m b/Cocoa/Document.m index d1e20af7..fbd483d7 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -309,7 +309,7 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, unsigned char r, unsigned char g, un - (IBAction)consoleInput:(NSTextField *)sender { NSString *line = [sender stringValue]; - if ([line isEqualToString:@""]) { + if ([line isEqualToString:@""] && lastConsoleInput) { line = lastConsoleInput; } else if (line) { diff --git a/Core/debugger.c b/Core/debugger.c index fe490583..e2d15544 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -610,6 +610,9 @@ next_command: gb->debug_next_command = false; gb->debug_fin_command = false; input = gb->input_callback(gb); + if (!input[0]) { + goto next_command; + } char *command_string = input; char *arguments = strchr(input, ' ');