gpu.dma.h = size_word >> 16;
gpu.dma.offset = 0;
- if (is_read)
+ renderer_flush_queues();
+ if (is_read) {
gpu.status.img = 1;
+ // XXX: wrong for width 1
+ memcpy(&gpu.gp0, VRAM_MEM_XY(gpu.dma.x, gpu.dma.y), 4);
+ }
else {
- renderer_flush_queues();
renderer_invalidate_caches(gpu.dma.x, gpu.dma.y, gpu.dma.w, gpu.dma.h);
}
uint32_t GPUreadData(void)
{
- log_io("gpu_read\n");
+ uint32_t ret;
if (unlikely(gpu.cmd_len > 0))
flush_cmd_buffer();
+ ret = gpu.gp0;
if (gpu.dma.h)
- do_vram_io(&gpu.gp0, 1, 1);
+ do_vram_io(&ret, 1, 1);
- return gpu.gp0;
+ log_io("gpu_read %08x\n", ret);
+ return ret;
}
uint32_t GPUreadStatus(void)