From: notaz Date: Sun, 6 Feb 2011 00:22:05 +0000 (+0200) Subject: maemo: update for recent changes, fix warnings X-Git-Tag: r6~7 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54b4a001cf0b0f165a59b727c4b201226eda014c;p=pcsx_rearmed.git maemo: update for recent changes, fix warnings --- diff --git a/Makefile.maemo b/Makefile.maemo index 06f21dc7..2bed0792 100644 --- a/Makefile.maemo +++ b/Makefile.maemo @@ -8,8 +8,8 @@ EXTRA_CFLAGS += -march=armv7-a -O3 -mfpu=neon -funsafe-math-optimizations \ -mstructure-size-boundary=32 -falign-functions=32 -falign-loops \ -DMAEMO -DMAEMO_CHANGES $(shell pkg-config --cflags hildon-1) -#EXTRA_CFLAGS += -Imaemo/gtk-2.0 -Imaemo/hildon -Imaemo/glib-2.0 -Imaemo/cairo \ - -Imaemo/pango-1.0 -Imaemo/atk-1.0 -DMAEMO -DMAEMO_CHANGES +#EXTRA_CFLAGS += -Imaemo/i/gtk-2.0 -Imaemo/i/hildon -Imaemo/i/glib-2.0 -Imaemo/i/cairo \ + -Imaemo/i/pango-1.0 -Imaemo/i/atk-1.0 -DMAEMO -DMAEMO_CHANGES include Makefile diff --git a/maemo/hildon.c b/maemo/hildon.c index 2cea99a3..df42a90a 100644 --- a/maemo/hildon.c +++ b/maemo/hildon.c @@ -1,9 +1,11 @@ #include #include #include +#include #include #include #include "plugin_lib.h" +#include "../libpcsxcore/psemu_plugin_defs.h" #define X_RES 800 #define Y_RES 480 @@ -15,7 +17,8 @@ static HildonAnimationActor *actor; static GtkWidget *window, *drawing; void *pl_fbdev_buf; -int keystate; +int in_type = PSE_PAD_TYPE_STANDARD; +int in_keystate, in_a1[2], in_a2[2]; static int keymap[65536]; @@ -86,15 +89,15 @@ window_key_proxy(GtkWidget *widget, if (event->type == GDK_KEY_PRESS) { if (psxkey1 >= 0) - keystate |= 1 << psxkey1; + in_keystate |= 1 << psxkey1; if (psxkey2 >= 0) - keystate |= 1 << psxkey2; + in_keystate |= 1 << psxkey2; } else if (event->type == GDK_KEY_RELEASE) { if (psxkey1 >= 0) - keystate &= ~(1 << psxkey1); + in_keystate &= ~(1 << psxkey1); if (psxkey2 >= 0) - keystate &= ~(1 << psxkey2); + in_keystate &= ~(1 << psxkey2); } } @@ -148,7 +151,7 @@ void maemo_init(int *argc, char ***argv) void *pl_fbdev_set_mode(int w, int h, int bpp) { if (w <= 0 || h <= 0) - return; + return pl_fbdev_buf; if (image) gdk_image_destroy(image); image = gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(), w, h ); @@ -169,6 +172,7 @@ void *pl_fbdev_set_mode(int w, int h, int bpp) void *pl_fbdev_flip(void) { gtk_widget_queue_draw (drawing); + return pl_fbdev_buf; } void pl_frame_limit(void) @@ -187,6 +191,7 @@ void pl_fbdev_close(void) int pl_fbdev_open(void) { + return 0; } static void pl_get_layer_pos(int *x, int *y, int *w, int *h) diff --git a/maemo/main.c b/maemo/main.c index 267fb55f..80919ace 100644 --- a/maemo/main.c +++ b/maemo/main.c @@ -7,17 +7,13 @@ #include #include -#include -#include -#include -#include +#include #include -#include #include "main.h" #include "plugin.h" #include "../libpcsxcore/misc.h" -#include "../plugins/cdrcimg/cdrcimg.h" +#include "../libpcsxcore/new_dynarec/new_dynarec.h" // from softgpu plugin extern int iUseDither; @@ -34,11 +30,14 @@ extern int iXAPitch; extern int iSPUIRQWait; extern int iUseTimer; +enum sched_action emu_action; +void do_emu_action(void); + static void ChangeWorkingDirectory(char *exe) { - s8 exepath[1024]; - s8* s; - sprintf(exepath, "%s", exe); + char exepath[1024]; + char *s; + snprintf(exepath, sizeof(exepath), "%s", exe); s = strrchr(exepath, '/'); if (s != NULL) { *s = '\0'; @@ -53,7 +52,6 @@ int maemo_main(int argc, char **argv) char path[MAXPATHLEN]; const char *cdfile = NULL; int loadst = 0; - void *tmp; int i; strcpy(Config.BiosDir, "/home/user/MyDocs"); @@ -190,7 +188,15 @@ int maemo_main(int argc, char **argv) return 0; } - psxCpu->Execute(); + while (1) + { + stop = 0; + emu_action = SACTION_NONE; + + psxCpu->Execute(); + if (emu_action != SACTION_NONE) + do_emu_action(); + } return 0; }