From 49f5a273fd9ee501d5cab2fb554b0a50c243e487 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Thu, 30 May 2024 11:52:21 +0200 Subject: [PATCH] Fix invalid variable types On SH4, uint32_t is "unsigned long" and int32_t is "long"; which means that "int32_t" and "int" pointers cannot be used interchangeably without an explicit cast. Signed-off-by: Paul Cercueil --- libpcsxcore/psxdma.c | 8 ++++++-- plugins/gpulib/gpu.c | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c index 55d2a0a7..68b9694f 100644 --- a/libpcsxcore/psxdma.c +++ b/libpcsxcore/psxdma.c @@ -136,7 +136,9 @@ static u32 gpuDmaChainSize(u32 addr) { void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU u32 *ptr, madr_next, *madr_next_p; u32 words, words_left, words_max, words_copy; - int cycles_sum, cycles_last_cmd = 0, do_walking; + s32 cycles_last_cmd = 0; + int do_walking; + long cycles_sum; madr &= ~3; switch (chcr) { @@ -225,7 +227,9 @@ void gpuInterrupt() { if (HW_DMA2_CHCR == SWAP32(0x01000401) && !(HW_DMA2_MADR & SWAP32(0x800000))) { u32 madr_next = 0xffffff, madr = SWAPu32(HW_DMA2_MADR); - int cycles_sum, cycles_last_cmd = 0; + s32 cycles_last_cmd = 0; + long cycles_sum; + cycles_sum = GPU_dmaChain((u32 *)psxM, madr & 0x1fffff, &madr_next, &cycles_last_cmd); HW_DMA2_MADR = SWAPu32(madr_next); diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c index b444dcf5..94027874 100644 --- a/plugins/gpulib/gpu.c +++ b/plugins/gpulib/gpu.c @@ -919,8 +919,8 @@ void GPUrearmedCallbacks(const struct rearmed_cbs *cbs) gpu.frameskip.advice = &cbs->fskip_advice; gpu.frameskip.active = 0; gpu.frameskip.frame_ready = 1; - gpu.state.hcnt = cbs->gpu_hcnt; - gpu.state.frame_count = cbs->gpu_frame_count; + gpu.state.hcnt = (uint32_t *)cbs->gpu_hcnt; + gpu.state.frame_count = (uint32_t *)cbs->gpu_frame_count; gpu.state.allow_interlace = cbs->gpu_neon.allow_interlace; gpu.state.enhancement_enable = cbs->gpu_neon.enhancement_enable; gpu.state.screen_centering_type_default = cbs->screen_centering_type_default; -- 2.39.2