X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fpandora%2Fplat.c;h=306f2c36821dadb19acdf6bb88489a7c7bca4eba;hb=a76fad41291b7be0b42554353d6775dcdff065e0;hp=49b8da6b0bb0c986692aa964ec3cbc7f230afe4d;hpb=d4d626658a7a999f48009f408b4a22d280ab80ea;p=picodrive.git diff --git a/platform/pandora/plat.c b/platform/pandora/plat.c index 49b8da6..306f2c3 100644 --- a/platform/pandora/plat.c +++ b/platform/pandora/plat.c @@ -43,7 +43,6 @@ 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; -unsigned char *PicoDraw2FB; const char *renderer_names[] = { NULL }; const char *renderer_names32x[] = { NULL }; @@ -74,6 +73,7 @@ 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_F, IN_BINDTYPE_EMU, PEVB_FF }, { KEY_BACKSLASH, IN_BINDTYPE_EMU, PEVB_MENU }, { KEY_SPACE, IN_BINDTYPE_EMU, PEVB_MENU }, /* Pandora */ @@ -105,10 +105,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); @@ -140,13 +143,6 @@ static void draw_cd_leds(void) } } -static int emuscan(unsigned int num) -{ - DrawLineDest = (unsigned short *)g_screen_ptr + num * g_screen_width; - - return 0; -} - void pemu_finalize_frame(const char *fps, const char *notice) { if (notice && notice[0]) @@ -160,6 +156,7 @@ void pemu_finalize_frame(const char *fps, const char *notice) void plat_video_flip(void) { g_screen_ptr = vout_fbdev_flip(layer_fb); + PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2); // XXX: drain OS event queue here, maybe we'll actually use it someday.. xenv_update(NULL, NULL, NULL, NULL); @@ -307,9 +304,6 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols) if (doing_bg_frame) return; - PicoDrawSetOutFormat(PDF_RGB555, 1); - PicoDrawSetCallbacks(emuscan, NULL); - if (is_32cols) { fb_w = 256; fb_left = fb_right = 32; @@ -358,8 +352,10 @@ 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); } void plat_video_loop_prepare(void) @@ -455,7 +451,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; @@ -474,7 +470,6 @@ void plat_init(void) } g_menubg_ptr = temp_frame; g_menubg_src_ptr = temp_frame; - PicoDraw2FB = temp_frame; pnd_menu_init();