2 * (C) GraÅžvydas "notaz" Ignotas, 2011
4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
13 extern const unsigned char cmd_lengths[256];
14 #define command_lengths cmd_lengths
16 static unsigned int *ex_regs;
19 #define SET_Ex(r, v) \
22 #include "psx_gpu/psx_gpu.c"
23 #include "psx_gpu/psx_gpu_parse.c"
24 #include "../gpulib/gpu.h"
26 static psx_gpu_struct egpu __attribute__((aligned(256)));
28 int do_cmd_list(uint32_t *list, int count, int *last_cmd)
32 if (gpu.state.enhancement_active)
33 ret = gpu_parse_enhanced(&egpu, list, count * 4, (u32 *)last_cmd);
35 ret = gpu_parse(&egpu, list, count * 4, (u32 *)last_cmd);
38 ex_regs[1] |= egpu.texture_settings & 0x1ff;
42 int renderer_init(void)
44 initialize_psx_gpu(&egpu, gpu.vram);
45 ex_regs = gpu.ex_regs;
46 gpu.state.enhancement_available = 1;
50 void renderer_sync_ecmds(uint32_t *ecmds)
52 gpu_parse(&egpu, ecmds + 1, 6 * 4, NULL);
55 void renderer_update_caches(int x, int y, int w, int h)
57 update_texture_cache_region(&egpu, x, y, x + w - 1, y + h - 1);
60 void renderer_flush_queues(void)
62 flush_render_block_buffer(&egpu);
65 void renderer_set_interlace(int enable, int is_odd)
67 egpu.render_mode &= ~(RENDER_INTERLACE_ENABLED|RENDER_INTERLACE_ODD);
69 egpu.render_mode |= RENDER_INTERLACE_ENABLED;
71 egpu.render_mode |= RENDER_INTERLACE_ODD;
74 #include "../../frontend/plugin_lib.h"
76 void renderer_set_config(const struct rearmed_cbs *cbs)
78 egpu.enhancement_buf_ptr = gpu.enhancement_bufer;
79 disable_main_render = cbs->gpu_neon.enhancement_no_main;