Compare commits
2 Commits
cleanup/nw
...
cleanup/ip
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
802960edff | ||
|
|
e5f4e0e1f4 |
@@ -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
|
||||
|
||||
@@ -322,6 +322,8 @@ pf_s32 PFCLUSTER_CombineFiles(PFCLUSTER_ENT_ITER* p_first_iter, PFCLUSTER_ENT_IT
|
||||
pf_u32 first_spare_clusters;
|
||||
pf_u32 second_spare_clusters;
|
||||
pf_u32 excess_clusters;
|
||||
pf_s32 second_allocated_clusters;
|
||||
pf_u32 capacity_clusters;
|
||||
pf_u32 first_end_cluster;
|
||||
pf_u32 first_spare_cluster;
|
||||
pf_u32 second_spare_cluster;
|
||||
@@ -370,8 +372,10 @@ pf_s32 PFCLUSTER_CombineFiles(PFCLUSTER_ENT_ITER* p_first_iter, PFCLUSTER_ENT_IT
|
||||
if (*p_second_iter->ffd.p_start_cluster != 0) {
|
||||
second_spare_clusters = p_second_iter->ffd.last_cluster.max_chain_index + 1 - second_used_clusters;
|
||||
}
|
||||
if (-1U / cluster_size + 1 < (second_used_clusters + second_spare_clusters) + first_used_clusters) {
|
||||
excess_clusters = (second_used_clusters + second_spare_clusters) + first_used_clusters - (-1U / cluster_size + 1);
|
||||
second_allocated_clusters = second_used_clusters + second_spare_clusters;
|
||||
capacity_clusters = -1U / cluster_size + 1;
|
||||
if (capacity_clusters < first_used_clusters + second_allocated_clusters) {
|
||||
excess_clusters = first_used_clusters + second_allocated_clusters - capacity_clusters;
|
||||
err = PFFAT_TraceClustersChain(&p_second_iter->ffd, second_spare_cluster,
|
||||
cluster_size * ((p_second_iter->ffd.last_cluster.max_chain_index + 1 - excess_clusters) - second_used_clusters),
|
||||
&end_cluster, &spare_cluster);
|
||||
@@ -534,7 +538,7 @@ pf_s32 PFCLUSTER_DivideFile(PFCLUSTER_ENT_ITER* p_source_iter, PFCLUSTER_ENT_ITE
|
||||
|
||||
pf_s32 PFCLUSTER_InsertCluster(PFCLUSTER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent,
|
||||
pf_u32 cluster_index, pf_u32 num_clusters, pf_u32* p_inserted_clusters) {
|
||||
pf_s32 err;
|
||||
pf_u32 requested_size;
|
||||
pf_u32 previous_cluster;
|
||||
pf_u32 next_cluster;
|
||||
pf_u32 success_size;
|
||||
@@ -544,7 +548,7 @@ pf_s32 PFCLUSTER_InsertCluster(PFCLUSTER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent,
|
||||
pf_u32 allocated_size;
|
||||
pf_u32 first_cluster;
|
||||
pf_u32 last_cluster;
|
||||
pf_u32 requested_size;
|
||||
pf_s32 err;
|
||||
pf_u32 file_clusters;
|
||||
pf_u32 remainder;
|
||||
pf_u32 extra_size;
|
||||
|
||||
@@ -44,8 +44,8 @@ typedef struct NWC24MsgObjPrivate {
|
||||
#else
|
||||
NWC24UserId fromId; // 0x20
|
||||
#endif
|
||||
u32 date; // 0x28
|
||||
u32 receivedDate; // 0x2C
|
||||
u32 unk_0x28;
|
||||
u32 unk_0x2C;
|
||||
NWC24Data unk_0x30;
|
||||
NWC24Data unk_0x38;
|
||||
NWC24Data subject; // 0x40
|
||||
|
||||
@@ -783,7 +783,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
|
||||
continue;
|
||||
}
|
||||
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
|
||||
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->date) {
|
||||
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->unk_0x28) {
|
||||
duplicateId = entry->msgId;
|
||||
duplicateOffset = offset;
|
||||
continue;
|
||||
@@ -962,8 +962,8 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
|
||||
entry->crc = msg->unk_0x1C;
|
||||
entry->fromIdHigh = msg->fromIdHigh;
|
||||
entry->fromIdLow = msg->fromIdLow;
|
||||
entry->date = msg->date;
|
||||
entry->receivedDate = msg->receivedDate;
|
||||
entry->date = msg->unk_0x28;
|
||||
entry->receivedDate = msg->unk_0x2C;
|
||||
entry->numTo = msg->numTo;
|
||||
entry->numAttached = msg->numAttached;
|
||||
entry->groupId = msg->groupId;
|
||||
@@ -1009,8 +1009,8 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
|
||||
msg->unk_0x1C = entry->crc;
|
||||
msg->fromIdHigh = entry->fromIdHigh;
|
||||
msg->fromIdLow = entry->fromIdLow;
|
||||
msg->date = entry->date;
|
||||
msg->receivedDate = entry->receivedDate;
|
||||
msg->unk_0x28 = entry->date;
|
||||
msg->unk_0x2C = entry->receivedDate;
|
||||
msg->numTo = entry->numTo;
|
||||
msg->numAttached = entry->numAttached;
|
||||
msg->groupId = entry->groupId;
|
||||
|
||||
@@ -158,7 +158,7 @@ static inline NWC24Err WriteMessageIdField(NWC24MsgObjPrivate* msg) {
|
||||
Mail_memset(buffer, 0, 1024);
|
||||
Mail_strcpy(buffer, "Message-Id: <");
|
||||
Mail_memset(idText, 0, 32);
|
||||
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->date);
|
||||
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->unk_0x28);
|
||||
Mail_strcat(buffer, idText);
|
||||
Mail_strcat(buffer, domain);
|
||||
Mail_strcat(buffer, ">\r\n");
|
||||
@@ -312,7 +312,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
|
||||
}
|
||||
CHECK_WRITE(WriteExtraFields(msg));
|
||||
Mail_memset(MultiPartDivider, 0, 40);
|
||||
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->date, msg->msgId);
|
||||
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->unk_0x28, msg->msgId);
|
||||
buffer = NWC24WorkP->stringWork;
|
||||
Mail_memset(buffer, 0, 1024);
|
||||
Mail_strcpy(buffer, "MIME-Version: 1.0\r\n");
|
||||
@@ -654,9 +654,9 @@ static NWC24Err WriteDateField(NWC24MsgObjPrivate* msg) {
|
||||
date.sec = calendar.sec;
|
||||
if (date.month > 12)
|
||||
return NWC24_ERR_FORMAT;
|
||||
NWC24iDateToMinutes(&msg->date, &date);
|
||||
NWC24iDateToMinutes(&msg->unk_0x28, &date);
|
||||
if (msg->type & 0x1000000)
|
||||
NWC24iMinutesToDate(&date, msg->receivedDate);
|
||||
NWC24iMinutesToDate(&date, msg->unk_0x2C);
|
||||
buffer = NWC24WorkP->stringWork;
|
||||
Mail_memset(buffer, 0, 1024);
|
||||
Mail_sprintf(buffer, "Date: %02d %s %d %02d:%02d:%02d -0000\r\n", date.day, months[date.month - 1], date.year, date.hour, date.min, date.sec);
|
||||
|
||||
@@ -46,9 +46,9 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
msgObj->date = 0;
|
||||
msgObj->unk_0x28 = 0;
|
||||
msgObj->type |= 0x200000;
|
||||
msgObj->receivedDate = 0;
|
||||
msgObj->unk_0x2C = 0;
|
||||
|
||||
NWC24GetMyUserId(&msgObj->fromId);
|
||||
msgObj->numTo = 0;
|
||||
@@ -477,7 +477,7 @@ NWC24Err NWC24GetMsgFromId(const NWC24MsgObj* msg, NWC24UserId* fromId) {
|
||||
NWC24Err NWC24GetMsgDate(const NWC24MsgObj* msg, OSCalendarTime* msgDate) {
|
||||
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
|
||||
|
||||
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->date);
|
||||
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->unk_0x28);
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user