Compare commits

..

1 Commits

Author SHA1 Message Date
coah
802960edff cleanup(iplButton): name anim-wait and new-mail anm flags
Rename Button calc busy flag and new-mail animation controls; update
ChannelTitle setter call sites.
2026-10-01 19:09:59 -05:00
5 changed files with 48 additions and 48 deletions

View File

@@ -309,8 +309,8 @@ namespace ipl {
return mbArrowVisible[i];
}
void setUnk_0x105(bool flag) {
unk_0x105 = flag;
void setSuppressNewMailAnm(bool flag) {
mbSuppressNewMailAnm = flag;
}
protected:
@@ -354,7 +354,7 @@ namespace ipl {
ANIM_MAX,
};
int unk_0x54;
int mAnimWait;
layout::Object* mpLayout; // 0x58
nand::LayoutFile* mpLayoutFile; // 0x5C
@@ -373,8 +373,8 @@ namespace ipl {
BOOL mbHovered[BTN_MAX]; // 0xD8
bool unk_0x104;
bool unk_0x105;
bool mbNewMailAnm;
bool mbSuppressNewMailAnm;
utility::timer mTimer; // 0x108
bool mbEnabled; // 0x110

View File

@@ -19,7 +19,7 @@ typedef struct CXUncompContextRL {
u8* outData; // 0x00
int outDataLen; // 0x04
u32 size; // 0x08
u16 length; // 0x0C
u16 unk_0x0C; // 0x0C
u8 unk_0x0e; // 0x0E
u8 unk_0x0f; // 0x0F
} CXUncompContextRL;
@@ -28,7 +28,7 @@ typedef struct CXUncompContextLZ {
u8* outData; // 0x00
int outDataLen; // 0x04
u32 size; // 0x08
int length; // 0x0C
int unk_0x0C; // 0x0C
u8 unk_0x10; // 0x10
u8 unk_0x11; // 0x11
u8 unk_0x12; // 0x12

View File

@@ -8,7 +8,7 @@ void CXInitUncompContextRL(CXUncompContextRL* context, u8* data) {
context->outData = data;
context->outDataLen = 0;
context->unk_0x0e = 0;
context->length = 0;
context->unk_0x0C = 0;
context->unk_0x0f = 8;
context->size = 0;
}
@@ -18,7 +18,7 @@ void CXInitUncompContextLZ(CXUncompContextLZ* context, u8* data) {
context->outDataLen = 0;
context->unk_0x11 = 0;
context->unk_0x12 = 0;
context->length = 0;
context->unk_0x0C = 0;
context->unk_0x10 = 3;
context->unk_0x13 = 8;
context->unk_0x14 = 0;
@@ -66,10 +66,10 @@ CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u3
while (context->outDataLen > 0) {
if (!(context->unk_0x0e & 0x80)) {
while (context->length) {
while (context->unk_0x0C) {
*context->outData++ = *pSrc++;
context->length--;
context->unk_0x0C--;
context->outDataLen--;
size--;
@@ -77,14 +77,14 @@ CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u3
return context->outDataLen;
}
}
} else if (context->length) {
} else if (context->unk_0x0C) {
u8 b = *pSrc++;
size--;
while (context->length) {
while (context->unk_0x0C) {
*context->outData++ = b;
context->length--;
context->unk_0x0C--;
context->outDataLen--;
}
@@ -95,20 +95,20 @@ CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u3
context->unk_0x0e = *pSrc++;
size--;
context->length = context->unk_0x0e & 0x7f;
context->unk_0x0C = context->unk_0x0e & 0x7f;
if (context->unk_0x0e & 0x80) {
context->length += 3;
context->unk_0x0C += 3;
} else {
context->length += 1;
context->unk_0x0C += 1;
}
if (context->length > context->outDataLen) {
if (context->unk_0x0C > context->outDataLen) {
if (!context->size) {
return CX_STREAMING_ERR_BAD_FILE_SIZE;
}
context->length = context->outDataLen;
context->unk_0x0C = context->outDataLen;
}
if (size) {
@@ -205,34 +205,34 @@ CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u3
context->unk_0x10--;
if (!context->unk_0x14) {
context->length = *pSrc++;
context->length += 0x30;
context->unk_0x0C = *pSrc++;
context->unk_0x0C += 0x30;
context->unk_0x10 = 0;
} else {
switch (context->unk_0x10) {
case 2: {
context->length = *pSrc++;
context->unk_0x0C = *pSrc++;
if (context->length >> 4 == 1) {
context->length = (context->length & 0x0F) << 16;
context->length += 0x1110;
} else if (context->length >> 4 == 0) {
context->length = (context->length & 0x0F) << 8;
context->length += 0x110;
if (context->unk_0x0C >> 4 == 1) {
context->unk_0x0C = (context->unk_0x0C & 0x0F) << 16;
context->unk_0x0C += 0x1110;
} else if (context->unk_0x0C >> 4 == 0) {
context->unk_0x0C = (context->unk_0x0C & 0x0F) << 8;
context->unk_0x0C += 0x110;
context->unk_0x10 = 1;
} else {
context->length += 0x10;
context->unk_0x0C += 0x10;
context->unk_0x10 = 0;
}
break;
}
case 1: {
context->length += *pSrc++ << 8;
context->unk_0x0C += *pSrc++ << 8;
break;
}
case 0: {
context->length += *pSrc++;
context->unk_0x0C += *pSrc++;
break;
}
}
@@ -244,26 +244,26 @@ CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u3
}
}
a = (context->length & 0x0F) << 8;
context->length >>= 4;
a = (context->unk_0x0C & 0x0F) << 8;
context->unk_0x0C >>= 4;
a = (a | *pSrc++) + 1;
size--;
context->unk_0x10 = 3;
if (context->length > context->outDataLen) {
if (context->unk_0x0C > context->outDataLen) {
if (!context->size) {
return CX_STREAMING_ERR_BAD_FILE_SIZE;
}
context->length = context->outDataLen;
context->unk_0x0C = context->outDataLen;
}
while (context->length > 0) {
while (context->unk_0x0C > 0) {
*context->outData = context->outData[-a];
context->outData++;
context->outDataLen--;
context->length--;
context->unk_0x0C--;
}
there:

View File

@@ -185,7 +185,7 @@ namespace ipl {
};
// clang-format on
Button::Button(EGG::Heap* heap) : Base(heap), unk_0x54(0), mOptOutBtn(), mSdMenuBtn(), unk_0x104(false), unk_0x105(false), mReservedCmd() {
Button::Button(EGG::Heap* heap) : Base(heap), mAnimWait(0), mOptOutBtn(), mSdMenuBtn(), mbNewMailAnm(false), mbSuppressNewMailAnm(false), mReservedCmd() {
for (int i = 0; i < ARROW_BTN_MAX; i++) {
mbArrowVisible[i] = true;
}
@@ -293,7 +293,7 @@ namespace ipl {
}
void Button::calc() {
switch (unk_0x54) {
switch (mAnimWait) {
case 0: {
if (mReservedCmd.get_current_index() != 0) {
Command popped = mReservedCmd.get_popped_item();
@@ -312,7 +312,7 @@ namespace ipl {
if (!mpButtonAnim[ANIM_SCENE_CHANGE]->isPlaying() && !mpButtonAnim[ANIM_CALENDAR_EXIT]->isPlaying() &&
!mpButtonAnim[ANIM_COMMON_BUTTON]->isPlaying() && !mpButtonAnim[ANIM_TRASH_DELETE]->isPlaying() &&
!mOptOutBtn.mpLayout->isPlaying()) {
unk_0x54 = 0;
mAnimWait = 0;
}
break;
}
@@ -335,7 +335,7 @@ namespace ipl {
mpBalloons[i]->calc();
}
if (unk_0x104 && !unk_0x105 && mTimer()) {
if (mbNewMailAnm && !mbSuppressNewMailAnm && mTimer()) {
startNewMailAnm_();
}
}
@@ -457,7 +457,7 @@ namespace ipl {
bool Button::isActive() const {
bool result = false;
if (isSceneCreated() && unk_0x54 != 1) {
if (isSceneCreated() && mAnimWait != 1) {
result = true;
}
return result;
@@ -668,7 +668,7 @@ namespace ipl {
}
}
unk_0x54 = 1;
mAnimWait = 1;
}
void Button::initArrowAppearance(int arrowType, bool bAppear) {
@@ -752,8 +752,8 @@ namespace ipl {
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMinFrame(scLoopAnmFrame.start);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(scLoopAnmFrame.end);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(1.0f);
unk_0x104 = true;
if (!unk_0x105) {
mbNewMailAnm = true;
if (!mbSuppressNewMailAnm) {
startNewMailAnm_();
}
}
@@ -773,7 +773,7 @@ namespace ipl {
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setMaxFrame(1.0f);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->setSpeed(0.0f);
mpButtonAnim[ANIM_BOARD_BBS_NEW]->play();
unk_0x104 = false;
mbNewMailAnm = false;
}
void Button::enableBtn() {

View File

@@ -449,7 +449,7 @@ namespace ipl {
mpRsoExpHeaps[0] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL);
mpRsoExpHeaps[1] = EGG::ExpHeap::create(0x80000, System::getMem2App(), MEM_HEAP_OPT_THREAD_SAFE | MEM_HEAP_OPT_DEBUG_FILL);
getButton()->setUnk_0x105(true);
getButton()->setSuppressNewMailAnm(true);
}
void ChannelTitle::calcCommon() {
@@ -931,7 +931,7 @@ namespace ipl {
System::getChannelManager()->resetChJumpLoad();
getButton()->setUnk_0x105(false);
getButton()->setSuppressNewMailAnm(false);
}
BOOL ChannelTitle::isResetAcceptable() const {