reorganized repo, implemented mxcore

This commit is contained in:
itsmattkc
2023-05-05 02:54:17 -07:00
parent 1690784a8b
commit d4e2fb8d8a
54 changed files with 958 additions and 243 deletions

6
LEGO1/dllmain.cpp Normal file
View File

@@ -0,0 +1,6 @@
#include <Windows.h>
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
return TRUE;
}

View File

@@ -0,0 +1,10 @@
#ifndef LEGOANIMATIONMANAGER_H
#define LEGOANIMATIONMANAGER_H
class LegoAnimationManager
{
public:
__declspec(dllexport) static void configureLegoAnimationManager(int param_1);
};
#endif // LEGOANIMATIONMANAGER_H

View File

@@ -0,0 +1,10 @@
#ifndef LEGOBUILDINGMANAGER_H
#define LEGOBUILDINGMANAGER_H
class LegoBuildingManager
{
public:
__declspec(dllexport) static void configureLegoBuildingManager(int param_1);
};
#endif // LEGOBUILDINGMANAGER_H

13
LEGO1/legogamestate.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef LEGOGAMESTATE_H
#define LEGOGAMESTATE_H
class LegoGameState
{
public:
__declspec(dllexport) long Save(unsigned long p);
__declspec(dllexport) void SerializePlayersInfo(short p);
__declspec(dllexport) void SerializeScoreHistory(short p);
__declspec(dllexport) void SetSavePath(char *p);
};
#endif // LEGOGAMESTATE_H

22
LEGO1/legoinputmanager.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef LEGOINPUTMANAGER_H
#define LEGOINPUTMANAGER_H
__declspec(dllexport) enum NotificationId
{
NONE = 0x0,
KEYDOWN = 0x7,
MOUSEUP = 0x8,
MOUSEDOWN = 0x9,
MOUSEMOVE = 0x10,
TIMER = 0xF
};
class LegoInputManager
{
public:
__declspec(dllexport) void QueueEvent(NotificationId id, unsigned char p2, long p3, long p4, unsigned char p5);
int m_unk00[0x400];
};
#endif // LEGOINPUTMANAGER_H

View File

@@ -0,0 +1,10 @@
#ifndef LEGOMODELPRESENTER_H
#define LEGOMODELPRESENTER_H
class LegoModelPresenter
{
public:
__declspec(dllexport) static void configureLegoModelPresenter(int param_1);
};
#endif // LEGOMODELPRESENTER_H

99
LEGO1/legoomni.h Normal file
View File

@@ -0,0 +1,99 @@
#ifndef LEGOOMNI_H
#define LEGOOMNI_H
#include "define.h"
#include "mxbackgroundaudiomanager.h"
#include "mxdsaction.h"
#include "mxomnicreateparam.h"
#include "mxstreamer.h"
#include "mxticklemanager.h"
#include "mxtimer.h"
#include "mxtransitionmanager.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legomodelpresenter.h"
#include "legopartpresenter.h"
#include "legoroi.h"
#include "legoworldpresenter.h"
#include "legovideomanager.h"
class MxBackgroundAudioManager;
class LegoOmni
{
public:
__declspec(dllexport) void CreateBackgroundAudio();
__declspec(dllexport) void RemoveWorld(const MxAtomId &p1, long p2);
__declspec(dllexport) static void CreateInstance();
__declspec(dllexport) static LegoOmni *GetInstance();
virtual ~LegoOmni();
virtual void vtable04();
virtual void vtable08();
virtual void vtable0c();
virtual void vtable10();
virtual void vtable14();
virtual MxResult Create(const MxOmniCreateParam &p);
virtual void vtable1c();
virtual void vtable20();
virtual void vtable24(MxDSAction &ds);
virtual int vtable28(MxDSAction &ds);
virtual void vtable2c();
virtual void vtable30();
virtual void vtable34();
virtual void vtable38();
virtual void vtable3c();
virtual unsigned char vtable40();
LegoInputManager *GetInputManager() { return m_inputMgr; }
private:
int m_unk04;
int m_unk08;
int m_unk0c;
int m_unk10;
int m_unk14;
int m_unk18;
int m_unk1c;
int m_unk20;
int m_unk24;
int m_unk28;
int m_unk2c;
int m_unk30;
int m_unk34;
int m_unk38;
int m_unk3c;
int m_unk40;
int m_unk44;
int m_unk48;
int m_unk4c;
int m_unk50;
int m_unk54;
int m_unk58;
int m_unk5c;
int m_unk60;
int m_unk64;
int m_unk68;
int m_unk6c;
LegoInputManager *m_inputMgr;
};
__declspec(dllexport) LegoOmni *Lego();
__declspec(dllexport) MxBackgroundAudioManager *BackgroundAudioManager();
__declspec(dllexport) MxTickleManager *TickleManager();
__declspec(dllexport) LegoVideoManager *VideoManager();
__declspec(dllexport) MxVariableTable *VariableTable();
__declspec(dllexport) LegoGameState *GameState();
__declspec(dllexport) MxTimer *Timer();
__declspec(dllexport) MxStreamer *Streamer();
__declspec(dllexport) LegoInputManager *InputManager();
__declspec(dllexport) MxTransitionManager *TransitionManager();
__declspec(dllexport) long Start(MxDSAction *a);
#endif // LEGOOMNI_H

