From 9580402ab54487f0bf3f4d7a2288487243ddd2e3 Mon Sep 17 00:00:00 2001 From: Moss Gallagher Date: Sun, 11 Jun 2023 02:00:57 -0700 Subject: [PATCH 1/4] isle main: Matched startDirectSound to Original --- ISLE/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ISLE/main.cpp b/ISLE/main.cpp index 51c9b723..a0cd95b1 100644 --- a/ISLE/main.cpp +++ b/ISLE/main.cpp @@ -19,7 +19,7 @@ BOOL findExistingInstance(void) BOOL startDirectSound(void) { - LPDIRECTSOUND lpDS; + LPDIRECTSOUND lpDS = 0; HRESULT ret = DirectSoundCreate(NULL, &lpDS, NULL); if (ret == DS_OK && lpDS != NULL) { lpDS->Release(); From 4a1ac277f95632362d674b8d801a2722a94913da Mon Sep 17 00:00:00 2001 From: Moss Gallagher Date: Sun, 11 Jun 2023 02:03:07 -0700 Subject: [PATCH 2/4] isle: Partially Matched setupVideoFlags to Original For some reason the decomp version is doing the first xor in EnableFullScreen with the operands swapped. The source code and the original binary both have m_flags ^ e but the decomp binary has e ^ m_flags. This gives the same result but it is not a 100% match in the binary. I'm not sure why the compiler is doing this or how to change it but the other inaccuracy with the function is fixed. --- ISLE/isle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index cc9defe0..3756f916 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -234,8 +234,8 @@ void Isle::setupVideoFlags(BOOL fullScreen, BOOL flipSurfaces, BOOL backBuffers, m_videoParam.flags().EnableBackBuffers(backBuffers); m_videoParam.flags().EnableUnknown1(param_6); m_videoParam.flags().SetUnknown3(param_7); - m_videoParam.flags().EnableUnknown2(); m_videoParam.flags().EnableWideViewAngle(wideViewAngle); + m_videoParam.flags().EnableUnknown2(); m_videoParam.SetDeviceName(deviceId); if (using8bit) { m_videoParam.flags().Set8Bit(); From f81c5f944ccafd9a5004c676f96badbd767fd0ee Mon Sep 17 00:00:00 2001 From: Moss Gallagher Date: Sun, 11 Jun 2023 02:31:38 -0700 Subject: [PATCH 3/4] isle: Matched WNDCLASS_NAME to Original MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In 1.0 WINDOW_TITLE seems to be a define like WNDCLASS_NAME. However, in 1.1 it is a const char* like in the already existing code. It also has a value of "Lego Island" in 1.0 but a value of "Lego®" in 1.1. --- ISLE/define.cpp | 3 +-- ISLE/define.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ISLE/define.cpp b/ISLE/define.cpp index f5751c6e..7f574a8c 100644 --- a/ISLE/define.cpp +++ b/ISLE/define.cpp @@ -3,8 +3,7 @@ Isle *g_isle = 0; int g_closed = 0; -const char *WNDCLASS_NAME = "Lego Island MainNoM App"; -const char *WINDOW_TITLE = "LEGO®"; +const char *WINDOW_TITLE = "LEGO®"; unsigned char g_mousedown = 0; unsigned char g_mousemoved = 0; diff --git a/ISLE/define.h b/ISLE/define.h index ffa97a68..b104f239 100644 --- a/ISLE/define.h +++ b/ISLE/define.h @@ -5,7 +5,7 @@ class Isle; extern Isle *g_isle; extern int g_closed; -extern const char *WNDCLASS_NAME; +#define WNDCLASS_NAME "Lego Island MainNoM App" extern const char *WINDOW_TITLE; extern unsigned char g_mousedown; extern unsigned char g_mousemoved; From 1244a7a57be0cb2cefe5186db76e75c0a674dc77 Mon Sep 17 00:00:00 2001 From: Moss Gallagher Date: Sun, 11 Jun 2023 02:48:27 -0700 Subject: [PATCH 4/4] isle: Match readReg to Original --- ISLE/isle.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index 3756f916..ae4f5040 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -119,15 +119,17 @@ BOOL readReg(LPCSTR name, LPSTR outValue, DWORD outSize) HKEY hKey; DWORD valueType; + BOOL out = FALSE; + unsigned long size = outSize; if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { - if (RegQueryValueExA(hKey, name, NULL, &valueType, (LPBYTE) outValue, &outSize) == ERROR_SUCCESS) { + if (RegQueryValueExA(hKey, name, NULL, &valueType, (LPBYTE) outValue, &size) == ERROR_SUCCESS) { if (RegCloseKey(hKey) == ERROR_SUCCESS) { - return TRUE; + out = TRUE; } } } - return FALSE; + return out; } int readRegBool(LPCSTR name, BOOL *out)