Compare commits

..

26 Commits

Author SHA1 Message Date
coah
463aa6b048 cleanup(puh_ker_tsk): rename unused manager tail fields to pads
The four u32s after entries[] are never read or written.
2026-10-02 14:36:32 -05:00
coah
f508371ca0 cleanup(eZiText): rename work unk_0x00 to getcPhase (#916)
Multi-pass getc state (0..9 / tab) shared by Zi8punct and zi8getc2.
2026-10-02 14:34:22 -05:00
coah
7216fd527f cleanup(eZiText): rename work unk_0x130/138 to uwdDicts/uwdDictCount (#914)
User-word dictionary ptr stack + depth (mirrors pudTable/pudCount).
2026-10-02 14:33:56 -05:00
coah
26e90aa988 cleanup(eZiText): rename work unk_0x1B30 to koAltTables (#913)
Korean path selects alternate hangul tables when non-zero.
2026-10-02 14:33:31 -05:00
coah
e059ea0632 cleanup(puh_ker_tsk): rename entry unk_0x00/04 to thread/stack (#912)
OSThread* used with OSSetThreadPriority; following buffer is task stack.
2026-10-02 14:33:04 -05:00
coah
e6f54e254d cleanup(usb_kbd): rename async mem unk_0x09 to reserved (#911)
HID boot-keyboard reserved byte between modifiers and keycodes.
2026-10-02 14:32:37 -05:00
coah
299a6ca724 cleanup(puh_ker_sem): name semaphore manager fields (#910)
initCount/flags from create args; usedCount active slots; lockSem manager lock.
2026-10-02 14:30:27 -05:00
coah
77439a3268 cleanup(iplChannelManager): name mbDiskChannelReady (#908)
unk_0x1B81 -> mbDiskChannelReady
isUnk_0x1B81 -> isDiskChannelReady
setUnk_0x1B81 -> setDiskChannelReady

Set when BS2 enters RVL_GAME and disk banner info is applied; cleared when
disk banner data is consumed or channel UI dismisses it.

Touched channelSelect / channelTitle callers.

Matching 100% before/after; DOL sha1 unchanged.
2026-10-02 14:29:40 -05:00
coah
f65fac3351 cleanup(WPAD): rename CB unk_0x910 to suppressDisconnect (#907)
When set, comm-timeout path skips WPADiDisconnect and reports TRANSFER.
2026-10-02 14:29:12 -05:00
coah
c7ceb3efe0 cleanup(WPAD): name FS/CL stick min/max calib fields (#903)
DEBUGPrint labels X/Y max/min beside stick centers in calibration.
2026-10-02 14:27:25 -05:00
coah
401d0c88e7 cleanup(eZiText): rename work unk_0x12C to uwdPtrCount (#901)
Count of ZH user-word ptr stack entries (distinct from uwdCount @ 0x1C7).
2026-10-02 14:26:58 -05:00
coah
6cb5ac9ded cleanup(eZiText): name unicode map range fields in work (#900)
Zi8Uni2Ptr OEM remap table + two char ranges + subLanguage gate.
2026-10-02 14:26:31 -05:00
coah
8870c4aa75 cleanup(NWC24FriendList): rename FLHeader unk_0x3C to listFlags (#898)
Written by SetListFlag (OR of flag bits on add).
2026-10-02 14:25:44 -05:00
coah
402687106b cleanup(NWC24FriendList): rename Get/SetUnkFlag helpers (#897)
GetUnkFlag/SetUnkFlag → GetConfirmedBit/SetConfirmedBit;
SetUnkFlag2 → SetListFlag (writes FLHeader unk_0x3C).
2026-10-02 14:25:17 -05:00
coah
2080aeb0cf cleanup(NWC24FriendList): rename FLHeader unk_0x10 to confirmedBits (#896)
Per-friend bitfield; GetUnkFlag==1 sets NWC24_FRIENDSTATUS_CONFIRMED.
2026-10-02 14:24:50 -05:00
coah
1f3d89772e cleanup(iplChannelScriptManager): name CSData mbHasNewMessage (#895)
unk_0x1A -> mbHasNewMessage

Set true when starting channel script, cleared when the title has no new
NWC24 message (isNewMessageThere).

Touched channelSelect / channelTitle / sdChannelTitle writers.

Matching 100% before/after; DOL sha1 unchanged.
2026-10-02 14:24:22 -05:00
coah
f429cd07cc cleanup(CDBRecord): rename unk_0x00 to database (#894)
Held as CDBDatabase*; copied to recordFile->database.
2026-10-02 14:23:55 -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
coah
413c779180 cleanup(eZiText): rename work unk_0x0A to maxWordLength (#886)
Copied to/from options->maxWordLength; assigned from length.
2026-10-02 14:18:33 -05:00
coah
f9ecefa6a2 cleanup(NWC24Work): rename MBox header/entry work buffers (#883)
sendMbcHeader/recvMbcHeader/mbcEntry for cached MBC structures.
2026-10-02 14:17:06 -05:00
coah
320700d49b cleanup(eZiText): rename work unk_0x141E to graphTableId (#882)
Passed to Zi8GetTableAddress / Zi8GetTableSize (often 0x10).
2026-10-02 14:16:39 -05:00
coah
c52153e9f7 cleanup(eZiText): rename work unk_0x141A to capacity (#880)
Copied into options.capacity in zi8getc2; init to 0x100.
2026-10-02 14:15:52 -05:00
coah
899438ff02 cleanup(NWC24MsgObj): rename unk_0xD0 to extraData (#879)
Written by WriteExtraFields during commit.
2026-10-02 14:15:25 -05:00
34 changed files with 357 additions and 357 deletions

View File

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

View File

@@ -365,8 +365,8 @@ namespace ipl {
int getChJumpChanPage() { return mChJumpPage; }
int getChJumpChanIndex() { return mChJumpIndex; }
void setUnk_0x1B81(bool flag) { unk_0x1B81 = flag; }
bool isUnk_0x1B81() { return unk_0x1B81; }
void setDiskChannelReady(bool flag) { mbDiskChannelReady = flag; }
bool isDiskChannelReady() { return mbDiskChannelReady; }
void resetChJumpLoad() { mbLoadedChJump = false; }
bool hasLoadedChJump() { return mbLoadedChJump; }
@@ -399,7 +399,7 @@ namespace ipl {
int mBS2State; // 0x1B7C
bool mbCanRefresh; // 0x1B80
bool unk_0x1B81;
bool mbDiskChannelReady;
u8* mpDiskIconBuf; // 0x1B84
u8* mpDiskBannerBuf; // 0x1B88

View File

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

View File

@@ -204,13 +204,13 @@ typedef struct _ziUwdNode {
} ziUwdNode;
struct __zi8_work_data_s {
ziU8 unk_0x00;
ziU8 getcPhase; // 0x00
ziU8 countOnly; // 0x01
ziU8 unk_0x02[2];
ziLanguageEntry* langEntries; // 0x04
ziU8 unk_0x08;
ziU8 unk_0x09;
ziU8 unk_0x0A;
ziU8 maxWordLength;
ziU8 unk_0x0B;
ziU32 unk_0x0C;
ziU32 unk_0x10;
@@ -226,12 +226,12 @@ struct __zi8_work_data_s {
ziU16 unk_0xA0[0x42];
ziU16* unk_0x124[1];
ziU8* unk_0x128;
ziU8 unk_0x12C;
ziU8 uwdPtrCount; // 0x12C
ziU8 unk_0x12D;
ziU8 unk_0x12E;
ziU8 unk_0x12F;
ziPtr unk_0x130[2];
ziU8 unk_0x138;
ziPtr uwdDicts[2]; // 0x130
ziU8 uwdDictCount; // 0x138
ziU8 unk_0x139[3];
ziU32 unk_0x13C;
ziU8 unk_0x140;
@@ -269,10 +269,10 @@ struct __zi8_work_data_s {
ziU8 unk_0x1414[4];
ziU8 formatCount;
ziU8 unk_0x1419;
ziU16 unk_0x141A;
ziU16 capacity; // 0x141A
ziU8 unk_0x141C;
ziU8 unk_0x141D;
ziU8 unk_0x141E;
ziU8 graphTableId; // 0x141E
ziU8 maxCnt; // 0x141F
ziU8 unk_0x1420[4];
zi8DawgCtx dawgCtx; // 0x1424
@@ -309,26 +309,26 @@ struct __zi8_work_data_s {
ziWChar unk_0x1A92[0x41];
ziU8 unk_0x1B14;
ziU8 unk_0x1B15[3];
ziU16* unk_0x1B18;
ziU16 unk_0x1B1C;
ziU16 unk_0x1B1E;
ziU16 unk_0x1B20;
ziU16 unk_0x1B22;
ziU8 unk_0x1B24;
ziU16* unicodeMap; // 0x1B18
ziU16 unicodeRange1Min; // 0x1B1C
ziU16 unicodeRange1Max; // 0x1B1E
ziU16 unicodeRange2Min; // 0x1B20
ziU16 unicodeRange2Max; // 0x1B22
ziU8 unicodeMapSubLang; // 0x1B24
ziU8 unk_0x1B25[3];
union {
ziU32 word;
struct {
ziU32 msb : 1;
} bits;
} unk_0x1B28;
} pyFuzzy; // 0x1B28
union {
ziU32 word;
struct {
ziU32 msb : 1;
} bits;
} unk_0x1B2C;
ziU8 unk_0x1B30;
ziU8 koAltTables; // 0x1B30
ziU8 unk_0x1B31;
ziU16 unk_0x1B32;
ziU16 unk_0x1B34;

View File

@@ -21,7 +21,7 @@ ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) {
}
if (fc == 0) {
count++;
if (ZI_WORK->unk_0x00 == 0) {
if (ZI_WORK->getcPhase == 0) {
param->candidates[i++] = Zi8PunctTable[j];
if ((param->context & 0x10) != 0) {
param->candidates[i++] = 0x20;
@@ -42,7 +42,7 @@ ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) {
}
j++;
}
if (ZI_WORK->unk_0x00 == 0) {
if (ZI_WORK->getcPhase == 0) {
param->letters = count;
}
return count;

View File

@@ -2,14 +2,14 @@
#include <zi8clib/zitypes.h>
ziU32 Zi8GetZHuwdPtr(ziU32* arg0, ziU16* arg1 ZI_NEED_WORK) {
if (ZI_WORK->unk_0x12C == 0) {
if (ZI_WORK->uwdPtrCount == 0) {
*arg0 = 0;
*arg1 = 0;
Zi8LogError(0x1A5, ZI_WORK);
return 0;
} else {
*arg1 = ZI_WORK->unk_0x124[ZI_WORK->unk_0x12C - 1][1] / 3;
*arg0 = (ziU32)ZI_WORK->unk_0x124[ZI_WORK->unk_0x12C - 1];
*arg1 = ZI_WORK->unk_0x124[ZI_WORK->uwdPtrCount - 1][1] / 3;
*arg0 = (ziU32)ZI_WORK->unk_0x124[ZI_WORK->uwdPtrCount - 1];
*arg0 += 8;
Zi8LogError(0x64, ZI_WORK);
return 1;

View File

@@ -577,27 +577,27 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
if (getMode == 1) {
switch ((int)match.phon2[index] >> 9) {
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;
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;
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;
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;
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;
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;
else if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B28.word)->lANDr) ordinalIndex = 0xF1FF;
else 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 && ((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->lANDr) ordinalIndex = 0xE1FF;
else if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->lANDr) ordinalIndex = 0xF1FF;
else if (((ziFuzzyPYPairs*)&((struct __zi8_work_data_s*)work)->pyFuzzy.word)->nANDl) ordinalIndex = 0xE5FF;
break;
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;
}
} else {
@@ -650,13 +650,13 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
if (getMode == 1) {
switch (match.phon2[index] & 0x1F0) {
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;
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;
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;
}
} else {
@@ -1752,7 +1752,7 @@ tone_candidates:
}
}
user_character_search:
if (((struct __zi8_work_data_s*)work)->unk_0x12C && (getMode != 0 || !firstPhoneticPass) &&
if (((struct __zi8_work_data_s*)work)->uwdPtrCount && (getMode != 0 || !firstPhoneticPass) &&
!options->countOnly && (match.nCand <= 1 || (getMode != 1 && getMode != 2)) &&
Zi8GetZHuwdPtr(&userEntries, &userCount, work) && (getMode != 0 || match.nSeg <= 1)) {
userIndex = 0;

View File

@@ -39,10 +39,10 @@ ziU32 Zi8MatchROMdata0(ziWChar* elements, ziU8 count, ziU8 language,
}
if (mode == 1) acceptPrefix = 0;
} else {
if (ZI_WORK->unk_0x141E != 0 && graphTable == 0xc &&
Zi8GetTableSize(language, ZI_WORK->unk_0x141E, ZI_WORK) != 0) {
graphData = (ziU8*)Zi8GetTableAddress(language, ZI_WORK->unk_0x141E, ZI_WORK);
keyTable = ZI_WORK->unk_0x141E + 1;
if (ZI_WORK->graphTableId != 0 && graphTable == 0xc &&
Zi8GetTableSize(language, ZI_WORK->graphTableId, ZI_WORK) != 0) {
graphData = (ziU8*)Zi8GetTableAddress(language, ZI_WORK->graphTableId, ZI_WORK);
keyTable = ZI_WORK->graphTableId + 1;
} else {
if (Zi8GetTableSize(language, graphTable, ZI_WORK) == 0) {
Zi8LogError(0x961, ZI_WORK);
@@ -232,9 +232,9 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language,
ZI_WORK->unk_0x1768 = 0;
ZI_WORK->matchOffset = 0;
if (group != 0 && *group == 0xc && language == 10 && ZI_WORK->unk_0x141C != 0) {
ZI_WORK->unk_0x141E = 0x10;
ZI_WORK->graphTableId = 0x10;
} else {
ZI_WORK->unk_0x141E = 0;
ZI_WORK->graphTableId = 0;
}
}
search_segment:
@@ -273,14 +273,14 @@ search_segment:
if (ZI_WORK->matchOffset == count) return 0;
ZI_WORK->unk_0x1768++;
status = 0;
ZI_WORK->unk_0x141E = 0;
ZI_WORK->graphTableId = 0;
if (ZI_WORK->dawgCtx.key == 0 && language == 10) {
for (index = 0; index < ZI_WORK->matchOffset; index++) {
switch (ZI_WORK->unk_0x17F4[index]) {
case 0x61:
case 0x6f:
case 0x75:
ZI_WORK->unk_0x141E = 0x10;
ZI_WORK->graphTableId = 0x10;
goto search_segment;
}
}

View File

@@ -32,9 +32,9 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
ziBool Zi8ZHsetPYfuzzyPairs(ziFuzzyPYPairs pairs ZI_NEED_WORK) {
if (pairs.ziDefault) {
ZI_WORK->unk_0x1B28.word = *(const ziU32*)&Zi8PYdefaultFuzzyPairs;
ZI_WORK->pyFuzzy.word = *(const ziU32*)&Zi8PYdefaultFuzzyPairs;
} else {
ZI_WORK->unk_0x1B28.word = *(ziU32*)&pairs;
ZI_WORK->pyFuzzy.word = *(ziU32*)&pairs;
}
return 1;
}
@@ -158,7 +158,7 @@ static ziBool Zi8AlphaSignature(ziGetParam* parameters, ziBool countOnly ZI_NEED
length = length - parameters->firstCandidate;
if (countOnly != 0) {
parameters->letters = length;
ZI_WORK->unk_0x0A = 0xff;
ZI_WORK->maxWordLength = 0xff;
return 1;
}
if (parameters->maxCandidates < length) length = parameters->maxCandidates;
@@ -175,7 +175,7 @@ static ziBool Zi8AlphaSignature(ziGetParam* parameters, ziBool countOnly ZI_NEED
current = signatures.first;
length = signatures.length;
}
if (length > ZI_WORK->unk_0x0A) length = ZI_WORK->unk_0x0A;
if (length > ZI_WORK->maxWordLength) length = ZI_WORK->maxWordLength;
if ((parameters->elementCount < ZI_WORK->unk_0x140C[0] ||
(parameters->getOptions & 0x7e) == 2) && length > parameters->elementCount) {
length = parameters->elementCount;
@@ -185,7 +185,7 @@ static ziBool Zi8AlphaSignature(ziGetParam* parameters, ziBool countOnly ZI_NEED
if (parameters->letters == 2) {
current = signatures.second;
length = secondLength;
if (length > ZI_WORK->unk_0x0A) length = ZI_WORK->unk_0x0A;
if (length > ZI_WORK->maxWordLength) length = ZI_WORK->maxWordLength;
if ((parameters->elementCount < ZI_WORK->unk_0x140C[0] ||
(parameters->getOptions & 0x7e) == 2) && length > parameters->elementCount) {
length = parameters->elementCount;
@@ -194,7 +194,7 @@ static ziBool Zi8AlphaSignature(ziGetParam* parameters, ziBool countOnly ZI_NEED
*output++ = 0;
}
*output++ = 0;
ZI_WORK->unk_0x0A = 0xff;
ZI_WORK->maxWordLength = 0xff;
return 1;
}
@@ -226,7 +226,7 @@ static ziBool Zi8ZhSignature(ziGetParam* parameters, ziBool countOnly ZI_NEED_WO
length = length - parameters->firstCandidate;
if (countOnly != 0) {
parameters->letters = length;
ZI_WORK->unk_0x0A = 0xff;
ZI_WORK->maxWordLength = 0xff;
return 1;
}
if (parameters->maxCandidates < length) length = parameters->maxCandidates;
@@ -279,13 +279,13 @@ static ziBool Zi8ZhSignature(ziGetParam* parameters, ziBool countOnly ZI_NEED_WO
ziU8 _Zi8GetCandidates(ziGetParam* parameters ZI_NEED_WORK) {
ZiCandidateOptions options = {0};
options.capacity = ZI_WORK->unk_0x141A;
options.capacity = ZI_WORK->capacity;
return Zi8GetCandidatesOrCount(parameters, &options, ZI_WORK);
}
ziU8 _Zi8CheckCandidates(ziGetParam* parameters ZI_NEED_WORK) {
ZiCandidateOptions options = {0};
options.capacity = ZI_WORK->unk_0x141A;
options.capacity = ZI_WORK->capacity;
options.flags = 1;
return Zi8GetCandidatesOrCount(parameters, &options, ZI_WORK);
}
@@ -324,7 +324,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
saved.savedCandidates = 0;
saved.restoreCandidates = 0;
if (options->lookupMode == '\0') {
if (((ZI_WORK->unk_0x00 == '\t') && (parameters->elementCount != 0)) &&
if (((ZI_WORK->getcPhase == '\t') && (parameters->elementCount != 0)) &&
(((parameters->elements[parameters->elementCount - 1] == 0xEFF8 &&
((ziU8)Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK) != 0)) ||
((parameters->elements[parameters->elementCount - 1] == 0xEF04 &&
@@ -339,22 +339,22 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) {
switch (parameters->language) {
case 1:
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
switch(ZI_WORK->unk_0x00) {
if ((ZI_WORK->getcPhase == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
switch(ZI_WORK->getcPhase) {
case '\0':
if (parameters->elements[0] == 0xEF04) {
ZI_WORK->countOnly = options->countOnly;
ZI_WORK->unk_0x00 = '\x01';
ZI_WORK->getcPhase = '\x01';
}
break;
case '\x02':
case '\x04':
case '\x06':
if (parameters->elements[0] == 0xEF04) {
++ZI_WORK->unk_0x00;
++ZI_WORK->getcPhase;
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\x01':
@@ -362,17 +362,17 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
case '\x05':
case '\a':
if (parameters->elements[0] == 0xEF01) {
++ZI_WORK->unk_0x00;
++ZI_WORK->getcPhase;
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\b':
case '\t':
if ((parameters->elements[0] == 0xEF04) &&
((ziU8)Zi8ZhSignature(parameters,options->countOnly,ZI_WORK) != 0)) {
ZI_WORK->unk_0x00 = '\t';
ZI_WORK->getcPhase = '\t';
candidateCount = (unsigned int)parameters->letters;
if (options->countOnly != '\0') {
parameters->letters = 0;
@@ -381,10 +381,10 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
return candidateCount;
}
default:
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
if ((ZI_WORK->unk_0x00 == '\0') && (parameters->elements[0] == 0xEF04)) {
ZI_WORK->unk_0x00 = '\x01';
if ((ZI_WORK->getcPhase == '\0') && (parameters->elements[0] == 0xEF04)) {
ZI_WORK->getcPhase = '\x01';
}
}
break;
@@ -400,75 +400,75 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
break;
case 0x11:
default:
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
switch(ZI_WORK->unk_0x00) {
if ((ZI_WORK->getcPhase == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
switch(ZI_WORK->getcPhase) {
case '\0':
if (parameters->elements[0] == 0xEFF2) {
ZI_WORK->countOnly = options->countOnly;
ZI_WORK->unk_0x00 = '\x01';
ZI_WORK->getcPhase = '\x01';
}
break;
case '\x01':
if (parameters->elements[0] == 0xEFF3) {
ZI_WORK->unk_0x00 = '\x02';
ZI_WORK->getcPhase = '\x02';
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\x02':
if (parameters->elements[0] == 0xEFF5) {
ZI_WORK->unk_0x00 = '\x03';
ZI_WORK->getcPhase = '\x03';
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\x03':
if (parameters->elements[0] == 0xEFF7) {
ZI_WORK->unk_0x00 = '\x04';
ZI_WORK->getcPhase = '\x04';
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\x04':
if (parameters->elements[0] == 0xEFF8) {
ZI_WORK->unk_0x00 = '\x05';
ZI_WORK->getcPhase = '\x05';
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\x05':
if (parameters->elements[0] == 0xEFF9) {
ZI_WORK->unk_0x00 = '\x06';
ZI_WORK->getcPhase = '\x06';
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\x06':
if (parameters->elements[0] == 0xEFF2) {
ZI_WORK->unk_0x00 = '\a';
ZI_WORK->getcPhase = '\a';
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\a':
if (parameters->elements[0] == 0xEFF5) {
ZI_WORK->unk_0x00 = '\b';
ZI_WORK->getcPhase = '\b';
}
else {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
break;
case '\b':
case '\t':
if ((parameters->elements[0] == 0xEFF8) &&
((ziU8)Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK) != 0)) {
ZI_WORK->unk_0x00 = '\t';
ZI_WORK->getcPhase = '\t';
candidateCount = (unsigned int)parameters->letters;
if (options->countOnly != '\0') {
parameters->letters = 0;
@@ -477,24 +477,24 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
return candidateCount;
}
default:
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
if ((ZI_WORK->unk_0x00 == '\0') && (parameters->elements[0] == 0xEFF2)) {
ZI_WORK->unk_0x00 = '\x01';
if ((ZI_WORK->getcPhase == '\0') && (parameters->elements[0] == 0xEFF2)) {
ZI_WORK->getcPhase = '\x01';
}
}
break;
}
}
else if (1 < parameters->elementCount) {
ZI_WORK->unk_0x00 = '\0';
ZI_WORK->getcPhase = '\0';
}
}
ZI_WORK->subLanguage = parameters->subLanguage;
ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1,ZI_WORK) & 2;
options->maxCount = ZI_WORK->unk_0x10;
options->maxWordLength = ZI_WORK->unk_0x0A;
ZI_WORK->unk_0x0A = -1;
options->maxWordLength = ZI_WORK->maxWordLength;
ZI_WORK->maxWordLength = -1;
if ((ziU8)Zi8LangSupported(parameters->language,ZI_WORK) == 0) {
Zi8LogError(0x163,ZI_WORK);
return 0;
@@ -711,6 +711,6 @@ void Zi8Memcpy(ziU8* destination, ziU8* source, ziS32 count) {
}
ziBool Zi8SetMaxWordLength(ziU8 length ZI_NEED_WORK) {
ZI_WORK->unk_0x0A = length;
ZI_WORK->maxWordLength = length;
return 1;
}

View File

@@ -18,12 +18,12 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
Zi8Memset(__zi8_work_data, 0, 0x1B44);
ZI_WORK->unk_0x08 = 1;
ZI_WORK->unk_0x09 = 1;
ZI_WORK->unk_0x0A = 0xFF;
ZI_WORK->maxWordLength = 0xFF;
ZI_WORK->unk_0x10 = 0x64;
*(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF;
ZI_WORK->separator = 0x20;
ZI_WORK->unk_0x1C[2] = 0;
ZI_WORK->unk_0x1B30 = 0;
ZI_WORK->koAltTables = 0;
ZI_WORK->unk_0x1B3A = 0;
ZI_WORK->unk_0x1B36 = 0;
ZI_WORK->unk_0x1B32 = 0;
@@ -44,17 +44,17 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
ZI_WORK->unk_0x1874 = 0x2D;
ZI_WORK->language = 0;
ZI_WORK->unk_0x1C[3] = 0;
ZI_WORK->unk_0x141A = 0x100;
ZI_WORK->capacity = 0x100;
Zi8SetLatinSearchOrder(0, 0, ZI_WORK);
ZADP_Zi8SetPDremoveOpt(1, ZI_WORK);
ZI_WORK->unk_0x17 = 5;
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;
zyFuzzy = ZI_WORK->unk_0x1B2C.word;
pzyFuzzy = &zyFuzzy;
Zi8ZHsetZYfuzzyPairs(pzyFuzzy, ZI_WORK);
pyFuzzy = ZI_WORK->unk_0x1B28.word;
pyFuzzy = ZI_WORK->pyFuzzy.word;
ppyFuzzy = &pyFuzzy;
Zi8ZHsetPYfuzzyPairs(ppyFuzzy, ZI_WORK);
Zi8SetParentalControls(2, ZI_WORK);

View File

@@ -65,19 +65,19 @@ ziU16 Zi8Uni2Ptr(ziU16 ch, ziE12* buf ZI_NEED_WORK) {
}
}
e = (ziU8*)table;
if (WORKP->unk_0x1B18 != ZI8_NULL && WORKP->unk_0x1B24 == WORKP->subLanguage) {
if ((ziU16)ch >= WORKP->unk_0x1B1C && (ziU16)ch <= WORKP->unk_0x1B1E) {
i = (ziU16)(ch - WORKP->unk_0x1B1C);
if (WORKP->unicodeMap != ZI8_NULL && WORKP->unicodeMapSubLang == WORKP->subLanguage) {
if ((ziU16)ch >= WORKP->unicodeRange1Min && (ziU16)ch <= WORKP->unicodeRange1Max) {
i = (ziU16)(ch - WORKP->unicodeRange1Min);
goto map;
}
if ((ziU16)ch >= WORKP->unk_0x1B20 && (ziU16)ch <= WORKP->unk_0x1B22) {
i = (ziU16)(WORKP->unk_0x1B1E + (ch - WORKP->unk_0x1B20) -
WORKP->unk_0x1B1C + 1);
if ((ziU16)ch >= WORKP->unicodeRange2Min && (ziU16)ch <= WORKP->unicodeRange2Max) {
i = (ziU16)(WORKP->unicodeRange1Max + (ch - WORKP->unicodeRange2Min) -
WORKP->unicodeRange1Min + 1);
goto map;
}
return 0xFFFF;
map:
i = WORKP->unk_0x1B18[i];
i = WORKP->unicodeMap[i];
if (i != 0xFFFF) {
e = (ziU8*)table + i * 0xC;
if (hi == e[6] && lo == e[7]) {

View File

@@ -105,11 +105,11 @@ ziU8 Zi8MatchUWDdata(ziWChar* pattern, ziU8 length, ziWChar* currentWord, ziU16
int position;
int prefixLength;
Zi8LogError(100, __zi8_work_data);
if (!(ZI_WORK->unk_0x138 <= 2 && ZI_WORK->unk_0x138 != 0 && ZI_WORK->unk_0x130[ZI_WORK->unk_0x138 - 1] != 0)) {
if (!(ZI_WORK->uwdDictCount <= 2 && ZI_WORK->uwdDictCount != 0 && ZI_WORK->uwdDicts[ZI_WORK->uwdDictCount - 1] != 0)) {
Zi8ReplaceLastError(0x19C, __zi8_work_data);
return 0;
}
dictionary = ZI_WORK->unk_0x130[ZI_WORK->unk_0x138 - 1];
dictionary = ZI_WORK->uwdDicts[ZI_WORK->uwdDictCount - 1];
if (continuation != 0) {
text = (ziU8*)Zi8_814803F4(__zi8_work_data);
entryLength = 0;

View File

@@ -104,7 +104,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
state.characterIndex,
(state.elementIndex - currentCharacter) - 1,
workData);
if ((((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 1)) {
if ((((struct __zi8_work_data_s*)workData)->koAltTables == 1)) {
switch (state.characterIndex) {
case 1:
selectedTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 0x1E, workData);
@@ -179,7 +179,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument,
} else {
params->candidates[(ziU8)result] =
((ziU16)selectedTable[state.nextIndex * 2] << 8) | (selectedTable + state.nextIndex * 2)[1];
if ((state.tableCount6 != 0) && (((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 0)) {
if ((state.tableCount6 != 0) && (((struct __zi8_work_data_s*)workData)->koAltTables == 0)) {
params->candidates[(ziU8)result] += state.inputIndex * state.tableCount3;
}
result++;
@@ -249,7 +249,7 @@ ziU8 Zi8MatchKoreanSequence(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 c
firstCharacter = input[0];
mappedCharacter = 0xFF;
if (((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 0) {
if (((struct __zi8_work_data_s*)workData)->koAltTables == 0) {
table = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 3, workData);
tableCount = Zi8GetTableCount(ZI8_LANG_KO, 3, workData);
} else {

View File

@@ -133,11 +133,11 @@ typedef struct WPADExtConfig {
union {
struct WPADFSConfig {
s16 stickXCenter; // 0x00
s16 unk_0x02; // 0x02
s16 unk_0x04; // 0x04
s16 stickXMin; // 0x02
s16 stickXMax; // 0x04
s16 stickYCenter; // 0x06
s16 unk_0x08; // 0x08
s16 unk_0x0A; // 0x0A
s16 stickYMin; // 0x08
s16 stickYMax; // 0x0A
s16 accX0g; // 0x0C
s16 accY0g; // 0x0E
@@ -150,18 +150,18 @@ typedef struct WPADExtConfig {
struct WPADCLConfig {
s16 lStickXCenter; // 0x00
s16 unk_0x02; // 0x02
s16 unk_0x04; // 0x04
s16 lStickXMin; // 0x02
s16 lStickXMax; // 0x04
s16 lStickYCenter; // 0x06
s16 unk_0x08; // 0x08
s16 unk_0x0A; // 0x0A
s16 lStickYMin; // 0x08
s16 lStickYMax; // 0x0A
s16 rStickXCenter; // 0x0C
s16 unk_0x0E; // 0x0E
s16 unk_0x10; // 0x10
s16 rStickXMin; // 0x0E
s16 rStickXMax; // 0x10
s16 rStickYCenter; // 0x12
s16 unk_0x14; // 0x14
s16 unk_0x16; // 0x16
s16 rStickYMin; // 0x14
s16 rStickYMax; // 0x16
u8 triggerLZero; // 0x18
u8 triggerRZero; // 0x19
@@ -171,7 +171,7 @@ typedef struct WPADExtConfig {
typedef struct WPADCB {
WPADGameInfo gameInfo; // 0x00
s32 unk_0x38[2];
s32 gameInfoStatus[2]; // 0x38
u8 rxBufMain[RX_BUFFER_SIZE]; // 0x40
u8 rxBufs[2][RX_BUFFER_SIZE]; // 0xA0
WPADCommandQueue stdCmdQueue; // 0x160
@@ -223,7 +223,7 @@ typedef struct WPADCB {
u16 filterDiffExt; // 0x900
u16 filterSameExt; // 0x902
s64 lastReportSendTime; // 0x908
u8 unk_0x910;
u8 suppressDisconnect; // 0x910
u8 calibrated; // 0x911
u16 comboHeld; // 0x912
u8 encryptionKey[16]; // 0x914

View File

@@ -7,12 +7,12 @@
static struct {
struct {
OSSemaphore* sem; // 0x00
u32 unk_0x04;
u32 unk_0x08;
u32 initCount;
u32 flags;
} entries[MAX_PUH_SEM]; // 0x00
u32 unk_0x90;
OSSemaphore* unk_0x94;
u8 unk_0x98[0x0C];
u32 usedCount;
OSSemaphore* lockSem;
u8 pad[0x0C];
} st_uhs_ker_sem_mng;
static OSSemaphore st_uhf_ker_sem[MAX_PUH_SEM];
@@ -20,17 +20,17 @@ static OSSemaphore st_uhf_ker_sem[MAX_PUH_SEM];
static s32 st_uhs_ker_sem_status;
static int uhf_ker_sem_inline_0() {
if (st_uhs_ker_sem_status != 1 || st_uhs_ker_sem_mng.unk_0x94 == 0) {
if (st_uhs_ker_sem_status != 1 || st_uhs_ker_sem_mng.lockSem == 0) {
return -1;
} else {
OSWaitSemaphore(st_uhs_ker_sem_mng.unk_0x94);
OSWaitSemaphore(st_uhs_ker_sem_mng.lockSem);
return 0;
}
}
static void uhf_ker_sem_inline_1() {
if (st_uhs_ker_sem_status == 1 && st_uhs_ker_sem_mng.unk_0x94 != 0) {
OSSignalSemaphore(st_uhs_ker_sem_mng.unk_0x94);
if (st_uhs_ker_sem_status == 1 && st_uhs_ker_sem_mng.lockSem != 0) {
OSSignalSemaphore(st_uhs_ker_sem_mng.lockSem);
}
}
@@ -48,7 +48,7 @@ s32 uhf_ker_create_sem(u32 initCount, int flags) {
return -5;
}
if (st_uhs_ker_sem_mng.unk_0x90 == 12) {
if (st_uhs_ker_sem_mng.usedCount == 12) {
uhf_ker_sem_inline_1();
return -24;
}
@@ -65,9 +65,9 @@ s32 uhf_ker_create_sem(u32 initCount, int flags) {
}
st_uhs_ker_sem_mng.entries[i].sem = sem;
st_uhs_ker_sem_mng.entries[i].unk_0x04 = initCount;
st_uhs_ker_sem_mng.entries[i].unk_0x08 = flags;
st_uhs_ker_sem_mng.unk_0x90++;
st_uhs_ker_sem_mng.entries[i].initCount = initCount;
st_uhs_ker_sem_mng.entries[i].flags = flags;
st_uhs_ker_sem_mng.usedCount++;
uhf_ker_sem_inline_1();
@@ -97,9 +97,9 @@ s32 uhf_ker_delete_sem(int sem) {
}
st_uhs_ker_sem_mng.entries[sem - 1].sem = NULL;
st_uhs_ker_sem_mng.entries[sem - 1].unk_0x04 = 0;
st_uhs_ker_sem_mng.entries[sem - 1].unk_0x08 = 0;
st_uhs_ker_sem_mng.unk_0x90--;
st_uhs_ker_sem_mng.entries[sem - 1].initCount = 0;
st_uhs_ker_sem_mng.entries[sem - 1].flags = 0;
st_uhs_ker_sem_mng.usedCount--;
uhf_ker_sem_inline_1();

View File

@@ -6,13 +6,13 @@
static struct {
struct {
OSThread* unk_0x00;
u8 unk_0x04[0x33C];
OSThread* thread; // 0x00
u8 stack[0x33C]; // 0x04
} entries[MAX_PUH_TSK]; // 0x00
u32 unk_0x680;
u32 unk_0x684;
u32 unk_0x688;
u32 unk_0x68C;
u32 pad_0x680;
u32 pad_0x684;
u32 pad_0x688;
u32 pad_0x68C;
} st_uhs_ker_tsk_mng;
s32 uhf_ker_set_priority(int tsk, int priority) {
@@ -24,9 +24,9 @@ s32 uhf_ker_set_priority(int tsk, int priority) {
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 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

@@ -20,7 +20,7 @@ typedef struct _usbKbdAsyncMem {
u32 state; // 0x00
void* kbd; // 0x04
char modifiers; // 0x08
u8 unk_0x09;
u8 reserved; // 0x09
u8 keys[6]; // 0x0A
} usbKbdAsyncMem;

View File

@@ -190,7 +190,7 @@ static s32 WPADiSendData(s32 chan, WPADCommand command) {
if (status == WPAD_ERR_COMMUNICATION_ERROR) {
if ((s32)OSTicksToSeconds(__OSGetSystemTime() - p->lastReportSendTime) > 1 && _sleepTime != 0) {
if (!p->unk_0x910) {
if (!p->suppressDisconnect) {
p->lastReportSendTime = __OSGetSystemTime();
WPADiDisconnect(chan, FALSE);
} else {
@@ -1263,7 +1263,7 @@ static void __ClearControlBlock(s32 chan) {
p->lastControllerDataUpdate = __OSGetSystemTime();
p->lastReportSendTime = __OSGetSystemTime();
p->unk_0x910 = 0;
p->suppressDisconnect = 0;
p->unk_0x8C9 = 0;
p->unk_0x8C4 = 0;
p->wmReadDataPtr = NULL;
@@ -1298,8 +1298,8 @@ static void __ClearControlBlock(s32 chan) {
memset(&p->decryptXorTable, 0, sizeof(p->decryptXorTable));
memset(&p->gameInfo, 0, sizeof(WPADGameInfo));
p->unk_0x38[0] = -1;
p->unk_0x38[1] = -1;
p->gameInfoStatus[0] = -1;
p->gameInfoStatus[1] = -1;
p->stdCmdQueue.buffer = p->stdCmdQueueList;
p->stdCmdQueue.capacity = ARRAY_LENGTH(p->stdCmdQueueList);
@@ -2692,7 +2692,7 @@ static void __SendData(s32 chan, WPADCommand command) {
u32 time;
memcpy(&time, command.dataBuf, sizeof(u32));
p->lastReportSendTime = __OSGetSystemTime() + time;
p->unk_0x910 = 1;
p->suppressDisconnect = 1;
return;
}
default: {
@@ -2704,7 +2704,7 @@ static void __SendData(s32 chan, WPADCommand command) {
p->cmdBlkCB = command.cmdCB;
p->lastReportID = reportID;
p->lastReportSendTime = __OSGetSystemTime() + OSSecondsToTicks(2);
p->unk_0x910 = 0;
p->suppressDisconnect = 0;
OSRestoreInterrupts(enabled);
}

View File

@@ -393,48 +393,48 @@ static void getExtConfig(s32 chan, s32 result) {
p_wpd->extConfig.u.fs.accX1g = (s16)((u16)(((u16)(p_buf[index + 4]) << 2) & 0xFFFC) | (u16)(((u16)(p_buf[index + 7]) >> 4) & 3));
p_wpd->extConfig.u.fs.accY1g = (s16)((u16)(((u16)(p_buf[index + 5]) << 2) & 0xFFFC) | (u16)(((u16)(p_buf[index + 7]) >> 2) & 3));
p_wpd->extConfig.u.fs.accZ1g = (s16)((u16)(((u16)(p_buf[index + 6]) << 2) & 0xFFFC) | (u16)(((u16)(p_buf[index + 7])) & 3));
p_wpd->extConfig.u.fs.unk_0x04 = (s8)p_buf[index + 8];
p_wpd->extConfig.u.fs.unk_0x02 = (s8)p_buf[index + 9];
p_wpd->extConfig.u.fs.stickXMax = (s8)p_buf[index + 8];
p_wpd->extConfig.u.fs.stickXMin = (s8)p_buf[index + 9];
p_wpd->extConfig.u.fs.stickXCenter = (s8)p_buf[index + 10];
p_wpd->extConfig.u.fs.unk_0x0A = (s8)p_buf[index + 11];
p_wpd->extConfig.u.fs.unk_0x08 = (s8)p_buf[index + 12];
p_wpd->extConfig.u.fs.stickYMax = (s8)p_buf[index + 11];
p_wpd->extConfig.u.fs.stickYMin = (s8)p_buf[index + 12];
p_wpd->extConfig.u.fs.stickYCenter = (s8)p_buf[index + 13];
DEBUGPrint("0G: fsaccX = %d, fsaccY = %d, fsaccZ = %d\n", p_wpd->extConfig.u.fs.accX0g, p_wpd->extConfig.u.fs.accY0g,
p_wpd->extConfig.u.fs.accZ0g);
DEBUGPrint("1G: fsaccX = %d, fsaccY = %d, fsaccZ = %d\n", p_wpd->extConfig.u.fs.accX1g, p_wpd->extConfig.u.fs.accY1g,
p_wpd->extConfig.u.fs.accZ1g);
DEBUGPrint("FS: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.fs.stickXCenter, p_wpd->extConfig.u.fs.unk_0x04,
p_wpd->extConfig.u.fs.unk_0x02);
DEBUGPrint("FS: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.fs.stickYCenter, p_wpd->extConfig.u.fs.unk_0x0A,
p_wpd->extConfig.u.fs.unk_0x08);
DEBUGPrint("FS: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.fs.stickXCenter, p_wpd->extConfig.u.fs.stickXMax,
p_wpd->extConfig.u.fs.stickXMin);
DEBUGPrint("FS: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.fs.stickYCenter, p_wpd->extConfig.u.fs.stickYMax,
p_wpd->extConfig.u.fs.stickYMin);
}
break;
case WPAD_DEV_CLASSIC:
p_wpd->extConfig.u.cl.unk_0x04 = (s8)p_buf[index + 0];
p_wpd->extConfig.u.cl.unk_0x02 = (s8)p_buf[index + 1];
p_wpd->extConfig.u.cl.lStickXMax = (s8)p_buf[index + 0];
p_wpd->extConfig.u.cl.lStickXMin = (s8)p_buf[index + 1];
p_wpd->extConfig.u.cl.lStickXCenter = (s8)p_buf[index + 2];
p_wpd->extConfig.u.cl.unk_0x0A = (s8)p_buf[index + 3];
p_wpd->extConfig.u.cl.unk_0x08 = (s8)p_buf[index + 4];
p_wpd->extConfig.u.cl.lStickYMax = (s8)p_buf[index + 3];
p_wpd->extConfig.u.cl.lStickYMin = (s8)p_buf[index + 4];
p_wpd->extConfig.u.cl.lStickYCenter = (s8)p_buf[index + 5];
p_wpd->extConfig.u.cl.unk_0x10 = (s8)p_buf[index + 6];
p_wpd->extConfig.u.cl.unk_0x0E = (s8)p_buf[index + 7];
p_wpd->extConfig.u.cl.rStickXMax = (s8)p_buf[index + 6];
p_wpd->extConfig.u.cl.rStickXMin = (s8)p_buf[index + 7];
p_wpd->extConfig.u.cl.rStickXCenter = (s8)p_buf[index + 8];
p_wpd->extConfig.u.cl.unk_0x16 = (s8)p_buf[index + 9];
p_wpd->extConfig.u.cl.unk_0x14 = (s8)p_buf[index + 10];
p_wpd->extConfig.u.cl.rStickYMax = (s8)p_buf[index + 9];
p_wpd->extConfig.u.cl.rStickYMin = (s8)p_buf[index + 10];
p_wpd->extConfig.u.cl.rStickYCenter = (s8)p_buf[index + 11];
p_wpd->extConfig.u.cl.triggerLZero = p_buf[index + 12];
p_wpd->extConfig.u.cl.triggerRZero = p_buf[index + 13];
DEBUGPrint("CL: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.lStickXCenter, p_wpd->extConfig.u.cl.unk_0x04,
p_wpd->extConfig.u.cl.unk_0x02);
DEBUGPrint("CL: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.lStickYCenter, p_wpd->extConfig.u.cl.unk_0x0A,
p_wpd->extConfig.u.cl.unk_0x08);
DEBUGPrint("CR: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.rStickXCenter, p_wpd->extConfig.u.cl.unk_0x10,
p_wpd->extConfig.u.cl.unk_0x0E);
DEBUGPrint("CR: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.rStickYCenter, p_wpd->extConfig.u.cl.unk_0x16,
p_wpd->extConfig.u.cl.unk_0x14);
DEBUGPrint("CL: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.lStickXCenter, p_wpd->extConfig.u.cl.lStickXMax,
p_wpd->extConfig.u.cl.lStickXMin);
DEBUGPrint("CL: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.lStickYCenter, p_wpd->extConfig.u.cl.lStickYMax,
p_wpd->extConfig.u.cl.lStickYMin);
DEBUGPrint("CR: X = %d, X max = %d, X min = %d\n", p_wpd->extConfig.u.cl.rStickXCenter, p_wpd->extConfig.u.cl.rStickXMax,
p_wpd->extConfig.u.cl.rStickXMin);
DEBUGPrint("CR: Y = %d, Y max = %d, Y min = %d\n", p_wpd->extConfig.u.cl.rStickYCenter, p_wpd->extConfig.u.cl.rStickYMax,
p_wpd->extConfig.u.cl.rStickYMin);
DEBUGPrint("LR: L = %d, R = %d\n", p_wpd->extConfig.u.cl.triggerLZero, p_wpd->extConfig.u.cl.triggerRZero);
break;
}
@@ -547,9 +547,9 @@ static void getGameInfo(s32 chan, s32 result, u8 index) {
if (p_info->checksum == sum) {
memcpy(&p_wpd->gameInfo, p_buf, sizeof(WPADMEMGameInfo));
p_wpd->unk_0x38[index] = WPAD_ERR_NONE;
p_wpd->gameInfoStatus[index] = WPAD_ERR_NONE;
} else {
p_wpd->unk_0x38[index] = WPAD_ERR_INVALID;
p_wpd->gameInfoStatus[index] = WPAD_ERR_INVALID;
}
}
}

View File

@@ -17,9 +17,9 @@ typedef struct NWC24FLHeader {
u32 version; // 0x04
u32 infoCount; // 0x08
u32 registeredCount; // 0x0C
u32 unk_0x10[4];
u32 confirmedBits[4]; // 0x10
u32 unk_0x20[7];
u32 unk_0x3C;
u32 listFlags; // 0x3C
NWC24UserId friendIds[NWC24_FRIEND_INFO_MAX]; // 0x40
} NWC24FLHeader;

View File

@@ -73,7 +73,7 @@ typedef struct NWC24MsgObjPrivate {
};
u32 raw;
} msgBoardFlags; // 0xCC
NWC24Data unk_0xD0;
NWC24Data extraData; // 0xD0
NWC24Data faceData; // 0xD8
NWC24Data altName; // 0xE0
u32 textSize; // 0xE4

View File

@@ -26,9 +26,9 @@ extern struct NWC24Work {
u8 configData[1024]; // 0x1300
u8 unk_0x1700[128]; // 0x1700
u8 unk_0x1780[128]; // 0x1780
u8 unk_0x1800[256]; // 0x1800
u8 sendMbcHeader[128]; // 0x1700
u8 recvMbcHeader[128]; // 0x1780
u8 mbcEntry[256]; // 0x1800
u8 base64Work[256]; // 0x1900
u8 unk_0x1A00[4096]; // 0x1A00

View File

@@ -62,7 +62,7 @@ typedef struct _CDBRecordKey {
} CDBRecordKey;
typedef struct _CDBRecord {
u32 unk_0x00;
u32 database; // 0x00
void* cryptBuf; // 0x04
CDBRecordKey key; // 0x08
void* file; // 0x38

View File

@@ -58,7 +58,7 @@ void CDBRecordInstanceInit(CDBRecordFile* recordFile, CDBRecord* record, int typ
recordFile->used = 1;
OSUnlockMutex((OSMutex*)recordFile);
recordFile->allocFlag = type;
recordFile->database = record->unk_0x00;
recordFile->database = record->database;
CDBAttrInit(&recordFile->attr);
CDBRecordKeyCopy(&recordFile->key, &record->key);
}
@@ -73,7 +73,7 @@ BOOL CDBRecordInstanceIsUsed(CDBRecordFile* recordFile) {
void CDBRecordInitDescriptor(CDBRecord* record, CDBDatabase* database, CDBRecordKey* key) {
CDBLock();
record->unk_0x00 = (u32)database;
record->database = (u32)database;
CDBRecordKeyCopy(&record->key, key);
record->cryptBuf = NULL;
record->file = NULL;
@@ -95,7 +95,7 @@ CDBErr CDBRecordCreateAtOnce(CDBRecord* record, CDBDatabase* database, const cha
CDBRecordKeyInit(&key, epoch, gameCode, makerCode, 0, fileType, CDB_FS_LOCATION_NAND);
CDBLock();
record->unk_0x00 = (u32)database;
record->database = (u32)database;
CDBRecordKeyCopy(&record->key, &key);
record->cryptBuf = NULL;
record->file = NULL;
@@ -128,7 +128,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) {
CDBDatabase* database;
CDBRecordDatabaseState* instance;
database = (CDBDatabase*)record->unk_0x00;
database = (CDBDatabase*)record->database;
instance = database->instance;
record->cryptBuf = NULL;
if (instance == NULL) {
@@ -292,7 +292,7 @@ CDBErr CDBRecordWrite_(CDBRecord* record, void* buffer, u32 size) {
CDBErr result;
CDBRecordDatabaseState* instance;
database = (CDBDatabase*)record->unk_0x00;
database = (CDBDatabase*)record->database;
instance = database->instance;
recordFile = record->file;
if (record->key.location == CDB_FS_LOCATION_SD) {
@@ -508,7 +508,7 @@ CDBErr CDBRecordUpdateModifiedDate(CDBRecord* record) {
ticks = OSGetTime();
modifiedDate = ticks / (OS_BUS_CLOCK / 4);
recordFile = record->file;
if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->unk_0x00)->instance)->openFlags & 2) == 0) {
if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->database)->instance)->openFlags & 2) == 0) {
CDBReportError("can't set modified time of the record; the database is opened as READONLY\n");
return CDB_ERROR_26;
}
@@ -570,7 +570,7 @@ CDBErr CDBRecordBackupToSD_(CDBRecord* record) {
CDBRecordKeyCopy(&localRecord.key, &record->key);
localRecord.file = NULL;
localRecord.key.location = CDB_FS_LOCATION_SD;
localRecord.unk_0x00 = record->unk_0x00;
localRecord.database = record->database;
err = CDBRecordFileCreateBlank(&localRecord);
if (err != CDB_ERROR_OK) {
CDBLock();
@@ -614,7 +614,7 @@ CDBErr CDBRecordBackupToSD_(CDBRecord* record) {
CDBLock();
recordFile = localRecord.file;
CDBRecordKeyCopy(&record->key, &localRecord.key);
record->unk_0x00 = localRecord.unk_0x00;
record->database = localRecord.database;
record->file = localRecord.file;
record->cryptBuf = localRecord.cryptBuf;
CDBRecordKeyCopy(&recordFile->key, &localRecord.key);

View File

@@ -27,7 +27,7 @@ static NWC24Err GetCachedFLHeader(NWC24FLHeader** header);
static ChkHostNameError CheckHostName(const char* hostName, u32 hostNameLength);
static inline NWC24Err CheckFriendInfo(const NWC24FriendInfo* friendInfo);
static u32 GetUnkFlag(u32 index) {
static u32 GetConfirmedBit(u32 index) {
NWC24Err result;
NWC24FLHeader* header;
u32 data;
@@ -37,11 +37,11 @@ static u32 GetUnkFlag(u32 index) {
return result;
}
data = header->unk_0x10[index >> 5] >> (index & 0x1f) & 1;
data = header->confirmedBits[index >> 5] >> (index & 0x1f) & 1;
return (NWC24Err)data;
}
static NWC24Err SetUnkFlag(u32 index, int flag) {
static NWC24Err SetConfirmedBit(u32 index, int flag) {
NWC24Err result;
NWC24FLHeader* header;
@@ -50,11 +50,11 @@ static NWC24Err SetUnkFlag(u32 index, int flag) {
return result;
}
header->unk_0x10[index >> 5] = ~(1 << (index & 0x1f)) & header->unk_0x10[index >> 5] | flag << (index & 0x1f);
header->confirmedBits[index >> 5] = ~(1 << (index & 0x1f)) & header->confirmedBits[index >> 5] | flag << (index & 0x1f);
return NWC24_OK;
}
static NWC24Err SetUnkFlag2(int flag) {
static NWC24Err SetListFlag(int flag) {
NWC24Err result;
NWC24FLHeader* header;
@@ -63,7 +63,7 @@ static NWC24Err SetUnkFlag2(int flag) {
return result;
}
header->unk_0x3C |= flag;
header->listFlags |= flag;
return NWC24_OK;
}
@@ -101,7 +101,7 @@ NWC24Err NWC24ReadFriendInfo(NWC24FriendInfo* info, u32 index) {
Mail_memset(&info->addr.mailAddr[sizeof(NWC24UserId)], 0, sizeof(NWC24UserMailAddr) - sizeof(NWC24UserId));
}
result = GetUnkFlag(index);
result = GetConfirmedBit(index);
if (result == 1) {
info->attr.status = NWC24_FRIENDSTATUS_CONFIRMED;
}
@@ -189,9 +189,9 @@ NWC24Err NWC24WriteFriendInfo(const NWC24FriendInfo* friendInfo, u32 index) {
tmpFriendAddr = (NWC24FriendAddr*)&friendInfo->addr;
}
SetUnkFlag2(1);
SetListFlag(1);
result = SetUnkFlag(index, 0);
result = SetConfirmedBit(index, 0);
if (result != NWC24_OK) {
return result;
}
@@ -347,7 +347,7 @@ NWC24Err NWC24DeleteFriendInfo(u32 index) {
if (resultWrite == NWC24_OK) {
header->friendIds[index] = 0;
header->registeredCount--;
result = SetUnkFlag(index, 0);
result = SetConfirmedBit(index, 0);
if (result == NWC24_OK) {
NWC24FSeek(&file, 0, NWC24_SEEK_BEG);
resultWrite = NWC24FWrite(header, sizeof(NWC24FLHeader), &file);
@@ -374,8 +374,8 @@ NWC24Err NWC24SwapFriendInfos(u32 index1, u32 index2) {
u32 fileOffset1;
u32 fileOffset2;
int friendUnkFlag1;
int friendUnkFlag2;
int confirmedBit1;
int confirmedBit2;
if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool()) {
return NWC24_ERR_LIB_NOT_OPENED;
@@ -429,10 +429,10 @@ NWC24Err NWC24SwapFriendInfos(u32 index1, u32 index2) {
header->friendIds[index2] = tmp;
// Swap some flag
friendUnkFlag1 = GetUnkFlag(index1);
friendUnkFlag2 = GetUnkFlag(index2);
SetUnkFlag(index1, friendUnkFlag2);
SetUnkFlag(index2, friendUnkFlag1);
confirmedBit1 = GetConfirmedBit(index1);
confirmedBit2 = GetConfirmedBit(index2);
SetConfirmedBit(index1, confirmedBit2);
SetConfirmedBit(index2, confirmedBit1);
// Write new header
NWC24FSeek(&file, 0, NWC24_SEEK_BEG);
@@ -629,10 +629,10 @@ NWC24Err NWC24iCreateFriendList() {
header->version = FRIEND_LIST_VERSION;
header->infoCount = NWC24_FRIEND_INFO_MAX;
header->registeredCount = 0;
header->unk_0x10[0] = 0;
header->unk_0x10[1] = 0;
header->unk_0x10[2] = 0;
header->unk_0x10[3] = 0;
header->confirmedBits[0] = 0;
header->confirmedBits[1] = 0;
header->confirmedBits[2] = 0;
header->confirmedBits[3] = 0;
result = NWC24FOpen(&file, FLFilePath, NWC24_OPEN_WRITE);
if (result != NWC24_OK) {

View File

@@ -170,7 +170,7 @@ NWC24Err NWC24GetMsgObj(NWC24MsgObj* msg, NWC24MBoxType type, u32 id) {
u32 count = 0;
if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool())
return NWC24_ERR_LIB_NOT_OPENED;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
entry = (MBCEntry*)NWC24WorkP->mbcEntry;
memset(entry, 0, sizeof(*entry));
if (id == 0)
return NWC24_ERR_HIDDEN;
@@ -251,7 +251,7 @@ NWC24Err NWC24GetMsgIdList(NWC24MBoxType type, u32* ids, u32 maxLength) {
MBCEntry* entry;
if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool())
return NWC24_ERR_LIB_NOT_OPENED;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
entry = (MBCEntry*)NWC24WorkP->mbcEntry;
err = GetCachedMBCHeader(type, &header);
if (err != NWC24_OK)
return err;
@@ -307,11 +307,11 @@ NWC24Err NWC24iOpenMBox(void) {
NWC24File recvFile, sendFile;
char* path = NWC24WorkP->pathWork;
NWC24Err err;
Mail_memset(NWC24WorkP->unk_0x1700, 0, 128);
Mail_memset(NWC24WorkP->sendMbcHeader, 0, 128);
err = GetCachedMBCHeader(NWC24_MBOX_TYPE_SEND, &header);
if (err != NWC24_OK)
return err;
Mail_memset(NWC24WorkP->unk_0x1780, 0, 128);
Mail_memset(NWC24WorkP->recvMbcHeader, 0, 128);
err = GetCachedMBCHeader(NWC24_MBOX_TYPE_RECV, &header);
if (err != NWC24_OK)
return err;
@@ -340,11 +340,11 @@ NWC24Err NWC24iInitMBox(void) {
NWC24File recvFile, sendFile;
NWC24Err recvResult, sendResult, err, sendStatus;
char* path = NWC24WorkP->pathWork;
Mail_memset(NWC24WorkP->unk_0x1700, 0, 128);
Mail_memset(NWC24WorkP->sendMbcHeader, 0, 128);
sendResult = CreateCtrlFile(NWC24_MBOX_TYPE_SEND, FALSE);
if (sendResult < 0)
return sendResult;
Mail_memset(NWC24WorkP->unk_0x1780, 0, 128);
Mail_memset(NWC24WorkP->recvMbcHeader, 0, 128);
recvResult = CreateCtrlFile(NWC24_MBOX_TYPE_RECV, FALSE);
if (recvResult < 0)
return recvResult;
@@ -616,11 +616,11 @@ static NWC24Err CreateCtrlFile(NWC24MBoxType type, BOOL force) {
err = MakeCtrlPath(path, type);
if (err != NWC24_OK)
return err;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
entry = (MBCEntry*)NWC24WorkP->mbcEntry;
if (type == NWC24_MBOX_TYPE_SEND)
header = (MBCHeader*)NWC24WorkP->unk_0x1700;
header = (MBCHeader*)NWC24WorkP->sendMbcHeader;
else if (type == NWC24_MBOX_TYPE_RECV)
header = (MBCHeader*)NWC24WorkP->unk_0x1780;
header = (MBCHeader*)NWC24WorkP->recvMbcHeader;
else
return NWC24_ERR_INVALID_VALUE;
result = err;
@@ -676,7 +676,7 @@ static NWC24Err DeleteMsg(NWC24MBoxType type, u32 id, BOOL protect) {
NWC24Err err, deleteResult, closeResult;
if (!NWC24IsMsgLibOpened() && !NWC24IsMsgLibOpenedByTool())
return NWC24_ERR_LIB_NOT_OPENED;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
entry = (MBCEntry*)NWC24WorkP->mbcEntry;
err = GetCachedMBCHeader(type, &header);
if (err != NWC24_OK)
return err;
@@ -754,7 +754,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
NWC24Err clearResult, deleteResult;
if (type == NWC24_MBOX_TYPE_SEND)
return NWC24_OK;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
entry = (MBCEntry*)NWC24WorkP->mbcEntry;
for (offset = 128; offset < header->fileSize; offset += 128) {
if (count >= header->numMessages)
break;
@@ -809,9 +809,9 @@ static NWC24Err GetCachedMBCHeader(NWC24MBoxType type, MBCHeader** header) {
char* path;
NWC24Err err = NWC24_OK, closeResult;
if (type == NWC24_MBOX_TYPE_SEND)
*header = (MBCHeader*)NWC24WorkP->unk_0x1700;
*header = (MBCHeader*)NWC24WorkP->sendMbcHeader;
else if (type == NWC24_MBOX_TYPE_RECV)
*header = (MBCHeader*)NWC24WorkP->unk_0x1780;
*header = (MBCHeader*)NWC24WorkP->recvMbcHeader;
else {
*header = NULL;
return NWC24_ERR_INVALID_VALUE;
@@ -874,7 +874,7 @@ static NWC24Err InitMBCHeader(MBCHeader* header, NWC24MBoxType type) {
static NWC24Err AddMBCEntry(MBCHeader* header, const NWC24MsgObjPrivate* msg, NWC24File* file) {
u32 offset = header->freeOffset;
MBCEntry* entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
MBCEntry* entry = (MBCEntry*)NWC24WorkP->mbcEntry;
u32 next;
NWC24Err err;
if (offset == 0)
@@ -906,7 +906,7 @@ static NWC24Err AddMBCEntry(MBCHeader* header, const NWC24MsgObjPrivate* msg, NW
}
static NWC24Err ClearMBCEntry(MBCHeader* header, NWC24File* file, u32 offset) {
MBCEntry* entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
MBCEntry* entry = (MBCEntry*)NWC24WorkP->mbcEntry;
NWC24Err err = NWC24FSeek(file, offset, NWC24_SEEK_BEG);
if (err != NWC24_OK)
return err;

View File

@@ -243,11 +243,11 @@ static inline NWC24Err WriteMBDelayField(NWC24MsgObjPrivate* msg) {
static inline NWC24Err WriteExtraFields(NWC24MsgObjPrivate* msg) {
NWC24Err err;
if (msg->unk_0xD0.size == 0)
if (msg->extraData.size == 0)
return NWC24_OK;
err = NWC24FWrite(msg->unk_0xD0.ptr, msg->unk_0xD0.size, m_pFile);
err = NWC24FWrite(msg->extraData.ptr, msg->extraData.size, m_pFile);
if (err == NWC24_OK)
msg->length += msg->unk_0xD0.size;
msg->length += msg->extraData.size;
return err;
}

View File

@@ -77,7 +77,7 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
NWC24Data_Init(&msgObj->toData);
NWC24Data_Init(&msgObj->unk_0x50);
NWC24Data_Init(&msgObj->unk_0x58);
NWC24Data_Init(&msgObj->unk_0xD0);
NWC24Data_Init(&msgObj->extraData);
NWC24Data_Init(&msgObj->faceData);
NWC24Data_Init(&msgObj->altName);

View File

@@ -1844,7 +1844,7 @@ namespace ipl {
initChanZoomParam(myVec, 1);
setChanZoomOrtho();
if (System::getChannelManager()->isUnk_0x1B81()) {
if (System::getChannelManager()->isDiskChannelReady()) {
if (System::getBS2Manager()->getIPLState() == bs2::IPL_STATE_RVL_GAME ||
System::getBS2Manager()->getIPLState() == bs2::IPL_STATE_DISK_UPDATE) {
if (mspDiskID != NULL) {
@@ -1856,7 +1856,7 @@ namespace ipl {
if (strncmp(diskID, mspDiskID, 4) == 0) {
if (strncmp(diskMaker, mspDiskMaker, 2) == 0) {
System::getChannelManager()->setUnk_0x1B81(false);
System::getChannelManager()->setDiskChannelReady(false);
}
}
}

View File

@@ -467,7 +467,7 @@ namespace ipl {
mpDiskBnrLayout->calc();
} else {
calcModuleChannel();
System::getChannelManager()->setUnk_0x1B81(false);
System::getChannelManager()->setDiskChannelReady(false);
}
if ((mState == STATE_NORMAL || mState == STATE_WAIT_TMD || mState == STATE_PREPARE_BOOT || mState == STATE_BOOT_SCENE) && !unk_0x90 &&
@@ -1220,7 +1220,7 @@ namespace ipl {
#pragma ppc_iro_level 0
void ChannelTitle::calcNormalParentalDialog() {
if (mChanSceneID == SCENE_DISK_CHANNEL &&
(System::getBS2Manager()->getIPLState() != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isUnk_0x1B81())) {
(System::getBS2Manager()->getIPLState() != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isDiskChannelReady())) {
mParentalState = PARENTAL_STATE_FAILED;
}
@@ -2064,7 +2064,7 @@ namespace ipl {
break;
}
case DISK_STATE_WII_DISK_IDLE: {
if (BS2State != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isUnk_0x1B81()) {
if (BS2State != bs2::IPL_STATE_RVL_GAME || System::getChannelManager()->isDiskChannelReady()) {
mDiskState = DISK_STATE_EJECT;
mpDiskBnrAnims[DISK_ANIM_GRP_ALL][DISK_ANIM_DISK_EJECT]->play();
mpDiskBnrLayout->GetRootPane()->SetVisible(true);

View File

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

View File

@@ -91,7 +91,7 @@ namespace ipl {
extern "C" const u32 scLangLookup__Q23ipl7channel[][16];
Manager::Manager(EGG::Heap* heap)
: mpHeap(heap), mState(INIT), mbCanRefresh(0), unk_0x1B81(false), mbSetDiskBannerInfo(false), mPrevNandResult(NAND_RESULT_OK),
: mpHeap(heap), mState(INIT), mbCanRefresh(0), mbDiskChannelReady(false), mbSetDiskBannerInfo(false), mPrevNandResult(NAND_RESULT_OK),
mbLoadedChJump(false) {
mpLockedMsgFile = NULL;
@@ -951,7 +951,7 @@ namespace ipl {
int state = System::getBS2Manager()->getIPLState();
if (state == bs2::IPL_STATE_RVL_GAME && mBS2State != bs2::IPL_STATE_RVL_GAME) {
mbSetDiskBannerInfo = setDiskBannerInfo(false);
unk_0x1B81 = true;
mbDiskChannelReady = true;
} else if (state != bs2::IPL_STATE_RVL_GAME && state != mBS2State) {
setDiskBannerInfo(true);
}
@@ -1076,7 +1076,7 @@ namespace ipl {
ARCFileInfo readFile;
if (unk) {
unk_0x1B81 = false;
mbDiskChannelReady = false;
}
int diskPage, diskIndex;

View File

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

View File

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