From 7e70fab3bd42fd167252edef062ff359633550b4 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 20 Oct 2013 20:46:07 -0400 Subject: [PATCH] Use single function to refresh all windows Use emugtk_UpdateDisplay() to replace individual calls to these functions: regwin_Show(); memwin_DumpD(); pgmwin_Disasm(); --- src/emugtk.c | 30 ++++++++++++------------------ src/emugtk.h | 3 +++ src/regwin.c | 5 ++--- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/emugtk.c b/src/emugtk.c index de5d48b..0711248 100644 --- a/src/emugtk.c +++ b/src/emugtk.c @@ -55,6 +55,15 @@ GtkWidget *mainwin; extern struct app_config_t *cfg; extern struct options_t options; +void +emugtk_UpdateDisplay(void) +{ + log_debug("UpdateDisplay()"); + regwin_Show(); + pgmwin_Disasm(); + memwin_DumpD(INT_MEM_ID); +} + /* Step out of running state */ static void emugtk_stop_running() @@ -63,9 +72,7 @@ emugtk_stop_running() log_info("StopRunning()"); g_source_remove(running_function_tag); running = 0; - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); + emugtk_UpdateDisplay(); } } @@ -116,9 +123,7 @@ static void emugtk_Reset(void) { cpu8051_Reset(); - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); + emugtk_UpdateDisplay(); } /* Signal ResetEvent (ResetButton) */ @@ -135,9 +140,7 @@ static void emugtk_Step(void) { cpu8051_Exec(); - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); + emugtk_UpdateDisplay(); } /* Signal RunEvent (RunButton) */ @@ -383,15 +386,6 @@ emugtk_window_init(void) gtk_widget_show_all(mainwin); } -static void -emugtk_UpdateDisplay(void) -{ - log_debug("UpdateDisplay()"); - regwin_Show(); - pgmwin_Disasm(); - memwin_DumpD(); -} - void AddMenuSeparator(GtkWidget *menu) { diff --git a/src/emugtk.h b/src/emugtk.h index 75714be..35ac1e4 100644 --- a/src/emugtk.h +++ b/src/emugtk.h @@ -30,4 +30,7 @@ AddMenuSeparator(GtkWidget *menu); void emugtk_new_file(char *file); +void +emugtk_UpdateDisplay(void); + #endif /* EMUGTK_H */ diff --git a/src/regwin.c b/src/regwin.c index e3b79d7..aaa006b 100644 --- a/src/regwin.c +++ b/src/regwin.c @@ -33,6 +33,7 @@ #include "pgmwin.h" #include "instructions_8051.h" #include "hexfile.h" +#include "emugtk.h" static GtkWidget *reglist; @@ -387,9 +388,7 @@ regwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, * Make sure to update all windows. * For example, R0-R7 values depends on internal memory values. */ - regwin_Show(); - memwin_DumpD(); - pgmwin_Disasm(); + emugtk_UpdateDisplay(); }; static void -- 2.20.1