From: Fabien C. <cou...@us...> - 2005-12-20 21:01:13
|
Update of /cvsroot/yabause/yabause/src/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1769/yabause/src/linux Modified Files: debug.c yui.c Log Message: + sh2 core selection in settings dialog + "jump to vblank-out" button in vdp1 dialog Index: yui.c =================================================================== RCS file: /cvsroot/yabause/yabause/src/linux/yui.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- yui.c 19 Dec 2005 22:38:41 -0000 1.16 +++ yui.c 20 Dec 2005 21:01:01 -0000 1.17 @@ -51,6 +51,32 @@ static void yuiRun(void); static void yuiPause(void); +typedef struct { + + GtkWidget *frame; + GtkWidget *hbox; + GtkWidget *combo; + GtkWidget *button; + GtkWidget *filew; + + gchar *name; + gchar lastPathEntry[64]; + gint idc; +} ComboFileSelect; + +static struct { + GtkWidget *window; + GdkPixbuf *pixBufIcon; + ComboFileSelect *cfBios, *cfCdRom; + GtkWidget *checkIso; + GtkWidget *checkCdRom; + GtkWidget *buttonRun; + GtkWidget *buttonPause; + GtkWidget *buttonFs; + GtkWidget *buttonSettings; + enum {GTKYUI_WAIT,GTKYUI_RUN,GTKYUI_PAUSE} running; +} yui; + /* --------------------------------------------------------------------------------- */ /* managing the configuration file $HOME/.yabause */ @@ -157,19 +183,6 @@ /* ------------------------------------------------------------ */ /* ComboFileSelect - Control for file selection */ -typedef struct { - - GtkWidget *frame; - GtkWidget *hbox; - GtkWidget *combo; - GtkWidget *button; - GtkWidget *filew; - - gchar *name; - gchar lastPathEntry[64]; - gint idc; -} ComboFileSelect; - static void loadCombo( GtkComboBox* combo, gint* idc, gchar* name ) { gchar tmp[64] = "remind_"; @@ -338,7 +351,7 @@ static struct { ComboFileSelect *cfBup, *cfCart, *cfMpeg; - GtkWidget *comboCartType, *comboRegion, *spinX, *spinY, *checkAspect, *checkSound; + GtkWidget *comboCartType, *comboRegion, *spinX, *spinY, *checkAspect, *checkSound, *cbSh2; gboolean soundenabled; } yuiSettings; @@ -367,6 +380,7 @@ case 7: r = REGION_EUROPE ; break; case 8: r = REGION_CENTRALSOUTHAMERICAPAL ; break; } + yuiSetInt( "sh2core", gtk_combo_box_get_active( GTK_COMBO_BOX(yuiSettings.cbSh2) )); yuiSetInt( "region", r ); yuiSetInt( "fsX", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( yuiSettings.spinX ) ) ); yuiSetInt( "fsY", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( yuiSettings.spinY ) ) ); @@ -408,7 +422,7 @@ /* create and run settings dialog. */ int r; - GtkWidget *hboxcart, *hboxregion; + GtkWidget *hboxcart, *hboxregion, *fSh2; GtkWidget* dialog = gtk_dialog_new_with_buttons ( "Settings", NULL, (GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), @@ -418,6 +432,17 @@ GTK_RESPONSE_REJECT, NULL); GtkWidget* vbox = GTK_DIALOG(dialog)->vbox; + /* sh2core combo */ + + fSh2 = gtk_frame_new("Execution mode"); + gtk_box_pack_start( GTK_BOX( vbox ), fSh2, FALSE, FALSE, 4 ); + + yuiSettings.cbSh2 = gtk_combo_box_new_text(); + gtk_container_add (GTK_CONTAINER( fSh2 ), yuiSettings.cbSh2 ); + gtk_combo_box_append_text( GTK_COMBO_BOX(yuiSettings.cbSh2), "Fast Interpreter" ); + gtk_combo_box_append_text( GTK_COMBO_BOX(yuiSettings.cbSh2), "Debug Interpreter" ); + gtk_combo_box_set_active( GTK_COMBO_BOX(yuiSettings.cbSh2), yuiGetInt( "sh2core", 0 ) ); + /* Cartbridge path selection CF */ yuiSettings.cfCart = cfNew( "cart", "Cartbridge slot" ); @@ -531,6 +556,17 @@ /* ---------------------- */ + if ( yui.running != GTKYUI_WAIT ) { + + cfSetSensitive( yuiSettings.cfCart, FALSE ); + cfSetSensitive( yuiSettings.cfBup, FALSE ); + cfSetSensitive( yuiSettings.cfMpeg, FALSE ); + gtk_widget_set_sensitive( yuiSettings.comboCartType, 0 ); + gtk_widget_set_sensitive( yuiSettings.comboRegion, 0 ); + gtk_widget_set_sensitive( yuiSettings.cbSh2, 0 ); + gtk_widget_set_sensitive( yuiSettings.checkSound, 0 ); + } + gtk_widget_show_all(dialog); g_signal_connect (GTK_OBJECT (dialog), "response", @@ -546,19 +582,6 @@ /* ---------------------------------------------------------- */ /* GUI Core */ -static struct { - GtkWidget *window; - GdkPixbuf *pixBufIcon; - ComboFileSelect *cfBios, *cfCdRom; - GtkWidget *checkIso; - GtkWidget *checkCdRom; - GtkWidget *buttonRun; - GtkWidget *buttonPause; - GtkWidget *buttonFs; - GtkWidget *buttonSettings; - enum {GTKYUI_WAIT,GTKYUI_RUN,GTKYUI_PAUSE} running; -} yui; - static void yuiAbout(void); static int GtkWorkaround(void) { @@ -566,17 +589,27 @@ return TRUE; } -static void yuiErrorPopup( gchar* text ) { +static void yuiPopup( gchar* text, GtkMessageType mType ) { GtkWidget* dialog = gtk_message_dialog_new (GTK_WINDOW(yui.window), GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, + mType, GTK_BUTTONS_CLOSE, text ); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } +static void yuiErrorPopup( gchar* text ) { + + yuiPopup( text, GTK_MESSAGE_ERROR ); +} + +static void yuiWarningPopup( gchar* text ) { + + yuiPopup( text, GTK_MESSAGE_WARNING ); +} + static void yuiYabauseInit() { yabauseinit_struct yinit; @@ -602,7 +635,7 @@ ? CDCORE_ISO : CDCORE_ARCH; } yinit.percoretype = PERCORE_SDL; - yinit.sh2coretype = SH2CORE_DEFAULT; + yinit.sh2coretype = yuiGetInt( "sh2core", SH2CORE_DEFAULT ); yinit.vidcoretype = VIDCORE_SDLGL; yinit.sndcoretype = yuiSettings.soundenabled ? SNDCORE_SDL : SNDCORE_DUMMY; yinit.regionid = yuiGetInt( "region", REGION_AUTODETECT ); Index: debug.c =================================================================== RCS file: /cvsroot/yabause/yabause/src/linux/debug.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- debug.c 17 Dec 2005 20:35:17 -0000 1.7 +++ debug.c 20 Dec 2005 21:01:01 -0000 1.8 @@ -63,7 +63,7 @@ } M68KprocDlg; typedef struct { - GtkWidget *dialog, *spin, *commName, *commDesc; + GtkWidget *dialog, *spin, *commName, *commDesc, *buttonVBlankOut; gint curs; } VDP1procDlg; @@ -562,6 +562,9 @@ return sh2; } openedSH2[(int)bMaster] = TRUE; + if ( yuiGetInt( "sh2core", -1 ) != 1 ) + yuiWarningPopup( "Yabause execution mode is <Fast Interpreter>. Debugger won't be fully \ +functional. You may restart with <Debug Interpreter>." ); if ( yui.running == GTKYUI_WAIT ) yuiYabauseInit(); /* force yabause initialization */ sh2->debugsh = bMaster ? MSH2 : SSH2; /* so that proc structures exist */ SH2SetBreakpointCallBack(sh2->debugsh, (void (*)(void *, u32))SH2BreakpointHandler); @@ -728,6 +731,7 @@ gtk_spin_button_set_range(GTK_SPIN_BUTTON(VDP1proc.spin),0,i-1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(VDP1proc.spin),0); VDP1proc.curs = 0; + gtk_widget_set_sensitive( VDP1proc.buttonVBlankOut, yabsys.LineCount != 262 ); vdp1define(); } @@ -737,6 +741,13 @@ return FALSE; /* propagate event */ } +static void VDP1vBlankOut() { + + while (yabsys.LineCount != 262) + if (YabauseExec() != 0) return; + debugUpdateViews(); +} + static void openVDP1() { GtkWidget *vbox, *hbox; @@ -775,6 +786,12 @@ gtk_box_pack_start( GTK_BOX( hbox ), VDP1proc.commName, FALSE, FALSE, 4 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 4 ); + /* vblank-out button */ + + VDP1proc.buttonVBlankOut = gtk_button_new_with_label( "Jump to\nvblank-out" ); + gtk_box_pack_start( GTK_BOX( hbox ), VDP1proc.buttonVBlankOut, FALSE, FALSE, 2 ); + g_signal_connect( VDP1proc.buttonVBlankOut, "clicked", G_CALLBACK(VDP1vBlankOut), NULL ); + /* Description text */ VDP1proc.commDesc = gtk_label_new(""); |