From 9580402ab54487f0bf3f4d7a2288487243ddd2e3 Mon Sep 17 00:00:00 2001 From: Moss Gallagher Date: Sun, 11 Jun 2023 02:00:57 -0700 Subject: [PATCH 01/18] 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 02/18] 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 03/18] 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 04/18] 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) From cb8fac86627d763f4266a148a0d55743acdfd719 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:07:15 +0200 Subject: [PATCH 05/18] Create build.yml --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..87eb4c46 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: ISO + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/checkout@v3 + with: + repository: 'itsmattkc/msvc420' + path: msvc420 + + - name: Set up DX5 SDK + run: | + mkdir dx5sdk + cd dx5sdk + wget https://ia800700.us.archive.org/9/items/idx5sdk/idx5sdk.exe + 7z x .\idx5sdk.exe + 7z x .\DX5SDK.EXE + cd cdrom + .\SETUP.EXE + + - name: Build + run: | + ./msvc420/BIN/VCVARS32.BAT x86 + mkdir Release + nmake /f isle.mak CFG="ISLE - Win32 Release" + + - name: Upload Artifact + uses: actions/upload-artifact@master + with: + name: Win32 + path: Release From 06f907782ac4c0b85c084a7e5020db5bd0f34a6d Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:16:58 +0200 Subject: [PATCH 06/18] Create setup.iss --- dx5sdk/cdrom/setup.iss | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 dx5sdk/cdrom/setup.iss diff --git a/dx5sdk/cdrom/setup.iss b/dx5sdk/cdrom/setup.iss new file mode 100644 index 00000000..65d3f56f --- /dev/null +++ b/dx5sdk/cdrom/setup.iss @@ -0,0 +1,34 @@ +[InstallShield Silent] +Version=v5.00.000 +File=Response File +[DlgOrder] +Dlg0=SdWelcome-0 +Count=7 +Dlg1=SdLicense-0 +Dlg2=SdSetupTypeEx-0 +Dlg3=SdAskDestPath-0 +Dlg4=SdSelectFolder-0 +Dlg5=SdStartCopy-0 +Dlg6=SdFinish-0 +[SdWelcome-0] +Result=1 +[SdLicense-0] +Result=1 +[SdSetupTypeEx-0] +Result=Compact +[SdAskDestPath-0] +szDir=C:\dxsdk +Result=1 +[SdSelectFolder-0] +szFolder=Microsoft DirectX 5 SDK +Result=1 +[SdStartCopy-0] +Result=1 +[Application] +Name=the Microsoft DirectX 5 SDK +Version=5 +Company=Microsoft +[SdFinish-0] +Result=1 +bOpt1=0 +bOpt2=0 From 4a961d452ccb20cfb93b1c74a911c46e352db0c7 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:17:41 +0200 Subject: [PATCH 07/18] use the answer file --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87eb4c46..3694583b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: ISO +name: Build on: push: @@ -22,11 +22,11 @@ jobs: run: | mkdir dx5sdk cd dx5sdk - wget https://ia800700.us.archive.org/9/items/idx5sdk/idx5sdk.exe + wget https://archive.org/download/idx5sdk/idx5sdk.exe 7z x .\idx5sdk.exe 7z x .\DX5SDK.EXE cd cdrom - .\SETUP.EXE + .\SETUP.EXE /s - name: Build run: | From 30a91afe6a6553d5249c4e3fee15384464b5292c Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:18:32 +0200 Subject: [PATCH 08/18] wget not found --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3694583b..ce81ca61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: run: | mkdir dx5sdk cd dx5sdk - wget https://archive.org/download/idx5sdk/idx5sdk.exe + C:\msys64\usr\bin\wget.exe https://archive.org/download/idx5sdk/idx5sdk.exe 7z x .\idx5sdk.exe 7z x .\DX5SDK.EXE cd cdrom From 596335f409eefe8c9da0c68cebf85d3744b09ca1 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:19:33 +0200 Subject: [PATCH 09/18] dont fail if dir exists --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce81ca61..47f23d80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Set up DX5 SDK run: | - mkdir dx5sdk + mkdir -p dx5sdk cd dx5sdk C:\msys64\usr\bin\wget.exe https://archive.org/download/idx5sdk/idx5sdk.exe 7z x .\idx5sdk.exe @@ -31,7 +31,7 @@ jobs: - name: Build run: | ./msvc420/BIN/VCVARS32.BAT x86 - mkdir Release + mkdir -p Release nmake /f isle.mak CFG="ISLE - Win32 Release" - name: Upload Artifact From b922043edcfd33b02c7607585f4b584110f1973c Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:20:39 +0200 Subject: [PATCH 10/18] screw you windows --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47f23d80..a4cee99c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,6 @@ jobs: - name: Set up DX5 SDK run: | - mkdir -p dx5sdk cd dx5sdk C:\msys64\usr\bin\wget.exe https://archive.org/download/idx5sdk/idx5sdk.exe 7z x .\idx5sdk.exe @@ -31,7 +30,7 @@ jobs: - name: Build run: | ./msvc420/BIN/VCVARS32.BAT x86 - mkdir -p Release + mkdir Release nmake /f isle.mak CFG="ISLE - Win32 Release" - name: Upload Artifact From df3bf6cf2eea7fde741c92c5c1c577eb42ec7bc0 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:24:19 +0200 Subject: [PATCH 11/18] use 420 nmake --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4cee99c..4c945537 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,9 +29,9 @@ jobs: - name: Build run: | - ./msvc420/BIN/VCVARS32.BAT x86 + ./msvc420/bin/VCVARS32.BAT x86 mkdir Release - nmake /f isle.mak CFG="ISLE - Win32 Release" + ./msvc420/bin/NMAKE.EXE /f isle.mak CFG="ISLE - Win32 Release" - name: Upload Artifact uses: actions/upload-artifact@master From 1d1041c06feaca5e9471546371b614d33642d3b2 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:27:14 +0200 Subject: [PATCH 12/18] make vcvars stick --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c945537..3cf2e733 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,9 @@ jobs: .\SETUP.EXE /s - name: Build + shell: cmd run: | - ./msvc420/bin/VCVARS32.BAT x86 + call ./msvc420/bin/VCVARS32.BAT x86 mkdir Release ./msvc420/bin/NMAKE.EXE /f isle.mak CFG="ISLE - Win32 Release" From da227101a0b2f2628b4d1cb18b04ce846a195595 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 14:30:54 +0200 Subject: [PATCH 13/18] another windows moment --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cf2e733..50fa4e29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,9 +30,9 @@ jobs: - name: Build shell: cmd run: | - call ./msvc420/bin/VCVARS32.BAT x86 + call .\msvc420\bin\VCVARS32.BAT x86 mkdir Release - ./msvc420/bin/NMAKE.EXE /f isle.mak CFG="ISLE - Win32 Release" + .\msvc420\bin\NMAKE.EXE /f isle.mak CFG="ISLE - Win32 Release" - name: Upload Artifact uses: actions/upload-artifact@master From 01845a94abed50a702d797b394090fc77ac0672c Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sun, 11 Jun 2023 16:12:41 +0200 Subject: [PATCH 14/18] Use WM_SYSCOMMAND type constants --- ISLE/isle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index cc9defe0..ca81f887 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -324,18 +324,18 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_ENTERMENULOOP: return DefWindowProcA(hWnd,WM_ENTERMENULOOP,wParam,lParam); case WM_SYSCOMMAND: - if (wParam == 0xf140) { + if (wParam == SC_SCREENSAVE) { return 0; } - if (wParam == 0xf060 && g_closed == 0) { + if (wParam == SC_CLOSE && g_closed == 0) { if (g_isle) { if (g_rmDisabled) { ShowWindow(g_isle->m_windowHandle, SW_RESTORE); } - PostMessageA(g_isle->m_windowHandle, 0x10, 0, 0); + PostMessageA(g_isle->m_windowHandle, WM_CLOSE, 0, 0); return 0; } - } else if (g_isle && g_isle->m_fullScreen && (wParam == 0xf010 || wParam == 0xf100)) { + } else if (g_isle && g_isle->m_fullScreen && (wParam == SC_MOVE || wParam == SC_KEYMENU)) { return 0; } return DefWindowProcA(hWnd,WM_SYSCOMMAND,wParam,lParam); From 1efb87500a6b17204eda9aea67518898242096f3 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 18:54:16 +0200 Subject: [PATCH 15/18] cache dxsdk folder on C --- .github/workflows/build.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50fa4e29..8adf34c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,13 +17,22 @@ jobs: with: repository: 'itsmattkc/msvc420' path: msvc420 - - - name: Set up DX5 SDK + + - name: Cache DX5 SDK + id: cache-dx5 + uses: actions/cache@v3 + with: + path: C:\dxsdk + key: dx5sdk + + - name: Setup DX5 SDK + if: steps.cache-dx5.outputs.cache-hit != 'true' run: | cd dx5sdk C:\msys64\usr\bin\wget.exe https://archive.org/download/idx5sdk/idx5sdk.exe 7z x .\idx5sdk.exe 7z x .\DX5SDK.EXE + cd dx5sdk cd cdrom .\SETUP.EXE /s From cb253618186e688961a00c2982b36785c46a6c5a Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 18:55:47 +0200 Subject: [PATCH 16/18] double folder?? --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8adf34c0..b6a9955d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,6 @@ jobs: C:\msys64\usr\bin\wget.exe https://archive.org/download/idx5sdk/idx5sdk.exe 7z x .\idx5sdk.exe 7z x .\DX5SDK.EXE - cd dx5sdk cd cdrom .\SETUP.EXE /s From dedc88d7ca6f4288dc7ec4b0ab8b55583545dce0 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 18:59:44 +0200 Subject: [PATCH 17/18] do it in the 2 step way --- .github/workflows/build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6a9955d..daecc1a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,9 +18,9 @@ jobs: repository: 'itsmattkc/msvc420' path: msvc420 - - name: Cache DX5 SDK + - name: Restore cached DX5 SDK id: cache-dx5 - uses: actions/cache@v3 + uses: actions/cache/restore@v3 with: path: C:\dxsdk key: dx5sdk @@ -34,6 +34,14 @@ jobs: 7z x .\DX5SDK.EXE cd cdrom .\SETUP.EXE /s + + - name: Cache DX5 SDK + if: steps.cache-dx5.outputs.cache-hit != 'true' + id: save-dx5 + uses: actions/cache/save@v3 + with: + path: C:\dxsdk + key: dx5sdk - name: Build shell: cmd From 6b6f32e8d5c8006feac31d14485c0098747e6924 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sun, 11 Jun 2023 19:02:41 +0200 Subject: [PATCH 18/18] actions can't handle it, only cache the download --- .github/workflows/build.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index daecc1a2..55a1eb50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,10 @@ jobs: id: cache-dx5 uses: actions/cache/restore@v3 with: - path: C:\dxsdk + path: dx5sdk key: dx5sdk - - name: Setup DX5 SDK + - name: Download DX5 SDK if: steps.cache-dx5.outputs.cache-hit != 'true' run: | cd dx5sdk @@ -33,16 +33,21 @@ jobs: 7z x .\idx5sdk.exe 7z x .\DX5SDK.EXE cd cdrom - .\SETUP.EXE /s - name: Cache DX5 SDK if: steps.cache-dx5.outputs.cache-hit != 'true' id: save-dx5 uses: actions/cache/save@v3 with: - path: C:\dxsdk + path: dx5sdk key: dx5sdk - + + - name: Setup DX5 SDK + run: | + cd dx5sdk + cd cdrom + .\SETUP.EXE /s + - name: Build shell: cmd run: |