-/* emugtk.c */
-
+/*
+ * emugtk.c
+ *
+ * Copyright (C) 1999 Jonathan St-André
+ * Copyright (C) 1999 Hugo Villeneuve <hugo@hugovil.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
#include <stdio.h>
#include "config.h"
static void
WindowDestroyEvent( GtkWidget *widget, gpointer data )
{
+#ifdef EMU8051_DEBUG
g_print( "emugtk_DestroyEvent(...)\n" );
+#endif
gtk_main_quit();
}
void
emugtk_UpdateDisplay( void )
{
+#ifdef EMU8051_DEBUG
g_print( "emugtk_UpdateDisplay()\n" );
+#endif
regwin_Show();
pgmwin_Disasm();
void
emugtk_ResetEvent( GtkWidget *widget, GdkEvent *event, gpointer data )
{
+#ifdef EMU8051_DEBUG
g_print( "emugtk_ResetEvent(...)\n" );
+#endif
emugtk_StopRunning( );
emugtk_Reset( );
}
void
emugtk_RunEvent( GtkWidget *widget, GdkEvent *event, gpointer data )
{
+#ifdef EMU8051_DEBUG
g_print( "emugtk_RunEvent(...)\n" );
+#endif
if ( RunningState ) {
// g_print( "Getting out of RunningState! \n" );
emugtk_StopRunning( );
void
emugtk_StopEvent( GtkWidget *widget, GdkEvent *event, gpointer data )
{
+#ifdef EMU8051_DEBUG
g_print( "emugtk_StopEvent(...)\n" );
+#endif
emugtk_StopRunning( );
}
void
emugtk_StepEvent( GtkWidget *widget, GdkEvent *event, gpointer data )
{
+#ifdef EMU8051_DEBUG
g_print( "emugtk_StepEvent(...)\n" );
+#endif
emugtk_StopRunning( );
emugtk_Step();
}
{
cpu8051_Exec( );
if( pgmwin_IsBreakpoint( cpu8051.pc ) ) {
+#ifdef EMU8051_DEBUG
g_print( "Breakpoint Hit, stopping!\n" );
+#endif
emugtk_StopRunning( );
}
}
emugtk_StartRunning( void )
{
if ( !RunningState ) {
-
+#ifdef EMU8051_DEBUG
printf( "emugtk_StartRunning( )\n" );
-
+#endif
/*RunFuncTag = gtk_idle_add( GtkFunction( RunningFunction ), 0 );*/
RunFuncTag = gtk_idle_add( RunningFunction, 0 );
emugtk_StopRunning( )
{
if (RunningState) {
+#ifdef EMU8051_DEBUG
printf( "emugtk_StopRunning( )\n" );
+#endif
gtk_idle_remove( RunFuncTag );
RunningState = 0;
//gtk_widget_hide( GTK_WIDGET( ButtonStop ) );