aboutsummaryrefslogtreecommitdiff
path: root/maemo
diff options
context:
space:
mode:
authornotaz2011-02-06 02:22:05 +0200
committernotaz2011-02-10 02:07:54 +0200
commit54b4a001cf0b0f165a59b727c4b201226eda014c (patch)
tree25e3d317d97599793fc8ce0046c0600b43382991 /maemo
parent799b0b8773d6add1de99efd582c93701b82e970d (diff)
downloadpcsx_rearmed-54b4a001cf0b0f165a59b727c4b201226eda014c.tar.gz
pcsx_rearmed-54b4a001cf0b0f165a59b727c4b201226eda014c.tar.bz2
pcsx_rearmed-54b4a001cf0b0f165a59b727c4b201226eda014c.zip
maemo: update for recent changes, fix warnings
Diffstat (limited to 'maemo')
-rw-r--r--maemo/hildon.c17
-rw-r--r--maemo/main.c28
2 files changed, 28 insertions, 17 deletions
diff --git a/maemo/hildon.c b/maemo/hildon.c
index 2cea99a..df42a90 100644
--- a/maemo/hildon.c
+++ b/maemo/hildon.c
@@ -1,9 +1,11 @@
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
+#include <stdint.h>
#include <unistd.h>
#include <hildon/hildon.h>
#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 267fb55..80919ac 100644
--- a/maemo/main.c
+++ b/maemo/main.c
@@ -7,17 +7,13 @@
#include <stdio.h>
#include <string.h>
-#include <stdarg.h>
-#include <dlfcn.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <unistd.h>
-#include <signal.h>
#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;
}