X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fpandora%2Fplat.c;h=2171c036a3db24aef5537d3c37552caf48bc2f59;hb=a93a80deda2211dc89ea543841e71cdaf6f65917;hp=a9fa99207168ca3976185571a441746ac3b8672c;hpb=b7d64dbdb78425b501093dfb137072459b5b3f0f;p=picodrive.git diff --git a/platform/pandora/plat.c b/platform/pandora/plat.c index a9fa992..2171c03 100644 --- a/platform/pandora/plat.c +++ b/platform/pandora/plat.c @@ -40,7 +40,6 @@ 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; -static const char pnd_script_base[] = "sudo -n /usr/pandora/scripts"; static unsigned char __attribute__((aligned(4))) fb_copy[320 * 240 * 2]; static void *temp_frame; const char *renderer_names[] = { NULL }; @@ -73,23 +72,29 @@ static struct in_default_bind in_evdev_defbinds[] = { KEY_S, IN_BINDTYPE_PLAYER12, GBTN_B }, { KEY_D, IN_BINDTYPE_PLAYER12, GBTN_C }, { KEY_ENTER, IN_BINDTYPE_PLAYER12, GBTN_START }, - { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU }, + { KEY_F, IN_BINDTYPE_EMU, PEVB_FF }, + { KEY_BACKSPACE,IN_BINDTYPE_EMU, PEVB_FF }, + { KEY_BACKSLASH,IN_BINDTYPE_EMU, PEVB_MENU }, { KEY_SPACE, IN_BINDTYPE_EMU, PEVB_MENU }, - /* Pandora */ + { KEY_LEFTCTRL, IN_BINDTYPE_EMU, PEVB_MENU }, { KEY_HOME, IN_BINDTYPE_PLAYER12, GBTN_A }, { KEY_PAGEDOWN, IN_BINDTYPE_PLAYER12, GBTN_B }, { KEY_END, IN_BINDTYPE_PLAYER12, GBTN_C }, { KEY_LEFTALT, IN_BINDTYPE_PLAYER12, GBTN_START }, - { KEY_RIGHTSHIFT,IN_BINDTYPE_EMU, PEVB_STATE_SAVE }, - { KEY_RIGHTCTRL, IN_BINDTYPE_EMU, PEVB_STATE_LOAD }, - { KEY_LEFTCTRL, IN_BINDTYPE_EMU, PEVB_MENU }, + { KEY_1, IN_BINDTYPE_EMU, PEVB_STATE_SAVE }, + { KEY_2, IN_BINDTYPE_EMU, PEVB_STATE_LOAD }, + { KEY_3, IN_BINDTYPE_EMU, PEVB_SSLOT_PREV }, + { KEY_4, IN_BINDTYPE_EMU, PEVB_SSLOT_NEXT }, + { KEY_5, IN_BINDTYPE_EMU, PEVB_PICO_PPREV }, + { KEY_6, IN_BINDTYPE_EMU, PEVB_PICO_PNEXT }, + { KEY_7, IN_BINDTYPE_EMU, PEVB_PICO_SWINP }, { 0, 0, 0 } }; void pemu_prep_defconfig(void) { defaultConfig.EmuOpt |= EOPT_VSYNC|EOPT_16BPP; - defaultConfig.s_PicoOpt |= POPT_EN_MCD_GFX|POPT_EN_MCD_PSYNC; + defaultConfig.s_PicoOpt |= POPT_EN_MCD_GFX; defaultConfig.scaling = SCALE_2x2_3x2; } @@ -104,10 +109,13 @@ static void osd_text(int x, int y, const char *text) int i, h; len++; + if (x + len > g_screen_width) + len = g_screen_width - x; + for (h = 0; h < 8; h++) { unsigned short *p; p = (unsigned short *)g_screen_ptr + x + g_screen_width*(y + h); - for (i = len; i; i--, p++) + for (i = len; i > 0; i--, p++) *p = (*p>>2) & 0x39e7; } emu_text_out16(x, y, text); @@ -348,7 +356,7 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols) pnd_setup_layer(1, g_layer_x, g_layer_y, g_layer_w, g_layer_h); vout_fbdev_clear(layer_fb); - vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 3); + vout_fbdev_resize(layer_fb, fb_w, fb_h, 16, fb_left, fb_right, fb_top, fb_bottom, 4); plat_video_flip(); PicoDrawSetOutFormat(PDF_RGB555, 0); @@ -366,6 +374,8 @@ void plat_video_loop_prepare(void) void pemu_loop_prep(void) { // dirty buffers better go now than during gameplay + fflush(stdout); + fflush(stderr); sync(); sleep(0); } @@ -447,7 +457,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, 16, 3); + layer_fb = vout_fbdev_init(layer_fb_name, &w, &h, 16, 4); if (layer_fb == NULL) { fprintf(stderr, "couldn't init fb: %s\n", layer_fb_name); goto fail0;