Documentation of fox_option (#80)

* Renamed functions and variables related to the option cards

* Fixed format

* Renamed OptionLabel to OptionTexture

* Added more types on fox_option

* Reverted note_data

* Renamed OptionEntryId to OptionId

* Renamed ranking menu

* Added OPTION_COUNT

* Renamed missing declarations on option cards

* Added vars on symbol_addrs_overlays

* Removed hardcoded option count

* Fixed format

* Added missing option state assingments

* Fixed fox_game format
This commit is contained in:
Lywx 2024-01-13 19:33:38 -06:00 committed by GitHub
parent 56c2bd3e10
commit cbe2ad4546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 465 additions and 442 deletions

View File

@ -3,7 +3,7 @@
#include "global.h"
//! TODO: RENAME. Member names inferred by func_EBFBE0_8019C120.
//! TODO: RENAME. Member names inferred by Option_DrawCardLabel.
typedef struct {
/* 0x00 */ s32 unk_00; // type
/* 0x04 */ s32 unk_04;
@ -19,9 +19,9 @@ typedef struct {
/* 0x2C */ s32 unk_2C; // green
/* 0x30 */ s32 unk_30; // blue
/* 0x34 */ s32 unk_34; // alpha
} MenuContext_00; // size = 0x38
} OptionTexture; // size = 0x38
//! TODO: RENAME. Member names inferred by func_EBFBE0_8019BAB8
//! TODO: RENAME. Member names inferred by Option_DrawMenuCard
typedef struct {
/* 0x00 */ f32 unk_00; // x
/* 0x04 */ f32 unk_04; // y
@ -30,20 +30,20 @@ typedef struct {
/* 0x10 */ f32 unk_10; // yScale
} MenuContext_38; // size = 0x14
//! TODO: RENAME. Member names inferred by func_EBFBE0_8019BBA4
//! TODO: RENAME. Member names inferred by Option_DrawMenuArwing
typedef struct {
/* 0x0 */ f32 unk_0; // x
/* 0x4 */ f32 unk_4; // y
/* 0x8 */ f32 unk_8; // range
} MenuContext_4C; // size = 0xC
} ArwingPosition; // size = 0xC
typedef struct {
/* 0x00 */ MenuContext_00 unk_00;
/* 0x00 */ OptionTexture unk_00;
/* 0x38 */ MenuContext_38 unk_38;
/* 0x4C */ MenuContext_4C unk_4C;
/* 0x4C */ ArwingPosition unk_4C;
/* 0x58 */ s32 unk_58;
/* 0x5C */ s32 unk_5C;
} MenuContext; // size = 0x60
} OptionEntry; // size = 0x60
typedef struct {
s32 unk_0;
@ -56,6 +56,27 @@ typedef struct {
/* 0x8 */ s32 unk_8;
} UnkStruct_D_EBFBE0_801AED4C; // size = 0xC
typedef enum OptionId {
OPTION_MAIN = 1000,
OPTION_VERSUS_STAGE = 2000,
OPTION_MAP = 0,
OPTION_TRAINING = 1,
OPTION_VERSUS = 2,
OPTION_RANKING = 3,
OPTION_SOUND = 4,
OPTION_DATA = 5,
OPTION_EXPERT_SOUND = 6,
OPTION_POINT_MATCH = 10,
OPTION_BR_MATCH = 20,
OPTION_TT_MATCH = 30,
OPTION_NAME = 200,
OPTION_SCORE = 300,
OPTION_INVOICE = 400,
OPTION_MAX,
} OptionId;
#define OPTION_COUNT ARRAY_COUNT(sOptionCardList)
extern s32 D_EBFBE0_801B9090;
extern s32 D_EBFBE0_801B9094;
extern s32 D_EBFBE0_801B9098; //gap
@ -69,7 +90,7 @@ extern f32 D_EBFBE0_801B9100[3]; //gap
extern f32 D_EBFBE0_801B9110[3];
extern f32 D_EBFBE0_801B911C;
extern f32 D_EBFBE0_801B9120;
extern s32 D_EBFBE0_801B9124;
extern OptionId D_EBFBE0_801B9124;
extern s32 D_EBFBE0_801B9128;
extern s32 D_EBFBE0_801B912C;
extern s32 D_EBFBE0_801B9130;
@ -219,35 +240,35 @@ void func_EBFBE0_8018FF74(void);
void func_EBFBE0_8018D2B8(s32);
void func_EBFBE0_8018EA78(s32);
void func_EBFBE0_80191B20(void);
void func_EBFBE0_80192190(void);
void func_EBFBE0_801928BC(void);
void func_EBFBE0_80192D58(void);
void func_EBFBE0_80192938(void);
void Option_Setup(void);
void Option_UpdateEntry(void);
void Option_MapUpdate(void);
void Option_MainMenuUpdate(void);
void Option_TrainingUpdate(void);
void func_EBFBE0_801929F0(void);
void func_EBFBE0_80193864(void);
void func_EBFBE0_80193C4C(void);
void func_EBFBE0_801944F0(void);
void func_EBFBE0_80194678(void);
void func_EBFBE0_801948A8(void);
void Option_MainMenuDraw(void);
void Option_VersusUpdate(void);
void Option_VersusDraw(void);
void Option_SoundInit(void);
void Option_SoundUpdate(void);
void func_EBFBE0_80194AEC(void);
void func_EBFBE0_80194BD0(void);
void func_EBFBE0_80194CE4(void);
void Option_SoundDraw(void);
void func_EBFBE0_801952B4(void);
void func_EBFBE0_801958DC(void);
void Option_ExpertSoundInit(void);
void Option_ExpertSoundUpdate(void);
void func_EBFBE0_80195B74(void);
void func_EBFBE0_80196260(void);
void func_EBFBE0_801962A4(void);
void Option_ExpertSoundDraw(void);
void Option_DataInit(void);
void Option_DataUpdate(void);
void func_EBFBE0_8019669C(void);
void func_EBFBE0_80196894(void);
void func_EBFBE0_80196E54(void);
void func_EBFBE0_80196EFC(void);
void func_EBFBE0_80196F9C(void);
void Option_DataDraw(void);
void Option_RankingInit(void);
void Option_RankingUpdate(void);
void Option_RankingDraw(void);
void func_EBFBE0_80196FC4(void);
void func_EBFBE0_80197074(void);
void func_EBFBE0_8019715C(void);
void func_EBFBE0_801973C0(void);
void func_EBFBE0_80197074(void);
void func_EBFBE0_8019715C(void);
void Option_RankingMenuDraw(void);
void func_EBFBE0_8019752C(void);
void func_EBFBE0_80197914(void);
void func_EBFBE0_80197A3C(s32, s32, s32);
@ -262,15 +283,15 @@ void func_EBFBE0_8019882C(s32, s32, f32, f32);
void func_EBFBE0_8019896C(s32, f32, s32);
void func_EBFBE0_80199198(f32 arg0, f32 arg1, f32 arg2);
s32 func_EBFBE0_80199284(s32 arg0, s32 arg1);
void func_EBFBE0_801992C4(void);
void func_EBFBE0_80199424(void);
void Option_VersusMenuInit(void);
void Option_VersusMenuUpdate(void);
void func_EBFBE0_8019949C(void);
void func_EBFBE0_8019978C(void);
void Option_VersusMenuDraw(void);
void func_EBFBE0_80199820(s32);
void func_EBFBE0_80199EA8(void);
void func_EBFBE0_80199FA8(void);
void Option_VersusStageInit(void);
void func_EBFBE0_8019A080(void);
void func_EBFBE0_8019A0B8(void);
void Option_VersusStageUpdate(void);
void func_EBFBE0_8019A124(void);
void func_EBFBE0_8019A1A8(void);
void func_EBFBE0_8019A214(void);
@ -279,7 +300,7 @@ void func_EBFBE0_8019A2E0(void);
void func_EBFBE0_8019A4DC(void);
void func_EBFBE0_8019A6DC(void);
void func_EBFBE0_8019A954(void);
void func_EBFBE0_8019AAB4(void);
void Option_VersusStageDraw(void);
void func_EBFBE0_8019AB30(void);
void func_EBFBE0_8019AD84(void);
void func_EBFBE0_8019AFFC(void);
@ -289,16 +310,16 @@ void func_EBFBE0_8019B5AC(void);
void func_EBFBE0_8019B7D4(void);
void func_EBFBE0_8019B8A0(s32 arg0);
void func_EBFBE0_8019B8C8(void);
void func_EBFBE0_8019B9C0(void);
void Option_DrawMenuLabel(void);
void func_EBFBE0_8019BDF0(void);
void func_EBFBE0_8019BAB8(MenuContext_38 arg0);
void func_EBFBE0_8019BBA4(MenuContext_4C arg0);
void Option_DrawMenuCard(MenuContext_38 arg0);
void Option_DrawMenuArwing(ArwingPosition arg0);
void func_EBFBE0_8019BC44(f32, f32, f32, f32, f32, f32);
void func_EBFBE0_8019BE7C(f32, f32, f32, f32 *, f32 *, f32 *);
void func_EBFBE0_8019BF34(void);
void func_EBFBE0_8019B6D8(f32 xPos, f32 yPos, f32 offset, s32 r, s32 g, s32 b);
void func_EBFBE0_8019C04C(void);
void func_EBFBE0_8019C120(MenuContext_00 arg0);
void Option_DrawCardLabel(OptionTexture arg0);
s32 func_EBFBE0_8019C418(s32* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, UnkStruct_D_EBFBE0_801B9250* arg8);
void func_EBFBE0_8019C824(f32* );
s32 func_EBFBE0_8019C8C4(void);
@ -312,8 +333,8 @@ s32 func_EBFBE0_8019DCE8(s32 arg0);
void func_EBFBE0_8019DD44(void);
void func_EBFBE0_8019DE74(void);
void func_EBFBE0_8019DF64(void);
void func_EBFBE0_8019E030(void);
void func_EBFBE0_8019E284(void);
void Option_InvoiceUpdate(void);
void Option_InvoiceDraw(void);
void func_EBFBE0_801906A0(void);
void func_EBFBE0_80190C9C(void);
void func_EBFBE0_80190E64(void);

View File

@ -7,12 +7,12 @@
#define UNK_TYPE s32
typedef struct {
/* bit 0 */ u8 unk_0 : 3;
/* bit 3 */ u8 expertMedal : 1;
/* bit 4 */ u8 expertClear : 1;
/* bit 5 */ u8 played : 1;
/* bit 6 */ u8 normalMedal : 1;
/* bit 7 */ u8 normalClear : 1;
/* bit 0 */ u8 unk_0 : 3;
/* bit 3 */ u8 expertMedal : 1;
/* bit 4 */ u8 expertClear : 1;
/* bit 5 */ u8 played : 1;
/* bit 6 */ u8 normalMedal : 1;
/* bit 7 */ u8 normalClear : 1;
} PlanetData; // size = 0x1
typedef struct {
@ -95,4 +95,10 @@ typedef struct {
/* 0x14 */ f32 unk_14;
} UnkStruct_D_EBFBE0_801B8294; // size = 0x18
typedef enum OptionState {
OPTION_WAIT,
OPTION_SETUP,
OPTION_UPDATE
} OptionState;
#endif

View File

@ -416,7 +416,7 @@ extern s32 D_Timer_8017783C;
extern s32 D_80177840;
extern s32 gBossHealthBar;
extern s32 D_80177844;
extern s32 D_8017784C;
extern OptionState gOptionMenuStatus;
extern s32 D_80177850;
extern s32 D_80177854;
extern s32 D_80177858[4];
@ -705,7 +705,7 @@ extern f32 D_801784CC;
extern f32 D_801784D0; // effective Vec3f
extern f32 D_801784D4;
extern f32 D_801784D8;
extern s32 gLight1x; // Vec3i light direction
extern s32 gLight1x; // Vec3i light direction
extern s32 gLight1y;
extern s32 gLight1z;
extern f32 D_801784E8;
@ -740,7 +740,7 @@ extern s32 gLight2G;
extern s32 gLight2B;
extern s32 D_80178570; // Color32 light color 2 modifier?
extern s32 D_80178574;
extern s32 D_80178578;
extern s32 D_80178578;
// fox_rcp?
extern u8 D_80178580[];
@ -812,7 +812,7 @@ extern Gfx D_Gfx_800DAC20[];
extern Gfx D_Gfx_800D9688[];
// wave_samples
extern s16 gSawtoothWaveSample[];
extern s16 gSawtoothWaveSample[];
extern s16 gTriangleWaveSample[];
extern s16 gSineWaveSample[];
extern s16 gSquareWaveSample[];

View File

@ -1,9 +1,11 @@
Option_ExpertSoundUpdate = 0x80195944;
Option_ExpertSoundUpdate = 0x80195944; // segment:ovl_menu
Option_VersusStageInit = 0x80199FA8; // segment:ovl_menu
planet = 0x801AF4A0; // type:Planet segment:ovl_menu size:0x38
sPlanetNames = 0x801AF9F4; // type:s32 segment:ovl_menu size:0xF
GetPlanetId = 0x801A6480; // force_migration:True segment:ovl_menu
D_EBFBE0_801AE638 = 0x801AE638; // type:MenuContext segment:ovl_menu size:0x240
sOptionCardList = 0x801AE638; // type:OptionEntry segment:ovl_menu size:0x240
D_EBFBE0_801AE99C = 0x801AE99C; // force_migration:True segment:ovl_menu
sTimeTrialMinuteTextures = 0x801AF28C; // force_migration:True segment:ovl_menu
sPlanetList = 0x801AF7E8;
spectrumAnalizerMode = 0x801B9318;
D_EBFBE0_801B6E50 = 0x801B6E50; // force_migration:True segment:ovl_menu

View File

@ -415,8 +415,8 @@ gGameState = 0x80177834;
D_80177838 = 0x80177838;
D_Timer_8017783C = 0x8017783C;
D_80177840 = 0x80177840;
gOptionMenuStatus = 0x8017784C; //type:OptionState
gBossHealthBar = 0x80177848;
D_8017784C = 0x8017784C;
D_80177850 = 0x80177850;
D_80177854 = 0x80177854;
D_80177858 = 0x80177858;
@ -730,4 +730,3 @@ func_800B832C = 0x800B832C;
func_800B852C = 0x800B852C;
func_800B86A4 = 0x800B86A4;
func_800B86CC = 0x800B86CC;

View File

@ -14,11 +14,11 @@ D_DF4260_8019A008 = 0x8019A008;
func_E08400_80187B08 = 0x80187B08;
func_E08400_80188A40 = 0x80188A40;
D_E08400_80195D70 = 0x80195D70;
D_EBFBE0_801AE570 = 0x801AE570; // type:f32 size:0x18 force_migration:True segment:ovl_menu
D_EBFBE0_801AE588 = 0x801AE588; // type:f32 size:0x18 force_migration:True segment:ovl_menu
D_EBFBE0_801AE5A0 = 0x801AE5A0; // type:f32 size:0x18 force_migration:True segment:ovl_menu
D_EBFBE0_801AE5B8 = 0x801AE5B8; // type:f32 size:0x18 force_migration:True segment:ovl_menu
D_EBFBE0_801AE5D0 = 0x801AE5D0; // type:f32 size:0x18 force_migration:True segment:ovl_menu
sOptionCardPosY = 0x801AE570; // type:f32 size:0x18 force_migration:True segment:ovl_menu
sOptionCardTextPosX = 0x801AE588; // type:f32 size:0x18 force_migration:True segment:ovl_menu
sOptionCardTextPosY = 0x801AE5A0; // type:f32 size:0x18 force_migration:True segment:ovl_menu
sOptionCardCurTextPosX = 0x801AE5B8; // type:f32 size:0x18 force_migration:True segment:ovl_menu
sOptionCardCurTextPosY = 0x801AE5D0; // type:f32 size:0x18 force_migration:True segment:ovl_menu
D_EBFBE0_801AE9A0 = 0x801AE9A0; // type:f32 size:0x10 force_migration:True segment:ovl_menu
D_EBFBE0_801AE9B0 = 0x801AE9B0; // type:f32 size:0x10 force_migration:True segment:ovl_menu
@ -145,4 +145,3 @@ D_E9F1D0_801A7F70 = 0x801A7F70;
D_E9F1D0_801A7F78 = 0x801A7F78;
D_EFFA40_801875C0 = 0x801875C0;

View File

@ -383,8 +383,8 @@ void func_800A26C0(void) {
gLifeCount[0] = 2;
D_80177D20 = 0.0f;
D_8016170C = D_80177A80 = D_80177830 = D_80177838 = D_80177840 = D_80178754 = gVersusMode = D_80177AE0 =
D_80178410 = D_80177B40 = D_80177854 = D_8017784C = gDrawMode = gShowBossHealth = D_80161A2C =
gBgColor = D_80178340 = 0;
D_80178410 = D_80177B40 = D_80177854 = gOptionMenuStatus = gDrawMode = gShowBossHealth =
D_80161A2C = gBgColor = D_80178340 = 0;
gNextGameState = D_80177C94 = D_80177CAC = D_80177CB4 = D_80177CBC = D_80177CC4 = D_80177C9C =
D_80177CA4 = D_80161A5C = D_80161A34 = 0;
for (i = 0; i < 4; i++) {

View File

@ -5461,7 +5461,7 @@ void func_800B48BC(Player* player) {
} else if (gCurrentLevel == LEVEL_TRAINING) {
gGameState = GSTATE_MENU;
D_Timer_8017783C = 2;
D_8017784C = 0;
gOptionMenuStatus = OPTION_WAIT;
gDrawMode = DRAWMODE_0;
D_80161A34 = 7;
D_80178410 = 0;

View File

@ -62,7 +62,7 @@ void func_800BC760(void) {
D_80177854 = 0;
gDrawMode = DRAWMODE_0;
D_80177AE0 = 0;
D_8017784C = 0;
gOptionMenuStatus = OPTION_WAIT;
D_80177B40 = 0;
gBgColor = 0;
D_80178380[0] = 0;
@ -1468,7 +1468,7 @@ void func_800C1700(void) {
func_800BC760();
gGameState = GSTATE_MENU;
D_Timer_8017783C = 2;
D_8017784C = 0;
gOptionMenuStatus = OPTION_WAIT;
D_800D2870 = 1;
gBgColor = 0;
}
@ -1811,16 +1811,16 @@ void func_800C1ED4(void) {
}
void func_800C20B0(void) {
switch (D_8017784C) {
switch (gOptionMenuStatus) {
case 0:
if (D_Timer_8017783C == 0) {
D_8017784C = 1;
gOptionMenuStatus = OPTION_SETUP;
D_80178410 = 0;
}
break;
case 1:
D_8017784C = 2;
gOptionMenuStatus = OPTION_UPDATE;
break;
case 2:

View File

@ -2,8 +2,8 @@
void func_EBFBE0_80187754(void);
void func_EBFBE0_801878D8(void);
void func_EBFBE0_801920C4(void);
void func_EBFBE0_80192340(void);
void Option_Init(void);
void Option_DrawEntry(void);
void func_EBFBE0_8019E85C(void);
void func_EBFBE0_8019E8C8(void);
void func_EBFBE0_8019E8D0(void);
@ -28,11 +28,11 @@ void func_EBFBE0_80187520(s32 arg0, void* arg1) {
break;
case 107:
func_EBFBE0_801920C4();
Option_Init();
break;
case 108:
func_EBFBE0_80192340();
Option_DrawEntry();
break;
case 109:

View File

@ -2348,7 +2348,7 @@ void func_EBFBE0_801A116C(void) {
wings.rightState = wings.leftState = 2;
// clang-format off
wings.unk_18 = wings.unk_1C = wings.unk_20 = wings.unk_24 = wings.unk_04 =
wings.unk_18 = wings.unk_1C = wings.unk_20 = wings.unk_24 = wings.unk_04 =
wings.unk_08 = wings.unk_0C = wings.unk_10 = wings.unk_28 = 0.0f;
// clang-format on
@ -3228,7 +3228,7 @@ void func_EBFBE0_801A36A8(void) {
case 4:
gGameState = GSTATE_MENU;
D_Timer_8017783C = 2;
D_8017784C = 0;
gOptionMenuStatus = OPTION_WAIT;
gDrawMode = 0;
D_80178410 = 0;
break;

File diff suppressed because it is too large Load Diff

View File

@ -3133,7 +3133,7 @@ void func_EBFBE0_80190FD0(void) {
} else {
gGameState = GSTATE_MENU;
D_Timer_8017783C = 2;
D_8017784C = 0;
gOptionMenuStatus = OPTION_WAIT;
gDrawMode = DRAWMODE_0;
D_80178410 = 0;
D_EBFBE0_801B8280 = 0;