Search
lxdream.org :: lxdream :: r238:6af4cc93b137
lxdream 0.9.1
released Jun 29
Download Now
changeset238:6af4cc93b137
parent237:6f1a429c9d12
child239:e5cd6b2d4586
authornkeynes
dateFri Dec 15 10:17:08 2006 +0000 (13 years ago)
Add UI for the trace flag
src/gui/callbacks.c
src/gui/callbacks.h
src/gui/mmio_win.c
1.1 --- a/src/gui/callbacks.c Thu Dec 14 12:31:38 2006 +0000
1.2 +++ b/src/gui/callbacks.c Fri Dec 15 10:17:08 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: callbacks.c,v 1.16 2006-07-02 04:59:00 nkeynes Exp $
1.6 + * $Id: callbacks.c,v 1.17 2006-12-15 10:17:08 nkeynes Exp $
1.7 *
1.8 * All GTK callbacks go here (stubs are autogenerated by Glade)
1.9 *
1.10 @@ -27,6 +27,7 @@
1.11 #include "gui/gui.h"
1.12 #include "gdrom/gdrom.h"
1.13 #include "mem.h"
1.14 +#include "mmio.h"
1.15 #include "dreamcast.h"
1.16 #include "loader.h"
1.17
1.18 @@ -155,6 +156,16 @@
1.19 debug_win_toggle_breakpoint( data, selected_row );
1.20 }
1.21
1.22 +void on_trace_button_toggled (GtkToggleButton *button,
1.23 + gpointer user_data)
1.24 +{
1.25 + struct mmio_region *io_rgn = (struct mmio_region *)user_data;
1.26 + gboolean isActive = gtk_toggle_button_get_active(button);
1.27 + if( io_rgn != NULL ) {
1.28 + io_rgn->trace_flag = isActive ? 1 : 0;
1.29 + }
1.30 +}
1.31 +
1.32
1.33 gboolean
1.34 on_debug_win_delete_event (GtkWidget *widget,
2.1 --- a/src/gui/callbacks.h Thu Dec 14 12:31:38 2006 +0000
2.2 +++ b/src/gui/callbacks.h Fri Dec 15 10:17:08 2006 +0000
2.3 @@ -1,5 +1,5 @@
2.4 /**
2.5 - * $Id: callbacks.h,v 1.4 2005-12-25 08:24:11 nkeynes Exp $
2.6 + * $Id: callbacks.h,v 1.5 2006-12-15 10:17:08 nkeynes Exp $
2.7 *
2.8 * GTK callback declarations (stubs are autogenerated by Glade)
2.9 *
2.10 @@ -73,6 +73,10 @@
2.11 on_break_btn_clicked (GtkButton *button,
2.12 gpointer user_data);
2.13
2.14 +void
2.15 +on_trace_button_toggled (GtkToggleButton *button,
2.16 + gpointer user_data);
2.17 +
2.18 gboolean
2.19 on_debug_win_delete_event (GtkWidget *widget,
2.20 GdkEvent *event,
3.1 --- a/src/gui/mmio_win.c Thu Dec 14 12:31:38 2006 +0000
3.2 +++ b/src/gui/mmio_win.c Fri Dec 15 10:17:08 2006 +0000
3.3 @@ -1,5 +1,5 @@
3.4 /**
3.5 - * $Id: mmio_win.c,v 1.4 2006-01-02 14:47:55 nkeynes Exp $
3.6 + * $Id: mmio_win.c,v 1.5 2006-12-15 10:17:08 nkeynes Exp $
3.7 *
3.8 * Implements the MMIO register viewing window
3.9 *
3.10 @@ -19,6 +19,7 @@
3.11 #include <stdint.h>
3.12 #include <gnome.h>
3.13 #include "interface.h"
3.14 +#include "callbacks.h"
3.15 #include "gui.h"
3.16 #include "mem.h"
3.17 #include "mmio.h"
3.18 @@ -56,11 +57,13 @@
3.19 }
3.20
3.21
3.22 -static GtkCList *create_mmr_page( char *name )
3.23 +static GtkCList *create_mmr_page( char *name, struct mmio_region *io_rgn )
3.24 {
3.25 GtkCList *list;
3.26 GtkWidget *scroll;
3.27 GtkWidget *tab;
3.28 + GtkCheckButton *trace_button;
3.29 + GtkVBox *vbox;
3.30
3.31 scroll = gtk_scrolled_window_new(NULL, NULL);
3.32 gtk_widget_show( scroll );
3.33 @@ -86,8 +89,21 @@
3.34 tab = gtk_label_new(_(name));
3.35 gtk_widget_show( tab );
3.36 gtk_container_add( GTK_CONTAINER(scroll), GTK_WIDGET(list) );
3.37 - gtk_notebook_append_page( mmr_book, scroll, tab );
3.38 +
3.39 + vbox = gtk_vbox_new( FALSE, 0 );
3.40 + gtk_widget_show( GTK_WIDGET(vbox) );
3.41 + gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(scroll) );
3.42 +
3.43 + trace_button = gtk_check_button_new_with_label("Trace access");
3.44 + gtk_widget_show( GTK_WIDGET(trace_button) );
3.45 + gtk_container_add( GTK_CONTAINER(vbox), GTK_WIDGET(trace_button) );
3.46 + gtk_box_set_child_packing( GTK_BOX(vbox), GTK_WIDGET(trace_button),
3.47 + FALSE, FALSE, 0, GTK_PACK_START );
3.48 + gtk_notebook_append_page( mmr_book, vbox, tab );
3.49 gtk_object_set_data( GTK_OBJECT(mmr_win), name, list );
3.50 + g_signal_connect ((gpointer) trace_button, "toggled",
3.51 + G_CALLBACK (on_trace_button_toggled),
3.52 + io_rgn);
3.53 return list;
3.54 }
3.55
3.56 @@ -138,9 +154,9 @@
3.57 /* kill the dummy page glade insists on adding */
3.58 gtk_notebook_remove_page( mmr_book, 0 );
3.59
3.60 - all_list = create_mmr_page( "All" );
3.61 + all_list = create_mmr_page( "All", NULL );
3.62 for( i=0; i < num_io_rgns; i++ ) {
3.63 - GtkCList *list = create_mmr_page( io_rgn[i]->id );
3.64 + GtkCList *list = create_mmr_page( io_rgn[i]->id, io_rgn[i] );
3.65
3.66 for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
3.67 int sz = io_rgn[i]->ports[j].width;
.