Search
lxdream.org :: lxdream/src/gui/gui.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/gui.c
changeset 27:1ef09a52cd1e
prev23:1ec3acd0594d
next28:81c206f59dc7
author nkeynes
date Sun Dec 25 01:28:39 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change Refactor all the GUI bits out of the main directory (except for a couple
lingering temporarily in loader.c
Fix a few timeslice issues
file annotate diff log raw
1.1 --- a/src/gui/gui.c Fri Dec 23 11:44:55 2005 +0000
1.2 +++ b/src/gui/gui.c Sun Dec 25 01:28:39 2005 +0000
1.3 @@ -2,22 +2,40 @@
1.4 #include <stdarg.h>
1.5 #include <gnome.h>
1.6 #include <math.h>
1.7 +#include "dream.h"
1.8 #include "dreamcast.h"
1.9 -#include "gui.h"
1.10 #include "mem.h"
1.11 #include "sh4dasm.h"
1.12 #include "sh4core.h"
1.13 +#include "gui/gui.h"
1.14
1.15 #define REGISTER_FONT "-*-fixed-medium-r-normal--12-*-*-*-*-*-iso8859-1"
1.16
1.17 GdkColor clrNormal, clrChanged, clrError, clrWarn, clrPC, clrDebug, clrTrace;
1.18 PangoFontDescription *fixed_list_font;
1.19
1.20 +debug_info_t main_debug;
1.21 +
1.22 +
1.23 void open_file_callback(GtkWidget *btn, gint result, gpointer user_data);
1.24
1.25 -void init_gui() {
1.26 +void gtk_gui_init( void );
1.27 +void gtk_gui_update( void );
1.28 +int gtk_gui_run_slice( int microsecs );
1.29 +
1.30 +struct dreamcast_module gtk_gui_module = { "Debugger", gtk_gui_init,
1.31 + gtk_gui_update, NULL,
1.32 + gtk_gui_run_slice,
1.33 + gtk_gui_update,
1.34 + NULL, NULL };
1.35 +
1.36 +const cpu_desc_t cpu_descs[4] = { &sh4_cpu_desc, &arm_cpu_desc, &armt_cpu_desc, NULL };
1.37 +
1.38 +
1.39 +void gtk_gui_init() {
1.40 GdkColormap *map;
1.41 -
1.42 + GtkWidget *debug_win;
1.43 +
1.44 clrNormal.red = clrNormal.green = clrNormal.blue = 0;
1.45 clrChanged.red = clrChanged.green = 64*256;
1.46 clrChanged.blue = 154*256;
1.47 @@ -41,16 +59,23 @@
1.48 gdk_colormap_alloc_color(map, &clrDebug, TRUE, TRUE);
1.49 gdk_colormap_alloc_color(map, &clrTrace, TRUE, TRUE);
1.50 fixed_list_font = pango_font_description_from_string("Courier 10");
1.51 + debug_win = create_debug_win ();
1.52 + main_debug = init_debug_win(debug_win, cpu_descs);
1.53 + init_mmr_win();
1.54 +
1.55 + gtk_widget_show (debug_win);
1.56 +
1.57 }
1.58
1.59 -void gui_run_slice( int millisecs )
1.60 +int gtk_gui_run_slice( int microsecs )
1.61 {
1.62 while( gtk_events_pending() )
1.63 gtk_main_iteration();
1.64 update_icount(main_debug);
1.65 + return microsecs;
1.66 }
1.67
1.68 -void update_gui(void) {
1.69 +void gtk_gui_update(void) {
1.70 update_registers(main_debug);
1.71 update_icount(main_debug);
1.72 update_mmr_win();
.