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=d42f83a8c3623ffdb73536b9260f5d55ecc7075c;hp=3ff6e486bca7abf801e4a945883ac2bb870cad19;hb=f3492649a0ced3b4e81f6df6e93c81746fcad54b;hpb=62d7fa9555924ab8e152b546711d27add640b102 diff --git a/plugins/gpu_neon/psx_gpu_if.c b/plugins/gpu_neon/psx_gpu_if.c index 3ff6e486..d42f83a8 100644 --- a/plugins/gpu_neon/psx_gpu_if.c +++ b/plugins/gpu_neon/psx_gpu_if.c @@ -13,26 +13,43 @@ extern const unsigned char cmd_lengths[256]; #define command_lengths cmd_lengths +static unsigned int *ex_regs; + +#define PCSX +#define SET_Ex(r, v) \ + ex_regs[r] = v + #include "psx_gpu/psx_gpu.c" #include "psx_gpu/psx_gpu_parse.c" #include "../gpulib/gpu.h" static psx_gpu_struct egpu __attribute__((aligned(256))); -void do_cmd_list(uint32_t *list, int count) +int do_cmd_list(uint32_t *list, int count, int *last_cmd) { - gpu_parse(&egpu, list, count * 4); + int ret; + + if (gpu.state.enhancement_active) + ret = gpu_parse_enhanced(&egpu, list, count * 4, (u32 *)last_cmd); + else + ret = gpu_parse(&egpu, list, count * 4, (u32 *)last_cmd); + + ex_regs[1] &= ~0x1ff; + ex_regs[1] |= egpu.texture_settings & 0x1ff; + return ret; } int renderer_init(void) { initialize_psx_gpu(&egpu, gpu.vram); + ex_regs = gpu.ex_regs; + gpu.state.enhancement_available = 1; return 0; } void renderer_sync_ecmds(uint32_t *ecmds) { - gpu_parse(&egpu, ecmds + 1, 6 * 4); + gpu_parse(&egpu, ecmds + 1, 6 * 4, NULL); } void renderer_update_caches(int x, int y, int w, int h) @@ -47,13 +64,17 @@ 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; } +#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; }