summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorErin Moon <erin@hecke.rs>2021-01-03 00:04:15 -0600
committerGitHub <noreply@github.com>2021-01-03 01:04:15 -0500
commit5c4ac052c3eadf70cfb4810341ccfbbba22869e2 (patch)
tree37f1e2f9a5d7f0ba7313c7229fa60bac11dcb453 /include
parentb6791276753f676f07e5251d823b0969208f1dc8 (diff)
decomp some small files, do some cleanup (#42)
* remove leftover asm: JSUList.s * d_save_init: decomp * JMath/random: decomp * J3DUDL: fixup label * JAUClusterSound: decomp * c_API_controller_pad: decomp, elaborate globals/types * clang-format * don't add guards to functions.h * semantic merge of m_cpadInfo stuff * fix undef symbols Co-authored-by: Pheenoh <pheenoh@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/JAudio2/JAUClusterSound/JAUClusterSound.h8
-rw-r--r--include/JSystem/JMath/random.h19
-rw-r--r--include/SComponent/c_API_controller_pad.h37
-rw-r--r--include/Z2AudioLib/Z2Calc/asm/func_802A98D4.s2
-rw-r--r--include/Z2AudioLib/Z2SeMgr/Z2SeMgr.h2
-rw-r--r--include/Z2AudioLib/Z2SeMgr/asm/func_802AB64C.s4
-rw-r--r--include/d/d_lib/d_lib.h3
-rw-r--r--include/d/d_save/d_save_init/d_save_init.h8
-rw-r--r--include/functions.h3
-rw-r--r--include/m_Do/m_Do_controller_pad/m_Do_controller_pad.h44
-rw-r--r--include/os/OS.h2
-rw-r--r--include/variables.h2
12 files changed, 84 insertions, 50 deletions
diff --git a/include/JSystem/JAudio2/JAUClusterSound/JAUClusterSound.h b/include/JSystem/JAudio2/JAUClusterSound/JAUClusterSound.h
index 6048eec2ae..918035371d 100644
--- a/include/JSystem/JAudio2/JAUClusterSound/JAUClusterSound.h
+++ b/include/JSystem/JAudio2/JAUClusterSound/JAUClusterSound.h
@@ -1,8 +1,12 @@
#ifndef JAUCLUSTERSOUND_H_
#define JAUCLUSTERSOUND_H_
-#include "global.h"
+#include "dolphin/types.h"
-struct JAISoundHandle {};
+struct JAISoundHandle {
+ void* unk; // probably JAISound*
+
+ JAISoundHandle();
+};
#endif \ No newline at end of file
diff --git a/include/JSystem/JMath/random.h b/include/JSystem/JMath/random.h
new file mode 100644
index 0000000000..ffe0f3b141
--- /dev/null
+++ b/include/JSystem/JMath/random.h
@@ -0,0 +1,19 @@
+#ifndef __JSYSTEM_JMATH_RANDOM_H__
+#define __JSYSTEM_JMATH_RANDOM_H__
+
+#include "dolphin/types.h"
+
+namespace JMath {
+struct TRandom_fast_ {
+ u32 value;
+
+ TRandom_fast_(u32 value);
+};
+} // namespace JMath
+
+// needed for Z2Calc.cpp
+extern "C" {
+void __ct__Q25JMath13TRandom_fast_FUl(JMath::TRandom_fast_*, u32);
+};
+
+#endif \ No newline at end of file
diff --git a/include/SComponent/c_API_controller_pad.h b/include/SComponent/c_API_controller_pad.h
new file mode 100644
index 0000000000..b200ba825b
--- /dev/null
+++ b/include/SComponent/c_API_controller_pad.h
@@ -0,0 +1,37 @@
+#ifndef __C_API_CONTROLLER_PAD__
+#define __C_API_CONTROLLER_PAD__
+
+#include "global.h"
+
+struct interface_of_controller_pad {
+ f32 mMainStickPosX;
+ f32 mMainStickPosY;
+ f32 mMainStickValue;
+ s16 mMainStickAngle;
+ u8 field_0xe;
+ u8 field_0xf;
+ f32 mCStickPosX;
+ f32 mCStickPosY;
+ f32 mCStickValue;
+ s16 mCStickAngle;
+ u8 field_0x1e;
+ u8 field_0x1f;
+ f32 mAnalogA;
+ f32 mAnalogB;
+ f32 mTriggerLeft;
+ f32 mTriggerRight;
+ u32 mButtonFlags;
+ u32 mPressedButtonFlags;
+ s8 mGamepadErrorFlags;
+ u8 field_0x39;
+ u8 field_0x3a;
+ u8 field_0x3b;
+ u8 field_0x3c;
+ u8 field_0x3d;
+ u8 field_0x3e;
+ u8 field_0x3f;
+};
+
+void cAPICPad_recalibrate(void);
+
+#endif \ No newline at end of file
diff --git a/include/Z2AudioLib/Z2Calc/asm/func_802A98D4.s b/include/Z2AudioLib/Z2Calc/asm/func_802A98D4.s
index b45098ff84..5f79372049 100644
--- a/include/Z2AudioLib/Z2Calc/asm/func_802A98D4.s
+++ b/include/Z2AudioLib/Z2Calc/asm/func_802A98D4.s
@@ -6,7 +6,7 @@
/* 802A98E8 002A6828 40 82 00 18 */ bne lbl_802A9900
/* 802A98EC 002A682C 38 6D 8D B4 */ subi r3, r13, 0x724c
/* 802A98F0 002A6830 38 80 00 00 */ li r4, 0
-/* 802A98F4 002A6834 48 09 01 F1 */ bl JMath_NS_TRandom_fast_
+/* 802A98F4 002A6834 48 09 01 F1 */ bl __ct__Q25JMath13TRandom_fast_FUl
/* 802A98F8 002A6838 38 00 00 01 */ li r0, 1
/* 802A98FC 002A683C 98 0D 8D B0 */ stb r0, lbl_80451330-_SDA_BASE_(r13)
lbl_802A9900:
diff --git a/include/Z2AudioLib/Z2SeMgr/Z2SeMgr.h b/include/Z2AudioLib/Z2SeMgr/Z2SeMgr.h
index 1744b17b77..b722ceeb37 100644
--- a/include/Z2AudioLib/Z2SeMgr/Z2SeMgr.h
+++ b/include/Z2AudioLib/Z2SeMgr/Z2SeMgr.h
@@ -76,6 +76,8 @@ void registMultiSePos__12Z2MultiSeMgrFP3Vec(Vec*);
void resetMultiSePos__12Z2MultiSeMgrFv(void);
float getPanPower__12Z2MultiSeMgrFv(void);
float getDolbyPower__12Z2MultiSeMgrFv(void);
+
+void __ct__14JAISoundHandleFv(void);
}
extern Z2SeMgr* lbl_80450B88; // Z2SeMgr sInstance
diff --git a/include/Z2AudioLib/Z2SeMgr/asm/func_802AB64C.s b/include/Z2AudioLib/Z2SeMgr/asm/func_802AB64C.s
index e047f08c65..038eacedfd 100644
--- a/include/Z2AudioLib/Z2SeMgr/asm/func_802AB64C.s
+++ b/include/Z2AudioLib/Z2SeMgr/asm/func_802AB64C.s
@@ -4,8 +4,8 @@
/* 802AB658 002A8598 93 E1 00 0C */ stw r31, 0xc(r1)
/* 802AB65C 002A859C 7C 7F 1B 78 */ mr r31, r3
/* 802AB660 002A85A0 93 ED 86 08 */ stw r31, lbl_80450B88-_SDA_BASE_(r13)
-/* 802AB664 002A85A4 3C 80 80 2A */ lis r4, JAISoundHandle@ha
-/* 802AB668 002A85A8 38 84 4A C4 */ addi r4, r4, JAISoundHandle@l
+/* 802AB664 002A85A4 3C 80 80 2A */ lis r4, __ct__14JAISoundHandleFv@ha
+/* 802AB668 002A85A8 38 84 4A C4 */ addi r4, r4, __ct__14JAISoundHandleFv@l
/* 802AB66C 002A85AC 3C A0 80 00 */ lis r5, JAISoundHandle_NS_dtor@ha
/* 802AB670 002A85B0 38 A5 78 38 */ addi r5, r5, JAISoundHandle_NS_dtor@l
/* 802AB674 002A85B4 38 C0 00 04 */ li r6, 4
diff --git a/include/d/d_lib/d_lib.h b/include/d/d_lib/d_lib.h
index bc7e249f2c..a0ca4366c3 100644
--- a/include/d/d_lib/d_lib.h
+++ b/include/d/d_lib/d_lib.h
@@ -1,5 +1,6 @@
#include "JSystem/JKernel/JKRAramArchive/JKRAramArchive.h"
#include "SComponent/c_xyz.h"
+#include "f/f_op/f_op_actor.h"
#include "global.h"
struct STControl_vtable {
@@ -56,8 +57,6 @@ struct CSTControl {
u32 dLib_getEventSwitchNo(int param_1);
-struct fopAc_ac_c;
-
bool dLib_checkActorInRectangle(fopAc_ac_c* param_1, fopAc_ac_c* param_2, cXyz const* param_3,
cXyz const* param_4);
diff --git a/include/d/d_save/d_save_init/d_save_init.h b/include/d/d_save/d_save_init/d_save_init.h
new file mode 100644
index 0000000000..ec2217cee5
--- /dev/null
+++ b/include/d/d_save/d_save_init/d_save_init.h
@@ -0,0 +1,8 @@
+#ifndef __D_SAVE_INIT_H__
+#define __D_SAVE_INIT_H__
+
+extern "C" {
+void setInitEventBit();
+}
+
+#endif \ No newline at end of file
diff --git a/include/functions.h b/include/functions.h
index ce2b01f85f..9db64d5c19 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -505,7 +505,7 @@ void DVDReadDir(void);
class mDoCPd_c;
extern "C" {
-void cAPICPad_recalibrate(void);
+void mDoCPd_c_NS_recalibrate(void);
}
// JSystem/JSupport/JSUList
@@ -705,7 +705,6 @@ void func_8036C740(void);
void func_8036C780(void);
void getRandom_0_1__6Z2CalcFv(void);
void getParamByExp__6Z2CalcFffffffQ26Z2Calc9CurveSign(void);
-void JMath_NS_TRandom_fast_(void);
}
// d_a_horse_static
diff --git a/include/m_Do/m_Do_controller_pad/m_Do_controller_pad.h b/include/m_Do/m_Do_controller_pad/m_Do_controller_pad.h
index fd4d7d0b6a..05b8f1d773 100644
--- a/include/m_Do/m_Do_controller_pad/m_Do_controller_pad.h
+++ b/include/m_Do/m_Do_controller_pad/m_Do_controller_pad.h
@@ -2,7 +2,10 @@
#define __M_DO_CONTROLLER_PAD_H_
#include "JSystem/JUtility/JUTGamePad/JUTGamePad.h"
-#include "global.h"
+#include "SComponent/c_API_controller_pad.h"
+
+extern JUTGamePad* lbl_803DD2D8[4]; // m_Do_controller_pad::mDoCPd_c::m_gamePad
+extern interface_of_controller_pad m_cpadInfo[4]; // m_Do_controller_pad::mDoCPd_c::m_cpadInfo
struct g_HIO_struct {
u32 field_0x0;
@@ -66,49 +69,12 @@ struct g_HIO_struct {
u8 field_0x43;
};
-struct interface_of_controller_pad {
- float stick_x;
- float stick_y;
- float length_from_neutral;
- s16 controlStick_angle;
- u8 field_0xe;
- u8 field_0xf;
- float cStick_x;
- float cStick_y;
- float cStick_length_from_neutral;
- s16 cStick_angle;
- u8 field_0x1e;
- u8 field_0x1f;
- float analog_a;
- float analog_b;
- float trigger_left;
- float trigger_right;
- u32 button_flags;
- u32 field_0x34;
- s8 error_value;
- bool field_0x39;
- bool field_0x3a;
- bool field_0x3b;
- bool field_0x3c;
-};
-
-struct cpadInfo {
- interface_of_controller_pad interface;
- cpadInfo* unk1;
- f32 stickValue;
- s16 stickAngle;
- u8 p2[0x8];
- f32 CstickValue;
- s16 CstickAngle;
- u8 p3[0xE2];
-};
-
struct mDoCPd_c {
void create();
void read();
static void convert(interface_of_controller_pad* controllerInteface, JUTGamePad* gamePad);
static void LRlockCheck(interface_of_controller_pad* controllerInterface);
- void recalibrate(void);
+ static void recalibrate(void);
JUTGamePad* gamePad;
};
diff --git a/include/os/OS.h b/include/os/OS.h
index de2a2191e3..8af2c821a1 100644
--- a/include/os/OS.h
+++ b/include/os/OS.h
@@ -4,6 +4,8 @@
#ifndef __OS_H__
#define __OS_H__
+#include "dolphin/types.h"
+
/* TODO: more structs, and get rid of the ones that are faked! */
struct OSMutex {
diff --git a/include/variables.h b/include/variables.h
index 0a02af6bce..1fb1e4445c 100644
--- a/include/variables.h
+++ b/include/variables.h
@@ -10,8 +10,6 @@ extern char lbl_803739A0[0x310];
extern void* lbl_80451368;
extern u32 _sRumbleSupported;
extern u8 lbl_803C3384;
-struct cpadInfo;
-extern cpadInfo m_cpadInfo;
extern u8 lbl_803A2EF4;
extern u8 lbl_803A2EE0;
extern u8 lbl_80450B19;