redefine vftable as actual member. allocate console for debug purposes

This commit is contained in:
Sydney Biscuit committed 2019-08-18 15:04:12 -07:00
1 parent 7b433f5282
commit 4e5ec98fa6
77 files changed
+348 -280

No files matched your search

+31 -46
View File
@@ -5,13 +5,13 @@
#include "TPinballComponent.h"
//----- (010145F5) --------------------------------------------------------
void* __stdcall TPinballComponent::operator new(size_t SizeOfElements)
void* TPinballComponent::operator new(size_t SizeOfElements)
{
return _calloc(1u, SizeOfElements);
}
//----- (010159A9) --------------------------------------------------------
int __thiscall TPinballComponent::Message(TPinballComponent* this, int a2, float a3)
int TPinballComponent::Message(int a2, float a3)
{
*(_DWORD*)((char*)this + 6) = a2;
if (a2 == 1024)
@@ -20,15 +20,15 @@ int __thiscall TPinballComponent::Message(TPinballComponent* this, int a2, float
}
//----- (010159CA) --------------------------------------------------------
int __stdcall TPinballComponent::get_scoring(int a2)
int TPinballComponent::get_scoring(int a2)
{
return 0;
}
//----- (01017C6D) --------------------------------------------------------
TPinballComponent* __thiscall TPinballComponent::TPinballComponent(TPinballComponent* this, struct TPinballTable* a2, int a3, int a4)
TPinballComponent* TPinballComponent::TPinballComponent(struct TPinballTable* a2, int a3, int a4)
{
TPinballComponent* v4; // esi
TPinballComponent* this; // esi
struct TPinballTable* v5; // edi
TZmapList* v6; // eax
TZmapList* v7; // eax
@@ -42,26 +42,11 @@ TPinballComponent* __thiscall TPinballComponent::TPinballComponent(TPinballCompo
signed int v15; // ebx
_DWORD* v16; // eax
int v17; // eax
char v19; // [esp+Ch] [ebp-6Ch]
void* v20; // [esp+4Ch] [ebp-2Ch]
void* v21; // [esp+50h] [ebp-28h]
int v22; // [esp+54h] [ebp-24h]
int v23; // [esp+58h] [ebp-20h]
int v24; // [esp+5Ch] [ebp-1Ch]
int v25; // [esp+60h] [ebp-18h]
int v26; // [esp+64h] [ebp-14h]
int v27; // [esp+68h] [ebp-10h]
int v28; // [esp+6Ch] [ebp-Ch]
int v29; // [esp+70h] [ebp-8h]
int v30; // [esp+74h] [ebp-4h]
struct TPinballTable* v31; // [esp+80h] [ebp+8h]
struct TPinballTable* v32; // [esp+80h] [ebp+8h]
signed int v33; // [esp+88h] [ebp+10h]
v4 = this;
this = this;
v5 = a2;
*(_DWORD*)this = &TPinballComponent::`vftable`;
* (_DWORD*)((char*)this + 6) = 0;
* (_DWORD*)((char*)this + 6) = 0;
*((_BYTE*)this + 4) = 0;
*((_BYTE*)this + 5) = 0;
*(_DWORD*)((char*)this + 30) = a2;
@@ -69,7 +54,7 @@ TPinballComponent* __thiscall TPinballComponent::TPinballComponent(TPinballCompo
if (a2)
objlist_class::Add((struct TPinballTable*)((char*)a2 + 250), (void*)this);
if (a3 >= 0)
* (_DWORD*)((char*)v4 + 10) = loader_query_name(a3);
* (_DWORD*)((char*)this + 10) = loader_query_name(a3);
if (a4 && a3 >= 0)
{
v33 = loader_query_visual_states(a3);
@@ -81,41 +66,41 @@ TPinballComponent* __thiscall TPinballComponent::TPinballComponent(TPinballCompo
loader_query_visual(a3, (signed int)v31, &v19);
if (v20)
{
if (!*(_DWORD*)((char*)v4 + 34))
if (!*(_DWORD*)((char*)this + 34))
{
v6 = (TZmapList*)operator new(8u);
if (v6)
v7 = TZmapList::TZmapList(v6, v33, 4);
else
v7 = 0;
*(_DWORD*)((char*)v4 + 34) = v7;
*(_DWORD*)((char*)this + 34) = v7;
}
v8 = *(objlist_class * *)((char*)v4 + 34);
v8 = *(objlist_class * *)((char*)this + 34);
if (v8)
objlist_class::Add(v8, v20);
}
if (v21)
{
if (!*(_DWORD*)((char*)v4 + 38))
if (!*(_DWORD*)((char*)this + 38))
{
v9 = (TZmapList*)operator new(8u);
if (v9)
v10 = TZmapList::TZmapList(v9, v33, 4);
else
v10 = 0;
*(_DWORD*)((char*)v4 + 38) = v10;
*(_DWORD*)((char*)this + 38) = v10;
}
v11 = *(objlist_class * *)((char*)v4 + 38);
v11 = *(objlist_class * *)((char*)this + 38);
if (v11)
objlist_class::Add(v11, v21);
}
v31 = (struct TPinballTable*)((char*)v31 + 1);
} while ((signed int)v31 < v33);
}
v12 = *(_DWORD*)((char*)v4 + 38);
v12 = *(_DWORD*)((char*)this + 38);
if (v12)
v30 = *(_DWORD*)(*(_DWORD*)(v12 + 4) + 8);
v13 = *(_DWORD*)((char*)v4 + 34);
v13 = *(_DWORD*)((char*)this + 34);
if (v13)
{
v14 = *(_DWORD * *)(*(_DWORD*)(v13 + 4) + 8);
@@ -129,7 +114,7 @@ TPinballComponent* __thiscall TPinballComponent::TPinballComponent(TPinballCompo
v32 = (struct TPinballTable*)12;
do
{
v16 = *(_DWORD * *)((char*)v32 + *(_DWORD*)(*(_DWORD*)((char*)v4 + 34) + 4));
v16 = *(_DWORD * *)((char*)v32 + *(_DWORD*)(*(_DWORD*)((char*)this + 34) + 4));
v22 = *(_DWORD*)((char*)v16 + 29) - *(_DWORD*)((char*)v5 + 234);
v23 = *(_DWORD*)((char*)v16 + 33) - *(_DWORD*)((char*)v5 + 238);
v24 = v16[3];
@@ -137,22 +122,22 @@ TPinballComponent* __thiscall TPinballComponent::TPinballComponent(TPinballCompo
enclosing_box(&v26, &v22, &v26);
v32 = (struct TPinballTable*)((char*)v32 + 4);
++v15;
} while (v15 < *(_DWORD*)(*(_DWORD*)(*(_DWORD*)((char*)v4 + 34) + 4) + 4));
} while (v15 < *(_DWORD*)(*(_DWORD*)(*(_DWORD*)((char*)this + 34) + 4) + 4));
}
v17 = *(_DWORD*)(*(_DWORD*)(*(_DWORD*)((char*)v4 + 34) + 4) + 8);
*(_DWORD*)((char*)v4 + 26) = render_create_sprite(
v17 = *(_DWORD*)(*(_DWORD*)(*(_DWORD*)((char*)this + 34) + 4) + 8);
*(_DWORD*)((char*)this + 26) = render_create_sprite(
v33 > 0,
*(_DWORD*)(*(_DWORD*)(*(_DWORD*)((char*)v4 + 34) + 4) + 8),
*(_DWORD*)(*(_DWORD*)(*(_DWORD*)((char*)this + 34) + 4) + 8),
v30,
*(_DWORD*)(v17 + 29) - *(_DWORD*)((char*)v5 + 234),
*(_DWORD*)(v17 + 33) - *(_DWORD*)((char*)v5 + 238),
&v26);
}
}
*(_DWORD*)((char*)v4 + 22) = a3;
return v4;
*(_DWORD*)((char*)this + 22) = a3;
return this;
}
// 10024A8: using guessed type void *TPinballComponent::`vftable`;
// 10024A8: using guessed type void *TPinballComponent::vftable;
//----- (01018FBC) --------------------------------------------------------
TZmapList* __thiscall TPinballComponent::~TPinballComponent(TPinballComponent* this)
@@ -164,7 +149,7 @@ TZmapList* __thiscall TPinballComponent::~TPinballComponent(TPinballComponent* t
v1 = this;
result = *(TZmapList * *)((char*)this + 30);
*(_DWORD*)this = &TPinballComponent::`vftable`;
*(_DWORD*)this = &TPinballComponent::vftable;
if (result)
result = (TZmapList*)objlist_delete_object(*(_DWORD*)((char*)result + 254), (int)this);
v3 = *(TZmapList * *)((char*)v1 + 34);
@@ -175,7 +160,7 @@ TZmapList* __thiscall TPinballComponent::~TPinballComponent(TPinballComponent* t
result = TZmapList::`scalar deleting destructor`(v4, 1);
return result;
}
// 10024A8: using guessed type void *TPinballComponent::`vftable`;
// 10024A8: using guessed type void *TPinballComponent::vftable;
//----- (01018FFD) --------------------------------------------------------
TComponentGroup* __thiscall TComponentGroup::TComponentGroup(TComponentGroup* this, struct TPinballTable* a2, int a3)
@@ -189,7 +174,7 @@ TComponentGroup* __thiscall TComponentGroup::TComponentGroup(TComponentGroup* th
v3 = this;
TPinballComponent::TPinballComponent(this, a2, a3, 0);
*(_DWORD*)v3 = &TComponentGroup::`vftable`;
*(_DWORD*)v3 = &TComponentGroup::vftable;
objlist_class::objlist_class((TComponentGroup*)((char*)v3 + 42), 4, 4);
*(_DWORD*)((char*)v3 + 50) = 0;
if (a3 > 0)
@@ -206,7 +191,7 @@ TComponentGroup* __thiscall TComponentGroup::TComponentGroup(TComponentGroup* th
}
return v3;
}
// 10024D8: using guessed type void *TComponentGroup::`vftable`;
// 10024D8: using guessed type void *TComponentGroup::vftable;
//----- (01019082) --------------------------------------------------------
TZmapList* __thiscall TComponentGroup::~TComponentGroup(TComponentGroup* this)
@@ -216,7 +201,7 @@ TZmapList* __thiscall TComponentGroup::~TComponentGroup(TComponentGroup* this)
v1 = this;
v2 = *(_DWORD*)((char*)this + 50);
*(_DWORD*)this = &TComponentGroup::`vftable`;
*(_DWORD*)this = &TComponentGroup::vftable;
if (v2)
{
timer_kill(v2);
@@ -225,5 +210,5 @@ TZmapList* __thiscall TComponentGroup::~TComponentGroup(TComponentGroup* this)
objlist_destroy(*(_DWORD*)((char*)v1 + 46));
return TPinballComponent::~TPinballComponent(v1);
}
// 10024D8: using guessed type void *TComponentGroup::`vftable`;
// 10024D8: using guessed type void *TComponentGroup::vftable;