CMysterio::ShakePad

This commit is contained in:
krystalgamer 2024-07-02 18:46:39 +01:00
parent fe4c86067c
commit e5733e1716
4 changed files with 38 additions and 9 deletions

View File

@ -1,6 +1,7 @@
#include "mysterio.h"
#include "validate.h"
#include "ps2redbook.h"
#include "ps2pad.h"
// @TODO
CMysterio::CMysterio(int*, int)
@ -107,6 +108,21 @@ i32 INLINE CMysterio::PlayAndAttachXAPlease(
return 0;
}
u8 gActuatorRelated;
// @NotOk
// globals
void INLINE CMysterio::ShakePad(void)
{
if (gActuatorRelated)
{
if (Pad_GetActuatorTime(0, 0) <= 2)
Pad_ActuatorOn(0, 6, 0, 1);
if (Pad_GetActuatorTime(0, 1) <= 2)
Pad_ActuatorOn(0, 10, 1, 0xC8);
}
}
void validate_CMysterio(void){
VALIDATE_SIZE(CMysterio, 0x3D0);

View File

@ -25,6 +25,7 @@ class CMysterio : public CBaddy {
EXPORT CMysterio(void);
EXPORT u8 MystRedbook_XAPlayPos(i32, i32, CVector*, i32);
EXPORT i32 CMysterio::PlayAndAttachXAPlease(i32, i32, CBody*, i32);
EXPORT void ShakePad(void);
i32 field_324;
u8 padAfter324[0x4];

View File

@ -4,13 +4,13 @@
static int gPadActuator[255];
// @NotOk
// global
void Pad_ActuatorOff(unsigned char a1, unsigned char)
void Pad_ActuatorOff(u8 a1, u8)
{
gPadActuator[a1] = 1;
}
// @Ok
void Pad_SetDigitalMapping(SControl *pControl, int a2, int a3, int a4, int a5)
void Pad_SetDigitalMapping(SControl *pControl, i32 a2, i32 a3, i32 a4, i32 a5)
{
pControl->field_140 = a2;
pControl->field_144 = a3;
@ -18,6 +18,16 @@ void Pad_SetDigitalMapping(SControl *pControl, int a2, int a3, int a4, int a5)
pControl->field_14C = a5;
}
// @TODO
u16 Pad_GetActuatorTime(u8, u8)
{
return 0x020702024;
}
// @TODO
void Pad_ActuatorOn(u8, u16, u8, u8)
{}
void validate_SControl(void)
{
VALIDATE(SControl, field_140, 0x140);

View File

@ -7,16 +7,18 @@
struct SControl
{
unsigned char pad[0x140];
u8 pad[0x140];
int field_140;
int field_144;
int field_148;
int field_14C;
i32 field_140;
i32 field_144;
i32 field_148;
i32 field_14C;
};
EXPORT void Pad_SetDigitalMapping(SControl*, int, int, int, int);
EXPORT void Pad_ActuatorOff(unsigned char, unsigned char);
EXPORT void Pad_SetDigitalMapping(SControl*, i32, i32, i32, i32);
EXPORT void Pad_ActuatorOff(u8, u8);
EXPORT u16 Pad_GetActuatorTime(u8, u8);
EXPORT void Pad_ActuatorOn(u8, u16, u8, u8);
void validate_SControl(void);