From 335c7ad7e2210583e8fd5bf1d1e9d63e4d367c1b Mon Sep 17 00:00:00 2001 From: rogerman Date: Sun, 21 Sep 2025 21:07:41 -0700 Subject: [PATCH] GPU: ClearWithColor() running in 15-bit color mode now always clears both native and custom buffers. - This is being done for compatibility with less sophisticated clients that don't handle the NDSDisplayInfo.isCustomSizeRequested flag. --- desmume/src/GPU.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index 4d95ddfe1..56964f8fe 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -5646,20 +5646,10 @@ void GPUSubsystem::ClearWithColor(const u16 colorBGRA5551) if (this->_displayInfo.colorFormat == NDSColorFormat_BGR555_Rev) { - if (this->_displayInfo.isCustomSizeRequested) + for (size_t i = 0; i < this->_displayInfo.framebufferPageCount; i++) { - for (size_t i = 0; i < this->_displayInfo.framebufferPageCount; i++) - { - memset_u16((u8 *)this->_masterFramebuffer + (this->_displayInfo.framebufferPageSize * i), color16, nativeFramebufferPixCount); - memset_u16((u8 *)this->_masterFramebuffer + (this->_displayInfo.framebufferPageSize * i) + (nativeFramebufferPixCount * sizeof(u16)), color16, customFramebufferPixCount); - } - } - else - { - for (size_t i = 0; i < this->_displayInfo.framebufferPageCount; i++) - { - memset_u16((u8 *)this->_masterFramebuffer + (this->_displayInfo.framebufferPageSize * i), color16, nativeFramebufferPixCount); - } + memset_u16((u8 *)this->_masterFramebuffer + (this->_displayInfo.framebufferPageSize * i), color16, nativeFramebufferPixCount); + memset_u16((u8 *)this->_masterFramebuffer + (this->_displayInfo.framebufferPageSize * i) + (nativeFramebufferPixCount * sizeof(u16)), color16, customFramebufferPixCount); } } else