10
LEGO1/legopartpresenter.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef LEGOPARTPRESENTER_H
#define LEGOPARTPRESENTER_H
class LegoPartPresenter
{
public:
__declspec(dllexport) static void configureLegoPartPresenter(int param_1, int param_2);
};
#endif // LEGOPARTPRESENTER_H

10
LEGO1/legoroi.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef LEGOROI_H
#define LEGOROI_H
class LegoROI
{
public:
__declspec(dllexport) static void configureLegoROI(int param_1);
};
#endif // LEGOROI_H

48
LEGO1/legovideomanager.h Normal file
View File

@@ -0,0 +1,48 @@
#ifndef LEGOVIDEOMANAGER_H
#define LEGOVIDEOMANAGER_H
class LegoVideoManager
{
public:
__declspec(dllexport) int EnableRMDevice();
__declspec(dllexport) int DisableRMDevice();
__declspec(dllexport) void EnableFullScreenMovie(unsigned char a, unsigned char b);
__declspec(dllexport) void MoveCursor(int x, int y);
int m_unk00;
int m_unk04;
int m_unk08;
int m_unk0c;
int m_unk10;
int m_unk14;
int m_unk18;
int m_unk1c;
int m_unk20;
int m_unk24;
int m_unk28;
int m_unk2c;
int m_unk30;
int m_unk34;
int m_unk38;
int m_unk3c;
int m_unk40;
int m_unk44;
int m_unk48;
int m_unk4c;
int m_unk50;
int m_unk54;
int m_unk58;
int m_unk5c;
int m_unk60;
int m_unk64;
int m_unk68;
int m_unk6c;
int m_unk70;
int *m_unk74;
};
#endif // LEGOVIDEOMANAGER_H

View File

@@ -0,0 +1,10 @@
#ifndef LEGOWORLDPRESENTER_H
#define LEGOWORLDPRESENTER_H
class LegoWorldPresenter
{
public:
__declspec(dllexport) static void configureLegoWorldPresenter(int param_1);
};
#endif // LEGOWORLDPRESENTER_H

14
LEGO1/mxatomid.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef MXATOMID_H
#define MXATOMID_H
class MxAtomId
{
public:
__declspec(dllexport) MxAtomId &operator=(const MxAtomId &id);
__declspec(dllexport) ~MxAtomId();
char *m_internal;
};
#endif // MXATOMID_H

View File

@@ -0,0 +1,10 @@
#ifndef MXBACKGROUNDAUDIOMANAGER_H
#define MXBACKGROUNDAUDIOMANAGER_H
class MxBackgroundAudioManager
{
public:
__declspec(dllexport) void Enable(unsigned char p);
};
#endif // MXBACKGROUNDAUDIOMANAGER_H

