mirror of https://github.com/bsnes-emu/bsnes.git
Made the command line debugger output “>” before inputs, added special magic sequence to break the debugger from stdin
This commit is contained in:
parent
0c0ca8e862
commit
08efb46d41
|
@ -62,6 +62,9 @@ static char *default_input_callback(GB_gameboy_t *gb)
|
|||
{
|
||||
char *expression = NULL;
|
||||
size_t size = 0;
|
||||
if (gb->debug_stopped) {
|
||||
printf(">");
|
||||
}
|
||||
|
||||
if (getline(&expression, &size, stdin) == -1) {
|
||||
/* The user doesn't have STDIN or used ^D. We make sure the program keeps running. */
|
||||
|
@ -77,6 +80,12 @@ static char *default_input_callback(GB_gameboy_t *gb)
|
|||
if (expression[length - 1] == '\n') {
|
||||
expression[length - 1] = 0;
|
||||
}
|
||||
|
||||
if (expression[0] == '\x03') {
|
||||
gb->debug_stopped = true;
|
||||
free(expression);
|
||||
return strdup("");
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue