mirror of
https://github.com/zeldaret/ss
synced 2026-05-29 08:42:57 -04:00
Naming
This commit is contained in:
+15
-15
@@ -2272,21 +2272,21 @@ fn_80056B90__Q24dPad4ex_cFl = .text:0x80056B90; // type:function size:0x14C
|
||||
fn_80056CE0__Q24dPad4ex_cFl = .text:0x80056CE0; // type:function size:0xBC
|
||||
startMplsCalibration__Q24dPad4ex_cFl = .text:0x80056DA0; // type:function size:0x48
|
||||
workMplsCalibration__Q24dPad4ex_cFl = .text:0x80056DF0; // type:function size:0x60
|
||||
fn_80056E50__Q24dPad4ex_cFv = .text:0x80056E50; // type:function size:0x8
|
||||
getCalibrationWork__Q24dPad4ex_cFv = .text:0x80056E50; // type:function size:0x8
|
||||
stopMplsCalibration__Q24dPad4ex_cFl = .text:0x80056E60; // type:function size:0x4C
|
||||
centerCursor__Q24dPad4ex_cFl = .text:0x80056EB0; // type:function size:0x38
|
||||
gotoStateWaitForConnect__Q24dPad4ex_cFl = .text:0x80056EF0; // type:function size:0xC
|
||||
executeStateWaitForConnect__Q24dPad4ex_cFl = .text:0x80056F00; // type:function size:0x24
|
||||
gotoStateWaitForLeaveHbm__Q24dPad4ex_cFl = .text:0x80056F30; // type:function size:0xC
|
||||
executeStateWaitForLeaveHbm__Q24dPad4ex_cFl = .text:0x80056F40; // type:function size:0xC8
|
||||
gotoState2__Q24dPad4ex_cFl = .text:0x80057010; // type:function size:0x10
|
||||
executeState2__Q24dPad4ex_cFl = .text:0x80057020; // type:function size:0x80
|
||||
gotoState3__Q24dPad4ex_cFl = .text:0x800570A0; // type:function size:0x10
|
||||
executeState3__Q24dPad4ex_cFl = .text:0x800570B0; // type:function size:0x4
|
||||
gotoState4__Q24dPad4ex_cFl = .text:0x800570C0; // type:function size:0x40
|
||||
executeState4__Q24dPad4ex_cFl = .text:0x80057100; // type:function size:0xA8
|
||||
gotoState5__Q24dPad4ex_cFl = .text:0x800571B0; // type:function size:0xC
|
||||
executeState5__Q24dPad4ex_cFl = .text:0x800571C0; // type:function size:0xD4
|
||||
gotoStatePostConnect__Q24dPad4ex_cFl = .text:0x80056F30; // type:function size:0xC
|
||||
executeStatePostConnect__Q24dPad4ex_cFl = .text:0x80056F40; // type:function size:0xC8
|
||||
gotoStateEnableMpls__Q24dPad4ex_cFl = .text:0x80057010; // type:function size:0x10
|
||||
executeStateEnableMpls__Q24dPad4ex_cFl = .text:0x80057020; // type:function size:0x80
|
||||
gotoStateDisconnectWpad__Q24dPad4ex_cFl = .text:0x800570A0; // type:function size:0x10
|
||||
executeStateDisconnectWpad__Q24dPad4ex_cFl = .text:0x800570B0; // type:function size:0x4
|
||||
gotoStateMplsConfigError__Q24dPad4ex_cFl = .text:0x800570C0; // type:function size:0x40
|
||||
executeStateMplsConfigError__Q24dPad4ex_cFl = .text:0x80057100; // type:function size:0xA8
|
||||
gotoStateMplsConfigured__Q24dPad4ex_cFl = .text:0x800571B0; // type:function size:0xC
|
||||
executeStateMplsConfigured__Q24dPad4ex_cFl = .text:0x800571C0; // type:function size:0xD4
|
||||
fn_800572A0__Q24dPad4ex_cFl = .text:0x800572A0; // type:function size:0xC8
|
||||
init__Q34dPad4ex_c5acc_cFv = .text:0x80057370; // type:function size:0x30C
|
||||
getEntryField_0xB40__Q34dPad4ex_c5acc_cFl = .text:0x80057680; // type:function size:0x4C
|
||||
@@ -2321,11 +2321,11 @@ getBatteryLevel__Q24dPad4ex_cFl = .text:0x80058EB0; // type:function size:0x30
|
||||
setInfo__Q24dPad4ex_cFlPC8WPADInfo = .text:0x80058EE0; // type:function size:0x68
|
||||
fn_80058F50__Q24dPad4ex_cFv = .text:0x80058F50; // type:function size:0xC
|
||||
fn_80058F60__Q24dPad4ex_cFv = .text:0x80058F60; // type:function size:0x78
|
||||
fn_80058FE0__Q24dPad4ex_cFv = .text:0x80058FE0; // type:function size:0x8
|
||||
getCurrentCalibrationWork__Q24dPad4ex_cFv = .text:0x80058FE0; // type:function size:0x8
|
||||
fn_80058FF0__Q24dPad4ex_cFv = .text:0x80058FF0; // type:function size:0xC
|
||||
fn_80059000__Q24dPad4ex_cFv = .text:0x80059000; // type:function size:0xC
|
||||
fn_80059010__Q24dPad4ex_cFv = .text:0x80059010; // type:function size:0x90
|
||||
fn_800590A0__Q24dPad4ex_cFv = .text:0x800590A0; // type:function size:0x10
|
||||
needMplsCalibration__Q24dPad4ex_cFv = .text:0x80059010; // type:function size:0x90
|
||||
setCalibrateMpls__Q24dPad4ex_cFv = .text:0x800590A0; // type:function size:0x10
|
||||
fn_800590B0__Q24dPad4ex_cFv = .text:0x800590B0; // type:function size:0x30
|
||||
fn_800590E0__Q24dPad4ex_cFv = .text:0x800590E0; // type:function size:0xC
|
||||
fn_800590F0__Q24dPad4ex_cFv = .text:0x800590F0; // type:function size:0x10
|
||||
@@ -41676,7 +41676,7 @@ sCopyFileBToCurrentAfterRespawn__9dScGame_c = .sbss:0x8057579E; // type:object s
|
||||
sDoSomethingWithFileAOnTransition__9dScGame_c = .sbss:0x8057579F; // type:object size:0x1 data:byte
|
||||
sPreventClearingSomeFlag__9dScGame_c = .sbss:0x805757A0; // type:object size:0x1 data:byte
|
||||
sInstance__9dCsBase_c = .sbss:0x805757A8; // type:object size:0x8 data:4byte
|
||||
C_GAME = .sbss:0x805757B0; // type:object size:0x8 data:4byte
|
||||
sInstance__9dCsGame_c = .sbss:0x805757B0; // type:object size:0x8 data:4byte
|
||||
LINK2__7dAcPy_c = .sbss:0x805757B8; // type:object size:0x4 data:4byte
|
||||
lbl_805757BC = .sbss:0x805757BC; // type:object size:0x1 data:byte
|
||||
lbl_805757C0 = .sbss:0x805757C0; // type:object size:0x4 align:4 data:float
|
||||
|
||||
+22
-22
@@ -79,23 +79,23 @@ public:
|
||||
|
||||
void startMplsCalibration(s32 chan);
|
||||
void workMplsCalibration(s32 chan);
|
||||
f32 fn_80056E50();
|
||||
f32 getCalibrationWork();
|
||||
void stopMplsCalibration(s32 chan);
|
||||
|
||||
void centerCursor(s32 chan);
|
||||
|
||||
void gotoStateWaitForConnect(s32 chan);
|
||||
void executeStateWaitForConnect(s32 chan);
|
||||
void gotoStateWaitForLeaveHbm(s32 chan);
|
||||
void executeStateWaitForLeaveHbm(s32 chan);
|
||||
void gotoState2(s32 chan); // (EnableMPLS)
|
||||
void executeState2(s32 chan);
|
||||
void gotoState3(s32 chan); // (Disconnect)
|
||||
void executeState3(s32 chan); // Sets State to 1
|
||||
void gotoState4(s32 chan);
|
||||
void executeState4(s32 chan);
|
||||
void gotoState5(s32 chan);
|
||||
void executeState5(s32 chan);
|
||||
void gotoStatePostConnect(s32 chan);
|
||||
void executeStatePostConnect(s32 chan);
|
||||
void gotoStateEnableMpls(s32 chan); // (EnableMPLS)
|
||||
void executeStateEnableMpls(s32 chan);
|
||||
void gotoStateDisconnectWpad(s32 chan); // (Disconnect)
|
||||
void executeStateDisconnectWpad(s32 chan);
|
||||
void gotoStateMplsConfigError(s32 chan);
|
||||
void executeStateMplsConfigError(s32 chan);
|
||||
void gotoStateMplsConfigured(s32 chan);
|
||||
void executeStateMplsConfigured(s32 chan);
|
||||
void fn_800572A0(s32 chan); // State Handling
|
||||
|
||||
/**
|
||||
@@ -121,11 +121,11 @@ public:
|
||||
|
||||
static f32 fn_80058F50();
|
||||
static bool fn_80058F60();
|
||||
static f32 fn_80058FE0();
|
||||
static f32 getCurrentCalibrationWork();
|
||||
static void fn_80058FF0();
|
||||
static void fn_80059000();
|
||||
static bool fn_80059010();
|
||||
static void fn_800590A0();
|
||||
static bool needMplsCalibration();
|
||||
static void setCalibrateMpls();
|
||||
static bool fn_800590B0();
|
||||
static bool fn_800590E0();
|
||||
static void fn_800590F0();
|
||||
@@ -162,11 +162,11 @@ public:
|
||||
|
||||
enum ExState_e {
|
||||
EX_STATE_WAITING_FOR_CONNECT = 0,
|
||||
EX_STATE_WAITING_FOR_LEAVE_HBM = 1,
|
||||
EX_STATE_2 = 2,
|
||||
EX_STATE_3 = 3,
|
||||
EX_STATE_4 = 4,
|
||||
EX_STATE_5 = 5,
|
||||
EX_STATE_POST_CONNECT = 1,
|
||||
EX_STATE_ENABLE_MPLS = 2,
|
||||
EX_STATE_DISCONECT_WPAD = 3,
|
||||
EX_STATE_MPLS_CONFIG_ERROR = 4,
|
||||
EX_STATE_MPLS_CONFIGURED = 5,
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
/* 0x0034 */ s32 mWPADDeviceTypeStableTimer;
|
||||
/* 0x0038 */ s32 mConnectedStableTimer;
|
||||
/* 0x003C */ s32 field_0x3C;
|
||||
/* 0x0040 */ f32 field_0x40;
|
||||
/* 0x0040 */ f32 mCalibrationWork;
|
||||
/* 0x0044 */ bool field_0x44;
|
||||
/* 0x0045 */ bool field_0x45;
|
||||
/* 0x0046 */ bool field_0x46;
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
/* 0x0048 */ s32 field_0x48;
|
||||
/* 0x004C */ bool mDidConnect;
|
||||
/* 0x004D */ bool mDidDisconnect;
|
||||
/* 0x004E */ bool mIncorrectDeviceType;
|
||||
/* 0x004E */ bool mNeedMplsCalibration;
|
||||
/* 0x004F */ bool field_0x4F;
|
||||
/* 0x0050 */ bool field_0x50;
|
||||
/* 0x0051 */ u8 field_0x51;
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
/* 0x005B */ bool field_0x5B;
|
||||
/* 0x005C */ mVec2_c field_0x5C;
|
||||
/* 0x0064 */ mVec2_c field_0x64;
|
||||
/* 0x006C */ s32 field_0x6C;
|
||||
/* 0x006C */ s32 mIsWPADDeviceTypeMplsStableTimer;
|
||||
/* 0x0070 */ mAng field_0x70;
|
||||
/* 0x0074 */ mVec3_c field_0x74;
|
||||
/* 0x0080 */ mVec3_c field_0x80;
|
||||
|
||||
@@ -621,6 +621,7 @@ void WPADSetCallbackByKPAD(BOOL isKPAD);
|
||||
|
||||
void WPADSetAutoSleepTime(int min);
|
||||
void WPADSetControllerLastDataUpdateTime(int min);
|
||||
void WPADResetAutoSleepTimeCount(WPADChannel chan);
|
||||
|
||||
void WPADSetAcceptConnection(int);
|
||||
|
||||
|
||||
+91
-68
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/col/c/c_m3d_g_aab.h"
|
||||
#include "d/d_cs_game.h"
|
||||
#include "d/d_gfx.h"
|
||||
#include "d/d_hbm.h"
|
||||
@@ -36,20 +37,28 @@ WPADInfo ex_c::m_info[2][4];
|
||||
|
||||
bool ex_c::m_connected[4];
|
||||
|
||||
// TODO - the SDK decomp uses WPAD error codes for this
|
||||
// callback, but I think they have different semantics.
|
||||
// Refer to https://github.com/doldecomp/sdk_2009-12-11/blob/main/source/kpad/KPAD.c#L3607-L3639
|
||||
// for logic.
|
||||
void control_mpls_callback(s32 idx, s32 code) {
|
||||
switch (code) {
|
||||
case WPAD_ERR_OK: {
|
||||
// Called first
|
||||
case 0: {
|
||||
ex_c::on_0x54(idx);
|
||||
break;
|
||||
}
|
||||
case WPAD_ERR_NO_CONTROLLER: {
|
||||
// Called when Mpls configuration failed - not actually reached?
|
||||
case -1: {
|
||||
ex_c::on_0x55(idx);
|
||||
break;
|
||||
}
|
||||
case WPAD_ERR_BUSY: {
|
||||
// Called when Mpls + Nunchuk configuration failed -- called a bunch of times
|
||||
case -2: {
|
||||
ex_c::on_0x56(idx);
|
||||
break;
|
||||
}
|
||||
// not sure - called last
|
||||
case 1: {
|
||||
ex_c::on_0x57(idx);
|
||||
break;
|
||||
@@ -102,6 +111,8 @@ void setMpls(bool enable, s32 chan) {
|
||||
if (enable) {
|
||||
if (ex_c::m_ex[chan].mMplsEnabled == false) {
|
||||
ex_c::m_ex[chan].mMplsEnabled = true;
|
||||
// WPAD_DEV_MODE_MPLS_PT_FS
|
||||
// i.e. Skyward Sword wants both MotionPlus and Nunchuk
|
||||
KPADEnableMpls(chan, 5);
|
||||
initMpls(chan);
|
||||
}
|
||||
@@ -323,7 +334,7 @@ ex_c::ex_c()
|
||||
mWPADDeviceTypeStableTimer(0),
|
||||
mConnectedStableTimer(0),
|
||||
field_0x3C(0),
|
||||
field_0x40(0.f),
|
||||
mCalibrationWork(0.f),
|
||||
field_0x44(false),
|
||||
field_0x45(false),
|
||||
field_0x46(false),
|
||||
@@ -331,7 +342,7 @@ ex_c::ex_c()
|
||||
field_0x48(0),
|
||||
mDidConnect(false),
|
||||
mDidDisconnect(false),
|
||||
mIncorrectDeviceType(true),
|
||||
mNeedMplsCalibration(true),
|
||||
field_0x4F(false),
|
||||
field_0x50(true),
|
||||
field_0x51(0),
|
||||
@@ -347,7 +358,7 @@ ex_c::ex_c()
|
||||
field_0x5B(false),
|
||||
field_0x5C(0.f, 0.f),
|
||||
field_0x64(0.f, 0.f),
|
||||
field_0x6C(0),
|
||||
mIsWPADDeviceTypeMplsStableTimer(0),
|
||||
field_0x70(0x1200),
|
||||
field_0x74(1.f, 0.f, 0.f),
|
||||
field_0x80(0.f, 1.f, 0.f),
|
||||
@@ -544,11 +555,11 @@ void ex_c::fn_80056B90(s32 chan) {
|
||||
}
|
||||
|
||||
if (!isDeviceTypeMpls(mWPADDeviceTypeStable)) {
|
||||
mIncorrectDeviceType = true;
|
||||
field_0x6C = 0;
|
||||
mNeedMplsCalibration = true;
|
||||
mIsWPADDeviceTypeMplsStableTimer = 0;
|
||||
}
|
||||
if (isDeviceTypeMpls(mWPADDeviceTypeStable) && field_0x6C < 8) {
|
||||
field_0x6C++;
|
||||
if (isDeviceTypeMpls(mWPADDeviceTypeStable) && mIsWPADDeviceTypeMplsStableTimer < 8) {
|
||||
mIsWPADDeviceTypeMplsStableTimer++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +589,7 @@ void ex_c::fn_80056CE0(s32 chan) {
|
||||
void ex_c::startMplsCalibration(s32 chan) {
|
||||
KPADStartMplsCalibration(chan);
|
||||
mIsCalibrating = true;
|
||||
field_0x40 = 1.0f;
|
||||
mCalibrationWork = 1.0f;
|
||||
field_0x48 = 0;
|
||||
}
|
||||
|
||||
@@ -587,20 +598,20 @@ void ex_c::workMplsCalibration(s32 chan) {
|
||||
return;
|
||||
}
|
||||
|
||||
field_0x40 = KPADWorkMplsCalibration(chan);
|
||||
if (field_0x40 == 0.0f) {
|
||||
mCalibrationWork = KPADWorkMplsCalibration(chan);
|
||||
if (mCalibrationWork == 0.0f) {
|
||||
mIsCalibrating = false;
|
||||
field_0x48 = 60;
|
||||
}
|
||||
}
|
||||
|
||||
f32 ex_c::fn_80056E50() {
|
||||
return field_0x40;
|
||||
f32 ex_c::getCalibrationWork() {
|
||||
return mCalibrationWork;
|
||||
}
|
||||
|
||||
void ex_c::stopMplsCalibration(s32 chan) {
|
||||
mIsCalibrating = false;
|
||||
field_0x40 = 0.0f;
|
||||
mCalibrationWork = 0.0f;
|
||||
KPADStopMplsCalibration(chan);
|
||||
field_0x48 = 0;
|
||||
}
|
||||
@@ -616,15 +627,15 @@ void ex_c::gotoStateWaitForConnect(s32 chan) {
|
||||
|
||||
void ex_c::executeStateWaitForConnect(s32 chan) {
|
||||
if (mPad::getCore(chan)->isConnected()) {
|
||||
gotoStateWaitForLeaveHbm(chan);
|
||||
gotoStatePostConnect(chan);
|
||||
}
|
||||
}
|
||||
|
||||
void ex_c::gotoStateWaitForLeaveHbm(s32 chan) {
|
||||
mState = EX_STATE_WAITING_FOR_LEAVE_HBM;
|
||||
void ex_c::gotoStatePostConnect(s32 chan) {
|
||||
mState = EX_STATE_POST_CONNECT;
|
||||
}
|
||||
|
||||
void ex_c::executeStateWaitForLeaveHbm(s32 chan) {
|
||||
void ex_c::executeStatePostConnect(s32 chan) {
|
||||
if (dHbm::Manage_c::GetInstance()->getState() == dHbm::Manage_c::HBM_MANAGE_ACTIVE) {
|
||||
// If we are in HBM, set some sort of cooldown
|
||||
mOutOfHbmStableTimer = 110;
|
||||
@@ -634,8 +645,8 @@ void ex_c::executeStateWaitForLeaveHbm(s32 chan) {
|
||||
if (mPad::getCore(chan)->isConnected()) {
|
||||
if (ex_c::checkWPADProbeStable() &&
|
||||
dHbm::Manage_c::GetInstance()->getState() != dHbm::Manage_c::HBM_MANAGE_ACTIVE) {
|
||||
// If we're not in HBM anymore, advance state
|
||||
gotoState2(chan);
|
||||
// Enable Mpls after we leave HBM
|
||||
gotoStateEnableMpls(chan);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,45 +655,45 @@ void ex_c::executeStateWaitForLeaveHbm(s32 chan) {
|
||||
}
|
||||
}
|
||||
|
||||
void ex_c::gotoState2(s32 chan) {
|
||||
mState = EX_STATE_2;
|
||||
void ex_c::gotoStateEnableMpls(s32 chan) {
|
||||
mState = EX_STATE_ENABLE_MPLS;
|
||||
setMpls(true, chan);
|
||||
}
|
||||
|
||||
void ex_c::executeState2(s32 chan) {
|
||||
void ex_c::executeStateEnableMpls(s32 chan) {
|
||||
if (fn_80059350(chan) || fn_80059370(chan)) {
|
||||
gotoState4(chan);
|
||||
gotoStateMplsConfigError(chan);
|
||||
} else if (fn_80059390(chan)) {
|
||||
gotoState5(chan);
|
||||
gotoStateMplsConfigured(chan);
|
||||
}
|
||||
}
|
||||
|
||||
void ex_c::gotoState3(s32 chan) {
|
||||
mState = EX_STATE_3;
|
||||
void ex_c::gotoStateDisconnectWpad(s32 chan) {
|
||||
mState = EX_STATE_DISCONECT_WPAD;
|
||||
WPADDisconnect(chan);
|
||||
}
|
||||
|
||||
void ex_c::executeState3(s32 chan) {
|
||||
gotoStateWaitForLeaveHbm(chan);
|
||||
void ex_c::executeStateDisconnectWpad(s32 chan) {
|
||||
gotoStatePostConnect(chan);
|
||||
}
|
||||
|
||||
void ex_c::gotoState4(s32 chan) {
|
||||
mState = EX_STATE_4;
|
||||
void ex_c::gotoStateMplsConfigError(s32 chan) {
|
||||
mState = EX_STATE_MPLS_CONFIG_ERROR;
|
||||
setMpls(false, chan);
|
||||
field_0x2288 = 0;
|
||||
}
|
||||
|
||||
void ex_c::executeState4(s32 chan) {
|
||||
void ex_c::executeStateMplsConfigError(s32 chan) {
|
||||
if (fn_80059390(chan)) {
|
||||
if (dHbm::Manage_c::GetInstance()->getState() == dHbm::Manage_c::HBM_MANAGE_ACTIVE) {
|
||||
gotoStateWaitForLeaveHbm(chan);
|
||||
gotoStatePostConnect(chan);
|
||||
} else {
|
||||
gotoState2(chan);
|
||||
gotoStateEnableMpls(chan);
|
||||
}
|
||||
} else {
|
||||
if (dHbm::Manage_c::GetInstance()->getState() != dHbm::Manage_c::HBM_MANAGE_ACTIVE) {
|
||||
if (field_0x2288 > 120) {
|
||||
gotoState3(chan);
|
||||
gotoStateDisconnectWpad(chan);
|
||||
} else {
|
||||
field_0x2288++;
|
||||
}
|
||||
@@ -690,11 +701,11 @@ void ex_c::executeState4(s32 chan) {
|
||||
}
|
||||
}
|
||||
|
||||
void ex_c::gotoState5(s32 chan) {
|
||||
mState = EX_STATE_5;
|
||||
void ex_c::gotoStateMplsConfigured(s32 chan) {
|
||||
mState = EX_STATE_MPLS_CONFIGURED;
|
||||
}
|
||||
|
||||
void ex_c::executeState5(s32 chan) {
|
||||
void ex_c::executeStateMplsConfigured(s32 chan) {
|
||||
if (!mPad::getCore(chan)->isConnected()) {
|
||||
setMpls(false, chan);
|
||||
gotoStateWaitForConnect(chan);
|
||||
@@ -704,7 +715,7 @@ void ex_c::executeState5(s32 chan) {
|
||||
}
|
||||
}
|
||||
if (!mMplsEnabled) {
|
||||
gotoStateWaitForLeaveHbm(chan);
|
||||
gotoStatePostConnect(chan);
|
||||
}
|
||||
|
||||
if (dHbm::Manage_c::GetInstance()->getState() == dHbm::Manage_c::HBM_MANAGE_ACTIVE) {
|
||||
@@ -714,15 +725,15 @@ void ex_c::executeState5(s32 chan) {
|
||||
|
||||
void ex_c::fn_800572A0(s32 chan) {
|
||||
switch (mState) {
|
||||
case EX_STATE_WAITING_FOR_CONNECT: executeStateWaitForConnect(chan); break;
|
||||
case EX_STATE_WAITING_FOR_LEAVE_HBM: executeStateWaitForLeaveHbm(chan); break;
|
||||
case EX_STATE_2: executeState2(chan); break;
|
||||
case EX_STATE_3: executeState3(chan); break;
|
||||
case EX_STATE_4: executeState4(chan); break;
|
||||
case EX_STATE_5: executeState5(chan); break;
|
||||
case EX_STATE_WAITING_FOR_CONNECT: executeStateWaitForConnect(chan); break;
|
||||
case EX_STATE_POST_CONNECT: executeStatePostConnect(chan); break;
|
||||
case EX_STATE_ENABLE_MPLS: executeStateEnableMpls(chan); break;
|
||||
case EX_STATE_DISCONECT_WPAD: executeStateDisconnectWpad(chan); break;
|
||||
case EX_STATE_MPLS_CONFIG_ERROR: executeStateMplsConfigError(chan); break;
|
||||
case EX_STATE_MPLS_CONFIGURED: executeStateMplsConfigured(chan); break;
|
||||
}
|
||||
|
||||
if (mState != EX_STATE_WAITING_FOR_LEAVE_HBM &&
|
||||
if (mState != EX_STATE_POST_CONNECT &&
|
||||
dHbm::Manage_c::GetInstance()->getState() != dHbm::Manage_c::HBM_MANAGE_ACTIVE) {
|
||||
if (mOutOfHbmStableTimer > 0) {
|
||||
mOutOfHbmStableTimer--;
|
||||
@@ -794,7 +805,19 @@ bool ex_c::acc_c::fn_800589F0() {
|
||||
return true;
|
||||
}
|
||||
|
||||
f32 ex_c::acc_c::fn_80058A00() {}
|
||||
f32 ex_c::acc_c::fn_80058A00() {
|
||||
cM3dGAab aab;
|
||||
aab.ClearForMinMax();
|
||||
for (int i = 0; i < 120; i++) {
|
||||
aab.SetMinMax(field_0x000[i]);
|
||||
}
|
||||
|
||||
f32 lenSq = nw4r::math::VEC3LenSq(aab.GetMax() - aab.GetMin()) - 0.017f;
|
||||
if (lenSq < 0.0f) {
|
||||
lenSq = 0.0f;
|
||||
}
|
||||
return lenSq;
|
||||
}
|
||||
|
||||
void ex_c::acc_c::fn_80058AE0(s32 chan, bool) {}
|
||||
|
||||
@@ -828,7 +851,7 @@ bool ex_c::isMissingNunchuk() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_current_ex->mState != EX_STATE_5) {
|
||||
if (m_current_ex->mState != EX_STATE_MPLS_CONFIGURED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -844,7 +867,7 @@ bool ex_c::isMissingNunchuk() {
|
||||
}
|
||||
|
||||
void ex_c::fn_80058C90(s32 chan) {
|
||||
m_ex[chan].field_0x46 = 1;
|
||||
m_ex[chan].field_0x46 = true;
|
||||
m_ex[chan].field_0x3C = 1;
|
||||
}
|
||||
|
||||
@@ -922,7 +945,7 @@ f32 ex_c::fn_80058F50() {
|
||||
}
|
||||
|
||||
bool ex_c::fn_80058F60() {
|
||||
if (m_current_ex->field_0x6C < 8) {
|
||||
if (m_current_ex->mIsWPADDeviceTypeMplsStableTimer < 8) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -930,7 +953,7 @@ bool ex_c::fn_80058F60() {
|
||||
return true;
|
||||
}
|
||||
|
||||
m_current_ex->mIncorrectDeviceType = false;
|
||||
m_current_ex->mNeedMplsCalibration = false;
|
||||
m_current_ex->startMplsCalibration(mPad::getCurrentCoreID());
|
||||
m_current_ex->fn_80058C90(mPad::getCurrentCoreID());
|
||||
initMpls(mPad::getCurrentCoreID());
|
||||
@@ -938,8 +961,8 @@ bool ex_c::fn_80058F60() {
|
||||
return false;
|
||||
}
|
||||
|
||||
f32 ex_c::fn_80058FE0() {
|
||||
return m_current_ex->fn_80056E50();
|
||||
f32 ex_c::getCurrentCalibrationWork() {
|
||||
return m_current_ex->getCalibrationWork();
|
||||
}
|
||||
|
||||
void ex_c::fn_80058FF0() {
|
||||
@@ -950,7 +973,7 @@ void ex_c::fn_80059000() {
|
||||
m_current_ex->centerCursor(mPad::getCurrentCoreID());
|
||||
}
|
||||
|
||||
bool ex_c::fn_80059010() {
|
||||
bool ex_c::needMplsCalibration() {
|
||||
if (!mPad::getCore()->isConnected()) {
|
||||
return false;
|
||||
}
|
||||
@@ -967,27 +990,27 @@ bool ex_c::fn_80059010() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_current_ex->field_0x6C >= 8) {
|
||||
return m_current_ex->mIncorrectDeviceType;
|
||||
if (m_current_ex->mIsWPADDeviceTypeMplsStableTimer >= 8) {
|
||||
return m_current_ex->mNeedMplsCalibration;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ex_c::fn_800590A0() {
|
||||
m_current_ex->mIncorrectDeviceType = true;
|
||||
void ex_c::setCalibrateMpls() {
|
||||
m_current_ex->mNeedMplsCalibration = true;
|
||||
}
|
||||
|
||||
bool ex_c::fn_800590B0() {
|
||||
bool ret = false;
|
||||
switch (m_current_ex->mState) {
|
||||
case EX_STATE_WAITING_FOR_LEAVE_HBM:
|
||||
case EX_STATE_2:
|
||||
case EX_STATE_3:
|
||||
case EX_STATE_4:
|
||||
case EX_STATE_POST_CONNECT:
|
||||
case EX_STATE_ENABLE_MPLS:
|
||||
case EX_STATE_DISCONECT_WPAD:
|
||||
case EX_STATE_MPLS_CONFIG_ERROR:
|
||||
// TODO - one uneliminated dead branch in here
|
||||
ret = m_current_ex->mState == EX_STATE_4 || m_current_ex->mState == EX_STATE_2 ||
|
||||
m_current_ex->mState == EX_STATE_WAITING_FOR_LEAVE_HBM;
|
||||
ret = m_current_ex->mState == EX_STATE_MPLS_CONFIG_ERROR || m_current_ex->mState == EX_STATE_ENABLE_MPLS ||
|
||||
m_current_ex->mState == EX_STATE_POST_CONNECT;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -1095,7 +1118,7 @@ void ex_c::setNoSleep() {
|
||||
|
||||
void ex_c::setAutoSleepTime() {
|
||||
WPADSetAutoSleepTime(5);
|
||||
WPADSetControllerLastDataUpdateTime(0);
|
||||
WPADResetAutoSleepTimeCount(0);
|
||||
}
|
||||
|
||||
} // namespace dPad
|
||||
|
||||
Reference in New Issue
Block a user