Compare commits

..

1 Commits

Author SHA1 Message Date
coah
4aa7b79d7a cleanup(NWC24MsgObj): rename unk_0x28/2C to date/receivedDate
Evidence from NWC24MBoxCtrl entry->date / entry->receivedDate copies.
2026-10-01 19:08:05 -05:00
8 changed files with 34 additions and 38 deletions

View File

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

View File

@@ -322,8 +322,6 @@ 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;
@@ -372,10 +370,8 @@ 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;
}
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;
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);
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);
@@ -538,7 +534,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_u32 requested_size;
pf_s32 err;
pf_u32 previous_cluster;
pf_u32 next_cluster;
pf_u32 success_size;
@@ -548,7 +544,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_s32 err;
pf_u32 requested_size;
pf_u32 file_clusters;
pf_u32 remainder;
pf_u32 extra_size;

View File

@@ -44,8 +44,8 @@ typedef struct NWC24MsgObjPrivate {
#else
NWC24UserId fromId; // 0x20
#endif
u32 unk_0x28;
u32 unk_0x2C;
u32 date; // 0x28
u32 receivedDate; // 0x2C
NWC24Data unk_0x30;
NWC24Data unk_0x38;
NWC24Data subject; // 0x40

View File

@@ -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->unk_0x28) {
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->date) {
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->unk_0x28;
entry->receivedDate = msg->unk_0x2C;
entry->date = msg->date;
entry->receivedDate = msg->receivedDate;
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->unk_0x28 = entry->date;
msg->unk_0x2C = entry->receivedDate;
msg->date = entry->date;
msg->receivedDate = entry->receivedDate;
msg->numTo = entry->numTo;
msg->numAttached = entry->numAttached;
msg->groupId = entry->groupId;

View File

@@ -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->unk_0x28);
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->date);
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->unk_0x28, msg->msgId);
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->date, 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->unk_0x28, &date);
NWC24iDateToMinutes(&msg->date, &date);
if (msg->type & 0x1000000)
NWC24iMinutesToDate(&date, msg->unk_0x2C);
NWC24iMinutesToDate(&date, msg->receivedDate);
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);

View File

@@ -46,9 +46,9 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
return NWC24_ERR_INVALID_VALUE;
}
msgObj->unk_0x28 = 0;
msgObj->date = 0;
msgObj->type |= 0x200000;
msgObj->unk_0x2C = 0;
msgObj->receivedDate = 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->unk_0x28);
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->date);
return NWC24_OK;
}

View File

@@ -185,7 +185,7 @@ namespace ipl {
};
// clang-format on
Button::Button(EGG::Heap* heap) : Base(heap), mAnimWait(0), mOptOutBtn(), mSdMenuBtn(), mbNewMailAnm(false), mbSuppressNewMailAnm(false), mReservedCmd() {
Button::Button(EGG::Heap* heap) : Base(heap), unk_0x54(0), mOptOutBtn(), mSdMenuBtn(), unk_0x104(false), unk_0x105(false), mReservedCmd() {
for (int i = 0; i < ARROW_BTN_MAX; i++) {
mbArrowVisible[i] = true;
}
@@ -293,7 +293,7 @@ namespace ipl {
}
void Button::calc() {
switch (mAnimWait) {
switch (unk_0x54) {
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()) {
mAnimWait = 0;
unk_0x54 = 0;
}
break;
}
@@ -335,7 +335,7 @@ namespace ipl {
mpBalloons[i]->calc();
}
if (mbNewMailAnm && !mbSuppressNewMailAnm && mTimer()) {
if (unk_0x104 && !unk_0x105 && mTimer()) {
startNewMailAnm_();
}
}
@@ -457,7 +457,7 @@ namespace ipl {
bool Button::isActive() const {
bool result = false;
if (isSceneCreated() && mAnimWait != 1) {
if (isSceneCreated() && unk_0x54 != 1) {
result = true;
}
return result;
@@ -668,7 +668,7 @@ namespace ipl {
}
}
mAnimWait = 1;
unk_0x54 = 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);
mbNewMailAnm = true;
if (!mbSuppressNewMailAnm) {
unk_0x104 = true;
if (!unk_0x105) {
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();
mbNewMailAnm = false;
unk_0x104 = 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()->setSuppressNewMailAnm(true);
getButton()->setUnk_0x105(true);
}
void ChannelTitle::calcCommon() {
@@ -931,7 +931,7 @@ namespace ipl {
System::getChannelManager()->resetChJumpLoad();
getButton()->setSuppressNewMailAnm(false);
getButton()->setUnk_0x105(false);
}
BOOL ChannelTitle::isResetAcceptable() const {