d_pad_manager WIP

This commit is contained in:
robojumper
2025-07-30 21:44:01 +02:00
parent 899f86a571
commit 415873f7b3
15 changed files with 1056 additions and 90 deletions
+5 -1
View File
@@ -250,8 +250,12 @@ d/d_pad.cpp:
d/d_pad_ex.cpp:
.text start:0x80059620 end:0x80059CE0 align:16
d/d_pause_manager.cpp:
d/d_pad_manager.cpp:
.text start:0x80059CE0 end:0x8005B6D4 align:16
.rodata start:0x804DE188 end:0x804DE1E8
.data start:0x8050D458 end:0x8050D620
.sdata start:0x80571C68 end:0x80571C70
.sdata2 start:0x80577008 end:0x80577010
d/d_player_act.cpp:
.text start:0x8005B6E0 end:0x8005CE8C align:16
+53 -53
View File
@@ -2164,7 +2164,7 @@ fn_80052C60__Q27dDvdUnk7FontUnkFv = .text:0x80052C60; // type:function size:0x24
fn_80052C90__Q27dDvdUnk7FontUnkFv = .text:0x80052C90; // type:function size:0x28
fn_80052CC0 = .text:0x80052CC0; // type:function size:0x38
fn_80052D00__Q27dDvdUnk7FontUnkFb = .text:0x80052D00; // type:function size:0x14
fn_80052D20 = .text:0x80052D20; // type:function size:0x30
fn_80052D20__Q27dDvdUnk7FontUnkFv = .text:0x80052D20; // type:function size:0x30
fn_80052D50__Q27dDvdUnk7FontUnkFv = .text:0x80052D50; // type:function size:0x78
fn_80052DD0 = .text:0x80052DD0; // type:function size:0x2C
initDylinkHeap__4dDylFiPC10RelNamePtriPQ23EGG4Heap = .text:0x80052E00; // type:function size:0x1A0
@@ -2320,10 +2320,10 @@ getBatteryLevel__Q24dPad4ex_cFv = .text:0x80058EA0; // type:function size:0x8
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
startCurrentMplsCalibration__Q24dPad4ex_cFv = .text:0x80058F60; // type:function size:0x78
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
stopCurrentMplsCalibration__Q24dPad4ex_cFv = .text:0x80058FF0; // type:function size:0xC
centerCurrentCursor__Q24dPad4ex_cFv = .text:0x80059000; // type:function size:0xC
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
@@ -2407,38 +2407,38 @@ fn_80059B90__4dPadFv = .text:0x80059B90; // type:function size:0x10
getFSAcc__4dPadFv = .text:0x80059BA0; // type:function size:0x120
fn_80059CC0__4dPadFv = .text:0x80059CC0; // type:function size:0x10
fn_80059CD0__4dPadFv = .text:0x80059CD0; // type:function size:0x10
fn_80059CE0 = .text:0x80059CE0; // type:function size:0x2C
fn_80059D10 = .text:0x80059D10; // type:function size:0x44
fn_80059D60 = .text:0x80059D60; // type:function size:0x40
fn_80059DA0 = .text:0x80059DA0; // type:function size:0x24
fn_80059DD0 = .text:0x80059DD0; // type:function size:0x54
fn_80059E30 = .text:0x80059E30; // type:function size:0x60
fn_80059E90 = .text:0x80059E90; // type:function size:0x44
fn_80059EE0 = .text:0x80059EE0; // type:function size:0x2C
fn_80059F10 = .text:0x80059F10; // type:function size:0x2C
fn_80059F40 = .text:0x80059F40; // type:function size:0xC
fn_80059F50 = .text:0x80059F50; // type:function size:0x84
fn_80059FE0 = .text:0x80059FE0; // type:function size:0x68
fn_8005A050 = .text:0x8005A050; // type:function size:0x104
fn_8005A160 = .text:0x8005A160; // type:function size:0x40
fn_8005A1A0 = .text:0x8005A1A0; // type:function size:0x144
fn_8005A2F0 = .text:0x8005A2F0; // type:function size:0x40
fn_8005A330 = .text:0x8005A330; // type:function size:0x174
fn_8005A4B0 = .text:0x8005A4B0; // type:function size:0x8
fn_8005A4C0 = .text:0x8005A4C0; // type:function size:0x188
fn_8005A650 = .text:0x8005A650; // type:function size:0x48
performInitialCalibrationMaybeMaybe = .text:0x8005A6A0; // type:function size:0x2C4
fn_8005A970 = .text:0x8005A970; // type:function size:0x3C
fn_8005A9B0 = .text:0x8005A9B0; // type:function size:0x1D8
fn_8005AB90 = .text:0x8005AB90; // type:function size:0x5C
fn_8005ABF0 = .text:0x8005ABF0; // type:function size:0x374
fn_8005AF70 = .text:0x8005AF70; // type:function size:0x8
fn_8005AF80 = .text:0x8005AF80; // type:function size:0x50C
fn_8005B490 = .text:0x8005B490; // type:function size:0x18
fn_8005B4B0 = .text:0x8005B4B0; // type:function size:0xDC
fn_8005B590 = .text:0x8005B590; // type:function size:0xB0
fn_8005B640 = .text:0x8005B640; // type:function size:0x2C
fn_8005B670 = .text:0x8005B670; // type:function size:0x64
__ct__13dPadManager_cFv = .text:0x80059CE0; // type:function size:0x2C
create__13dPadManager_cFPQ23EGG4Heap = .text:0x80059D10; // type:function size:0x44
__dt__13dPadManager_cFv = .text:0x80059D60; // type:function size:0x40
execute__13dPadManager_cFv = .text:0x80059DA0; // type:function size:0x24
draw__13dPadManager_cFv = .text:0x80059DD0; // type:function size:0x54
init__13dPadManager_cFv = .text:0x80059E30; // type:function size:0x60
buildWindow__13dPadManager_cFv = .text:0x80059E90; // type:function size:0x44
get30SecondsInTicks__13dPadManager_cFv = .text:0x80059EE0; // type:function size:0x2C
get3Point3SecondsInTicks__13dPadManager_cFv = .text:0x80059F10; // type:function size:0x2C
requestMplsCalibration__13dPadManager_cFv = .text:0x80059F40; // type:function size:0xC
executeProc__13dPadManager_cFv = .text:0x80059F50; // type:function size:0x84
ModeRequestNormal__13dPadManager_cFv = .text:0x80059FE0; // type:function size:0x68
ModeProc_Normal__13dPadManager_cFv = .text:0x8005A050; // type:function size:0x104
ModeRequestReconnectPad__13dPadManager_cFv = .text:0x8005A160; // type:function size:0x40
ModeProc_ReconnectPad__13dPadManager_cFv = .text:0x8005A1A0; // type:function size:0x144
ModeRequestAttachMplsAndNunchuk__13dPadManager_cFv = .text:0x8005A2F0; // type:function size:0x40
ModeProc_AttachMplsAndNunchuk__13dPadManager_cFv = .text:0x8005A330; // type:function size:0x174
ModeRequestAttachNunchuk__13dPadManager_cFv = .text:0x8005A4B0; // type:function size:0x8
ModeProc_AttachNunchuk__13dPadManager_cFv = .text:0x8005A4C0; // type:function size:0x188
ModeRequestCalibrating__13dPadManager_cFv = .text:0x8005A650; // type:function size:0x48
ModeProc_Calibrating__13dPadManager_cFv = .text:0x8005A6A0; // type:function size:0x2C4
ModeRequestLowBattery__13dPadManager_cFv = .text:0x8005A970; // type:function size:0x3C
ModeProc_LowBattery__13dPadManager_cFv = .text:0x8005A9B0; // type:function size:0x1D8
ModeRequestPointCenter__13dPadManager_cFv = .text:0x8005AB90; // type:function size:0x5C
ModeProc_PointCenter__13dPadManager_cFv = .text:0x8005ABF0; // type:function size:0x374
ModeRequestCalibrationFail__13dPadManager_cFv = .text:0x8005AF70; // type:function size:0x8
ModeProc_CalibrationFail__13dPadManager_cFv = .text:0x8005AF80; // type:function size:0x50C
ModeRequest__13dPadManager_cFQ213dPadManager_c6Mode_e = .text:0x8005B490; // type:function size:0x18
getPadStatus__13dPadManager_cFv = .text:0x8005B4B0; // type:function size:0xDC
ModeRequestNext__13dPadManager_cFQ213dPadManager_c11PadStatus_e = .text:0x8005B590; // type:function size:0xB0
get1Point5SecondsInTicks__13dPadManager_cFv = .text:0x8005B640; // type:function size:0x2C
isOutOfBattery__13dPadManager_cFv = .text:0x8005B670; // type:function size:0x64
preExecute__17daPlayerActBase_cFv = .text:0x8005B6E0; // type:function size:0x4C
postExecute__17daPlayerActBase_cFQ27fBase_c12MAIN_STATE_e = .text:0x8005B730; // type:function size:0x18
isInEvent__17daPlayerActBase_cFv = .text:0x8005B750; // type:function size:0x24
@@ -8465,27 +8465,27 @@ fn_80150430 = .text:0x80150430; // type:function size:0x34
fn_80150470 = .text:0x80150470; // type:function size:0x1CC
fn_80150640 = .text:0x80150640; // type:function size:0x28
fn_80150670 = .text:0x80150670; // type:function size:0x28
fn_801506A0 = .text:0x801506A0; // type:function size:0x138
__ct__22dLytSystemWindowMain_cFv = .text:0x801506A0; // type:function size:0x138
fn_801507E0 = .text:0x801507E0; // type:function size:0x40
fn_80150820 = .text:0x80150820; // type:function size:0x10C
fn_80150930 = .text:0x80150930; // type:function size:0x78
fn_801509B0 = .text:0x801509B0; // type:function size:0xA0
fn_80150A50 = .text:0x80150A50; // type:function size:0x60
build__22dLytSystemWindowMain_cFv = .text:0x80150930; // type:function size:0x78
calc__22dLytSystemWindowMain_cFv = .text:0x801509B0; // type:function size:0xA0
draw__22dLytSystemWindowMain_cFv = .text:0x80150A50; // type:function size:0x60
fn_80150AB0 = .text:0x80150AB0; // type:function size:0x1A8
fn_80150C60 = .text:0x80150C60; // type:function size:0xC
init__22dLytSystemWindowMain_cFv = .text:0x80150C60; // type:function size:0xC
fn_80150C70 = .text:0x80150C70; // type:function size:0xC
fn_80150C80 = .text:0x80150C80; // type:function size:0x230
fn_80150EB0 = .text:0x80150EB0; // type:function size:0x24
fn_80150EE0 = .text:0x80150EE0; // type:function size:0x24
setProperties__22dLytSystemWindowMain_cFPCcbPCw = .text:0x80150C80; // type:function size:0x230
fn_80150EB0__22dLytSystemWindowMain_cFv = .text:0x80150EB0; // type:function size:0x24
fn_80150EE0__22dLytSystemWindowMain_cFv = .text:0x80150EE0; // type:function size:0x24
fn_80150F10 = .text:0x80150F10; // type:function size:0x14
fn_80150F30 = .text:0x80150F30; // type:function size:0x1C
fn_80150F50 = .text:0x80150F50; // type:function size:0x5C
fn_80150FB0 = .text:0x80150FB0; // type:function size:0x24
fn_80150FE0 = .text:0x80150FE0; // type:function size:0xC
fn_80150FF0 = .text:0x80150FF0; // type:function size:0xC
fn_80151000 = .text:0x80151000; // type:function size:0xC
fn_80150F30__22dLytSystemWindowMain_cFl = .text:0x80150F30; // type:function size:0x1C
requestABtnOut__22dLytSystemWindowMain_cFv = .text:0x80150F50; // type:function size:0x5C
fn_80150FB0__22dLytSystemWindowMain_cFv = .text:0x80150FB0; // type:function size:0x24
fn_80150FE0__22dLytSystemWindowMain_cFv = .text:0x80150FE0; // type:function size:0xC
fn_80150FF0__22dLytSystemWindowMain_cFv = .text:0x80150FF0; // type:function size:0xC
fn_80151000__22dLytSystemWindowMain_cFv = .text:0x80151000; // type:function size:0xC
fn_80151010 = .text:0x80151010; // type:function size:0x1C
fn_80151030 = .text:0x80151030; // type:function size:0x10
isPointerWithinWindow__22dLytSystemWindowMain_cFv = .text:0x80151030; // type:function size:0x10
fn_80151040 = .text:0x80151040; // type:function size:0x90
fn_801510D0 = .text:0x801510D0; // type:function size:0xA0
fn_80151170 = .text:0x80151170; // type:function size:0x1EC
@@ -30797,7 +30797,7 @@ lbl_8050D528 = .data:0x8050D528; // type:object size:0x30
jumptable_8050D558 = .data:0x8050D558; // type:object size:0x54 scope:local
lbl_8050D5AC = .data:0x8050D5AC; // type:object size:0x24
jumptable_8050D5D0 = .data:0x8050D5D0; // type:object size:0x44 scope:local
lbl_8050D614 = .data:0x8050D614; // type:object size:0xC
__vt__13dPadManager_c = .data:0x8050D614; // type:object size:0xC
lbl_8050D620 = .data:0x8050D620; // type:object size:0xC data:string
lbl_8050D62C = .data:0x8050D62C; // type:object size:0xC data:string
lbl_8050D638 = .data:0x8050D638; // type:object size:0xC data:string
@@ -41402,7 +41402,7 @@ HBMHeap__5dHeap = .sbss:0x805751C8; // type:object size:0x4 data:4byte
lbl_805751D0 = .sbss:0x805751D0; // type:object size:0x8 data:4byte
dMain__g_InitialTime = .sbss:0x805751D8; // type:object size:0x8 data:4byte
m_connected__Q24dPad4ex_c = .sbss:0x805751E0; // type:object size:0x4
sInstance__15dPauseManager_c = .sbss:0x805751E8; // type:object size:0x8 data:4byte
sInstance__13dPadManager_c = .sbss:0x805751E8; // type:object size:0x8 data:4byte
LINK_ROT = .sbss:0x805751F0; // type:object size:0x2 data:2byte
LINK_ROT_2 = .sbss:0x805751F4; // type:object size:0x2 data:2byte
lbl_805751F6 = .sbss:0x805751F6; // type:object size:0x1 data:byte
+1 -1
View File
@@ -413,7 +413,7 @@ config.libs = [
Object(NonMatching, "d/d_main.cpp"),
Object(NonMatching, "d/d_pad.cpp"),
Object(Matching, "d/d_pad_ex.cpp"),
Object(NonMatching, "d/d_pause_manager.cpp"),
Object(NonMatching, "d/d_pad_manager.cpp"),
Object(NonMatching, "d/d_player_act.cpp"),
Object(Matching, "d/d_player_mdl.cpp"),
Object(Matching, "d/d_player_guide_colors.cpp"),
+8 -2
View File
@@ -25,10 +25,12 @@ public:
void setField703(bool val) {
field_0x703 = val;
}
void setField704(bool val) {
field_0x704 = val;
}
bool getField704() const {
return field_0x704;
}
void setField705(bool val) {
field_0x705 = val;
}
@@ -41,6 +43,10 @@ public:
return sInstance;
}
void setCursorStickVisible(bool visible) {
mCursorStick.setShouldBeOn(visible);
}
private:
static dCsBase_c *sInstance;
void setCurrentLyt(int lyt);
@@ -55,7 +61,7 @@ private:
/* 0x700 */ mAng field_0x700;
/* 0x702 */ u8 mAlpha;
/* 0x703 */ u8 field_0x703;
/* 0x704 */ u8 field_0x704;
/* 0x704 */ bool field_0x704;
/* 0x705 */ u8 field_0x705;
};
+1
View File
@@ -28,6 +28,7 @@ public:
void fn_80052D50();
void fn_80052C90();
void fn_80052C60();
bool fn_80052D20();
s32 getField_0x24() const {
return field_0x24;
+5
View File
@@ -36,6 +36,11 @@ public:
return sInstance;
}
static void doDrawCapTexture() {
nw4r::ut::Color c(0xFFFFFFFF);
sInstance->drawCapTexture(sInstance->mpTextureBuffer, &c);
}
public:
// clang-format off
static s32 getCurrentScreenWidth() { return g_CurrentScreenWidth_s32; }
+7 -3
View File
@@ -137,10 +137,10 @@ public:
static void setInfo(s32 chan, const WPADInfo *pInfo);
static f32 fn_80058F50();
static bool fn_80058F60();
static bool startCurrentMplsCalibration();
static f32 getCurrentCalibrationWork();
static void fn_80058FF0();
static void fn_80059000();
static void stopCurrentMplsCalibration();
static void centerCurrentCursor();
static bool needMplsCalibration();
static void setCalibrateMpls();
static bool fn_800590B0();
@@ -168,6 +168,10 @@ public:
void getUnifiedWpadStatus(s32 chan);
void calcFSStickDirMask();
void setNoCalibrationNeeded() {
mNeedMplsCalibration = false;
}
static void setNoSleep();
static void setAutoSleepTime();
+108
View File
@@ -0,0 +1,108 @@
#ifndef D_PAD_MANAGER_H
#define D_PAD_MANAGER_H
#include "common.h"
#include "d/lyt/d_lyt_system_window.h"
#include "egg/core/eggHeap.h"
class dPadManager_c {
public:
dPadManager_c();
virtual ~dPadManager_c();
static bool create(EGG::Heap *pHeap);
void init();
bool execute();
bool draw();
static void buildWindow();
static dPadManager_c *GetInstance() {
return sInstance;
}
bool getField_0x25() const {
return field_0x25;
}
void requestMplsCalibration();
private:
typedef void (dPadManager_c::*ModeFunc)();
void executeProc();
static s32 get30SecondsInTicks();
static s32 get3Point3SecondsInTicks();
/* static */ s32 get1Point5SecondsInTicks();
enum Mode_e {
Normal = 0,
ReconnectPad = 1,
AttachMplsAndNunchuk = 2,
AttachNunchuk = 3,
Calibrating = 4,
LowBattery = 5,
PointCenter = 6,
CalibrationFail = 7,
};
enum PadStatus_e {
PAD_DISCONNECTED = 0,
PAD_NO_MPLS = 1,
PAD_NO_NUNCHUK = 2,
PAD_NEED_CALIBRATION = 3,
PAD_CONFIGURING_MPLS = 4,
PAD_NEED_POINT_CENTER = 5,
PAD_NORMAL = 6,
};
void ModeRequestNormal();
void ModeProc_Normal();
void ModeRequestReconnectPad();
void ModeProc_ReconnectPad();
void ModeRequestAttachMplsAndNunchuk();
void ModeProc_AttachMplsAndNunchuk();
void ModeRequestAttachNunchuk();
void ModeProc_AttachNunchuk();
void ModeRequestCalibrating();
void ModeProc_Calibrating();
void ModeRequestLowBattery();
void ModeProc_LowBattery();
void ModeRequestPointCenter();
void ModeProc_PointCenter();
void ModeRequestCalibrationFail();
void ModeProc_CalibrationFail();
void ModeRequest(Mode_e mode);
void ModeRequestNext(PadStatus_e status);
PadStatus_e getPadStatus();
bool isOutOfBattery();
/* 0x04 */ dLytSystemWindowMain_c *mpWindow;
/* 0x08 */ PadStatus_e mPadStatus;
/* 0x0C */ Mode_e mMode;
/* 0x10 */ s32 mStep;
/* 0x14 */ s32 mCalibrationTimer;
/* 0x18 */ s32 mStepTimer;
/* 0x1C */ bool field_0x1C;
/* 0x1D */ bool field_0x1D;
/* 0x1E */ bool field_0x1E;
/* 0x1F */ bool field_0x1F;
/* 0x20 */ bool field_0x20;
/* 0x21 */ bool mCalibrationFinished;
/* 0x22 */ bool field_0x22;
/* 0x23 */ bool field_0x23;
/* 0x24 */ bool field_0x24;
/* 0x25 */ bool field_0x25;
static dPadManager_c *sInstance;
};
#endif
-23
View File
@@ -1,23 +0,0 @@
#ifndef D_PAUSE_H
#define D_PAUSE_H
#include "common.h"
// reference to NSMBW PauseManage_c (im adding back the d)
class dPauseManager_c {
public:
static dPauseManager_c *GetInstance() {
return sInstance;
}
bool getField_0x25() const {
return field_0x25;
}
private:
/* 0x00 */ u8 _00[0x25 - 0x00];
/* 0x25 */ bool field_0x25;
static dPauseManager_c *sInstance;
};
#endif
+4
View File
@@ -11,6 +11,10 @@ public:
static bool draw();
bool dismissManually();
static dLytBattery_c *GetInstance() {
return sInstance;
}
private:
dLytBattery_c() : mStateMgr(*this, sStateID::null) {
sInstance = this;
+57
View File
@@ -3,6 +3,63 @@
#include "common.h"
// TODO - the Main vs not-main split may not make sense here,
// but I don't know what the second class here does
class dLytSystemWindowMain_c {
public:
dLytSystemWindowMain_c();
virtual ~dLytSystemWindowMain_c();
bool draw();
bool build();
bool calc();
void init();
bool setProperties(const char *label, bool, const wchar_t *);
void fn_80150F30(s32 arg);
bool requestABtnOut();
bool fn_80150EB0();
bool fn_80150EE0();
bool fn_80150FB0();
void fn_80150FE0();
void fn_80150FF0();
void fn_80151000();
bool isPointerWithinWindow();
s32 getField_0xDDC() const {
return field_0xDDC;
}
bool getField_0xDF7() const {
return field_0xDF7;
}
bool getField_0xDF8() const {
return field_0xDF8;
}
void setField_0xE03(bool val) {
field_0xE03 = val;
}
void setField_0xE04(bool val) {
field_0xE04 = val;
}
private:
/* 0x004 */ u8 _0x004[0xDDC - 0x004];
/* 0xDDC */ s32 field_0xDDC;
/* 0xDF0 */ u8 _0xDF0[0xDF7 - 0xDE0];
/* 0xDF7 */ bool field_0xDF7;
/* 0xDF8 */ bool field_0xDF8;
/* 0xDF9 */ u8 _0xDF9[0xE03 - 0xDF9];
/* 0xE03 */ bool field_0xE03;
/* 0xE04 */ bool field_0xE04;
};
class dLytSystemWindow_c {
public:
virtual ~dLytSystemWindow_c();
+1
View File
@@ -153,6 +153,7 @@ public:
bool clearSelectedFile();
private:
// TODO - Align with NSMBW ModeInit_ / ModeProc_ naming convention?
void initializeCheckForSave();
void initializeCheckForFreeSpace();
void initializeCreateFiles();
+3 -2
View File
@@ -10,6 +10,7 @@
#include "d/d_hbm.h"
#include "d/d_heap.h"
#include "d/d_message.h"
#include "d/d_pad_manager.h"
#include "d/d_reset.h"
#include "d/d_scene.h"
#include "d/d_sys.h"
@@ -293,13 +294,13 @@ sFPhaseBase::sFPhaseState dScBoot_c::cb7() {
sFPhaseBase::sFPhaseState dScBoot_c::cb8() {
return sFPhaseBase::PHASE_NEXT;
}
extern "C" void fn_80059E90();
sFPhaseBase::sFPhaseState dScBoot_c::cb9() {
dBase_c::createRoot(fProfile::MESSAGE, 0, dBase_c::OTHER);
dBase_c::createRoot(fProfile::C_BASE, 0, dBase_c::OTHER);
dLytSystemWindow_c::create();
SaveMgr::GetInstance()->createSaveMsgWindow();
fn_80059E90();
dPadManager_c::buildWindow();
dLytBattery_c::create();
return sFPhaseBase::PHASE_NEXT;
}
+5 -5
View File
@@ -8,7 +8,7 @@
#include "d/d_gfx.h"
#include "d/d_hbm.h"
#include "d/d_pad_nav.h"
#include "d/d_pause.h"
#include "d/d_pad_manager.h"
#include "d/d_reset.h"
#include "d/d_sc_game.h"
#include "d/lyt/d_lyt_control_game.h"
@@ -228,7 +228,7 @@ void beginPad_BR() {
!dAcPy_c::GetLink()->vt_0x1C0() && !dLytMeter_c::GetMain()->getField_0x1377F()) ||
ex.field_0x22CF) {
if (dLytControlGame_c::getInstance() && dLytControlGame_c::getInstance()->isStateNormal()) {
if (!(dPauseManager_c::GetInstance() && dPauseManager_c::GetInstance()->getField_0x25())) {
if (!(dPadManager_c::GetInstance() && dPadManager_c::GetInstance()->getField_0x25())) {
KPADDisableMplsDpdRevise(0);
KPADDisableMplsAccRevise(0);
}
@@ -1271,7 +1271,7 @@ f32 ex_c::fn_80058F50() {
return m_current_ex->mMotion.fn_80058A00();
}
bool ex_c::fn_80058F60() {
bool ex_c::startCurrentMplsCalibration() {
if (m_current_ex->mIsWPADDeviceTypeMplsStableTimer < 8) {
return true;
}
@@ -1292,11 +1292,11 @@ f32 ex_c::getCurrentCalibrationWork() {
return m_current_ex->getCalibrationWork();
}
void ex_c::fn_80058FF0() {
void ex_c::stopCurrentMplsCalibration() {
m_current_ex->stopMplsCalibration(mPad::getCurrentCoreID());
}
void ex_c::fn_80059000() {
void ex_c::centerCurrentCursor() {
m_current_ex->centerCursor(mPad::getCurrentCoreID());
}
+798
View File
@@ -0,0 +1,798 @@
#include "d/d_pad_manager.h"
#include "common.h"
#include "d/d_cs_base.h"
#include "d/d_dvd_unk.h"
#include "d/d_gfx.h"
#include "d/d_pad.h"
#include "d/d_pad_nav.h"
#include "d/d_sys.h"
#include "d/lyt/d_lyt_battery.h"
#include "d/snd/d_snd_small_effect_mgr.h"
#include "d/snd/d_snd_wzsound.h"
#include "m/m_pad.h"
dPadManager_c::dPadManager_c() {
sInstance = this;
field_0x20 = true;
mpWindow = nullptr;
mCalibrationFinished = false;
field_0x25 = false;
}
bool dPadManager_c::create(EGG::Heap *pHeap) {
new (pHeap) dPadManager_c();
sInstance->init();
return true;
}
dPadManager_c::~dPadManager_c() {}
bool dPadManager_c::execute() {
executeProc();
return true;
}
bool dPadManager_c::draw() {
dGfx_c::doDrawCapTexture();
if (mpWindow != nullptr) {
mpWindow->draw();
}
return true;
}
void dPadManager_c::init() {
field_0x22 = false;
field_0x23 = false;
ModeRequestNormal();
field_0x1E = false;
field_0x1F = false;
if (mpWindow != nullptr) {
mpWindow->init();
}
field_0x24 = false;
}
void dPadManager_c::buildWindow() {
sInstance->mpWindow = new dLytSystemWindowMain_c();
sInstance->mpWindow->build();
}
s32 dPadManager_c::get30SecondsInTicks() {
return 1800 / dSys_c::getFrameRate();
}
s32 dPadManager_c::get3Point3SecondsInTicks() {
return 200 / dSys_c::getFrameRate();
}
void dPadManager_c::requestMplsCalibration() {
mCalibrationFinished = false;
dPad::ex_c::setCalibrateMpls();
}
void dPadManager_c::executeProc() {
static const ModeFunc procs[] = {
&dPadManager_c::ModeProc_Normal,
&dPadManager_c::ModeProc_ReconnectPad,
&dPadManager_c::ModeProc_AttachMplsAndNunchuk,
&dPadManager_c::ModeProc_AttachNunchuk,
&dPadManager_c::ModeProc_Calibrating,
&dPadManager_c::ModeProc_LowBattery,
&dPadManager_c::ModeProc_PointCenter,
&dPadManager_c::ModeProc_CalibrationFail,
};
ModeFunc f = procs[mMode];
if (f != nullptr) {
(this->*f)();
}
if (mpWindow != nullptr) {
mpWindow->calc();
}
}
void dPadManager_c::ModeRequestNormal() {
ModeRequest(Normal);
field_0x1C = false;
field_0x1D = false;
if (dCsBase_c::GetInstance() != nullptr) {
dCsBase_c::GetInstance()->setField704(field_0x22);
if (field_0x23) {
dPadNav::setCursorStickVisible();
} else {
dPadNav::setCursorStickInvisible();
}
}
}
void dPadManager_c::ModeProc_Normal() {
PadStatus_e status = getPadStatus();
if (status == PAD_NORMAL || status == PAD_CONFIGURING_MPLS) {
if (isOutOfBattery() == true) {
field_0x1C = true;
dDvdUnk::FontUnk::GetInstance()->fn_80052C60();
ModeRequestLowBattery();
}
return;
}
// Some sort of error occured
field_0x1C = true;
mPadStatus = status;
dCsBase_c *cs = dCsBase_c::GetInstance();
field_0x22 = cs->getField704();
cs->setField704(false);
cs->setCursorStickVisible(false);
field_0x23 = dPadNav::isCursorStickVisible();
dPadNav::setCursorStickInvisible();
dDvdUnk::FontUnk::GetInstance()->fn_80052C60();
if (status == PAD_DISCONNECTED) {
ModeRequestReconnectPad();
} else if (status == PAD_NO_MPLS) {
ModeRequestAttachMplsAndNunchuk();
} else if (status == PAD_NO_NUNCHUK) {
ModeRequestAttachNunchuk();
} else if (status == PAD_NEED_POINT_CENTER) {
ModeRequestPointCenter();
} else {
ModeRequestCalibrating();
}
}
void dPadManager_c::ModeRequestReconnectPad() {
ModeRequest(ReconnectPad);
field_0x1D = true;
mCalibrationFinished = false;
}
void dPadManager_c::ModeProc_ReconnectPad() {
PadStatus_e status = getPadStatus();
if (status == PAD_NEED_CALIBRATION || status == PAD_CONFIGURING_MPLS) {
status = PAD_NORMAL;
}
switch (mStep) {
case 0:
// "Communications with the Wii Remote have been interrupted. Reconnect the Wii Remote.
// Press (A) without touching the Control Stick."
if (mpWindow->setProperties("SYS_CONT_10", true, nullptr) == true) {
mStep = 1;
}
break;
case 1:
if (mPad::getCore()->isConnected() && mpWindow->requestABtnOut() == true) {
mPad::getCore()->startPatternRumble("***--***--***", 0, false);
mStepTimer = 0;
mStep = 2;
}
break;
case 2:
if (mStepTimer < get3Point3SecondsInTicks()) {
mStepTimer++;
} else if (mpWindow->fn_80150EE0() == true) {
mStep = 3;
}
break;
case 3:
if (mpWindow->getField_0xDF7() == true) {
mStep = 4;
}
break;
case 4: ModeRequestNext(status); break;
}
}
void dPadManager_c::ModeRequestAttachMplsAndNunchuk() {
ModeRequest(AttachMplsAndNunchuk);
field_0x1D = true;
mCalibrationFinished = false;
}
void dPadManager_c::ModeProc_AttachMplsAndNunchuk() {
PadStatus_e status = getPadStatus();
if (status == PAD_NEED_CALIBRATION || status == PAD_CONFIGURING_MPLS) {
status = PAD_NORMAL;
}
switch (mStep) {
case 0:
// "Connect the Wii Remote and Nunchuk to the Wii MotionPlus accessory. Next, wait a few moments without
// touching the Control Stick."
if (mpWindow->setProperties("SYS_CONT_01_02", false, nullptr) == true) {
mpWindow->fn_80150F30(2);
mStep = 1;
}
break;
case 1:
if (mpWindow->getField_0xDF7() == true) {
mStep++;
}
// fall-through
case 2:
if (status == PAD_DISCONNECTED) {
if (mpWindow->fn_80150EE0() == true) {
mStep = 4;
}
} else {
if (dPad::ex_c::isMissingMpls() != true) {
mStep = 3;
mStepTimer = 0;
}
}
break;
case 3:
if (mStepTimer < get3Point3SecondsInTicks()) {
mStepTimer++;
} else if (mpWindow->fn_80150EE0() == true) {
mStep = 4;
mStepTimer = 0;
dPad::ex_c::fn_800590F0();
}
break;
case 4:
if (mpWindow->getField_0xDF7() == true) {
mStep = 5;
}
break;
case 5: ModeRequestNext(status); break;
}
}
void dPadManager_c::ModeRequestAttachNunchuk() {
ModeRequest(AttachNunchuk);
}
void dPadManager_c::ModeProc_AttachNunchuk() {
PadStatus_e status = getPadStatus();
if (status == PAD_NEED_CALIBRATION || status == PAD_CONFIGURING_MPLS) {
status = PAD_NORMAL;
}
switch (mStep) {
case 0:
// "Connect the Nunchuk to the Wii Remote. Once you have connected the Nunchuk, wait a few moments without
// touching the Control Stick."
if (mpWindow->setProperties("SYS_CONT_01_01", false, nullptr) == true) {
mpWindow->fn_80150F30(1);
mStep = 1;
mStepTimer = 0;
}
break;
case 1:
if (mpWindow->getField_0xDF7() == true) {
mStep++;
}
break;
case 2:
if (status == PAD_DISCONNECTED) {
if (mpWindow->fn_80150EE0() == true) {
mStep = 3;
}
} else if (status == PAD_NO_MPLS) {
if (mpWindow->fn_80150EE0() == true) {
mStep = 3;
}
} else if (mStepTimer < get1Point5SecondsInTicks()) {
mStepTimer++;
} else if (dPad::ex_c::isMissingNunchuk() != true && mpWindow->fn_80150EB0() == true) {
mStep = 3;
mStepTimer = 0;
}
break;
case 3:
if (mpWindow->getField_0xDF7() == true) {
mStep = 4;
}
break;
case 4: ModeRequestNext(status); break;
}
}
void dPadManager_c::ModeRequestCalibrating() {
ModeRequest(Calibrating);
mCalibrationTimer = 0;
field_0x1D = true;
mCalibrationFinished = false;
field_0x24 = false;
}
void dPadManager_c::ModeProc_Calibrating() {
PadStatus_e status = getPadStatus();
bool empty = false;
if (status == PAD_NEED_CALIBRATION) {
empty = true;
status = PAD_NORMAL;
}
static const char *s_messages[] = {
"SYS_MPLS_01", // "Now calibrating the Wii MotionPlus. Place the Wii Remote on a flat surface."
"SYS_MPLS_05", // ""
};
switch (mStep) {
case 0: {
s32 idx = 0;
if (empty) {
idx = 1;
}
if (mpWindow->setProperties(s_messages[idx], false, nullptr) == true) {
mpWindow->fn_80150F30(3);
mpWindow->fn_80150FE0();
mpWindow->fn_80151000();
mStep = 1;
mStepTimer = 0;
}
break;
}
case 1:
if (mpWindow->getField_0xDF7() == true) {
mStep++;
}
break;
case 2:
if (status != PAD_NORMAL && status != PAD_CONFIGURING_MPLS) {
mStep = 20;
} else if (mStepTimer < get1Point5SecondsInTicks()) {
mStepTimer++;
} else if (dPad::ex_c::startCurrentMplsCalibration() == false) {
mStep = 3;
mStepTimer = 0;
} else if (mCalibrationTimer >= get30SecondsInTicks() && mpWindow->fn_80150EE0() == true) {
mpWindow->fn_80150FF0();
mStep = 10;
mCalibrationTimer = 0;
} else {
mCalibrationTimer++;
}
break;
case 3:
if (status != PAD_NORMAL) {
dPad::ex_c::stopCurrentMplsCalibration();
mStep = 20;
} else if (!dPad::ex_c::getCurrentCalibrationWork()) {
// okay cool everywhere else we do "== true" and so on
// but here the float is simply converted to bool
// done calibrating
if (mpWindow->fn_80150EE0() == true) {
mStep = 4;
}
} else if (mCalibrationTimer >= get30SecondsInTicks() && mpWindow->fn_80150EE0() == true) {
mpWindow->fn_80150FF0();
mStep = 10;
mCalibrationTimer = 0;
} else {
mCalibrationTimer++;
}
break;
case 4:
if (mpWindow->getField_0xDF7() == true) {
field_0x1D = false;
mCalibrationFinished = true;
ModeRequestPointCenter();
}
break;
case 10:
if (mpWindow->getField_0xDF7() == true) {
ModeRequestCalibrationFail();
}
break;
case 20:
mpWindow->fn_80150FF0();
if (mpWindow->fn_80150EE0() == true) {
mStep = 21;
}
break;
case 21:
if (mpWindow->getField_0xDF7() == true) {
if (status == PAD_CONFIGURING_MPLS) {
mStep = 30;
} else {
ModeRequestNext(status);
}
}
break;
case 30: ModeRequestCalibrationFail(); break;
}
}
void dPadManager_c::ModeRequestLowBattery() {
ModeRequest(LowBattery);
mCalibrationTimer = 0;
field_0x20 = false;
}
void dPadManager_c::ModeProc_LowBattery() {
PadStatus_e status = getPadStatus();
switch (mStep) {
case 0:
// "The Wii Remote battery charge is running low. Please check the HOME Menu."
if (mpWindow->setProperties("SYS_CONT_09", false, nullptr) == true) {
mStep = 1;
mStepTimer = 0;
}
break;
case 1:
if (mpWindow->getField_0xDF7() == true) {
mStep++;
}
break;
case 2:
if (status != PAD_NORMAL) {
mStep = 10;
} else if (mStepTimer < get1Point5SecondsInTicks()) {
mStepTimer++;
} else if (mpWindow->fn_80150FB0() == true) {
mStep = 3;
mStepTimer = 0;
}
break;
case 3:
if (status != PAD_NORMAL) {
mStep = 10;
} else if (mPad::getCore()->downTrigger(mPad::BUTTON_A) && mpWindow->fn_80150EB0() == true) {
mStep = 4;
}
break;
case 4:
if (mpWindow->getField_0xDF7() == true) {
dLytBattery_c::GetInstance()->dismissManually();
ModeRequestNext(status);
}
break;
case 10:
if (mpWindow->fn_80150EE0() == true) {
mStep = 11;
}
break;
case 11:
if (mpWindow->getField_0xDF7() == true) {
dLytBattery_c::GetInstance()->dismissManually();
ModeRequestNext(status);
}
break;
}
}
void dPadManager_c::ModeRequestPointCenter() {
ModeRequest(PointCenter);
field_0x25 = true;
if (field_0x20 == false && dPad::ex_c::getBatteryLevel() >= 2) {
field_0x20 = true;
}
}
void dPadManager_c::ModeProc_PointCenter() {
PadStatus_e status = getPadStatus();
if (status == PAD_NEED_CALIBRATION || status == PAD_CONFIGURING_MPLS) {
status = PAD_NORMAL;
}
switch (mStep) {
case 0:
// "Point the Wii Remote at the screen, and move <pointer icon> to the center."
if (mpWindow->setProperties("SYS_MPLS_02", false, nullptr) == true) {
dCsBase_c::GetInstance()->setField703(true);
dCsBase_c::GetInstance()->setField704(true);
dCsBase_c::GetInstance()->setField705(true);
mStep = 1;
}
break;
case 1:
if (mpWindow->getField_0xDF7() == true) {
mStep++;
}
break;
case 2:
if (status != PAD_NORMAL) {
mStep = 10;
} else if (mpWindow->isPointerWithinWindow() != false &&
// "Press (A)."
mpWindow->setProperties("SYS_MPLS_07", false, nullptr) == true) {
mpWindow->fn_80150FB0();
mPad::getCore()->startPatternRumble("**-*----", 0, false);
mStepTimer = 0;
mStep++;
}
break;
case 3:
if (mpWindow->getField_0xDF7() == true) {
mStep = 5;
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_POINTER_IN);
}
break;
case 4:
if (status != PAD_NORMAL) {
mStep = 10;
} else if (mpWindow->isPointerWithinWindow() == false &&
// "Point the Wii Remote at the screen, and move <pointer icon> to the center."
mpWindow->setProperties("SYS_MPLS_02", false, nullptr) == true) {
mStep = 1;
} else if (mStepTimer < 8) {
mStepTimer++;
} else if (mpWindow->fn_80150FB0() == true) {
mStepTimer = 0;
mStep++;
}
break;
case 5:
if (mpWindow->getField_0xDF8() == true) {
if (status != PAD_NORMAL) {
mStep = 20;
} else if (mpWindow->isPointerWithinWindow() == false &&
// "Point the Wii Remote at the screen, and move <pointer icon> to the center."
mpWindow->setProperties("SYS_MPLS_02", false, nullptr) == true) {
mpWindow->setField_0xE03(true);
mStep = 1;
} else if (mPad::getCore()->downTrigger(mPad::BUTTON_A) != false && mpWindow->fn_80150EB0() == true) {
mStepTimer = 0;
mStep++;
dPad::ex_c::centerCurrentCursor();
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_POINTER_OK);
}
}
break;
case 6:
if (mpWindow->getField_0xDF7() == true) {
field_0x1E = true;
field_0x25 = false;
dCsBase_c::GetInstance()->setField703(false);
dCsBase_c::GetInstance()->setField704(false);
dCsBase_c::GetInstance()->setField705(false);
ModeRequestNormal();
return;
}
break;
case 10:
if (mpWindow->fn_80150EE0() == true) {
mStep = 11;
}
break;
case 11:
if (mpWindow->getField_0xDF7() == true) {
ModeRequestNext(status);
dCsBase_c::GetInstance()->setField703(false);
dCsBase_c::GetInstance()->setField704(false);
dCsBase_c::GetInstance()->setField705(false);
return;
}
break;
case 20:
if (mpWindow->fn_80150EE0() == true) {
mpWindow->setField_0xE03(true);
mStep = 11;
}
break;
}
dCsBase_c::GetInstance()->update();
}
void dPadManager_c::ModeRequestCalibrationFail() {
ModeRequest(CalibrationFail);
}
void dPadManager_c::ModeProc_CalibrationFail() {
PadStatus_e status = getPadStatus();
switch (mStep) {
case 0:
// "Could not successfully complete the calibration check. Run the check again? [1]Check [2]Don't check"
if (mpWindow->setProperties("SYS_MPLS_03", false, nullptr) == true) {
mpWindow->fn_80150F30(4);
mStep = 1;
mStepTimer = 0;
}
break;
case 1:
if (status != PAD_NORMAL && status != PAD_CONFIGURING_MPLS && status != PAD_NEED_CALIBRATION) {
mStep = 14;
} else if (mStepTimer < get1Point5SecondsInTicks()) {
mStepTimer++;
} else if (mPad::getCore()->downTrigger(mPad::BUTTON_A) != false && mpWindow->getField_0xDDC() != 2 &&
mpWindow->fn_80150EE0() == true) {
mStep = 2;
mStepTimer = 0;
}
break;
case 2:
if (mpWindow->getField_0xDF7() == true) {
mStep = 3;
}
break;
case 3:
if (mpWindow->getField_0xDDC() == 0) {
if (
// "If you proceed without finishing calibration, game controls may not work properly. Continue without finishing calibration? [1]Continue [2]Retry check"
mpWindow->setProperties("SYS_MPLS_04", false, nullptr) == true
) {
mStep = 4;
mpWindow->fn_80150F30(4);
}
} else {
mStep = 6;
}
break;
case 4:
if (status != PAD_NORMAL && status != PAD_CONFIGURING_MPLS && status != PAD_NEED_CALIBRATION) {
mStep = 14;
} else if (mPad::getCore()->downTrigger(mPad::BUTTON_A) != false && mpWindow->getField_0xDDC() != 2) {
if (mpWindow->getField_0xDDC() == 0) {
if (mpWindow->fn_80150EE0() == true) {
mStep = 5;
}
} else {
if (mpWindow->fn_80150EB0() == true) {
field_0x1D = false;
dPad::ex_c::getInstance()->setNoCalibrationNeeded();
field_0x24 = true;
field_0x25 = false;
mStep = 16;
}
}
}
break;
case 5:
if (mpWindow->getField_0xDF7() == true) {
mStep = 6;
}
break;
case 6:
// "Now calibrating the Wii MotionPlus. Place the Wii Remote on a flat surface."
if (mpWindow->setProperties("SYS_MPLS_01", false, nullptr) == true) {
mpWindow->fn_80150F30(3);
mpWindow->fn_80150FE0();
mpWindow->fn_80151000();
mCalibrationTimer = 0;
mStep = 7;
}
break;
case 7:
if (mpWindow->getField_0xDF7() == true) {
mStep = 8;
mStepTimer = 0;
}
break;
case 8:
if (status != PAD_NORMAL && status != PAD_NEED_CALIBRATION) {
mStep = 12;
} else if (mStepTimer < get1Point5SecondsInTicks()) {
mStepTimer++;
} else if (dPad::ex_c::startCurrentMplsCalibration() == false) {
mStep = 9;
mStepTimer = 0;
mCalibrationTimer = 0;
} else if (mCalibrationTimer >= get30SecondsInTicks() && mpWindow->fn_80150EE0() == true) {
mpWindow->fn_80150FF0();
mStep = 11;
mCalibrationTimer = 0;
} else {
mCalibrationTimer++;
}
break;
case 9:
if (status != PAD_NORMAL && status != PAD_NEED_CALIBRATION) {
dPad::ex_c::stopCurrentMplsCalibration();
mStep = 12;
} else if (!dPad::ex_c::getCurrentCalibrationWork() && mpWindow->fn_80150EE0() == true) {
// okay cool everywhere else we do "== true" and so on
// but here the float is simply converted to bool
// done calibrating
mStep = 10;
} else if (mCalibrationTimer >= get30SecondsInTicks() && mpWindow->fn_80150EE0() == true) {
mpWindow->fn_80150FF0();
mStep = 11;
mCalibrationTimer = 0;
} else {
mCalibrationTimer++;
}
break;
case 10:
if (mpWindow->getField_0xDF7() == true) {
field_0x1D = false;
mCalibrationFinished = true;
ModeRequestPointCenter();
}
break;
case 11:
if (mpWindow->getField_0xDF7() == true) {
ModeRequestCalibrationFail();
}
break;
case 12:
mpWindow->fn_80150FF0();
if (mpWindow->fn_80150EE0() == true) {
mStep = 13;
}
break;
case 13:
if (mpWindow->getField_0xDF7() == true) {
if (status == PAD_CONFIGURING_MPLS) {
ModeRequestCalibrationFail();
} else {
ModeRequestNext(status);
}
}
break;
case 14:
if (mpWindow->fn_80150EB0() == true) {
mpWindow->setField_0xE04(true);
mStep = 15;
}
break;
case 15:
if (mpWindow->getField_0xDF7() == true) {
ModeRequestNext(status);
}
break;
case 16:
if (mpWindow->getField_0xDF7() == true) {
ModeRequestNext(status);
}
break;
}
}
void dPadManager_c::ModeRequest(Mode_e mode) {
mMode = mode;
mStep = 0;
mStepTimer = 0;
mCalibrationTimer = 0;
}
dPadManager_c::PadStatus_e dPadManager_c::getPadStatus() {
PadStatus_e ret = PAD_NORMAL;
if (dDvdUnk::FontUnk::GetInstance()->fn_80052D20() != true) {
return PAD_NORMAL;
}
if (!mPad::getCore()->isConnected()) {
ret = PAD_DISCONNECTED;
} else if (dPad::ex_c::isMissingMpls() == true || dPad::ex_c::fn_800590E0()) {
ret = PAD_NO_MPLS;
} else if (dPad::ex_c::isMissingNunchuk() == true) {
ret = PAD_NO_NUNCHUK;
} else {
if (mMode == Normal) {
if (dPad::ex_c::needMplsCalibration()) {
ret = PAD_NEED_CALIBRATION;
} else if (field_0x25) {
ret = PAD_NEED_POINT_CENTER;
}
}
if (dPad::ex_c::fn_800590B0()) {
ret = PAD_CONFIGURING_MPLS;
}
}
return ret;
}
void dPadManager_c::ModeRequestNext(PadStatus_e status) {
if (status == PAD_DISCONNECTED) {
ModeRequestReconnectPad();
} else if (status == PAD_NO_MPLS) {
ModeRequestAttachMplsAndNunchuk();
} else if (status == PAD_NO_NUNCHUK) {
ModeRequestAttachNunchuk();
} else if (status == PAD_NEED_CALIBRATION) {
ModeRequestCalibrating();
} else if (field_0x1D == true) {
ModeRequestCalibrating();
} else if (field_0x25 == true) {
ModeRequestPointCenter();
} else if (isOutOfBattery() == true) {
ModeRequestLowBattery();
} else {
ModeRequestNormal();
}
}
s32 dPadManager_c::get1Point5SecondsInTicks() {
return 90 / dSys_c::getFrameRate();
}
bool dPadManager_c::isOutOfBattery() {
if (dDvdUnk::FontUnk::GetInstance()->fn_80052D20() != true) {
return false;
}
if (dPad::ex_c::isOutOfBattery() && field_0x20 == true) {
return true;
}
return false;
}