Merge branch 'master' into pr/43

This commit is contained in:
itsmattkc 2023-06-27 19:10:23 -07:00
commit 6ac5f8328e
23 changed files with 91 additions and 78 deletions

View File

@ -55,14 +55,24 @@ jobs:
.\msvc420\bin\NMAKE.EXE /f isle.mak CFG="ISLE - Win32 Release"
- name: Summarize Accuracy
shell: cmd
shell: bash
run: |
curl -fLOSs https://legoisland.org/download/ISLE.EXE
curl -fLOSs https://legoisland.org/download/LEGO1.DLL
pip install capstone
pip install colorama
python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML ISLE.EXE Release/ISLE.EXE Release/ISLE.PDB .
python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML LEGO1.DLL Release/LEGO1.DLL Release/LEGO1.PDB .
python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML ISLE.EXE Release/ISLE.EXE Release/ISLE.PDB . | tee ISLEPROGRESS.TXT
python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML LEGO1.DLL Release/LEGO1.DLL Release/LEGO1.PDB . | tee LEGO1PROGRESS.TXT
- name: Compare Accuracy With Current Master
shell: bash
run: |
# Compare with current master
curl -fLSs -o ISLEPROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/ISLEPROGRESS.TXT
curl -fLSs -o LEGO1PROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/LEGO1PROGRESS.TXT
diff -u ISLEPROGRESS-OLD.TXT ISLEPROGRESS.TXT || true
diff -u LEGO1PROGRESS-OLD.TXT LEGO1PROGRESS.TXT || true
- name: Upload Artifact
uses: actions/upload-artifact@master
@ -92,8 +102,10 @@ jobs:
Release/ISLE.EXE \
Release/LEGO1.DLL \
ISLEPROGRESS.HTML \
ISLEPROGRESS.TXT \
ISLEPROGRESS.SVG \
ISLEPROGRESS.PNG \
LEGO1PROGRESS.HTML \
LEGO1PROGRESS.TXT \
LEGO1PROGRESS.PNG \
LEGO1PROGRESS.SVG

View File

@ -1,7 +1,7 @@
#ifndef DEFINE_H
#define DEFINE_H
#include "legoinc.h"
#include <windows.h>
class IsleApp;

View File

