Skip to content

Commit

Permalink
various mn work (#1431)
Browse files Browse the repository at this point in the history
  • Loading branch information
thefoxcam authored Aug 15, 2024
1 parent 6b14e76 commit c41c548
Show file tree
Hide file tree
Showing 15 changed files with 704 additions and 269 deletions.
24 changes: 14 additions & 10 deletions config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22984,9 +22984,14 @@ mnVibration_803EECE0 = .data:0x803EECE0; // type:object size:0xC scope:global
mnVibration_803EECEC = .data:0x803EECEC; // type:object size:0xC scope:global
mnVibration_803EECF8 = .data:0x803EECF8; // type:object size:0xC scope:global data:float
mnVibration_803EED04 = .data:0x803EED04; // type:object size:0x1D4 scope:global
mnSound_803EEED8 = .data:0x803EEED8; // type:object size:0x3C scope:global
mnSound_803EEF14 = .data:0x803EEF14; // type:object size:0xC scope:global data:4byte
mnSound_803EEF20 = .data:0x803EEF20; // type:object size:0xB8 scope:global data:4byte
mnSound_803EEED8 = .data:0x803EEED8; // type:object size:0x54 scope:global data:float
mnSound_803EEF2C = .data:0x803EEF2C; // type:object size:0x16 scope:global data:string
mnSound_803EEF44 = .data:0x803EEF44; // type:object size:0x9 scope:global data:string
mnSound_803EEF50 = .data:0x803EEF50; // type:object size:0xA scope:global data:string
mnSound_803EEF5C = .data:0x803EEF5C; // type:object size:0x17 scope:global data:string
mnSound_803EEF74 = .data:0x803EEF74; // type:object size:0x1B scope:global data:string
mnSound_803EEF90 = .data:0x803EEF90; // type:object size:0x1E scope:global data:string
mnSound_803EEFB0 = .data:0x803EEFB0; // type:object size:0x20 scope:global data:string
mnDeflicker_803EEFD8 = .data:0x803EEFD8; // type:object size:0xC scope:global
...data.0 = .data:0x803EEFD8; // type:label scope:local
mnDeflicker_803EEFE4 = .data:0x803EEFE4; // type:object size:0xC scope:global
Expand All @@ -22998,10 +23003,8 @@ mnDeflicker_803EEFF0 = .data:0x803EEFF0; // type:object size:0xC scope:global
@234 = .data:0x803EF048; // type:object size:0x1B scope:local data:string
@235 = .data:0x803EF064; // type:object size:0x1F scope:local data:string
@236 = .data:0x803EF084; // type:object size:0x21 scope:local data:string
mnSoundTest_803EF0A8 = .data:0x803EF0A8; // type:object size:0x18 scope:global
mnSoundTest_803EF0C0 = .data:0x803EF0C0; // type:object size:0xC scope:global data:float
mnSoundTest_803EF0CC = .data:0x803EF0CC; // type:object size:0x3C scope:global
mnSoundTest_803EF108 = .data:0x803EF108; // type:object size:0x498 scope:global data:float
mnSoundTest_803EF0A8 = .data:0x803EF0A8; // type:object size:0x6C scope:global data:float
mnSoundTest_803EF114 = .data:0x803EF114; // type:object size:0x48C scope:global
mnLanguage_803EF5A0 = .data:0x803EF5A0; // type:object size:0xC scope:global
mnLanguage_803EF5AC = .data:0x803EF5AC; // type:object size:0xBC scope:global
mnHyaku_803EF668 = .data:0x803EF668; // type:object size:0xC scope:global
Expand Down Expand Up @@ -25013,7 +25016,8 @@ mnVibration_804A0868 = .bss:0x804A0868; // type:object size:0x10 scope:global da
mnVibration_804A0878 = .bss:0x804A0878; // type:object size:0x10 scope:global data:4byte
mnVibration_804A0888 = .bss:0x804A0888; // type:object size:0x10 scope:global data:4byte
mnVibration_804A0898 = .bss:0x804A0898; // type:object size:0x10 scope:global data:4byte
mnSound_804A08A8 = .bss:0x804A08A8; // type:object size:0x10 scope:global data:4byte
mnSound_804A08A8 = .bss:0x804A08A8; // type:object size:0x4 scope:global data:4byte
mnSound_804A08AC = .bss:0x804A08AC; // type:object size:0xC scope:global data:4byte
mnDeflicker_804A08B8 = .bss:0x804A08B8; // type:object size:0x10 scope:global data:4byte
...bss.0 = .bss:0x804A08B8; // type:label scope:local
mnSoundTest_804A08C8 = .bss:0x804A08C8; // type:object size:0x10 scope:global data:4byte
Expand Down Expand Up @@ -26221,8 +26225,8 @@ mnVibration_804D4FE8 = .sdata:0x804D4FE8; // type:object size:0x8 scope:global d
mnVibration_804D4FF0 = .sdata:0x804D4FF0; // type:object size:0x4 scope:global
mnVibration_804D4FF4 = .sdata:0x804D4FF4; // type:object size:0x8 scope:global
mnVibration_804D4FFC = .sdata:0x804D4FFC; // type:object size:0xC scope:global
mnSound_804D5008 = .sdata:0x804D5008; // type:object size:0x8 scope:global
mnSound_804D5010 = .sdata:0x804D5010; // type:object size:0x8 scope:global
mnSound_804D5008 = .sdata:0x804D5008; // type:object size:0x8 scope:global data:string
mnSound_804D5010 = .sdata:0x804D5010; // type:object size:0x8 scope:global data:string
mnLanguage_804D5018 = .sdata:0x804D5018; // type:object size:0x8 scope:global
mnHyaku_804D5020 = .sdata:0x804D5020; // type:object size:0x8 scope:global
mnEvent_804D5028 = .sdata:0x804D5028; // type:object size:0x4 scope:global data:4byte
Expand Down
5 changes: 5 additions & 0 deletions src/melee/lb/lb_00F9.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ void lb_8000F9F8(HSD_JObj* jobj)
lb_80011B74(HSD_JObjGetDObj(jobj), JOBJ_UNK_B26);
}
}

