tune flip calls and frame setup

for pandora, mostly
This commit is contained in:
notaz 2013-07-28 16:45:13 +03:00
parent 9c9cda8c39
commit b7d64dbdb7
5 changed files with 15 additions and 13 deletions

View file

@ -1424,11 +1424,6 @@ PICO_INTERNAL void PicoFrameStart(void)
lines = 240; lines = 240;
} }
HighCol = HighColBase + offs * HighColIncrement;
DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;
DrawScanline = 0;
skip_next_line = 0;
if (rendstatus != rendstatus_old || lines != rendlines) { if (rendstatus != rendstatus_old || lines != rendlines) {
rendlines = lines; rendlines = lines;
// mode_change() might reset rendstatus_old by calling SetColorFormat // mode_change() might reset rendstatus_old by calling SetColorFormat
@ -1437,6 +1432,11 @@ PICO_INTERNAL void PicoFrameStart(void)
rendstatus_old = rendstatus; rendstatus_old = rendstatus;
} }
HighCol = HighColBase + offs * HighColIncrement;
DrawLineDest = (char *)DrawLineDestBase + offs * DrawLineDestIncrement;
DrawScanline = 0;
skip_next_line = 0;
if (PicoOpt & POPT_ALT_RENDERER) if (PicoOpt & POPT_ALT_RENDERER)
return; return;

View file

@ -48,7 +48,8 @@ currentConfig_t currentConfig, defaultConfig;
int state_slot = 0; int state_slot = 0;
int config_slot = 0, config_slot_current = 0; int config_slot = 0, config_slot_current = 0;
int pico_pen_x = 320/2, pico_pen_y = 240/2; int pico_pen_x = 320/2, pico_pen_y = 240/2;
int pico_inp_mode = 0; int pico_inp_mode;
int flip_after_sync;
int engineState = PGS_Menu; int engineState = PGS_Menu;
static short __attribute__((aligned(4))) sndBuffer[2*44100/50]; static short __attribute__((aligned(4))) sndBuffer[2*44100/50];
@ -1431,7 +1432,8 @@ void emu_loop(void)
PicoFrame(); PicoFrame();
pemu_finalize_frame(fpsbuff, notice_msg); pemu_finalize_frame(fpsbuff, notice_msg);
// plat_video_flip(); if (!flip_after_sync)
plat_video_flip();
/* frame limiter */ /* frame limiter */
if (!reset_timing && !(currentConfig.EmuOpt & (EOPT_NO_FRMLIMIT|EOPT_EXT_FRMLIMIT))) if (!reset_timing && !(currentConfig.EmuOpt & (EOPT_NO_FRMLIMIT|EOPT_EXT_FRMLIMIT)))
@ -1449,9 +1451,8 @@ void emu_loop(void)
} }
} }
// XXX: for some plats it might be better to flip before vsync if (flip_after_sync)
// (due to shadow registers in display hw) plat_video_flip();
plat_video_flip();
pframes_done++; frames_done++; frames_shown++; pframes_done++; frames_done++; frames_shown++;

View file

@ -82,6 +82,7 @@ extern int state_slot;
extern int config_slot, config_slot_current; extern int config_slot, config_slot_current;
extern unsigned char *movie_data; extern unsigned char *movie_data;
extern int reset_timing; extern int reset_timing;
extern int flip_after_sync;
#define PICO_PEN_ADJUST_X 4 #define PICO_PEN_ADJUST_X 4
#define PICO_PEN_ADJUST_Y 2 #define PICO_PEN_ADJUST_Y 2

View file

@ -202,6 +202,7 @@ void plat_init(void)
in_set_config(in_name_to_id("evdev:pollux-analog"), IN_CFG_KEY_NAMES, in_set_config(in_name_to_id("evdev:pollux-analog"), IN_CFG_KEY_NAMES,
caanoo_keys, sizeof(caanoo_keys)); caanoo_keys, sizeof(caanoo_keys));
flip_after_sync = 1;
gp2x_menu_init(); gp2x_menu_init();
} }

View file

@ -300,9 +300,6 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols)
if (doing_bg_frame) if (doing_bg_frame)
return; return;
PicoDrawSetOutFormat(PDF_RGB555, 1);
PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);
if (is_32cols) { if (is_32cols) {
fb_w = 256; fb_w = 256;
fb_left = fb_right = 32; fb_left = fb_right = 32;
@ -353,6 +350,8 @@ void emu_video_mode_change(int start_line, int line_count, int is_32cols)
vout_fbdev_clear(layer_fb); 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, 3);
plat_video_flip(); plat_video_flip();
PicoDrawSetOutFormat(PDF_RGB555, 0);
} }
void plat_video_loop_prepare(void) void plat_video_loop_prepare(void)