cpu select in memory view

This commit is contained in:
damdoum 2007-01-12 18:35:32 +00:00
parent 744081ab76
commit 26a25f0126
3 changed files with 35 additions and 4 deletions

View File

@ -32,7 +32,7 @@ enum SHOW {
static BOOL init=FALSE; static BOOL init=FALSE;
static enum SHOW packmode=Bit8; 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 PangoAttrList *attr_Address, *attr_Pattern1, *attr_Pattern2, *attr_Text;
static GtkEntry *wAddress; static GtkEntry *wAddress;
@ -40,6 +40,13 @@ static GtkDrawingArea *wPaint;
void refresh(); 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 */ /* how to pack bytes */
void on_wtools_2_r8_toggled (GtkToggleButton *togglebutton, gpointer user_data) { packmode=Bit8; refresh(); } 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) { 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"); wAddress = (GtkEntry*)glade_xml_get_widget(xml_tools, "wtools_2_GotoAddress");
wPaint = (GtkDrawingArea*)glade_xml_get_widget(xml_tools, "wtools_2_draw"); wPaint = (GtkDrawingArea*)glade_xml_get_widget(xml_tools, "wtools_2_draw");
gtk_combo_box_set_active((GtkComboBox*)combo, 0);
refresh(); refresh();
} }
@ -89,7 +100,7 @@ void refresh() {
GtkWidget * area = (GtkWidget*)wPaint; GtkWidget * area = (GtkWidget*)wPaint;
PangoLayout* playout = gtk_widget_create_pango_layout(area, NULL); PangoLayout* playout = gtk_widget_create_pango_layout(area, NULL);
GdkGC * GC = area->style->fg_gc[area->state]; 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 txt[80],*ptxt;
char words[4][13]; char words[4][13];

View File

@ -46,6 +46,7 @@ void on_wtools_1_r_dispb_winout_toggled(GtkToggleButton *togglebutton, gpointer
/* ***** ***** MEMORY VIEWER ***** ***** */ /* ***** ***** 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_MemView_show (GtkWidget *widget, gpointer user_data);
void on_wtools_2_r8_toggled (GtkToggleButton *togglebutton, 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); void on_wtools_2_r16_toggled (GtkToggleButton *togglebutton, gpointer user_data);

View File

@ -640,7 +640,7 @@ cpu : ARM9</property>
<widget class="GtkTable" id="table2"> <widget class="GtkTable" id="table2">
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">2</property> <property name="n_rows">2</property>
<property name="n_columns">6</property> <property name="n_columns">7</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="row_spacing">0</property> <property name="row_spacing">0</property>
<property name="column_spacing">0</property> <property name="column_spacing">0</property>
@ -813,12 +813,31 @@ cpu : ARM9</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="right_attach">6</property> <property name="right_attach">7</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">2</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkComboBox" id="wtools_2_cpu">
<property name="visible">True</property>
<property name="items" translatable="yes">ARM9 cpu
ARM7 cpu</property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
<signal name="changed" handler="on_wtools_2_cpu_changed" last_modification_time="Fri, 12 Jan 2007 18:36:24 GMT"/>
</widget>
<packing>
<property name="left_attach">6</property>
<property name="right_attach">7</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>