10
LEGO1/mxbitmap.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef MXBITMAP_H
#define MXBITMAP_H
class MxBitmap
{
public:
__declspec(dllexport) MxPalette *CreatePalette();
};
#endif // MXBITMAP_H

6
LEGO1/mxbool.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef MXBOOL_H
#define MXBOOL_H
typedef unsigned char MxBool;
#endif // MXBOOL_H

35
LEGO1/mxcore.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include "mxcore.h"
#include <string.h>
unsigned int g_mxcoreCount = 0;
MxCore::MxCore()
{
m_id = g_mxcoreCount;
g_mxcoreCount++;
}
MxCore::~MxCore()
{
}
long MxCore::Notify(MxParam &p)
{
return 0;
}
long MxCore::FUN_10001f70()
{
return 0;
}
const char *MxCore::GetClassName() const
{
return "MxCore";
}
MxBool MxCore::IsClass(const char *name) const
{
return strcmp(name, "MxCore") == 0;
}

23
LEGO1/mxcore.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef MXCORE_H
#define MXCORE_H
#include "mxbool.h"
class MxParam;
class MxCore
{
public:
__declspec(dllexport) MxCore();
__declspec(dllexport) virtual ~MxCore();
__declspec(dllexport) virtual long Notify(MxParam &p);
virtual long FUN_10001f70();
virtual const char *GetClassName() const;
virtual MxBool IsClass(const char *name) const;
private:
unsigned int m_id;
};
#endif // MXCORE_H

10
LEGO1/mxdirectdraw.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef MXDIRECTDRAW_H
#define MXDIRECTDRAW_H
class MxDirectDraw
{
public:
__declspec(dllexport) static int GetPrimaryBitDepth();
};
#endif // MXDIRECTDRAW_H

52
LEGO1/mxdsaction.h Normal file
View File

@@ -0,0 +1,52 @@
#ifndef MXDSACTION_H
#define MXDSACTION_H
#include "mxatomid.h"
class MxDSAction
{
public:
__declspec(dllexport) MxDSAction();
int m_unk00;
int m_unk04;
int m_unk08;
int m_unk0c;
int m_unk10;
int m_unk14;
int m_unk18;
int m_unk1c;
MxAtomId m_atomId;
unsigned short m_unk24;
unsigned short m_unk26;
int m_unk28;
int m_unk2c;
int m_unk30;
int m_unk34;
int m_unk38;
int m_unk3c;
int m_unk40;
int m_unk44;
int m_unk48;
int m_unk4c;
int m_unk50;
int m_unk54;
int m_unk58;
int m_unk5c;
int m_unk60;
int m_unk64;
int m_unk68;
int m_unk6c;
int m_unk70;
int m_unk74;
int m_unk78;
int m_unk7c;
int m_unk80;
int m_unk84;
int m_unk88;
int m_unk8c;
int m_unk90;
};
#endif // MXDSACTION_H

10
LEGO1/mxdsfile.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef MXDSFILE_H
#define MXDSFILE_H
class MxDSFile
{
public:
__declspec(dllexport) long Close();
};
#endif // MXDSFILE_H

15
LEGO1/mxomni.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef MXOMNI_H
#define MXOMNI_H
class MxOmni
{
public:
__declspec(dllexport) static const char *GetHD();
__declspec(dllexport) static const char *GetCD();
__declspec(dllexport) static void SetHD(const char *s);
__declspec(dllexport) static void SetCD(const char *s);
__declspec(dllexport) static void SetSound3D(unsigned char param_1);
__declspec(dllexport) static void DestroyInstance();
};
#endif // MXOMNI_H

14
LEGO1/mxomnicreateflags.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef MXOMNICREATEFLAGS_H
#define MXOMNICREATEFLAGS_H
class MxOmniCreateFlags
{
public:
__declspec(dllexport) MxOmniCreateFlags();
private:
unsigned short m_flags;
};
#endif // MXOMNICREATEFLAGS_H

