From 13ccf9a160f38eff5d0b85db28625a6dd38b191d Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Sat, 28 Jun 2025 21:43:40 +0200 Subject: [PATCH] MMU: Fix bit width for 32bit MMIO reads This resolves the ghost input issue in N64 virtual console --- src/Cafe/HW/MMU/MMU.cpp | 2 +- src/Cafe/HW/MMU/MMU.h | 2 +- src/Cafe/HW/SI/SI.cpp | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Cafe/HW/MMU/MMU.cpp b/src/Cafe/HW/MMU/MMU.cpp index 04ee8877..f88c3d0d 100644 --- a/src/Cafe/HW/MMU/MMU.cpp +++ b/src/Cafe/HW/MMU/MMU.cpp @@ -500,7 +500,7 @@ namespace MMU // todo - instead of passing the physical address to Read/WriteMMIO we should pass an interface id and a relative address? This would allow remapping the hardware address (tho we can just unregister + register at different addresses) - uint16 ReadMMIO_32(PAddr address) + uint32 ReadMMIO_32(PAddr address) { cemu_assert_debug((address & 0x3) == 0); auto itr = g_mmioHandlerR32->find(address); diff --git a/src/Cafe/HW/MMU/MMU.h b/src/Cafe/HW/MMU/MMU.h index 794785fa..a8367f88 100644 --- a/src/Cafe/HW/MMU/MMU.h +++ b/src/Cafe/HW/MMU/MMU.h @@ -261,7 +261,7 @@ namespace MMU void WriteMMIO_32(PAddr address, uint32 value); void WriteMMIO_16(PAddr address, uint16 value); - uint16 ReadMMIO_32(PAddr address); + uint32 ReadMMIO_32(PAddr address); uint16 ReadMMIO_16(PAddr address); } diff --git a/src/Cafe/HW/SI/SI.cpp b/src/Cafe/HW/SI/SI.cpp index 16cfb894..026543d8 100644 --- a/src/Cafe/HW/SI/SI.cpp +++ b/src/Cafe/HW/SI/SI.cpp @@ -87,7 +87,6 @@ namespace HW_SI HWREG::SICOMCSR SI_COMCSR_R32(PAddr addr) { - //cemuLog_logDebug(LogType::Force, "Read SICOMCSR"); return g_si.registerState.sicomcsr; }