Copy tile-based fast renderer buffer

Also omit renderer option when RENDER_GSKIT_PS2 is used since it seems to have its own logic
This commit is contained in:
bmaupin
2020-02-25 13:34:02 -05:00
parent 0f3f206b3c
commit 6877c461f6
2 changed files with 21 additions and 0 deletions

View File

@@ -1545,6 +1545,25 @@ void retro_run(void)
ps2->padding = padding;
#else
if (PicoIn.opt & POPT_ALT_RENDERER) {
/* In retro_init, PicoDrawSetOutBuf is called to make sure the output gets written to vout_buf, but this only
* applies to the line renderer (pico/draw.c). The faster tile-based renderer (pico/draw2.c) enabled by
* POPT_ALT_RENDERER writes to Pico.est.Draw2FB, so we need to manually copy that to vout_buf.
*/
/* This section is mostly copied from pemu_finalize_frame in platform/linux/emu.c */
unsigned short *pd = (unsigned short *)vout_buf;
/* Skip the leftmost 8 columns (it seems to be used as some sort of caching or overscan area) */
unsigned char *ps = Pico.est.Draw2FB + 8;
unsigned short *pal = Pico.est.HighPal;
int x;
if (Pico.m.dirtyPal)
PicoDrawUpdateHighPal();
/* Copy up to the max height to include the overscan area, and skip the leftmost 8 columns again */
for (i = 0; i < VOUT_MAX_HEIGHT; i++, ps += 8)
for (x = 0; x < vout_width; x++)
*pd++ = pal[*ps++];
}
buff = (char*)vout_buf + vout_offset;
#endif

View File

@@ -200,6 +200,7 @@ struct retro_core_option_definition option_defs_us[] = {
},
"60"
},
#if !defined(RENDER_GSKIT_PS2)
{
"picodrive_renderer",
"Renderer",
@@ -211,6 +212,7 @@ struct retro_core_option_definition option_defs_us[] = {
},
"accurate"
},
#endif
{ NULL, NULL, NULL, {{0}}, NULL },
};