From 0d9652b5677991b5ad9dea8a4369d15335e4d88b Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 11 Sep 2007 20:52:21 +0000 Subject: [PATCH] new acc mode timing, VDP FIFO code git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@244 be3aeb3a-fb24-0410-a615-afba39da0efa --- gp2x/Makefile | 2 +- gp2x/port_config.h | 3 +++ linux/gp2x.c | 39 +++++++++++++++++++++++---------------- linux/port_config.h | 2 ++ 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/gp2x/Makefile b/gp2x/Makefile index 5b8b039..c6f9fe9 100644 --- a/gp2x/Makefile +++ b/gp2x/Makefile @@ -32,7 +32,7 @@ use_cyclone = 1 endif DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK -COPT_COMMON = -static -Wall -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math +COPT_COMMON = -static -Wall -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math -Winline ifeq "$(profile)" "1" COPT_COMMON += -fprofile-generate endif diff --git a/gp2x/port_config.h b/gp2x/port_config.h index a6a15af..7bfe247 100644 --- a/gp2x/port_config.h +++ b/gp2x/port_config.h @@ -12,6 +12,9 @@ // pico.c #define CAN_HANDLE_240_LINES 1 +// logging emu events +#define EL_LOGMASK 0 // (EL_STATUS|EL_ANOMALY) // xffff + //#define dprintf(f,...) printf("%05i:%03i: " f "\n",Pico.m.frame_count,Pico.m.scanline,##__VA_ARGS__) #define dprintf(x...) diff --git a/linux/gp2x.c b/linux/gp2x.c index f5da167..3b43c3d 100644 --- a/linux/gp2x.c +++ b/linux/gp2x.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -98,22 +99,12 @@ static gint key_release_event (GtkWidget *widget, GdkEventKey *event) 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 (); @@ -149,11 +140,27 @@ static void gtk_initf(void) 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) diff --git a/linux/port_config.h b/linux/port_config.h index ce3d41f..2e0eb54 100644 --- a/linux/port_config.h +++ b/linux/port_config.h @@ -13,6 +13,8 @@ // 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...) -- 2.39.5