/*
@note: The number of HSD_JObjs that get passed into arg1 is the number of
variable arguments passed until -1 is passed. lb_80011E24
*/
1 change: 1 addition & 0 deletions src/melee/lb/lb_00F9.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/* 011ABC */ UNK_RET lb_80011ABC(UNK_PARAMS);
/* 011AC4 */ HSD_LObj* lb_80011AC4(UNK_T);
/* 011C18 */ void lb_80011C18(HSD_JObj* jobj, u32 flags);
/* 011E24 */ int lb_80011E24(HSD_JObj*, HSD_JObj**, ...);
/* 0122C8 */ void lb_800122C8(HSD_ImageDesc*, int, int, int);
/* 0122FC */ void lb_800121FC(HSD_ImageDesc*, int, int, int, int);
/* 013B14 */ HSD_CObj* lb_80013B14(HSD_CameraDescPerspective*);
Expand Down
2 changes: 1 addition & 1 deletion src/melee/lb/lbaudio_ax.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* 0237A8 */ u32 lbAudioAx_800237A8(enum_t sfx_id, u8 sfx_vol, u8 sfx_pan);
/* 023870 */ int lbAudioAx_80023870(int, int, int, int);
/* 023F28 */ void lbAudioAx_80023F28(s32);
/* 024030 */ void lbAudioAx_80024030(s32);
/* 024030 */ void lbAudioAx_80024030(s32); // plays menu SFX
/* 024184 */ int lbAudioAx_80024184(int, int, int, int);
/* 02438C */ void lbAudioAx_8002438C(s32);
/* 024B1C */ void lbAudioAx_80024B1C(s32, s32);
Expand Down
79 changes: 79 additions & 0 deletions src/melee/mn/inlines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#include "lb/lb_00F9.h"
#include "lb/lbaudio_ax.h"
#include "mn/mn_2295.h"
#include "mn/types.h"

