Merge branch 'master' into function-annotation-locations

This commit is contained in:
Christian Semmler 2023-12-12 04:26:49 -05:00
commit 436d011717
6 changed files with 85 additions and 51 deletions

View File

@ -83,7 +83,7 @@ jobs:
shell: bash shell: bash
run: | run: |
python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML legobin/ISLE.EXE build/ISLE.EXE build/ISLE.PDB . | tee ISLEPROGRESS.TXT python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML legobin/ISLE.EXE build/ISLE.EXE build/ISLE.PDB . | tee ISLEPROGRESS.TXT
python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML legobin/LEGO1.DLL build/LEGO1.DLL build/LEGO1.PDB . | tee LEGO1PROGRESS.TXT python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 4252 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML legobin/LEGO1.DLL build/LEGO1.DLL build/LEGO1.PDB . | tee LEGO1PROGRESS.TXT
- name: Compare Accuracy With Current Master - name: Compare Accuracy With Current Master
shell: bash shell: bash

View File

@ -24,6 +24,10 @@
#include <dsound.h> #include <dsound.h>
// Might be static functions of IsleApp
BOOL FindExistingInstance(void);
BOOL StartDirectSound(void);
// FUNCTION: ISLE 0x401000 // FUNCTION: ISLE 0x401000
IsleApp::IsleApp() IsleApp::IsleApp()
{ {
@ -169,9 +173,6 @@ void IsleApp::SetupVideoFlags(
} }
} }
BOOL FindExistingInstance(void);
BOOL StartDirectSound(void);
// FUNCTION: ISLE 0x401610 // FUNCTION: ISLE 0x401610
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{ {
@ -386,52 +387,46 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
return DefWindowProcA(hWnd, uMsg, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_DISPLAYCHANGE: case WM_DISPLAYCHANGE:
if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->GetDirect3D() && if (g_isle && VideoManager() && g_isle->m_fullScreen && VideoManager()->GetDirect3D()) {
VideoManager()->GetDirect3D()->GetDeviceModeFinder()) { if (VideoManager()->GetDirect3D()->GetDeviceModeFinder()) {
int targetWidth = LOWORD(lParam); int targetDepth = wParam;
int targetHeight = HIWORD(lParam); int targetWidth = LOWORD(lParam);
int targetDepth = wParam; int targetHeight = HIWORD(lParam);
if (g_waitingForTargetDepth) { if (g_waitingForTargetDepth) {
g_waitingForTargetDepth = 0; g_waitingForTargetDepth = 0;
g_targetDepth = targetDepth; g_targetDepth = targetDepth;
}
else {
BOOL valid = FALSE;
if (targetWidth == g_targetWidth && targetHeight == g_targetHeight && g_targetDepth == targetDepth) {
valid = TRUE;
} }
else {
BOOL valid = FALSE;
if (g_rmDisabled) { if (g_targetWidth == targetWidth && g_targetHeight == targetHeight &&
if (valid) { g_targetDepth == targetDepth) {
g_reqEnableRMDevice = 1; valid = TRUE;
}
if (g_rmDisabled) {
if (valid) {
g_reqEnableRMDevice = 1;
}
}
else if (!valid) {
g_rmDisabled = 1;
Lego()->StartTimer();
VideoManager()->DisableRMDevice();
} }
}
else if (!valid) {
g_rmDisabled = 1;
Lego()->StartTimer();
VideoManager()->DisableRMDevice();
} }
} }
} }
return DefWindowProcA(hWnd, uMsg, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam);
case WM_SETCURSOR:
if (g_isle) {
HCURSOR hCursor = g_isle->m_cursorCurrent;
if (hCursor == g_isle->m_cursorBusy || hCursor == g_isle->m_cursorNo || !hCursor) {
SetCursor(hCursor);
return 0;
}
}
break;
case WM_KEYDOWN: case WM_KEYDOWN:
// While this probably should be (HIWORD(lParam) & KF_REPEAT), this seems // While this probably should be (HIWORD(lParam) & KF_REPEAT), this seems
// to be what the assembly is actually doing // to be what the assembly is actually doing
if (lParam & (KF_REPEAT << 16)) { if (lParam & (KF_REPEAT << 16)) {
return DefWindowProcA(hWnd, uMsg, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam);
} }
keyCode = wParam;
type = c_notificationKeyPress; type = c_notificationKeyPress;
keyCode = wParam;
break; break;
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
g_mousemoved = 1; g_mousemoved = 1;
@ -454,6 +449,13 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
break; break;
case WM_SETCURSOR:
if (g_isle && (g_isle->m_cursorCurrent == g_isle->m_cursorBusy ||
g_isle->m_cursorCurrent == g_isle->m_cursorNo || !g_isle->m_cursorCurrent)) {
SetCursor(g_isle->m_cursorCurrent);
return 0;
}
break;
default: default:
return DefWindowProcA(hWnd, uMsg, wParam, lParam); return DefWindowProcA(hWnd, uMsg, wParam, lParam);
} }
@ -809,10 +811,8 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
} }
this->m_gameStarted = 1; this->m_gameStarted = 1;
} }
return;
} }
else if (sleepIfNotNextFrame != 0)
if (sleepIfNotNextFrame != 0)
Sleep(0); Sleep(0);
} }

