Compare commits

...

5 Commits

Author SHA1 Message Date
coah
5091975abf cleanup(puh_ker_tsk): rename entry unk_0x00/04 to thread/stack
OSThread* used with OSSetThreadPriority; following buffer is task stack.
2026-10-02 14:23:31 -05:00
coah
f7b1b9b09b cleanup(eZiText): rename work unk_0x1B28 to pyFuzzy (#892)
Union holding Pinyin fuzzy pairs; initd copies .word into pyFuzzy.
2026-10-02 14:21:24 -05:00
coah
fcbc0c56b7 cleanup(WPAD): rename CB unk_0x38 to gameInfoStatus (#891)
Stores WPAD_ERR_* from getGameInfo checksum validation.
2026-10-02 14:20:58 -05:00
coah
ab8bece04e cleanup(iplController): name decide/pinch/kpad/classic fields (#889)
unk_0x08 -> mDecideHoldCount
unk_0x1C -> mbForceInvalid
unk_0x1D -> mbPinching
unk_0x1E -> mbWasPinching
unk_0x20 -> mpKpadStatus
unk_0x24 -> mClassicCursorPos
unk_0x2C -> mClassicCursorTimer

Also update iplControllerManager ctor inits for Base fields.

Matching 100% before/after; DOL sha1 unchanged.
2026-10-02 14:20:10 -05:00
coah
0059de422f cleanup(iplSettingSelect): rename pending scene and exit sequence fields (#888)
unk_0x90 -> mPendingSceneId (SCENE_* values); unk_0x94 -> mExitSeqStep.
Also use SCENE_* constants instead of magic numbers. Byte-identical.
2026-10-02 14:19:44 -05:00
13 changed files with 143 additions and 143 deletions

View File

@@ -185,8 +185,8 @@ namespace ipl {
gui::PaneManager* mpGui; // 0x74 gui::PaneManager* mpGui; // 0x74
BOOL mbHovered[BTN_MAX]; // 0x78 BOOL mbHovered[BTN_MAX]; // 0x78
u32 unk_0x90; u32 mPendingSceneId;
u32 unk_0x94; u32 mExitSeqStep;
static const char* smButtonName[BTN_MAX]; static const char* smButtonName[BTN_MAX];
}; };

View File

@@ -118,26 +118,26 @@ namespace ipl {
public: public:
Base(int chan, KPADStatus& status) { Base(int chan, KPADStatus& status) {
mButton = 0; mButton = 0;
unk_0x08 = 0; mDecideHoldCount = 0;
mLastRumbleTime = 0; mLastRumbleTime = 0;
mRumbleType = -1; mRumbleType = -1;
mChan = chan; mChan = chan;
mType = 2; mType = 2;
unk_0x1C = 0; mbForceInvalid = 0;
KPADEnableDPD(chan); KPADEnableDPD(chan);
unk_0x1D = 0; mbPinching = 0;
unk_0x1E = 0; mbWasPinching = 0;
unk_0x20 = &status; mpKpadStatus = &status;
} }
Base(int chan, int type, KPADStatus& status) { Base(int chan, int type, KPADStatus& status) {
mButton = 0; mButton = 0;
unk_0x08 = 0; mDecideHoldCount = 0;
mLastRumbleTime = 0; mLastRumbleTime = 0;
mRumbleType = -1; mRumbleType = -1;
mChan = chan; mChan = chan;
mType = type; mType = type;
unk_0x1C = 0; mbForceInvalid = 0;
KPADEnableDPD(chan); KPADEnableDPD(chan);
} }
@@ -152,15 +152,15 @@ namespace ipl {
protected: protected:
u8 mButton; u8 mButton;
u32 unk_0x08; u32 mDecideHoldCount;
OSTick mLastRumbleTime; OSTick mLastRumbleTime;
s32 mRumbleType; s32 mRumbleType;
u32 mChan; u32 mChan;
u32 mType; u32 mType;
u8 unk_0x1C; u8 mbForceInvalid;
u8 unk_0x1D; u8 mbPinching;
u8 unk_0x1E; u8 mbWasPinching;
KPADStatus* unk_0x20; KPADStatus* mpKpadStatus;
}; };
class Revolution : public Base { class Revolution : public Base {
@@ -206,8 +206,8 @@ namespace ipl {
virtual BOOL isValidDpdClassic() const; virtual BOOL isValidDpdClassic() const;
private: private:
math::VEC2 unk_0x24; math::VEC2 mClassicCursorPos;
int unk_0x2C; int mClassicCursorTimer;
}; };
class Master : public Interface { class Master : public Interface {
@@ -264,18 +264,18 @@ namespace ipl {
public: public:
Base(int chan, KPADStatus& arg1) { Base(int chan, KPADStatus& arg1) {
mButton = 0; mButton = 0;
unk_0x08 = 0; mDecideHoldCount = 0;
mLastRumbleTime = 0; mLastRumbleTime = 0;
mRumbleType = -1; mRumbleType = -1;
mChan = chan; mChan = chan;
mType = 2; mType = 2;
unk_0x1C = 0; mbForceInvalid = 0;
KPADEnableDPD(chan); KPADEnableDPD(chan);
unk_0x1D = 0; mbPinching = 0;
unk_0x1E = 0; mbWasPinching = 0;
unk_0x20 = &arg1; mpKpadStatus = &arg1;
} }
virtual ~Base(); // 0x08 virtual ~Base(); // 0x08
@@ -326,15 +326,15 @@ namespace ipl {
// protected: // protected:
u8 mButton; // 0x4 u8 mButton; // 0x4
u32 unk_0x08; // 0x8 u32 mDecideHoldCount; // 0x8
OSTick mLastRumbleTime; // 0xC OSTick mLastRumbleTime; // 0xC
s32 mRumbleType; // 0x10 s32 mRumbleType; // 0x10
u32 mChan; // 0x14 u32 mChan; // 0x14
u32 mType; // 0x18 u32 mType; // 0x18
u8 unk_0x1C; u8 mbForceInvalid;
u8 unk_0x1D; // 0x1D u8 mbPinching; // 0x1D
u8 unk_0x1E; // 0x1E u8 mbWasPinching; // 0x1E
KPADStatus* unk_0x20; // 0x20 KPADStatus* mpKpadStatus; // 0x20
}; };
class Interface : public Base { class Interface : public Base {
@@ -446,8 +446,8 @@ namespace ipl {
virtual BOOL isValidDpdClassic() const; // 0x8C virtual BOOL isValidDpdClassic() const; // 0x8C
private: private:
math::VEC2 unk_0x24; math::VEC2 mClassicCursorPos;
int unk_0x2C; int mClassicCursorTimer;
}; };
class Manager { class Manager {

View File

@@ -321,7 +321,7 @@ struct __zi8_work_data_s {
struct { struct {
ziU32 msb : 1; ziU32 msb : 1;
} bits; } bits;
} unk_0x1B28; } pyFuzzy; // 0x1B28
union { union {
ziU32 word; ziU32 word;
struct { struct {

View File

@@ -577,27 +577,27 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
if (getMode == 1) { if (getMode == 1) {
switch ((int)match.phon2[index] >> 9) { switch ((int)match.phon2[index] >> 9) {
case 24: case 25: case 24: case 25:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->cANDch) ordinalIndex = 0xFDFF; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->cANDch) ordinalIndex = 0xFDFF;
break; break;
case 26: case 27: case 26: case 27:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->sANDsh) ordinalIndex = 0xFDFF; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->sANDsh) ordinalIndex = 0xFDFF;
break; break;
case 28: case 29: case 28: case 29:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->zANDzh) ordinalIndex = 0xFDFF; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->zANDzh) ordinalIndex = 0xFDFF;
break; break;
case 56: case 59: case 56: case 59:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->fANDh) ordinalIndex = 0xF9FF; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->fANDh) ordinalIndex = 0xF9FF;
break; break;
case 38: case 38:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->nANDl) ordinalIndex = 0xE5FF; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->nANDl) ordinalIndex = 0xE5FF;
break; break;
case 43: case 43:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->nANDl && ((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->lANDr) ordinalIndex = 0xE1FF; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->nANDl && ((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->lANDr) ordinalIndex = 0xE1FF;
else if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->lANDr) ordinalIndex = 0xF1FF; else if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->lANDr) ordinalIndex = 0xF1FF;
else if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->nANDl) ordinalIndex = 0xE5FF; else if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->nANDl) ordinalIndex = 0xE5FF;
break; break;
case 44: case 44:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->lANDr) ordinalIndex = 0xF1FF; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->lANDr) ordinalIndex = 0xF1FF;
break; break;
} }
} else { } else {
@@ -650,13 +650,13 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
if (getMode == 1) { if (getMode == 1) {
switch (match.phon2[index] & 0x1F0) { switch (match.phon2[index] & 0x1F0) {
case 0x10: case 0x80: case 0x100: case 0x10: case 0x80: case 0x100:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->anANDang) ordinalIndex = 0xFFF7; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->anANDang) ordinalIndex = 0xFFF7;
break; break;
case 0x180: case 0x180:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->enANDeng) ordinalIndex = 0xFFF7; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->enANDeng) ordinalIndex = 0xFFF7;
break; break;
case 0x60: case 0x60:
if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->inANDing) ordinalIndex = 0xFFF7; if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->inANDing) ordinalIndex = 0xFFF7;
break; break;
} }
} else { } else {

View File

@@ -32,9 +32,9 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
ziBool Zi8ZHsetPYfuzzyPairs(ziFuzzyPYPairs pairs ZI_NEED_WORK) { ziBool Zi8ZHsetPYfuzzyPairs(ziFuzzyPYPairs pairs ZI_NEED_WORK) {
if (pairs.ziDefault) { if (pairs.ziDefault) {
ZI_WORK->unk_0x1B28.word = *(const ziU32*)&Zi8PYdefaultFuzzyPairs; ZI_WORK->pyFuzzy.word = *(const ziU32*)&Zi8PYdefaultFuzzyPairs;
} else { } else {
ZI_WORK->unk_0x1B28.word = *(ziU32*)&pairs; ZI_WORK->pyFuzzy.word = *(ziU32*)&pairs;
} }
return 1; return 1;
} }

View File

@@ -49,12 +49,12 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
ZADP_Zi8SetPDremoveOpt(1, ZI_WORK); ZADP_Zi8SetPDremoveOpt(1, ZI_WORK);
ZI_WORK->unk_0x17 = 5; ZI_WORK->unk_0x17 = 5;
ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, ZI_WORK) & 2; ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1, ZI_WORK) & 2;
ZI_WORK->unk_0x1B28.bits.msb = 1; ZI_WORK->pyFuzzy.bits.msb = 1;
ZI_WORK->unk_0x1B2C.bits.msb = 1; ZI_WORK->unk_0x1B2C.bits.msb = 1;
zyFuzzy = ZI_WORK->unk_0x1B2C.word; zyFuzzy = ZI_WORK->unk_0x1B2C.word;
pzyFuzzy = &zyFuzzy; pzyFuzzy = &zyFuzzy;
Zi8ZHsetZYfuzzyPairs(pzyFuzzy, ZI_WORK); Zi8ZHsetZYfuzzyPairs(pzyFuzzy, ZI_WORK);
pyFuzzy = ZI_WORK->unk_0x1B28.word; pyFuzzy = ZI_WORK->pyFuzzy.word;
ppyFuzzy = &pyFuzzy; ppyFuzzy = &pyFuzzy;
Zi8ZHsetPYfuzzyPairs(ppyFuzzy, ZI_WORK); Zi8ZHsetPYfuzzyPairs(ppyFuzzy, ZI_WORK);
Zi8SetParentalControls(2, ZI_WORK); Zi8SetParentalControls(2, ZI_WORK);

