Update NEWS and ChangeLog
[emu8051.git] / src / emugtk.c
index 2224ee2..45448a2 100644 (file)
  *
  * 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.
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include <stdio.h>
 #include "config.h"
 
 #include <gtk/gtk.h>
-#include "emugtk.h"
-#include "reset.xpm"
-#include "run.xpm"
-#include "stop.xpm"
-#include "step.xpm"
 
 #include "common.h"
 #include "cpu8051.h"
 #include "options.h"
 #include "hexfile.h"
+
+#include "emugtk.h"
+#include "reset.xpm"
+#include "run.xpm"
+#include "stop.xpm"
+#include "step.xpm"
 #include "filemenu.h"
 #include "viewmenu.h"
 #include "helpmenu.h"
 #include "pgmwin.h"
 #include "memwin.h"
 
-
 static int RunningState;
 static int RunFuncTag;
-
-
 static GtkWidget *mainwin;
 
-
-/* In options.c */
-extern char *hex_file;
-
-
 /* Signal DestroyEvent */
 static void
 WindowDestroyEvent( GtkWidget *widget, gpointer data )
@@ -210,6 +203,8 @@ emugtk_window_init( void )
 int
 main( int argc, char **argv )
 {
+  char *hex_file;
+
   ParseCommandLineOptions( argc, argv );
 
   cpu8051_init();
@@ -220,6 +215,8 @@ main( int argc, char **argv )
 
   emugtk_window_init();
 
+  hex_file = get_hex_filename();
+
   if( hex_file != NULL ) {
     emugtk_new_file( hex_file );
   }
@@ -267,7 +264,7 @@ emugtk_UpdateDisplay( void )
 
   regwin_Show();
   pgmwin_Disasm();
-  memwin_DumpD( 0 );
+  memwin_DumpD("0x00");
 }
 
 
@@ -291,7 +288,7 @@ emugtk_Reset( void )
   cpu8051_Reset( );
   regwin_Show();
   pgmwin_Disasm();
-  memwin_DumpD( 0 );
+  memwin_DumpD("0x00");
 }
 
 
@@ -304,7 +301,7 @@ emugtk_Step( void )
   cpu8051_Exec();
   regwin_Show();
   pgmwin_Disasm();
-  memwin_DumpD( 0 );
+  memwin_DumpD("0x00");
 }
 
 
@@ -406,14 +403,9 @@ emugtk_StartRunning( void )
 #ifdef EMU8051_DEBUG
     printf( "emugtk_StartRunning( )\n" );
 #endif
-    /*RunFuncTag = gtk_idle_add( GtkFunction( RunningFunction ), 0 );*/
     RunFuncTag = gtk_idle_add( RunningFunction, 0 );
 
     RunningState = 1;
-
-    // gtk_widget_hide( GTK_WIDGET( ButtonRun ) );
-    // gtk_widget_show_now( GTK_WIDGET( ButtonStop ) );
-    // gtk_table_attach_defaults( GTK_TABLE( ButtonTable ), ButtonStop, 3, 4, 0, 1);
   }
 }
 
@@ -430,11 +422,8 @@ emugtk_StopRunning( )
 #endif
     gtk_idle_remove( RunFuncTag );
     RunningState = 0;
-    //gtk_widget_hide( GTK_WIDGET( ButtonStop ) );
-    //gtk_widget_show( GTK_WIDGET( ButtonRun ) );
-    //    gtk_table_attach_defaults( GTK_TABLE( ButtonTable ), ButtonRun, 3, 4, 0, 1);
     regwin_Show();
     pgmwin_Disasm();
-    memwin_DumpD( 0 );
+  memwin_DumpD("0x00");
   }
 }