From: Hugo Villeneuve Date: Fri, 17 Jan 2014 04:22:46 +0000 (-0500) Subject: Fix error when toggling memory display viewing on/off X-Git-Tag: v2.0.0~4 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=9417a6bc0bbc72d367c3ee84274a4eac1bf24a7e;p=emu8051.git Fix error when toggling memory display viewing on/off Only the first two rows were displayed. The crc_init variable was not handled correctly. --- diff --git a/src/gtk/memwin.c b/src/gtk/memwin.c index 56d728b..dae27a9 100644 --- a/src/gtk/memwin.c +++ b/src/gtk/memwin.c @@ -246,6 +246,8 @@ memwin_init(char *title, int memory_id) GtkWidget *scrollwin; GtkListStore *store; + log_debug("memwin_init"); + COL_ASCII = cfg->bytes_per_row + 1; N_COLUMNS = COL_ASCII + 1; @@ -305,9 +307,8 @@ memwin_row_changed(int memory_id, int row, unsigned int address) (crc_new == memwin_infos->crc[row])) { row_changed = false; } else { - memwin_infos->crc_init = true; memwin_infos->crc[row] = crc_new; - log_debug(" Row %02d value(s) change", row); + log_debug(" Row %02d value(s) change", row); row_changed = true; } @@ -322,6 +323,8 @@ memwin_refresh(int memory_id) unsigned int Address = 0; GtkListStore *store; + log_debug("memwin_refresh"); + memwin_infos_select(memory_id); store = GTK_LIST_STORE(gtk_tree_view_get_model( @@ -377,4 +380,7 @@ memwin_refresh(int memory_id) gtk_list_store_set(store, &iter, COL_ASCII, ascii_str, -1); } } + + /* At this point we know all rows crc have been initialized. */ + memwin_infos->crc_init = true; }