couple more funcs for w02|main
This commit is contained in:
parent
b3396d86cf
commit
373ea7d799
1 changed files with 209 additions and 7 deletions
|
|
@ -3,26 +3,69 @@
|
||||||
#include "game/gamework_data.h"
|
#include "game/gamework_data.h"
|
||||||
#include "game/board/model.h"
|
#include "game/board/model.h"
|
||||||
#include "game/board/space.h"
|
#include "game/board/space.h"
|
||||||
|
#include "game/board/main.h"
|
||||||
|
#include "game/board/window.h"
|
||||||
|
|
||||||
/* Data */
|
// Temporary defines
|
||||||
|
#define MINI_MUSHROOM 0x0
|
||||||
|
#define MEGA_MUSHROOM 0x1
|
||||||
|
#define SUPER_MINI_MUSHROOM 0x2
|
||||||
|
#define SUPER_MEGA_MUSHROOM 0x3
|
||||||
|
#define MINI_MEGA_HAMMER 0x4
|
||||||
|
#define WARP_PIPE 0x5
|
||||||
|
#define SWAP_CARD 0x6
|
||||||
|
#define SPARKY_STICKER 0x7
|
||||||
|
#define GADDLIGHT 0x8
|
||||||
|
#define CHOMP_CALL 0x9
|
||||||
|
#define BOWSER_SUIT 0xA
|
||||||
|
#define BOOS_CRYSTAL_BALL 0xB
|
||||||
|
#define MAGIC_LAMP 0xC
|
||||||
|
#define ITEM_BAG 0xD
|
||||||
|
#define TOTAL_ITEMS 0xE
|
||||||
|
#define NO_ITEM -1
|
||||||
|
|
||||||
|
/* BSS */
|
||||||
|
s16 lbl_1_bss_8[3]; // Item List
|
||||||
s16 lbl_1_bss_30[0x10]; // Model List
|
s16 lbl_1_bss_30[0x10]; // Model List
|
||||||
|
|
||||||
|
/* DATA */
|
||||||
// Special Models
|
// Special Models
|
||||||
s16 lbl_1_data_280;
|
s16 lbl_1_data_280;
|
||||||
s16 lbl_1_data_282;
|
s16 lbl_1_data_282;
|
||||||
s16 lbl_1_data_284;
|
s16 lbl_1_data_284;
|
||||||
s16 lbl_1_data_286;
|
s16 lbl_1_data_286;
|
||||||
|
|
||||||
|
/* RODATA */
|
||||||
|
f32 lbl_1_rodata_14;
|
||||||
|
f32 lbl_1_rodata_1C;
|
||||||
|
f32 lbl_1_rodata_20;
|
||||||
|
f32 lbl_1_rodata_24;
|
||||||
|
f32 lbl_1_rodata_28;
|
||||||
|
f32 lbl_1_rodata_2C;
|
||||||
|
f32 lbl_1_rodata_30;
|
||||||
|
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
//Actual externs
|
//Actual externs
|
||||||
extern void BoardMusStart(s32, s32, s32, s32);
|
extern void BoardMusStart(s32, s32, s32, s32);
|
||||||
|
extern void BoardAudSeqPause(s32, s32, s32);
|
||||||
|
s8 BoardComPreferItemCheck(s32, s8, s8, s8);
|
||||||
|
extern void BoardComKeySetLeft();
|
||||||
|
extern void BoardComKeySetRight();
|
||||||
|
extern u32 frand();
|
||||||
|
extern u32 frandmod(u32);
|
||||||
|
|
||||||
// Local functions
|
// Local incomplete functions
|
||||||
extern void fn_1_394C(s32);
|
void fn_1_394C(s32);
|
||||||
extern void fn_1_39F4();
|
void fn_1_3BF4();
|
||||||
extern void fn_1_5CF8();
|
void fn_1_39F4();
|
||||||
extern void fn_1_93C8(s32);
|
void fn_1_5CF8();
|
||||||
extern void fn_1_E41C();
|
void fn_1_5D28();
|
||||||
|
void fn_1_5F90();
|
||||||
|
void fn_1_79BC(s16* itemList);
|
||||||
|
void fn_1_8244(s32);
|
||||||
|
void fn_1_93C8(s32 spaceFlag);
|
||||||
|
void fn_1_E41C();
|
||||||
|
|
||||||
void BoardDestroy(void) {
|
void BoardDestroy(void) {
|
||||||
/* Kill Model List */
|
/* Kill Model List */
|
||||||
|
|
@ -130,4 +173,163 @@ void fn_1_954(void) {
|
||||||
HuPrcSleep(0x3C);
|
HuPrcSleep(0x3C);
|
||||||
BoardMusStart(1, 0x12, 0x7F, 0);
|
BoardMusStart(1, 0x12, 0x7F, 0);
|
||||||
HuPrcEnd();
|
HuPrcEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fn_1_990(void) {
|
||||||
|
Vec rotation;
|
||||||
|
Vec offset;
|
||||||
|
Vec boardSpacePos;
|
||||||
|
|
||||||
|
s32 textChoice;
|
||||||
|
s32 currPlayer;
|
||||||
|
s32 currSpace;
|
||||||
|
s32 spaceLinkFlag;
|
||||||
|
|
||||||
|
|
||||||
|
currPlayer = GWSystem.player_curr;
|
||||||
|
BoardWinCreateChoice(2, 0x130011U, 4, 0);
|
||||||
|
if (GWPlayer[currPlayer].com) {
|
||||||
|
if ((s32) (frand() & 1) != 0) {
|
||||||
|
BoardComKeySetLeft();
|
||||||
|
} else {
|
||||||
|
BoardComKeySetRight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BoardWinWait();
|
||||||
|
BoardWinKill();
|
||||||
|
textChoice = BoardWinChoiceGet();
|
||||||
|
if ((textChoice == 1) || (textChoice == -1)) {
|
||||||
|
BoardWinCreate(2, 0x130012U, 4);
|
||||||
|
BoardWinWait();
|
||||||
|
BoardWinKill();
|
||||||
|
BoardMGExit();
|
||||||
|
while (BoardMGDoneFlagGet() != 1) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
BoardMGDoneFlagSet(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BoardAudSeqPause(0, 1, 0x3E8);
|
||||||
|
HuPrcChildCreate(fn_1_954, 0x2003U, 0x1000U, 0, boardMainProc);
|
||||||
|
rotation.x = lbl_1_rodata_14;
|
||||||
|
rotation.y = rotation.z = lbl_1_rodata_14;
|
||||||
|
offset.y = lbl_1_rodata_1C;
|
||||||
|
offset.x = offset.z = lbl_1_rodata_14;
|
||||||
|
BoardCameraMotionStartEx(lbl_1_bss_30[8], &rotation, &offset, lbl_1_rodata_20, lbl_1_rodata_24, 0x15);
|
||||||
|
currSpace = GWPlayer[currPlayer].space_curr;
|
||||||
|
spaceLinkFlag = BoardSpaceLinkFlagSearch(0, currSpace, 0x02000000U);
|
||||||
|
BoardSpacePosGet(0, spaceLinkFlag, &boardSpacePos);
|
||||||
|
BoardPlayerMoveBetween(currPlayer, currSpace, spaceLinkFlag);
|
||||||
|
while (GWPlayer[currPlayer].moving) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
BoardPlayerMotionStart(currPlayer, 1, 0x40000001);
|
||||||
|
fn_1_3BF4();
|
||||||
|
|
||||||
|
while (GWPlayer[currPlayer].moving) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
while (BoardEventFlagGet() != 0) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
while (GWPlayer[currPlayer].moving) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
BoardPlayerMotionStart(currPlayer, 1, 0x40000001);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fn_1_C50(void) {
|
||||||
|
Vec rotation;
|
||||||
|
Vec offset;
|
||||||
|
s32 currSpace;
|
||||||
|
s32 spaceLinkFlags;
|
||||||
|
s32 textChoice;
|
||||||
|
s32 currPlayer;
|
||||||
|
s32 i, j;
|
||||||
|
|
||||||
|
currPlayer = GWSystem.player_curr;
|
||||||
|
if (BoardPlayerItemCount((s32) currPlayer) == 3) {
|
||||||
|
BoardWinCreate(2, 0x13001A, 4);
|
||||||
|
BoardWinWait();
|
||||||
|
BoardWinKill();
|
||||||
|
HuPrcEnd();
|
||||||
|
}
|
||||||
|
BoardCameraTargetModelSet(lbl_1_bss_30[10]);
|
||||||
|
BoardCameraMotionWait();
|
||||||
|
|
||||||
|
/* Generate three random unique items where
|
||||||
|
the first item is MINI_MUSHROOM and the
|
||||||
|
other two are not BOWSER_SUIT or ITEM_BAG.
|
||||||
|
*/
|
||||||
|
lbl_1_bss_8[0] = MINI_MUSHROOM;
|
||||||
|
for (i = 1; i < 3;) {
|
||||||
|
lbl_1_bss_8[i] = frandmod(TOTAL_ITEMS);
|
||||||
|
if (lbl_1_bss_8[i] != BOWSER_SUIT && lbl_1_bss_8[i] != ITEM_BAG) {
|
||||||
|
for (j = 0; j < i; j++) {
|
||||||
|
if (lbl_1_bss_8[i] == lbl_1_bss_8[j]) {
|
||||||
|
lbl_1_bss_8[i] = NO_ITEM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (lbl_1_bss_8[i] != NO_ITEM) {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fn_1_79BC(lbl_1_bss_8);
|
||||||
|
|
||||||
|
HuAudFXPlay(0x43);
|
||||||
|
BoardWinCreateChoice(2, 0x130016, 4, 0);
|
||||||
|
if (GWPlayer[currPlayer].com) {
|
||||||
|
if (BoardComPreferItemCheck(currPlayer, lbl_1_bss_8[0], lbl_1_bss_8[1], lbl_1_bss_8[2]) != -1) {
|
||||||
|
BoardComKeySetLeft();
|
||||||
|
} else {
|
||||||
|
BoardComKeySetRight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BoardWinWait();
|
||||||
|
BoardWinKill();
|
||||||
|
textChoice = BoardWinChoiceGet();
|
||||||
|
if ((textChoice == 1) || (textChoice == -1)) {
|
||||||
|
HuAudFXPlay(0x44);
|
||||||
|
BoardWinCreate(2, 0x130017, 4);
|
||||||
|
BoardWinWait();
|
||||||
|
BoardWinKill();
|
||||||
|
BoardMGExit();
|
||||||
|
fn_1_8244(1);
|
||||||
|
while (BoardMGDoneFlagGet() != 1) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
BoardMGDoneFlagSet(0);
|
||||||
|
fn_1_5F90();
|
||||||
|
HuPrcEnd();
|
||||||
|
}
|
||||||
|
rotation.x = lbl_1_rodata_28;
|
||||||
|
rotation.y = rotation.z = lbl_1_rodata_14;
|
||||||
|
offset.x = lbl_1_rodata_14;
|
||||||
|
offset.y = lbl_1_rodata_14;
|
||||||
|
offset.z = lbl_1_rodata_2C;
|
||||||
|
BoardCameraMotionStartEx(lbl_1_bss_30[10], (Point3d* ) &rotation, (Point3d* ) &offset, lbl_1_rodata_30, lbl_1_rodata_24, 0x15);
|
||||||
|
currSpace = GWPlayer[currPlayer].space_curr;
|
||||||
|
spaceLinkFlags = BoardSpaceLinkFlagSearch(0, currSpace, 0x02000000U);
|
||||||
|
BoardPlayerMoveBetween(currPlayer, currSpace, spaceLinkFlags);
|
||||||
|
while (GWPlayer[currPlayer].moving) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
BoardPlayerMotionStart((s32) currPlayer, 1, 0x40000001);
|
||||||
|
BoardPlayerMotBlendSet(currPlayer, 0xB4, 0xF);
|
||||||
|
while (BoardPlayerMotBlendCheck(currPlayer) == 0) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
BoardCameraMotionWait();
|
||||||
|
fn_1_5D28();
|
||||||
|
while (BoardEventFlagGet() != 0) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
fn_1_8244(0);
|
||||||
|
while (GWPlayer[currPlayer].moving) {
|
||||||
|
HuPrcVSleep();
|
||||||
|
}
|
||||||
|
fn_1_5F90();
|
||||||
|
BoardPlayerMotionStart((s32) currPlayer, 1, 0x40000001);
|
||||||
|
HuPrcEnd();
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue