X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flinux%2Fio.c;h=edc5f6eb661d22716c617950d5fa7608cfa80df4;hb=75bf03886e4acb87bd7922d42d828f56c5dbe4bb;hp=1122e8a77a0a49c36623de0b14f9a57100e112c6;hpb=93a7109873b7050a1b347972711982eac1ad7fbc;p=picodrive.git diff --git a/platform/linux/io.c b/platform/linux/io.c index 1122e8a..edc5f6e 100644 --- a/platform/linux/io.c +++ b/platform/linux/io.c @@ -1,17 +1,23 @@ +/* + * PicoDrive + * (C) notaz, 2007-2010 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ #include #include #include +#include "../libpicofe/menu.h" +#include "../libpicofe/input.h" #include "../common/emu.h" -#include "../common/menu.h" -#include "../common/plat.h" -#include "sndout_oss.h" +#include "../common/input_pico.h" #include "version.h" #include "log_io.h" int current_keys; -unsigned char *PicoDraw2FB; #ifdef FBDEV @@ -25,7 +31,7 @@ unsigned char *PicoDraw2FB; static int current_bpp = 16; static int current_pal[256]; static const char *verstring = "PicoDrive " VERSION; -static int scr_changed = 0, scr_w = SCREEN_WIDTH, scr_h = SCREEN_HEIGHT; +static int scr_changed = 0, scr_w = 320, scr_h = 240; /* faking GP2X pad */ enum { GP2X_UP=0x1, GP2X_LEFT=0x4, GP2X_DOWN=0x10, GP2X_RIGHT=0x40, @@ -258,7 +264,6 @@ static void realloc_screen(void) g_menubg_ptr = realloc(g_menubg_ptr, size); memset(g_screen_ptr, 0, size); memset(g_menubg_ptr, 0, size); - PicoDraw2FB = g_menubg_ptr; scr_changed = 0; } @@ -328,15 +333,11 @@ void plat_init(void) g_screen_width = g_menuscreen_w = w; g_screen_height = g_menuscreen_h = h; g_menubg_ptr = realloc(g_menubg_ptr, w * g_screen_height * 2); - PicoDraw2FB = g_menubg_ptr; #else realloc_screen(); memset(g_screen_ptr, 0, g_screen_width * g_screen_height * 2); xlib_init(); #endif - - // snd - sndout_oss_init(); } void plat_finish(void) @@ -346,7 +347,6 @@ void plat_finish(void) #else free(g_screen_ptr); #endif - sndout_oss_exit(); } /* misc */ @@ -363,3 +363,20 @@ void mp3_update(int *buffer, int length, int stereo) { } +#include + +struct in_default_bind in_evdev_defbinds[] = +{ + /* MXYZ SACB RLDU */ + { KEY_UP, IN_BINDTYPE_PLAYER12, 0 }, + { KEY_DOWN, IN_BINDTYPE_PLAYER12, 1 }, + { KEY_LEFT, IN_BINDTYPE_PLAYER12, 2 }, + { KEY_RIGHT, IN_BINDTYPE_PLAYER12, 3 }, + { KEY_S, IN_BINDTYPE_PLAYER12, 4 }, /* B */ + { KEY_D, IN_BINDTYPE_PLAYER12, 5 }, /* C */ + { KEY_A, IN_BINDTYPE_PLAYER12, 6 }, /* A */ + { KEY_ENTER, IN_BINDTYPE_PLAYER12, 7 }, + { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU }, + { 0, 0, 0 } +}; +