Skip to content

Commit 5bfa2e0

Browse files
committed
Annotate GolFile a bit
1 parent 7572cf3 commit 5bfa2e0

7 files changed

Lines changed: 46 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ if (MSVC_FOR_DECOMP)
196196
target_link_options(goldp PRIVATE "/OPT:NOREF,ICF")
197197
endif()
198198

199-
set_property(TARGET legoracers goldp PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
199+
set_property(TARGET legoracers PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
200+
set_property(TARGET goldp PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
200201

201202
set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"")
202203
set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"")

GolDP/library_msvc.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,36 @@
1212
// LIBRARY: GOLDP 0x1004b7fe
1313
// __purecall
1414

15+
// LIBRARY: GOLDP 0x1004bbd2
16+
// __tell
17+
18+
// LIBRARY: GOLDP 0x1004bbe3
19+
// __lseek
20+
1521
// LIBRARY: GOLDP 0x1004c5c7
1622
// __CRT_INIT@12
1723

1824
// LIBRARY: GOLDP 0x1004c6a0
1925
// __DllMainCRTStartup@12
2026

27+
// LIBRARY: GOLDP 0x1004bd2e
28+
// __errno
29+
30+
// LIBRARY: GOLDP 0x1004bd40
31+
// __open
32+
33+
// LIBRARY: GOLDP 0x1004c026
34+
// __close
35+
36+
// LIBRARY: GOLDP 0x1004c106
37+
// __read
38+
39+
// LIBRARY: GOLDP 0x1004c344
40+
// __write
41+
42+
// LIBRARY: GOLDP 0x1004c534
43+
// __commit
44+
2145
// GLOBAL: GOLDP 0x10067620
2246
// __pRawDllMain
2347

LEGORacers/src/ironflame0x944.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void IronFlame0x944::VTable0x14()
5656
{
5757
char buffer[100];
5858
// const char *dllname;
59-
GolImport gol_import;
59+
GolImport golImport;
6060

6161
if (m_unk0x928 & 0x2) {
6262
m_golLibrary = LoadLibraryA("GolGlide.DLL");
@@ -80,9 +80,9 @@ void IronFlame0x944::VTable0x14()
8080
if (golEntry == NULL) {
8181
GOL_FATALERROR_MESSAGE("Invalid Gol DLL - cannot call entry procedure");
8282
}
83-
CreateGolImport(&gol_import);
84-
gol_import.m_fatalErrorMessage = GolFatalErrorMessage;
85-
m_golExport = golEntry(&gol_import);
83+
CreateGolImport(&golImport);
84+
golImport.m_fatalErrorMessage = GolFatalErrorMessage;
85+
m_golExport = golEntry(&golImport);
8686
m_golDrawState = m_golExport->VTable0x04();
8787
}
8888

common/include/golfile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "decomp.h"
66
#include "golstream.h"
77

8+
// VTABLE: GOLDP 0x10057934
89
// VTABLE: LEGORACERS 0x4b1250
910
// SIZE 0x30
1011
class GolFile : public GolStream {
@@ -19,6 +20,7 @@ class GolFile : public GolStream {
1920
LegoS32 Write(void* p_buf, LegoU32 p_size) override; // vtable+0x10
2021
LegoS32 Flush() override; // vtable+0x14
2122

23+
// SYNTHETIC: GOLDP 0x100328e0
2224
// SYNTHETIC: LEGORACERS 0x450ab0
2325
// GolFile::`scalar deleting destructor'
2426
};

common/include/golstream.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "decomp.h"
55
#include "types.h"
66

7+
// VTABLE: GOLDP 0x10057884
78
// VTABLE: LEGORACERS 0x4b0f38
89
// SIZE 0x30
910
class GolStream {

common/src/golfile.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ GolFile::GolFile()
1616
m_fd = -1;
1717
}
1818

19+
// FUNCTION: GOLDP 0x10032900
1920
// FUNCTION: LEGORACERS 0x450ad0
2021
GolFile::~GolFile()
2122
{
2223
GolStream::Dispose();
2324
}
2425

26+
// FUNCTION: GOLDP 0x10032950
2527
// FUNCTION: LEGORACERS 0x450b50
2628
LegoS32 GolFile::Open(LegoChar* p_fileName)
2729
{
@@ -90,6 +92,7 @@ LegoS32 GolFile::Open(LegoChar* p_fileName)
9092
return result;
9193
}
9294

95+
// FUNCTION: GOLDP 0x10032a90
9396
// FUNCTION: LEGORACERS 0x450c90
9497
LegoS32 GolFile::Close()
9598
{
@@ -106,6 +109,7 @@ LegoS32 GolFile::Close()
106109
return e_ioSuccess;
107110
}
108111

112+
// FUNCTION: GOLDP 0x10032ad0
109113
// FUNCTION: LEGORACERS 0x450cd0
110114
LegoS32 GolFile::Seek(LegoS32 p_offset)
111115
{
@@ -117,6 +121,7 @@ LegoS32 GolFile::Seek(LegoS32 p_offset)
117121
return e_ioSuccess;
118122
}
119123

124+
// FUNCTION: GOLDP 0x10032b00
120125
// FUNCTION: LEGORACERS 0x450d00
121126
LegoS32 GolFile::Read(void* p_buf, LegoU32 p_size, LegoS32* p_lenRead)
122127
{
@@ -130,12 +135,14 @@ LegoS32 GolFile::Read(void* p_buf, LegoU32 p_size, LegoS32* p_lenRead)
130135
return result != 0 ? e_ioSuccess : e_ioEndOfFile;
131136
}
132137

138+
// FUNCTION: GOLDP 0x10032b40
133139
// FUNCTION: LEGORACERS 0x450d40
134140
LegoS32 GolFile::Write(void* p_buf, LegoU32 p_size)
135141
{
136142
return _write(m_fd, p_buf, p_size) < 0 ? e_ioWriteError : e_ioSuccess;
137143
}
138144

145+
// FUNCTION: GOLDP 0x10032b70
139146
// FUNCTION: LEGORACERS 0x450d70
140147
LegoS32 GolFile::Flush()
141148
{

common/src/golstream.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LegoChar g_pathBuffer[256];
1515
// GLOBAL: LEGORACERS 0x4c7384
1616
LegoChar* g_unk0x4c7384[4];
1717

18+
// GLOBAL: GOLDP 0x10065e78
1819
// GLOBAL: LEGORACERS 0x4c7394
1920
GolFileSource* g_fileSources;
2021

@@ -24,12 +25,14 @@ LegoU32 g_fileSourceCount;
2425
// GLOBAL: LEGORACERS 0x4c739c
2526
LegoU32 g_unk0x4c739c;
2627

28+
// FUNCTION: GOLDP 0x100314a0
2729
// FUNCTION: LEGORACERS 0x44c920
2830
GolStream::GolStream()
2931
{
3032
Init();
3133
}
3234

35+
// FUNCTION: GOLDP 0x10031530
3336
// FUNCTION: LEGORACERS 0x44c960
3437
GolStream::~GolStream()
3538
{
@@ -168,6 +171,7 @@ LegoS32 GolStream::BufferedOpen(LegoChar* p_fileName, LegoS32 p_mode, LegoU32 p_
168171
return e_ioSuccess;
169172
}
170173

174+
// FUNCTION: GOLDP 0x10031790
171175
// FUNCTION: LEGORACERS 0x44cc90
172176
LegoS32 GolStream::Dispose()
173177
{
@@ -601,12 +605,14 @@ LegoS32 GolStream::FlushWriteBuffer()
601605
return result;
602606
}
603607

608+
// FUNCTION: GOLDP 0x100016f0 FOLDED
604609
// FUNCTION: LEGORACERS 0x44e7e0
605610
LegoS32 GolStream::Flush()
606611
{
607612
return e_ioSuccess;
608613
}
609614

615+
// FUNCTION: GOLDP 0x10029950 FOLDED
610616
// FUNCTION: LEGORACERS 0x44e7f0
611617
LegoS32 GolStream::Write(void*, LegoU32)
612618
{

0 commit comments

Comments
 (0)