2024-03-09 19:23:32 +00:00
|
|
|
#include "spclone.h"
|
|
|
|
#include "validate.h"
|
|
|
|
|
2024-08-08 16:20:34 +00:00
|
|
|
extern CBaddy* BaddyList;
|
|
|
|
extern u8 submarinerDieRelated;
|
|
|
|
|
2024-08-04 15:22:46 +00:00
|
|
|
// @MEDIUMTODO
|
|
|
|
void CSpClone::AI(void)
|
|
|
|
{
|
|
|
|
printf("CSpClone::AI(void)");
|
|
|
|
}
|
|
|
|
|
2024-09-02 19:58:11 +00:00
|
|
|
// @Ok
|
2024-08-08 16:20:34 +00:00
|
|
|
// @Matching
|
|
|
|
CSpClone::CSpClone(i16 * a2,i32 a3)
|
2024-08-04 15:22:46 +00:00
|
|
|
{
|
2024-08-08 16:20:34 +00:00
|
|
|
this->InitItem("spidey");
|
|
|
|
this->field_194 &= 0xFFFFFFDF;
|
|
|
|
this->field_194 |= 0x40u;
|
|
|
|
this->field_194 &= 0xFFFFFBFF;
|
|
|
|
this->field_194 |= 0x800u;
|
|
|
|
|
|
|
|
i16 *v5 = this->SquirtAngles(this->SquirtPos(a2));
|
|
|
|
|
|
|
|
this->ShadowOn();
|
|
|
|
this->field_D0 = 48;
|
|
|
|
this->field_21E = 100;
|
|
|
|
this->field_32C = 2;
|
|
|
|
this->field_330 = 2;
|
|
|
|
|
|
|
|
this->RunAnim(0xCAu, 0, -1);
|
|
|
|
this->mFlags |= 0x480u;
|
|
|
|
|
|
|
|
// @FIXME figure this shit
|
|
|
|
this->field_3C = 0x555920;
|
|
|
|
|
|
|
|
this->AttachTo(reinterpret_cast<CBody**>(&BaddyList));
|
|
|
|
|
|
|
|
this->field_38 = 327;
|
|
|
|
this->field_31C.bothFlags = 1;
|
|
|
|
this->field_DE = a3;
|
|
|
|
this->field_DC = 0;
|
|
|
|
this->field_348 = reinterpret_cast<i32>(v5);
|
|
|
|
|
|
|
|
if ( submarinerDieRelated )
|
|
|
|
this->Die(0);
|
2024-08-04 15:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// @MEDIUMTODO
|
|
|
|
void CSpClone::DoMGSShadow(void)
|
|
|
|
{
|
|
|
|
printf("CSpClone::DoMGSShadow(void)");
|
|
|
|
}
|
|
|
|
|
2024-09-02 22:09:39 +00:00
|
|
|
// @Ok
|
|
|
|
INLINE i32* CSpClone::GetNewCommandBlock(u32 a1)
|
2024-08-04 15:22:46 +00:00
|
|
|
{
|
2024-09-02 22:09:39 +00:00
|
|
|
i32* res = static_cast<i32*>(DCMem_New(4 * a1, 0, 1, 0, 1));
|
|
|
|
res[a1 - 1] = 0;
|
|
|
|
|
|
|
|
if (!this->field_34C)
|
|
|
|
{
|
|
|
|
this->field_34C = res;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
i32* it = this->field_34C;
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
if (!it[it[1] - 1])
|
|
|
|
break;
|
|
|
|
|
|
|
|
it = reinterpret_cast<i32*>(it[it[1] - 1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
it[it[1] - 1] = reinterpret_cast<i32>(res);
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
2024-08-04 15:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// @SMALLTODO
|
|
|
|
void CSpClone::KillCommandBlockByID(i32)
|
|
|
|
{
|
|
|
|
printf("CSpClone::KillCommandBlockByID(i32)");
|
|
|
|
}
|
|
|
|
|
|
|
|
// @MEDIUMTODO
|
|
|
|
void CSpClone::SynthesizeAnalogueInput(void)
|
|
|
|
{
|
|
|
|
printf("CSpClone::SynthesizeAnalogueInput(void)");
|
|
|
|
}
|
|
|
|
|
2024-08-08 16:23:12 +00:00
|
|
|
// @Ok
|
2024-08-04 15:22:46 +00:00
|
|
|
CSpClone::~CSpClone(void)
|
|
|
|
{
|
2024-08-08 16:23:12 +00:00
|
|
|
this->DeleteFrom(reinterpret_cast<CBody**>(&BaddyList));
|
|
|
|
|
|
|
|
delete this->field_338;
|
|
|
|
|
|
|
|
this->KillAllCommandBlocks();
|
2024-08-04 15:22:46 +00:00
|
|
|
}
|
|
|
|
|
2024-08-08 16:13:22 +00:00
|
|
|
// @Ok
|
|
|
|
// @Matching
|
|
|
|
void SpClone_CreateSpClone(u32 * a2,u32 * a3)
|
2024-08-04 15:22:46 +00:00
|
|
|
{
|
2024-08-08 16:13:22 +00:00
|
|
|
i16* v2 = reinterpret_cast<i16*>(a2[0]);
|
|
|
|
i32 v3 = static_cast<i32>(a2[1]);
|
|
|
|
|
|
|
|
*a3 = reinterpret_cast<u32>(new CSpClone(v2, v3));
|
2024-08-04 15:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// @SMALLTODO
|
|
|
|
void SpClone_RelocatableModuleClear(void)
|
|
|
|
{
|
|
|
|
printf("SpClone_RelocatableModuleClear(void)");
|
|
|
|
}
|
2024-03-09 19:23:32 +00:00
|
|
|
|
2024-05-27 17:51:40 +00:00
|
|
|
// @Ok
|
|
|
|
void CSpClone::Shouldnt_DoPhysics_Be_Virtual(void)
|
|
|
|
{
|
|
|
|
this->DoPhysics();
|
|
|
|
}
|
|
|
|
|
2024-07-12 16:22:59 +00:00
|
|
|
// @BIGTODO
|
2024-05-27 17:51:40 +00:00
|
|
|
void CSpClone::DoPhysics(void)
|
|
|
|
{}
|
|
|
|
|
2024-09-02 20:19:07 +00:00
|
|
|
// @Ok
|
|
|
|
// @Matching
|
|
|
|
INLINE i32* CSpClone::KillCommandBlock(i32* a1)
|
2024-06-02 16:19:00 +00:00
|
|
|
{
|
2024-09-02 20:19:07 +00:00
|
|
|
i32* res = reinterpret_cast<i32*>(a1[a1[1]-1]);
|
|
|
|
|
|
|
|
if (this->field_34C == a1)
|
|
|
|
{
|
|
|
|
this->field_34C = res;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
i32* it = this->field_34C;
|
|
|
|
|
|
|
|
while (it)
|
|
|
|
{
|
|
|
|
if (a1 == reinterpret_cast<i32*>(it[it[1]-1]))
|
|
|
|
{
|
|
|
|
it[it[1]-1] = reinterpret_cast<i32>(res);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
it = reinterpret_cast<i32*>(it[it[1]-1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Mem_Delete(reinterpret_cast<void*>(a1));
|
|
|
|
return res;
|
2024-06-02 16:19:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// @NotOk
|
|
|
|
// Revisit
|
|
|
|
void CSpClone::KillAllCommandBlocks(void)
|
|
|
|
{
|
|
|
|
for (int* cur = reinterpret_cast<int*>(this->field_34C); cur; cur = this->KillCommandBlock(cur));
|
|
|
|
this->field_34C = 0;
|
|
|
|
}
|
|
|
|
|
2024-03-09 19:23:32 +00:00
|
|
|
void validate_CSpClone(void){
|
|
|
|
VALIDATE_SIZE(CSpClone, 0x350);
|
2024-04-28 14:53:12 +00:00
|
|
|
|
|
|
|
VALIDATE(CSpClone, field_328, 0x328);
|
|
|
|
VALIDATE(CSpClone, field_32C, 0x32C);
|
|
|
|
VALIDATE(CSpClone, field_330, 0x330);
|
|
|
|
VALIDATE(CSpClone, field_334, 0x334);
|
|
|
|
VALIDATE(CSpClone, field_338, 0x338);
|
2024-08-08 16:20:34 +00:00
|
|
|
|
|
|
|
VALIDATE(CSpClone, field_348, 0x348);
|
|
|
|
|
2024-04-28 14:53:12 +00:00
|
|
|
VALIDATE(CSpClone, field_34C, 0x34C);
|
|
|
|
}
|