Search
lxdream.org :: lxdream/src/gui/debugcb.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/debugcb.c
changeset 455:3080881d00d4
prev450:207461e79f21
author nkeynes
date Sun Oct 21 05:21:35 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change More GUI WIP
file annotate diff log raw
1.1 --- a/src/gui/debugcb.c Wed Oct 17 11:26:45 2007 +0000
1.2 +++ b/src/gui/debugcb.c Sun Oct 21 05:21:35 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: debugcb.c,v 1.2 2007-10-17 11:26:45 nkeynes Exp $
1.6 + * $Id: debugcb.c,v 1.3 2007-10-21 05:21:35 nkeynes Exp $
1.7 *
1.8 * All GTK callbacks go here (stubs are autogenerated by Glade)
1.9 *
1.10 @@ -29,140 +29,6 @@
1.11 #include "loader.h"
1.12 #include "pvr2/pvr2.h"
1.13
1.14 -int selected_pc = -1;
1.15 -int selected_row = -1;
1.16 -
1.17 -debug_window_t get_debug_info( GtkWidget *widget );
1.18 -
1.19 -void
1.20 -on_new_file1_activate (GtkMenuItem *menuitem,
1.21 - gpointer user_data)
1.22 -{
1.23 -
1.24 -}
1.25 -
1.26 -
1.27 -void
1.28 -on_open1_activate (GtkMenuItem *menuitem,
1.29 - gpointer user_data)
1.30 -{
1.31 - const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);
1.32 - open_file_dialog( "Open...", file_load_magic, NULL, NULL, dir );
1.33 -}
1.34 -
1.35 -
1.36 -void
1.37 -on_save1_activate (GtkMenuItem *menuitem,
1.38 - gpointer user_data)
1.39 -{
1.40 -
1.41 -}
1.42 -
1.43 -
1.44 -void
1.45 -on_save_as1_activate (GtkMenuItem *menuitem,
1.46 - gpointer user_data)
1.47 -{
1.48 -
1.49 -}
1.50 -
1.51 -void
1.52 -on_save_next_scene_activate( GtkMenuItem *menuitem,
1.53 - gpointer user_data)
1.54 -{
1.55 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
1.56 - save_file_dialog( "Save next scene...", pvr2_save_next_scene, "*.dsc", "lxdream scene file (*.dsc)", dir );
1.57 -}
1.58 -
1.59 -void
1.60 -on_exit1_activate (GtkMenuItem *menuitem,
1.61 - gpointer user_data)
1.62 -{
1.63 - gtk_main_quit();
1.64 -}
1.65 -
1.66 -
1.67 -void
1.68 -on_preferences1_activate (GtkMenuItem *menuitem,
1.69 - gpointer user_data)
1.70 -{
1.71 -
1.72 -}
1.73 -
1.74 -
1.75 -void
1.76 -on_about1_activate (GtkMenuItem *menuitem,
1.77 - gpointer user_data)
1.78 -{
1.79 - GtkWidget *about = create_about_win();
1.80 - gtk_widget_show(about);
1.81 -}
1.82 -
1.83 -
1.84 -void
1.85 -on_load_btn_clicked (GtkButton *button,
1.86 - gpointer user_data)
1.87 -{
1.88 - const gchar *dir = lxdream_get_config_value(CONFIG_DEFAULT_PATH);
1.89 - open_file_dialog( "Open...", gdrom_mount_image, NULL, NULL, dir );
1.90 -}
1.91 -
1.92 -
1.93 -void
1.94 -on_reset_btn_clicked (GtkButton *button,
1.95 - gpointer user_data)
1.96 -{
1.97 - dreamcast_reset();
1.98 -}
1.99 -
1.100 -
1.101 -void
1.102 -on_stop_btn_clicked (GtkButton *button,
1.103 - gpointer user_data)
1.104 -{
1.105 - dreamcast_stop();
1.106 -}
1.107 -
1.108 -
1.109 -void
1.110 -on_step_btn_clicked (GtkButton *button,
1.111 - gpointer user_data)
1.112 -{
1.113 - debug_window_t data = get_debug_info(GTK_WIDGET(button));
1.114 - debug_win_single_step(data);
1.115 -}
1.116 -
1.117 -
1.118 -void
1.119 -on_run_btn_clicked (GtkButton *button,
1.120 - gpointer user_data)
1.121 -{
1.122 - dreamcast_run();
1.123 -}
1.124 -
1.125 -
1.126 -void
1.127 -on_runto_btn_clicked (GtkButton *button,
1.128 - gpointer user_data)
1.129 -{
1.130 - if( selected_pc == -1 )
1.131 - WARN( "No address selected, so can't run to it", NULL );
1.132 - else {
1.133 - debug_window_t data = get_debug_info(GTK_WIDGET(button));
1.134 - debug_win_set_oneshot_breakpoint( data, selected_row );
1.135 - dreamcast_run();
1.136 - }
1.137 -}
1.138 -
1.139 -
1.140 -void
1.141 -on_break_btn_clicked (GtkButton *button,
1.142 - gpointer user_data)
1.143 -{
1.144 - debug_window_t data = get_debug_info(GTK_WIDGET(button));
1.145 - debug_win_toggle_breakpoint( data, selected_row );
1.146 -}
1.147 -
1.148 void on_trace_button_toggled (GtkToggleButton *button,
1.149 gpointer user_data)
1.150 {
1.151 @@ -175,51 +41,6 @@
1.152
1.153
1.154 gboolean
1.155 -on_debug_win_delete_event (GtkWidget *widget,
1.156 - GdkEvent *event,
1.157 - gpointer user_data)
1.158 -{
1.159 - dreamcast_shutdown();
1.160 - gtk_main_quit();
1.161 - return FALSE;
1.162 -}
1.163 -
1.164 -
1.165 -void
1.166 -on_disasm_list_select_row (GtkCList *clist,
1.167 - gint row,
1.168 - gint column,
1.169 - GdkEvent *event,
1.170 - gpointer user_data)
1.171 -{
1.172 - debug_window_t data = get_debug_info(GTK_WIDGET(clist));
1.173 - selected_pc = row_to_address(data, row);
1.174 - selected_row = row;
1.175 -}
1.176 -
1.177 -
1.178 -void
1.179 -on_disasm_list_unselect_row (GtkCList *clist,
1.180 - gint row,
1.181 - gint column,
1.182 - GdkEvent *event,
1.183 - gpointer user_data)
1.184 -{
1.185 - debug_window_t data = get_debug_info(GTK_WIDGET(clist));
1.186 - int pc = row_to_address(data,row);
1.187 - if( selected_pc == pc ) selected_pc = -1;
1.188 -}
1.189 -
1.190 -
1.191 -void
1.192 -on_mem_mapped_regs1_activate (GtkMenuItem *menuitem,
1.193 - gpointer user_data)
1.194 -{
1.195 - mmr_open_win();
1.196 -}
1.197 -
1.198 -
1.199 -gboolean
1.200 on_mmr_win_delete_event (GtkWidget *widget,
1.201 GdkEvent *event,
1.202 gpointer user_data)
1.203 @@ -235,122 +56,3 @@
1.204 {
1.205 mmr_close_win();
1.206 }
1.207 -
1.208 -
1.209 -void
1.210 -on_mode_field_changed (GtkEditable *editable,
1.211 - gpointer user_data)
1.212 -{
1.213 - const gchar *text = gtk_entry_get_text( GTK_ENTRY(editable) );
1.214 - debug_window_t data = get_debug_info( GTK_WIDGET(editable) );
1.215 - set_disassembly_cpu( data, text );
1.216 -}
1.217 -
1.218 -
1.219 -void
1.220 -on_page_locked_btn_toggled (GtkToggleButton *togglebutton,
1.221 - gpointer user_data)
1.222 -{
1.223 -
1.224 -}
1.225 -
1.226 -
1.227 -gboolean
1.228 -on_page_field_key_press_event (GtkWidget *widget,
1.229 - GdkEventKey *event,
1.230 - gpointer user_data)
1.231 -{
1.232 - if( event->keyval == GDK_Return || event->keyval == GDK_Linefeed ) {
1.233 - debug_window_t data = get_debug_info(widget);
1.234 - const gchar *text = gtk_entry_get_text( GTK_ENTRY(widget) );
1.235 - gchar *endptr;
1.236 - unsigned int val = strtoul( text, &endptr, 16 );
1.237 - if( text == endptr ) { /* invalid input */
1.238 - char buf[10];
1.239 - sprintf( buf, "%08X", row_to_address(data,0) );
1.240 - gtk_entry_set_text( GTK_ENTRY(widget), buf );
1.241 - } else {
1.242 - set_disassembly_region(data, val);
1.243 - }
1.244 - }
1.245 - return FALSE;
1.246 -}
1.247 -
1.248 -
1.249 -void
1.250 -on_output_list_select_row (GtkCList *clist,
1.251 - gint row,
1.252 - gint column,
1.253 - GdkEvent *event,
1.254 - gpointer user_data)
1.255 -{
1.256 - if( event->type == GDK_2BUTTON_PRESS && event->button.button == 1 ) {
1.257 - char *val;
1.258 - gtk_clist_get_text( clist, row, 2, &val );
1.259 - if( val[0] != '\0' ) {
1.260 - int addr = strtoul( val, NULL, 16 );
1.261 - debug_window_t data = get_debug_info( GTK_WIDGET(clist) );
1.262 - jump_to_disassembly( data, addr, TRUE );
1.263 - }
1.264 - }
1.265 -}
1.266 -
1.267 -
1.268 -void
1.269 -on_jump_pc_btn_clicked (GtkButton *button,
1.270 - gpointer user_data)
1.271 -{
1.272 - debug_window_t data = get_debug_info( GTK_WIDGET(button) );
1.273 - jump_to_pc( data, TRUE );
1.274 -}
1.275 -
1.276 -
1.277 -void
1.278 -on_button_add_watch_clicked (GtkButton *button,
1.279 - gpointer user_data)
1.280 -{
1.281 -
1.282 -}
1.283 -
1.284 -
1.285 -void
1.286 -on_button_clear_all_clicked (GtkButton *button,
1.287 - gpointer user_data)
1.288 -{
1.289 -
1.290 -}
1.291 -
1.292 -
1.293 -void
1.294 -on_button_close_clicked (GtkButton *button,
1.295 - gpointer user_data)
1.296 -{
1.297 -
1.298 -}
1.299 -
1.300 -
1.301 -void
1.302 -on_view_memory_activate (GtkMenuItem *menuitem,
1.303 - gpointer user_data)
1.304 -{
1.305 - dump_window_new();
1.306 -}
1.307 -
1.308 -
1.309 -void
1.310 -on_loadstate_button_clicked (GtkToolButton *toolbutton,
1.311 - gpointer user_data)
1.312 -{
1.313 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
1.314 - open_file_dialog( "Load state...", dreamcast_load_state, "*.dst", "lxDream Save State (*.dst)", dir );
1.315 -}
1.316 -
1.317 -
1.318 -void
1.319 -on_savestate_button_clicked (GtkToolButton *toolbutton,
1.320 - gpointer user_data)
1.321 -{
1.322 - const gchar *dir = lxdream_get_config_value(CONFIG_SAVE_PATH);
1.323 - save_file_dialog( "Save state...", dreamcast_save_state, "*.dst", "lxDream Save State (*.dst)", dir );
1.324 -}
1.325 -
.