Gamework struct labeling (#563)

* Label most of w01Dll

* Add symbols for instdll and resultdll in us

* Fix pal symbols for instDll

* Build resultdll+symbols for pal

* Gamework struct labeling
This commit is contained in:
Liam Coleman 2025-02-06 15:45:43 -06:00 committed by GitHub
parent 560a592518
commit 64f087c2c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 46 additions and 56 deletions

View File

@ -40,8 +40,8 @@ typedef struct system_state {
};
/* 0x09 */ s8 last5_effect;
/* 0x0A */ s8 player_curr;
/* 0x0B */ u8 unk0B;
/* 0x0C */ s8 unk0C;
/* 0x0B */ u8 storyCharBit;
/* 0x0C */ s8 storyChar;
/* 0x0E */ s16 block_pos;
/* 0x10 */ u8 ATTRIBUTE_ALIGN(4) board_data[32];
/* 0x30 */ u8 mess_delay;
@ -137,9 +137,9 @@ typedef struct game_stat {
u8 story_continue : 1;
u8 party_continue : 1;
u8 open_w06 : 1;
u8 field10E_bit4 : 1;
u8 field10E_bit5 : 1;
u8 field10E_bit6 : 1;
u8 veryHardUnlock : 1;
u8 customPackEnable : 1;
u8 musicAllF : 1;
};
/* 0x10F */ PauseBackupConfig story_pause;
/* 0x110 */ PauseBackupConfig party_pause;
@ -300,11 +300,6 @@ static inline s32 GWSaveModeGet(void)
return GWSystem.save_mode;
}
static inline s32 GWTurnGet(void)
{
return GWSystem.turn;
}
static inline s32 GWBoardGet(void)
{
return GWSystem.board;
@ -315,9 +310,14 @@ static inline s32 GWPlayerCurrGet(void)
return GWSystem.player_curr;
}
static inline s32 GWUnkB1Get(void)
static inline s32 GWStoryCharGet(void)
{
return GWSystem.unk0C;
return GWSystem.storyChar;
}
static inline void GWStoryCharSet(s32 storyChar)
{
GWSystem.storyChar = storyChar;
}
static inline s32 GWPlayerTeamGet(s32 player)

View File

