From 26a25f0126d19510044d757c6f10adc0e55ee453 Mon Sep 17 00:00:00 2001 From: damdoum Date: Fri, 12 Jan 2007 18:35:32 +0000 Subject: [PATCH] cpu select in memory view --- .../gtk-glade/dTools/callbacks_2_memview.c | 15 ++++++++++-- .../src/gtk-glade/dTools/callbacks_dtools.h | 1 + .../src/gtk-glade/glade/DeSmuMe_Dtools.glade | 23 +++++++++++++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/desmume/src/gtk-glade/dTools/callbacks_2_memview.c b/desmume/src/gtk-glade/dTools/callbacks_2_memview.c index b98c6c419..0c82662bc 100755 --- a/desmume/src/gtk-glade/dTools/callbacks_2_memview.c +++ b/desmume/src/gtk-glade/dTools/callbacks_2_memview.c @@ -32,7 +32,7 @@ enum SHOW { static BOOL init=FALSE; static enum SHOW packmode=Bit8; -static u32 address=0, tmpaddr=0, bpl=0; +static u32 address=0, tmpaddr=0, bpl=0; int cpu=0; static PangoAttrList *attr_Address, *attr_Pattern1, *attr_Pattern2, *attr_Text; static GtkEntry *wAddress; @@ -40,6 +40,13 @@ static GtkDrawingArea *wPaint; void refresh(); +void on_wtools_2_cpu_changed (GtkComboBox *widget, gpointer user_data) { + /* c == 0 means ARM9 */ + cpu=gtk_combo_box_get_active(widget); + refresh(); +} + + /* how to pack bytes */ void on_wtools_2_r8_toggled (GtkToggleButton *togglebutton, gpointer user_data) { packmode=Bit8; refresh(); } @@ -61,9 +68,13 @@ void on_wtools_2_GotoButton_clicked (GtkButton *button, gpointer user_data) { } + + void on_wtools_2_MemView_show (GtkWidget *widget, gpointer user_data) { + GtkWidget * combo = glade_xml_get_widget(xml_tools, "wtools_2_cpu"); wAddress = (GtkEntry*)glade_xml_get_widget(xml_tools, "wtools_2_GotoAddress"); wPaint = (GtkDrawingArea*)glade_xml_get_widget(xml_tools, "wtools_2_draw"); + gtk_combo_box_set_active((GtkComboBox*)combo, 0); refresh(); } @@ -89,7 +100,7 @@ void refresh() { GtkWidget * area = (GtkWidget*)wPaint; PangoLayout* playout = gtk_widget_create_pango_layout(area, NULL); GdkGC * GC = area->style->fg_gc[area->state]; - int i,j,addr, w,h,x,y, cpu=0; u8 c; + int i,j,addr, w,h,x,y; u8 c; char txt[80],*ptxt; char words[4][13]; diff --git a/desmume/src/gtk-glade/dTools/callbacks_dtools.h b/desmume/src/gtk-glade/dTools/callbacks_dtools.h index 6961e650b..1fc9ea588 100755 --- a/desmume/src/gtk-glade/dTools/callbacks_dtools.h +++ b/desmume/src/gtk-glade/dTools/callbacks_dtools.h @@ -46,6 +46,7 @@ void on_wtools_1_r_dispb_winout_toggled(GtkToggleButton *togglebutton, gpointer /* ***** ***** MEMORY VIEWER ***** ***** */ +void on_wtools_2_cpu_changed (GtkComboBox *widget, gpointer user_data); void on_wtools_2_MemView_show (GtkWidget *widget, gpointer user_data); void on_wtools_2_r8_toggled (GtkToggleButton *togglebutton, gpointer user_data); void on_wtools_2_r16_toggled (GtkToggleButton *togglebutton, gpointer user_data); diff --git a/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade b/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade index d705d83cf..dba8e9de3 100755 --- a/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade +++ b/desmume/src/gtk-glade/glade/DeSmuMe_Dtools.glade @@ -640,7 +640,7 @@ cpu : ARM9 True 2 - 6 + 7 False 0 0 @@ -813,12 +813,31 @@ cpu : ARM9 0 - 6 + 7 1 2 fill + + + + True + ARM9 cpu +ARM7 cpu + False + True + + + + 6 + 7 + 0 + 1 + fill + fill + + 0