25
LEGO1/mxomnicreateparam.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef MXOMNICREATEPARAM_H
#define MXOMNICREATEPARAM_H
#include <Windows.h>
#include "mxomnicreateflags.h"
#include "mxomnicreateparambase.h"
#include "mxstring.h"
#include "mxvideoparam.h"
class MxOmniCreateParam : public MxOmniCreateParamBase
{
public:
__declspec(dllexport) MxOmniCreateParam(const char *mediaPath, struct HWND__ *windowHandle, MxVideoParam &vparam, MxOmniCreateFlags flags);
virtual void vtable00();
private:
MxString m_mediaPath;
HWND m_windowHandle;
MxVideoParam m_videoParam;
MxOmniCreateFlags m_createFlags;
};
#endif // MXOMNICREATEPARAM_H

View File

@@ -0,0 +1,6 @@
#include "mxomnicreateparam.h"
MxOmniCreateParamBase::~MxOmniCreateParamBase()
{
}

View File

@@ -0,0 +1,13 @@
#ifndef MXOMNICREATEPARAMBASE_H
#define MXOMNICREATEPARAMBASE_H
// FIXME: Clearly not its real name
class MxOmniCreateParamBase
{
public:
~MxOmniCreateParamBase();
virtual void vtable00(){}
};
#endif // MXOMNICREATEPARAMBASE_H

9
LEGO1/mxpalette.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef MXPALETTE_H
#define MXPALETTE_H
class MxPalette
{
public:
};
#endif // MXPALETTE_H

13
LEGO1/mxrect32.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef MXRECT32_H
#define MXRECT32_H
class MxRect32
{
public:
int m_left;
int m_top;
int m_right;
int m_bottom;
};
#endif // MXRECT32_H

8
LEGO1/mxresult.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef MXRESULT_H
#define MXRESULT_H
typedef unsigned long MxResult;
const MxResult SUCCESS = 0;
const MxResult FAILURE = 0xFFFFFFFFL;
#endif // MXRESULT_H

View File

@@ -0,0 +1,21 @@
#ifndef MXSTREAMCONTROLLER_H
#define MXSTREAMCONTROLLER_H
class MxStreamController
{
public:
int m_unk00;
int m_unk04;
int m_unk08;
int m_unk0c;
int m_unk10;
int m_unk14;
int m_unk18;
int m_unk1c;
int m_unk20;
MxAtomId atom;
int m_unk28;
int m_unk2c;
};
#endif // MXSTREAMCONTROLLER_H

14
LEGO1/mxstreamer.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef MXSTREAMER_H
#define MXSTREAMER_H
#include "mxstreamcontroller.h"
class MxStreamer
{
public:
__declspec(dllexport) MxStreamController *Open(const char *name, unsigned short p);
__declspec(dllexport) long Close(const char *p);
};
#endif // MXSTREAMER_H

17
LEGO1/mxstring.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef MXSTRING_H
#define MXSTRING_H
#include "mxcore.h"
class MxString : public MxCore
{
public:
__declspec(dllexport) virtual ~MxString();
private:
char *m_data;
unsigned short m_length;
};
#endif // MXSTRING_H

19
LEGO1/mxticklemanager.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef MXTICKLEMANAGER_H
#define MXTICKLEMANAGER_H
class MxTickleManager
{
public:
virtual ~MxTickleManager();
virtual void vtable04();
virtual void vtable08();
virtual void vtable0c();
virtual void vtable10();
virtual void vtable14();
virtual void vtable18();
virtual void vtable1c(void *v, int p);
virtual void vtable20();
};
#endif // MXTICKLEMANAGER_H

10
LEGO1/mxtimer.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef MXTIMER_H
#define MXTIMER_H
class MxTimer
{
public:
__declspec(dllexport) long GetRealTime();
};
#endif // MXTIMER_H

View File

