#include "main.h"
#include "../libpcsxcore/psemu_plugin_defs.h"
#include "common/readpng.h"
+#include "maemo_common.h"
#define X_RES 800
#define Y_RES 480
static HildonAnimationActor *actor;
static GtkWidget *window, *drawing;
-extern int g_opts;
-extern char * file_name;
static int pl_buf_w, pl_buf_h;
static int sens, y_def;
static int keymap[65536];
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
actor = HILDON_ANIMATION_ACTOR (hildon_animation_actor_new());
- if (g_opts & 2)
+ if (g_maemo_opts & 2)
hildon_animation_actor_set_position (actor, 0, 0 );
else
hildon_animation_actor_set_position (actor, (X_RES - D_WIDTH)/2, (Y_RES - D_HEIGHT)/2 );
gtk_image_set_from_image (GTK_IMAGE(drawing), image, NULL);
gtk_window_resize (GTK_WINDOW (actor), w, h);
- if (g_opts & 2)
+ if (g_maemo_opts & 2)
hildon_animation_actor_set_scale (actor,
(gdouble)800 / (gdouble)w,
(gdouble)480 / (gdouble)h
gtk_widget_queue_draw (drawing);
// process accelometer
- if (g_opts & 4) {
+ if (g_maemo_opts & 4) {
int x, y, z;
FILE* f = fopen( "/sys/class/i2c-adapter/i2c-3/3-001d/coord", "r" );
if( !f ) {printf ("err in accel"); exit(1);}
fscanf( f, "%d %d %d", &x, &y, &z );
fclose( f );
- if( x > sens ) keystate |= 1 << DKEY_LEFT;
- else if( x < -sens ) keystate |= 1 << DKEY_RIGHT;
- else {keystate &= ~(1 << DKEY_LEFT);keystate &= ~(1 << DKEY_RIGHT);}
+ if( x > sens ) in_keystate |= 1 << DKEY_LEFT;
+ else if( x < -sens ) in_keystate |= 1 << DKEY_RIGHT;
+ else {in_keystate &= ~(1 << DKEY_LEFT);in_keystate &= ~(1 << DKEY_RIGHT);}
y+=y_def;
- if( y > sens )keystate |= 1 << DKEY_UP;
- else if( y < -sens ) keystate |= 1 << DKEY_DOWN;
- else {keystate &= ~(1 << DKEY_DOWN);keystate &= ~(1 << DKEY_UP);}
+ if( y > sens )in_keystate |= 1 << DKEY_UP;
+ else if( y < -sens ) in_keystate |= 1 << DKEY_DOWN;
+ else {in_keystate &= ~(1 << DKEY_DOWN);in_keystate &= ~(1 << DKEY_UP);}
}
#include "plugin_lib.h"
#include "../libpcsxcore/misc.h"
#include "../libpcsxcore/new_dynarec/new_dynarec.h"
+#include "maemo_common.h"
// sound plugin
extern int iUseReverb;
extern int iUseTimer;
int g_opts = OPT_SHOWFPS;
+int g_maemo_opts;
+char file_name[MAXPATHLEN];
enum sched_action emu_action;
void do_emu_action(void);
-char* file_name;
static void ChangeWorkingDirectory(char *exe)
{
if (tv_reg > 0)
pl_rearmed_cbs.frameskip = -1;
}
- else if (!strcmp(argv[i],"-fullscreen")) g_opts |= 2;
- else if (!strcmp(argv[i],"-accel")) g_opts |= 4;
+ else if (!strcmp(argv[i],"-fullscreen")) g_maemo_opts |= 2;
+ else if (!strcmp(argv[i],"-accel")) g_maemo_opts |= 4;
else if (!strcmp(argv[i],"-sputhreaded")) iUseTimer=1;
else if (!strcmp(argv[i],"-nosound")) strcpy(Config.Spu, "spunull.so");
/* unworking with r10
hildon_init(&argc, &argv);
- char f_name[MAXPATHLEN];
- strcpy(f_name, strrchr(cdfile,'/'));
- file_name=f_name;
-
- if (cdfile)
+ if (cdfile) {
set_cd_image(cdfile);
+ strcpy(file_name, strrchr(cdfile,'/'));
+ }
if (SysInit() == -1)
return 1;
}
if (ready_to_go)
- maemo_init();
+ maemo_init(&argc, &argv);
else
{
printf ("somethings goes wrong, maybe you forgot -cdfile ? \n");