(Proposal) Adjustments to "decomp" language (#308)

* Adjustments to "decomp" language

* Fix a comment

* Fix accidental clang-formatting

* Fix order

* Fix order

* Remove junk

* Fix OFFSET

* Adjustments based on new suggestions

* Annotate globals

* Globals in ISLE

* More globals

* Merge from parser2 branch

* Allow prepending space for exact marker match

* To eliminate noise, require the 0x prefix on offset for marker match

* fix test from previous

* Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise

* FUNCTION to SYNTHETIC where needed

* Missed marker conversion on SetAtomId

* pylint cleanup, remove unused code

* Fix unexpected function end, add more unit tests

* Be more strict about synthetic name syntax

* Revert "Missed marker conversion on SetAtomId"

This reverts commit d87d665127.

* Revert "FUNCTION to SYNTHETIC where needed"

This reverts commit 8c815418d2.

* Implicit lookup by name for functions

* Fix VTABLE SYNTHETIC and other decomp markers

* Get vtable class name

* Vtable marker should identify struct

* No colon for SIZE comment

* Update README.md

* Update README.md

* Update CONTRIBUTING.md

* Update README.md

* Update README.md

* Update CONTRIBUTING.md

* Update README.md

* Update CONTRIBUTING.md

* Fix destructor/annotation

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

---------

Co-authored-by: disinvite <disinvite@users.noreply.github.com>
This commit is contained in:
Christian Semmler
2023-12-06 07:10:45 -05:00
committed by GitHub
parent 4f5b70013f
commit 494a556f8e
407 changed files with 3505 additions and 2493 deletions

View File

@@ -1,40 +1,40 @@
#include "define.h"
// 0x410030
// GLOBAL: ISLE 0x410030
IsleApp* g_isle = 0;
// 0x410034
// GLOBAL: ISLE 0x410034
unsigned char g_mousedown = 0;
// 0x410038
// GLOBAL: ISLE 0x410038
unsigned char g_mousemoved = 0;
// 0x41003c
// GLOBAL: ISLE 0x41003c
int g_closed = 0;
// 0x410040
// GLOBAL: ISLE 0x410040
RECT g_windowRect = {0, 0, 640, 480};
// 0x410050
// GLOBAL: ISLE 0x410050
int g_rmDisabled = 0;
// 0x410054
// GLOBAL: ISLE 0x410054
int g_waitingForTargetDepth = 1;
// 0x410058
// GLOBAL: ISLE 0x410058
int g_targetWidth = 640;
// 0x41005c
// GLOBAL: ISLE 0x41005c
int g_targetHeight = 480;
// 0x410060
// GLOBAL: ISLE 0x410060
int g_targetDepth = 16;
// 0x410064
// GLOBAL: ISLE 0x410064
int g_reqEnableRMDevice = 0;
// 0x4101bc
// GLOBAL: ISLE 0x4101bc
int g_startupDelay = 200;
// 0x4101c0
// GLOBAL: ISLE 0x4101c0
MxLong g_lastFrameTime = 0;

View File

@@ -8,9 +8,9 @@ class IsleApp;
extern IsleApp* g_isle;
extern int g_closed;
// 0x4101c4
// GLOBAL: ISLE 0x4101c4
#define WNDCLASS_NAME "Lego Island MainNoM App"
// 0x4101dc
// GLOBAL: ISLE 0x4101dc
#define WINDOW_TITLE "LEGO\xAE"
extern unsigned char g_mousedown;
extern unsigned char g_mousemoved;

View File

@@ -24,7 +24,7 @@
#include <dsound.h>
// OFFSET: ISLE 0x401000
// FUNCTION: ISLE 0x401000
IsleApp::IsleApp()
{
m_hdPath = NULL;
@@ -61,7 +61,7 @@ IsleApp::IsleApp()
LegoOmni::CreateInstance();
}
// OFFSET: ISLE 0x4011a0
// FUNCTION: ISLE 0x4011a0
IsleApp::~IsleApp()
{
if (LegoOmni::GetInstance()) {
@@ -86,7 +86,7 @@ IsleApp::~IsleApp()
}
}
// OFFSET: ISLE 0x401260
// FUNCTION: ISLE 0x401260
void IsleApp::Close()
{
MxDSAction ds;
@@ -121,7 +121,7 @@ void IsleApp::Close()
}
}
// OFFSET: ISLE 0x4013b0
// FUNCTION: ISLE 0x4013b0
BOOL IsleApp::SetupLegoOmni()
{
BOOL result = FALSE;
@@ -140,7 +140,7 @@ BOOL IsleApp::SetupLegoOmni()
return result;
}
// OFFSET: ISLE 0x401560
// FUNCTION: ISLE 0x401560
void IsleApp::SetupVideoFlags(
BOOL fullScreen,
BOOL flipSurfaces,
@@ -172,7 +172,7 @@ void IsleApp::SetupVideoFlags(
BOOL FindExistingInstance(void);
BOOL StartDirectSound(void);
// OFFSET: ISLE 0x401610
// FUNCTION: ISLE 0x401610
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
// Look for another instance, if we find one, bring it to the foreground instead
@@ -281,10 +281,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
return msg.wParam;
}
// OFFSET: ISLE 0x401c40 TEMPLATE
// FUNCTION: ISLE 0x401c40
// MxDSObject::SetAtomId
// OFFSET: ISLE 0x401ca0
// FUNCTION: ISLE 0x401ca0
BOOL FindExistingInstance(void)
{
HWND hWnd = FindWindowA(WNDCLASS_NAME, WINDOW_TITLE);
@@ -297,7 +297,7 @@ BOOL FindExistingInstance(void)
return 1;
}
// OFFSET: ISLE 0x401ce0
// FUNCTION: ISLE 0x401ce0
BOOL StartDirectSound(void)
{
LPDIRECTSOUND lpDS = NULL;
@@ -310,7 +310,7 @@ BOOL StartDirectSound(void)
return FALSE;
}
// OFFSET: ISLE 0x401d20
// FUNCTION: ISLE 0x401d20
LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
NotificationId type;
@@ -481,7 +481,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
// OFFSET: ISLE 0x4023e0
// FUNCTION: ISLE 0x4023e0
MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
{
WNDCLASSA wndclass;
@@ -627,7 +627,7 @@ MxResult IsleApp::SetupWindow(HINSTANCE hInstance, LPSTR lpCmdLine)
return SUCCESS;
}
// OFFSET: ISLE 0x402740
// FUNCTION: ISLE 0x402740
BOOL IsleApp::ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize)
{
HKEY hKey;
@@ -646,7 +646,7 @@ BOOL IsleApp::ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize)
return out;
}
// OFFSET: ISLE 0x4027b0
// FUNCTION: ISLE 0x4027b0
int IsleApp::ReadRegBool(LPCSTR name, BOOL* out)
{
char buffer[256];
@@ -668,7 +668,7 @@ int IsleApp::ReadRegBool(LPCSTR name, BOOL* out)
return read;
}
// OFFSET: ISLE 0x402880
// FUNCTION: ISLE 0x402880
int IsleApp::ReadRegInt(LPCSTR name, int* out)
{
char buffer[256];
@@ -681,7 +681,7 @@ int IsleApp::ReadRegInt(LPCSTR name, int* out)
return read;
}
// OFFSET: ISLE 0x4028d0
// FUNCTION: ISLE 0x4028d0
void IsleApp::LoadConfig()
{
char buffer[1024];
@@ -747,7 +747,7 @@ void IsleApp::LoadConfig()
}
}
// OFFSET: ISLE 0x402c20
// FUNCTION: ISLE 0x402c20
inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
{
if (!this->m_windowActive) {
@@ -819,7 +819,7 @@ inline void IsleApp::Tick(BOOL sleepIfNotNextFrame)
Sleep(0);
}
// OFFSET: ISLE 0x402e80
// FUNCTION: ISLE 0x402e80
void IsleApp::SetupCursor(WPARAM wParam)
{
switch (wParam) {