X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fplat.c;h=1815274b814d1b9ec28fb37df3b37eed47b5cb6c;hb=ca69c3e5a0ecf407c02dc85c6f3282ebb1efc5a2;hp=b95334da63ad98ac9460ef708631ec6fe8f43ea7;hpb=a33164fffe6463cd0aa698fac2bcc1fc213af18e;p=libpicofe.git diff --git a/pandora/plat.c b/pandora/plat.c index b95334d..1815274 100644 --- a/pandora/plat.c +++ b/pandora/plat.c @@ -5,7 +5,6 @@ #include #include -#include #include #include #include @@ -21,6 +20,7 @@ #include "../common/input.h" #include "../linux/sndout_oss.h" #include "../linux/fbdev.h" +#include "../linux/xenv.h" #include "plat.h" #include "asm_utils.h" #include "version.h" @@ -30,6 +30,8 @@ #include static struct vout_fbdev *main_fb, *layer_fb; +// g_layer_* - in use, g_layer_c* - configured custom +int g_layer_cx, g_layer_cy, g_layer_cw, g_layer_ch; static int g_layer_x, g_layer_y; static int g_layer_w = 320, g_layer_h = 240; static int g_osd_fps_x, g_osd_y, doing_bg_frame; @@ -59,6 +61,30 @@ static const char * const pandora_gpio_keys[KEY_MAX + 1] = { [KEY_MENU] = "Pandora", }; +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 }, + { KEY_SPACE, IN_BINDTYPE_EMU, PEVB_MENU }, + /* Pandora */ + { KEY_PAGEDOWN, IN_BINDTYPE_PLAYER12, 4 }, + { KEY_END, IN_BINDTYPE_PLAYER12, 5 }, + { KEY_HOME, IN_BINDTYPE_PLAYER12, 6 }, + { KEY_LEFTALT, IN_BINDTYPE_PLAYER12, 7 }, + { KEY_RIGHTSHIFT,IN_BINDTYPE_EMU, PEVB_STATE_SAVE }, + { KEY_RIGHTCTRL, IN_BINDTYPE_EMU, PEVB_STATE_LOAD }, + { KEY_LEFTCTRL, IN_BINDTYPE_EMU, PEVB_MENU }, + { 0, 0, 0 } +}; + static int get_cpu_clock(void) { FILE *f; @@ -144,6 +170,10 @@ void pemu_finalize_frame(const char *fps, const char *notice) void plat_video_flip(void) { g_screen_ptr = vout_fbdev_flip(layer_fb); + + // XXX: drain OS event queue here, maybe we'll actually use it someday.. + int dummy; + xenv_update(&dummy); } void plat_video_toggle_renderer(int change, int is_menu) @@ -442,8 +472,8 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols) g_osd_y = fb_top + fb_h - 8; pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h); - vout_fbdev_resize(layer_fb, fb_w, fb_h, fb_left, fb_right, fb_top, fb_bottom, 0); vout_fbdev_clear(layer_fb); + vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 3); plat_video_flip(); } @@ -517,26 +547,6 @@ void plat_wait_till_us(unsigned int us_to) */ } -const char *plat_get_credits(void) -{ - return "PicoDrive v" VERSION " (c) notaz, 2006-2010\n\n\n" - "Credits:\n" - "fDave: Cyclone 68000 core,\n" - " base code of PicoDrive\n" - "Reesy & FluBBa: DrZ80 core\n" - "MAME devs: YM2612 and SN76496 cores\n" - "Pandora team: Pandora\n" - "Inder, ketchupgun: graphics\n" - "\n" - "special thanks (for docs, ideas):\n" - " Charles MacDonald, Haze,\n" - " Stephane Dallongeville,\n" - " Lordus, Exophase, Rokas,\n" - " Nemesis, Tasco Deluxe"; -} - -#include "../linux/oshide.h" - void plat_early_init(void) { } @@ -569,10 +579,10 @@ void plat_init(void) exit(1); } - oshide_init(); + xenv_init(); w = h = 0; - main_fb = vout_fbdev_init(main_fb_name, &w, &h, 0); + main_fb = vout_fbdev_init(main_fb_name, &w, &h, 16, 2); if (main_fb == NULL) { fprintf(stderr, "couldn't init fb: %s\n", main_fb_name); exit(1); @@ -583,7 +593,7 @@ void plat_init(void) g_menuscreen_ptr = vout_fbdev_flip(main_fb); w = 320; h = 240; - layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 0); + layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 3); if (layer_fb == NULL) { fprintf(stderr, "couldn't init fb: %s\n", layer_fb_name); goto fail0; @@ -622,18 +632,8 @@ void plat_finish(void) { sndout_oss_exit(); vout_fbdev_finish(main_fb); - oshide_finish(); + xenv_finish(); printf("all done\n"); } -/* lprintf */ -void lprintf(const char *fmt, ...) -{ - va_list vl; - - va_start(vl, fmt); - vprintf(fmt, vl); - va_end(vl); -} -