View File

@ -42,11 +42,19 @@ MxResult MxRAMStreamController::vtable0x20(MxDSAction* p_action)
return FAILURE; return FAILURE;
} }
// STUB: LEGO1 0x100c6320 // FUNCTION: LEGO1 0x100c6320
MxResult MxRAMStreamController::vtable0x24(undefined4 p_unknown) MxResult MxRAMStreamController::vtable0x24(MxDSAction* p_action)
{ {
// TODO STUB MxDSAction action;
return FAILURE; do {
if (m_action0x60 != NULL) {
delete m_action0x60;
m_action0x60 = NULL;
}
action = *p_action;
MxStreamController::vtable0x24(&action);
} while (m_action0x60 != NULL);
return SUCCESS;
} }
// STUB: LEGO1 0x100d0d80 // STUB: LEGO1 0x100d0d80

View File

@ -26,7 +26,7 @@ class MxRAMStreamController : public MxStreamController {
virtual MxResult Open(const char* p_filename) override; virtual MxResult Open(const char* p_filename) override;
virtual MxResult vtable0x20(MxDSAction* p_action) override; virtual MxResult vtable0x20(MxDSAction* p_action) override;
virtual MxResult vtable0x24(undefined4 p_unknown) override; virtual MxResult vtable0x24(MxDSAction* p_action) override;
private: private:
MxDSBuffer m_buffer; MxDSBuffer m_buffer;

View File

@ -73,11 +73,20 @@ MxResult MxStreamController::vtable0x20(MxDSAction* p_action)
return result; return result;
} }
// STUB: LEGO1 0x100c1740 // FUNCTION: LEGO1 0x100c1740
MxResult MxStreamController::vtable0x24(undefined4 p_unknown) MxResult MxStreamController::vtable0x24(MxDSAction* p_action)
{ {
// TODO STUB MxAutoLocker locker(&m_criticalSection);
return FAILURE; vtable0x30(p_action);
m_action0x60 = m_unkList0x54.Find(p_action, TRUE);
if (m_action0x60 == NULL) {
return FAILURE;
}
else {
p_action->SetUnknown24(m_action0x60->GetUnknown24());
p_action->SetObjectId(m_action0x60->GetObjectId());
return FUN_100c1f00(m_action0x60);
}
} }
// FUNCTION: LEGO1 0x100c1800 // FUNCTION: LEGO1 0x100c1800
@ -109,9 +118,25 @@ MxResult MxStreamController::vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval)
return FUN_100c1800(p_action, (p_bufferval / m_provider->GetFileSize()) * m_provider->GetFileSize()); return FUN_100c1800(p_action, (p_bufferval / m_provider->GetFileSize()) * m_provider->GetFileSize());
} }
// STUB: LEGO1 0x100c1ce0 // FUNCTION: LEGO1 0x100c1ce0
MxResult MxStreamController::vtable0x30(undefined4 p_unknown) MxResult MxStreamController::vtable0x30(MxDSAction* p_unknown)
{ {
MxAutoLocker locker(&m_criticalSection);
MxResult result = FAILURE;
MxDSAction* action = m_unkList0x3c.Find(p_unknown, TRUE);
if (action != NULL) {
MxNextActionDataStart* data = m_nextActionList.Find(action->GetObjectId(), action->GetUnknown24());
delete action;
delete data;
result = SUCCESS;
}
return result;
}
// STUB: LEGO1 0x100c1f00
MxResult MxStreamController::FUN_100c1f00(MxDSAction* p_action)
{
// TODO
return FAILURE; return FAILURE;
} }

View File

@ -36,14 +36,15 @@ class MxStreamController : public MxCore {
virtual MxResult vtable0x18(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x18 virtual MxResult vtable0x18(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x18
virtual MxResult vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x1c virtual MxResult vtable0x1C(undefined4 p_unknown, undefined4 p_unknown2); // vtable+0x1c
virtual MxResult vtable0x20(MxDSAction* p_action); // vtable+0x20 virtual MxResult vtable0x20(MxDSAction* p_action); // vtable+0x20
virtual MxResult vtable0x24(undefined4 p_unknown); // vtable+0x24 virtual MxResult vtable0x24(MxDSAction* p_unknown); // vtable+0x24
MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val); MxResult FUN_100c1800(MxDSAction* p_action, MxU32 p_val);
virtual MxResult vtable0x28(); // vtable+0x28 virtual MxResult vtable0x28(); // vtable+0x28
virtual MxResult vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c virtual MxResult vtable0x2c(MxDSAction* p_action, MxU32 p_bufferval); // vtable+0x2c
virtual MxResult vtable0x30(undefined4 p_unknown); // vtable+0x30 virtual MxResult vtable0x30(MxDSAction* p_unknown); // vtable+0x30
MxBool FUN_100c20d0(MxDSObject& p_obj); MxBool FUN_100c20d0(MxDSObject& p_obj);
MxResult FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferval); MxResult FUN_100c1a00(MxDSAction* p_action, MxU32 p_bufferval);
MxResult FUN_100c1f00(MxDSAction* p_action);
inline MxAtomId& GetAtom() { return atom; }; inline MxAtomId& GetAtom() { return atom; };