2024-05-12 17:44:36 +00:00
|
|
|
#include "trig.h"
|
2024-05-22 14:49:57 +00:00
|
|
|
#include "validate.h"
|
|
|
|
|
2024-07-13 13:42:05 +00:00
|
|
|
u16 **gTrigNodes;
|
2024-05-12 17:44:36 +00:00
|
|
|
|
2024-07-13 16:30:41 +00:00
|
|
|
// @SMALLTODO
|
|
|
|
void* Trig_GetLinkInfoList(i32, SLinkInfo*, i32)
|
|
|
|
{
|
|
|
|
return reinterpret_cast<void*>(0x13072024);
|
|
|
|
}
|
|
|
|
|
2024-07-12 16:22:59 +00:00
|
|
|
// @MEDIUMTODO
|
2024-05-12 17:44:36 +00:00
|
|
|
int Trig_GetLevelId(void)
|
|
|
|
{
|
|
|
|
return 0x686868;
|
|
|
|
}
|
|
|
|
|
2024-07-12 16:22:59 +00:00
|
|
|
// @BIGTODO
|
2024-07-13 13:42:05 +00:00
|
|
|
u16* Trig_GetPosition(CVector*, int)
|
|
|
|
{
|
|
|
|
return reinterpret_cast<u16*>(0x13072024);
|
|
|
|
}
|
2024-05-12 17:44:36 +00:00
|
|
|
|
2024-07-12 16:22:59 +00:00
|
|
|
// @SMALLTODO
|
2024-05-12 17:44:36 +00:00
|
|
|
void* Trig_GetLinksPointer(int)
|
|
|
|
{
|
|
|
|
return reinterpret_cast<void*>(0x686849);
|
|
|
|
}
|
2024-05-14 18:19:05 +00:00
|
|
|
|
2024-07-12 16:22:59 +00:00
|
|
|
// @MEDIUMTODO
|
2024-05-14 18:19:05 +00:00
|
|
|
void Trig_SendPulse(unsigned __int16*)
|
|
|
|
{}
|
2024-05-22 14:49:57 +00:00
|
|
|
|
2024-07-12 16:22:59 +00:00
|
|
|
// @SMALLTODO
|
2024-05-25 17:19:27 +00:00
|
|
|
void Trig_SendSignalToLinks(unsigned __int16*)
|
|
|
|
{}
|
|
|
|
|
2024-05-26 14:32:38 +00:00
|
|
|
static int gTrigMenu[40];
|
|
|
|
static int gRestartPoints;
|
|
|
|
// @NotOk
|
|
|
|
// Globals
|
|
|
|
void Trig_ClearTrigMenu(void)
|
|
|
|
{
|
|
|
|
for (int i = 0; i<40; i++)
|
|
|
|
{
|
|
|
|
gTrigMenu[i] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
gRestartPoints = 0;
|
|
|
|
}
|
|
|
|
|
2024-05-26 15:26:37 +00:00
|
|
|
// @Ok
|
|
|
|
unsigned char* SkipFlags(unsigned char* ptr)
|
|
|
|
{
|
|
|
|
while(*ptr != 0xFF)
|
|
|
|
ptr++;
|
|
|
|
|
|
|
|
return ptr+1;
|
|
|
|
}
|
|
|
|
|
2024-05-28 17:12:31 +00:00
|
|
|
static int* gTrigCollisionRelated;
|
|
|
|
|
|
|
|
// @NotOk
|
|
|
|
// Globals
|
|
|
|
// unknown memory accesses
|
|
|
|
void Trig_ResetCPCollisionFlags(void)
|
|
|
|
{
|
|
|
|
for(int *ptr = gTrigCollisionRelated; ptr; ptr = reinterpret_cast<int*>(ptr[5]))
|
|
|
|
{
|
|
|
|
*reinterpret_cast<unsigned char*>(&ptr[1]) = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-29 18:14:35 +00:00
|
|
|
// @NotOk
|
|
|
|
// check inline later
|
|
|
|
int __inline GetFlag(unsigned char flag, unsigned char *pData)
|
|
|
|
{
|
|
|
|
while (*pData != 0xFF)
|
|
|
|
{
|
|
|
|
if (*pData == flag)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-07-12 16:22:59 +00:00
|
|
|
// @BIGTODO
|
2024-05-31 17:49:29 +00:00
|
|
|
void Trig_SendPulseToNode(int)
|
|
|
|
{}
|
|
|
|
|
2024-05-22 14:49:57 +00:00
|
|
|
void validate_SLinkInfo(void)
|
|
|
|
{
|
2024-07-13 16:30:41 +00:00
|
|
|
VALIDATE_SIZE(SLinkInfo, 0x10);
|
2024-05-22 14:49:57 +00:00
|
|
|
|
|
|
|
VALIDATE(SLinkInfo, field_0, 0x0);
|
|
|
|
VALIDATE(SLinkInfo, field_4, 0x4);
|
|
|
|
VALIDATE(SLinkInfo, field_8, 0x8);
|
2024-07-13 16:30:41 +00:00
|
|
|
VALIDATE(SLinkInfo, field_C, 0xC);
|
2024-05-22 14:49:57 +00:00
|
|
|
}
|
2024-05-26 14:32:38 +00:00
|
|
|
|