Make scanline core options dynamic for sw renderer (#585)

This commit is contained in:
ggdrt 2020-02-24 20:32:11 -08:00
parent 2e24b487a6
commit dcabf59c66
4 changed files with 16 additions and 5 deletions

View File

@ -4221,7 +4221,6 @@ void retro_run(void)
{
has_new_geometry = false;
}
}
switch (psx_gpu_dither_mode)
@ -4236,6 +4235,9 @@ void retro_run(void)
break;
}
GPU_set_visible_scanlines(MDFN_GetSettingI(content_is_pal ? "psx.slstartp" : "psx.slstart"),
MDFN_GetSettingI(content_is_pal ? "psx.slendp" : "psx.slend"));
PGXP_SetModes(psx_pgxp_mode | psx_pgxp_vertex_caching | psx_pgxp_texture_correction);
}

View File

@ -610,7 +610,7 @@ struct retro_core_option_definition option_defs_us[] = {
{
BEETLE_OPT(initial_scanline),
"Initial Scanline - NTSC",
"Select the first displayed scanline when running NTSC content. Setting a value greater than zero will reduce the height of output images by cropping pixels from the topmost edge. May be used to counteract letterboxing. Requires restart for software renderer.",
"Select the first displayed scanline when running NTSC content. Setting a value greater than zero will reduce the height of output images by cropping pixels from the topmost edge. May be used to counteract letterboxing.",
{
{ "0", NULL },
{ "1", NULL },
@ -660,7 +660,7 @@ struct retro_core_option_definition option_defs_us[] = {
{
BEETLE_OPT(last_scanline),
"Last Scanline - NTSC",
"Select the last displayed scanline when running NTSC content. Setting a value less than 239 will reduce the height of output images by cropping pixels from the bottommost edge. May be used to counteract letterboxing. Requires restart for software renderer.",
"Select the last displayed scanline when running NTSC content. Setting a value less than 239 will reduce the height of output images by cropping pixels from the bottommost edge. May be used to counteract letterboxing.",
{
{ "210", NULL },
{ "211", NULL },
@ -699,7 +699,7 @@ struct retro_core_option_definition option_defs_us[] = {
{
BEETLE_OPT(initial_scanline_pal),
"Initial Scanline - PAL",
"Select the first displayed scanline when running PAL content. Setting a value greater than zero will reduce the height of output images by cropping pixels from the topmost edge. May be used to counteract letterboxing. Requires restart for software renderer.",
"Select the first displayed scanline when running PAL content. Setting a value greater than zero will reduce the height of output images by cropping pixels from the topmost edge. May be used to counteract letterboxing.",
{
{ "0", NULL },
{ "1", NULL },
@ -749,7 +749,7 @@ struct retro_core_option_definition option_defs_us[] = {
{
BEETLE_OPT(last_scanline_pal),
"Last Scanline - PAL",
"Select the last displayed scanline when running PAL content. Setting a value less than 287 will reduce the height of output images by cropping pixels from the bottommost edge. May be used to counteract letterboxing. Requires restart for software renderer.",
"Select the last displayed scanline when running PAL content. Setting a value less than 287 will reduce the height of output images by cropping pixels from the bottommost edge. May be used to counteract letterboxing.",
{
{ "230", NULL },
{ "231", NULL },

View File

@ -2108,3 +2108,10 @@ int32_t GPU_GetScanlineNum(void)
{
return GPU.scanline;
}
/* Beetle PSX addition, allows runtime configuration of visible scanlines in software renderer */
void GPU_set_visible_scanlines(int sls, int sle)
{
GPU.LineVisFirst = sls;
GPU.LineVisLast = sle;
}

View File

@ -281,4 +281,6 @@ int32_t GPU_GetScanlineNum(void);
void texel_put(uint32 x, uint32 y, uint16 v);
void GPU_set_visible_scanlines(int sls, int sle); // Beetle PSX addition
#endif