//#define log_io gpu_log
#define log_io(...)
-#define log_anomaly gpu_log
-//#define log_anomaly(...)
+//#define log_anomaly gpu_log
+#define log_anomaly(...)
struct psx_gpu gpu __attribute__((aligned(64)));
long GPUinit(void)
{
- int ret = vout_init();
- do_reset();
+ int ret;
+ ret = vout_init();
+ ret |= renderer_init();
+
gpu.lcf_hc = &gpu.zero;
gpu.state.frame_count = 0;
gpu.state.hcnt = &gpu.zero;
+ do_reset();
return ret;
}
if (is_read)
gpu.status.img = 1;
+ else
+ renderer_invalidate_caches(gpu.dma.x, gpu.dma.y, gpu.dma.w, gpu.dma.h);
log_io("start_vram_transfer %c (%d, %d) %dx%d\n", is_read ? 'r' : 'w',
gpu.dma.x, gpu.dma.y, gpu.dma.w, gpu.dma.h);
freeze->ulStatus = gpu.status.reg;
break;
case 0: // load
+ renderer_invalidate_caches(0, 0, 1024, 512);
memcpy(gpu.vram, freeze->psxVRam, sizeof(gpu.vram));
memcpy(gpu.regs, freeze->ulControl, sizeof(gpu.regs));
memcpy(gpu.ex_regs, freeze->ulControl + 0xe0, sizeof(gpu.ex_regs));
void do_cmd_list(uint32_t *list, int count);
+int renderer_init(void);
+void renderer_invalidate_caches(int x, int y, int w, int h);
+void renderer_flush_queues(void);
+
int vout_init(void);
int vout_finish(void);
{
old_status = gpu.status.reg;
old_h = h;
- screen_buf = cbs->pl_fbdev_set_mode(stride, h, gpu.status.rgb24 ? 24 : 16);
+ screen_buf = cbs->pl_vout_set_mode(stride, h, gpu.status.rgb24 ? 24 : 16);
}
dest = screen_buf;
}
}
- screen_buf = cbs->pl_fbdev_flip();
+ screen_buf = cbs->pl_vout_flip();
}
void GPUupdateLace(void)
return;
if (!gpu.status.blanking && gpu.state.fb_dirty) {
+ renderer_flush_queues();
blit();
gpu.state.fb_dirty = 0;
}
gpu.frameskip.enabled = cbs->frameskip;
gpu.frameskip.advice = &cbs->fskip_advice;
- cbs->pl_fbdev_open();
- screen_buf = cbs->pl_fbdev_flip();
+ cbs->pl_vout_open();
+ screen_buf = cbs->pl_vout_flip();
return 0;
}
long GPUclose(void)
{
- cbs->pl_fbdev_close();
+ cbs->pl_vout_close();
return 0;
}