From 9bc36c00ce0c88d60f1d5b358bd912eaad9e5c12 Mon Sep 17 00:00:00 2001 From: Dennis Kempin Date: Wed, 18 Feb 2026 15:59:01 -0800 Subject: [PATCH] Snes: Fix integer overflow for calculating dma overhead RunDma will transfer up to 2^16 bytes, this will overflow the uint8_t counter. This has no practical implications other than SyncEndDma not calculating the right amount of cycles to add. I am not aware of this behavior causing any issues in games. --- Core/SNES/SnesDmaController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/SNES/SnesDmaController.cpp b/Core/SNES/SnesDmaController.cpp index 7fc0d5f05..03e7d7297 100644 --- a/Core/SNES/SnesDmaController.cpp +++ b/Core/SNES/SnesDmaController.cpp @@ -78,7 +78,7 @@ void SnesDmaController::RunDma(DmaChannelConfig &channel) const uint8_t *transferOffsets = _transferOffset[channel.TransferMode]; - uint8_t i = 0; + uint32_t i = 0; do { //Manual DMA transfers run to the end of the transfer when started CopyDmaByte(