Compare commits
1 Commits
agent/data
...
agent/cont
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bd34f7bd5 |
@@ -704,7 +704,7 @@ config.libs = [
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
IPLSection("homebutton", [
|
IPLSection("homebutton", [
|
||||||
Object(Equivalent, "homebutton/HBMBase.cpp"),
|
Object(Matching, "homebutton/HBMBase.cpp"),
|
||||||
Object(Matching, "homebutton/HBMAnmController.cpp"),
|
Object(Matching, "homebutton/HBMAnmController.cpp"),
|
||||||
Object(Matching, "homebutton/HBMController.cpp"),
|
Object(Matching, "homebutton/HBMController.cpp"),
|
||||||
Object(Matching, "homebutton/HBMFrameController.cpp"),
|
Object(Matching, "homebutton/HBMFrameController.cpp"),
|
||||||
|
|||||||
@@ -272,20 +272,20 @@ namespace homebutton {
|
|||||||
f32 mFadeOutSeTime; // 0x798
|
f32 mFadeOutSeTime; // 0x798
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int scSoundHeapSize_but2;
|
static const int scSoundHeapSize_but2 = 0x60000;
|
||||||
static const int scSoundHeapSize_but3;
|
static const int scSoundHeapSize_but3 = 0x6f800;
|
||||||
static const int scSoundThreadPrio;
|
static const int scSoundThreadPrio = 4;
|
||||||
static const int scDvdThreadPrio;
|
static const int scDvdThreadPrio = 3;
|
||||||
|
|
||||||
static const int scReConnectTime;
|
static const int scReConnectTime = 3600;
|
||||||
static const int scReConnectTime2;
|
static const int scReConnectTime2 = 3570;
|
||||||
static const int scPadDrawWaitTime;
|
static const int scPadDrawWaitTime = 5;
|
||||||
static const int scGetPadInfoTime;
|
static const int scGetPadInfoTime = 100;
|
||||||
static const int scForcusSEWaitTime;
|
static const int scForcusSEWaitTime = 2;
|
||||||
static const f32 scOnPaneVibTime;
|
static const f32 scOnPaneVibTime;
|
||||||
static const f32 scOnPaneVibWaitTime;
|
static const f32 scOnPaneVibWaitTime;
|
||||||
static const int scWaitStopMotorTime;
|
static const int scWaitStopMotorTime = 30;
|
||||||
static const int scWaitDisConnectTime;
|
static const int scWaitDisConnectTime = 180;
|
||||||
|
|
||||||
static const char* scCursorLytName[res::eCursorLyt_Max];
|
static const char* scCursorLytName[res::eCursorLyt_Max];
|
||||||
static const char* scCursorPaneName;
|
static const char* scCursorPaneName;
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ static MEMAllocator sAllocator;
|
|||||||
static MEMAllocator* spAllocator = &sAllocator;
|
static MEMAllocator* spAllocator = &sAllocator;
|
||||||
|
|
||||||
void* HBMAllocMem(u32 size) {
|
void* HBMAllocMem(u32 size) {
|
||||||
return MEMAllocFromAllocator(spAllocator, size);
|
void* addr = MEMAllocFromAllocator(spAllocator, size);
|
||||||
|
|
||||||
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HBMFreeMem(void* pBlock) {
|
void HBMFreeMem(void* pBlock) {
|
||||||
@@ -124,17 +126,6 @@ BOOL HBMIsReassignedControllers() {
|
|||||||
|
|
||||||
/* THE LOGIC */
|
/* THE LOGIC */
|
||||||
|
|
||||||
extern const f32 lbl_816946D8;
|
|
||||||
extern const f32 lbl_81694748;
|
|
||||||
extern const f32 lbl_81694744;
|
|
||||||
extern const f32 lbl_816946DC;
|
|
||||||
extern const f32 lbl_81694754;
|
|
||||||
extern volatile const f32 lbl_8169474C;
|
|
||||||
extern volatile const f32 lbl_81694750;
|
|
||||||
|
|
||||||
extern const f32 lbl_81694714;
|
|
||||||
extern const f32 lbl_81694710;
|
|
||||||
|
|
||||||
namespace homebutton {
|
namespace homebutton {
|
||||||
static void SimpleSyncCallback(s32 result, s32 num);
|
static void SimpleSyncCallback(s32 result, s32 num);
|
||||||
|
|
||||||
@@ -156,16 +147,6 @@ namespace homebutton {
|
|||||||
|
|
||||||
HomeButton* HomeButton::spHomeButtonObj = NULL;
|
HomeButton* HomeButton::spHomeButtonObj = NULL;
|
||||||
|
|
||||||
const int HomeButton::scReConnectTime = 3600;
|
|
||||||
const int HomeButton::scReConnectTime2 = 3570;
|
|
||||||
const int HomeButton::scPadDrawWaitTime = 5;
|
|
||||||
const int HomeButton::scGetPadInfoTime = 100;
|
|
||||||
const int HomeButton::scForcusSEWaitTime = 2;
|
|
||||||
const f32 HomeButton::scOnPaneVibTime = 3.0f;
|
|
||||||
const f32 HomeButton::scOnPaneVibWaitTime = 9.0f;
|
|
||||||
const int HomeButton::scWaitStopMotorTime = 30;
|
|
||||||
const int HomeButton::scWaitDisConnectTime = 180;
|
|
||||||
|
|
||||||
const char* HomeButton::scCursorLytName[res::eCursorLyt_Max] = {
|
const char* HomeButton::scCursorLytName[res::eCursorLyt_Max] = {
|
||||||
"P1_Def.brlyt",
|
"P1_Def.brlyt",
|
||||||
"P2_Def.brlyt",
|
"P2_Def.brlyt",
|
||||||
@@ -616,8 +597,8 @@ namespace homebutton {
|
|||||||
mpController[i]->initCallback();
|
mpController[i]->initCallback();
|
||||||
mpController[i]->initSound();
|
mpController[i]->initSound();
|
||||||
|
|
||||||
mOnPaneVibFrame[i] = ::lbl_816946D8;
|
mOnPaneVibFrame[i] = 0.0f;
|
||||||
mOnPaneVibWaitFrame[i] = ::lbl_816946D8;
|
mOnPaneVibWaitFrame[i] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,7 +619,7 @@ namespace homebutton {
|
|||||||
|
|
||||||
if (mpSoundArchivePlayer != NULL) {
|
if (mpSoundArchivePlayer != NULL) {
|
||||||
for (i = 0; i < mpSoundArchivePlayer->GetSoundPlayerCount(); i++) {
|
for (i = 0; i < mpSoundArchivePlayer->GetSoundPlayerCount(); i++) {
|
||||||
mpSoundArchivePlayer->GetSoundPlayer(i).SetVolume(::lbl_816946DC);
|
mpSoundArchivePlayer->GetSoundPlayer(i).SetVolume(1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,7 +779,7 @@ namespace homebutton {
|
|||||||
if (mOnPaneVibFrame[i] <= 0.0f || mState == 17) {
|
if (mOnPaneVibFrame[i] <= 0.0f || mState == 17) {
|
||||||
getController(i)->stopMotor();
|
getController(i)->stopMotor();
|
||||||
mOnPaneVibFrame[i] = 0.0f;
|
mOnPaneVibFrame[i] = 0.0f;
|
||||||
mOnPaneVibWaitFrame[i] = scOnPaneVibWaitTime;
|
mOnPaneVibWaitFrame[i] = 9.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (mOnPaneVibWaitFrame[i] > 0.0f) {
|
} else if (mOnPaneVibWaitFrame[i] > 0.0f) {
|
||||||
@@ -1271,20 +1252,6 @@ namespace homebutton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HomeButton::calc_letter() {
|
|
||||||
if (mLetterFlag && !mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->isPlaying()) {
|
|
||||||
mpLayout->GetRootPane()->FindPaneByName(scFuncPaneName[res::eFuncPane_let_icn_00], true)->SetVisible(true);
|
|
||||||
|
|
||||||
mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->setAnmType(ANIM_TYPE_LOOP);
|
|
||||||
|
|
||||||
mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->play();
|
|
||||||
} else if (!mLetterFlag) {
|
|
||||||
mpLayout->GetRootPane()->FindPaneByName(scFuncPaneName[res::eFuncPane_let_icn_00], true)->SetVisible(false);
|
|
||||||
|
|
||||||
mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HomeButton::calc_battery(int chan) {
|
void HomeButton::calc_battery(int chan) {
|
||||||
for (int i = 0; i < res::eBatteryPane_Max; i++) {
|
for (int i = 0; i < res::eBatteryPane_Max; i++) {
|
||||||
if (i < mWpadInfo[chan].battery) {
|
if (i < mWpadInfo[chan].battery) {
|
||||||
@@ -1311,6 +1278,20 @@ namespace homebutton {
|
|||||||
getController(chan)->clrBatteryFlag();
|
getController(chan)->clrBatteryFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HomeButton::calc_letter() {
|
||||||
|
if (mLetterFlag && !mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->isPlaying()) {
|
||||||
|
mpLayout->GetRootPane()->FindPaneByName(scFuncPaneName[res::eFuncPane_let_icn_00], true)->SetVisible(true);
|
||||||
|
|
||||||
|
mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->setAnmType(ANIM_TYPE_LOOP);
|
||||||
|
|
||||||
|
mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->play();
|
||||||
|
} else if (!mLetterFlag) {
|
||||||
|
mpLayout->GetRootPane()->FindPaneByName(scFuncPaneName[res::eFuncPane_let_icn_00], true)->SetVisible(false);
|
||||||
|
|
||||||
|
mpPairGroupAnmController[res::ePairAnm_ltrIcn_on]->stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void HomeButton::draw() {
|
void HomeButton::draw() {
|
||||||
mpLayout->Draw(mDrawInfo);
|
mpLayout->Draw(mDrawInfo);
|
||||||
|
|
||||||
@@ -1475,13 +1456,12 @@ namespace homebutton {
|
|||||||
nw4r::math::VEC3 vec;
|
nw4r::math::VEC3 vec;
|
||||||
|
|
||||||
if (pController->wiiCon[i].use_devtype == WPAD_DEV_CLASSIC && pController->wiiCon[i].kpad->dev_type == WPAD_DEV_CLASSIC) {
|
if (pController->wiiCon[i].use_devtype == WPAD_DEV_CLASSIC && pController->wiiCon[i].kpad->dev_type == WPAD_DEV_CLASSIC) {
|
||||||
vec = nw4r::math::VEC3(lbl_816946D8, lbl_816946D8,
|
vec = nw4r::math::VEC3(0.0f, 0.0f, 15.0f);
|
||||||
*((volatile const f32*)&lbl_81694710));
|
|
||||||
} else {
|
} else {
|
||||||
Vec2 v = pController->wiiCon[i].kpad->horizon;
|
Vec2 v = pController->wiiCon[i].kpad->horizon;
|
||||||
f32 rad = nw4r::math::Atan2FIdx(-v.y, v.x) * lbl_81694714;
|
f32 rad = nw4r::math::Atan2FIdx(-v.y, v.x) * 1.40625f;
|
||||||
|
|
||||||
vec = nw4r::math::VEC3(lbl_816946D8, lbl_816946D8, rad);
|
vec = nw4r::math::VEC3(0.0f, 0.0f, rad);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mpHBInfo->cursor) {
|
if (!mpHBInfo->cursor) {
|
||||||
@@ -1933,8 +1913,8 @@ namespace homebutton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (onFlag && pController != NULL) {
|
if (onFlag && pController != NULL) {
|
||||||
if (!getController(pController->chan)->isRumbling() && mOnPaneVibWaitFrame[pController->chan] <= ::lbl_816946D8) {
|
if (!getController(pController->chan)->isRumbling() && mOnPaneVibWaitFrame[pController->chan] <= 0.0f) {
|
||||||
mOnPaneVibFrame[pController->chan] = ::lbl_81694744;
|
mOnPaneVibFrame[pController->chan] = 3.0f;
|
||||||
getController(pController->chan)->startMotor();
|
getController(pController->chan)->startMotor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2388,10 +2368,10 @@ namespace homebutton {
|
|||||||
void HomeButton::reset_guiManager(int num) {
|
void HomeButton::reset_guiManager(int num) {
|
||||||
if (num < 0) {
|
if (num < 0) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
mpPaneManager->update(i, ::lbl_81694748, ::lbl_81694748, 0, 0, 0, NULL);
|
mpPaneManager->update(i, -10000.0f, -10000.0f, 0, 0, 0, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mpPaneManager->update(num, ::lbl_81694748, ::lbl_81694748, 0, 0, 0, NULL);
|
mpPaneManager->update(num, -10000.0f, -10000.0f, 0, 0, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2500,7 +2480,7 @@ namespace homebutton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scale = nw4r::math::VEC2(::lbl_816946DC, ::lbl_816946DC);
|
scale = nw4r::math::VEC2(1.0f, 1.0f);
|
||||||
mpLayout->GetRootPane()->SetScale(scale);
|
mpLayout->GetRootPane()->SetScale(scale);
|
||||||
|
|
||||||
if (!mpHBInfo->cursor) {
|
if (!mpHBInfo->cursor) {
|
||||||
@@ -2645,14 +2625,9 @@ namespace homebutton {
|
|||||||
|
|
||||||
initgx();
|
initgx();
|
||||||
GXColor clr = {red_, green_, blue_, alpha};
|
GXColor clr = {red_, green_, blue_, alpha};
|
||||||
drawBlackPlate(::lbl_8169474C, ::lbl_8169474C, ::lbl_81694750, ::lbl_81694750, clr);
|
drawBlackPlate(-1000.0f, -1000.0f, 1000.0f, 1000.0f, clr);
|
||||||
}
|
}
|
||||||
|
|
||||||
const int HomeButton::scSoundHeapSize_but2 = 0x60000;
|
|
||||||
const int HomeButton::scSoundHeapSize_but3 = 0x6f800;
|
|
||||||
const int HomeButton::scSoundThreadPrio = 4;
|
|
||||||
const int HomeButton::scDvdThreadPrio = 3;
|
|
||||||
|
|
||||||
void HomeButton::update_sound() {
|
void HomeButton::update_sound() {
|
||||||
if (mpSoundArchivePlayer != NULL) {
|
if (mpSoundArchivePlayer != NULL) {
|
||||||
mpSoundArchivePlayer->Update();
|
mpSoundArchivePlayer->Update();
|
||||||
@@ -2684,7 +2659,7 @@ namespace homebutton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mEndInitSoundFlag) {
|
if (mEndInitSoundFlag) {
|
||||||
AXSetAuxAReturnVolume(lbl_81694754 * gain);
|
AXSetAuxAReturnVolume(32768.0f * gain);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mpSoundArchivePlayer != NULL) {
|
if (mpSoundArchivePlayer != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user