@ -200,8 +200,8 @@ void fn_1_658C(Process *arg0)
CharKill(-1);
}
lbl_1_bss_A8[4] = GWGameStat.open_w06;
lbl_1_bss_A8[5] = GWGameStat.field10E_bit4;
lbl_1_bss_A8[6] = GWGameStat.field10E_bit5;
lbl_1_bss_A8[5] = GWGameStat.veryHardUnlock;
lbl_1_bss_A8[6] = GWGameStat.customPackEnable;
switch (lbl_1_bss_A8[0]) {
case 0:
HuAudSndGrpSetSet(7);
@ -340,11 +340,9 @@ void fn_1_6C4C(void)
print8(var_r30, var_r29 + 0xAA, 1.0f, "MODE:%d MAP:%d", lbl_1_bss_A8[0], lbl_1_bss_A8[2]);
print8(var_r30, var_r29 + 0xBE, 1.0f, "NO) IDX:GRP:COM:DIF:PAD:CHR");
for (var_r31 = 0; var_r31 < 4; var_r31++) {
s32 spC;
s32 sp8 = lbl_1_bss_3114[var_r31].unk_6C;
spC = lbl_1_bss_3114[var_r31].unk_68;
print8(var_r30, var_r29 + 0xC8 + (var_r31 * 0xA), 1.0f, "%2d) %3d:%3d:%3d:%3d:%3d:%3d", var_r31, lbl_1_bss_3114[var_r31].unk_58,
lbl_1_bss_3114[var_r31].unk_5C, lbl_1_bss_3114[var_r31].unk_60, lbl_1_bss_3114[var_r31].unk_64);
lbl_1_bss_3114[var_r31].unk_5C, lbl_1_bss_3114[var_r31].unk_60, lbl_1_bss_3114[var_r31].unk_64, lbl_1_bss_3114[var_r31].unk_6C, lbl_1_bss_3114[var_r31].unk_68);
}
print8(var_r30, var_r29 + 0xF0, 1.0f, "NO) FG0:FG1:FG2:FG3");
for (var_r31 = 0; var_r31 < 4; var_r31++) {
@ -2693,12 +2691,6 @@ void fn_1_E71C(s32 arg0)
}
}
inline void fn_1_E874_inline(void)
{
s32 sp18 = lbl_1_bss_3114[0].unk_68;
GWSystem.unk0C = sp18;
}
void fn_1_E874(omObjData *arg0, MentDllUnkBss35BCStruct *arg1)
{
s32 var_r31;
@ -2757,7 +2749,7 @@ void fn_1_E874(omObjData *arg0, MentDllUnkBss35BCStruct *arg1)
var_r18 = 0;
}
BoardStoryConfigSet(var_r24, var_r18);
fn_1_E874_inline();
GWStoryCharSet(lbl_1_bss_3114[0].unk_68);
// looks a bit similar to fn_1_7304
for (var_r31 = 1; var_r31 < 4; var_r31++) {
lbl_1_bss_3114[var_r31].unk_68 = -1;

View File

@ -1075,7 +1075,7 @@ s32 fn_1_1D688(StructBss8_24 *arg0)
var_r28 = 0;
var_r26 = arg0->unk64;
if (HuPadStkX[lbl_1_bss_1E10->unk6C] >= 5 || (HuPadBtn[lbl_1_bss_1E10->unk6C] & 2)) {
if (GWGameStat.field10E_bit4 == 1) {
if (GWGameStat.veryHardUnlock == 1) {
arg0->unk64++;
var_r28 = 1;
if (arg0->unk64 > 3) {
@ -1091,7 +1091,7 @@ s32 fn_1_1D688(StructBss8_24 *arg0)
}
}
else if (HuPadStkX[lbl_1_bss_1E10->unk6C] <= -5 || (HuPadBtn[lbl_1_bss_1E10->unk6C] & 1)) {
if (GWGameStat.field10E_bit4 == 1) {
if (GWGameStat.veryHardUnlock == 1) {
arg0->unk64--;
var_r28 = -1;
if (arg0->unk64 < 0) {

View File

@ -930,10 +930,10 @@ void fn_1_4010(void)
}
}
if (spA[0] >= 4 && spA[1] >= 3 && spA[2] >= 3 && spA[3] >= 2) {
GWGameStat.field10E_bit5 = 1;
GWGameStat.customPackEnable = 1;
}
else {
GWGameStat.field10E_bit5 = 0;
GWGameStat.customPackEnable = 0;
}
pos2D = lbl_1_data_40[2];
pos2D.z = 800;

View File

@ -1859,7 +1859,7 @@ void fn_1_A8C0(s16 boxno)
SLLoadBoardStory();
lbl_1_bss_EE[boxno] = GWGameStat.total_stars;
lbl_1_bss_D0[boxno] = GWGameStat.create_time;
lbl_1_bss_E8[boxno] = GWSystem.unk0C;
lbl_1_bss_E8[boxno] = GWSystem.storyChar;
lbl_1_bss_C4[boxno] = GWGameStat.story_continue;
lbl_1_bss_B8[boxno] = GWGameStat.party_continue;
if (GWGameStat.story_continue) {

View File

@ -2441,7 +2441,7 @@ s32 fn_1_19A98(MpexDllUnkStruct4 *arg0)
goto block_2;
}
}
if (GWGameStat.field10E_bit4 == 1) {
if (GWGameStat.veryHardUnlock == 1) {
arg0->unk_54++;
var_r28 = 1;
if (arg0->unk_54 > 3) {
@ -2457,7 +2457,7 @@ s32 fn_1_19A98(MpexDllUnkStruct4 *arg0)
goto block_1;
block_2:
if (HuPadStkX[lbl_1_bss_45C->unk_58] <= -5 || HuPadBtn[lbl_1_bss_45C->unk_58] & PAD_BUTTON_LEFT) {
if (GWGameStat.field10E_bit4 == 1) {
if (GWGameStat.veryHardUnlock == 1) {
arg0->unk_54--;
var_r28 = -1;
if (arg0->unk_54 < 0) {

View File

@ -105,7 +105,7 @@ void fn_1_188F0(Process *arg0, s32 arg1)
{
lbl_1_bss_B38 = arg0;
if (GWSystem.diff_story == 2) {
GWGameStat.field10E_bit4 = TRUE;
GWGameStat.veryHardUnlock = TRUE;
}
lbl_1_bss_C0C.unk0C = arg1;
fn_1_C30();
@ -298,7 +298,7 @@ void fn_1_19334(void)
Hu3DModelAttrSet(lbl_1_bss_B94.unk00->model[1], 1);
HuAudSeqFadeOut(lbl_1_bss_78[0], 100);
lbl_1_bss_B3C = 2;
GWGameStat.field10E_bit6 = TRUE;
GWGameStat.musicAllF = TRUE;
WipeColorSet(0, 0, 0);
WipeCreate(WIPE_MODE_OUT, WIPE_TYPE_NORMAL, -1);
while (WipeStatGet()) {
@ -406,8 +406,8 @@ void fn_1_199A0(void)
HuPrcVSleep();
}
fn_1_BE8(60);
var_r28 = GWUnkB1Get();
GWSystem.unk0B |= 1 << var_r28;
var_r28 = GWStoryCharGet();
GWSystem.storyCharBit |= 1 << var_r28;
if (SLSaveFlagGet() == 1) {
HuWinInit(1);
HuWinMesMaxSizeGet(1, sp8, MAKE_MESSID(30, 22));

View File

@ -171,7 +171,7 @@ void fn_1_4F4(void) {
case 1:
for (i = 0; i < 4; i++) {
if (GWPlayerCfg[i].character == GWUnkB1Get()) {
if (GWPlayerCfg[i].character == GWStoryCharGet()) {
break;
}
}
@ -179,7 +179,7 @@ void fn_1_4F4(void) {
break;
case 2:
for (i = 0; i < 4; i++) {
if (GWPlayerCfg[i].character == GWUnkB1Get()) {
if (GWPlayerCfg[i].character == GWStoryCharGet()) {
break;
}
}

View File

@ -619,7 +619,7 @@ void fn_1_17570(void) {
} else {
fn_1_159A4();
for (i = 0; i < 4; i++) {
if (lbl_1_bss_1A0C.unk38[i].unk10 != GWUnkB1Get()) {
if (lbl_1_bss_1A0C.unk38[i].unk10 != GWStoryCharGet()) {
continue;
}
_SetFlag(9);

View File

@ -575,15 +575,13 @@ void fn_1_13A0(void)
GWPlayerCfg[0].character = itemno/6;
{
s32 i;
s32 character;
for(i=1; i<4; i++) {
GWPlayerCfg[i].character = GWPlayerCfg[i-1].character+1;
if(GWPlayerCfg[i].character > GW_CHARACTER_MAX) {
GWPlayerCfg[i].character = 0;
}
}
character = GWPlayerCfg[0].character;
GWSystem.unk0C = character;
GWStoryCharSet(GWPlayerCfg[0].character);
GWPlayer[0].character = GWPlayerCfg[0].character;
GWPlayer[1].character = GWPlayerCfg[1].character;
GWPlayer[2].character = GWPlayerCfg[2].character;

View File

@ -147,7 +147,7 @@ void fn_1_488(void) {
switch (omovlevtno) {
case 0:
for (i = 0; i < 4; i++) {
if (GWPlayerCfg[i].character == GWUnkB1Get()) {
if (GWPlayerCfg[i].character == GWStoryCharGet()) {
break;
}
}
@ -155,7 +155,7 @@ void fn_1_488(void) {
break;
case 1:
for (i = 0; i < 4; i++) {
if (GWPlayerCfg[i].character == GWUnkB1Get()) {
if (GWPlayerCfg[i].character == GWStoryCharGet()) {
break;
}
}

View File

@ -513,9 +513,9 @@ omObjData *OptionSoundCreate(void)
for (i = 0; i < NUM_BOARDS; i++) {
musicPageOn[i + 3] = (GWGameStat.board_play_count[i] != 0) ? TRUE : FALSE;
}
musicPageOn[11] = (GWGameStat.field10E_bit6 != 0) ? TRUE : FALSE;
musicPageOn[12] = (GWGameStat.field10E_bit6 != 0) ? TRUE : FALSE;
musicPageOn[13] = (GWGameStat.field10E_bit6 != 0) ? TRUE : FALSE;
musicPageOn[11] = (GWGameStat.musicAllF != 0) ? TRUE : FALSE;
musicPageOn[12] = (GWGameStat.musicAllF != 0) ? TRUE : FALSE;
musicPageOn[13] = (GWGameStat.musicAllF != 0) ? TRUE : FALSE;
return object;
}

View File

@ -2511,7 +2511,7 @@ s32 fn_1_F214(ZtarDllUnkStruct2 *arg0)
var_r28 = 0;
var_r26 = arg0->unk_54;
if (HuPadStkX[lbl_1_bss_8C[0].unk_58] >= 5 || (HuPadBtn[lbl_1_bss_8C[0].unk_58] & PAD_BUTTON_RIGHT)) {
if (GWGameStat.field10E_bit4 == 1) {
if (GWGameStat.veryHardUnlock == 1) {
arg0->unk_54++;
var_r28 = 1;
if (arg0->unk_54 > 3) {
@ -2527,7 +2527,7 @@ s32 fn_1_F214(ZtarDllUnkStruct2 *arg0)
}
}
else if (HuPadStkX[lbl_1_bss_8C[0].unk_58] <= -5 || (HuPadBtn[lbl_1_bss_8C[0].unk_58] & PAD_BUTTON_LEFT)) {
if (GWGameStat.field10E_bit4 == 1) {
if (GWGameStat.veryHardUnlock == 1) {
arg0->unk_54--;
var_r28 = -1;
if (arg0->unk_54 < 0) {

View File

@ -619,7 +619,7 @@ static void CreateBoard(void)
s32 guest_status;
GWSystem.mg_next = -1;
if(!GWGameStat.field10E_bit5 && GWMGListGet() == 2) {
if(!GWGameStat.customPackEnable && GWMGListGet() == 2) {
GWMGListSet(0);
}
GWMessSpeedSet(GWMessSpeedGet());

View File

@ -905,7 +905,7 @@ static void ChangeDiffPadConfig(omObjData *arg0, ConfigWork *arg1) {
var_r30 |= 2;
}
temp_r29 = CheckPort(arg1->unk04);
if (GWGameStat.field10E_bit4 != 0) {
if (GWGameStat.veryHardUnlock != 0) {
var_r27 = 4;
} else {
var_r27 = 3;
@ -962,7 +962,7 @@ static void ChangeDiffPadConfig(omObjData *arg0, ConfigWork *arg1) {
arg1->unk09 = 0;
}
arg1->unk05 += var_r28;
if (GWGameStat.field10E_bit4 == 0 && arg1->unk05 == 4) {
if (GWGameStat.veryHardUnlock == 0 && arg1->unk05 == 4) {
arg1->unk05 += var_r28;
}
if (arg1->unk05 > var_r27) {
@ -1100,7 +1100,7 @@ static s32 UpdatePauseBoxExt(omObjData *arg0, ConfigWork *arg1, s32 arg2) {
u32 temp_r28;
Mtx sp8;
if (arg2 == 3 && GWGameStat.field10E_bit5 == 0) {
if (arg2 == 3 && GWGameStat.customPackEnable == 0) {
var_r27 = 1;
} else {
var_r27 = 2;

View File

@ -112,9 +112,9 @@ static inline void ResetFlag(GameStat *game_stat)
game_stat->story_continue = 0;
game_stat->party_continue = 0;
game_stat->open_w06 = 0;
game_stat->field10E_bit4 = 0;
game_stat->field10E_bit5 = 0;
game_stat->field10E_bit6 = 0;
game_stat->veryHardUnlock = 0;
game_stat->customPackEnable = 0;
game_stat->musicAllF = 0;
}
static inline void ResetPauseConfig(GameStat *game_stat)