Merge pull request #146 from abnormalhare/main
made buildable, more functions
This commit is contained in:
commit
c24cb2a3e0
6 changed files with 187 additions and 41 deletions
|
|
@ -130,6 +130,7 @@ s32 BoardPlayerDiceJumpCheck(s32);
|
|||
static void DiceJumpFunc(omObjData*);
|
||||
void BoardRotateDiceNumbers(s32);
|
||||
void BoardPlayerMotBlendSet(s32 arg0, s16 arg1, s16 arg2);
|
||||
void UpdateDiceDigitSprite(omObjData*);
|
||||
//...
|
||||
void BoardPlayerMotBlendExec(omObjData*);
|
||||
s32 BoardPlayerAutoSizeGet(s32);
|
||||
|
|
@ -150,5 +151,6 @@ s32 BoardPlayerMotBlendCheck(s32);
|
|||
void BoardPlayerMoveAwayStartCurr(s16, s32);
|
||||
void BoardBowserSuitMotionSetWalk(void);
|
||||
s16 BoardBowserSuitModelGet(void);
|
||||
void UpdateDiceDigit2D(omObjData*);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ void BoardCameraQuakeSet(s32 duration, float strength);
|
|||
s16 MGSeqCreate(s32, ...);
|
||||
u8 MGSeqStatGet(s16);
|
||||
void omVibrate(s16, s16, s16, s16);
|
||||
void BoardPlayerMotBlendSet(s32, s16, s16);
|
||||
f32 BoardPlayerRotYGet(s32);
|
||||
f32 BoardModelMotionTimeGet(s16);
|
||||
s32 BoardVecMinDistCheck(Vec *vec1, Vec *vec2, float min_dist);
|
||||
|
|
@ -952,4 +951,4 @@ void fn_1_BE30(s32 arg0, ParticleData* arg1) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,18 +3,17 @@
|
|||
#include "REL/w03Dll.h"
|
||||
#include "board_unsplit.h"
|
||||
#include "game/board/main.h"
|
||||
#include "game/board/player.h"
|
||||
|
||||
double sin(double x);
|
||||
double cos(double x);
|
||||
double atan2(double y, double x);
|
||||
s16 BoardModelIDGet(s16 model);
|
||||
void Hu3DModelObjPosGet(s16 arg0, char *arg1, Vec *arg2);
|
||||
void BoardPlayerMotBlendSet(s32, s32, s32);
|
||||
float BoardModelMotionTimeGet(s16 model);
|
||||
s32 BoardModelMotionShiftSet(s16 model, s32 motion, float time, float shift_time, u32 attr);
|
||||
void BoardPlayerPosSet(s32, f32, f32, f32);
|
||||
s32 BoardModelHookSet(s16 model, char *name, s16 hook);
|
||||
void BoardPlayerMotionShiftSet(s32, s32, f32, f32, s32);
|
||||
|
||||
|
||||
#define OM_GET_WORK_PTR(object, type) ((type *)(&((object)->work[0])))
|
||||
|
|
@ -314,15 +313,6 @@ void fn_1_6B98(s32 arg0) {
|
|||
|
||||
extern s32 lbl_1_data_368[];
|
||||
extern w03State* lbl_1_bss_0;
|
||||
|
||||
static inline PlayerState *BoardPlayerGet(s32 player) {
|
||||
return &GWPlayer[player];
|
||||
}
|
||||
|
||||
static inline s16 BoardPlayerModelGet(s32 player) {
|
||||
PlayerState *player_ptr = BoardPlayerGet(player);
|
||||
return boardPlayerMdl[player_ptr->player_idx];
|
||||
}
|
||||
|
||||
void fn_1_6F9C(s32 arg0) {
|
||||
Vec sp20;
|
||||
|
|
@ -474,4 +464,4 @@ void fn_1_77E4(s32 arg0) {
|
|||
BoardComKeySetRight();
|
||||
}
|
||||
|
||||
char padRiver[] = "\0\0\0\0";
|
||||
char padRiver[] = "\0\0\0\0";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ void fn_1_2A40(void);
|
|||
void fn_1_2B44(void);
|
||||
s32 BoardDAngleCalcRange(f32*, f32, f32);
|
||||
s32 BoardPlayerMotBlendCheck(s32);
|
||||
void BoardPlayerMotBlendSet(s32, s16, s16);
|
||||
f32 BoardPlayerRotYGet(s32);
|
||||
void BoardConfettiCreate(Point3d*, s16, f32);
|
||||
double atan2(double y, double x);
|
||||
|
|
@ -95,7 +94,7 @@ f32 lbl_1_bss_30;
|
|||
s8 lbl_1_bss_2C;
|
||||
Process* lbl_1_bss_28;
|
||||
|
||||
s32 fn_1_12C8(void) {
|
||||
void fn_1_12C8(void) {
|
||||
BoardDiceDigit2DShowSet(0);
|
||||
lbl_1_bss_28 = HuPrcChildCreate(&fn_1_1358, 0x2003, 0x2000, 0, boardMainProc);
|
||||
HuPrcDestructorSet2(lbl_1_bss_28, &fn_1_152C);
|
||||
|
|
@ -648,4 +647,4 @@ void fn_1_2B44(void) {
|
|||
GXSetChanMatColor(GX_COLOR0A0, sp1C);
|
||||
}
|
||||
|
||||
f32 const padStatue = 0.0f;
|
||||
f32 const padStatue = 0.0f;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "game/board/basic_space.h"
|
||||
#include "game/board/main.h"
|
||||
#include "game/board/player.h"
|
||||
#include "game/data.h"
|
||||
#include "game/flag.h"
|
||||
#include "game/object.h"
|
||||
|
|
@ -38,7 +39,6 @@ extern void omVibrate(s16, s16, s16, s16);
|
|||
extern void BoardPlayerPosGet(s32, Vec*);
|
||||
extern void BoardModelPosGet(s16, Vec*);
|
||||
extern void BoardPlayerMotionEndWait(s32);
|
||||
extern void BoardPlayerMotionShiftSet(s32, s32, f32, f32, s32);
|
||||
extern void BoardPlayerCoinsAdd(s32, s32);
|
||||
extern void BoardRotateDiceNumbers(s32);
|
||||
extern void BoardCameraMotBlendSet(s32, s16, s16);
|
||||
|
|
|
|||
|
|
@ -78,36 +78,15 @@ typedef struct bitcopy {
|
|||
s16 unk_06[5];
|
||||
} bitcopy;
|
||||
|
||||
typedef struct bitcopy2 {
|
||||
struct {
|
||||
u8 field00_bit0 : 1;
|
||||
u8 field00_bit1 : 2;
|
||||
u8 field00_bit3 : 1;
|
||||
u8 field00_bit4 : 1;
|
||||
u8 field00_bit5 : 2;
|
||||
u8 field00_bit7 : 1;
|
||||
};
|
||||
s8 unk_01;
|
||||
s16 unk_02;
|
||||
union{
|
||||
s32 unk_04;
|
||||
struct {
|
||||
s16 unk_04h;
|
||||
s16 unk_06h;
|
||||
};
|
||||
};
|
||||
f32 unk_08;
|
||||
f32 unk_0C;
|
||||
} bitcopy2;
|
||||
|
||||
static HsfMaterial *playerMatCopy[4];
|
||||
static s32 (*postTurnHook[4])();
|
||||
static s32 (*preTurnHook[4])();
|
||||
|
||||
s16 boardPlayerMdl[4];
|
||||
static s16 playerMot[4];
|
||||
static s16 junctionArrowRot[4];
|
||||
static s8 rollType;
|
||||
static s16 junctionArrowRot[4];
|
||||
static omObjData* diceDigit2DObj;
|
||||
static omObjData* junctionObj;
|
||||
static s32 junctionMask;
|
||||
static s32 rollResized;
|
||||
|
|
@ -1695,6 +1674,34 @@ static void PlayerPosLerpFunc(omObjData* arg0) {
|
|||
BoardPlayerPosSet(temp_r30, temp_f31, temp_f30, temp_f29);
|
||||
}
|
||||
|
||||
typedef struct bitcopy2 {
|
||||
struct {
|
||||
u8 field00_bit0 : 1;
|
||||
u8 field00_bit1 : 2;
|
||||
u8 field00_bit3 : 1;
|
||||
u8 field00_bit4 : 1;
|
||||
u8 field00_bit5 : 2;
|
||||
u8 field00_bit7 : 1;
|
||||
};
|
||||
s8 unk_01;
|
||||
s16 unk_02;
|
||||
union{
|
||||
struct {
|
||||
s32 unk_04;
|
||||
f32 unk_08;
|
||||
f32 unk_0C;
|
||||
};
|
||||
struct {
|
||||
s16 unk_04h;
|
||||
s16 unk_06h;
|
||||
s16 unk_08h;
|
||||
s16 unk_0Ah;
|
||||
s16 unk_0Ch;
|
||||
s16 unk_0Eh;
|
||||
};
|
||||
};
|
||||
} bitcopy2;
|
||||
|
||||
void BoardPlayerDiceJumpStart(s32 arg0) {
|
||||
Point3d sp8;
|
||||
PlayerState* temp_r25;
|
||||
|
|
@ -1884,6 +1891,155 @@ void BoardPlayerMotBlendSet(s32 arg0, s16 arg1, s16 arg2) {
|
|||
}
|
||||
}
|
||||
|
||||
void BoardPlayerMotBlendExec(omObjData* arg0) {
|
||||
f32 sp48;
|
||||
f32 var_f27;
|
||||
bitcopy2* temp_r30;
|
||||
|
||||
temp_r30 = (bitcopy2*) arg0->work;
|
||||
if ((temp_r30->field00_bit0 != 0) || (BoardIsKill() != 0)) {
|
||||
if (temp_r30->unk_04h > 0) {
|
||||
BoardPlayerMotionKill(temp_r30->unk_01, temp_r30->unk_04h);
|
||||
}
|
||||
BoardPlayerRotYSet(temp_r30->unk_01, temp_r30->unk_08);
|
||||
motDoneF[temp_r30->unk_01] = 0;
|
||||
omDelObjEx(HuPrcCurrentGet(), arg0);
|
||||
return;
|
||||
}
|
||||
if (temp_r30->unk_02-- <= 0) {
|
||||
temp_r30->field00_bit0 = 1;
|
||||
BoardPlayerRotYSet(temp_r30->unk_01, temp_r30->unk_08);
|
||||
if (GWPlayer[temp_r30->unk_01].bowser_suit != 0) {
|
||||
BoardBowserSuitMotionSetWait();
|
||||
BoardBowserSuitPlayerModelKill();
|
||||
} else {
|
||||
BoardPlayerMotionStart(temp_r30->unk_01, 1, 0x40000001);
|
||||
}
|
||||
return;
|
||||
}
|
||||
var_f27 = BoardPlayerRotYGet(temp_r30->unk_01);
|
||||
OSs16tof32(&temp_r30->unk_08h, &sp48);
|
||||
var_f27 += temp_r30->unk_0C;
|
||||
BoardPlayerRotYSet(temp_r30->unk_01, var_f27);
|
||||
}
|
||||
|
||||
s32 BoardPlayerMotBlendCheck(s32 arg0) {
|
||||
if (motDoneF[arg0] != 0) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
typedef struct bitcopy3 {
|
||||
struct {
|
||||
u8 field00_bit0 : 1;
|
||||
u8 field00_bit1 : 1;
|
||||
u8 field00_bit2 : 1;
|
||||
u8 field00_bit3 : 2;
|
||||
u8 field00_bit5 : 2;
|
||||
u8 field00_bit7 : 1;
|
||||
};
|
||||
u8 unk_01;
|
||||
s8 unk_02;
|
||||
s8 unk_03;
|
||||
s16 unk_04;
|
||||
s16 unk_06[5];
|
||||
} bitcopy3;
|
||||
|
||||
void BoardDiceDigit2DInit(s32 arg0, s32 arg1) {
|
||||
omObjData* temp_r3;
|
||||
s32 var_r30;
|
||||
bitcopy3* temp_r31;
|
||||
|
||||
temp_r3 = omAddObjEx(boardObjMan, 0x105, 0, 0, -1, &UpdateDiceDigit2D);
|
||||
temp_r31 = (bitcopy3*) temp_r3->work;
|
||||
temp_r31->field00_bit0 = 0;
|
||||
temp_r31->field00_bit1 = 1;
|
||||
temp_r31->unk_01 = 0;
|
||||
temp_r31->unk_02 = arg0;
|
||||
if (arg1 != 0) {
|
||||
temp_r31->unk_03 = 0;
|
||||
} else {
|
||||
temp_r31->unk_03 = 1;
|
||||
}
|
||||
temp_r31->unk_04 = HuSprGrpCreate(2);
|
||||
|
||||
for (var_r30 = 0; var_r30 < 2; var_r30++) {
|
||||
BoardSpriteCreate(0x7002B, 0x4B0, 0, &temp_r31->unk_06[var_r30]);
|
||||
HuSprGrpMemberSet(temp_r31->unk_04, var_r30, temp_r31->unk_06[var_r30]);
|
||||
HuSprPosSet(temp_r31->unk_04, var_r30, 288.0f, 240.0f);
|
||||
HuSprAttrSet(temp_r31->unk_04, var_r30, 4);
|
||||
}
|
||||
diceDigit2DObj = temp_r3;
|
||||
}
|
||||
|
||||
void BoardDiceDigit2DUpdateEnable(s32 arg0) {
|
||||
bitcopy3* temp_r31;
|
||||
|
||||
if (diceDigit2DObj != 0) {
|
||||
temp_r31 = (bitcopy3*) diceDigit2DObj->work;
|
||||
temp_r31->field00_bit0 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void BoardDiceDigit2DShowSet(s32 arg0) {
|
||||
s32 var_r30;
|
||||
bitcopy3* temp_r31;
|
||||
|
||||
if (diceDigit2DObj != 0) {
|
||||
temp_r31 = (bitcopy3*) diceDigit2DObj->work;
|
||||
|
||||
for (var_r30 = 0; var_r30 < 2; var_r30++) {
|
||||
if (arg0 != 0) {
|
||||
temp_r31->field00_bit1 = 1;
|
||||
if ((var_r30 == 1) && (GWPlayer[temp_r31->unk_02].roll / 10 == 0)) {
|
||||
HuSprAttrSet(temp_r31->unk_04, var_r30, 4);
|
||||
} else {
|
||||
HuSprAttrReset(temp_r31->unk_04, var_r30, 4);
|
||||
}
|
||||
} else {
|
||||
temp_r31->field00_bit1 = 0;
|
||||
HuSprAttrSet(temp_r31->unk_04, var_r30, 4);
|
||||
}
|
||||
}
|
||||
UpdateDiceDigitSprite(diceDigit2DObj);
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateDiceDigitSprite(omObjData* arg0) {
|
||||
f32 sp1C[2];
|
||||
s32 sp14[2];
|
||||
f32 spC[2] = { 320.0f, 256.0f };
|
||||
s32 var_r30;
|
||||
s32 temp_r29;
|
||||
bitcopy3* temp_r31;
|
||||
|
||||
temp_r31 = (bitcopy3*) arg0->work;
|
||||
temp_r29 = GWPlayer[temp_r31->unk_02].roll;
|
||||
if (temp_r29 != 0) {
|
||||
sp14[0] = temp_r29 % 10;
|
||||
sp14[1] = temp_r29 / 10;
|
||||
} else {
|
||||
temp_r31->field00_bit0 = 1;
|
||||
}
|
||||
|
||||
for (var_r30 = 0; var_r30 < 2; var_r30++) {
|
||||
if (((var_r30 == 1) && (sp14[1] == 0)) || (temp_r31->field00_bit1 == 0)) {
|
||||
HuSprAttrSet(temp_r31->unk_04, var_r30, 4);
|
||||
} else {
|
||||
if ((sp14[1] == 0) && (var_r30 == 0)) {
|
||||
sp1C[0] = 288.0f;
|
||||
} else {
|
||||
sp1C[0] = spC[var_r30];
|
||||
}
|
||||
sp1C[1] = 176.0f;
|
||||
HuSprAttrReset(temp_r31->unk_04, var_r30, 4);
|
||||
HuSprBankSet(temp_r31->unk_04, var_r30, sp14[var_r30]);
|
||||
HuSprPosSet(temp_r31->unk_04, var_r30, sp1C[0], sp1C[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
void BoardPlayerCopyMat(s32 arg0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue