X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fgpulib%2Fgpu.c;h=32a797d58652594a5ad48813e6aa260e16376ee3;hb=688bdb9526d42181368e64ceaa6828727a10188c;hp=8e92c782c52ebfaad266b35bf712d2eb375fd6d2;hpb=89df80c636609625bb2e89099805f49cfef3ead0;p=pcsx_rearmed.git diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c index 8e92c782..32a797d5 100644 --- a/plugins/gpulib/gpu.c +++ b/plugins/gpulib/gpu.c @@ -126,17 +126,16 @@ static noinline void get_gpu_info(uint32_t data) case 0x02: case 0x03: case 0x04: - case 0x05: gpu.gp0 = gpu.ex_regs[data & 7] & 0xfffff; break; - case 0x06: - gpu.gp0 = gpu.ex_regs[5] & 0xfffff; + case 0x05: + gpu.gp0 = gpu.ex_regs[5] & 0x3fffff; break; case 0x07: gpu.gp0 = 2; break; default: - gpu.gp0 = 0; + // gpu.gp0 unchanged break; } } @@ -360,7 +359,7 @@ static void start_vram_transfer(uint32_t pos_word, uint32_t size_word, int is_re if (is_read) { gpu.status |= PSX_GPU_STATUS_IMG; // XXX: wrong for width 1 - memcpy(&gpu.gp0, VRAM_MEM_XY(gpu.dma.x, gpu.dma.y), 4); + gpu.gp0 = LE32TOH(*(uint32_t *) VRAM_MEM_XY(gpu.dma.x, gpu.dma.y)); gpu.state.last_vram_read_frame = *gpu.state.frame_count; } @@ -612,8 +611,11 @@ uint32_t GPUreadData(void) flush_cmd_buffer(); ret = gpu.gp0; - if (gpu.dma.h) + if (gpu.dma.h) { + ret = HTOLE32(ret); do_vram_io(&ret, 1, 1); + ret = LE32TOH(ret); + } log_io("gpu_read %08x\n", ret); return ret;