Create common function for running instructions
[emu8051.git] / src / gtk / emugtk.c
index 308bdeb..0c1ca49 100644 (file)
@@ -89,13 +89,14 @@ emugtk_stop_running()
 static gboolean
 emugtk_running(gpointer data)
 {
+       int breakpoint_hit;
+
        (void) data; /* Remove compiler warning about unused variable. */
 
-       cpu8051_Exec();
-       if (IsBreakpoint(cpu8051.pc)) {
-               log_info("Breakpoint Hit");
+       breakpoint_hit = cpu8051_run(1, NULL);
+
+       if (breakpoint_hit)
                emugtk_stop_running();
-       }
 
        return TRUE;
 }