View File

@@ -171,7 +171,7 @@ typedef struct WPADExtConfig {
typedef struct WPADCB { typedef struct WPADCB {
WPADGameInfo gameInfo; // 0x00 WPADGameInfo gameInfo; // 0x00
s32 unk_0x38[2]; s32 gameInfoStatus[2]; // 0x38
u8 rxBufMain[RX_BUFFER_SIZE]; // 0x40 u8 rxBufMain[RX_BUFFER_SIZE]; // 0x40
u8 rxBufs[2][RX_BUFFER_SIZE]; // 0xA0 u8 rxBufs[2][RX_BUFFER_SIZE]; // 0xA0
WPADCommandQueue stdCmdQueue; // 0x160 WPADCommandQueue stdCmdQueue; // 0x160

View File

@@ -6,8 +6,8 @@
static struct { static struct {
struct { struct {
OSThread* unk_0x00; OSThread* thread; // 0x00
u8 unk_0x04[0x33C]; u8 stack[0x33C]; // 0x04
} entries[MAX_PUH_TSK]; // 0x00 } entries[MAX_PUH_TSK]; // 0x00
u32 unk_0x680; u32 unk_0x680;
u32 unk_0x684; u32 unk_0x684;
@@ -24,9 +24,9 @@ s32 uhf_ker_set_priority(int tsk, int priority) {
return -5; return -5;
} }
if (st_uhs_ker_tsk_mng.entries[tsk - 1].unk_0x00 == NULL) { if (st_uhs_ker_tsk_mng.entries[tsk - 1].thread == NULL) {
return -1; return -1;
} }
return OSSetThreadPriority(st_uhs_ker_tsk_mng.entries[tsk - 1].unk_0x00, priority) ? 0 : -20; return OSSetThreadPriority(st_uhs_ker_tsk_mng.entries[tsk - 1].thread, priority) ? 0 : -20;
} }

View File

@@ -1298,8 +1298,8 @@ static void __ClearControlBlock(s32 chan) {
memset(&p->decryptXorTable, 0, sizeof(p->decryptXorTable)); memset(&p->decryptXorTable, 0, sizeof(p->decryptXorTable));
memset(&p->gameInfo, 0, sizeof(WPADGameInfo)); memset(&p->gameInfo, 0, sizeof(WPADGameInfo));
p->unk_0x38[0] = -1; p->gameInfoStatus[0] = -1;
p->unk_0x38[1] = -1; p->gameInfoStatus[1] = -1;
p->stdCmdQueue.buffer = p->stdCmdQueueList; p->stdCmdQueue.buffer = p->stdCmdQueueList;
p->stdCmdQueue.capacity = ARRAY_LENGTH(p->stdCmdQueueList); p->stdCmdQueue.capacity = ARRAY_LENGTH(p->stdCmdQueueList);

View File

@@ -547,9 +547,9 @@ static void getGameInfo(s32 chan, s32 result, u8 index) {
if (p_info->checksum == sum) { if (p_info->checksum == sum) {
memcpy(&p_wpd->gameInfo, p_buf, sizeof(WPADMEMGameInfo)); memcpy(&p_wpd->gameInfo, p_buf, sizeof(WPADMEMGameInfo));
p_wpd->unk_0x38[index] = WPAD_ERR_NONE; p_wpd->gameInfoStatus[index] = WPAD_ERR_NONE;
} else { } else {
p_wpd->unk_0x38[index] = WPAD_ERR_INVALID; p_wpd->gameInfoStatus[index] = WPAD_ERR_INVALID;
} }
} }
} }

View File

@@ -30,7 +30,7 @@ namespace ipl {
SettingSelect::SettingSelect(EGG::Heap* heap, int arg) SettingSelect::SettingSelect(EGG::Heap* heap, int arg)
: Base(heap), ::gui::EventHandler(), mState(STATE_WAIT_BUTTON_FADE_IN), mPrevState(STATE_WAIT_BUTTON_FADE_IN), mSettingArg(arg), : Base(heap), ::gui::EventHandler(), mState(STATE_WAIT_BUTTON_FADE_IN), mPrevState(STATE_WAIT_BUTTON_FADE_IN), mSettingArg(arg),
mpLayout(NULL), mpLayoutFile(NULL), mpGui(NULL), unk_0x90(0), unk_0x94(0) { mpLayout(NULL), mpLayoutFile(NULL), mpGui(NULL), mPendingSceneId(0), mExitSeqStep(0) {
setSceneParentFlags(SCN_PARENTFLAG_CALC | SCN_PARENTFLAG_DRAW); setSceneParentFlags(SCN_PARENTFLAG_CALC | SCN_PARENTFLAG_DRAW);
} }
@@ -222,7 +222,7 @@ namespace ipl {
void SettingSelect::stt_1st_fadeout() { void SettingSelect::stt_1st_fadeout() {
if (is_stopped_all_anm()) { if (is_stopped_all_anm()) {
if (unk_0x90 != 0) { if (mPendingSceneId != 0) {
System::getFader()->fadeOut(); System::getFader()->fadeOut();
CHANGE_STATE(STATE_WAIT_BLACK_OUT); CHANGE_STATE(STATE_WAIT_BLACK_OUT);
} else { } else {
@@ -247,7 +247,7 @@ namespace ipl {
void SettingSelect::stt_2nd_fadeout() { void SettingSelect::stt_2nd_fadeout() {
if (is_stopped_all_anm()) { if (is_stopped_all_anm()) {
if (unk_0x90 != 0) { if (mPendingSceneId != 0) {
CHANGE_STATE(STATE_WAIT_CHILD); CHANGE_STATE(STATE_WAIT_CHILD);
reset_gui(); reset_gui();
} else { } else {
@@ -309,7 +309,7 @@ namespace ipl {
case STATE_1ST_NORMAL: { case STATE_1ST_NORMAL: {
System::getChannelManager()->refreshAsync(); System::getChannelManager()->refreshAsync();
System::getFader()->fadeOut(); System::getFader()->fadeOut();
unk_0x90 = 4; mPendingSceneId = SCENE_BOARD;
reserveAllSceneDestruction(SCENE_BOARD, NULL); reserveAllSceneDestruction(SCENE_BOARD, NULL);
@@ -369,8 +369,8 @@ namespace ipl {
int backAnim = -1; int backAnim = -1;
int inAnim = -1; int inAnim = -1;
switch (unk_0x90) { switch (mPendingSceneId) {
case 13: { case SCENE_MEMORY: {
#ifndef KOREAN_BUILD #ifndef KOREAN_BUILD
backAnim = ANIM_WII_SAVE_DATA_BACK; backAnim = ANIM_WII_SAVE_DATA_BACK;
inAnim = ANIM_GC_SAVE_DATA_IN; inAnim = ANIM_GC_SAVE_DATA_IN;
@@ -380,12 +380,12 @@ namespace ipl {
#endif #endif
break; break;
} }
case 14: { case SCENE_MEMORY_CARD: {
backAnim = ANIM_GC_SAVE_DATA_BACK; backAnim = ANIM_GC_SAVE_DATA_BACK;
inAnim = ANIM_WII_SAVE_DATA_IN; inAnim = ANIM_WII_SAVE_DATA_IN;
break; break;
} }
case 12: { case SCENE_CHANNEL_EDIT: {
backAnim = ANIM_CHANNEL_BACK; backAnim = ANIM_CHANNEL_BACK;
inAnim = ANIM_SAVE_DATA_IN; inAnim = ANIM_SAVE_DATA_IN;
if (mSettingArg == SettingSelectArg::ARG_START_SAVE_DATA) { if (mSettingArg == SettingSelectArg::ARG_START_SAVE_DATA) {
@@ -404,14 +404,14 @@ namespace ipl {
void SettingSelect::stt_wait_child_anm() { void SettingSelect::stt_wait_child_anm() {
if (is_stopped_all_anm()) { if (is_stopped_all_anm()) {
switch (unk_0x90) { switch (mPendingSceneId) {
case 12: { case SCENE_CHANNEL_EDIT: {
static_cast<SettingButton*>(System::getScene(SCENE_SETTING_BUTTON))->showWii(); static_cast<SettingButton*>(System::getScene(SCENE_SETTING_BUTTON))->showWii();
CHANGE_STATE(STATE_2ND_NORMAL); CHANGE_STATE(STATE_2ND_NORMAL);
break; break;
} }
case 13: case SCENE_MEMORY:
case 14: { case SCENE_MEMORY_CARD: {
static_cast<SettingButton*>(System::getScene(SCENE_SETTING_BUTTON))->showWii(); static_cast<SettingButton*>(System::getScene(SCENE_SETTING_BUTTON))->showWii();
#ifndef KOREAN_BUILD #ifndef KOREAN_BUILD
CHANGE_STATE(STATE_3RD_NORMAL); CHANGE_STATE(STATE_3RD_NORMAL);
@@ -422,7 +422,7 @@ namespace ipl {
} }
} }
unk_0x90 = 0; mPendingSceneId = 0;
} }
} }
@@ -587,7 +587,7 @@ namespace ipl {
break; break;
} }
case BTN_SETTING: { case BTN_SETTING: {
unk_0x90 = 18; mPendingSceneId = SCENE_SETTING;
flashAnim = ANIM_SETTING_FLASH; flashAnim = ANIM_SETTING_FLASH;
outAnim = ANIM_DATA_MANAGE_OUT; outAnim = ANIM_DATA_MANAGE_OUT;
reserveAllSceneDestruction(SCENE_SETTING, (void*)Setting::ARG_NORMAL_PAGE); reserveAllSceneDestruction(SCENE_SETTING, (void*)Setting::ARG_NORMAL_PAGE);
@@ -596,7 +596,7 @@ namespace ipl {
} }
case BTN_SAVEDATA: { case BTN_SAVEDATA: {
#ifdef KOREAN_BUILD #ifdef KOREAN_BUILD
unk_0x90 = 13; mPendingSceneId = SCENE_MEMORY;
#endif #endif
flashAnim = ANIM_SAVE_DATA_FLASH; flashAnim = ANIM_SAVE_DATA_FLASH;
outAnim = ANIM_CHANNEL_OUT; outAnim = ANIM_CHANNEL_OUT;
@@ -611,7 +611,7 @@ namespace ipl {
break; break;
} }
case BTN_CHANNEL: { case BTN_CHANNEL: {
unk_0x90 = 12; mPendingSceneId = SCENE_CHANNEL_EDIT;
flashAnim = ANIM_CHANNEL_FLASH; flashAnim = ANIM_CHANNEL_FLASH;
outAnim = ANIM_SAVE_DATA_OUT; outAnim = ANIM_SAVE_DATA_OUT;
createChildScene(SCENE_CHANNEL_EDIT, this, NULL); createChildScene(SCENE_CHANNEL_EDIT, this, NULL);
@@ -623,7 +623,7 @@ namespace ipl {
break; break;
} }
case BTN_WII_SAVE: { case BTN_WII_SAVE: {
unk_0x90 = 13; mPendingSceneId = SCENE_MEMORY;
flashAnim = ANIM_WII_SAVE_DATA_FLASH; flashAnim = ANIM_WII_SAVE_DATA_FLASH;
outAnim = ANIM_GC_SAVE_DATA_OUT; outAnim = ANIM_GC_SAVE_DATA_OUT;
createChildScene(SCENE_MEMORY, this, NULL); createChildScene(SCENE_MEMORY, this, NULL);
@@ -632,7 +632,7 @@ namespace ipl {
break; break;
} }
case BTN_GC_SAVE: { case BTN_GC_SAVE: {
unk_0x90 = 14; mPendingSceneId = SCENE_MEMORY_CARD;
flashAnim = ANIM_GC_SAVE_DATA_FLASH; flashAnim = ANIM_GC_SAVE_DATA_FLASH;
outAnim = ANIM_WII_SAVE_DATA_OUT; outAnim = ANIM_WII_SAVE_DATA_OUT;
createChildScene(SCENE_MEMORY_CARD, this, NULL); createChildScene(SCENE_MEMORY_CARD, this, NULL);
@@ -689,7 +689,7 @@ namespace ipl {
} }
void SettingSelect::calc_exit_sequence() { void SettingSelect::calc_exit_sequence() {
switch (unk_0x94) { switch (mExitSeqStep) {
case 0: { case 0: {
prepare_exit_abort(); prepare_exit_abort();
break; break;
@@ -720,13 +720,13 @@ namespace ipl {
System::getBS2Manager()->abort(); System::getBS2Manager()->abort();
System::stopReceiveSchedule(); System::stopReceiveSchedule();
unk_0x94 = 1; mExitSeqStep = 1;
} }
} }
void SettingSelect::wait_decide_se() { void SettingSelect::wait_decide_se() {
if (!snd::getSystem()->isSEActive("WIPL_SE_DECIDE")) { if (!snd::getSystem()->isSEActive("WIPL_SE_DECIDE")) {
unk_0x94 = 2; mExitSeqStep = 2;
} }
} }
@@ -734,7 +734,7 @@ namespace ipl {
__WPADReconnect(TRUE); __WPADReconnect(TRUE);
snd::getSystem()->stopAllSound(20); snd::getSystem()->stopAllSound(20);
System::getFader()->fadeOut(); System::getFader()->fadeOut();
unk_0x94 = 3; mExitSeqStep = 3;
} }
void SettingSelect::finish_exit_reboot() { void SettingSelect::finish_exit_reboot() {

View File

@@ -46,17 +46,17 @@ namespace ipl {
} }
if (mButton != 0) { if (mButton != 0) {
if (down(BTN_INTERACT)) { if (down(BTN_INTERACT)) {
unk_0x08++; mDecideHoldCount++;
} else { } else {
unk_0x08 = 0; mDecideHoldCount = 0;
mButton = 0; mButton = 0;
} }
} else { } else {
unk_0x08 = 0; mDecideHoldCount = 0;
} }
} else { } else {
mButton = 0; mButton = 0;
unk_0x08 = 0; mDecideHoldCount = 0;
} }
switch (mRumbleType) { switch (mRumbleType) {
@@ -109,7 +109,7 @@ namespace ipl {
return NULL; return NULL;
} }
int ipl::controller::Base::decide() const { int ipl::controller::Base::decide() const {
return unk_0x08 == 5; return mDecideHoldCount == 5;
} }
int ipl::controller::Base::rumble(int type) { int ipl::controller::Base::rumble(int type) {
int ret = FALSE; int ret = FALSE;
@@ -130,44 +130,44 @@ namespace ipl {
} }
void ipl::controller::Revolution::read() { void ipl::controller::Revolution::read() {
if (!isValidDpd()) { if (!isValidDpd()) {
unk_0x20->pos.y = 1.0f / 0.0f; mpKpadStatus->pos.y = 1.0f / 0.0f;
unk_0x20->pos.x = 1.0f / 0.0f; mpKpadStatus->pos.x = 1.0f / 0.0f;
unk_0x20->speed = 0.0f; mpKpadStatus->speed = 0.0f;
unk_0x20->vec.y = 0.0f; mpKpadStatus->vec.y = 0.0f;
unk_0x20->vec.x = 0.0f; mpKpadStatus->vec.x = 0.0f;
} }
unk_0x1E = unk_0x1D; mbWasPinching = mbPinching;
if (isValidBtn()) { if (isValidBtn()) {
if (unk_0x1E == 0) { if (mbWasPinching == 0) {
if (down(0x800) && down(0x400)) { if (down(0x800) && down(0x400)) {
unk_0x1D = 1; mbPinching = 1;
} }
} else if (!down(0x800) || !down(0x400)) { } else if (!down(0x800) || !down(0x400)) {
unk_0x1D = 0; mbPinching = 0;
} }
} else { } else {
unk_0x1D = 0; mbPinching = 0;
} }
Base::read(); Base::read();
} }
bool ipl::controller::Revolution::isValidDpd() const { bool ipl::controller::Revolution::isValidDpd() const {
if (unk_0x1C != 0) { if (mbForceInvalid != 0) {
return false; return false;
} }
return (unk_0x20->wpad_err == 0 || unk_0x20->wpad_err == -7) && unk_0x20->dpd_valid_fg != 0; return (mpKpadStatus->wpad_err == 0 || mpKpadStatus->wpad_err == -7) && mpKpadStatus->dpd_valid_fg != 0;
} }
bool ipl::controller::Revolution::isValidBtn() const { bool ipl::controller::Revolution::isValidBtn() const {
u8 val = unk_0x20->wpad_err; u8 val = mpKpadStatus->wpad_err;
return (u8)(val + 7) <= 7 && ((1 << (val + 7)) & 0xA1) != 0; return (u8)(val + 7) <= 7 && ((1 << (val + 7)) & 0xA1) != 0;
} }
bool ipl::controller::Revolution::down(u32 mButton) const { bool ipl::controller::Revolution::down(u32 mButton) const {
bool ret = false; bool ret = false;
if (isValidBtn()) { if (isValidBtn()) {
if (unk_0x20->hold & (mButton & 0xFFFF)) { if (mpKpadStatus->hold & (mButton & 0xFFFF)) {
ret = true; ret = true;
} }
} }
@@ -177,7 +177,7 @@ namespace ipl {
ipl::math::VEC2 ipl::controller::Revolution::getDpdProjectionPos() const { ipl::math::VEC2 ipl::controller::Revolution::getDpdProjectionPos() const {
math::VEC2 ret; math::VEC2 ret;
Vec2 dest; Vec2 dest;
Vec2 src = {unk_0x20->pos.x, unk_0x20->pos.y}; Vec2 src = {mpKpadStatus->pos.x, mpKpadStatus->pos.y};
nw4r::ut::Rect nw4r_rect; // constructor shouldn't be inlined nw4r::ut::Rect nw4r_rect; // constructor shouldn't be inlined
Rect kpad_rect; Rect kpad_rect;
@@ -216,9 +216,9 @@ namespace ipl {
y = fy; y = fy;
} }
ipl::controller::Classic::Classic(int arg0, KPADStatus& arg1) : Revolution(arg0, arg1) { ipl::controller::Classic::Classic(int arg0, KPADStatus& arg1) : Revolution(arg0, arg1) {
unk_0x24.x = 0.01f; mClassicCursorPos.x = 0.01f;
unk_0x24.y = 0.01f; mClassicCursorPos.y = 0.01f;
unk_0x2C = 0; mClassicCursorTimer = 0;
} }
ipl::controller::Base::~Base() { ipl::controller::Base::~Base() {
} }
@@ -230,32 +230,32 @@ namespace ipl {
} }
void ipl::controller::Classic::read() { void ipl::controller::Classic::read() {
if (!Revolution::isValidDpd()) { if (!Revolution::isValidDpd()) {
math::VEC2 lstick(unk_0x20->ex_status.cl.lstick.x, unk_0x20->ex_status.cl.lstick.y); math::VEC2 lstick(mpKpadStatus->ex_status.cl.lstick.x, mpKpadStatus->ex_status.cl.lstick.y);
if (lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f) { if (lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f) {
unk_0x24.x = math::abs_clamp(unk_0x24.x + unk_0x20->ex_status.cl.lstick.x * 0.05f, 1.8f); mClassicCursorPos.x = math::abs_clamp(mClassicCursorPos.x + mpKpadStatus->ex_status.cl.lstick.x * 0.05f, 1.8f);
unk_0x24.y = math::abs_clamp(unk_0x24.y - unk_0x20->ex_status.cl.lstick.y * 0.05f, 1.2f); mClassicCursorPos.y = math::abs_clamp(mClassicCursorPos.y - mpKpadStatus->ex_status.cl.lstick.y * 0.05f, 1.2f);
} }
math::VEC2 rstick = math::VEC2(unk_0x20->ex_status.cl.rstick.x, unk_0x20->ex_status.cl.rstick.y); math::VEC2 rstick = math::VEC2(mpKpadStatus->ex_status.cl.rstick.x, mpKpadStatus->ex_status.cl.rstick.y);
if (getClassicHoldFlag() != 0 || lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f || if (getClassicHoldFlag() != 0 || lstick.x * lstick.x + lstick.y * lstick.y > 0.0036f ||
rstick.x * rstick.x + rstick.y * rstick.y > 0.0036f) { rstick.x * rstick.x + rstick.y * rstick.y > 0.0036f) {
unk_0x2C = 180; mClassicCursorTimer = 180;
} }
if (--unk_0x2C < 0) { if (--mClassicCursorTimer < 0) {
unk_0x2C = 0; mClassicCursorTimer = 0;
} }
} else { } else {
unk_0x24.y = 0.01f; mClassicCursorPos.y = 0.01f;
unk_0x24.x = 0.01f; mClassicCursorPos.x = 0.01f;
unk_0x2C = 0; mClassicCursorTimer = 0;
} }
Revolution::read(); Revolution::read();
} }
int ipl::controller::Classic::getClassicHoldFlag() const { int ipl::controller::Classic::getClassicHoldFlag() const {
return unk_0x20->ex_status.cl.hold; return mpKpadStatus->ex_status.cl.hold;
} }
template <> template <>
f32 ipl::math::abs_clamp<f32>(const f32& x, const f32& y) { f32 ipl::math::abs_clamp<f32>(const f32& x, const f32& y) {
@@ -270,7 +270,7 @@ namespace ipl {
ipl::math::VEC2 ipl::controller::Classic::getHorizon() const { ipl::math::VEC2 ipl::controller::Classic::getHorizon() const {
math::VEC2 ret; math::VEC2 ret;
if (Revolution::isValidDpd()) { if (Revolution::isValidDpd()) {
ret.set(unk_0x20->horizon.x, unk_0x20->horizon.y); ret.set(mpKpadStatus->horizon.x, mpKpadStatus->horizon.y);
} else { } else {
ret.x = 1.0f; ret.x = 1.0f;
ret.y = -0.2679492f; ret.y = -0.2679492f;
@@ -280,9 +280,9 @@ namespace ipl {
ipl::math::VEC2 ipl::controller::Classic::getDpdPos() const { ipl::math::VEC2 ipl::controller::Classic::getDpdPos() const {
math::VEC2 ret; math::VEC2 ret;
if (Revolution::isValidDpd()) { if (Revolution::isValidDpd()) {
ret.set(unk_0x20->pos.x, unk_0x20->pos.y); ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
} else if (unk_0x2C != 0) { } else if (mClassicCursorTimer != 0) {
ret = unk_0x24; ret = mClassicCursorPos;
} else { } else {
ret.x = (1.0f / 0.0f); ret.x = (1.0f / 0.0f);
ret.y = (1.0f / 0.0f); ret.y = (1.0f / 0.0f);
@@ -296,9 +296,9 @@ namespace ipl {
ipl::math::VEC2 ipl::controller::Classic::getDpdProjectionPos() const { ipl::math::VEC2 ipl::controller::Classic::getDpdProjectionPos() const {
math::VEC2 ret; math::VEC2 ret;
if (Revolution::isValidDpd()) { if (Revolution::isValidDpd()) {
ret.set(unk_0x20->pos.x, unk_0x20->pos.y); ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
} else if (unk_0x2C != 0) { } else if (mClassicCursorTimer != 0) {
ret = unk_0x24; ret = mClassicCursorPos;
} else { } else {
ret.set(1.0f / 0.0f, 1.0f / 0.0f); ret.set(1.0f / 0.0f, 1.0f / 0.0f);
} }
@@ -454,7 +454,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
return -1; return -1;
} }
void ipl::controller::Base::setForceInvalid(bool flag) { void ipl::controller::Base::setForceInvalid(bool flag) {
unk_0x1C = flag; mbForceInvalid = flag;
} }
int ipl::controller::Base::getType() const { int ipl::controller::Base::getType() const {
return mType; return mType;
@@ -463,65 +463,65 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
return mChan; return mChan;
} }
KPADStatus* ipl::controller::Revolution::getKPADStatus() const { KPADStatus* ipl::controller::Revolution::getKPADStatus() const {
return unk_0x20; return mpKpadStatus;
} }
f32 ipl::controller::Revolution::getDpdDistance() const { f32 ipl::controller::Revolution::getDpdDistance() const {
return unk_0x20->dist; return mpKpadStatus->dist;
} }
int ipl::controller::Revolution::getReleaseFlag() const { int ipl::controller::Revolution::getReleaseFlag() const {
return unk_0x20->release; return mpKpadStatus->release;
} }
int ipl::controller::Revolution::getTrigFlag() const { int ipl::controller::Revolution::getTrigFlag() const {
return unk_0x20->trig; return mpKpadStatus->trig;
} }
int ipl::controller::Revolution::getHoldFlag() const { int ipl::controller::Revolution::getHoldFlag() const {
return unk_0x20->hold; return mpKpadStatus->hold;
} }
int ipl::controller::Revolution::pinchOffTrg() const { int ipl::controller::Revolution::pinchOffTrg() const {
int ret = 0; int ret = 0;
if (isValidBtn() && unk_0x1D == 0 && unk_0x1E != 0) { if (isValidBtn() && mbPinching == 0 && mbWasPinching != 0) {
ret = 1; ret = 1;
} }
return ret; return ret;
} }
int ipl::controller::Revolution::pinch() const { int ipl::controller::Revolution::pinch() const {
int ret = 0; int ret = 0;
if (isValidBtn() && unk_0x1D != 0) { if (isValidBtn() && mbPinching != 0) {
ret = 1; ret = 1;
} }
return ret; return ret;
} }
int ipl::controller::Revolution::pinchTrg() const { int ipl::controller::Revolution::pinchTrg() const {
int ret = 0; int ret = 0;
if (isValidBtn() && unk_0x1D != 0 && unk_0x1E == 0) { if (isValidBtn() && mbPinching != 0 && mbWasPinching == 0) {
ret = 1; ret = 1;
} }
return ret; return ret;
} }
bool ipl::controller::Revolution::repeat(u32 button) const { bool ipl::controller::Revolution::repeat(u32 button) const {
return down(button) && (unk_0x20->hold & 0x80000000) != 0; return down(button) && (mpKpadStatus->hold & 0x80000000) != 0;
} }
BOOL ipl::controller::Classic::isValidDpdClassic() const { BOOL ipl::controller::Classic::isValidDpdClassic() const {
return unk_0x2C != 0; return mClassicCursorTimer != 0;
} }
bool ipl::controller::Classic::isValidDpd() const { bool ipl::controller::Classic::isValidDpd() const {
if (unk_0x1C != 0) { if (mbForceInvalid != 0) {
return false; return false;
} }
return (Revolution::isValidDpd() != 0) || (unk_0x2C != 0); return (Revolution::isValidDpd() != 0) || (mClassicCursorTimer != 0);
} }
int ipl::controller::Classic::getClassicReleaseFlag() const { int ipl::controller::Classic::getClassicReleaseFlag() const {
return unk_0x20->ex_status.cl.release; return mpKpadStatus->ex_status.cl.release;
} }
int ipl::controller::Classic::getClassicTrigFlag() const { int ipl::controller::Classic::getClassicTrigFlag() const {
return unk_0x20->ex_status.cl.trig; return mpKpadStatus->ex_status.cl.trig;
} }
bool ipl::controller::Classic::upTrg(u32 button) const { bool ipl::controller::Classic::upTrg(u32 button) const {
bool ret = false; bool ret = false;
if (isValidBtn()) { if (isValidBtn()) {
bool pressed = true; bool pressed = true;
KPADStatus* status = unk_0x20; KPADStatus* status = mpKpadStatus;
if ((status->release & (button & 0xFFFF)) == 0) { if ((status->release & (button & 0xFFFF)) == 0) {
if ((status->ex_status.cl.release & (button >> 16)) == 0) { if ((status->ex_status.cl.release & (button >> 16)) == 0) {
pressed = false; pressed = false;
@@ -537,7 +537,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
bool ret = false; bool ret = false;
if (isValidBtn()) { if (isValidBtn()) {
bool pressed = true; bool pressed = true;
KPADStatus* status = unk_0x20; KPADStatus* status = mpKpadStatus;
if ((status->trig & (button & 0xFFFF)) == 0) { if ((status->trig & (button & 0xFFFF)) == 0) {
if ((status->ex_status.cl.trig & (button >> 16)) == 0) { if ((status->ex_status.cl.trig & (button >> 16)) == 0) {
pressed = false; pressed = false;
@@ -553,8 +553,8 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
bool ret = false; bool ret = false;
if (isValidBtn()) { if (isValidBtn()) {
bool pressed = true; bool pressed = true;
if ((unk_0x20->hold & (button & 0xFFFF)) == 0) { if ((mpKpadStatus->hold & (button & 0xFFFF)) == 0) {
if ((unk_0x20->ex_status.cl.hold & (button >> 16)) == 0) { if ((mpKpadStatus->ex_status.cl.hold & (button >> 16)) == 0) {
pressed = false; pressed = false;
} }
} }
@@ -565,15 +565,15 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
return ret; return ret;
} }
ipl::math::VEC2 ipl::controller::Revolution::getHorizon() const { ipl::math::VEC2 ipl::controller::Revolution::getHorizon() const {
return math::VEC2(unk_0x20->horizon.x, unk_0x20->horizon.y); return math::VEC2(mpKpadStatus->horizon.x, mpKpadStatus->horizon.y);
} }
ipl::math::VEC2 ipl::controller::Revolution::getDpdPos() const { ipl::math::VEC2 ipl::controller::Revolution::getDpdPos() const {
return math::VEC2(unk_0x20->pos.x, unk_0x20->pos.y); return math::VEC2(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
} }
bool ipl::controller::Revolution::upTrg(u32 button) const { bool ipl::controller::Revolution::upTrg(u32 button) const {
bool ret = false; bool ret = false;
if (isValidBtn()) { if (isValidBtn()) {
if (unk_0x20->release & (button & 0xFFFF)) { if (mpKpadStatus->release & (button & 0xFFFF)) {
ret = true; ret = true;
} }
} }
@@ -582,7 +582,7 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
bool ipl::controller::Revolution::downTrg(u32 button) const { bool ipl::controller::Revolution::downTrg(u32 button) const {
bool ret = false; bool ret = false;
if (isValidBtn()) { if (isValidBtn()) {
if (unk_0x20->trig & (button & 0xFFFF)) { if (mpKpadStatus->trig & (button & 0xFFFF)) {
ret = true; ret = true;
} }
} }

View File

@@ -152,9 +152,9 @@ namespace ipl {
} }
Revolution::Revolution(int chan, int type, KPADStatus& status) : Base(chan, type, status) { Revolution::Revolution(int chan, int type, KPADStatus& status) : Base(chan, type, status) {
unk_0x1D = 0; mbPinching = 0;
unk_0x1E = 0; mbWasPinching = 0;
unk_0x20 = &status; mpKpadStatus = &status;
} }
Interface* Manager::getMasterController() { Interface* Manager::getMasterController() {