endif\r
\r
DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK\r
-COPT_COMMON = -static -Wall -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
+COPT_COMMON = -static -Wall -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math -Winline\r
ifeq "$(profile)" "1"\r
COPT_COMMON += -fprofile-generate\r
endif\r
// pico.c\r
#define CAN_HANDLE_240_LINES 1\r
\r
+// logging emu events\r
+#define EL_LOGMASK 0 // (EL_STATUS|EL_ANOMALY) // xffff\r
+\r
//#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)\r
#define dprintf(x...)\r
\r
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
+#include <semaphore.h>
#include <gtk/gtk.h>
#include <unistd.h>
return 0;
}
-static void *gtk_threadf(void *none)
-{
- gtk_main();
-
- printf("linux: gtk thread finishing\n");
- engineState = PGS_Quit;
-
- return NULL;
-}
-
-static void gtk_initf(void)
+static void *gtk_threadf(void *targ)
{
int argc = 0;
char *argv[] = { "" };
GtkWidget *box;
- pthread_t gtk_thread;
+ sem_t *sem = targ;
g_thread_init (NULL);
gdk_threads_init ();
gtk_widget_show (gtk_items.window);
- // pthread_mutex_init (&thr_mutex, NULL);
- // pthread_mutex_lock (&thr_mutex);
- // pthread_mutex_init (&scanner_muttex, NULL);
+ sem_post(sem);
+
+ gtk_main();
+
+ printf("linux: gtk thread finishing\n");
+ exit(1);
+
+ return NULL;
+}
+
+static void gtk_initf(void)
+{
+ pthread_t gtk_thread;
+ sem_t sem;
+ sem_init(&sem, 0, 0);
+
+ pthread_create(>k_thread, NULL, gtk_threadf, &sem);
+ pthread_detach(gtk_thread);
- pthread_create(>k_thread, NULL, gtk_threadf, NULL);
+ sem_wait(&sem);
+ sem_close(&sem);
}
void finalize_image(guchar *pixels, gpointer data)
// pico.c
#define CAN_HANDLE_240_LINES 1
+#define EL_LOGMASK (EL_ANOMALY|EL_STATUS|EL_VDPDMA|EL_ASVDP|EL_SR) // |EL_BUSREQ|EL_Z80BNK)
+
//#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__)
#define dprintf(x...)