GUI: slight fix on input handling

This commit is contained in:
(Tim) Efthimis Kritikos 2024-02-05 12:34:28 +00:00
parent 2d4c021130
commit 1f3f26d91e

39
gui.c
View File

@ -334,20 +334,31 @@ int update_gui(struct simdata_t *simdata){
int gui_continue_request(){ int gui_continue_request(){
char inch; char inch;
if(((inch=getch())==ERR)&&CPU_STATE==SINGLE_STEPPING) int release=0;
return 1; while(release==0){
switch(inch){ if(((inch=getch())==ERR)){
case 'r': if(CPU_STATE==SINGLE_STEPPING)
if(CPU_STATE==RUNNING){ return 1;
CPU_STATE=SINGLE_STEPPING; else
nodelay(stdscr, FALSE); release=1;
}else{ }
CPU_STATE=RUNNING; switch(inch){
nodelay(stdscr, TRUE); case 'r':
} if(CPU_STATE==RUNNING){
break; CPU_STATE=SINGLE_STEPPING;
case 'q': nodelay(stdscr, FALSE);
return 2; }else{
CPU_STATE=RUNNING;
nodelay(stdscr, TRUE);
}
break;
case 'q':
return 2;
case '\n':
release=1;
break;
default:
}
} }
return 0; return 0;
} }