if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
- if (strcmp(var.value, "disabled") == 0)
- pl_rearmed_cbs.gpu_neon.enhancement_no_main = 0;
- else if (strcmp(var.value, "enabled") == 0)
+ if (strcmp(var.value, "enabled") == 0)
pl_rearmed_cbs.gpu_neon.enhancement_no_main = 1;
+ else
+ pl_rearmed_cbs.gpu_neon.enhancement_no_main = 0;
+ }
+
+ var.value = NULL;
+ var.key = "pcsx_rearmed_neon_enhancement_tex_adj";
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
+ {
+ if (strcmp(var.value, "enabled") == 0)
+ pl_rearmed_cbs.gpu_neon.enhancement_tex_adj = 1;
+ else
+ pl_rearmed_cbs.gpu_neon.enhancement_tex_adj = 0;
}
#endif
},
"disabled",
},
+ {
+ "pcsx_rearmed_neon_enhancement_tex_adj",
+ "(GPU) Enhanced Resolution Texture Adjustment",
+ "Enhanced Resolution Texture Adjustment",
+ "(Hack) Attempts to solve some texturing issues is some games, but causes new ones in others.",
+ NULL,
+ "gpu_neon",
+ {
+ { "disabled", NULL },
+ { "enabled", NULL },
+ { NULL, NULL },
+ },
+ "disabled",
+ },
#endif /* GPU_NEON */
#ifdef GPU_PEOPS
{
CE_INTVAL_P(gpu_neon.allow_interlace),
CE_INTVAL_P(gpu_neon.enhancement_enable),
CE_INTVAL_P(gpu_neon.enhancement_no_main),
+ CE_INTVAL_P(gpu_neon.enhancement_tex_adj),
CE_INTVAL_P(gpu_peopsgl.bDrawDither),
CE_INTVAL_P(gpu_peopsgl.iFilterType),
CE_INTVAL_P(gpu_peopsgl.iFrameTexType),
mee_enum ("Enable interlace mode", 0, pl_rearmed_cbs.gpu_neon.allow_interlace, men_gpu_interlace),
mee_onoff_h ("Enhanced resolution", 0, pl_rearmed_cbs.gpu_neon.enhancement_enable, 1, h_gpu_neon_enhanced),
mee_onoff_h ("Enhanced res. speed hack", 0, pl_rearmed_cbs.gpu_neon.enhancement_no_main, 1, h_gpu_neon_enhanced_hack),
+ mee_onoff ("Enh. res. texture adjust", 0, pl_rearmed_cbs.gpu_neon.enhancement_tex_adj, 1),
mee_end,
};
int enhancement_enable;
int enhancement_no_main;
int allow_dithering;
+ int enhancement_tex_adj;
} gpu_neon;
struct {
int iUseDither;
u16 enhancement_scanout_eselect; // eviction selector
u16 enhancement_current_buf;
+ u32 hack_disable_main:1;
+ u32 hack_texture_adj:1;
+
// Align up to 64 byte boundary to keep the upcoming buffers cache line
// aligned, also make reachable with single immediate addition
- u8 reserved_a[188 + 9*4 - 9*sizeof(void *)];
+ u8 reserved_a[184 + 9*4 - 9*sizeof(void *)];
// 8KB
block_struct blocks[MAX_BLOCKS_PER_ROW];
}
#endif
-static int disable_main_render;
-
// simple check for a case where no clipping is used
// - now handled by adjusting the viewport
static int check_enhanced_range(psx_gpu_struct *psx_gpu, int x, int y)
vertex_ptrs[i].v = new;
}
+// this sometimes does more harm than good, like in PE2
static void uv_hack(vertex_struct *vertex_ptrs, int vertex_count)
{
int i, u[4], v[4];
if (!prepare_triangle(psx_gpu, vertexes, vertex_ptrs))
return;
- if (!disable_main_render)
+ if (!psx_gpu->hack_disable_main)
render_triangle_p(psx_gpu, vertex_ptrs, current_command);
if (!check_enhanced_range(psx_gpu, vertex_ptrs[0]->x, vertex_ptrs[2]->x))
get_vertex_data_xy_uv(2, 10);
get_vertex_data_xy_uv(3, 14);
- uv_hack(vertexes, 4);
+ if (psx_gpu->hack_texture_adj)
+ uv_hack(vertexes, 4);
do_quad_enhanced(psx_gpu, vertexes, current_command);
gput_sum(cpu_cycles_sum, cpu_cycles, gput_quad_base_t());
break;
get_vertex_data_xy_uv_rgb(2, 12);
get_vertex_data_xy_uv_rgb(3, 18);
- uv_hack(vertexes, 4);
+ if (psx_gpu->hack_texture_adj)
+ uv_hack(vertexes, 4);
do_quad_enhanced(psx_gpu, vertexes, current_command);
gput_sum(cpu_cycles_sum, cpu_cycles, gput_quad_base_gt());
break;
egpu.dither_table[3] = dither_table_row(3, -1, 2, -2);
}
- disable_main_render = cbs->gpu_neon.enhancement_no_main;
+ egpu.hack_disable_main = cbs->gpu_neon.enhancement_no_main;
+ egpu.hack_texture_adj = cbs->gpu_neon.enhancement_tex_adj;
if (gpu.state.enhancement_enable) {
if (gpu.mmap != NULL && egpu.enhancement_buf_ptr == NULL)
map_enhancement_buffer();