@@ -0,0 +1,12 @@
#ifndef MXTRANSITIONMANAGER_H
#define MXTRANSITIONMANAGER_H
class MxVideoPresenter;
class MxTransitionManager
{
public:
void SetWaitIndicator(MxVideoPresenter *videoPresenter);
};
#endif // MXTRANSITIONMANAGER_H

10
LEGO1/mxvariabletable.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef MXVARIABLETABLE_H
#define MXVARIABLETABLE_H
class MxVariableTable
{
public:
__declspec(dllexport) void SetVariable(const char *key, const char *value);
};
#endif // MXVARIABLETABLE_H

33
LEGO1/mxvideoparam.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef MXVIDEOPARAM_H
#define MXVIDEOPARAM_H
#include "mxpalette.h"
#include "mxrect32.h"
#include "mxvariabletable.h"
#include "mxvideoparamflags.h"
class MxVideoParam
{
public:
__declspec(dllexport) MxVideoParam();
__declspec(dllexport) MxVideoParam(MxRect32 &rect, MxPalette *pal, unsigned long p3, MxVideoParamFlags &flags);
__declspec(dllexport) ~MxVideoParam();
__declspec(dllexport) void SetDeviceName(char *id);
inline MxVideoParamFlags &flags() { return m_flags; }
private:
int m_left;
int m_top;
int m_right;
int m_bottom;
MxPalette *m_palette;
BOOL m_backBuffers;
MxVideoParamFlags m_flags;
int m_unk1c;
char *m_deviceId;
};
#endif // MXVIDEOPARAM_H

86
LEGO1/mxvideoparamflags.h Normal file
View File

@@ -0,0 +1,86 @@
#ifndef MXVIDEOPARAMFLAGS_H
#define MXVIDEOPARAMFLAGS_H
class MxVideoParamFlags
{
public:
enum LowFlags
{
FULL_SCREEN = 0x1,
FLIP_SURFACES = 0x2,
BACK_BUFFERS = 0x4,
ENABLE_16BIT = 0x20,
WIDE_VIEW_ANGLE = 0x40,
UNKNOWN3 = 0x80
};
enum HighFlags
{
UNKNOWN1 = 0x1,
UNKNOWN2 = 0x2
};
__declspec(dllexport) MxVideoParamFlags();
inline void EnableFullScreen(BOOL e)
{
m_flags1 = (m_flags1 ^ (e << 0)) & FULL_SCREEN ^ m_flags1;
}
inline void EnableFlipSurfaces(BOOL e)
{
m_flags1 = (m_flags1 ^ (e << 1)) & FLIP_SURFACES ^ m_flags1;
}
inline void EnableBackBuffers(BOOL e)
{
m_flags1 = (m_flags1 ^ ((!e) << 2)) & BACK_BUFFERS ^ m_flags1;
}
inline void SetUnknown3(BOOL e)
{
m_flags1 = (m_flags1 ^ (e << 7)) & UNKNOWN3 ^ m_flags1;
}
inline void Set8Bit()
{
m_flags1 &= ~ENABLE_16BIT;
}
inline void Set16Bit()
{
m_flags1 |= ENABLE_16BIT;
}
inline void Enable16Bit(BOOL e)
{
m_flags1 = ((e << 5) ^ m_flags1) & ENABLE_16BIT ^ m_flags1;
}
inline void EnableWideViewAngle(BOOL e)
{
m_flags1 = (m_flags1 ^ (e << 6)) & WIDE_VIEW_ANGLE ^ m_flags1;
}
inline void EnableUnknown1(BOOL e)
{
m_flags2 = (m_flags2 ^ ((!e) << 0)) & UNKNOWN1 ^ m_flags2;
}
inline void EnableUnknown2(BOOL e)
{
m_flags2 = (m_flags2 ^ (e << 1)) & UNKNOWN2 ^ m_flags2;
}
inline void EnableUnknown2()
{
m_flags2 |= UNKNOWN2;
}
private:
unsigned char m_flags1;
unsigned char m_flags2;
};
#endif // MXVIDEOPARAMFLAGS_H