Add view menu option to view/hide SFR memory dump window
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 31 Oct 2013 00:51:11 +0000 (20:51 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 6 Nov 2013 02:55:34 +0000 (21:55 -0500)
src/viewmenu.c

index 99fa0ab..3377329 100644 (file)
@@ -71,6 +71,18 @@ void toggle_int_memory(GtkWidget *widget, gpointer data)
        emugtk_restart_gui();
 }
 
+void toggle_sfr_memory(GtkWidget *widget, gpointer data)
+{
+       if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) {
+               log_info("  View SFR memory");
+               cfg->view_sfr_memory = 1;
+       } else {
+               cfg->view_sfr_memory = 0;
+       }
+
+       emugtk_restart_gui();
+}
+
 void toggle_ext_memory(GtkWidget *widget, gpointer data)
 {
        if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) {
@@ -167,6 +179,13 @@ ViewAddMenu(GtkWidget *menu_bar)
        g_signal_connect(G_OBJECT(item), "activate",
                         G_CALLBACK(toggle_int_memory), NULL);
 
+       item = gtk_check_menu_item_new_with_label("SFR Memory");
+       gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
+                                      cfg->view_sfr_memory);
+       g_signal_connect(G_OBJECT(item), "activate",
+                        G_CALLBACK(toggle_sfr_memory), NULL);
+
        item = gtk_check_menu_item_new_with_label("External Memory");
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),