From 4def024b7ce2f658126a1567a1eb14abefc41556 Mon Sep 17 00:00:00 2001 From: Logan McNaughton Date: Sun, 13 Jun 2021 08:44:43 -0600 Subject: [PATCH] update core --- mupen64plus-core/src/device/rcp/pi/pi_controller.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mupen64plus-core/src/device/rcp/pi/pi_controller.c b/mupen64plus-core/src/device/rcp/pi/pi_controller.c index 9a260ab..f5319a8 100644 --- a/mupen64plus-core/src/device/rcp/pi/pi_controller.c +++ b/mupen64plus-core/src/device/rcp/pi/pi_controller.c @@ -71,7 +71,7 @@ static void dma_pi_read(struct pi_controller* pi) pre_framebuffer_read(&pi->dp->fb, dram_addr); // PI seems to treat the first 128 bytes differently, see https://n64brew.dev/wiki/Peripheral_Interface#Unaligned_DMA_transfer - if (length > 0x80 && (length & 1)) + if (length >= 0x7f && (length & 1)) length += 1; unsigned int cycles = handler->dma_read(opaque, dram, dram_addr, cart_addr, length); @@ -107,10 +107,10 @@ static void dma_pi_write(struct pi_controller* pi) } // PI seems to treat the first 128 bytes differently, see https://n64brew.dev/wiki/Peripheral_Interface#Unaligned_DMA_transfer + if (length >= 0x7f && (length & 1)) + length += 1; if (length <= 0x80) length -= dram_addr & 0x7; - if (length > 0x80 && (length & 1)) - length += 1; unsigned int cycles = handler->dma_write(opaque, dram, dram_addr, cart_addr, length); post_framebuffer_write(&pi->dp->fb, dram_addr, length);