X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=linux%2Fio.c;h=2767e68136fa6d1586a7ae0dc89032536e5c803c;hb=f342bededbe5d51afd1632e689f5105e50d4f63e;hp=7fff211770f0310b249497c5430009ae20885bf3;hpb=c66f49e61a09926e828b2685cc997a6ebee7cdb4;p=libpicofe.git diff --git a/linux/io.c b/linux/io.c index 7fff211..2767e68 100644 --- a/linux/io.c +++ b/linux/io.c @@ -1,10 +1,11 @@ #include #include #include -#include #include "../common/emu.h" #include "../common/menu.h" +#include "../common/plat.h" +#include "../common/input.h" #include "sndout_oss.h" #include "version.h" @@ -252,8 +253,8 @@ static void xlib_init(void) static void realloc_screen(void) { int size = scr_w * scr_h * 2; - g_menuscreen_w = scr_w; - g_menuscreen_h = scr_h; + g_screen_width = g_menuscreen_w = scr_w; + g_screen_height = g_menuscreen_h = scr_h; g_screen_ptr = realloc(g_screen_ptr, size); g_menubg_ptr = realloc(g_menubg_ptr, size); memset(g_screen_ptr, 0, size); @@ -302,6 +303,9 @@ void plat_video_flip(void) if (scr_changed) { realloc_screen(); ximage_realloc(xlib_display, DefaultVisual(xlib_display, 0)); + + // propagate new ponters to renderers + plat_video_toggle_renderer(0, 0); } } @@ -322,9 +326,8 @@ void plat_init(void) ret = vout_fbdev_init(&w, &h); if (ret != 0) exit(1); - g_menuscreen_w = w; - g_menuscreen_h = h; - g_screen_width = w; + 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 @@ -348,12 +351,12 @@ void plat_finish(void) } /* misc */ -int mp3_get_bitrate(FILE *f, int size) +int mp3_get_bitrate(void *f, int size) { return 128; } -void mp3_start_play(FILE *f, int pos) +void mp3_start_play(void *f, int pos) { } @@ -361,13 +364,20 @@ void mp3_update(int *buffer, int length, int stereo) { } -/* lprintf */ -void lprintf(const char *fmt, ...) -{ - va_list vl; +#include - va_start(vl, fmt); - vprintf(fmt, vl); - va_end(vl); -} +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 } +};