GUI: Added support running instead of just single stepping
This commit is contained in:
parent
5595ea91f2
commit
2d4c021130
26
gui.c
26
gui.c
@ -64,7 +64,6 @@ char *tab_name[]={"Overview","Memory","Internal"};
|
||||
unsigned int CURRENT_TAB=0;
|
||||
|
||||
enum CPU_STATE_t CPU_STATE=SINGLE_STEPPING;
|
||||
//enum CPU_STATE_t CPU_STATE=STOPPED;
|
||||
|
||||
void update_tabs(){
|
||||
wattron(tabs,A_BOLD);
|
||||
@ -170,7 +169,7 @@ int gui_error(char *str){
|
||||
}
|
||||
|
||||
int update_general_disas(struct simdata_t *simdata){
|
||||
wclear(general_disas);
|
||||
werase(general_disas);
|
||||
int width,height;
|
||||
getmaxyx(general_disas,height,width);
|
||||
box(general_disas, 0 , 0);
|
||||
@ -220,7 +219,6 @@ int update_general_disas(struct simdata_t *simdata){
|
||||
}
|
||||
|
||||
int update_general_stack(struct simdata_t *simdata){
|
||||
wclear(general_stack);
|
||||
int width,height;
|
||||
getmaxyx(general_stack,height,width);
|
||||
box(general_stack, 0 , 0);
|
||||
@ -277,7 +275,6 @@ int update_general_stack(struct simdata_t *simdata){
|
||||
}
|
||||
|
||||
int update_general_memdump(struct simdata_t *simdata){
|
||||
wclear(general_memdump);
|
||||
int width,height;
|
||||
getmaxyx(general_memdump,height,width);
|
||||
box(general_memdump, 0 , 0);
|
||||
@ -316,8 +313,13 @@ int update_general_memdump(struct simdata_t *simdata){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int clear_back_window=1;
|
||||
|
||||
int update_gui(struct simdata_t *simdata){
|
||||
if(clear_back_window){
|
||||
clear();
|
||||
clear_back_window=0;
|
||||
}
|
||||
update_tabs();
|
||||
if(update_general_memdump(simdata))
|
||||
return 1;
|
||||
@ -331,8 +333,22 @@ int update_gui(struct simdata_t *simdata){
|
||||
}
|
||||
|
||||
int gui_continue_request(){
|
||||
if(getch()==ERR)
|
||||
char inch;
|
||||
if(((inch=getch())==ERR)&&CPU_STATE==SINGLE_STEPPING)
|
||||
return 1;
|
||||
switch(inch){
|
||||
case 'r':
|
||||
if(CPU_STATE==RUNNING){
|
||||
CPU_STATE=SINGLE_STEPPING;
|
||||
nodelay(stdscr, FALSE);
|
||||
}else{
|
||||
CPU_STATE=RUNNING;
|
||||
nodelay(stdscr, TRUE);
|
||||
}
|
||||
break;
|
||||
case 'q':
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user