Compare commits

..

1 Commits

Author SHA1 Message Date
coah
5c45fddea5 cleanup(NWC24MsgObj): rename unk_0x1C to crc
Copied from/to mailbox entry->crc in MBoxCtrl.
2026-10-02 14:03:08 -05:00
6 changed files with 54 additions and 54 deletions

View File

@@ -62,17 +62,17 @@ namespace ipl {
void start_left_event(const char* paneName);
void start_trig_event(const char* paneName);
typedef struct CmdEntry {
typedef struct Unk {
int command; // 0x00
u32 msgID; // 0x04
} CmdEntry;
} Unk;
CmdEntry mCmdQueue[64];
Unk unk_0x64[64];
int mQueueCapacity;
int mQueueCount;
int mQueueRead;
int mQueueWrite;
int unk_0x264;
int unk_0x268;
int unk_0x26C;
int unk_0x270;
int mSettingArg; // 0x274

View File

@@ -89,10 +89,10 @@ namespace ipl {
int mIPLState; // 0x04
volatile BS2State mState; // 0x08
bool mbTickEnabled; // 0x0C
bool mbUpdateRequested; // 0x0D
bool mbAbortRequested; // 0x0E
bool mbRestartRequested; // 0x0F
bool unk_0x0C;
bool unk_0x0D;
bool unk_0x0E;
bool unk_0x0F;
bool mbIsDiagDisc; // 0x10
bool mbIncludesSeatTitles; // 0x11
u8* mpBannerBuffer; // 0x14

View File

@@ -31,7 +31,7 @@ typedef struct NWC24MsgObjPrivate {
u32 tag; // 0x14
u32 ledPattern; // 0x18
#if defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT)
u32 unk_0x1C;
u32 crc; // 0x1C
#endif
#if defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT)
union {

View File

@@ -782,7 +782,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
duplicateOffset = offset;
continue;
}
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
if (msg->crc != 0 && entry->crc == msg->crc && entry->type == msg->type && entry->length == msg->length &&
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->date) {
duplicateId = entry->msgId;
duplicateOffset = offset;
@@ -959,7 +959,7 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
entry->flags = msg->unk_0x10;
entry->tag = msg->tag;
entry->ledPattern = msg->ledPattern;
entry->crc = msg->unk_0x1C;
entry->crc = msg->crc;
entry->fromIdHigh = msg->fromIdHigh;
entry->fromIdLow = msg->fromIdLow;
entry->date = msg->date;
@@ -1006,7 +1006,7 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
msg->unk_0x10 = entry->flags;
msg->tag = entry->tag;
msg->ledPattern = entry->ledPattern;
msg->unk_0x1C = entry->crc;
msg->crc = entry->crc;
msg->fromIdHigh = entry->fromIdHigh;
msg->fromIdLow = entry->fromIdLow;
msg->date = entry->date;

View File

@@ -15,10 +15,10 @@ namespace ipl {
// clang-format on
SettingButton::SettingButton(EGG::Heap* heap, int arg) : FaderSceneBase(heap), ::gui::EventHandler() {
mQueueCapacity = 64;
mQueueCount = 0;
mQueueRead = 0;
mQueueWrite = 0;
unk_0x264 = 64;
unk_0x268 = 0;
unk_0x26C = 0;
unk_0x270 = 0;
mSettingArg = arg;
mpLayout = NULL;
mpLayoutFile = NULL;
@@ -81,9 +81,9 @@ namespace ipl {
FaderSceneCommand SettingButton::calcNormal() {
if (!mpLayout->getAnim(ANIM_ALPHA_IN)->isPlaying() && !mpLayout->getAnim(ANIM_ALPHA_OUT)->isPlaying() &&
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && mQueueCount != 0) {
CmdEntry entry = mCmdQueue[mQueueRead];
switch (entry.command) {
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && unk_0x268 != 0) {
Unk unk = unk_0x64[unk_0x26C];
switch (unk.command) {
case CMD_SHOW_BTN: {
showBtn();
break;
@@ -93,16 +93,16 @@ namespace ipl {
break;
}
case CMD_SET_TEXT: {
setText(entry.msgID);
setText(unk.msgID);
break;
}
}
if (mQueueCount != 0) {
if (++mQueueRead >= mQueueCapacity) {
mQueueRead = 0;
if (unk_0x268 != 0) {
if (++unk_0x26C >= unk_0x264) {
unk_0x26C = 0;
}
mQueueCount--;
unk_0x268--;
}
}
@@ -225,16 +225,16 @@ namespace ipl {
}
void SettingButton::reserve(int command, u32 msgId) {
if (mQueueCapacity != mQueueCount) {
int writeIdx = mQueueWrite;
mCmdQueue[writeIdx].command = command;
mCmdQueue[writeIdx].msgID = msgId;
mQueueWrite++;
if (unk_0x264 != unk_0x268) {
int unk = unk_0x270;
unk_0x64[unk].command = command;
unk_0x64[unk].msgID = msgId;
unk_0x270++;
if (mQueueWrite >= mQueueCapacity) {
mQueueWrite = 0;
if (unk_0x270 >= unk_0x264) {
unk_0x270 = 0;
}
mQueueCount++;
unk_0x268++;
}
}

View File

@@ -14,7 +14,7 @@
namespace ipl {
namespace bs2 {
Manager::Manager(EGG::Heap* pHeap)
: mIPLState(IPL_STATE_NO_DISK), mState(BS2_STT_NO_DISK), mbTickEnabled(true), mbUpdateRequested(false), mbAbortRequested(false), mbRestartRequested(false),
: mIPLState(IPL_STATE_NO_DISK), mState(BS2_STT_NO_DISK), unk_0x0C(true), unk_0x0D(false), unk_0x0E(false), unk_0x0F(false),
mbIsDiagDisc(false), mbIncludesSeatTitles(false), mbHasBanner(FALSE), mUnlockedState(BS2_STT_NO_DISK), mbStartUpdate(false),
mEntries(NULL), mEntrySize(1), mEntryOffset(0) {
mpBannerBuffer = new (pHeap, DEFAULT_ALIGN) u8[BS2_DEFAULT_BANNER_SIZE];
@@ -30,13 +30,13 @@ namespace ipl {
return mIPLState;
}
if (mbRestartRequested && !System::isNandFull()) {
if (unk_0x0F && !System::isNandFull()) {
BS2RestartStateMachine();
mbTickEnabled = true;
unk_0x0C = true;
mIPLState = IPL_STATE_NO_DISK;
mbRestartRequested = false;
} else if (mbTickEnabled) {
unk_0x0F = false;
} else if (unk_0x0C) {
BOOL old = OSDisableInterrupts();
mState = BS2Tick();
@@ -51,7 +51,7 @@ namespace ipl {
if (mbIsDiagDisc && System::isRsrcLoaded()) {
__WPADReconnect(TRUE);
mbTickEnabled = false;
unk_0x0C = false;
bootNewSystem();
}
}
@@ -65,7 +65,7 @@ namespace ipl {
}
void Manager::startUpdate() {
mbUpdateRequested = true;
unk_0x0D = true;
mbStartUpdate = true;
mPrevEntry = 0;
mPrevFound = 0;
@@ -88,11 +88,11 @@ namespace ipl {
}
void Manager::reserveRVLGame() {
mbTickEnabled = false;
unk_0x0C = false;
}
void Manager::reserveGCGame() {
mbTickEnabled = false;
unk_0x0C = false;
}
void Manager::startRVLGame() {
@@ -103,13 +103,13 @@ namespace ipl {
}
void Manager::abort() {
mbAbortRequested = true;
mbRestartRequested = false;
unk_0x0E = true;
unk_0x0F = false;
}
void Manager::restart() {
mbAbortRequested = false;
mbRestartRequested = true;
unk_0x0E = false;
unk_0x0F = true;
System::checkNandOverFlowFlagAsync();
}
@@ -195,7 +195,7 @@ namespace ipl {
break;
}
case BS2_STT_64: {
mbTickEnabled = false;
unk_0x0C = false;
mIPLState = IPL_STATE_8;
break;
}
@@ -216,25 +216,25 @@ namespace ipl {
}
void Manager::execTick(BS2State state) {
if (mbUpdateRequested) {
if (unk_0x0D) {
if (state == BS2_STT_UPDATE_DISK) {
BS2StartUpdate();
} else {
mbStartUpdate = false;
}
} else if (mbAbortRequested) {
} else if (unk_0x0E) {
if (state == BS2_STT_NO_DISK || state == BS2_STT_COVER_OPEN || state == BS2_STT_55 || state == BS2_STT_WRONG_DISK ||
state == BS2_STT_66 || state == BS2_STT_67 || state == BS2_STT_68 || state == BS2_STT_FATAL_ERROR ||
state == BS2_STT_UPDATE_FAILED || state == BS2_STT_DIRTY_DISK) {
mbTickEnabled = false;
unk_0x0C = false;
mIPLState = IPL_STATE_8;
} else {
BS2AbortStateMachine();
}
}
mbUpdateRequested = false;
mbAbortRequested = false;
unk_0x0D = false;
unk_0x0E = false;
}
void Manager::updateTick() {