Add support for PAL version (#464)

* Initial setup for PAL version

* Add hashes to config.yml
Set REL/empty.c to matching for every version
Turn off quick-analysis for PAL

* Set nisDll matching only for the US version

* More config.yml fixes and reran auto-analysis

* Split PAL to sprput

* Add more symbols

* Split a lot more code in PAL

* Split more

Also introduce version.h header

* Split to board stuff

* Port early board TUs to PAL

* More board PAL ports

* Split rest of board code

* Board RELs porting to PAL

* Match w06Dll/fire.c in PAL

* Match w04 big boo for PAL

---------

Co-authored-by: dbalatoni13 <stubiflex.junior@gmail.com>
This commit is contained in:
Liam Coleman 2024-11-16 12:35:24 -06:00 committed by GitHub
parent 80015a6e5e
commit d0a5c85d3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
236 changed files with 40998 additions and 390 deletions

View file

@ -913,9 +913,13 @@ static void fn_1_8A60(void) {
HuPrcVSleep();
}
fn_1_7300();
#if VERSION_NTSC
sprintf(sp10, "%d", var_r29);
BoardWinCreate(2, MAKE_MESSID(32, 11), 9);
BoardWinInsertMesSet(MAKE_MESSID_PTR(sp10), 0);
#else
BoardWinCreate(2, MAKE_MESSID(32, 11), 9);
#endif
BoardWinWait();
BoardWinKill();
BoardAudSeqFadeOut(1, 1000);

View file

@ -49,6 +49,24 @@ static s16 lbl_1_data_22A = -1;
static s16 lbl_1_data_22C = -1;
static s16 lbl_1_data_22E = -1;
#if VERSION_PAL
static s32 lbl_1_data_230[] = {
MAKE_MESSID(8, 0),
MAKE_MESSID(8, 1),
MAKE_MESSID(8, 2),
MAKE_MESSID(8, 3),
MAKE_MESSID(8, 4),
MAKE_MESSID(8, 5),
MAKE_MESSID(8, 6),
MAKE_MESSID(8, 7),
MAKE_MESSID(8, 8),
MAKE_MESSID(8, 9),
MAKE_MESSID(8, 10),
MAKE_MESSID(8, 11),
MAKE_MESSID(8, 12),
MAKE_MESSID(8, 13)
};
#else
static s32 lbl_1_data_230[] = {
MAKE_MESSID(8, 14),
MAKE_MESSID(8, 15),
@ -65,7 +83,7 @@ static s32 lbl_1_data_230[] = {
MAKE_MESSID(8, 26),
MAKE_MESSID(8, 27)
};
#endif
void fn_1_6EF0(void) {
BoardRollDispSet(0);
lbl_1_bss_90 = HuPrcChildCreate(fn_1_6F80, 0x2003, 0x3800, 0, boardMainProc);
@ -203,9 +221,12 @@ static void fn_1_74BC(s32 arg0) {
static void fn_1_7574(void) {
s32 temp_r3;
s32 temp_r29;
#if VERSION_PAL
s32 playerNo = GWSystem.player_curr;
#endif
s32 temp_r28;
s32 i;
for (i = 0; i < 4; i++) {
if (lbl_1_bss_C2[i] == 0) {
continue;
@ -218,11 +239,17 @@ static void fn_1_7574(void) {
BoardWinCreate(0, MAKE_MESSID(48, 16), -1);
BoardWinInsertMesSet(temp_r28, 0);
BoardWinInsertMesSet(lbl_1_data_230[temp_r29], 1);
#if VERSION_PAL
GWSystem.player_curr = i;
#endif
BoardWinPlayerSet(i);
BoardWinWait();
BoardWinKill();
}
}
#if VERSION_PAL
GWSystem.player_curr = playerNo;
#endif
}
static void fn_1_7674(s32 arg0) {

View file

@ -9,7 +9,7 @@ static int HuSePlay(int seId, MSM_SEPARAM *param);
extern s16 omSysExitReq;
static s32 charVoiceGroupStat[8];
s32 charVoiceGroupStat[8];
static s32 sndFXBuf[64][2];
static s16 Hu3DAudVol;

View file

@ -1335,7 +1335,7 @@ static void TakeBallCoinPosSet(BallTakeCoinData *arg0, Vec *arg1) {
BoardModelPosSetV(arg0->unk00, &arg0->unk04);
}
BOOL CheckBallCoinDone(void) {
static BOOL CheckBallCoinDone(void) {
BallTakeCoinData *var_r31;
s32 i;
@ -1351,7 +1351,7 @@ BOOL CheckBallCoinDone(void) {
return TRUE;
}
void TakeBallStar(void) {
static void TakeBallStar(void) {
BallTakeCoinWork *temp_r31;
Vec sp8;
@ -1376,7 +1376,7 @@ void TakeBallStar(void) {
HuAudFXPlay(0x361);
}
void ExecTakeBallStar(omObjData *arg0) {
static void ExecTakeBallStar(omObjData *arg0) {
BallTakeCoinWork *temp_r29 = OM_GET_WORK_PTR(arg0, BallTakeCoinWork);
Vec sp8;
float var_f30;
@ -1405,7 +1405,7 @@ void ExecTakeBallStar(omObjData *arg0) {
BoardModelRotYSet(temp_r29->unk02, arg0->rot.y);
}
BOOL CheckTakeBallStarDone(void) {
static BOOL CheckTakeBallStarDone(void) {
if (ballTakeCoinObj) {
return FALSE;
} else {

View file

@ -132,6 +132,12 @@ static void ExecCharWheel(omObjData *arg0) {
temp_r31 = OM_GET_WORK_PTR(arg0, CharWheelWork);;
if (temp_r31->unk00_field0 != 0 || BoardIsKill()) {
KillCharWheelSpr();
#if VERSION_PAL
if (wheelFXStat != -1) {
HuAudFXStop(wheelFXStat);
wheelFXStat = -1;
}
#endif
charWheelObj = NULL;
omDelObjEx(HuPrcCurrentGet(), arg0);
return;
@ -322,7 +328,13 @@ static void UpdateCharWheel(CharWheelWork *arg0) {
}
var_f23 = 8191.0f - 8191.0f * (var_f25 / wheelSpeed);
OSf32tos16(&var_f23, &var_r17);
#if VERSION_PAL
if(wheelFXStat != -1) {
HuAudFXPitchSet(wheelFXStat, -var_r17);
}
#else
HuAudFXPitchSet(wheelFXStat, -var_r17);
#endif
if (var_f25 > -0.0000001f && var_f25 < 0.0000001f) {
arg0->unk00_field3 = 3;
if (wheelFXStat != -1) {
@ -379,7 +391,14 @@ static void GrowCharWheel(CharWheelWork *arg0) {
}
arg0->unk02 = 90;
arg0->unk00_field3 = 2;
#if VERSION_PAL
if(!BoardIsKill()) {
wheelFXStat = HuAudFXPlay(0x30A);
}
#else
wheelFXStat = HuAudFXPlay(0x30A);
#endif
}
OSs8tof32(&arg0->unk02, &temp_f30);
HuSprGrpScaleSet(wheelSprGrp, sind(temp_f30), sind(temp_f30));

View file

@ -112,7 +112,7 @@ static AnimData *genieParticleAnim;
static s16 geniePlayerMot[3];
static Process *itemProc;
s32 lbl_801D37A0[2] = { DATA_MAKE_NUM(DATADIR_BOARD, 117), -1 };
static s32 itemMotTbl[2] = { DATA_MAKE_NUM(DATADIR_BOARD, 117), -1 };
static void (*itemFuncTbl[])(void) = { ExecItemMini, ExecItemMega, ExecItemMiniSuper, ExecItemMegaSuper, ExecItemHammer, ExecItemPipe, ExecItemSwap,
ExecItemSpark, ExecItemLight, ExecItemWhistle, ExecItemBowser, ExecItemBooBall, ExecItemGenie, ExecItemBag };
@ -1183,7 +1183,7 @@ static void ExecItemSpark(void)
BoardModelLayerSet(temp_r30, 3);
BoardModelVisibilitySet(temp_r30, 0);
HuAudFXPlay(0x350);
suitMdl = BoardModelCreate(itemMdlTbl[currItem], lbl_801D37A0, 0);
suitMdl = BoardModelCreate(itemMdlTbl[currItem], itemMotTbl, 0);
BoardModelLayerSet(suitMdl, 2);
ItemShowProc(NULL, NULL);
temp_r28 = GWPlayer[currItemRestore].space_curr;

View file

@ -403,8 +403,11 @@ static void MainFunc(void)
if(_CheckFlag(FLAG_ID_MAKE(1, 11))) {
BoardTutorialWorkSave();
BoardTutorialPlayerInit();
GWSystem.mess_speed = 1;
GWSystem.mess_delay = 32;
#if VERSION_PAL
GWMessSpeedSet(3);
#else
GWMessSpeedSet(1);
#endif
}
CreateBoard();
if(!_CheckFlag(FLAG_ID_MAKE(1, 1))) {

View file

@ -139,6 +139,71 @@ s32 BoardRollExec(s32 arg0)
return destMode;
}
static void RollWinCreate(s32 playerNo)
{
float sp8[2];
float posX;
float posY;
s32 var_r29;
s32 var_r27;
s32 temp_r25;
if (!_CheckFlag(FLAG_ID_MAKE(1, 11))) {
var_r27 = BoardPlayerItemCount(playerNo);
if (GWTeamGet()) {
temp_r25 = BoardPlayerSameTeamFind(playerNo);
var_r27 += BoardPlayerItemCount(temp_r25);
}
if (BoardItemPrevGet() != -1 || var_r27 == 0 || _CheckFlag(FLAG_ID_MAKE(1, 9)) || BoardMegaDoubleDiceCheck()) {
var_r29 = MAKE_MESSID(0x09, 0x04);
}
else {
var_r29 = MAKE_MESSID(0x09, 0x02);
}
if (inputTimer != 0) {
var_r29 = MAKE_MESSID(0x30, 0x25);
}
HuWinMesMaxSizeGet(1, sp8, var_r29);
#if VERSION_PAL
posY = HU_DISP_HEIGHT - 176;
switch (GWGameStat.language) {
case 0:
case 4:
posX = -10000.0f;
break;
case 3:
posX = HU_DISP_CENTERX - (sp8[0] / 2 - 32.0f);
break;
case 5:
posX = HU_DISP_CENTERX - (sp8[0] / 2 - 16.0f);
posY = 258;
break;
default:
posX = HU_DISP_CENTERX - (sp8[0] / 2 - 16.0f);
break;
}
#else
switch (GWGameStat.language) {
case 0:
posX = -10000.0f;
break;
case 1:
posX = HU_DISP_CENTERX - (sp8[0] / 2 - 16.0f);
break;
}
posY = HU_DISP_HEIGHT - 176;
#endif
rollWin = HuWinCreate(posX, posY, sp8[0], sp8[1], 0);
HuWinBGTPLvlSet(rollWin, 0.0f);
HuWinMesSpeedSet(rollWin, 0);
HuWinMesSet(rollWin, var_r29);
}
}
void BoardRollKill(void)
{
if (rollProc) {
@ -177,15 +242,11 @@ void BoardRollWinDispSet(s32 arg0)
static void RollMain(void)
{
float sp8[2];
float var_f31;
float var_f30;
s32 var_r28;
s32 var_r27;
s32 temp_r26;
s32 temp_r25;
s32 var_r30;
s32 var_r29;
s32 i;
diceValue[0] = diceValue[1] = diceValue[2] = 0;
@ -195,37 +256,7 @@ static void RollMain(void)
BoardCameraMotionWait();
BoardCameraTargetModelSet(-1);
for (i = 0; i < numDice; i++) {
temp_r26 = rollPlayer;
if (!_CheckFlag(FLAG_ID_MAKE(1, 11))) {
var_r27 = BoardPlayerItemCount(temp_r26);
if (GWTeamGet()) {
temp_r25 = BoardPlayerSameTeamFind(temp_r26);
var_r27 += BoardPlayerItemCount(temp_r25);
}
if (BoardItemPrevGet() != -1 || var_r27 == 0 || _CheckFlag(FLAG_ID_MAKE(1, 9)) || BoardMegaDoubleDiceCheck()) {
var_r29 = MAKE_MESSID(0x09, 0x04);
}
else {
var_r29 = MAKE_MESSID(0x09, 0x02);
}
if (inputTimer != 0) {
var_r29 = MAKE_MESSID(0x30, 0x25);
}
HuWinMesMaxSizeGet(1, sp8, var_r29);
switch (GWGameStat.language) {
case 0:
var_f31 = -10000.0f;
break;
case 1:
var_f31 = HU_DISP_CENTERX - (sp8[0] / 2 - 16.0f);
break;
}
var_f30 = HU_DISP_HEIGHT - 176;
rollWin = HuWinCreate(var_f31, var_f30, sp8[0], sp8[1], 0);
HuWinBGTPLvlSet(rollWin, 0.0f);
HuWinMesSpeedSet(rollWin, 0);
HuWinMesSet(rollWin, var_r29);
}
RollWinCreate(rollPlayer);
DiceCreate(i);
DiceWaitFull(i);
DoInput(i);

View file

@ -984,7 +984,12 @@ static void CreateShopItemChoice(s32 arg0, s32 arg1) {
omObjData *temp_r30;
ItemChoiceWork *var_r31;
s16 spC;
s16 i;
#if VERSION_PAL
for(i=0; i<6; i++) {
cursorPosTbl[i][0] = 190;
}
#endif
temp_r30 = omAddObjEx(boardObjMan, 0x7E01, 0, 0, -1, UpdateShopItemChoice);
itemChoiceObj = temp_r30;
itemChoice = -1;
@ -996,11 +1001,29 @@ static void CreateShopItemChoice(s32 arg0, s32 arg1) {
var_r31->unk02 = 0;
var_r31->unk03 = arg1;
var_r31->unk06 = HuSprGrpCreate(1);
#if VERSION_PAL
if (GWLanguageGet() != 0) {
s16 winId = BoardWinIDGet();
if(winId != -1) {
WindowData *winP = &winData[winId];
for(i=0; i<6; i++) {
cursorPosTbl[i][0] = winP->pos_x+96;
}
} else {
for(i=0; i<6; i++) {
cursorPosTbl[i][0] = 166;
}
}
}
temp_r30->trans.x = cursorPosTbl[0][0];
temp_r30->trans.y = cursorPosTbl[0][1];
#else
temp_r30->trans.x = cursorPosTbl[0][0];
temp_r30->trans.y = cursorPosTbl[0][1];
if (GWLanguageGet() != 0) {
temp_r30->trans.x -= 24.0f;
}
#endif
if (GWPlayer[arg0].com) {
var_r31->unk01 = GWMessDelayGet();
}
@ -1032,9 +1055,11 @@ static void MoveShopItemChoice(omObjData *arg0, ItemChoiceWork *arg1) {
temp_r28 = arg1->unk02;
arg0->trans.x = cursorPosTbl[arg1->unk02][0];
arg0->trans.y = cursorPosTbl[arg1->unk02][1];
#if VERSION_NTSC
if (GWLanguageGet() != 0) {
arg0->trans.x -= 24.0f;
}
#endif
if (GWPlayer[arg1->unk00_field1].com) {
GetShopItemChoiceInput(arg1, arg0, &sp8);
} else {

View file

@ -74,7 +74,7 @@ static Process *starProc;
static s16 starParman = -1;
static s16 hostMdl = -1;
const s32 lbl_8011E040[9] = {
static const s32 starMesTbl1[9] = {
MAKE_MESSID(12, 0),
MAKE_MESSID(12, 9),
MAKE_MESSID(12, 18),
@ -86,7 +86,7 @@ const s32 lbl_8011E040[9] = {
MAKE_MESSID(12, 0)
};
const s32 lbl_8011E064[9][2] = {
static const s32 starMesTbl2[9][2] = {
{ MAKE_MESSID(21, 34), MAKE_MESSID(21, 40) },
{ MAKE_MESSID(21, 35), MAKE_MESSID(21, 41) },
{ MAKE_MESSID(21, 36), MAKE_MESSID(21, 42) },
@ -249,12 +249,12 @@ static void ExecStar(void) {
BoardCameraViewSet(3);
BoardCameraMotionWait();
if (GWStarsGet(temp_r31) >= 999) {
temp_r29 = lbl_8011E040[temp_r27] + 5;
temp_r29 = starMesTbl1[temp_r27] + 5;
BoardWinCreate(0, temp_r29, BoardWinPortraitGetStar());
BoardWinWait();
BoardWinKill();
} else if (BoardPlayerCoinsGet(temp_r31) < 20 && GWSystem.last5_effect != 4) {
temp_r29 = lbl_8011E040[temp_r27] + 2;
temp_r29 = starMesTbl1[temp_r27] + 2;
BoardWinCreate(2, temp_r29, BoardWinPortraitGetStar());
BoardWinWait();
BoardWinKill();
@ -263,7 +263,7 @@ static void ExecStar(void) {
while (!BoardStatusStopCheck(0) || !BoardStatusStopCheck(1) || !BoardStatusStopCheck(2) || !BoardStatusStopCheck(3)) {
HuPrcVSleep();
}
temp_r29 = lbl_8011E040[temp_r27];
temp_r29 = starMesTbl1[temp_r27];
BoardWinCreate(2, temp_r29, BoardWinPortraitGetStar());
BoardWinInsertMesSet(BoardPlayerGetCharMess(temp_r31), 0);
BoardWinWait();
@ -275,12 +275,12 @@ static void ExecStar(void) {
HuPrcVSleep();
}
if (GWSystem.last5_effect == 4) {
temp_r29 = lbl_8011E040[temp_r27] + 8;
temp_r29 = starMesTbl1[temp_r27] + 8;
BoardWinCreate(2, temp_r29, BoardWinPortraitGetStar());
BoardWinWait();
break;
}
temp_r29 = lbl_8011E040[temp_r27] + 1;
temp_r29 = starMesTbl1[temp_r27] + 1;
BoardWinCreateChoice(1, temp_r29, BoardWinPortraitGetStar(), 0);
BoardWinAttrSet(0x10);
if (GWPlayer[temp_r31].com) {
@ -294,7 +294,7 @@ static void ExecStar(void) {
switch (BoardWinChoiceGet()) {
case 0:
if (BoardPlayerCoinsGet(temp_r31) < 20) {
temp_r29 = lbl_8011E040[temp_r27] + 2;
temp_r29 = starMesTbl1[temp_r27] + 2;
BoardWinCreate(2, temp_r29, BoardWinPortraitGetStar());
BoardWinWait();
BoardStatusShowSet(temp_r31, 0);
@ -306,7 +306,7 @@ static void ExecStar(void) {
}
goto block_A;
case 1:
temp_r29 = lbl_8011E040[temp_r27] + 4;
temp_r29 = starMesTbl1[temp_r27] + 4;
BoardWinCreate(2, temp_r29, BoardWinPortraitGetStar());
BoardWinWait();
BoardStatusShowSet(temp_r31, 0);
@ -326,7 +326,7 @@ static void ExecStar(void) {
}
}
block_A:
temp_r29 = lbl_8011E040[temp_r27] + 3;
temp_r29 = starMesTbl1[temp_r27] + 3;
BoardWinCreate(2, temp_r29, BoardWinPortraitGetStar());
BoardWinWait();
BoardWinKill();
@ -734,9 +734,9 @@ void BoardStarShowNext(s32 arg0) {
HuPrcVSleep();
}
if (var_r28 == 0) {
var_r30 = lbl_8011E040[GWBoardGet()] + 6;
var_r30 = starMesTbl1[GWBoardGet()] + 6;
} else {
var_r30 = lbl_8011E064[GWBoardGet()][0];
var_r30 = starMesTbl2[GWBoardGet()][0];
}
BoardWinCreate(3, var_r30, -1);
BoardWinPause();
@ -748,9 +748,9 @@ void BoardStarShowNext(s32 arg0) {
BoardWinKill();
HuPrcSleep(3);
if (var_r28 == 0) {
var_r30 = lbl_8011E040[GWBoardGet()] + 7;
var_r30 = starMesTbl1[GWBoardGet()] + 7;
} else {
var_r30 = lbl_8011E064[GWBoardGet()][1];
var_r30 = starMesTbl2[GWBoardGet()][1];
}
BoardWinCreate(3, var_r30, -1);
BoardWinWait();

View file

@ -1951,28 +1951,32 @@ static void UpdateItemWindow(omObjData *arg0) {
static void CreatePickerWindow(UnkUiWork01 *arg0, s32 arg1) {
float spC[2];
float var_f31;
float var_f30;
float var_f29;
float posX;
float posY;
float yOfs;
s32 var_r30;
#if VERSION_NTSC
switch (GWGameStat.language) {
case 1:
var_f31 = 0.0f;
yOfs = 0.0f;
break;
case 0:
var_f31 = 0.0f;
yOfs = 0.0f;
break;
}
#else
yOfs = 0;
#endif
if (arg1 != 0) {
var_r30 = MAKE_MESSID(0x10, 0x1A);
} else {
var_r30 = MAKE_MESSID(0x10, 0x1B);
}
HuWinMesMaxSizeGet(1, spC, var_r30);
var_f30 = -10000.0f;
var_f29 = var_f31 + (HU_DISP_HEIGHT-128);
arg0->unk06 = HuWinCreate(var_f30, var_f29, spC[0], spC[1], 0);
posX = -10000.0f;
posY = yOfs + (HU_DISP_HEIGHT-128);
arg0->unk06 = HuWinCreate(posX, posY, spC[0], spC[1], 0);
HuWinBGTPLvlSet(arg0->unk06, 0.0f);
HuWinMesSpeedSet(arg0->unk06, 0);
HuWinMesSet(arg0->unk06, var_r30);

View file

@ -396,20 +396,32 @@ static void DestroyFocus(void) {
static void CreateButtonWin(void) {
float sp8[2];
float var_f31;
float var_f30;
float posX;
float posY;
s32 var_r31;
if (viewControls != 2) {
var_r31 = MAKE_MESSID(0x09, 0x05);
var_f31 = 286.0f;
#if VERSION_PAL
HuWinMesMaxSizeGet(1, sp8, var_r31);
posX = 288-((sp8[0]/2)-32);
#endif
posY = 286.0f;
} else {
var_r31 = MAKE_MESSID(0x10, 0x4D);
var_f31 = 328.0f;
#if VERSION_PAL
posX = -10000.0f;
posY = 324.0f;
#else
posY = 328.0f;
#endif
}
HuWinMesMaxSizeGet(1, sp8, var_r31);
var_f30 = -10000.0f;
buttonWin = HuWinCreate(var_f30, var_f31, sp8[0], sp8[1], 0);
#if VERSION_NTSC
posX = -10000.0f;
#endif
buttonWin = HuWinCreate(posX, posY, sp8[0], sp8[1], 0);
HuWinBGTPLvlSet(buttonWin, 0.0f);
HuWinMesSpeedSet(buttonWin, 0);
HuWinMesSet(buttonWin, var_r31);

View file

@ -97,6 +97,11 @@ static void ExecBoardWindow(void) {
if (size[0] <= size_win[0]) {
size[0] = size_win[0];
pos[0] = pos_win[0];
#if VERSION_PAL
if(winPosIdx == 1) {
size[0] += 4;
}
#endif
} else {
pos[0] = -10000.0f;
}
@ -338,7 +343,7 @@ s32 BoardWinPortraitGetStar(void) {
void BoardWinPlayerSet(s32 player) {
s32 i;
#if VERSION_NTSC
if (player == -1) {
if (GWPartyGet() != 1) {
for (i = 0, disablePlayer = i; i < 4; i++) {
@ -354,6 +359,21 @@ void BoardWinPlayerSet(s32 player) {
} else {
disablePlayer = ~(1 << GWPlayer[player].port);
}
#else
if (player == -1) {
if (GWPartyGet() != 1) {
for (i = 0, disablePlayer = i; i < 4; i++) {
if (GWPlayer[i].com != 0) {
disablePlayer |= 1 << GWPlayer[i].port;
}
}
} else {
disablePlayer = 0;
}
} else {
disablePlayer = ~(1 << GWPlayer[player].port);
}
#endif
if (_CheckFlag(FLAG_ID_MAKE(1, 11)) != 0) {
disablePlayer = 0;
}
@ -405,4 +425,9 @@ void BoardWinStartComKeySet(void) {
void BoardWinComKeyFuncSet(BoardWinComKeyFunc func) {
comKeyFunc = func;
}
s16 BoardWinIDGet(void)
{
return windowID;
}

View file

@ -6,7 +6,7 @@
#define PTR_OFFSET(ptr, offset) (void *)(((u8 *)(ptr)+(u32)(offset)))
#define DATA_EFF_SIZE(size) (((size)+1) & ~0x1)
static void **HuDataReadMultiSub(s32 *data_ids, BOOL use_num, s32 num);
void **HuDataReadMultiSub(s32 *data_ids, BOOL use_num, s32 num);
#define DATA_MAX_READSTAT 128
@ -406,7 +406,7 @@ void **HuDataReadMulti(s32 *data_ids)
return HuDataReadMultiSub(data_ids, FALSE, 0);
}
static void **HuDataReadMultiSub(s32 *data_ids, BOOL use_num, s32 num)
void **HuDataReadMultiSub(s32 *data_ids, BOOL use_num, s32 num)
{
s32 *dir_ids;
char **paths;

View file

@ -8,7 +8,7 @@ struct decode_data
u32 size;
};
static u8 TextBuffer[1024];
static u8 textBuffer[1024];
static void HuDecodeNone(struct decode_data *decode)
{
@ -27,7 +27,7 @@ static void HuDecodeLz(struct decode_data *decode)
for(i=0; i<1024; i++) {
TextBuffer[i] = 0;
textBuffer[i] = 0;
}
while(decode->size) {
flag >>= 1;
@ -35,7 +35,7 @@ static void HuDecodeLz(struct decode_data *decode)
flag = (*decode->src++)|0xFF00;
}
if(flag & 0x1) {
TextBuffer[pos++] = *decode->dst++ = *decode->src++;
textBuffer[pos++] = *decode->dst++ = *decode->src++;
pos = pos & 0x3FF;
decode->size--;
} else {
@ -44,7 +44,7 @@ static void HuDecodeLz(struct decode_data *decode)
i |= ((copy_len & ~0x3F) << 2);
copy_len = (copy_len & 0x3F)+3;
for(j=0; j<copy_len; j++) {
TextBuffer[pos++] = *decode->dst++ = TextBuffer[(i+j) & 0x3FF];
textBuffer[pos++] = *decode->dst++ = textBuffer[(i+j) & 0x3FF];
pos &= 0x3FF;
}
decode->size -= j;

View file

@ -24,7 +24,7 @@ typedef struct {
/* 0x3C */ HsfanimStruct00 *unk3C;
} ParManProcUserData; // Size 0x40
static void _Hu3DParticleAttrReset(ModelData *arg0, Mtx arg1);
static void particleFunc(ModelData *arg0, Mtx arg1);
static void ParManFunc(void);
static void ParManHook(ModelData *arg0, ParticleData *arg1, Mtx matrix);
@ -493,7 +493,7 @@ s16 Hu3DParticleCreate(AnimData *arg0, s16 arg1) {
s16 i;
void *temp_r24;
temp_r25 = Hu3DHookFuncCreate((void*) &_Hu3DParticleAttrReset);
temp_r25 = Hu3DHookFuncCreate((void*) &particleFunc);
temp_r28 = &Hu3DData[temp_r25];
Hu3DModelAttrSet(temp_r25, HU3D_ATTR_PARTICLE_KILL);
temp_r31 = HuMemDirectMallocNum(HEAP_DATA, sizeof(ParticleData), temp_r28->unk_48);
@ -658,7 +658,7 @@ static float baseST[] = {
1.0f, 1.0f, 0.0f, 1.0f
};
static void _Hu3DParticleAttrReset(ModelData *arg0, Mtx arg1) {
static void particleFunc(ModelData *arg0, Mtx arg1) {
Vec *var_r30;
float temp_f31;
float temp_f29;

View file

@ -4,6 +4,9 @@
#include "game/pad.h"
#include "game/audio.h"
#include "game/thpmain.h"
#include "game/gamework_data.h"
#include "version.h"
#define SR_DVD_LOADING 0
#define SR_DVD_COVER_OPEN 1
@ -19,6 +22,8 @@ extern s32 HuDvdErrWait;
static s32 SR_PreRstChk[4] = {};
#if VERSION_NTSC
#include "coveropen_en.inc"
#include "fatalerror_en.inc"
#include "loading_en.inc"
@ -26,6 +31,45 @@ static s32 SR_PreRstChk[4] = {};
#include "retryerror_en.inc"
#include "wrongdisc_en.inc"
#else
#include "coveropen_en.inc"
#include "fatalerror_en.inc"
#include "loading_en.inc"
#include "nodisc_en.inc"
#include "retryerror_en.inc"
#include "wrongdisc_en.inc"
#include "coveropen_fr.inc"
#include "fatalerror_fr.inc"
#include "loading_fr.inc"
#include "nodisc_fr.inc"
#include "retryerror_fr.inc"
#include "wrongdisc_fr.inc"
#include "coveropen_ge.inc"
#include "fatalerror_ge.inc"
#include "loading_ge.inc"
#include "nodisc_ge.inc"
#include "retryerror_ge.inc"
#include "wrongdisc_ge.inc"
#include "coveropen_it.inc"
#include "fatalerror_it.inc"
#include "loading_it.inc"
#include "nodisc_it.inc"
#include "retryerror_it.inc"
#include "wrongdisc_it.inc"
#include "coveropen_sp.inc"
#include "fatalerror_sp.inc"
#include "loading_sp.inc"
#include "nodisc_sp.inc"
#include "retryerror_sp.inc"
#include "wrongdisc_sp.inc"
#endif
static s16 SR_PushTime[4] = {};
static s8 SR_ResetPad = -1;
@ -103,9 +147,17 @@ void HuDvdErrDispInit(GXRenderModeObj *rmode, void *xfb1, void *xfb2)
XfbW = (u16)(((u16)rmode->fbWidth+15) & ~0xF);
XfbH = rmode->xfbHeight;
} else {
#if VERSION_NTSC
XfbW = 640;
XfbH = 480;
#else
XfbW = 640;
XfbH = 528;
#endif
}
#if VERSION_PAL
(void)(VIGetTvFormat() == VI_PAL);
#endif
if((u16)rmode->xFBmode == VI_XFBMODE_SF) {
XfbProg = 0;
} else {
@ -223,20 +275,39 @@ static void ToeDispCheck(void)
_HuDvdErrDispXFB(status);
}
#if VERSION_NTSC
#define XFB_SIZE 0x96000
#else
#define XFB_SIZE (XfbW*XfbH*2)
#endif
static void _HuDvdErrDispXFB(s32 error)
{
#if VERSION_NTSC
static void *bmpMes[][6] = {
loading_en, coveropen_en, nodisc_en, wrongdisc_en, retryerror_en, fatalerror_en
};
volatile s32 status;
u8 color[2];
s8 language;
#else
static void *bmpMes[][6] = {
loading_en, coveropen_en, nodisc_en, wrongdisc_en, retryerror_en, fatalerror_en,
loading_fr, coveropen_fr, nodisc_fr, wrongdisc_fr, retryerror_fr, fatalerror_fr,
loading_ge, coveropen_ge, nodisc_ge, wrongdisc_ge, retryerror_ge, fatalerror_ge,
loading_it, coveropen_it, nodisc_it, wrongdisc_it, retryerror_it, fatalerror_it,
loading_sp, coveropen_sp, nodisc_sp, wrongdisc_sp, retryerror_sp, fatalerror_sp
};
#endif
s16 *bmpData;
u8 *xfb1_ptr;
u8 *xfb2_ptr;
u32 i;
u32 data;
u32 row;
s8 language;
u32 *xfb1;
u32 *xfb2;
u32 j;
@ -246,25 +317,59 @@ static void _HuDvdErrDispXFB(s32 error)
u32 *data_ptr;
u32 row_offset;
u32 row_pitch;
void *tempfb1;
void *tempfb2;
s32 status;
u8 color[2];
#if VERSION_PAL
switch(GWGameStat.language) {
case 2:
language = 2;
break;
case 3:
language = 1;
break;
case 4:
language = 3;
break;
case 5:
language = 4;
break;
default:
language = 0;
break;
}
#else
language = 0;
#endif
xfb1 = Xfb[0];
xfb2 = Xfb[1];
for(i=0; i<0x25800; i++, xfb1++, xfb2++) {
for(i=0; i<XFB_SIZE/4; i++, xfb1++, xfb2++) {
#if VERSION_NTSC
*xfb1 = *xfb2 = 0x800080;
#else
*xfb1 = *xfb2 = 0x10801080;
#endif
}
DCStoreRangeNoSync(Xfb[0], 0x96000);
DCStoreRangeNoSync(Xfb[1], 0x96000);
DCStoreRangeNoSync(Xfb[0], XFB_SIZE);
DCStoreRangeNoSync(Xfb[1], XFB_SIZE);
bmpData = bmpMes[language][error];
data_ptr = (u32 *)(bmpData+2);
row_offset = ((XfbW/2)-(bmpData[0]/2))*2;
row_pitch = XfbW*2;
color[1] = color[0] = 128;
for(row=0; row<bmpData[1]; row++) {
void *sp14[2];
xfb1_ptr = ((u8 *)(Xfb[0])+((row+200)*row_pitch)+row_offset);
sp14[1] = xfb1_ptr;
tempfb1 = xfb1_ptr;
xfb2_ptr = ((u8 *)(Xfb[1])+((row+200)*row_pitch)+row_offset);
sp14[0] = xfb2_ptr;
tempfb2 = xfb2_ptr;
for(i=0; i<bmpData[0]; i += 32) {
data = *data_ptr++;
for(j=0; j<32; j += 2, data >>= 2, xfb1_ptr += 4, xfb2_ptr += 4) {
@ -290,8 +395,8 @@ static void _HuDvdErrDispXFB(s32 error)
}
}
}
DCStoreRangeNoSync(sp14[1], bmpData[0]*2);
DCStoreRangeNoSync(sp14[0], bmpData[0]*2);
DCStoreRangeNoSync(tempfb1, bmpData[0]*2);
DCStoreRangeNoSync(tempfb2, bmpData[0]*2);
}
status = DVDGetDriveStatus();
while(status) {

View file

@ -3,6 +3,7 @@
#include "game/memory.h"
#include "game/flag.h"
#include "game/board/tutorial.h"
#include "version.h"
s16 HuSysVWaitGet(s16 old);
@ -141,6 +142,11 @@ void WipeCreate(s16 mode, s16 type, s16 duration)
void WipeColorSet(u8 r, u8 g, u8 b)
{
#if VERSION_PAL
if(r > 160 && g > 160 && b > 160) {
r = g = b = 160;
}
#endif
wipeData.color.r = r;
wipeData.color.g = g;
wipeData.color.b = b;