drc: implement ra accesses in ujump DS
[pcsx_rearmed.git] / maemo / hildon.c
index 2cea99a..342ac19 100644 (file)
@@ -1,9 +1,12 @@
 #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 "main.h"
+#include "../libpcsxcore/psemu_plugin_defs.h"
 
 #define X_RES           800
 #define Y_RES           480
@@ -15,7 +18,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];
 
@@ -77,24 +81,28 @@ window_key_proxy(GtkWidget *widget,
                        psxkey2 = DKEY_RIGHT;
                        break;
                case 19:
-                       //SaveState(cfile);
+                       if (event->type == GDK_KEY_PRESS)
+                               emu_set_action(SACTION_SAVE_STATE);
                        return;
                case 20:
-                       //LoadState(cfile);
+                       if (event->type == GDK_KEY_PRESS)
+                               emu_set_action(SACTION_LOAD_STATE);
                        return;
        }
 
        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);
+
+               emu_set_action(SACTION_NONE);
        }
 }
 
@@ -145,10 +153,14 @@ void maemo_init(int *argc, char ***argv)
        gtk_widget_show_all (GTK_WIDGET (window));
 }
 
+void menu_loop(void)
+{
+}
+
 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 +181,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 +200,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)
@@ -197,6 +211,16 @@ static void pl_get_layer_pos(int *x, int *y, int *w, int *h)
        *h = 640;
 }
 
+void *pl_prepare_screenshot(int *w, int *h, int *bpp)
+{
+       return NULL;
+}
+
+int writepng()
+{
+       return -1;
+}
+
 extern int UseFrameSkip; // hmh
 
 const struct rearmed_cbs pl_rearmed_cbs = {