Skip to content

Commit 0a54322

Browse files
committed
wip
1 parent 922d163 commit 0a54322

11 files changed

Lines changed: 849 additions & 55 deletions

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ add_executable(legoracers WIN32
158158
LEGORacers/src/imaginarynotion0x280.cpp
159159
LEGORacers/src/imaginarytool0x368.cpp
160160
LEGORacers/src/imaginarywrench0x23bc.cpp
161+
LEGORacers/src/keyboarddevice.cpp
161162
LEGORacers/racers.rc
162163
util/decomp.cpp
163164
${COMMON_SOURCES}
@@ -175,6 +176,7 @@ target_include_directories(legoracers PRIVATE
175176

176177
target_link_libraries(legoracers PRIVATE
177178
dinput
179+
dxguid
178180
ole32
179181
winmm
180182
)

GolDP/src/fluffygloomkins0x118.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "fluffygloomkins0x118.h"
22

3-
DECOMP_SIZE_ASSERT(FluffyGloomkins, 0x118);
3+
DECOMP_SIZE_ASSERT(FluffyGloomkins, 0x118)
44

55
// STUB: GOLDP 0x10017190
66
FluffyGloomkins::FluffyGloomkins()

GolDP/src/smallcocoon0xc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
#include <stdlib.h>
66

7-
DECOMP_SIZE_ASSERT(SmallCocoon0xc, 0xc);
8-
DECOMP_SIZE_ASSERT(SmallCocoon0xc::Item, 0xc);
7+
DECOMP_SIZE_ASSERT(SmallCocoon0xc, 0xc)
8+
DECOMP_SIZE_ASSERT(SmallCocoon0xc::Item, 0xc)
99

1010
// FUNCTION: GOLDP 0x100281c0
1111
SmallCocoon0xc::SmallCocoon0xc()

GolDP/src/zoweeblubberworth0xf0.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "zoweeblubberworth0xf0.h"
22

3-
DECOMP_SIZE_ASSERT(ZoweeBlubberworth0xf0, 0xf0);
3+
DECOMP_SIZE_ASSERT(ZoweeBlubberworth0xf0, 0xf0)
44

55
// FUNCTION: GOLDP 0x1002c030
66
ZoweeBlubberworth0xf0::ZoweeBlubberworth0xf0()

LEGORacers/include/inputdevice.h

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
#ifndef INPUTDEVICE_H
2+
#define INPUTDEVICE_H
3+
4+
#include "decomp.h"
5+
#include "types.h"
6+
7+
class OpalVault0xf0;
8+
9+
// VTABLE: LEGORACERS 0x004b0e9c
10+
// SIZE 0x9c
11+
class InputDevice {
12+
public:
13+
InputDevice();
14+
virtual void VTable0x00();
15+
virtual void VTable0x04(undefined4, LegoBool p_arg2, undefined4);
16+
virtual void VTable0x08(undefined4, undefined4) = 0;
17+
virtual ~InputDevice();
18+
virtual LegoBool32 VTable0x10();
19+
virtual undefined4 VTable0x14(undefined4);
20+
virtual undefined4 VTable0x18();
21+
virtual undefined4 VTable0x1c();
22+
virtual undefined4 VTable0x20();
23+
virtual const LegoChar* VTable0x24(undefined4);
24+
virtual void VTable0x28(undefined4) = 0;
25+
virtual LegoFloat VTable0x2c() = 0;
26+
virtual LegoFloat VTable0x30() = 0;
27+
virtual undefined4 VTable0x34(undefined4) = 0;
28+
virtual undefined4 VTable0x38() = 0;
29+
virtual undefined4 VTable0x3c() = 0;
30+
virtual undefined4 VTable0x40() = 0;
31+
virtual undefined4 VTable0x44() = 0;
32+
virtual undefined4 VTable0x48() = 0;
33+
virtual undefined4 VTable0x4c() = 0;
34+
virtual undefined4 VTable0x50();
35+
virtual undefined4 VTable0x54();
36+
virtual LegoBool32 VTable0x58() = 0;
37+
virtual LegoBool32 VTable0x5c() = 0;
38+
virtual LegoBool32 VTable0x60() = 0;
39+
40+
void FUN_0044b9f0();
41+
void FUN_0044bab0(undefined4 p_arg1, undefined4 p_arg2);
42+
void FUN_0044bad0(const LegoChar* p_str);
43+
void FUN_0044baf0(undefined2* p_arg1, undefined2* p_arg2);
44+
undefined2* FUN_0044bb20();
45+
undefined2* FUN_0044bb40();
46+
void FUN_0044bb40(LegoFloat, LegoFloat, undefined4);
47+
void FUN_0044bc60(undefined4);
48+
void FUN_0044bda0();
49+
void FUN_0044bdd0(undefined4 p_arg1, undefined p_arg2);
50+
void FUN_0044bdf0(undefined4);
51+
LegoBool32 FUN_0044be10(undefined4);
52+
undefined2 FUN_0044be70(const LegoChar*);
53+
54+
// SYNTHETIC: LEGORACERS 0x0044b920
55+
// InputDevice::`scalar deleting destructor'
56+
57+
protected:
58+
undefined4 m_unk0x04; // 0x04
59+
undefined4 m_unk0x08; // 0x08
60+
undefined4 m_unk0x0c; // 0x0c
61+
undefined4 m_unk0x10; // 0x10
62+
OpalVault0xf0* m_opalVault; // 0x14
63+
LegoBool32 m_unk0x18; // 0x18
64+
undefined4 m_unk0x1c; // 0x1c
65+
undefined4 m_unk0x20; // 0x20
66+
undefined4 m_unk0x24; // 0x24
67+
undefined4 m_unk0x28; // 0x28
68+
undefined2* m_unk0x2c; // 0x2c
69+
undefined2* m_unk0x30; // 0x30
70+
undefined4 m_unk0x34; // 0x34
71+
undefined4 m_unk0x38; // 0x38
72+
undefined4 m_unk0x3c; // 0x3c
73+
undefined4 m_unk0x40; // 0x40
74+
undefined4 m_unk0x44; // 0x44
75+
undefined4 m_unk0x48; // 0x48
76+
undefined4 m_unk0x4c; // 0x4c
77+
LegoS32 m_unk0x50; // 0x50
78+
undefined4 m_unk0x54; // 0x54
79+
undefined4 m_unk0x58; // 0x58
80+
undefined4 m_unk0x5c; // 0x5c
81+
LegoChar m_unk0x60[32]; // 0x60
82+
undefined m_unk0x80[0x90 - 0x80]; // 0x80
83+
undefined4 m_unk0x90; // 0x90
84+
undefined4 m_unk0x94; // 0x94
85+
undefined4 m_unk0x98; // 0x98
86+
};
87+
88+
#include "compat.h"
89+
90+
#include <dinput.h>
91+
#include <windows.h>
92+
93+
class OpalVault0xf0;
94+
95+
struct CreateDinputDeviceParams {
96+
LPDIRECTINPUT m_dinput; // 0x00
97+
LPCDIDATAFORMAT m_dataFormat; // 0x04
98+
HWND m_hWnd; // 0x08
99+
const GUID* m_guid; // 0x0c
100+
undefined4 m_unk0x10; // 0x10
101+
OpalVault0xf0* m_opalVault; // 0x14
102+
};
103+
104+
// VTABLE: LEGORACERS 0x004b11b8
105+
// SIZE 0xcc
106+
class CommonInputDevice : public InputDevice {
107+
public:
108+
CommonInputDevice();
109+
110+
void VTable0x00() override;
111+
~CommonInputDevice() override;
112+
LegoBool32 VTable0x10() override;
113+
undefined4 VTable0x14(undefined4) override;
114+
const LegoChar* VTable0x24(undefined4) override;
115+
LegoFloat VTable0x2c() override;
116+
undefined4 VTable0x38() override;
117+
undefined4 VTable0x3c() override;
118+
undefined4 VTable0x40() override;
119+
undefined4 VTable0x44() override;
120+
undefined4 VTable0x48() override;
121+
undefined4 VTable0x4c() override;
122+
undefined4 VTable0x50() override;
123+
undefined4 VTable0x54() override;
124+
LegoBool32 VTable0x58() override;
125+
LegoBool32 VTable0x5c() override;
126+
LegoBool32 VTable0x60() override;
127+
virtual LegoBool32 VTable0x64(CreateDinputDeviceParams* p_params);
128+
virtual void VTable0x68(const DIDEVICEOBJECTDATA& p_data) = 0;
129+
130+
void FUN_0044ff50(undefined4);
131+
132+
// SYNTHETIC: LEGORACERS 0x0044f9e0
133+
// CommonInputDevice::`scalar deleting destructor'
134+
135+
protected:
136+
void FUN_0044fa50();
137+
void FUN_0044faa0();
138+
void FUN_0044fb30();
139+
undefined4 FUN_0044fda0();
140+
LegoBool32 FUN_0044fef0();
141+
undefined4 FUN_00450170(HRESULT p_hResult);
142+
143+
undefined4 m_unk0x9c; // 0x9c
144+
LPDIRECTINPUTDEVICE2A m_device; // 0xa0
145+
HWND m_hWnd; // 0xa4
146+
undefined4 m_unk0xa8; // 0xa8
147+
undefined4 m_unk0xac; // 0xac
148+
GUID m_deviceGuid; // 0xb0
149+
DWORD m_cooperativeLevel; // 0xc0
150+
undefined2* m_unk0xc4; // 0xc4
151+
undefined2* m_unk0xc8; // 0xc8
152+
};
153+
154+
// VTABLE: LEGORACERS 0x004b10e0
155+
// SIZE 0x2cc
156+
class KeyboardInputDevice : public CommonInputDevice {
157+
public:
158+
KeyboardInputDevice();
159+
160+
void VTable0x00() override;
161+
void VTable0x04(undefined4, LegoBool, undefined4) override;
162+
void VTable0x08(undefined4, undefined4) override;
163+
~KeyboardInputDevice() override;
164+
undefined4 VTable0x1c() override;
165+
undefined4 VTable0x20() override;
166+
void VTable0x28(undefined4) override;
167+
LegoFloat VTable0x30() override;
168+
undefined4 VTable0x34(undefined4) override;
169+
undefined4 VTable0x64(CreateDinputDeviceParams* p_params) override;
170+
void VTable0x68(const DIDEVICEOBJECTDATA& p_data) override;
171+
172+
// SYNTHETIC: LEGORACERS 0x0044f300
173+
// KeyboardInputDevice::`scalar deleting destructor'
174+
175+
static BOOL PASCAL FUN_0044f400(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
176+
177+
private:
178+
undefined2 m_unk0xcc[256]; // 0xcc
179+
};
180+
181+
#endif // INPUTDEVICE_H

LEGORacers/include/jaspercore0xf0.h

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include <dinput.h>
99

10+
class KeyboardInputDevice;
11+
1012
// VTABLE: LEGORACERS 0x004b0f00
1113
// SIZE 0xf0
1214
class JasperCore0xf0 {
@@ -18,10 +20,6 @@ class JasperCore0xf0 {
1820
virtual LegoS32 Init() = 0; // vtable+0x0c
1921
virtual LegoS32 VTable0x10(LegoS32) = 0; // vtable+0x10
2022
virtual LegoS32 VTable0x14() = 0; // vtable+0x14
21-
virtual LegoS32 VTable0x18(); // vtable+0x18
22-
virtual LegoS32 VTable0x1c(); // vtable+0x1c
23-
virtual LegoS32 VTable0x20(); // vtable+0x20
24-
virtual void VTable0x24(); // vtable+0x24
2523

2624
// SYNTHETIC: LEGORACERS 0x0044bf40
2725
// JasperCore0xf0::`scalar deleting destructor'
@@ -32,16 +30,16 @@ class JasperCore0xf0 {
3230
void FUN_0044c040();
3331

3432
protected:
35-
undefined m_unk0x04[0x40]; // 0x04
36-
undefined4 m_unk0x44; // 0x44
37-
undefined4 m_unk0x48; // 0x48
38-
undefined m_unk0x4c[0x40]; // 0x4c
39-
undefined4 m_unk0x8c; // 0x8c
40-
undefined4 m_unk0x90; // 0x90
41-
undefined4 m_unk0x94; // 0x94
42-
undefined4 m_unk0x98; // 0x98
43-
undefined4 m_unk0x9c; // 0x9c
44-
JasperAuxInterface* m_unk0xa0; // 0xa0
33+
undefined m_unk0x04[0x40]; // 0x04
34+
undefined4 m_unk0x44; // 0x44
35+
undefined4 m_unk0x48; // 0x48
36+
undefined m_unk0x4c[0x40]; // 0x4c
37+
undefined4 m_unk0x8c; // 0x8c
38+
undefined4 m_unk0x90; // 0x90
39+
undefined4 m_unk0x94; // 0x94
40+
undefined4 m_unk0x98; // 0x98
41+
KeyboardInputDevice* m_unk0x9c; // 0x9c
42+
JasperAuxInterface* m_unk0xa0; // 0xa0
4543

4644
protected:
4745
undefined m_unk0xa4[0x40]; // 0xa4

LEGORacers/include/opalvault0xf0.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class OpalVault0xf0 : public JasperCore0xf0 {
1717
LegoS32 Init() override; // vtable+0x0c
1818
LegoS32 VTable0x10(LegoS32) override; // vtable+0x10
1919
LegoS32 VTable0x14() override; // vtable+0x14
20-
LegoS32 VTable0x18() override; // vtable+0x18
21-
LegoS32 VTable0x1c() override; // vtable+0x1c
22-
LegoS32 VTable0x20() override; // vtable+0x20
23-
void VTable0x24() override; // vtable+0x24
20+
virtual LegoBool32 VTable0x18(); // vtable+0x18
21+
virtual LegoS32 VTable0x1c(); // vtable+0x1c
22+
virtual LegoS32 VTable0x20(); // vtable+0x20
23+
virtual void VTable0x24(); // vtable+0x24
2424
virtual void VTable0x28(); // vtable+0x28
2525

2626
// SYNTHETIC: LEGORACERS 0x00450350

LEGORacers/library_msvc.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifdef 0
22
// For LEGORACERS symbols only
33

4+
// LIBRARY: LEGORACERS 0x004a83f0
5+
// c_dfDIKeyboard
6+
47
// LIBRARY: LEGORACERS 0x004a849e
58
// __purecall
69

@@ -43,7 +46,7 @@
4346
// LIBRARY: LEGORACERS 0x004a880d
4447
// __setargv
4548

46-
// LIBRARY: LEGORACERS 0x004af010
49+
// LIBRARY: LEGORACERS 0x004a8498
4750
// _DirectInputCreateA@16
4851

4952
// GLOBAL: LEGORACERS 0x004be000

LEGORacers/src/jaspercore0xf0.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,3 @@ void JasperCore0xf0::FUN_0044c040()
4646
// TODO
4747
STUB(0x44c040);
4848
}
49-
50-
// STUB: LEGORACERS 0x0044c120
51-
void JasperCore0xf0::VTable0x24()
52-
{
53-
// TODO
54-
STUB(0x44c120);
55-
}
56-
57-
// STUB: LEGORACERS 0x0044c430
58-
LegoS32 JasperCore0xf0::VTable0x18()
59-
{
60-
// TODO
61-
STUB(0x44c430);
62-
return 0;
63-
}
64-
65-
// STUB: LEGORACERS 0x0044c4a0
66-
LegoS32 JasperCore0xf0::VTable0x1c()
67-
{
68-
// TODO
69-
STUB(0x44c4a0);
70-
return 0;
71-
}
72-
73-
// STUB: LEGORACERS 0x0044c510
74-
LegoS32 JasperCore0xf0::VTable0x20()
75-
{
76-
// TODO
77-
STUB(0x44c510);
78-
return 0;
79-
}

0 commit comments

Comments
 (0)