From 426992525837e52b588726ac164fc952814fba81 Mon Sep 17 00:00:00 2001 From: rogerman Date: Mon, 20 Nov 2017 23:51:42 -0800 Subject: [PATCH] GPU: Properly initialize the newer NDSDisplayInfo fields. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - This has the side-effect of having the Windows port’s display window start up with a white screen and HUD showing (if enabled) just like before, rather than a black screen and HUD possibly hidden. --- desmume/src/GPU.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index 7788e7c2d..dccda52a9 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -7414,22 +7414,31 @@ GPUSubsystem::GPUSubsystem() _displayInfo.bufferIndex = 0; _displayInfo.masterFramebufferHead = _masterFramebuffer; _displayInfo.masterNativeBuffer = _masterFramebuffer; - _displayInfo.nativeBuffer[NDSDisplayID_Main] = _displayInfo.masterNativeBuffer; + _displayInfo.nativeBuffer[NDSDisplayID_Main] = _displayInfo.masterNativeBuffer; _displayInfo.nativeBuffer[NDSDisplayID_Touch] = (u8 *)_displayInfo.masterNativeBuffer + (GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT * _displayInfo.pixelBytes); _displayInfo.masterCustomBuffer = (u8 *)_masterFramebuffer + (GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT * 2 * _displayInfo.pixelBytes); - _displayInfo.customBuffer[NDSDisplayID_Main] = _displayInfo.masterCustomBuffer; + _displayInfo.customBuffer[NDSDisplayID_Main] = _displayInfo.masterCustomBuffer; _displayInfo.customBuffer[NDSDisplayID_Touch] = (u8 *)_displayInfo.masterCustomBuffer + (GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT * _displayInfo.pixelBytes); - _displayInfo.didPerformCustomRender[NDSDisplayID_Main] = false; + _displayInfo.didPerformCustomRender[NDSDisplayID_Main] = false; _displayInfo.didPerformCustomRender[NDSDisplayID_Touch] = false; - _displayInfo.renderedWidth[NDSDisplayID_Main] = GPU_FRAMEBUFFER_NATIVE_WIDTH; + _displayInfo.renderedWidth[NDSDisplayID_Main] = GPU_FRAMEBUFFER_NATIVE_WIDTH; _displayInfo.renderedWidth[NDSDisplayID_Touch] = GPU_FRAMEBUFFER_NATIVE_WIDTH; - _displayInfo.renderedHeight[NDSDisplayID_Main] = GPU_FRAMEBUFFER_NATIVE_HEIGHT; + _displayInfo.renderedHeight[NDSDisplayID_Main] = GPU_FRAMEBUFFER_NATIVE_HEIGHT; _displayInfo.renderedHeight[NDSDisplayID_Touch] = GPU_FRAMEBUFFER_NATIVE_HEIGHT; - _displayInfo.renderedBuffer[NDSDisplayID_Main] = _displayInfo.nativeBuffer[NDSDisplayID_Main]; + _displayInfo.renderedBuffer[NDSDisplayID_Main] = _displayInfo.nativeBuffer[NDSDisplayID_Main]; _displayInfo.renderedBuffer[NDSDisplayID_Touch] = _displayInfo.nativeBuffer[NDSDisplayID_Touch]; + _displayInfo.masterBrightnessDiffersPerLine[NDSDisplayID_Main] = false; + _displayInfo.masterBrightnessDiffersPerLine[NDSDisplayID_Touch] = false; + _displayInfo.backlightIntensity[NDSDisplayID_Main] = 1.0f; + _displayInfo.backlightIntensity[NDSDisplayID_Touch] = 1.0f; + _displayInfo.needConvertColorFormat[NDSDisplayID_Main] = false; + _displayInfo.needConvertColorFormat[NDSDisplayID_Touch] = false; + _displayInfo.needApplyMasterBrightness[NDSDisplayID_Main] = false; + _displayInfo.needApplyMasterBrightness[NDSDisplayID_Touch] = false; + ClearWithColor(0x8000); }