CBlackCat::GetNewCommandBlock

This commit is contained in:
krystalgamer 2024-09-02 23:12:47 +01:00
parent 8efa8bd050
commit a49cd37df5
2 changed files with 25 additions and 4 deletions

View File

@ -32,10 +32,31 @@ void CBlackCat::DoMGSShadow(void)
printf("CBlackCat::DoMGSShadow(void)");
}
// @SMALLTODO
void CBlackCat::GetNewCommandBlock(u32)
// @Ok
i32* CBlackCat::GetNewCommandBlock(u32 a1)
{
printf("CBlackCat::GetNewCommandBlock(u32)");
i32* res = static_cast<i32*>(DCMem_New(4 * a1, 0, 1, 0, 1));
res[a1 - 1] = 0;
if (!this->field_350)
{
this->field_350 = res;
}
else
{
i32* it = this->field_350;
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;
}
// @SMALLTODO

View File

@ -16,7 +16,7 @@ public:
EXPORT void AI(void) OVERRIDE;
EXPORT void DoMGSShadow(void);
EXPORT void GetNewCommandBlock(u32);
EXPORT i32* GetNewCommandBlock(u32);
EXPORT void KillCommandBlockByID(i32);
EXPORT void SynthesizeAnalogueInput(void);