if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
- if (strcmp(var.value, "disabled") == 0)
+ if (strcmp(var.value, "force") == 0)
{
- pl_rearmed_cbs.gpu_peops.iUseDither = 0;
+ pl_rearmed_cbs.dithering = 2;
+ pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 1;
+ }
+ else if (strcmp(var.value, "disabled") == 0)
+ {
+ pl_rearmed_cbs.dithering = 0;
pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 0;
- pl_rearmed_cbs.gpu_unai.dithering = 0;
-#ifdef GPU_NEON
- pl_rearmed_cbs.gpu_neon.allow_dithering = 0;
-#endif
}
- else if (strcmp(var.value, "enabled") == 0)
+ else
{
- pl_rearmed_cbs.gpu_peops.iUseDither = 1;
+ pl_rearmed_cbs.dithering = 1;
pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 1;
- pl_rearmed_cbs.gpu_unai.dithering = 1;
-#ifdef GPU_NEON
- pl_rearmed_cbs.gpu_neon.allow_dithering = 1;
-#endif
}
}
if (environ_cb(RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE, &rumble))
rumble_cb = rumble.set_rumble_state;
- pl_rearmed_cbs.gpu_peops.iUseDither = 1;
pl_rearmed_cbs.gpu_peops.dwActFixes = GPU_PEOPS_OLD_FRAME_SKIP;
SaveFuncs.open = save_open;
"pcsx_rearmed_dithering",
"Dithering Pattern",
NULL,
- "Enable emulation of the dithering technique used by the PSX to smooth out color banding artifacts. Increases performance requirements.",
+ "Enable emulation of the dithering technique used by the PSX to smooth out color banding artifacts. \"Force\" enables it even if the game turns it off. Increases performance requirements.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
+ { "force", "Force" },
{ NULL, NULL },
},
#if defined(_3DS)
Config.GpuListWalking = -1;
Config.FractionalFramerate = -1;
+ pl_rearmed_cbs.dithering = 1;
pl_rearmed_cbs.gpu_neon.allow_interlace = 2; // auto
- pl_rearmed_cbs.gpu_neon.allow_dithering = 1;
pl_rearmed_cbs.gpu_neon.enhancement_enable =
pl_rearmed_cbs.gpu_neon.enhancement_no_main = 0;
pl_rearmed_cbs.gpu_neon.enhancement_tex_adj = 1;
- pl_rearmed_cbs.gpu_peops.iUseDither = 0;
pl_rearmed_cbs.gpu_peops.dwActFixes = 1<<7;
pl_rearmed_cbs.gpu_unai.old_renderer = 0;
pl_rearmed_cbs.gpu_unai.ilace_force = 0;
pl_rearmed_cbs.gpu_unai.lighting = 1;
pl_rearmed_cbs.gpu_unai.fast_lighting = 0;
pl_rearmed_cbs.gpu_unai.blending = 1;
- pl_rearmed_cbs.gpu_unai.dithering = 0;
memset(&pl_rearmed_cbs.gpu_peopsgl, 0, sizeof(pl_rearmed_cbs.gpu_peopsgl));
pl_rearmed_cbs.gpu_peopsgl.iVRamSize = 64;
pl_rearmed_cbs.gpu_peopsgl.iTexGarbageCollection = 1;
CE_INTVAL_N("adev0_is_nublike", in_adev_is_nublike[0]),
CE_INTVAL_N("adev1_is_nublike", in_adev_is_nublike[1]),
CE_INTVAL_V(frameskip, 4),
- CE_INTVAL_P(gpu_peops.iUseDither),
+ CE_INTVAL_PV(dithering, 2),
CE_INTVAL_P(gpu_peops.dwActFixes),
CE_INTVAL_P(gpu_unai.old_renderer),
CE_INTVAL_P(gpu_unai.ilace_force),
CE_INTVAL_P(gpu_unai.lighting),
CE_INTVAL_P(gpu_unai.fast_lighting),
CE_INTVAL_P(gpu_unai.blending),
- CE_INTVAL_P(gpu_unai.dithering),
CE_INTVAL_P(gpu_unai.scale_hires),
CE_INTVAL_P(gpu_neon.allow_interlace),
CE_INTVAL_P(gpu_neon.enhancement_enable),
mee_onoff_h ("Enhanced res. speed hack", 0, pl_rearmed_cbs.gpu_neon.enhancement_no_main, 1, h_gpu_neon_enhanced_hack),
mee_onoff_h ("Enh. res. texture adjust", 0, pl_rearmed_cbs.gpu_neon.enhancement_tex_adj, 1, h_gpu_neon_enhanced_texadj),
mee_enum ("Enable interlace mode", 0, pl_rearmed_cbs.gpu_neon.allow_interlace, men_gpu_interlace),
- mee_onoff ("Enable dithering", 0, pl_rearmed_cbs.gpu_neon.allow_dithering, 1),
mee_end,
};
{
mee_onoff ("Old renderer", 0, pl_rearmed_cbs.gpu_unai.old_renderer, 1),
mee_onoff ("Interlace", 0, pl_rearmed_cbs.gpu_unai.ilace_force, 1),
- mee_onoff ("Dithering", 0, pl_rearmed_cbs.gpu_unai.dithering, 1),
mee_onoff ("Lighting", 0, pl_rearmed_cbs.gpu_unai.lighting, 1),
mee_onoff ("Fast lighting", 0, pl_rearmed_cbs.gpu_unai.fast_lighting, 1),
mee_onoff ("Blending", 0, pl_rearmed_cbs.gpu_unai.blending, 1),
}
-static const char *men_gpu_dithering[] = { "None", "Game dependant", "Always", NULL };
//static const char h_gpu_0[] = "Needed for Chrono Cross";
static const char h_gpu_1[] = "Capcom fighting games";
static const char h_gpu_2[] = "Black screens in Lunar";
static menu_entry e_menu_plugin_gpu_peops[] =
{
- mee_enum ("Dithering", 0, pl_rearmed_cbs.gpu_peops.iUseDither, men_gpu_dithering),
// mee_onoff_h ("Odd/even bit hack", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<0, h_gpu_0),
mee_onoff_h ("Expand screen width", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<1, h_gpu_1),
mee_onoff_h ("Ignore brightness color", 0, pl_rearmed_cbs.gpu_peops.dwActFixes, 1<<2, h_gpu_2),
return 0;
}
+static const char *men_gpu_dithering[] = { "OFF", "ON", "Force", NULL };
+
static const char h_bios[] = "HLE is simulated BIOS. BIOS selection is saved in\n"
"savestates and can't be changed there. Must save\n"
"config and reload the game for change to take effect";
static menu_entry e_menu_plugin_options[] =
{
mee_enum_h ("BIOS", 0, bios_sel, bioses, h_bios),
+ mee_enum ("GPU Dithering", 0, pl_rearmed_cbs.dithering, men_gpu_dithering),
mee_enum_h ("GPU plugin", 0, gpu_plugsel, gpu_plugins, h_plugin_gpu),
mee_enum_h ("SPU plugin", 0, spu_plugsel, spu_plugins, h_plugin_spu),
#ifdef BUILTIN_GPU_NEON
unsigned int flip_cnt; // increment manually if not using pl_vout_flip
unsigned int only_16bpp; // platform is 16bpp-only
unsigned int thread_rendering;
+ unsigned int dithering; // 0 off, 1 on, 2 force
struct {
int allow_interlace; // 0 off, 1 on, 2 guess
int enhancement_enable;
int enhancement_no_main;
- int allow_dithering;
int enhancement_tex_adj;
} gpu_neon;
struct {
- int iUseDither;
int dwActFixes;
float fFrameRateHz;
int dwFrameRateTicks;
int lighting;
int fast_lighting;
int blending;
- int dithering;
int scale_hires;
} gpu_unai;
struct {
void renderer_set_config(const struct rearmed_cbs *cbs)
{
- iUseDither = cbs->gpu_peops.iUseDither;
+ iUseDither = cbs->dithering;
dwActFixes = cbs->gpu_peops.dwActFixes;
if (cbs->pl_set_gpu_caps)
cbs->pl_set_gpu_caps(0);
u16 enhancement_scanout_eselect; // eviction selector
u16 enhancement_current_buf;
+ u32 allow_dithering:1;
+ u32 force_dithering:1;
u32 hack_disable_main:1;
u32 hack_texture_adj:1;
u8 texture_4bpp_cache[32][256 * 256];
u8 texture_8bpp_even_cache[16][256 * 256];
u8 texture_8bpp_odd_cache[16][256 * 256];
- int use_dithering;
} psx_gpu_struct;
typedef struct __attribute__((aligned(16)))
case 0xE1:
set_texture(psx_gpu, list[0]);
- if(list[0] & (1 << 9))
+ if ((psx_gpu->allow_dithering && (list[0] & (1 << 9)))
+ || psx_gpu->force_dithering)
psx_gpu->render_state_base |= RENDER_STATE_DITHER;
else
psx_gpu->render_state_base &= ~RENDER_STATE_DITHER;
case 0xE1:
set_texture(psx_gpu, list[0]);
- if(list[0] & (1 << 9))
+ if ((psx_gpu->allow_dithering && (list[0] & (1 << 9)))
+ || psx_gpu->force_dithering)
psx_gpu->render_state_base |= RENDER_STATE_DITHER;
else
psx_gpu->render_state_base &= ~RENDER_STATE_DITHER;
if (cbs->pl_set_gpu_caps)
cbs->pl_set_gpu_caps(GPU_CAP_SUPPORTS_2X);
- egpu.use_dithering = cbs->gpu_neon.allow_dithering;
- if(!egpu.use_dithering) {
+ egpu.allow_dithering = cbs->dithering;
+ egpu.force_dithering = cbs->dithering >> 1;
+ /*
+ if (!egpu.allow_dithering) {
egpu.dither_table[0] = dither_table_row(0, 0, 0, 0);
egpu.dither_table[1] = dither_table_row(0, 0, 0, 0);
egpu.dither_table[2] = dither_table_row(0, 0, 0, 0);
egpu.dither_table[2] = dither_table_row(-3, 1, -4, 0);
egpu.dither_table[3] = dither_table_row(3, -1, 2, -2);
}
+ */
egpu.hack_disable_main = cbs->gpu_neon.enhancement_no_main;
egpu.hack_texture_adj = cbs->gpu_neon.enhancement_tex_adj;
uint8_t fast_lighting:1;
uint8_t blending:1;
uint8_t dithering:1;
+ uint8_t force_dithering:1;
uint8_t old_renderer:1;
//senquack Only PCSX Rearmed's version of gpu_unai had this, and I
return gpu_unai.config.dithering;
}
-// For now, this is just for development/experimentation purposes..
-// If modified to return true, it will allow ignoring the status register
-// bit 9 setting (dither enable). It will still restrict dithering only
-// to Gouraud-shaded or texture-blended polys.
static inline bool ForcedDitheringEnabled()
{
- return false;
+ return gpu_unai.config.force_dithering;
}
static inline bool ProgressiveInterlaceEnabled()
gpu_unai.config.lighting = cbs->gpu_unai.lighting;
gpu_unai.config.fast_lighting = cbs->gpu_unai.fast_lighting;
gpu_unai.config.blending = cbs->gpu_unai.blending;
- gpu_unai.config.dithering = cbs->gpu_unai.dithering;
gpu_unai.config.scale_hires = cbs->gpu_unai.scale_hires;
+ gpu_unai.config.dithering = cbs->dithering != 0;
+ gpu_unai.config.force_dithering = cbs->dithering >> 1;
gpu.state.downscale_enable = gpu_unai.config.scale_hires;
if (gpu_unai.config.scale_hires) {