From a925aec046c1770962d123a33406dcd44f462f37 Mon Sep 17 00:00:00 2001 From: Thomas May Date: Wed, 14 Jun 2023 01:22:42 +0100 Subject: [PATCH 1/5] lego1: implement MxTimer + dependencies --- LEGO1/mxautolocker.cpp | 14 ++++++++++ LEGO1/mxautolocker.h | 15 +++++++++++ LEGO1/mxbool.h | 3 +++ LEGO1/mxomni.cpp | 15 +++++++++++ LEGO1/mxomni.h | 19 ++++++++++--- LEGO1/mxomnicreateflags.cpp | 16 +++++++++++ LEGO1/mxomnicreateflags.h | 46 +++++++++++++++++++++++++++++-- LEGO1/mxomnicreateparam.cpp | 9 +++++++ LEGO1/mxomnicreateparam.h | 7 ++--- LEGO1/mxstring.cpp | 30 +++++++++++++++++++++ LEGO1/mxstring.h | 2 ++ LEGO1/mxtimer.cpp | 34 +++++++++++++++++++++++ LEGO1/mxtimer.h | 23 +++++++++++++++- LEGO1/mxvideoparam.cpp | 54 +++++++++++++++++++++++++++++++++++++ LEGO1/mxvideoparamflags.cpp | 16 +++++++++++ LEGO1/mxvideoparamflags.h | 2 ++ 16 files changed, 296 insertions(+), 9 deletions(-) create mode 100644 LEGO1/mxautolocker.cpp create mode 100644 LEGO1/mxautolocker.h create mode 100644 LEGO1/mxomni.cpp create mode 100644 LEGO1/mxomnicreateflags.cpp create mode 100644 LEGO1/mxomnicreateparam.cpp create mode 100644 LEGO1/mxstring.cpp create mode 100644 LEGO1/mxtimer.cpp create mode 100644 LEGO1/mxvideoparam.cpp create mode 100644 LEGO1/mxvideoparamflags.cpp diff --git a/LEGO1/mxautolocker.cpp b/LEGO1/mxautolocker.cpp new file mode 100644 index 00000000..9020afaf --- /dev/null +++ b/LEGO1/mxautolocker.cpp @@ -0,0 +1,14 @@ +#include "mxautolocker.h" + +MxAutoLocker::MxAutoLocker(MxCriticalSection *critsect) +{ + this->m_criticalSection = critsect; + if (this->m_criticalSection != 0) + this->m_criticalSection->Enter(); +} + +MxAutoLocker::~MxAutoLocker() +{ + if (this->m_criticalSection != 0) + this->m_criticalSection->Leave(); +} diff --git a/LEGO1/mxautolocker.h b/LEGO1/mxautolocker.h new file mode 100644 index 00000000..b195ec45 --- /dev/null +++ b/LEGO1/mxautolocker.h @@ -0,0 +1,15 @@ +#ifndef MXAUTOLOCKER_H +#define MXAUTOLOCKER_H + +#include "mxcriticalsection.h" + +class MxAutoLocker +{ + public: + MxAutoLocker(MxCriticalSection* cs); + virtual ~MxAutoLocker(); + private: + MxCriticalSection* m_criticalSection; +}; + +#endif // MXAUTOLOCKER_H diff --git a/LEGO1/mxbool.h b/LEGO1/mxbool.h index ce1a9716..4b6e4a2d 100644 --- a/LEGO1/mxbool.h +++ b/LEGO1/mxbool.h @@ -3,4 +3,7 @@ typedef unsigned char MxBool; +#define MX_TRUE 1 +#define MX_FALSE 0 + #endif // MXBOOL_H diff --git a/LEGO1/mxomni.cpp b/LEGO1/mxomni.cpp new file mode 100644 index 00000000..9ed7b6e1 --- /dev/null +++ b/LEGO1/mxomni.cpp @@ -0,0 +1,15 @@ +#include "mxomni.h" + +MxResult MxOmni::Create(const MxOmniCreateParam &p) +{ + if (p.CreateFlags().CreateTimer()) + { + MxTimer *timer = new MxTimer(); + this->m_Timer = timer; + + if (timer == NULL) + return FAILURE; + } + + return SUCCESS; +} diff --git a/LEGO1/mxomni.h b/LEGO1/mxomni.h index 43b9b8ac..5a121323 100644 --- a/LEGO1/mxomni.h +++ b/LEGO1/mxomni.h @@ -1,17 +1,30 @@ #ifndef MXOMNI_H #define MXOMNI_H +#include "mxresult.h" +#include "mxomnicreateparam.h" +#include "mxomnicreateflags.h" +#include "mxtimer.h" + class MxOmni { public: __declspec(dllexport) static void DestroyInstance(); - __declspec(dllexport) static const char * GetCD(); - __declspec(dllexport) static const char * GetHD(); - __declspec(dllexport) static MxOmni * GetInstance(); + __declspec(dllexport) static const char *GetCD(); + __declspec(dllexport) static const char *GetHD(); + __declspec(dllexport) static MxOmni *GetInstance(); __declspec(dllexport) static unsigned char IsSound3D(); __declspec(dllexport) static void SetCD(const char *s); __declspec(dllexport) static void SetHD(const char *s); __declspec(dllexport) static void SetSound3D(unsigned char); + + MxResult MxOmni::Create(const MxOmniCreateParam &p); + + MxTimer* GetTimer() const { return this->m_Timer; } + +private: + char padding[0x3c]; + MxTimer* m_Timer; }; #endif // MXOMNI_H diff --git a/LEGO1/mxomnicreateflags.cpp b/LEGO1/mxomnicreateflags.cpp new file mode 100644 index 00000000..46f735d7 --- /dev/null +++ b/LEGO1/mxomnicreateflags.cpp @@ -0,0 +1,16 @@ +#include "mxomnicreateflags.h" + +MxOmniCreateFlags::MxOmniCreateFlags() +{ + this->CreateObjectFactory(MX_TRUE); + this->CreateVariableTable(MX_TRUE); + this->CreateTickleManager(MX_TRUE); + this->CreateNotificationManager(MX_TRUE); + this->CreateVideoManager(MX_TRUE); + this->CreateSoundManager(MX_TRUE); + this->CreateMusicManager(MX_TRUE); + this->CreateEventManager(MX_TRUE); + + this->CreateTimer(MX_TRUE); + this->CreateStreamer(MX_TRUE); +} diff --git a/LEGO1/mxomnicreateflags.h b/LEGO1/mxomnicreateflags.h index ae57208d..464a5f3c 100644 --- a/LEGO1/mxomnicreateflags.h +++ b/LEGO1/mxomnicreateflags.h @@ -1,14 +1,56 @@ #ifndef MXOMNICREATEFLAGS_H #define MXOMNICREATEFLAGS_H +#include "mxbool.h" + class MxOmniCreateFlags { public: + enum LowFlags { + Flag_CreateObjectFactory = 0x01, + Flag_CreateVariableTable = 0x02, + Flag_CreateTickleManager = 0x04, + Flag_CreateNotificationManager = 0x08, + Flag_CreateVideoManager = 0x10, + Flag_CreateSoundManager = 0x20, + Flag_CreateMusicManager = 0x40, + Flag_CreateEventManager = 0x80 + }; + + enum HighFlags { + Flag_CreateTimer = 0x02, + Flag_CreateStreamer = 0x04 + }; + __declspec(dllexport) MxOmniCreateFlags(); + + const inline MxBool CreateObjectFactory() const { return this->m_flags1 & Flag_CreateObjectFactory; } + const inline MxBool CreateVariableTable() const { return this->m_flags1 & Flag_CreateVariableTable; } + const inline MxBool CreateTickleManager() const { return this->m_flags1 & Flag_CreateTickleManager; } + const inline MxBool CreateNotificationManager() const { return this->m_flags1 & Flag_CreateNotificationManager; } + const inline MxBool CreateVideoManager() const { return this->m_flags1 & Flag_CreateVideoManager; } + const inline MxBool CreateSoundManager() const { return this->m_flags1 & Flag_CreateSoundManager; } + const inline MxBool CreateMusicManager() const { return this->m_flags1 & Flag_CreateMusicManager; } + const inline MxBool CreateEventManager() const { return this->m_flags1 & Flag_CreateEventManager; } + + const inline MxBool CreateTimer() const { return this->m_flags2 & Flag_CreateTimer; } + const inline MxBool CreateStreamer() const { return this->m_flags2 & Flag_CreateStreamer; } + + inline void CreateObjectFactory(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateObjectFactory : this->m_flags1 & ~Flag_CreateObjectFactory); } + inline void CreateVariableTable(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateVariableTable : this->m_flags1 & ~Flag_CreateVariableTable); } + inline void CreateTickleManager(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateTickleManager : this->m_flags1 & ~Flag_CreateTickleManager); } + inline void CreateNotificationManager(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateNotificationManager : this->m_flags1 & ~Flag_CreateNotificationManager); } + inline void CreateVideoManager(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateVideoManager : this->m_flags1 & ~Flag_CreateVideoManager); } + inline void CreateSoundManager(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateSoundManager : this->m_flags1 & ~Flag_CreateSoundManager); } + inline void CreateMusicManager(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateMusicManager : this->m_flags1 & ~Flag_CreateMusicManager); } + inline void CreateEventManager(MxBool b) { this->m_flags1 = (b == MX_TRUE ? this->m_flags1 | Flag_CreateEventManager : this->m_flags1 & ~Flag_CreateEventManager); } + + inline void CreateTimer(MxBool b) { this->m_flags2 = (b == MX_TRUE ? this->m_flags2 | Flag_CreateTimer : this->m_flags2 & ~Flag_CreateTimer); } + inline void CreateStreamer(MxBool b) { this->m_flags2 = (b == MX_TRUE ? this->m_flags2 | Flag_CreateStreamer : this->m_flags2 & ~Flag_CreateStreamer); } private: - unsigned short m_flags; - + unsigned char m_flags1; + unsigned char m_flags2; }; #endif // MXOMNICREATEFLAGS_H diff --git a/LEGO1/mxomnicreateparam.cpp b/LEGO1/mxomnicreateparam.cpp new file mode 100644 index 00000000..06a3567c --- /dev/null +++ b/LEGO1/mxomnicreateparam.cpp @@ -0,0 +1,9 @@ +#include "mxomnicreateparam.h" + +MxOmniCreateParam::MxOmniCreateParam(const char *mediaPath, HWND windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags) +{ + this->m_mediaPath = mediaPath; + this->m_windowHandle = windowHandle; + this->m_videoParam = vparam; + this->m_createFlags = flags; +} diff --git a/LEGO1/mxomnicreateparam.h b/LEGO1/mxomnicreateparam.h index f72623aa..c1e8570f 100644 --- a/LEGO1/mxomnicreateparam.h +++ b/LEGO1/mxomnicreateparam.h @@ -11,15 +11,16 @@ class MxOmniCreateParam : public MxOmniCreateParamBase { public: - __declspec(dllexport) MxOmniCreateParam(const char *mediaPath, struct HWND__ *windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags); - virtual void vtable00(); + __declspec(dllexport) MxOmniCreateParam(const char *mediaPath, HWND windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags); + // virtual void vtable00(); seems to be a destructor + + const MxOmniCreateFlags& CreateFlags() const { return this->m_createFlags; } private: MxString m_mediaPath; HWND m_windowHandle; MxVideoParam m_videoParam; MxOmniCreateFlags m_createFlags; - }; #endif // MXOMNICREATEPARAM_H diff --git a/LEGO1/mxstring.cpp b/LEGO1/mxstring.cpp new file mode 100644 index 00000000..66e84c85 --- /dev/null +++ b/LEGO1/mxstring.cpp @@ -0,0 +1,30 @@ +#include "mxstring.h" +#include +#include + +MxString::MxString() +{ + // Set string to one char in length and set that char to null terminator + this->m_data = (char *)malloc(1); + this->m_data[0] = 0; + this->m_length = 0; +} + +// TODO: this *mostly* matches, again weird with the comparison +const MxString &MxString::operator=(const char *param) +{ + if (this->m_data != param) + { + free(this->m_data); + this->m_length = strlen(param); + this->m_data = (char *)malloc(this->m_length + 1); + strcpy(this->m_data, param); + } + + return *this; +} + +MxString::~MxString() +{ + free(this->m_data); +} diff --git a/LEGO1/mxstring.h b/LEGO1/mxstring.h index 607b732c..9551f1c9 100644 --- a/LEGO1/mxstring.h +++ b/LEGO1/mxstring.h @@ -10,6 +10,8 @@ class MxString : public MxCore __declspec(dllexport) virtual ~MxString(); __declspec(dllexport) const MxString &operator=(const char *); + MxString(); + private: char *m_data; unsigned short m_length; diff --git a/LEGO1/mxtimer.cpp b/LEGO1/mxtimer.cpp new file mode 100644 index 00000000..e54439dc --- /dev/null +++ b/LEGO1/mxtimer.cpp @@ -0,0 +1,34 @@ +#include "mxtimer.h" + +#include + +long MxTimer::s_LastTimeCalculated = 0; +long MxTimer::s_LastTimeTimerStarted = 0; + +MxTimer::MxTimer() +{ + this->m_isRunning = FALSE; + MxTimer::s_LastTimeCalculated = timeGetTime(); + this->m_startTime = MxTimer::s_LastTimeCalculated; +} + +void MxTimer::Start() +{ + this->m_isRunning = TRUE; + MxTimer::s_LastTimeTimerStarted = timeGetTime(); +} + +void MxTimer::Stop() +{ + long elapsed = this->GetRealTime(); + long startTime = elapsed - MxTimer::s_LastTimeTimerStarted; + this->m_isRunning = FALSE; + // this feels very stupid but it's what the assembly does + this->m_startTime = this->m_startTime + startTime - 5; +} + +long MxTimer::GetRealTime() +{ + MxTimer::s_LastTimeCalculated = timeGetTime(); + return MxTimer::s_LastTimeCalculated - this->m_startTime; +} diff --git a/LEGO1/mxtimer.h b/LEGO1/mxtimer.h index 35d888fa..8f35d205 100644 --- a/LEGO1/mxtimer.h +++ b/LEGO1/mxtimer.h @@ -1,10 +1,31 @@ #ifndef MXTIMER_H #define MXTIMER_H -class MxTimer +#include "mxcore.h" + +class MxTimer : public MxCore { public: + MxTimer(); + + void Start(); + void Stop(); + __declspec(dllexport) long GetRealTime(); + + long GetTime() inline + { + if (this->m_isRunning) + return s_LastTimeCalculated; + else + return s_LastTimeCalculated - this->m_startTime; + } + +private: + long m_startTime; + MxBool m_isRunning; + static long s_LastTimeCalculated; + static long s_LastTimeTimerStarted; }; #endif // MXTIMER_H diff --git a/LEGO1/mxvideoparam.cpp b/LEGO1/mxvideoparam.cpp new file mode 100644 index 00000000..8e33560b --- /dev/null +++ b/LEGO1/mxvideoparam.cpp @@ -0,0 +1,54 @@ +#include "mxvideoparam.h" + +MxVideoParam::MxVideoParam() +{ + this->m_flags = MxVideoParamFlags(); + this->m_right = 640; + this->m_bottom = 480; + this->m_left = 0; + this->m_top = 0; + this->m_palette = 0; + this->m_backBuffers = 0; + this->m_unk1c = 0; + this->m_deviceId = 0; +} + +MxVideoParam &MxVideoParam::operator=(const MxVideoParam &other) +{ + m_flags = MxVideoParamFlags(); + m_left = other.m_left; + m_top = other.m_top; + m_right = other.m_right; + m_bottom = other.m_bottom; + m_palette = other.m_palette; + m_backBuffers = other.m_backBuffers; + m_flags = other.m_flags; + m_unk1c = other.m_unk1c; + m_deviceId = other.m_deviceId; + SetDeviceName(other.m_deviceId); + + return *this; +} + +// TODO: this doesn't match exactly, something weird with the conditional on id +void MxVideoParam::SetDeviceName(char *id) +{ + if (this->m_deviceId != 0) + free(this->m_deviceId); + + if (id == 0) + { + this->m_deviceId = 0; + } + else + { + this->m_deviceId = (char *)malloc(strlen(id) + 1); + strcpy(this->m_deviceId, id); + } +} + +MxVideoParam::~MxVideoParam() +{ + if (this->m_deviceId != 0) + free(this->m_deviceId); +} diff --git a/LEGO1/mxvideoparamflags.cpp b/LEGO1/mxvideoparamflags.cpp new file mode 100644 index 00000000..00429e30 --- /dev/null +++ b/LEGO1/mxvideoparamflags.cpp @@ -0,0 +1,16 @@ +#include "mxvideoparamflags.h" + +MxVideoParamFlags::MxVideoParamFlags() +{ + // TODO: convert to EnableXXX function calls + unsigned char bVar1 = this->m_flags1; + this->m_flags1 = bVar1 & 0xfe; + this->m_flags1 = bVar1 & 0xfc; + this->m_flags1 = bVar1 & 0xf8; + this->m_flags1 = bVar1 & 0xf0; + this->m_flags1 = bVar1 & 0xe0; + this->m_flags2 = this->m_flags2 | 2; + this->m_flags1 = bVar1 & 0xc0; + this->m_flags1 = bVar1 & 0xc0 | 0x40; + this->m_flags1 = 0xc0; +} diff --git a/LEGO1/mxvideoparamflags.h b/LEGO1/mxvideoparamflags.h index e57917dc..49a4ecc1 100644 --- a/LEGO1/mxvideoparamflags.h +++ b/LEGO1/mxvideoparamflags.h @@ -1,6 +1,8 @@ #ifndef MXVIDEOPARAMFLAGS_H #define MXVIDEOPARAMFLAGS_H +#include + class MxVideoParamFlags { public: From 14b14f88a5ee6350337f3c52e8becf598c494d23 Mon Sep 17 00:00:00 2001 From: Thomas May Date: Wed, 14 Jun 2023 01:26:24 +0100 Subject: [PATCH 2/5] Make sure we're using MX_TRUE/MX_FALSE --- LEGO1/mxtimer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LEGO1/mxtimer.cpp b/LEGO1/mxtimer.cpp index e54439dc..245787aa 100644 --- a/LEGO1/mxtimer.cpp +++ b/LEGO1/mxtimer.cpp @@ -7,14 +7,14 @@ long MxTimer::s_LastTimeTimerStarted = 0; MxTimer::MxTimer() { - this->m_isRunning = FALSE; + this->m_isRunning = MX_FALSE; MxTimer::s_LastTimeCalculated = timeGetTime(); this->m_startTime = MxTimer::s_LastTimeCalculated; } void MxTimer::Start() { - this->m_isRunning = TRUE; + this->m_isRunning = MX_TRUE; MxTimer::s_LastTimeTimerStarted = timeGetTime(); } @@ -22,7 +22,7 @@ void MxTimer::Stop() { long elapsed = this->GetRealTime(); long startTime = elapsed - MxTimer::s_LastTimeTimerStarted; - this->m_isRunning = FALSE; + this->m_isRunning = MX_FALSE; // this feels very stupid but it's what the assembly does this->m_startTime = this->m_startTime + startTime - 5; } From 7ed9c7df82f042a20f775c5bc6e19925057a1797 Mon Sep 17 00:00:00 2001 From: Thomas May Date: Wed, 14 Jun 2023 01:30:56 +0100 Subject: [PATCH 3/5] save the damn project --- isle.mak | 198 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- isle.mdp | Bin 46080 -> 51200 bytes 2 files changed, 190 insertions(+), 8 deletions(-) diff --git a/isle.mak b/isle.mak index c81ebe25..e70c28f9 100644 --- a/isle.mak +++ b/isle.mak @@ -56,8 +56,17 @@ ALL : ".\Release\LEGO1.DLL" CLEAN : -@erase "$(INTDIR)\dllmain.obj" -@erase "$(INTDIR)\legoomni.obj" + -@erase "$(INTDIR)\mxautolocker.obj" -@erase "$(INTDIR)\mxcore.obj" -@erase "$(INTDIR)\mxcriticalsection.obj" + -@erase "$(INTDIR)\mxomni.obj" + -@erase "$(INTDIR)\mxomnicreateflags.obj" + -@erase "$(INTDIR)\mxomnicreateparam.obj" + -@erase "$(INTDIR)\mxomnicreateparambase.obj" + -@erase "$(INTDIR)\mxstring.obj" + -@erase "$(INTDIR)\mxtimer.obj" + -@erase "$(INTDIR)\mxvideoparam.obj" + -@erase "$(INTDIR)\mxvideoparamflags.obj" -@erase ".\Release\LEGO1.DLL" -@erase ".\Release\LEGO1.EXP" -@erase ".\Release\LEGO1.LIB" @@ -107,18 +116,27 @@ 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 /pdb:"Release/LEGO1.PDB" /map:"Release/LEGO1.MAP" /machine:I386 /out:"Release/LEGO1.DLL" /implib:"Release/LEGO1.LIB" +# 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 /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\ + odbccp32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:no\ /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)\mxautolocker.obj" \ "$(INTDIR)\mxcore.obj" \ - "$(INTDIR)\mxcriticalsection.obj" + "$(INTDIR)\mxcriticalsection.obj" \ + "$(INTDIR)\mxomni.obj" \ + "$(INTDIR)\mxomnicreateflags.obj" \ + "$(INTDIR)\mxomnicreateparam.obj" \ + "$(INTDIR)\mxomnicreateparambase.obj" \ + "$(INTDIR)\mxstring.obj" \ + "$(INTDIR)\mxtimer.obj" \ + "$(INTDIR)\mxvideoparam.obj" \ + "$(INTDIR)\mxvideoparamflags.obj" ".\Release\LEGO1.DLL" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< @@ -145,8 +163,17 @@ ALL : ".\Debug\LEGO1.DLL" CLEAN : -@erase "$(INTDIR)\dllmain.obj" -@erase "$(INTDIR)\legoomni.obj" + -@erase "$(INTDIR)\mxautolocker.obj" -@erase "$(INTDIR)\mxcore.obj" -@erase "$(INTDIR)\mxcriticalsection.obj" + -@erase "$(INTDIR)\mxomni.obj" + -@erase "$(INTDIR)\mxomnicreateflags.obj" + -@erase "$(INTDIR)\mxomnicreateparam.obj" + -@erase "$(INTDIR)\mxomnicreateparambase.obj" + -@erase "$(INTDIR)\mxstring.obj" + -@erase "$(INTDIR)\mxtimer.obj" + -@erase "$(INTDIR)\mxvideoparam.obj" + -@erase "$(INTDIR)\mxvideoparamflags.obj" -@erase "$(INTDIR)\vc40.idb" -@erase "$(INTDIR)\vc40.pdb" -@erase "$(OUTDIR)\LEGO1.exp" @@ -200,18 +227,27 @@ 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 /out:"Debug/LEGO1.DLL" +# 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 /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\ + odbccp32.lib winmm.lib /nologo /subsystem:windows /dll /incremental:yes\ /pdb:"$(OUTDIR)/LEGO1.pdb" /map:"$(INTDIR)/LEGO1.map" /debug /machine:I386\ /out:"Debug/LEGO1.DLL" /implib:"$(OUTDIR)/LEGO1.lib" LINK32_OBJS= \ "$(INTDIR)\dllmain.obj" \ "$(INTDIR)\legoomni.obj" \ + "$(INTDIR)\mxautolocker.obj" \ "$(INTDIR)\mxcore.obj" \ - "$(INTDIR)\mxcriticalsection.obj" + "$(INTDIR)\mxcriticalsection.obj" \ + "$(INTDIR)\mxomni.obj" \ + "$(INTDIR)\mxomnicreateflags.obj" \ + "$(INTDIR)\mxomnicreateparam.obj" \ + "$(INTDIR)\mxomnicreateparambase.obj" \ + "$(INTDIR)\mxstring.obj" \ + "$(INTDIR)\mxtimer.obj" \ + "$(INTDIR)\mxvideoparam.obj" \ + "$(INTDIR)\mxvideoparamflags.obj" ".\Debug\LEGO1.DLL" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) $(LINK32) @<< @@ -497,6 +533,151 @@ DEP_CPP_MXCRI=\ $(CPP) $(CPP_PROJ) $(SOURCE) +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxautolocker.cpp +DEP_CPP_MXAUT=\ + ".\LEGO1\mxautolocker.h"\ + ".\LEGO1\mxcriticalsection.h"\ + + +"$(INTDIR)\mxautolocker.obj" : $(SOURCE) $(DEP_CPP_MXAUT) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxtimer.cpp +DEP_CPP_MXTIM=\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxcore.h"\ + ".\LEGO1\mxtimer.h"\ + + +"$(INTDIR)\mxtimer.obj" : $(SOURCE) $(DEP_CPP_MXTIM) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxomni.cpp +DEP_CPP_MXOMN=\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxcore.h"\ + ".\LEGO1\mxomni.h"\ + ".\LEGO1\mxomnicreateflags.h"\ + ".\LEGO1\mxomnicreateparam.h"\ + ".\LEGO1\mxomnicreateparambase.h"\ + ".\LEGO1\mxresult.h"\ + ".\LEGO1\mxstring.h"\ + ".\LEGO1\mxtimer.h"\ + ".\LEGO1\mxvideoparam.h"\ + + +"$(INTDIR)\mxomni.obj" : $(SOURCE) $(DEP_CPP_MXOMN) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxvideoparam.cpp +DEP_CPP_MXVID=\ + ".\LEGO1\mxvideoparam.h"\ + + +"$(INTDIR)\mxvideoparam.obj" : $(SOURCE) $(DEP_CPP_MXVID) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxvideoparamflags.cpp +DEP_CPP_MXVIDE=\ + ".\LEGO1\mxvideoparamflags.h"\ + + +"$(INTDIR)\mxvideoparamflags.obj" : $(SOURCE) $(DEP_CPP_MXVIDE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxomnicreateparam.cpp +DEP_CPP_MXOMNI=\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxcore.h"\ + ".\LEGO1\mxomnicreateflags.h"\ + ".\LEGO1\mxomnicreateparam.h"\ + ".\LEGO1\mxomnicreateparambase.h"\ + ".\LEGO1\mxstring.h"\ + ".\LEGO1\mxvideoparam.h"\ + + +"$(INTDIR)\mxomnicreateparam.obj" : $(SOURCE) $(DEP_CPP_MXOMNI) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxomnicreateparambase.cpp +DEP_CPP_MXOMNIC=\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxcore.h"\ + ".\LEGO1\mxomnicreateflags.h"\ + ".\LEGO1\mxomnicreateparam.h"\ + ".\LEGO1\mxomnicreateparambase.h"\ + ".\LEGO1\mxstring.h"\ + ".\LEGO1\mxvideoparam.h"\ + + +"$(INTDIR)\mxomnicreateparambase.obj" : $(SOURCE) $(DEP_CPP_MXOMNIC)\ + "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxstring.cpp +DEP_CPP_MXSTR=\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxcore.h"\ + ".\LEGO1\mxstring.h"\ + + +"$(INTDIR)\mxstring.obj" : $(SOURCE) $(DEP_CPP_MXSTR) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\mxomnicreateflags.cpp +DEP_CPP_MXOMNICR=\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxomnicreateflags.h"\ + + +"$(INTDIR)\mxomnicreateflags.obj" : $(SOURCE) $(DEP_CPP_MXOMNICR) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + # End Source File # End Target ################################################################################ @@ -647,7 +828,7 @@ SOURCE=.\ISLE\res\isle.rc # Begin Source File SOURCE=.\LEGO1\mxomnicreateparambase.cpp -DEP_CPP_MXOMN=\ +DEP_CPP_MXOMNIC=\ ".\LEGO1\mxbool.h"\ ".\LEGO1\mxcore.h"\ ".\LEGO1\mxomnicreateflags.h"\ @@ -661,7 +842,8 @@ DEP_CPP_MXOMN=\ ".\LEGO1\mxvideoparamflags.h"\ -"$(INTDIR)\mxomnicreateparambase.obj" : $(SOURCE) $(DEP_CPP_MXOMN) "$(INTDIR)" +"$(INTDIR)\mxomnicreateparambase.obj" : $(SOURCE) $(DEP_CPP_MXOMNIC)\ + "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) diff --git a/isle.mdp b/isle.mdp index 1d92bce9b92e4ca9a9c88f55e04f126638aacd73..9a7cd26268c5f59b226e5a22a0f60f508c91d743 100644 GIT binary patch liter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6kFOpanrt;$cr9P`m`>CHzbTb}X&$T@+w_8cE_8CD_!HOM+C}m@HttJL2Ii_H+-UJa!=DDt0RuXe$o=Wj<7BrT5 z%ePxqj~%M2W;NN#!WXQdJWX~4X%c}9^9LbXSInA(0SM974e%3KId?dI9w0>PNR~pD z2+`WPV}wITh!!T(5fFrEsizG>w8(XdCdwuV(Po0a#35RWi_`}}8Z*<2o;YGx0MEZt-|u^^j@WMZ70qMMF%9g%U0a6mU21@@ctQrT!2 zj&3;BXC;=*G274Z+FcuFn`huO6lhG;@vbG3&|6ST_VJ#`v7frY3@;!Va%%k;*9#V$ zS~wJk7=3Hk(>L%H?6yrWQ?cQCFO%R*!IXV4kTp!H_!bGPO7uQnx{-mX9Wu zm|ApD9bu^p?cuIZWEH7pQ=<9OPE#|g+X=B+ymQQ^Mv7WA!3~fO>qM;`iOmwVW+v4hQR`XzUAwJXyI1rw ziam}Wn@y7Gp{|y3ii}CMD456YD&J>%wY-O)$jqoW{b#*otb^UQM33PN4o{aCSFnr+ z7kku)2+KH@@#-@nWWh3?M0^4kEaMxwj30@@c6kfn&U8xr9xnfiq++5d-7An%#aLSv z-yP6H6MOS18kWKYwzqf(K#J^mGR8E|MKR8!Q7OKMrlk>bt`x)MMN$$8xx{|4k&aYC z)*ckK-N}S3KP<}SbV4o=CxpEBQ9>ch4vF4XL8ecU9ZMPWiChO4x<`(Mr-X=+8b z009sH0T2KI5C8!X009sH0T9Se;AMgSEk7Tp@jr|mf0gwectl_L_}8u Date: Wed, 14 Jun 2023 01:32:43 +0100 Subject: [PATCH 4/5] fix merge conflicts --- isle.mak | 19 +++++++++++++++++++ isle.mdp | Bin 51200 -> 51200 bytes 2 files changed, 19 insertions(+) diff --git a/isle.mak b/isle.mak index e70c28f9..2913bc72 100644 --- a/isle.mak +++ b/isle.mak @@ -55,6 +55,7 @@ ALL : ".\Release\LEGO1.DLL" CLEAN : -@erase "$(INTDIR)\dllmain.obj" + -@erase "$(INTDIR)\legonavcontroller.obj" -@erase "$(INTDIR)\legoomni.obj" -@erase "$(INTDIR)\mxautolocker.obj" -@erase "$(INTDIR)\mxcore.obj" @@ -125,6 +126,7 @@ LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ /out:"Release/LEGO1.DLL" /implib:"Release/LEGO1.LIB" LINK32_OBJS= \ "$(INTDIR)\dllmain.obj" \ + "$(INTDIR)\legonavcontroller.obj" \ "$(INTDIR)\legoomni.obj" \ "$(INTDIR)\mxautolocker.obj" \ "$(INTDIR)\mxcore.obj" \ @@ -162,6 +164,7 @@ ALL : ".\Debug\LEGO1.DLL" CLEAN : -@erase "$(INTDIR)\dllmain.obj" + -@erase "$(INTDIR)\legonavcontroller.obj" -@erase "$(INTDIR)\legoomni.obj" -@erase "$(INTDIR)\mxautolocker.obj" -@erase "$(INTDIR)\mxcore.obj" @@ -236,6 +239,7 @@ LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ /out:"Debug/LEGO1.DLL" /implib:"$(OUTDIR)/LEGO1.lib" LINK32_OBJS= \ "$(INTDIR)\dllmain.obj" \ + "$(INTDIR)\legonavcontroller.obj" \ "$(INTDIR)\legoomni.obj" \ "$(INTDIR)\mxautolocker.obj" \ "$(INTDIR)\mxcore.obj" \ @@ -678,6 +682,21 @@ DEP_CPP_MXOMNICR=\ $(CPP) $(CPP_PROJ) $(SOURCE) +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\LEGO1\legonavcontroller.cpp +DEP_CPP_LEGON=\ + ".\LEGO1\legonavcontroller.h"\ + ".\LEGO1\mxbool.h"\ + ".\LEGO1\mxcore.h"\ + + +"$(INTDIR)\legonavcontroller.obj" : $(SOURCE) $(DEP_CPP_LEGON) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + # End Source File # End Target ################################################################################ diff --git a/isle.mdp b/isle.mdp index 9a7cd26268c5f59b226e5a22a0f60f508c91d743..1855de7a87900545fb1a465f01ced5ce017dc802 100644 GIT binary patch delta 260 zcmZpez}zr_c>{;k=7f?TjGJUQgdhw97{dj|h?v1Qd1-;}q!|izbHRbFT-xKVur!y V+}N9}o3G}FFca+@d8S3jm;f_GV4eT~ delta 107 zcmZpez}zr_c>{;kW(BSvjGJUQgdhw97{dj|h?v2*`A*tIp3NJJKe10vn9ep?Vxr3C u-_B4&}8{cK-Ot}`t<#smO-v?_`K From e6f8da256f3ef5a1330bff893ced741a47c11ab3 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 15 Jun 2023 16:22:48 +0200 Subject: [PATCH 5/5] perfect SetDeviceName --- LEGO1/mxvideoparam.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/LEGO1/mxvideoparam.cpp b/LEGO1/mxvideoparam.cpp index 8e33560b..19dbad96 100644 --- a/LEGO1/mxvideoparam.cpp +++ b/LEGO1/mxvideoparam.cpp @@ -30,20 +30,21 @@ MxVideoParam &MxVideoParam::operator=(const MxVideoParam &other) return *this; } -// TODO: this doesn't match exactly, something weird with the conditional on id void MxVideoParam::SetDeviceName(char *id) { if (this->m_deviceId != 0) free(this->m_deviceId); - if (id == 0) - { - this->m_deviceId = 0; - } - else + if (id != 0) { this->m_deviceId = (char *)malloc(strlen(id) + 1); - strcpy(this->m_deviceId, id); + + if (this->m_deviceId != 0) { + strcpy(this->m_deviceId, id); + } + } + else { + this->m_deviceId = 0; } }