mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2025-02-11 12:05:58 +00:00
(SW Renderer) Properly get and set internal/dither mask resolutions.
Should fix issue #211
This commit is contained in:
parent
f9ab0a1ed3
commit
ae09b521b1
14
libretro.cpp
14
libretro.cpp
@ -2269,8 +2269,8 @@ static void alloc_surface(void)
|
||||
uint32_t width = MEDNAFEN_CORE_GEOMETRY_MAX_W;
|
||||
uint32_t height = is_pal ? MEDNAFEN_CORE_GEOMETRY_MAX_H : 480;
|
||||
|
||||
width <<= GPU_get_dither_upscale_shift();
|
||||
height <<= GPU_get_dither_upscale_shift();
|
||||
width <<= GPU_get_upscale_shift();
|
||||
height <<= GPU_get_upscale_shift();
|
||||
|
||||
if (surf != NULL)
|
||||
delete surf;
|
||||
@ -3596,7 +3596,7 @@ void retro_run(void)
|
||||
retro_get_system_av_info(&new_av_info);
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &new_av_info);
|
||||
|
||||
if (GPU_get_dither_upscale_shift() != psx_gpu_upscale_shift)
|
||||
if (GPU_get_upscale_shift() != psx_gpu_upscale_shift)
|
||||
{
|
||||
struct retro_system_av_info new_av_info;
|
||||
retro_get_system_av_info(&new_av_info);
|
||||
@ -3610,17 +3610,17 @@ void retro_run(void)
|
||||
else
|
||||
{
|
||||
// Failed, we have to postpone the upscaling change
|
||||
psx_gpu_upscale_shift = GPU_get_dither_upscale_shift();
|
||||
psx_gpu_upscale_shift = GPU_get_upscale_shift();
|
||||
}
|
||||
}
|
||||
|
||||
switch (psx_gpu_dither_mode)
|
||||
{
|
||||
case DITHER_NATIVE:
|
||||
GPU_set_dither_upscale_shift(psx_gpu_upscale_shift);
|
||||
GPU_set_dither_upscale_shift(0);
|
||||
break;
|
||||
case DITHER_UPSCALED:
|
||||
GPU_set_dither_upscale_shift(0);
|
||||
GPU_set_dither_upscale_shift(psx_gpu_upscale_shift);
|
||||
break;
|
||||
case DITHER_OFF:
|
||||
break;
|
||||
@ -3766,7 +3766,7 @@ void retro_run(void)
|
||||
const void *fb = NULL;
|
||||
unsigned width = rects[0];
|
||||
unsigned height = spec.DisplayRect.h;
|
||||
uint8_t upscale_shift = GPU_get_dither_upscale_shift();
|
||||
uint8_t upscale_shift = GPU_get_upscale_shift();
|
||||
|
||||
if (rsx_intf_is_type() == RSX_SOFTWARE)
|
||||
{
|
||||
|
@ -1978,13 +1978,6 @@ int GPU_StateAction(StateMem *sm, int load, int data_only)
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
void GPU_set_dither_upscale_shift(uint8 upscale_shift)
|
||||
{
|
||||
PS_GPU *gpu = (PS_GPU*)GPU;
|
||||
gpu->dither_upscale_shift = upscale_shift;
|
||||
}
|
||||
|
||||
void GPU_set_display_change_count(unsigned a)
|
||||
{
|
||||
PS_GPU *gpu = (PS_GPU*)GPU;
|
||||
@ -1997,12 +1990,30 @@ unsigned GPU_get_display_change_count(void)
|
||||
return gpu->display_change_count;
|
||||
}
|
||||
|
||||
void GPU_set_dither_upscale_shift(uint8 factor)
|
||||
{
|
||||
PS_GPU *gpu = (PS_GPU*)GPU;
|
||||
gpu->dither_upscale_shift = factor;
|
||||
}
|
||||
|
||||
uint8 GPU_get_dither_upscale_shift(void)
|
||||
{
|
||||
PS_GPU *gpu = (PS_GPU*)GPU;
|
||||
return gpu->dither_upscale_shift;
|
||||
}
|
||||
|
||||
void GPU_set_upscale_shift(uint8 factor)
|
||||
{
|
||||
PS_GPU *gpu = (PS_GPU*)GPU;
|
||||
gpu->upscale_shift = factor;
|
||||
}
|
||||
|
||||
uint8 GPU_get_upscale_shift(void)
|
||||
{
|
||||
PS_GPU *gpu = (PS_GPU*)GPU;
|
||||
return gpu->upscale_shift;
|
||||
}
|
||||
|
||||
bool GPU_DMACanWrite(void)
|
||||
{
|
||||
return CalcFIFOReadyBit();
|
||||
|
@ -236,7 +236,11 @@ bool GPU_DMACanWrite(void);
|
||||
|
||||
uint8 GPU_get_dither_upscale_shift(void);
|
||||
|
||||
void GPU_set_dither_upscale_shift(uint8 upscale_shift);
|
||||
void GPU_set_dither_upscale_shift(uint8 factor);
|
||||
|
||||
uint8 GPU_get_upscale_shift(void);
|
||||
|
||||
void GPU_set_upscale_shift(uint8 factor);
|
||||
|
||||
void GPU_set_display_change_count(unsigned a);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user