From 03fcad0bd23e863019f2d4909cd42d23b369e4d4 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sat, 10 Jun 2023 22:11:05 -0700 Subject: [PATCH 01/20] added some legoomni functions and named some isle global vars --- ISLE/define.cpp | 6 +- ISLE/define.h | 6 +- ISLE/isle.cpp | 14 ++--- ISLE/main.cpp | 6 +- LEGO1/legoomni.cpp | 13 +++++ LEGO1/legoomni.h | 4 +- isle.mak | 136 +++++++++++++++++++++++++++++++++------------ isle.mdp | Bin 41984 -> 44544 bytes 8 files changed, 131 insertions(+), 54 deletions(-) create mode 100644 LEGO1/legoomni.cpp diff --git a/ISLE/define.cpp b/ISLE/define.cpp index 24288885..f5751c6e 100644 --- a/ISLE/define.cpp +++ b/ISLE/define.cpp @@ -8,11 +8,11 @@ const char *WINDOW_TITLE = "LEGO unsigned char g_mousedown = 0; unsigned char g_mousemoved = 0; -int _DAT_00410050 = 0; +int g_rmDisabled = 0; int _DAT_00410054 = 1; int g_targetWidth = 640; int g_targetHeight = 480; unsigned int g_targetDepth = 16; -int _DAT_00410064 = 0; -int _DAT_004101bc = 200; +int g_reqEnableRMDevice = 0; +int g_startupDelay = 200; long g_lastFrameTime = 0; diff --git a/ISLE/define.h b/ISLE/define.h index e09a934a..ffa97a68 100644 --- a/ISLE/define.h +++ b/ISLE/define.h @@ -9,13 +9,13 @@ extern const char *WNDCLASS_NAME; extern const char *WINDOW_TITLE; extern unsigned char g_mousedown; extern unsigned char g_mousemoved; -extern int _DAT_00410050; +extern int g_rmDisabled; extern int _DAT_00410054; extern int g_targetWidth; extern int g_targetHeight; extern unsigned int g_targetDepth; -extern int _DAT_00410064; -extern int _DAT_004101bc; +extern int g_reqEnableRMDevice; +extern int g_startupDelay; extern long g_lastFrameTime; #endif // DEFINE_H diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index 5438005a..cc9defe0 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -329,7 +329,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } if (wParam == 0xf060 && g_closed == 0) { if (g_isle) { - if (_DAT_00410050 != 0) { + if (g_rmDisabled) { ShowWindow(g_isle->m_windowHandle, SW_RESTORE); } PostMessageA(g_isle->m_windowHandle, 0x10, 0, 0); @@ -359,14 +359,14 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (LOWORD(lParam) == g_targetWidth && HIWORD(lParam) == g_targetHeight && g_targetDepth == wParam) { valid = TRUE; } - if (_DAT_00410050 == 0) { + if (!g_rmDisabled) { if (!valid) { - _DAT_00410050 = 1; + g_rmDisabled = 1; Lego()->vtable38(); VideoManager()->DisableRMDevice(); } } else if (valid) { - _DAT_00410064 = 1; + g_reqEnableRMDevice = 1; } } else { _DAT_00410054 = 0; @@ -572,12 +572,12 @@ void Isle::tick(BOOL sleepIfNotNextFrame) } g_lastFrameTime = currentTime; - if (_DAT_004101bc == 0) { + if (g_startupDelay == 0) { return; } - _DAT_004101bc--; - if (_DAT_004101bc != 0) { + g_startupDelay--; + if (g_startupDelay != 0) { return; } diff --git a/ISLE/main.cpp b/ISLE/main.cpp index 0905c140..55be1653 100644 --- a/ISLE/main.cpp +++ b/ISLE/main.cpp @@ -103,10 +103,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine DispatchMessageA(&msg); } - if (_DAT_00410064 != 0) { - _DAT_00410064 = 0; + if (g_reqEnableRMDevice) { + g_reqEnableRMDevice = 0; VideoManager()->EnableRMDevice(); - _DAT_00410050 = 0; + g_rmDisabled = 0; Lego()->vtable3c(); } diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp new file mode 100644 index 00000000..e43be3bd --- /dev/null +++ b/LEGO1/legoomni.cpp @@ -0,0 +1,13 @@ +#include "legoomni.h" + +LegoOmni *LegoOmni::m_instance = NULL; + +LegoOmni *LegoOmni::GetInstance() +{ + return m_instance; +} + +LegoOmni *Lego() +{ + return LegoOmni::GetInstance(); +} diff --git a/LEGO1/legoomni.h b/LEGO1/legoomni.h index d319fb7e..0724f9b0 100644 --- a/LEGO1/legoomni.h +++ b/LEGO1/legoomni.h @@ -1,10 +1,10 @@ #ifndef LEGOOMNI_H #define LEGOOMNI_H -#include "define.h" #include "mxbackgroundaudiomanager.h" #include "mxdsaction.h" #include "mxomnicreateparam.h" +#include "mxresult.h" #include "mxstreamer.h" #include "mxticklemanager.h" #include "mxtimer.h" @@ -81,6 +81,8 @@ class LegoOmni int m_unk6c; LegoInputManager *m_inputMgr; + static LegoOmni *m_instance; + }; __declspec(dllexport) LegoOmni *Lego(); diff --git a/isle.mak b/isle.mak index 74713d10..d98109dc 100644 --- a/isle.mak +++ b/isle.mak @@ -51,15 +51,16 @@ NULL=nul OUTDIR=.\LEGO1\Release INTDIR=.\LEGO1\Release -ALL : "$(OUTDIR)\LEGO1.dll" +ALL : ".\Release\LEGO1.DLL" CLEAN : -@erase "$(INTDIR)\dllmain.obj" + -@erase "$(INTDIR)\legoomni.obj" -@erase "$(INTDIR)\mxcore.obj" - -@erase "$(OUTDIR)\LEGO1.dll" - -@erase "$(OUTDIR)\LEGO1.exp" - -@erase "$(OUTDIR)\LEGO1.lib" - -@erase "$(OUTDIR)\LEGO1.map" + -@erase ".\Release\LEGO1.DLL" + -@erase ".\Release\LEGO1.EXP" + -@erase ".\Release\LEGO1.LIB" + -@erase ".\Release\LEGO1.MAP" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" @@ -105,17 +106,19 @@ BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /map /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /pdb:"Release/LEGO1.PDB" /map:"Release/LEGO1.MAP" /machine:I386 /out:"Release/LEGO1.DLL" /implib:"Release/LEGO1.LIB" +# SUBTRACT LINK32 /pdb:none LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\ - /pdb:"$(OUTDIR)/LEGO1.pdb" /map:"$(INTDIR)/LEGO1.map" /machine:I386\ - /out:"$(OUTDIR)/LEGO1.dll" /implib:"$(OUTDIR)/LEGO1.lib" + /pdb:"Release/LEGO1.PDB" /map:"Release/LEGO1.MAP" /machine:I386\ + /out:"Release/LEGO1.DLL" /implib:"Release/LEGO1.LIB" LINK32_OBJS= \ "$(INTDIR)\dllmain.obj" \ + "$(INTDIR)\legoomni.obj" \ "$(INTDIR)\mxcore.obj" -"$(OUTDIR)\LEGO1.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) +".\Release\LEGO1.DLL" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << @@ -135,19 +138,20 @@ LINK32_OBJS= \ OUTDIR=.\LEGO1\Debug INTDIR=.\LEGO1\Debug -ALL : "$(OUTDIR)\LEGO1.dll" +ALL : ".\Debug\LEGO1.DLL" CLEAN : -@erase "$(INTDIR)\dllmain.obj" + -@erase "$(INTDIR)\legoomni.obj" -@erase "$(INTDIR)\mxcore.obj" -@erase "$(INTDIR)\vc40.idb" -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\LEGO1.dll" -@erase "$(OUTDIR)\LEGO1.exp" - -@erase "$(OUTDIR)\LEGO1.ilk" -@erase "$(OUTDIR)\LEGO1.lib" -@erase "$(OUTDIR)\LEGO1.map" -@erase "$(OUTDIR)\LEGO1.pdb" + -@erase ".\Debug\LEGO1.DLL" + -@erase ".\Debug\LEGO1.ILK" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" @@ -193,17 +197,19 @@ BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /map /debug /machine:I386 /out:"Debug/LEGO1.DLL" +# SUBTRACT LINK32 /pdb:none LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes\ /pdb:"$(OUTDIR)/LEGO1.pdb" /map:"$(INTDIR)/LEGO1.map" /debug /machine:I386\ - /out:"$(OUTDIR)/LEGO1.dll" /implib:"$(OUTDIR)/LEGO1.lib" + /out:"Debug/LEGO1.DLL" /implib:"$(OUTDIR)/LEGO1.lib" LINK32_OBJS= \ "$(INTDIR)\dllmain.obj" \ + "$(INTDIR)\legoomni.obj" \ "$(INTDIR)\mxcore.obj" -"$(OUTDIR)\LEGO1.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) +".\Debug\LEGO1.DLL" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << @@ -223,7 +229,7 @@ LINK32_OBJS= \ OUTDIR=.\ISLE\Release INTDIR=.\ISLE\Release -ALL : "$(OUTDIR)\ISLE.exe" +ALL : "LEGO1 - Win32 Release" ".\Release\ISLE.EXE" CLEAN : -@erase "$(INTDIR)\define.obj" @@ -231,7 +237,7 @@ CLEAN : -@erase "$(INTDIR)\isle.res" -@erase "$(INTDIR)\main.obj" -@erase "$(INTDIR)\mxomnicreateparambase.obj" - -@erase "$(OUTDIR)\ISLE.exe" + -@erase ".\Release\ISLE.EXE" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" @@ -278,21 +284,22 @@ BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows /machine:I386 /LIBPATH:"ISLE\EXT" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows /pdb:"Release/ISLE.PDB" /machine:I386 /out:"Release/ISLE.EXE" /LIBPATH:"ISLE/ext" # SUBTRACT LINK32 /pdb:none LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows\ - /incremental:no /pdb:"$(OUTDIR)/ISLE.pdb" /machine:I386\ - /out:"$(OUTDIR)/ISLE.exe" /LIBPATH:"ISLE\EXT" + /incremental:no /pdb:"Release/ISLE.PDB" /machine:I386 /out:"Release/ISLE.EXE"\ + /LIBPATH:"ISLE/ext" LINK32_OBJS= \ "$(INTDIR)\define.obj" \ "$(INTDIR)\isle.obj" \ "$(INTDIR)\isle.res" \ "$(INTDIR)\main.obj" \ - "$(INTDIR)\mxomnicreateparambase.obj" + "$(INTDIR)\mxomnicreateparambase.obj" \ + ".\Release\LEGO1.LIB" -"$(OUTDIR)\ISLE.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) +".\Release\ISLE.EXE" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << @@ -312,7 +319,7 @@ LINK32_OBJS= \ OUTDIR=.\ISLE\Debug INTDIR=.\ISLE\Debug -ALL : "$(OUTDIR)\ISLE.exe" +ALL : "LEGO1 - Win32 Debug" ".\Debug\ISLE.EXE" CLEAN : -@erase "$(INTDIR)\define.obj" @@ -322,9 +329,9 @@ CLEAN : -@erase "$(INTDIR)\mxomnicreateparambase.obj" -@erase "$(INTDIR)\vc40.idb" -@erase "$(INTDIR)\vc40.pdb" - -@erase "$(OUTDIR)\ISLE.exe" - -@erase "$(OUTDIR)\ISLE.ilk" - -@erase "$(OUTDIR)\ISLE.pdb" + -@erase ".\Debug\ISLE.EXE" + -@erase ".\Debug\ISLE.ILK" + -@erase ".\Debug\ISLE.PDB" "$(OUTDIR)" : if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" @@ -371,21 +378,22 @@ BSC32_SBRS= \ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows /debug /machine:I386 /LIBPATH:"ISLE\EXT" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows /pdb:"Debug/ISLE.PDB" /debug /machine:I386 /out:"Debug/ISLE.EXE" /LIBPATH:"ISLE/ext" # SUBTRACT LINK32 /pdb:none LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\ odbccp32.lib winmm.lib lego1.lib dsound.lib /nologo /subsystem:windows\ - /incremental:yes /pdb:"$(OUTDIR)/ISLE.pdb" /debug /machine:I386\ - /out:"$(OUTDIR)/ISLE.exe" /LIBPATH:"ISLE\EXT" + /incremental:yes /pdb:"Debug/ISLE.PDB" /debug /machine:I386\ + /out:"Debug/ISLE.EXE" /LIBPATH:"ISLE/ext" LINK32_OBJS= \ "$(INTDIR)\define.obj" \ "$(INTDIR)\isle.obj" \ "$(INTDIR)\isle.res" \ "$(INTDIR)\main.obj" \ - "$(INTDIR)\mxomnicreateparambase.obj" + "$(INTDIR)\mxomnicreateparambase.obj" \ + ".\LEGO1\Debug\LEGO1.lib" -"$(OUTDIR)\ISLE.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) +".\Debug\ISLE.EXE" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< $(LINK32_FLAGS) $(LINK32_OBJS) << @@ -427,6 +435,48 @@ SOURCE=.\LEGO1\dllmain.cpp $(CPP) $(CPP_PROJ) $(SOURCE) +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\legoomni.cpp +DEP_CPP_LEGOO=\ + ".\LEGO1\legoanimationmanager.h"\ + ".\LEGO1\legobuildingmanager.h"\ + ".\LEGO1\legogamestate.h"\ + ".\LEGO1\legoinputmanager.h"\ + ".\LEGO1\legomodelpresenter.h"\ + ".\LEGO1\legoomni.h"\ + ".\LEGO1\legopartpresenter.h"\ + ".\LEGO1\legoroi.h"\ + ".\LEGO1\legovideomanager.h"\ + ".\LEGO1\legoworldpresenter.h"\ + ".\LEGO1\mxatomid.h"\ + ".\LEGO1\mxbackgroundaudiomanager.h"\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxcore.h"\ + ".\LEGO1\mxdsaction.h"\ + ".\LEGO1\mxomnicreateflags.h"\ + ".\LEGO1\mxomnicreateparam.h"\ + ".\LEGO1\mxomnicreateparambase.h"\ + ".\LEGO1\mxpalette.h"\ + ".\LEGO1\mxrect32.h"\ + ".\LEGO1\mxresult.h"\ + ".\LEGO1\mxstreamcontroller.h"\ + ".\LEGO1\mxstreamer.h"\ + ".\LEGO1\mxstring.h"\ + ".\LEGO1\mxticklemanager.h"\ + ".\LEGO1\mxtimer.h"\ + ".\LEGO1\mxtransitionmanager.h"\ + ".\LEGO1\mxvariabletable.h"\ + ".\LEGO1\mxvideoparam.h"\ + ".\LEGO1\mxvideoparamflags.h"\ + + +"$(INTDIR)\legoomni.obj" : $(SOURCE) $(DEP_CPP_LEGOO) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + # End Source File # End Target ################################################################################ @@ -495,9 +545,6 @@ DEP_CPP_ISLE_=\ ".\LEGO1\mxvideoparam.h"\ ".\LEGO1\mxvideoparamflags.h"\ -NODEP_CPP_ISLE_=\ - ".\LEGO1\define.h"\ - "$(INTDIR)\isle.obj" : $(SOURCE) $(DEP_CPP_ISLE_) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) @@ -542,9 +589,6 @@ DEP_CPP_MAIN_=\ ".\LEGO1\mxvideoparam.h"\ ".\LEGO1\mxvideoparamflags.h"\ -NODEP_CPP_MAIN_=\ - ".\LEGO1\define.h"\ - "$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) @@ -1004,6 +1048,24 @@ SOURCE=.\LEGO1\mxvideoparamflags.h !ENDIF # End Source File +################################################################################ +# Begin Project Dependency + +# Project_Dep_Name "LEGO1" + +!IF "$(CFG)" == "ISLE - Win32 Release" + +"LEGO1 - Win32 Release" : + $(MAKE) /$(MAKEFLAGS) /F ".\isle.mak" CFG="LEGO1 - Win32 Release" + +!ELSEIF "$(CFG)" == "ISLE - Win32 Debug" + +"LEGO1 - Win32 Debug" : + $(MAKE) /$(MAKEFLAGS) /F ".\isle.mak" CFG="LEGO1 - Win32 Debug" + +!ENDIF + +# End Project Dependency # End Target # End Project ################################################################################ diff --git a/isle.mdp b/isle.mdp index 4fed0b7138a0675f044e77bee6f335e9cf2a12ce..61c43766da99a1aa1dd70d85787907e084aba1ca 100644 GIT binary patch delta 501 zcmZoT!PIbviN`D0-GG^ag&~}QfoZcM_ZP-ROe_LE3_1*93`z_V4F7?Ek6|+-(+9>$ z99)bIK-O2rNn9+OmALQmZB&qB4=5cc5q^9TR=jLTjUXU#@**`0Db48H|)8yYJ>YEj+o0ul=Llx;@ z+H9P?lTC)z$JO26kdZ-%!8xEPKPxr4#3i*LH7_MKFS&BEN0#CWK6;K|^{;Js1sAS0(d11kdvOq%>5Lu|8bln&J01iUc$ZN^@K s?RF?OFihT+ITfq7CRY@l6!c~AWAJAPU$ z99)clfUK{Kleky}xXY50vWra&^m5CRLi|zioa~q( zw%Iu|iE;9|tjx*p^7Db1ZL?JAem0}~}S*rB1pa+8|gBOE0gAao*gCB!G LL%?Q1nfHtUy*-SW From 689a38fcfce076c5accc67beca946a59da03ca9c Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sun, 11 Jun 2023 01:46:30 -0700 Subject: [PATCH 02/20] isle: change loadaccelerator comment (i know what this does now) --- ISLE/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ISLE/main.cpp b/ISLE/main.cpp index 55be1653..51c9b723 100644 --- a/ISLE/main.cpp +++ b/ISLE/main.cpp @@ -68,7 +68,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine window = g_isle->m_windowHandle; } - // Load accelerator (don't know what this does) + // Load accelerator (this call actually achieves nothing - there is no "AppAccel" resource in the original - but we'll keep this for authenticity) LoadAcceleratorsA(hInstance, "AppAccel"); MSG msg; From 9580402ab54487f0bf3f4d7a2288487243ddd2e3 Mon Sep 17 00:00:00 2001 From: Moss Gallagher Date: Sun, 11 Jun 2023 02:00:57 -0700 Subject: [PATCH 03/20] 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 04/20] 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 05/20] 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 06/20] 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 07/20] 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 08/20] 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 09/20] 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 10/20] 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 11/20] 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 12/20] 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 13/20] 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 14/20] 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 15/20] 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 16/20] 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 17/20] 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 18/20] 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 19/20] 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 20/20] 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: |