@ -101,7 +101,7 @@ void IsleApp::Close()
} while (lVar8 == 0);
while (Lego()) {
if (Lego()->vtable28(ds) != MX_FALSE) {
if (Lego()->vtable28(ds) != FALSE) {
break;
}

View File

@ -1,7 +1,7 @@
#ifndef ISLE_H
#define ISLE_H
#include "legoinc.h"
#include <windows.h>
#include "mxresult.h"
#include "mxvideoparam.h"

View File

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

View File

@ -1,10 +0,0 @@
#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

@ -26,7 +26,7 @@ float g_turnDecel = 50.0f;
// 0x100f4c50
float g_turnSensitivity = 0.4f;
// 0x100f4c54
MxBool g_turnUseVelocity = MX_FALSE;
MxBool g_turnUseVelocity = FALSE;
// OFFSET: LEGO1 0x10054d40
void LegoNavController::GetDefaults(int *p_mouseDeadzone, float *p_movementMaxSpeed, float *p_turnMaxSpeed,
@ -77,9 +77,9 @@ LegoNavController::LegoNavController()
this->m_targetTurnSpeed = 0.0f;
this->m_movementAccel = 0.0f;
this->m_turnAccel = 0.0f;
this->m_trackDefault = MX_FALSE;
this->m_unk5D = MX_FALSE;
this->m_unk6C = MX_FALSE;
this->m_trackDefault = FALSE;
this->m_unk5D = FALSE;
this->m_unk6C = FALSE;
this->m_unk64 = 0;
this->m_unk68 = 0;
this->m_unk60 = 0;
@ -133,12 +133,12 @@ void LegoNavController::ResetToDefault()
// OFFSET: LEGO1 0x10054e40
void LegoNavController::SetTargets(int p_hPos, int p_vPos, MxBool p_accel)
{
if (this->m_trackDefault != MX_FALSE)
if (this->m_trackDefault != FALSE)
{
ResetToDefault();
}
if (p_accel != MX_FALSE)
if (p_accel != FALSE)
{
this->m_targetTurnSpeed = CalculateNewTargetSpeed(p_hPos, this->m_hMax / 2, this->m_turnMaxSpeed);
this->m_targetMovementSpeed = CalculateNewTargetSpeed(this->m_vMax - p_vPos, this->m_vMax / 2, this->m_movementMaxSpeed);
@ -184,4 +184,4 @@ float LegoNavController::CalculateNewAccel(int p_pos, int p_center, float p_maxA
}
return result;
}
}

View File

@ -2,8 +2,8 @@
#define LEGONAVCONTROLLER_H
#include "mxcore.h"
#include "mxbool.h"
#include "mxtimer.h"
#include "mxtypes.h"
class LegoNavController : public MxCore
{

View File

@ -117,7 +117,7 @@ void LegoOmni::vtable24(MxDSAction &ds)
MxBool LegoOmni::vtable28(MxDSAction &ds)
{
// FIXME: Stub
return MX_TRUE;
return TRUE;
}
void LegoOmni::vtable2c()

View File

@ -35,12 +35,10 @@ class LegoOmni : public MxOmni
virtual long Notify(MxParam &p); // vtable+04
// OFFSET: LEGO1 0x10058aa0
inline virtual const char *GetClassName() const { return "LegoOmni"; }; // vtable+0c
inline virtual const char *ClassName() const { return "LegoOmni"; }; // vtable+0c
// OFFSET: LEGO1 0x10058ab0
inline virtual MxBool IsClass(const char *name) const {
return !strcmp(name, LegoOmni::GetClassName()) || MxOmni::IsClass(name);
}; // vtable+10;
inline virtual MxBool IsA(const char *name) const { return !strcmp(name, LegoOmni::ClassName()) || MxOmni::IsA(name); }; // vtable+10;
virtual void Init(); // vtable+14
virtual MxResult Create(MxOmniCreateParam &p); // vtable+18

View File

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

View File

@ -3,7 +3,7 @@
#include <string.h>
#include "mxbool.h"
#include "mxtypes.h"
class MxParam;
@ -16,12 +16,10 @@ class MxCore
virtual long Tickle(); // vtable+08
// OFFSET: LEGO1 0x100144c0
inline virtual const char *GetClassName() const { return "MxCore"; }; // vtable+0c
inline virtual const char *ClassName() const { return "MxCore"; }; // vtable+0c
// OFFSET: LEGO1 0x100140d0
inline virtual MxBool IsClass(const char *name) const {
return !strcmp(name, MxCore::GetClassName());
}; // vtable+10
inline virtual MxBool IsA(const char *name) const { return !strcmp(name, MxCore::ClassName()); }; // vtable+10
private:
unsigned int m_id;

View File

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

View File

@ -1,8 +1,10 @@
#ifndef MXIOINFO_H
#define MXIOINFO_H
#include "legoinc.h"
#include <windows.h>
#include "mmsystem.h"
class MXIOINFO
{
public:

View File

@ -3,15 +3,15 @@
// OFFSET: LEGO1 0x100b0a30
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->CreateObjectFactory(TRUE);
this->CreateVariableTable(TRUE);
this->CreateTickleManager(TRUE);
this->CreateNotificationManager(TRUE);
this->CreateVideoManager(TRUE);
this->CreateSoundManager(TRUE);
this->CreateMusicManager(TRUE);
this->CreateEventManager(TRUE);
this->CreateTimer(MX_TRUE);
this->CreateStreamer(MX_TRUE);
this->CreateTimer(TRUE);
this->CreateStreamer(TRUE);
}

View File

@ -1,7 +1,7 @@
#ifndef MXOMNICREATEFLAGS_H
#define MXOMNICREATEFLAGS_H
#include "mxbool.h"
#include "mxtypes.h"
class MxOmniCreateFlags
{
@ -36,17 +36,17 @@ class MxOmniCreateFlags
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 CreateObjectFactory(MxBool b) { this->m_flags1 = (b == TRUE ? this->m_flags1 | Flag_CreateObjectFactory : this->m_flags1 & ~Flag_CreateObjectFactory); }
inline void CreateVariableTable(MxBool b) { this->m_flags1 = (b == TRUE ? this->m_flags1 | Flag_CreateVariableTable : this->m_flags1 & ~Flag_CreateVariableTable); }
inline void CreateTickleManager(MxBool b) { this->m_flags1 = (b == TRUE ? this->m_flags1 | Flag_CreateTickleManager : this->m_flags1 & ~Flag_CreateTickleManager); }
inline void CreateNotificationManager(MxBool b) { this->m_flags1 = (b == TRUE ? this->m_flags1 | Flag_CreateNotificationManager : this->m_flags1 & ~Flag_CreateNotificationManager); }
inline void CreateVideoManager(MxBool b) { this->m_flags1 = (b == TRUE ? this->m_flags1 | Flag_CreateVideoManager : this->m_flags1 & ~Flag_CreateVideoManager); }
inline void CreateSoundManager(MxBool b) { this->m_flags1 = (b == TRUE ? this->m_flags1 | Flag_CreateSoundManager : this->m_flags1 & ~Flag_CreateSoundManager); }
inline void CreateMusicManager(MxBool b) { this->m_flags1 = (b == TRUE ? this->m_flags1 | Flag_CreateMusicManager : this->m_flags1 & ~Flag_CreateMusicManager); }
inline void CreateEventManager(MxBool b) { this->m_flags1 = (b == 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); }
inline void CreateTimer(MxBool b) { this->m_flags2 = (b == TRUE ? this->m_flags2 | Flag_CreateTimer : this->m_flags2 & ~Flag_CreateTimer); }
inline void CreateStreamer(MxBool b) { this->m_flags2 = (b == TRUE ? this->m_flags2 | Flag_CreateStreamer : this->m_flags2 & ~Flag_CreateStreamer); }
private:
unsigned char m_flags1;

View File

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

View File

@ -9,8 +9,8 @@ class MxTickleManager : public MxCore
virtual ~MxTickleManager();
virtual long Tickle();
virtual const char *GetClassName() const;
virtual MxBool IsClass(const char *name) const;
virtual const char *ClassName() const;
virtual MxBool IsA(const char *name) const;
virtual void vtable14();
virtual void vtable18();
virtual void vtable1c(void *v, int p);

View File

@ -1,6 +1,6 @@
#include "mxtimer.h"
#include "legoinc.h"
#include <windows.h>
// 0x10101414
long MxTimer::s_LastTimeCalculated = 0;
@ -11,7 +11,7 @@ long MxTimer::s_LastTimeTimerStarted = 0;
// OFFSET: LEGO1 0x100ae060
MxTimer::MxTimer()
{
this->m_isRunning = MX_FALSE;
this->m_isRunning = FALSE;
m_startTime = timeGetTime();
// yeah this is somehow what the asm is
s_LastTimeCalculated = m_startTime;
@ -21,7 +21,7 @@ MxTimer::MxTimer()
void MxTimer::Start()
{
s_LastTimeTimerStarted = this->GetRealTime();
this->m_isRunning = MX_TRUE;
this->m_isRunning = TRUE;
}
// OFFSET: LEGO1 0x100ae180
@ -29,7 +29,7 @@ void MxTimer::Stop()
{
long elapsed = this->GetRealTime();
long startTime = elapsed - MxTimer::s_LastTimeTimerStarted;
this->m_isRunning = MX_FALSE;
this->m_isRunning = FALSE;
// this feels very stupid but it's what the assembly does
this->m_startTime = this->m_startTime + startTime - 5;
}

21
LEGO1/mxtypes.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef MXTYPE_H
#define MXTYPE_H
typedef unsigned char MxU8;
typedef char MxS8;
typedef unsigned short MxU16;
typedef short MxS16;
typedef unsigned int MxU32;
typedef int MxS32;
typedef unsigned char MxBool;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif MXTYPE_H

View File

@ -28,7 +28,7 @@ int MxVideoManager::Init()
this->m_unk58 = NULL;
this->m_unk5c = 0;
this->m_videoParam.SetPalette(NULL);
this->m_unk60 = MX_FALSE;
this->m_unk60 = FALSE;
return 0;
}
@ -47,4 +47,4 @@ long MxVideoManager::RealizePalette(MxPalette *p_palette)
this->m_criticalSection.Leave();
return 0;
}
}

View File

@ -4,8 +4,8 @@
#include <ddraw.h>
#include "mxpalette.h"
#include "mxbool.h"
#include "mxrect32.h"
#include "mxtypes.h"
#include "mxvariabletable.h"
#include "mxvideoparamflags.h"

View File

@ -1,7 +1,7 @@
#ifndef MXVIDEOPARAMFLAGS_H
#define MXVIDEOPARAMFLAGS_H
#include "legoinc.h"
#include <windows.h>
// Must be union with struct for match.
typedef union {