summaryrefslogtreecommitdiff
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
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>
-rw-r--r--asm/J3DU/J3DUDL.s4
-rw-r--r--asm/JAudio2/JASSeqParser.s2
-rw-r--r--asm/JAudio2/JAUClusterSound.s11
-rw-r--r--asm/JMath/random.s9
-rw-r--r--asm/JSupport/JSUList.s3
-rw-r--r--asm/SComponent/c/API/controller/c_API_controller_pad.s26
-rw-r--r--asm/Z2AudioLib/Z2SpeechMgr2.s2
-rw-r--r--asm/d/file/d_file_select.s4
-rw-r--r--asm/d/menu/d_menu_save.s2
-rw-r--r--asm/d/save/d_save_init.s9
-rw-r--r--asm/m/Do/m_Do_machine.s2
-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
-rw-r--r--libs/JSystem/JAudio2/JAUClusterSound.cpp6
-rw-r--r--libs/JSystem/JMath/random.cpp6
-rw-r--r--libs/SSystem/SComponent/c_API_controller_pad.cpp12
-rw-r--r--libs/Z2AudioLib/Z2Calc.cpp1
-rw-r--r--obj_files.mk9
-rw-r--r--src/d/d_a/d_a_alink.cpp1
-rw-r--r--src/d/d_attention.cpp1
-rw-r--r--src/d/d_camera.cpp1
-rw-r--r--src/d/d_lib.cpp9
-rw-r--r--src/d/d_meter/d_meter_map.cpp1
-rw-r--r--src/d/d_save/d_save.cpp1
-rw-r--r--src/d/d_save/d_save_init.cpp6
-rw-r--r--src/m_Do/m_Do_Reset.cpp1
-rw-r--r--src/m_Do/m_Do_controller_pad.cpp1
-rw-r--r--src/m_Do/m_Do_main.cpp1
38 files changed, 137 insertions, 128 deletions
diff --git a/asm/J3DU/J3DUDL.s b/asm/J3DU/J3DUDL.s
index 008696ea56..0264c1e315 100644
--- a/asm/J3DU/J3DUDL.s
+++ b/asm/J3DU/J3DUDL.s
@@ -2,7 +2,9 @@
.section .text, "ax" # 80273e08
-
+/* only pointed at from vtables afaict, and mislabeled */
+.global getUseMtxNum__11J3DShapeMtxCFv
+getUseMtxNum__11J3DShapeMtxCFv:
/* 80273E08 00270D48 38 60 00 01 */ li r3, 1
/* 80273E0C 00270D4C 4E 80 00 20 */ blr
diff --git a/asm/JAudio2/JASSeqParser.s b/asm/JAudio2/JASSeqParser.s
index 197093c271..f5a5c7aed7 100644
--- a/asm/JAudio2/JASSeqParser.s
+++ b/asm/JAudio2/JASSeqParser.s
@@ -1166,7 +1166,7 @@ lbl_80294D5C:
/* 80294E70 00291DB0 40 82 00 18 */ bne lbl_80294E88
/* 80294E74 00291DB4 38 6D 8C C8 */ addi r3, r13, lbl_80451248-_SDA_BASE_
/* 80294E78 00291DB8 38 80 00 00 */ li r4, 0
-/* 80294E7C 00291DBC 48 0A 4C 69 */ bl JMath_NS_TRandom_fast_
+/* 80294E7C 00291DBC 48 0A 4C 69 */ bl __ct__Q25JMath13TRandom_fast_FUl
/* 80294E80 00291DC0 38 00 00 01 */ li r0, 1
/* 80294E84 00291DC4 98 0D 8C C4 */ stb r0, lbl_80451244-_SDA_BASE_(r13)
lbl_80294E88:
diff --git a/asm/JAudio2/JAUClusterSound.s b/asm/JAudio2/JAUClusterSound.s
deleted file mode 100644
index d687f70f1f..0000000000
--- a/asm/JAudio2/JAUClusterSound.s
+++ /dev/null
@@ -1,11 +0,0 @@
-.include "macros.inc"
-
-.section .text, "ax" # 802a4ac4
-
-
-.global JAISoundHandle
-JAISoundHandle:
-/* 802A4AC4 002A1A04 38 00 00 00 */ li r0, 0
-/* 802A4AC8 002A1A08 90 03 00 00 */ stw r0, 0(r3)
-/* 802A4ACC 002A1A0C 4E 80 00 20 */ blr
-
diff --git a/asm/JMath/random.s b/asm/JMath/random.s
deleted file mode 100644
index 98aa8ad52b..0000000000
--- a/asm/JMath/random.s
+++ /dev/null
@@ -1,9 +0,0 @@
-.include "macros.inc"
-
-.section .text, "ax" # 80339ae4
-
-
-.global JMath_NS_TRandom_fast_
-JMath_NS_TRandom_fast_:
-/* 80339AE4 00336A24 90 83 00 00 */ stw r4, 0(r3)
-/* 80339AE8 00336A28 4E 80 00 20 */ blr
diff --git a/asm/JSupport/JSUList.s b/asm/JSupport/JSUList.s
deleted file mode 100644
index dc797e3536..0000000000
--- a/asm/JSupport/JSUList.s
+++ /dev/null
@@ -1,3 +0,0 @@
-.include "macros.inc"
-
-.section .text, "ax" # 802dbdfc
diff --git a/asm/SComponent/c/API/controller/c_API_controller_pad.s b/asm/SComponent/c/API/controller/c_API_controller_pad.s
deleted file mode 100644
index b099701159..0000000000
--- a/asm/SComponent/c/API/controller/c_API_controller_pad.s
+++ /dev/null
@@ -1,26 +0,0 @@
-.include "macros.inc"
-
-.section .text, "ax" # 8026328c
-
-
-.global cAPICPad_recalibrate
-cAPICPad_recalibrate:
-/* 8026328C 002601CC 94 21 FF F0 */ stwu r1, -0x10(r1)
-/* 80263290 002601D0 7C 08 02 A6 */ mflr r0
-/* 80263294 002601D4 90 01 00 14 */ stw r0, 0x14(r1)
-/* 80263298 002601D8 4B DA 4A DD */ bl recalibrate__8mDoCPd_cFv
-/* 8026329C 002601DC 80 01 00 14 */ lwz r0, 0x14(r1)
-/* 802632A0 002601E0 7C 08 03 A6 */ mtlr r0
-/* 802632A4 002601E4 38 21 00 10 */ addi r1, r1, 0x10
-/* 802632A8 002601E8 4E 80 00 20 */ blr
-
-.global cAPICPad_ANY_BUTTON
-cAPICPad_ANY_BUTTON:
-/* 802632AC 002601EC 54 64 30 32 */ slwi r4, r3, 6
-/* 802632B0 002601F0 3C 60 80 3E */ lis r3, m_cpadInfo@ha
-/* 802632B4 002601F4 38 03 D2 E8 */ addi r0, r3, m_cpadInfo@l
-/* 802632B8 002601F8 7C 60 22 14 */ add r3, r0, r4
-/* 802632BC 002601FC 80 03 00 34 */ lwz r0, 0x34(r3)
-/* 802632C0 00260200 70 03 13 00 */ andi. r3, r0, 0x1300
-/* 802632C4 00260204 4E 80 00 20 */ blr
-
diff --git a/asm/Z2AudioLib/Z2SpeechMgr2.s b/asm/Z2AudioLib/Z2SpeechMgr2.s
index 7480746676..6e108be2fd 100644
--- a/asm/Z2AudioLib/Z2SpeechMgr2.s
+++ b/asm/Z2AudioLib/Z2SpeechMgr2.s
@@ -16,7 +16,7 @@ Z2SpeechMgr2:
/* 802CBC80 002C8BC0 90 03 00 04 */ stw r0, 4(r3)
/* 802CBC84 002C8BC4 38 7F 00 08 */ addi r3, r31, 8
/* 802CBC88 002C8BC8 38 80 00 00 */ li r4, 0
-/* 802CBC8C 002C8BCC 48 06 DE 59 */ bl JMath_NS_TRandom_fast_
+/* 802CBC8C 002C8BCC 48 06 DE 59 */ bl __ct__Q25JMath13TRandom_fast_FUl
/* 802CBC90 002C8BD0 38 7F 00 0C */ addi r3, r31, 0xc
/* 802CBC94 002C8BD4 48 00 13 25 */ bl Z2SpeechStarter
/* 802CBC98 002C8BD8 38 00 00 00 */ li r0, 0
diff --git a/asm/d/file/d_file_select.s b/asm/d/file/d_file_select.s
index ec6e75a76d..86c8b74738 100644
--- a/asm/d/file/d_file_select.s
+++ b/asm/d/file/d_file_select.s
@@ -8132,7 +8132,7 @@ lbl_8018AD20:
/* 8018AD5C 00187C9C B0 1F 03 AC */ sth r0, 0x3ac(r31)
lbl_8018AD60:
/* 8018AD60 00187CA0 38 60 00 00 */ li r3, 0
-/* 8018AD64 00187CA4 48 0D 85 49 */ bl cAPICPad_ANY_BUTTON
+/* 8018AD64 00187CA4 48 0D 85 49 */ bl cAPICPad_ANY_BUTTON__FUl
/* 8018AD68 00187CA8 28 03 00 00 */ cmplwi r3, 0
/* 8018AD6C 00187CAC 40 82 00 10 */ bne lbl_8018AD7C
/* 8018AD70 00187CB0 A8 1F 03 AC */ lha r0, 0x3ac(r31)
@@ -12180,7 +12180,7 @@ lbl_8018E928:
/* 8018E948 0018B888 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8018E94C 0018B88C 7C 7F 1B 78 */ mr r31, r3
/* 8018E950 0018B890 38 60 00 00 */ li r3, 0
-/* 8018E954 0018B894 48 0D 49 59 */ bl cAPICPad_ANY_BUTTON
+/* 8018E954 0018B894 48 0D 49 59 */ bl cAPICPad_ANY_BUTTON__FUl
/* 8018E958 0018B898 28 03 00 00 */ cmplwi r3, 0
/* 8018E95C 0018B89C 41 82 00 40 */ beq lbl_8018E99C
/* 8018E960 0018B8A0 3C 60 80 43 */ lis r3, lbl_80430188@ha
diff --git a/asm/d/menu/d_menu_save.s b/asm/d/menu/d_menu_save.s
index 7b219acb10..0b8e23336f 100644
--- a/asm/d/menu/d_menu_save.s
+++ b/asm/d/menu/d_menu_save.s
@@ -2395,7 +2395,7 @@ lbl_801F1908:
/* 801F1928 001EE868 93 E1 00 0C */ stw r31, 0xc(r1)
/* 801F192C 001EE86C 7C 7F 1B 78 */ mr r31, r3
/* 801F1930 001EE870 38 60 00 00 */ li r3, 0
-/* 801F1934 001EE874 48 07 19 79 */ bl cAPICPad_ANY_BUTTON
+/* 801F1934 001EE874 48 07 19 79 */ bl cAPICPad_ANY_BUTTON__FUl
/* 801F1938 001EE878 28 03 00 00 */ cmplwi r3, 0
/* 801F193C 001EE87C 41 82 00 58 */ beq lbl_801F1994
/* 801F1940 001EE880 3C 60 80 43 */ lis r3, lbl_80430188@ha
diff --git a/asm/d/save/d_save_init.s b/asm/d/save/d_save_init.s
deleted file mode 100644
index 966388af66..0000000000
--- a/asm/d/save/d_save_init.s
+++ /dev/null
@@ -1,9 +0,0 @@
-.include "macros.inc"
-
-.section .text, "ax" # 80035c88
-
-
-.global setInitEventBit
-setInitEventBit:
-/* 80035C88 00032BC8 4E 80 00 20 */ blr
-
diff --git a/asm/m/Do/m_Do_machine.s b/asm/m/Do/m_Do_machine.s
index f6782f536d..bb8b7893d7 100644
--- a/asm/m/Do/m_Do_machine.s
+++ b/asm/m/Do/m_Do_machine.s
@@ -448,7 +448,7 @@ myExceptionCallback:
/* 8000B7DC 0000871C 90 8D 85 94 */ stw r4, lbl_80450B14-_SDA_BASE_(r13)
/* 8000B7E0 00008720 90 6D 85 90 */ stw r3, lbl_80450B10-_SDA_BASE_(r13)
/* 8000B7E4 00008724 4B FF B0 BD */ bl OSReportEnable
-/* 8000B7E8 00008728 48 25 7A A5 */ bl cAPICPad_recalibrate
+/* 8000B7E8 00008728 48 25 7A A5 */ bl cAPICPad_recalibrate__Fv
/* 8000B7EC 0000872C 3C 60 80 37 */ lis r3, lbl_80373DE8@ha
/* 8000B7F0 00008730 38 63 3D E8 */ addi r3, r3, lbl_80373DE8@l
/* 8000B7F4 00008734 38 63 01 19 */ addi r3, r3, 0x119
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;
diff --git a/libs/JSystem/JAudio2/JAUClusterSound.cpp b/libs/JSystem/JAudio2/JAUClusterSound.cpp
index 4bf93c8658..0d86824351 100644
--- a/libs/JSystem/JAudio2/JAUClusterSound.cpp
+++ b/libs/JSystem/JAudio2/JAUClusterSound.cpp
@@ -1 +1,5 @@
-// ok
+#include "JSystem/JAudio2/JAUClusterSound/JAUClusterSound.h"
+
+JAISoundHandle::JAISoundHandle() {
+ this->unk = NULL;
+} \ No newline at end of file
diff --git a/libs/JSystem/JMath/random.cpp b/libs/JSystem/JMath/random.cpp
index 4bf93c8658..e23de54a1f 100644
--- a/libs/JSystem/JMath/random.cpp
+++ b/libs/JSystem/JMath/random.cpp
@@ -1 +1,5 @@
-// ok
+#include "JSystem/JMath/random.h"
+
+JMath::TRandom_fast_::TRandom_fast_(u32 value) {
+ this->value = value;
+} \ No newline at end of file
diff --git a/libs/SSystem/SComponent/c_API_controller_pad.cpp b/libs/SSystem/SComponent/c_API_controller_pad.cpp
index 4bf93c8658..537c488030 100644
--- a/libs/SSystem/SComponent/c_API_controller_pad.cpp
+++ b/libs/SSystem/SComponent/c_API_controller_pad.cpp
@@ -1 +1,11 @@
-// ok
+#include "SComponent/c_API_controller_pad.h"
+#include "m_Do/m_Do_controller_pad/m_Do_controller_pad.h"
+
+void cAPICPad_recalibrate() {
+ mDoCPd_c::recalibrate();
+}
+
+u32 cAPICPad_ANY_BUTTON(u32 pPadId) {
+ interface_of_controller_pad* pad = &m_cpadInfo[pPadId];
+ return pad->mPressedButtonFlags & 0x1300; // TODO: flag
+}
diff --git a/libs/Z2AudioLib/Z2Calc.cpp b/libs/Z2AudioLib/Z2Calc.cpp
index 4ea0436fb3..27985db4b3 100644
--- a/libs/Z2AudioLib/Z2Calc.cpp
+++ b/libs/Z2AudioLib/Z2Calc.cpp
@@ -1,4 +1,5 @@
#include "Z2AudioLib/Z2Calc/Z2calc.h"
+#include "JSystem/JMath/random.h"
// 1 instruction off
#ifdef NONMATCHING
diff --git a/obj_files.mk b/obj_files.mk
index 4874cf065e..94bb84056f 100644
--- a/obj_files.mk
+++ b/obj_files.mk
@@ -88,7 +88,7 @@ TEXT_O_FILES := \
$(BUILD_DIR)/src/d/d_bomb.o \
$(BUILD_DIR)/src/d/d_lib.o \
$(BUILD_DIR)/src/d/d_save/d_save.o \
- $(BUILD_DIR)/asm/d/save/d_save_init.o \
+ $(BUILD_DIR)/src/d/d_save/d_save_init.o \
$(BUILD_DIR)/asm/d/jnt/d_jnt_col.o \
$(BUILD_DIR)/asm/d/a/d_a_obj.o \
$(BUILD_DIR)/asm/d/a/itembase/d_a_itembase_static.o \
@@ -240,7 +240,7 @@ TEXT_O_FILES := \
$(BUILD_DIR)/asm/d/k/d_k_wpillar.o \
$(BUILD_DIR)/asm/DynamicLink.o \
$(BUILD_DIR)/asm/SComponent/c/c_malloc.o \
- $(BUILD_DIR)/asm/SComponent/c/API/controller/c_API_controller_pad.o \
+ $(BUILD_DIR)/libs/SSystem/SComponent/c_API_controller_pad.o \
$(BUILD_DIR)/asm/SComponent/c/API/c_API_graphic.o \
$(BUILD_DIR)/asm/SComponent/c/cc/c_cc_d.o \
$(BUILD_DIR)/asm/SComponent/c/cc/c_cc_s.o \
@@ -384,7 +384,7 @@ TEXT_O_FILES := \
$(BUILD_DIR)/asm/JAudio2/JAUAudioArcLoader.o \
$(BUILD_DIR)/asm/JAudio2/JAUAudioMgr.o \
$(BUILD_DIR)/asm/JAudio2/JAUBankTable.o \
- $(BUILD_DIR)/asm/JAudio2/JAUClusterSound.o \
+ $(BUILD_DIR)/libs/JSystem/JAudio2/JAUClusterSound.o \
$(BUILD_DIR)/asm/JAudio2/JAUInitializer.o \
$(BUILD_DIR)/asm/JAudio2/JAUSectionHeap.o \
$(BUILD_DIR)/asm/JAudio2/JAUSeqCollection.o \
@@ -459,7 +459,6 @@ TEXT_O_FILES := \
$(BUILD_DIR)/libs/JSystem/JKernel/JKRDvdAramRipper.o \
$(BUILD_DIR)/asm/JKernel/JKRDvdAramRipper.o \
$(BUILD_DIR)/libs/JSystem/JKernel/JKRDecomp.o \
- $(BUILD_DIR)/asm/JSupport/JSUList.o \
$(BUILD_DIR)/libs/JSystem/JSupport/JSUList.o \
$(BUILD_DIR)/asm/JSupport/JSUInputStream.o \
$(BUILD_DIR)/asm/JSupport/JSUMemoryStream.o \
@@ -540,7 +539,7 @@ TEXT_O_FILES := \
$(BUILD_DIR)/asm/J3DGraphLoader/J3DShapeFactory.o \
$(BUILD_DIR)/asm/J3DGraphLoader/J3DAnmLoader.o \
$(BUILD_DIR)/asm/JMath/JMath.o \
- $(BUILD_DIR)/asm/JMath/random.o \
+ $(BUILD_DIR)/libs/JSystem/JMath/random.o \
$(BUILD_DIR)/asm/JMath/JMATrigonometric.o \
$(BUILD_DIR)/asm/base/PPCArch.o \
$(BUILD_DIR)/asm/os/OS.o \
diff --git a/src/d/d_a/d_a_alink.cpp b/src/d/d_a/d_a_alink.cpp
index fe0e09956f..1c71ed7942 100644
--- a/src/d/d_a/d_a_alink.cpp
+++ b/src/d/d_a/d_a_alink.cpp
@@ -6,6 +6,7 @@
#include "Z2AudioLib/Z2SeqMgr/Z2SeqMgr.h"
#include "f/f_pc/f_pc_manager.h"
#include "f/f_pc/f_pc_searcher.h"
+#include "m_Do/m_Do_controller_pad/m_Do_controller_pad.h"
u32 daAlink_c::getE3Zhint(void) {
return 0;
diff --git a/src/d/d_attention.cpp b/src/d/d_attention.cpp
index f84860ad82..f64c11b78c 100644
--- a/src/d/d_attention.cpp
+++ b/src/d/d_attention.cpp
@@ -5,6 +5,7 @@
#include "d/d_com/d_com_inf_game/d_com_inf_game.h"
#include "f/f_pc/f_pc_searcher.h"
#include "global.h"
+#include "m_Do/m_Do_controller_pad/m_Do_controller_pad.h"
extern "C" {
// padLockButton__25@unnamed@d_attention_cpp@Fl
diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp
index 5c7148f9e2..45c0cb84bc 100644
--- a/src/d/d_camera.cpp
+++ b/src/d/d_camera.cpp
@@ -7,6 +7,7 @@
#include "d/d_com/d_com_inf_game/d_com_inf_game.h"
#include "f/f_pc/f_pc_searcher.h"
#include "global.h"
+#include "m_Do/m_Do_controller_pad/m_Do_controller_pad.h"
extern "C" {
// limitf__22@unnamed@d_camera_cpp@Ffff
diff --git a/src/d/d_lib.cpp b/src/d/d_lib.cpp
index a341f4a556..6e4faf0575 100644
--- a/src/d/d_lib.cpp
+++ b/src/d/d_lib.cpp
@@ -1,6 +1,7 @@
#include "d/d_lib/d_lib.h"
#include "JSystem/JUtility/JUTGamePad/JUTGamePad.h"
#include "d/d_event/d_event/d_event.h"
+#include "global.h"
#include "m_Do/m_Do_controller_pad/m_Do_controller_pad.h"
#include "os/OS.h"
@@ -63,19 +64,19 @@ asm void STControl::Yinit(void) {
#endif
double STControl::getValueStick() {
- return m_cpadInfo.interface.length_from_neutral;
+ return (double)m_cpadInfo[0].mMainStickValue;
}
s16 STControl::getAngleStick() {
- return m_cpadInfo.interface.controlStick_angle;
+ return m_cpadInfo[0].mMainStickAngle;
}
double CSTControl::getValueStick() {
- return m_cpadInfo.interface.cStick_length_from_neutral;
+ return (double)m_cpadInfo[0].mCStickValue;
}
s16 CSTControl::getAngleStick() {
- return m_cpadInfo.interface.cStick_angle;
+ return m_cpadInfo[0].mCStickAngle;
}
asm u32 STControl::checkTrigger() {
diff --git a/src/d/d_meter/d_meter_map.cpp b/src/d/d_meter/d_meter_map.cpp
index 0987b7bc1a..0b80e48859 100644
--- a/src/d/d_meter/d_meter_map.cpp
+++ b/src/d/d_meter/d_meter_map.cpp
@@ -3,6 +3,7 @@
#include "Z2AudioLib/Z2SeMgr/Z2SeMgr.h"
#include "d/d_com/d_com_inf_game/d_com_inf_game.h"
#include "global.h"
+#include "m_Do/m_Do_controller_pad/m_Do_controller_pad.h"
extern "C" {
// isEnableDispMap__11dMeterMap_cFv
diff --git a/src/d/d_save/d_save.cpp b/src/d/d_save/d_save.cpp
index 146a8d9411..731b006853 100644
--- a/src/d/d_save/d_save.cpp
+++ b/src/d/d_save/d_save.cpp
@@ -1,6 +1,7 @@
#include "d/d_save/d_save/d_save.h"
#include "d/d_com/d_com_inf_game/d_com_inf_game.h"
+#include "d/d_save/d_save_init/d_save_init.h"
#include "os/OS.h"
u8 dSv_item_rename(u8 item_id) {
diff --git a/src/d/d_save/d_save_init.cpp b/src/d/d_save/d_save_init.cpp
index 4bf93c8658..a6abb16008 100644
--- a/src/d/d_save/d_save_init.cpp
+++ b/src/d/d_save/d_save_init.cpp
@@ -1 +1,5 @@
-// ok
+#include "d/d_save/d_save_init/d_save_init.h"
+
+void setInitEventBit() {
+ return;
+} \ No newline at end of file
diff --git a/src/m_Do/m_Do_Reset.cpp b/src/m_Do/m_Do_Reset.cpp
index fc2e52f793..cd4123a595 100644
--- a/src/m_Do/m_Do_Reset.cpp
+++ b/src/m_Do/m_Do_Reset.cpp
@@ -1,5 +1,6 @@
#include "m_Do/m_Do_reset/m_Do_reset.h"
#include "JSystem/JUtility/JUTXfb/JUTXfb.h"
+#include "SComponent/c_API_controller_pad.h"
#include "dvd/dvd.h"
#include "global.h"
diff --git a/src/m_Do/m_Do_controller_pad.cpp b/src/m_Do/m_Do_controller_pad.cpp
index a79db0473e..649bd56044 100644
--- a/src/m_Do/m_Do_controller_pad.cpp
+++ b/src/m_Do/m_Do_controller_pad.cpp
@@ -6,6 +6,7 @@
#include "pad/pad.h"
#ifdef NONMATCHING
+// TODO: change the cpadinfo stuff to use the new type of m_cpadInfo
void mDoCPd_c::create() {
JUTGamePad* JUTGamePad_ptr;
cpadInfo* m_cpadInfo_addr;
diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp
index 46c3e9ac4b..3d0babdfa8 100644
--- a/src/m_Do/m_Do_main.cpp
+++ b/src/m_Do/m_Do_main.cpp
@@ -1,4 +1,5 @@
#include "m_Do/m_Do_main/m_Do_main.h"
+#include "SComponent/c_API_controller_pad.h"
#include "d/d_com/d_com_inf_game/d_com_inf_game.h"
#include "dvd/dvd.h"
#include "global.h"