implemented some parts of MxOmni and LegoOmni

This commit is contained in:
itsmattkc 2023-06-18 23:19:40 -07:00
parent d774644b4a
commit f8263a3ef8
12 changed files with 167 additions and 16 deletions

View file

@ -1,4 +1,4 @@
#include <windows.h> #include "legoinc.h"
// OFFSET: LEGO1 0x10091ee0 // OFFSET: LEGO1 0x10091ee0
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)

10
LEGO1/legoinc.h Normal file
View file

@ -0,0 +1,10 @@
#ifndef LEGOINC_H
#define LEGOINC_H
// It is recommended to include this over <windows.h> directly because this way
// we can undef stuff that might cause issues with our code.
#include <windows.h>
#undef GetClassName
#endif // LEGOINC_H

View file

@ -1,5 +1,17 @@
#include "legoomni.h" #include "legoomni.h"
// OFFSET: LEGO1 0x10058a00
LegoOmni::LegoOmni()
{
Init();
}
// OFFSET: LEGO1 0x10058b50
LegoOmni::~LegoOmni()
{
Destroy();
}
// OFFSET: LEGO1 0x1005ad10 // OFFSET: LEGO1 0x1005ad10
LegoOmni *LegoOmni::GetInstance() LegoOmni *LegoOmni::GetInstance()
{ {
@ -17,3 +29,87 @@ LegoVideoManager *VideoManager()
{ {
return LegoOmni::GetInstance()->GetVideoManager(); return LegoOmni::GetInstance()->GetVideoManager();
} }
// OFFSET: LEGO1 0x1005b5f0
long LegoOmni::Notify(MxParam &p)
{
// FIXME: Stub
return 0;
}
// OFFSET: LEGO1 0x10058aa0
const char *LegoOmni::GetClassName() const
{
return "LegoOmni";
}
// OFFSET: LEGO1 0x10058ab0
MxBool LegoOmni::IsClass(const char *name) const
{
return strcmp("LegoOmni", name) == 0;
}
// OFFSET: LEGO1 0x10058bd0
void LegoOmni::Init()
{
// FIXME: Stub
}
// OFFSET: LEGO1 0x10058e70
MxResult LegoOmni::Create(MxOmniCreateParam &p)
{
// FIXME: Stub
return SUCCESS;
}
void LegoOmni::Destroy()
{
// FIXME: Stub
}
void LegoOmni::vtable20()
{
// FIXME: Stub
}
void LegoOmni::vtable24(MxDSAction &ds)
{
// FIXME: Stub
}
MxBool LegoOmni::vtable28(MxDSAction &ds)
{
// FIXME: Stub
return MX_TRUE;
}
void LegoOmni::vtable2c()
{
// FIXME: Stub
}
void LegoOmni::vtable30()
{
// FIXME: Stub
}
void LegoOmni::vtable34()
{
// FIXME: Stub
}
void LegoOmni::vtable38()
{
// FIXME: Stub
}
void LegoOmni::vtable3c()
{
// FIXME: Stub
}
unsigned char LegoOmni::vtable40()
{
// FIXME: Stub
return 0;
}

View file

@ -26,6 +26,7 @@ class LegoOmni : public MxOmni
__declspec(dllexport) static void CreateInstance(); __declspec(dllexport) static void CreateInstance();
__declspec(dllexport) static LegoOmni *GetInstance(); __declspec(dllexport) static LegoOmni *GetInstance();
LegoOmni();
virtual ~LegoOmni(); // vtable+00 virtual ~LegoOmni(); // vtable+00
virtual long Notify(MxParam &p); // vtable+04 virtual long Notify(MxParam &p); // vtable+04

View file

@ -1,7 +1,7 @@
#ifndef MXCRITICALSECTION_H #ifndef MXCRITICALSECTION_H
#define MXCRITICALSECTION_H #define MXCRITICALSECTION_H
#include <windows.h> #include "legoinc.h"
class MxCriticalSection class MxCriticalSection
{ {

View file

@ -3,6 +3,35 @@
// 0x101015b0 // 0x101015b0
MxOmni* MxOmni::m_instance = NULL; MxOmni* MxOmni::m_instance = NULL;
// OFFSET: LEGO1 0x100aef10
MxOmni::MxOmni()
{
Init();
}
// OFFSET: LEGO1 0x100aeff0
MxOmni::~MxOmni()
{
Destroy();
}
void MxOmni::Init()
{
m_windowHandle = NULL;
m_objectFactory = NULL;
m_variableTable = NULL;
m_tickleManager = NULL;
m_notificationManager = NULL;
m_videoManager = NULL;
m_soundManager = NULL;
m_musicManager = NULL;
m_eventManager = NULL;
m_timer = NULL;
m_streamer = NULL;
m_unk44 = NULL;
m_unk64 = NULL;
}
// OFFSET: LEGO1 0x100b0680 // OFFSET: LEGO1 0x100b0680
MxOmni *MxOmni::GetInstance() MxOmni *MxOmni::GetInstance()
{ {
@ -23,3 +52,16 @@ MxResult MxOmni::Create(MxOmniCreateParam &p)
return SUCCESS; return SUCCESS;
} }
// OFFSET: LEGO1 0x100afe90
void MxOmni::Destroy()
{
// FIXME: Stub
}
// OFFSET: LEGO1 0x100b07f0
long MxOmni::Notify(MxParam &p)
{
// FIXME: Stub
return 0;
}

View file

@ -53,11 +53,11 @@ class MxOmni : public MxCore
MxTimer* m_timer; //0x3C MxTimer* m_timer; //0x3C
MxStreamer* m_streamer; //0x40 MxStreamer* m_streamer; //0x40
char unknown44[0x4]; // 0x44 int m_unk44; // 0x44
MxCriticalSection m_criticalsection; // 0x48 MxCriticalSection m_criticalsection; // 0x48
char unknown64[0x4]; // 0x64 int m_unk64; // 0x64
}; };

View file

@ -1,8 +1,7 @@
#ifndef MXOMNICREATEPARAM_H #ifndef MXOMNICREATEPARAM_H
#define MXOMNICREATEPARAM_H #define MXOMNICREATEPARAM_H
#include <windows.h> #include "legoinc.h"
#include "mxomnicreateflags.h" #include "mxomnicreateflags.h"
#include "mxomnicreateparambase.h" #include "mxomnicreateparambase.h"
#include "mxstring.h" #include "mxstring.h"

View file

@ -1,6 +1,6 @@
#include "mxtimer.h" #include "mxtimer.h"
#include <windows.h> #include "legoinc.h"
// 0x10101414 // 0x10101414
long MxTimer::s_LastTimeCalculated = 0; long MxTimer::s_LastTimeCalculated = 0;

View file

@ -1,5 +1,8 @@
#include "mxvideoparam.h" #include "mxvideoparam.h"
#include <stdlib.h>
#include <string.h>
// OFFSET: LEGO1 0x100bec70 // OFFSET: LEGO1 0x100bec70
MxVideoParam::MxVideoParam() MxVideoParam::MxVideoParam()
{ {

View file

@ -25,7 +25,7 @@ class MxVideoParam
int m_right; int m_right;
int m_bottom; int m_bottom;
MxPalette *m_palette; MxPalette *m_palette;
BOOL m_backBuffers; int m_backBuffers;
MxVideoParamFlags m_flags; MxVideoParamFlags m_flags;
int m_unk1c; int m_unk1c;
char *m_deviceId; char *m_deviceId;

View file

@ -1,7 +1,7 @@
#ifndef MXVIDEOPARAMFLAGS_H #ifndef MXVIDEOPARAMFLAGS_H
#define MXVIDEOPARAMFLAGS_H #define MXVIDEOPARAMFLAGS_H
#include <windows.h> #include "mxbool.h"
class MxVideoParamFlags class MxVideoParamFlags
{ {
@ -24,22 +24,22 @@ class MxVideoParamFlags
__declspec(dllexport) MxVideoParamFlags(); __declspec(dllexport) MxVideoParamFlags();
inline void EnableFullScreen(BOOL e) inline void EnableFullScreen(MxBool e)
{ {
m_flags1 = (m_flags1 ^ (e << 0)) & FULL_SCREEN ^ m_flags1; m_flags1 = (m_flags1 ^ (e << 0)) & FULL_SCREEN ^ m_flags1;
} }
inline void EnableFlipSurfaces(BOOL e) inline void EnableFlipSurfaces(MxBool e)
{ {
m_flags1 = (m_flags1 ^ (e << 1)) & FLIP_SURFACES ^ m_flags1; m_flags1 = (m_flags1 ^ (e << 1)) & FLIP_SURFACES ^ m_flags1;
} }
inline void EnableBackBuffers(BOOL e) inline void EnableBackBuffers(MxBool e)
{ {
m_flags1 = (m_flags1 ^ ((!e) << 2)) & BACK_BUFFERS ^ m_flags1; m_flags1 = (m_flags1 ^ ((!e) << 2)) & BACK_BUFFERS ^ m_flags1;
} }
inline void SetUnknown3(BOOL e) inline void SetUnknown3(MxBool e)
{ {
m_flags1 = (m_flags1 ^ (e << 7)) & UNKNOWN3 ^ m_flags1; m_flags1 = (m_flags1 ^ (e << 7)) & UNKNOWN3 ^ m_flags1;
} }
@ -59,17 +59,17 @@ class MxVideoParamFlags
m_flags1 = ((e << 5) ^ m_flags1) & ENABLE_16BIT ^ m_flags1; m_flags1 = ((e << 5) ^ m_flags1) & ENABLE_16BIT ^ m_flags1;
} }
inline void EnableWideViewAngle(BOOL e) inline void EnableWideViewAngle(MxBool e)
{ {
m_flags1 = (m_flags1 ^ (e << 6)) & WIDE_VIEW_ANGLE ^ m_flags1; m_flags1 = (m_flags1 ^ (e << 6)) & WIDE_VIEW_ANGLE ^ m_flags1;
} }
inline void EnableUnknown1(BOOL e) inline void EnableUnknown1(MxBool e)
{ {
m_flags2 = (m_flags2 ^ ((!e) << 0)) & UNKNOWN1 ^ m_flags2; m_flags2 = (m_flags2 ^ ((!e) << 0)) & UNKNOWN1 ^ m_flags2;
} }
inline void EnableUnknown2(BOOL e) inline void EnableUnknown2(MxBool e)
{ {
m_flags2 = (m_flags2 ^ (e << 1)) & UNKNOWN2 ^ m_flags2; m_flags2 = (m_flags2 ^ (e << 1)) & UNKNOWN2 ^ m_flags2;
} }