X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flinux%2Fio.c;h=57601ccc9d4220c6fff41d22296862ff0d02b911;hb=ee3c39efd2cf51cd654b6240f6fb595673f10f45;hp=2767e68136fa6d1586a7ae0dc89032536e5c803c;hpb=21ebcfd322972ea5579bb5d4bedee9e509b42785;p=picodrive.git diff --git a/platform/linux/io.c b/platform/linux/io.c index 2767e68..57601cc 100644 --- a/platform/linux/io.c +++ b/platform/linux/io.c @@ -1,18 +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 "../common/input.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 @@ -26,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, @@ -129,7 +134,7 @@ static void xlib_update(void) XLockDisplay(xlib_display); xstatus = XPutImage(xlib_display, xlib_window, DefaultGC(xlib_display, 0), ximage, - 0, 0, 0, 0, g_screen_width, g_screen_height); + 0, 0, 0, 0, g_screen_ppitch, g_screen_height); if (xstatus != 0) fprintf(stderr, "XPutImage %d\n", xstatus); @@ -255,11 +260,11 @@ static void realloc_screen(void) int size = scr_w * scr_h * 2; g_screen_width = g_menuscreen_w = scr_w; g_screen_height = g_menuscreen_h = scr_h; + g_screen_ppitch = g_menuscreen_pp = scr_w; g_screen_ptr = realloc(g_screen_ptr, size); 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; } @@ -271,7 +276,7 @@ void plat_video_flip(void) if (ximage == NULL) return; - pixel_count = g_screen_width * g_screen_height; + pixel_count = g_screen_ppitch * g_screen_height; image = (void *)ximage->data; if (current_bpp == 8) @@ -328,16 +333,13 @@ void plat_init(void) exit(1); g_screen_width = g_menuscreen_w = w; g_screen_height = g_menuscreen_h = h; + g_screen_ppitch = g_menuscreen_pp = w; 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) @@ -347,7 +349,6 @@ void plat_finish(void) #else free(g_screen_ptr); #endif - sndout_oss_exit(); } /* misc */