+ 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;
+}
+
+#define ENHANCEMENT_BUF_SIZE (1024 * 1024 * 2 * 4 + 4096)
+
+static void map_enhancement_buffer(void)
+{
+ // 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 = gpu.mmap(ENHANCEMENT_BUF_SIZE);
+ if (gpu.enhancement_bufer == NULL)
+ fprintf(stderr, "failed to map enhancement buffer\n");
+ egpu.enhancement_buf_ptr = gpu.enhancement_bufer;