#include <baselib/gobj.h>
#include <baselib/jobj.h>
#include <baselib/sislib.h>

typedef enum _MenuEvent {
MenuEvent_Up = 1 << 0,
MenuEvent_Down = 1 << 1,
MenuEvent_Left = 1 << 2,
MenuEvent_Right = 1 << 3,
MenuEvent_Unk = 1 << 4,
MenuEvent_Back = 1 << 5,
} MenuEvent;

#define GET_MENU(gobj) ((Menu*) HSD_GObjGetUserData(gobj))

static inline void Menu_DecrementAnimTimer(void)
{
mn_804D6BC8.x0--;
mn_804D6BC8.x2 = 0;
mn_804D6BC8.x4 = 0;
}

static inline u64 Menu_GetEvents(void)
{
return mn_804A04F0.x8 = mn_80229624(4);
}

// @todo: The functions `fn_8017435C`, `fn_80174338`, and `fn_80174380` are
// probably deduplicated clones of these.

static inline void Menu_SFX_Back(void)
{
lbAudioAx_80024030(0);
}

static inline void Menu_SFX_Forward(void)
{
lbAudioAx_80024030(1);
}

static inline void Menu_SFX_Move(void)
{
lbAudioAx_80024030(2);
}

static inline void Menu_InitCenterText(Menu* menu, u8 val)
{
HSD_Text* text =
HSD_SisLib_803A5ACC(0, 1, -9.5F, 9.1F, 17.0F, 364.68332F, 38.38772F);
menu->text = text;
text->x24.x = 0.0521F;
text->x24.y = 0.0521F;
HSD_SisLib_803A6368(text, val);
}

// @todo: One of these inlines is probably correct

static inline void inline_test_3(HSD_JObj* jobj, f32 val, u8 loops,
HSD_TypeMask type)
{
HSD_JObjReqAnimAll(jobj, val);
mn_8022F3D8(jobj, loops, type);
HSD_JObjAnimAll(jobj);
}

static inline void inline_test_4(HSD_GObj* gobj, f32 val, u8 loops,
HSD_TypeMask type)
{
HSD_JObj* jobj;
lb_80011E24(GET_JOBJ(gobj), &jobj, 5, -1);
HSD_JObjReqAnimAll(jobj, val);
mn_8022F3D8(jobj, loops, type);
HSD_JObjAnimAll(jobj);
}
33 changes: 32 additions & 1 deletion src/melee/mn/mn_2295.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@

#include <platform.h>

/* 22F3D8 */ void mn_8022F3D8(void);
#include "dolphin/mtx/types.h"

#include <baselib/object.h>

void mn_8022F3D8(void*, u8, HSD_TypeMask);
void mn_8022ED6C(HSD_JObj*, Vec3*);
u32 mn_80229624(u32); // returns a bitfield of controller inputs
void mn_80229894(s32, s32, s32); // go to a specific part of the menu?
float mn_8022EC18(HSD_JObj*, float*, int);
void mn_802295AC(void);
void mn_80229860(s32);
f32 mn_8022F298(HSD_JObj*);

typedef struct _mn_unk1 {
u8 x0;
u8 x1;
s16 x2;
s32 x4;
u64 x8;
u8 x10;
u8 x11;
} mn_unk1;

typedef struct _mn_unk2 {
u16 x0;
u16 x2;
s32 x4;
} mn_unk2;

extern HSD_Archive* mn_804D6BB8;
extern mn_unk1 mn_804A04F0;
extern mn_unk2 mn_804D6BC8;

#endif
Loading

0 comments on commit c41c548

Please sign in to comment.