Skip to content

Commit 96c813b

Browse files
authored
ImaginaryDrill0x2450 (isledecomp#244)
* `ImaginaryDrill0x2450` * Fix class layout * Update CLAUDE.md
1 parent 828e841 commit 96c813b

89 files changed

Lines changed: 1469 additions & 602 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Keep original types at API boundaries (Win32, DirectX, CRT); `void*` can remain.
157157

158158
- **Every type must be corroborated by matched code.** A type is proven only when a `// FUNCTION:` using it reaches 100%. Until then, `undefined`/`undefined4`.
159159
- **No raw pointer arithmetic as a substitute for types.** Casts + subtractions mean the types are wrong; find the real class so the cast is legitimate C++ (including multi-inheritance cross-casts — define the inheritance, don't fake the adjustment).
160+
- **Split mixed compilation units until unexplained address gaps are gone.** A large non-FOLDED address jump usually means one of the functions is assigned to the wrong class/type, or that multiple whole classes have been mashed into one source unit. Fix this by correcting ownership and moving whole classes or cohesive groups of whole classes into address-local implementation units. The exceptions are intentional FOLDED functions, which stay with the class they logically belong to, and single classes whose methods genuinely span a wide address range; never split one class's methods across `.cpp` files just to make address order look cleaner.
160161
- **One root type per header.** A header should define at most one top-level class or struct; forward declarations do not count. If a second concrete root type is needed, move it to its own header and include that header.
161162
- **Nest one-owner helper types.** Loader params, callback shims, small related records, and similar one-owner types belong inside the primary class that owns or consumes them instead of becoming top-level classes/structs.
162163
- **Ground polymorphic classes.** When a concrete polymorphic class is identified, add its `VTABLE`, ctor, dtor, and scalar-deleting-destructor annotations instead of leaving it as an unannotated interface shape.

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ set_property(TARGET goldp PROPERTY SUFFIX ".dll")
220220
# --- LEGORacers.exe target ---
221221
add_executable(legoracers WIN32
222222
LEGORacers/src/main.cpp
223+
LEGORacers/src/gamemain.cpp
223224
LEGORacers/src/cactusinterface0x4.cpp
224225
LEGORacers/src/legoracers.cpp
225226
LEGORacers/src/win32golapp.cpp
@@ -272,6 +273,7 @@ add_executable(legoracers WIN32
272273
LEGORacers/src/obscureanchor0x5c.cpp
273274
LEGORacers/src/obscureanthem0x58.cpp
274275
LEGORacers/src/obscureicon0x1a8.cpp
276+
LEGORacers/src/obscurelink0x1c.cpp
275277
LEGORacers/src/obscurerune0x4d8.cpp
276278
LEGORacers/src/obscuresigil0xdc.cpp
277279
LEGORacers/src/obscuretome0x3dc.cpp
@@ -283,10 +285,14 @@ add_executable(legoracers WIN32
283285
LEGORacers/src/imaginarybolt0x4774.cpp
284286
LEGORacers/src/imaginarybrush0x6410.cpp
285287
LEGORacers/src/imaginarychisel0x658.cpp
288+
LEGORacers/src/imaginarychisel0x658helperat0x368.cpp
286289
LEGORacers/src/imaginaryclaw0x15ec.cpp
287290
LEGORacers/src/imaginarycrowbar0x6750.cpp
288291
LEGORacers/src/imaginarycube0x3c34.cpp
289292
LEGORacers/src/imaginarydrill0x2450.cpp
293+
LEGORacers/src/imaginarydrillfieldat0x22dc.cpp
294+
LEGORacers/src/imaginarydrillfieldat0x420.cpp
295+
LEGORacers/src/imaginarydrillfieldat0x498.cpp
290296
LEGORacers/src/imaginaryfeather0x658.cpp
291297
LEGORacers/src/imaginarygear0x4c8c.cpp
292298
LEGORacers/src/imaginarygizmo0x1908.cpp
@@ -301,11 +307,17 @@ add_executable(legoracers WIN32
301307
LEGORacers/src/imaginaryspool0x2cc4.cpp
302308
LEGORacers/src/imaginaryspring0x658.cpp
303309
LEGORacers/src/imaginarytool0x368.cpp
310+
LEGORacers/src/imaginarytool0x368fieldat0x2e0.cpp
311+
LEGORacers/src/imaginarytool0x368fieldat0x340.cpp
312+
LEGORacers/src/imaginarytool0x368fieldat0x350.cpp
304313
LEGORacers/src/imaginarywrench0x23bc.cpp
305314
LEGORacers/src/onyxbreeze0x248.cpp
306315
LEGORacers/src/onyxcircularbuffer0x1c.cpp
307316
LEGORacers/src/peridottraceroot0x108.cpp
308317
LEGORacers/src/peridottrace0x4e0.cpp
318+
LEGORacers/src/peridottrace0x4a8.cpp
319+
LEGORacers/src/peridottraceactionbase0x34.cpp
320+
LEGORacers/src/peridottracestate0x438.cpp
309321
LEGORacers/src/citrinegrove0x1f4c.cpp
310322
LEGORacers/src/topazburst0x14.cpp
311323
LEGORacers/src/legopiecelibrary.cpp

LEGORacers/include/audio/directsoundgroup.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ class DirectSoundGroup : public SoundGroup {
2727
~DirectSoundGroup();
2828
void Load(const LegoChar* p_name) override; // vtable+0x00
2929
void Unload() override; // vtable+0x04
30-
virtual LegoBool32 IsLoaded(); // vtable+0x08
31-
virtual LegoU32 GetSoundCount(); // vtable+0x0c
32-
virtual void PlaySpatialSound(
30+
LegoBool32 IsLoaded() override; // vtable+0x08
31+
LegoU32 GetSoundCount() override; // vtable+0x0c
32+
void PlaySpatialSound(
3333
LegoU32 p_index,
3434
SoundNode* p_node,
3535
LegoFloat p_minDistance,
3636
LegoFloat p_maxDistance,
3737
LegoFloat p_volume,
3838
LegoFloat p_frequencyScale
39-
); // vtable+0x10
40-
virtual void PlaySoundByIndex(LegoU32 p_index); // vtable+0x14
41-
virtual SoundInstance* CreateSoundInstance(LegoU32 p_index); // vtable+0x18
42-
virtual void DestroySoundInstance(SoundInstance* p_sound); // vtable+0x1c
43-
virtual StreamingSoundInstance* CreateStreamingSoundInstance(LegoU32 p_index); // vtable+0x20
44-
virtual void DestroyStreamingSoundInstance(StreamingSoundInstance* p_sound); // vtable+0x24
45-
virtual SoundManager* GetSoundManager(); // vtable+0x28
39+
) override; // vtable+0x10
40+
void PlaySoundByIndex(LegoU32 p_index) override; // vtable+0x14
41+
SoundInstance* CreateSoundInstance(LegoU32 p_index) override; // vtable+0x18
42+
void DestroySoundInstance(SoundInstance* p_sound) override; // vtable+0x1c
43+
StreamingSoundInstance* CreateStreamingSoundInstance(LegoU32 p_index) override; // vtable+0x20
44+
void DestroyStreamingSoundInstance(StreamingSoundInstance* p_sound) override; // vtable+0x24
45+
SoundManager* GetSoundManager() override; // vtable+0x28
4646

4747
private:
4848
undefined4 m_unk0x10; // 0x10

LEGORacers/include/audio/nullsoundgroup.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ class NullSoundGroup : public SoundGroup {
2121
~NullSoundGroup();
2222
void Load(const LegoChar* p_name) override; // vtable+0x00
2323
void Unload() override; // vtable+0x04
24-
virtual LegoBool32 IsLoaded(); // vtable+0x08
25-
virtual LegoU32 GetSoundCount(); // vtable+0x0c
26-
virtual void PlaySpatialSound(
24+
LegoBool32 IsLoaded() override; // vtable+0x08
25+
LegoU32 GetSoundCount() override; // vtable+0x0c
26+
void PlaySpatialSound(
2727
LegoU32 p_index,
2828
SoundNode* p_node,
2929
LegoFloat p_minDistance,
3030
LegoFloat p_maxDistance,
3131
LegoFloat p_volume,
3232
LegoFloat p_frequencyScale
33-
); // vtable+0x10
34-
virtual void PlaySoundByIndex(LegoU32 p_index); // vtable+0x14
35-
virtual SoundInstance* CreateSoundInstance(LegoU32 p_index); // vtable+0x18
36-
virtual void DestroySoundInstance(SoundInstance* p_sound); // vtable+0x1c
37-
virtual StreamingSoundInstance* CreateStreamingSoundInstance(LegoU32 p_index); // vtable+0x20
38-
virtual void DestroyStreamingSoundInstance(StreamingSoundInstance* p_sound); // vtable+0x24
39-
virtual SoundManager* GetSoundManager(); // vtable+0x28
33+
) override; // vtable+0x10
34+
void PlaySoundByIndex(LegoU32 p_index) override; // vtable+0x14
35+
SoundInstance* CreateSoundInstance(LegoU32 p_index) override; // vtable+0x18
36+
void DestroySoundInstance(SoundInstance* p_sound) override; // vtable+0x1c
37+
StreamingSoundInstance* CreateStreamingSoundInstance(LegoU32 p_index) override; // vtable+0x20
38+
void DestroyStreamingSoundInstance(StreamingSoundInstance* p_sound) override; // vtable+0x24
39+
SoundManager* GetSoundManager() override; // vtable+0x28
4040

4141
private:
4242
GolList<NullSoundInstance> m_soundInstances; // 0x10

LEGORacers/include/audio/soundgroup.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#include "types.h"
77

88
class SoundManager;
9+
class SoundInstance;
10+
class StreamingSoundInstance;
11+
struct SoundNode;
912

1013
// SIZE 0x10
1114
class SoundGroup : public GolListLink {
@@ -14,6 +17,22 @@ class SoundGroup : public GolListLink {
1417

1518
virtual void Load(const LegoChar* p_name) = 0; // vtable+0x00
1619
virtual void Unload() = 0; // vtable+0x04
20+
virtual LegoBool32 IsLoaded() = 0; // vtable+0x08
21+
virtual LegoU32 GetSoundCount() = 0; // vtable+0x0c
22+
virtual void PlaySpatialSound(
23+
LegoU32 p_index,
24+
SoundNode* p_node,
25+
LegoFloat p_minDistance,
26+
LegoFloat p_maxDistance,
27+
LegoFloat p_volume,
28+
LegoFloat p_frequencyScale
29+
) = 0; // vtable+0x10
30+
virtual void PlaySoundByIndex(LegoU32 p_index) = 0; // vtable+0x14
31+
virtual SoundInstance* CreateSoundInstance(LegoU32 p_index) = 0; // vtable+0x18
32+
virtual void DestroySoundInstance(SoundInstance* p_sound) = 0; // vtable+0x1c
33+
virtual StreamingSoundInstance* CreateStreamingSoundInstance(LegoU32) = 0; // vtable+0x20
34+
virtual void DestroyStreamingSoundInstance(StreamingSoundInstance*) = 0; // vtable+0x24
35+
virtual SoundManager* GetSoundManager() = 0; // vtable+0x28
1736

1837
void SetSoundManager(SoundManager* p_soundManager) { m_soundManager = p_soundManager; }
1938

LEGORacers/include/audio/soundgroupbinding.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class SoundGroupBinding {
1515

1616
LegoBool32 SetSoundGroup(SoundManager* p_soundManager, SoundGroup* p_soundGroup, undefined4 p_unk0x0c);
1717
LegoBool32 ResetSoundGroup();
18+
void FUN_0046e970(LegoU32 p_index);
1819

1920
private:
2021
void Reset();

LEGORacers/include/ceruleanqueen0x58.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ class CeruleanQueen0x58 : public CeruleanKnight0x20 {
3131
undefined m_unk0x40[0x74 - 0x40]; // 0x40
3232
};
3333

34+
// SIZE 0x84
35+
class Entry0x84 {
36+
public:
37+
undefined m_unk0x00[0x38 - 0x00]; // 0x00
38+
LegoU8 m_unk0x38; // 0x38
39+
undefined m_unk0x39[0x52 - 0x39]; // 0x39
40+
LegoS8 m_unk0x52[6][4]; // 0x52
41+
undefined m_unk0x6a[0x74 - 0x6a]; // 0x6a
42+
undefined4 m_unk0x74; // 0x74
43+
undefined4 m_unk0x78; // 0x78
44+
undefined m_unk0x7c[0x84 - 0x7c]; // 0x7c
45+
};
46+
3447
// SIZE 0x0c
3548
struct ResourceLoadParams {
3649
BronzeFalcon0xc8770* m_renderer; // 0x00
@@ -51,6 +64,7 @@ class CeruleanQueen0x58 : public CeruleanKnight0x20 {
5164

5265
private:
5366
void FUN_00469900(ResourceLoadParams* p_params);
67+
void FUN_00469a20(Entry0x84* p_entry);
5468
void FUN_0046a750();
5569
void FUN_0046a800();
5670
void FUN_0046a8a0();
@@ -66,6 +80,9 @@ class CeruleanQueen0x58 : public CeruleanKnight0x20 {
6680
void FUN_0046aea0();
6781

6882
protected:
83+
static void __stdcall FUN_00469b20(Entry0x84* p_entry);
84+
void FUN_00469b50(Entry0x84* p_entry);
85+
6986
undefined* m_unk0x20; // 0x20
7087
undefined* m_unk0x24; // 0x24
7188
undefined* m_unk0x28; // 0x28

LEGORacers/include/citrinegrove0x1f4c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CitrineGrove0x1f4c {
3030
void FUN_004435c0();
3131
void FUN_00443620(const LegoChar*, PeridotTrace0x4a8*);
3232
void FUN_004436e0();
33-
void FUN_00450fc0(const LegoChar* p_path);
33+
LegoU32 FUN_00443760();
3434

3535
private:
3636
MarigoldTrail0x108 m_unk0x00; // 0x00

LEGORacers/include/crimsonsun0xa4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class CrimsonSun0xa4 {
1212

1313
LegoS32 Reset();
1414
LegoS32 FUN_00468ab0();
15+
void FUN_00468cf0();
1516
void FUN_00468da0(LegoU32 p_unk0x04);
1617
void FUN_00468e20();
1718
LegoBool FUN_00468af0(void* p_unk0x04, LegoS32 p_unk0x08, void* p_unk0x0c);

LEGORacers/include/imaginaryaxe0x36c4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ImaginaryAxe0x36c4 : public ImaginaryTool0x368 {
1111
public:
1212
ImaginaryAxe0x36c4();
1313

14-
void VTable0x38(undefined4) override; // vtable+0x38
14+
void VTable0x38(ObscureVantage0x58*) override; // vtable+0x38
1515
void VTable0x44(undefined4) override; // vtable+0x44
1616
void VTable0x4c() override; // vtable+0x4c
1717
void Reset() override; // vtable+0x54

0 commit comments

Comments
 (0)