Compare commits
4 Commits
cleanup/se
...
cleanup/ip
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87a084da31 | ||
|
|
00013016df | ||
|
|
3e279ef189 | ||
|
|
32417fe8a2 |
@@ -69,10 +69,10 @@ namespace ipl {
|
|||||||
|
|
||||||
CmdEntry mCmdQueue[64];
|
CmdEntry mCmdQueue[64];
|
||||||
|
|
||||||
int mCmdCapacity;
|
int mQueueCapacity;
|
||||||
int mCmdCount;
|
int mQueueCount;
|
||||||
int mCmdReadIdx;
|
int mQueueRead;
|
||||||
int mCmdWriteIdx;
|
int mQueueWrite;
|
||||||
|
|
||||||
int mSettingArg; // 0x274
|
int mSettingArg; // 0x274
|
||||||
|
|
||||||
|
|||||||
@@ -89,10 +89,10 @@ namespace ipl {
|
|||||||
|
|
||||||
int mIPLState; // 0x04
|
int mIPLState; // 0x04
|
||||||
volatile BS2State mState; // 0x08
|
volatile BS2State mState; // 0x08
|
||||||
bool unk_0x0C;
|
bool mbTickEnabled; // 0x0C
|
||||||
bool unk_0x0D;
|
bool mbUpdateRequested; // 0x0D
|
||||||
bool unk_0x0E;
|
bool mbAbortRequested; // 0x0E
|
||||||
bool unk_0x0F;
|
bool mbRestartRequested; // 0x0F
|
||||||
bool mbIsDiagDisc; // 0x10
|
bool mbIsDiagDisc; // 0x10
|
||||||
bool mbIncludesSeatTitles; // 0x11
|
bool mbIncludesSeatTitles; // 0x11
|
||||||
u8* mpBannerBuffer; // 0x14
|
u8* mpBannerBuffer; // 0x14
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ typedef struct _ziUwdNode {
|
|||||||
|
|
||||||
struct __zi8_work_data_s {
|
struct __zi8_work_data_s {
|
||||||
ziU8 unk_0x00;
|
ziU8 unk_0x00;
|
||||||
ziU8 unk_0x01;
|
ziU8 countOnly; // 0x01
|
||||||
ziU8 unk_0x02[2];
|
ziU8 unk_0x02[2];
|
||||||
ziLanguageEntry* langEntries; // 0x04
|
ziLanguageEntry* langEntries; // 0x04
|
||||||
ziU8 unk_0x08;
|
ziU8 unk_0x08;
|
||||||
@@ -283,7 +283,7 @@ struct __zi8_work_data_s {
|
|||||||
ziU16 unk_0x17EA;
|
ziU16 unk_0x17EA;
|
||||||
ziU8 unk_0x17EC;
|
ziU8 unk_0x17EC;
|
||||||
ziU8 unk_0x17ED[3];
|
ziU8 unk_0x17ED[3];
|
||||||
ziU8* unk_0x17F0;
|
ziU8* dawgGroup; // 0x17F0
|
||||||
ziWChar unk_0x17F4[0x40]; // 0x17F4..0x1874
|
ziWChar unk_0x17F4[0x40]; // 0x17F4..0x1874
|
||||||
ziU16 unk_0x1874;
|
ziU16 unk_0x1874;
|
||||||
ziU8 unk_0x1876;
|
ziU8 unk_0x1876;
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ ziU32 Zi8MatchROMdata(ziWChar* elements, ziU8 count, ziU8 language,
|
|||||||
} else {
|
} else {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
ZI_WORK->unk_0x17EC = 0;
|
ZI_WORK->unk_0x17EC = 0;
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(0, language, ZI_WORK);
|
||||||
} else if (ZI_WORK->unk_0x17EC != 0) {
|
} else if (ZI_WORK->unk_0x17EC != 0) {
|
||||||
Zi8LogError(100, ZI_WORK);
|
Zi8LogError(100, ZI_WORK);
|
||||||
goto finish_match;
|
goto finish_match;
|
||||||
@@ -316,30 +316,30 @@ ziU32 Zi8MatchROMdata(ziWChar* elements, ziU8 count, ziU8 language,
|
|||||||
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
mode, status, reservedMode, 0, acceptPrefix, ZI_WORK);
|
mode, status, reservedMode, 0, acceptPrefix, ZI_WORK);
|
||||||
} else {
|
} else {
|
||||||
while (ZI_WORK->unk_0x17F0 != 0) {
|
while (ZI_WORK->dawgGroup != 0) {
|
||||||
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
mode, status, reservedMode, ZI_WORK->unk_0x17F0,
|
mode, status, reservedMode, ZI_WORK->dawgGroup,
|
||||||
acceptPrefix, ZI_WORK);
|
acceptPrefix, ZI_WORK);
|
||||||
if ((ziU8)result != 0) break;
|
if ((ziU8)result != 0) break;
|
||||||
status = 0;
|
status = 0;
|
||||||
if (count <= 1 && language == 0x36) break;
|
if (count <= 1 && language == 0x36) break;
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(ZI_WORK->unk_0x17F0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(ZI_WORK->dawgGroup, language, ZI_WORK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((ziU8)result == 0 && status == 0 && mode == 1 && count == 1 && capacity >= 1) {
|
if ((ziU8)result == 0 && status == 0 && mode == 1 && count == 1 && capacity >= 1) {
|
||||||
mode = 0;
|
mode = 0;
|
||||||
ZI_WORK->unk_0x17EC = 1;
|
ZI_WORK->unk_0x17EC = 1;
|
||||||
if (tableSize != 0) {
|
if (tableSize != 0) {
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(0, language, ZI_WORK);
|
||||||
while (ZI_WORK->unk_0x17F0 != 0) {
|
while (ZI_WORK->dawgGroup != 0) {
|
||||||
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
mode, status, reservedMode, ZI_WORK->unk_0x17F0,
|
mode, status, reservedMode, ZI_WORK->dawgGroup,
|
||||||
acceptPrefix, ZI_WORK) != 0) {
|
acceptPrefix, ZI_WORK) != 0) {
|
||||||
*output = *elements;
|
*output = *elements;
|
||||||
result = 1;
|
result = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(ZI_WORK->unk_0x17F0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(ZI_WORK->dawgGroup, language, ZI_WORK);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
|
|||||||
@@ -339,11 +339,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
|
|||||||
if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) {
|
if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) {
|
||||||
switch (parameters->language) {
|
switch (parameters->language) {
|
||||||
case 1:
|
case 1:
|
||||||
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) {
|
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
|
||||||
switch(ZI_WORK->unk_0x00) {
|
switch(ZI_WORK->unk_0x00) {
|
||||||
case '\0':
|
case '\0':
|
||||||
if (parameters->elements[0] == 0xEF04) {
|
if (parameters->elements[0] == 0xEF04) {
|
||||||
ZI_WORK->unk_0x01 = options->countOnly;
|
ZI_WORK->countOnly = options->countOnly;
|
||||||
ZI_WORK->unk_0x00 = '\x01';
|
ZI_WORK->unk_0x00 = '\x01';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -400,11 +400,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
|
|||||||
break;
|
break;
|
||||||
case 0x11:
|
case 0x11:
|
||||||
default:
|
default:
|
||||||
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) {
|
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
|
||||||
switch(ZI_WORK->unk_0x00) {
|
switch(ZI_WORK->unk_0x00) {
|
||||||
case '\0':
|
case '\0':
|
||||||
if (parameters->elements[0] == 0xEFF2) {
|
if (parameters->elements[0] == 0xEFF2) {
|
||||||
ZI_WORK->unk_0x01 = options->countOnly;
|
ZI_WORK->countOnly = options->countOnly;
|
||||||
ZI_WORK->unk_0x00 = '\x01';
|
ZI_WORK->unk_0x00 = '\x01';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ namespace ipl {
|
|||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
SettingButton::SettingButton(EGG::Heap* heap, int arg) : FaderSceneBase(heap), ::gui::EventHandler() {
|
SettingButton::SettingButton(EGG::Heap* heap, int arg) : FaderSceneBase(heap), ::gui::EventHandler() {
|
||||||
mCmdCapacity = 64;
|
mQueueCapacity = 64;
|
||||||
mCmdCount = 0;
|
mQueueCount = 0;
|
||||||
mCmdReadIdx = 0;
|
mQueueRead = 0;
|
||||||
mCmdWriteIdx = 0;
|
mQueueWrite = 0;
|
||||||
mSettingArg = arg;
|
mSettingArg = arg;
|
||||||
mpLayout = NULL;
|
mpLayout = NULL;
|
||||||
mpLayoutFile = NULL;
|
mpLayoutFile = NULL;
|
||||||
@@ -81,9 +81,9 @@ namespace ipl {
|
|||||||
|
|
||||||
FaderSceneCommand SettingButton::calcNormal() {
|
FaderSceneCommand SettingButton::calcNormal() {
|
||||||
if (!mpLayout->getAnim(ANIM_ALPHA_IN)->isPlaying() && !mpLayout->getAnim(ANIM_ALPHA_OUT)->isPlaying() &&
|
if (!mpLayout->getAnim(ANIM_ALPHA_IN)->isPlaying() && !mpLayout->getAnim(ANIM_ALPHA_OUT)->isPlaying() &&
|
||||||
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && mCmdCount != 0) {
|
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && mQueueCount != 0) {
|
||||||
CmdEntry unk = mCmdQueue[mCmdReadIdx];
|
CmdEntry entry = mCmdQueue[mQueueRead];
|
||||||
switch (unk.command) {
|
switch (entry.command) {
|
||||||
case CMD_SHOW_BTN: {
|
case CMD_SHOW_BTN: {
|
||||||
showBtn();
|
showBtn();
|
||||||
break;
|
break;
|
||||||
@@ -93,16 +93,16 @@ namespace ipl {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_SET_TEXT: {
|
case CMD_SET_TEXT: {
|
||||||
setText(unk.msgID);
|
setText(entry.msgID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCmdCount != 0) {
|
if (mQueueCount != 0) {
|
||||||
if (++mCmdReadIdx >= mCmdCapacity) {
|
if (++mQueueRead >= mQueueCapacity) {
|
||||||
mCmdReadIdx = 0;
|
mQueueRead = 0;
|
||||||
}
|
}
|
||||||
mCmdCount--;
|
mQueueCount--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,16 +225,16 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SettingButton::reserve(int command, u32 msgId) {
|
void SettingButton::reserve(int command, u32 msgId) {
|
||||||
if (mCmdCapacity != mCmdCount) {
|
if (mQueueCapacity != mQueueCount) {
|
||||||
int unk = mCmdWriteIdx;
|
int writeIdx = mQueueWrite;
|
||||||
mCmdQueue[unk].command = command;
|
mCmdQueue[writeIdx].command = command;
|
||||||
mCmdQueue[unk].msgID = msgId;
|
mCmdQueue[writeIdx].msgID = msgId;
|
||||||
mCmdWriteIdx++;
|
mQueueWrite++;
|
||||||
|
|
||||||
if (mCmdWriteIdx >= mCmdCapacity) {
|
if (mQueueWrite >= mQueueCapacity) {
|
||||||
mCmdWriteIdx = 0;
|
mQueueWrite = 0;
|
||||||
}
|
}
|
||||||
mCmdCount++;
|
mQueueCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
namespace ipl {
|
namespace ipl {
|
||||||
namespace bs2 {
|
namespace bs2 {
|
||||||
Manager::Manager(EGG::Heap* pHeap)
|
Manager::Manager(EGG::Heap* pHeap)
|
||||||
: mIPLState(IPL_STATE_NO_DISK), mState(BS2_STT_NO_DISK), unk_0x0C(true), unk_0x0D(false), unk_0x0E(false), unk_0x0F(false),
|
: mIPLState(IPL_STATE_NO_DISK), mState(BS2_STT_NO_DISK), mbTickEnabled(true), mbUpdateRequested(false), mbAbortRequested(false), mbRestartRequested(false),
|
||||||
mbIsDiagDisc(false), mbIncludesSeatTitles(false), mbHasBanner(FALSE), mUnlockedState(BS2_STT_NO_DISK), mbStartUpdate(false),
|
mbIsDiagDisc(false), mbIncludesSeatTitles(false), mbHasBanner(FALSE), mUnlockedState(BS2_STT_NO_DISK), mbStartUpdate(false),
|
||||||
mEntries(NULL), mEntrySize(1), mEntryOffset(0) {
|
mEntries(NULL), mEntrySize(1), mEntryOffset(0) {
|
||||||
mpBannerBuffer = new (pHeap, DEFAULT_ALIGN) u8[BS2_DEFAULT_BANNER_SIZE];
|
mpBannerBuffer = new (pHeap, DEFAULT_ALIGN) u8[BS2_DEFAULT_BANNER_SIZE];
|
||||||
@@ -30,13 +30,13 @@ namespace ipl {
|
|||||||
return mIPLState;
|
return mIPLState;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unk_0x0F && !System::isNandFull()) {
|
if (mbRestartRequested && !System::isNandFull()) {
|
||||||
BS2RestartStateMachine();
|
BS2RestartStateMachine();
|
||||||
|
|
||||||
unk_0x0C = true;
|
mbTickEnabled = true;
|
||||||
mIPLState = IPL_STATE_NO_DISK;
|
mIPLState = IPL_STATE_NO_DISK;
|
||||||
unk_0x0F = false;
|
mbRestartRequested = false;
|
||||||
} else if (unk_0x0C) {
|
} else if (mbTickEnabled) {
|
||||||
BOOL old = OSDisableInterrupts();
|
BOOL old = OSDisableInterrupts();
|
||||||
|
|
||||||
mState = BS2Tick();
|
mState = BS2Tick();
|
||||||
@@ -51,7 +51,7 @@ namespace ipl {
|
|||||||
|
|
||||||
if (mbIsDiagDisc && System::isRsrcLoaded()) {
|
if (mbIsDiagDisc && System::isRsrcLoaded()) {
|
||||||
__WPADReconnect(TRUE);
|
__WPADReconnect(TRUE);
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
bootNewSystem();
|
bootNewSystem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::startUpdate() {
|
void Manager::startUpdate() {
|
||||||
unk_0x0D = true;
|
mbUpdateRequested = true;
|
||||||
mbStartUpdate = true;
|
mbStartUpdate = true;
|
||||||
mPrevEntry = 0;
|
mPrevEntry = 0;
|
||||||
mPrevFound = 0;
|
mPrevFound = 0;
|
||||||
@@ -88,11 +88,11 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::reserveRVLGame() {
|
void Manager::reserveRVLGame() {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::reserveGCGame() {
|
void Manager::reserveGCGame() {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::startRVLGame() {
|
void Manager::startRVLGame() {
|
||||||
@@ -103,13 +103,13 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::abort() {
|
void Manager::abort() {
|
||||||
unk_0x0E = true;
|
mbAbortRequested = true;
|
||||||
unk_0x0F = false;
|
mbRestartRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::restart() {
|
void Manager::restart() {
|
||||||
unk_0x0E = false;
|
mbAbortRequested = false;
|
||||||
unk_0x0F = true;
|
mbRestartRequested = true;
|
||||||
|
|
||||||
System::checkNandOverFlowFlagAsync();
|
System::checkNandOverFlowFlagAsync();
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ namespace ipl {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BS2_STT_64: {
|
case BS2_STT_64: {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
mIPLState = IPL_STATE_8;
|
mIPLState = IPL_STATE_8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -216,25 +216,25 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::execTick(BS2State state) {
|
void Manager::execTick(BS2State state) {
|
||||||
if (unk_0x0D) {
|
if (mbUpdateRequested) {
|
||||||
if (state == BS2_STT_UPDATE_DISK) {
|
if (state == BS2_STT_UPDATE_DISK) {
|
||||||
BS2StartUpdate();
|
BS2StartUpdate();
|
||||||
} else {
|
} else {
|
||||||
mbStartUpdate = false;
|
mbStartUpdate = false;
|
||||||
}
|
}
|
||||||
} else if (unk_0x0E) {
|
} else if (mbAbortRequested) {
|
||||||
if (state == BS2_STT_NO_DISK || state == BS2_STT_COVER_OPEN || state == BS2_STT_55 || state == BS2_STT_WRONG_DISK ||
|
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_66 || state == BS2_STT_67 || state == BS2_STT_68 || state == BS2_STT_FATAL_ERROR ||
|
||||||
state == BS2_STT_UPDATE_FAILED || state == BS2_STT_DIRTY_DISK) {
|
state == BS2_STT_UPDATE_FAILED || state == BS2_STT_DIRTY_DISK) {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
mIPLState = IPL_STATE_8;
|
mIPLState = IPL_STATE_8;
|
||||||
} else {
|
} else {
|
||||||
BS2AbortStateMachine();
|
BS2AbortStateMachine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unk_0x0D = false;
|
mbUpdateRequested = false;
|
||||||
unk_0x0E = false;
|
mbAbortRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::updateTick() {
|
void Manager::updateTick() {
|
||||||
|
|||||||
Reference in New Issue
Block a user