X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fgpu_neon%2Fpsx_gpu_if.c;h=250aa8c741f6d5ae8f5cf83750128f1017f0fb98;hp=8610c8313f63e3ec6eb373e085c07b30fd55ea7c;hb=3b3dee71d84bbbb376548d794b7a11cd38833cf0;hpb=c1817bd9249ee616cf9545a57136d6dd3669ce34 diff --git a/plugins/gpu_neon/psx_gpu_if.c b/plugins/gpu_neon/psx_gpu_if.c index 8610c831..250aa8c7 100644 --- a/plugins/gpu_neon/psx_gpu_if.c +++ b/plugins/gpu_neon/psx_gpu_if.c @@ -43,10 +43,27 @@ int renderer_init(void) { initialize_psx_gpu(&egpu, gpu.vram); ex_regs = gpu.ex_regs; - gpu.state.enhancement_available = 1; + + if (gpu.enhancement_bufer == NULL) { + // currently we use 4x 1024*1024 buffers instead of single 2048*1024 + // to be able to reuse 1024-width code better (triangle setup, + // dithering phase, lines). + gpu.enhancement_bufer = malloc(1024 * 1024 * 2 * 4); + if (gpu.enhancement_bufer == NULL) + printf("OOM for enhancement buffer\n"); + } + egpu.enhancement_buf_ptr = gpu.enhancement_bufer; + return 0; } +void renderer_finish(void) +{ + free(gpu.enhancement_bufer); + gpu.enhancement_bufer = NULL; + egpu.enhancement_buf_ptr = NULL; +} + void renderer_sync_ecmds(uint32_t *ecmds) { gpu_parse(&egpu, ecmds + 1, 6 * 4, NULL); @@ -64,17 +81,21 @@ void renderer_flush_queues(void) void renderer_set_interlace(int enable, int is_odd) { - egpu.interlace_mode &= ~(RENDER_INTERLACE_ENABLED|RENDER_INTERLACE_ODD); + egpu.render_mode &= ~(RENDER_INTERLACE_ENABLED|RENDER_INTERLACE_ODD); if (enable) - egpu.interlace_mode |= RENDER_INTERLACE_ENABLED; + egpu.render_mode |= RENDER_INTERLACE_ENABLED; if (is_odd) - egpu.interlace_mode |= RENDER_INTERLACE_ODD; + egpu.render_mode |= RENDER_INTERLACE_ODD; +} + +void renderer_notify_res_change(void) +{ + egpu.enhancement_x_threshold = gpu.screen.hres; } #include "../../frontend/plugin_lib.h" void renderer_set_config(const struct rearmed_cbs *cbs) { - egpu.enhancement_buf_ptr = gpu.enhancement_bufer; disable_main_render = cbs->gpu_neon.enhancement_no_main; }