Compare commits

..

1 Commits

Author SHA1 Message Date
coah
f7d1a7f211 cleanup(iplController): name decide/pinch/kpad/classic fields
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:09:29 -05:00
25 changed files with 215 additions and 215 deletions

View File

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

View File

@@ -125,9 +125,9 @@ namespace ipl {
mType = 2;
mbForceInvalid = 0;
KPADEnableDPD(chan);
mbPinch = 0;
mbPrevPinch = 0;
mpStatus = &status;
mbPinching = 0;
mbWasPinching = 0;
mpKpadStatus = &status;
}
Base(int chan, int type, KPADStatus& status) {
@@ -158,9 +158,9 @@ namespace ipl {
u32 mChan;
u32 mType;
u8 mbForceInvalid;
u8 mbPinch;
u8 mbPrevPinch;
KPADStatus* mpStatus;
u8 mbPinching;
u8 mbWasPinching;
KPADStatus* mpKpadStatus;
};
class Revolution : public Base {
@@ -206,7 +206,7 @@ namespace ipl {
virtual BOOL isValidDpdClassic() const;
private:
math::VEC2 mClassicCursor;
math::VEC2 mClassicCursorPos;
int mClassicCursorTimer;
};
@@ -273,9 +273,9 @@ namespace ipl {
KPADEnableDPD(chan);
mbPinch = 0;
mbPrevPinch = 0;
mpStatus = &arg1;
mbPinching = 0;
mbWasPinching = 0;
mpKpadStatus = &arg1;
}
virtual ~Base(); // 0x08
@@ -332,9 +332,9 @@ namespace ipl {
u32 mChan; // 0x14
u32 mType; // 0x18
u8 mbForceInvalid;
u8 mbPinch; // 0x1D
u8 mbPrevPinch; // 0x1E
KPADStatus* mpStatus; // 0x20
u8 mbPinching; // 0x1D
u8 mbWasPinching; // 0x1E
KPADStatus* mpKpadStatus; // 0x20
};
class Interface : public Base {
@@ -446,7 +446,7 @@ namespace ipl {
virtual BOOL isValidDpdClassic() const; // 0x8C
private:
math::VEC2 mClassicCursor;
math::VEC2 mClassicCursorPos;
int mClassicCursorTimer;
};

View File

@@ -60,9 +60,9 @@ namespace ipl {
int mMessageID; // 0x08
int mArg2;
int mArg3;
char mArg1[4];
int unk_0x0C;
int unk_0x10;
char unk_0x14[4];
u8* mpArcData; // 0x18
u32 mArcSize; // 0x1C

View File

@@ -139,7 +139,7 @@ namespace ipl {
bool received() { return mbReviecedMsg; }
void prepNextReceive() { mbReviecedMsg = false; }
volatile bool isReceivingIdle() { return mbReceiving == false; }
volatile bool isUnk0xA31() { return unk_0xA31 == false; }
BOOL isAppDlEnableLock(u32 appId) {
utility::autoMutexLock lock(mAutoLock);
@@ -175,9 +175,9 @@ namespace ipl {
OSMutex mAutoLock; // 0xA18
bool mbReviecedMsg;
bool mbReceiving;
bool unk_0xA31;
bool mbReceivePaused; // 0xA32
bool mbNewTitleTblReady;
bool unk_0xA33;
static Arg smArg;

View File

@@ -210,7 +210,7 @@ struct __zi8_work_data_s {
ziLanguageEntry* langEntries; // 0x04
ziU8 unk_0x08;
ziU8 unk_0x09;
ziU8 maxWordLength;
ziU8 unk_0x0A;
ziU8 unk_0x0B;
ziU32 unk_0x0C;
ziU32 unk_0x10;
@@ -267,20 +267,20 @@ struct __zi8_work_data_s {
ziU8 unk_0x140C[4];
ziU32 formats; // 0x1410
ziU8 unk_0x1414[4];
ziU8 formatCount;
ziU8 unk_0x1418;
ziU8 unk_0x1419;
ziU16 capacity; // 0x141A
ziU16 unk_0x141A;
ziU8 unk_0x141C;
ziU8 unk_0x141D;
ziU8 graphTableId; // 0x141E
ziU8 unk_0x141E;
ziU8 maxCnt; // 0x141F
ziU8 unk_0x1420[4];
zi8DawgCtx dawgCtx; // 0x1424
ziU8 unk_0x1760[4]; // 0x1760
ziU8* groupPtr; // 0x1764
ziU8* unk_0x1764; // 0x1764
ziU8 unk_0x1768;
ziU8 unk_0x1769[0x81];
ziU16 matchOffset; // 0x17EA
ziU16 unk_0x17EA;
ziU8 unk_0x17EC;
ziU8 unk_0x17ED[3];
ziU8* dawgGroup; // 0x17F0

View File

@@ -39,10 +39,10 @@ ziU32 Zi8MatchROMdata0(ziWChar* elements, ziU8 count, ziU8 language,
}
if (mode == 1) acceptPrefix = 0;
} else {
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;
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;
} else {
if (Zi8GetTableSize(language, graphTable, ZI_WORK) == 0) {
Zi8LogError(0x961, ZI_WORK);
@@ -184,36 +184,36 @@ unsigned int Zi8MatchROMdata1(ziWChar *elements, ziU8 count, ziU8 language, ziWC
result = 0;
if (status == 0) {
ZI_WORK->groupPtr = (ziU8*)group;
if (ZI_WORK->groupPtr == 0) {
ZI_WORK->unk_0x1764 = (ziU8*)group;
if (ZI_WORK->unk_0x1764 == 0) {
if (Zi8GetTableSize(language & 0xff,0xb,ZI_WORK) != 0) {
ZI_WORK->groupPtr = (ziU8*)(tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK));
ZI_WORK->unk_0x1764 = (ziU8*)(tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK));
}
}
if (ZI_WORK->groupPtr != 0) {
for (; (*ZI_WORK->groupPtr != 0xff && ((groupIndex & 0xff) != 0));
if (ZI_WORK->unk_0x1764 != 0) {
for (; (*ZI_WORK->unk_0x1764 != 0xff && ((groupIndex & 0xff) != 0));
groupIndex = groupIndex - 1) {
while (*ZI_WORK->groupPtr != 0xff) {
ZI_WORK->groupPtr += 2;
while (*ZI_WORK->unk_0x1764 != 0xff) {
ZI_WORK->unk_0x1764 += 2;
}
ZI_WORK->groupPtr++;
ZI_WORK->unk_0x1764++;
}
}
}
if (ZI_WORK->groupPtr == 0) {
if (ZI_WORK->unk_0x1764 == 0) {
result = Zi8MatchROMdata0(elements,count,language & 0xff,output,capacity & 0xffff,
mode & 0xff,status & 0xff,0,1,acceptPrefix,0,&ZI_WORK->dawgCtx,
ZI_WORK->unk_0x1760,ZI_WORK);
}
else {
while (*ZI_WORK->groupPtr != 0xff) {
while (*ZI_WORK->unk_0x1764 != 0xff) {
result = Zi8MatchROMdata0(elements,count,language & 0xff,output,
capacity & 0xffff,mode & 0xff,status & 0xff,
*ZI_WORK->groupPtr,
ZI_WORK->groupPtr[1],acceptPrefix,0,
*ZI_WORK->unk_0x1764,
ZI_WORK->unk_0x1764[1],acceptPrefix,0,
&ZI_WORK->dawgCtx,ZI_WORK->unk_0x1760,ZI_WORK);
if ((result & 0xff) != 0) break;
ZI_WORK->groupPtr += 2;
ZI_WORK->unk_0x1764 += 2;
status = 0;
}
}
@@ -230,31 +230,31 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language,
if (reservedMode != 0) return 0;
if (status == 0) {
ZI_WORK->unk_0x1768 = 0;
ZI_WORK->matchOffset = 0;
ZI_WORK->unk_0x17EA = 0;
if (group != 0 && *group == 0xc && language == 10 && ZI_WORK->unk_0x141C != 0) {
ZI_WORK->graphTableId = 0x10;
ZI_WORK->unk_0x141E = 0x10;
} else {
ZI_WORK->graphTableId = 0;
ZI_WORK->unk_0x141E = 0;
}
}
search_segment:
ZI_WORK->maxCnt = 1;
result = Zi8MatchROMdata1(elements + ZI_WORK->matchOffset,
count - ZI_WORK->matchOffset, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], capacity,
result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA,
count - ZI_WORK->unk_0x17EA, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
mode, status, ZI_WORK->unk_0x1768, (char*)group,
acceptPrefix, ZI_WORK);
if ((ziU8)result != 0) {
for (index = (ziU8)(ZI_WORK->matchOffset + result); index != 0; index--) {
for (index = (ziU8)(ZI_WORK->unk_0x17EA + result); index != 0; index--) {
output[index - 1] = ZI_WORK->unk_0x17F4[index - 1];
}
result = (ziU8)(result + ZI_WORK->matchOffset);
result = (ziU8)(result + ZI_WORK->unk_0x17EA);
} else {
if (status != 0 || count == 1) goto finish_segments;
if (mode == 1 && ZI_WORK->unk_0x1768 == 0 &&
(ziU8)Zi8MatchROMdata1(elements + ZI_WORK->matchOffset,
count - ZI_WORK->matchOffset, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], capacity,
(ziU8)Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA,
count - ZI_WORK->unk_0x17EA, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
0, status, ZI_WORK->unk_0x1768, (char*)group,
acceptPrefix, ZI_WORK) != 0) goto finish_segments;
if ((Zi8GetTableCount(language, 0x1f, ZI_WORK) & 4) == 0) {
@@ -264,23 +264,23 @@ search_segment:
}
if (ZI_WORK->maxCnt > capacity) goto finish_segments;
for (index = ZI_WORK->maxCnt; index != 0; index--) {
result = Zi8MatchROMdata1(elements + ZI_WORK->matchOffset, index, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], capacity,
result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA, index, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
1, 0, ZI_WORK->unk_0x1768, (char*)group,
acceptPrefix, ZI_WORK);
if ((ziU8)result != 0) {
ZI_WORK->matchOffset += (ziU8)result;
if (ZI_WORK->matchOffset == count) return 0;
ZI_WORK->unk_0x17EA += (ziU8)result;
if (ZI_WORK->unk_0x17EA == count) return 0;
ZI_WORK->unk_0x1768++;
status = 0;
ZI_WORK->graphTableId = 0;
ZI_WORK->unk_0x141E = 0;
if (ZI_WORK->dawgCtx.key == 0 && language == 10) {
for (index = 0; index < ZI_WORK->matchOffset; index++) {
for (index = 0; index < ZI_WORK->unk_0x17EA; index++) {
switch (ZI_WORK->unk_0x17F4[index]) {
case 0x61:
case 0x6f:
case 0x75:
ZI_WORK->graphTableId = 0x10;
ZI_WORK->unk_0x141E = 0x10;
goto search_segment;
}
}

View File

@@ -51,10 +51,10 @@ ziBool Zi8ZHsetZYfuzzyPairs(ziFuzzyZYPairs pairs ZI_NEED_WORK) {
ziBool Zi8SetLatinSearchOrder(ziU8* searchArray, ziU8 searchSize ZI_NEED_WORK) {
if (searchArray == 0 || *searchArray == 0) {
ZI_WORK->formats = (ziU32)Zi8SOdefaultArray;
ZI_WORK->formatCount = 9;
ZI_WORK->unk_0x1418 = 9;
} else {
ZI_WORK->formats = (ziU32)searchArray;
ZI_WORK->formatCount = searchSize;
ZI_WORK->unk_0x1418 = searchSize;
}
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->maxWordLength = 0xff;
ZI_WORK->unk_0x0A = 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->maxWordLength) length = ZI_WORK->maxWordLength;
if (length > ZI_WORK->unk_0x0A) length = ZI_WORK->unk_0x0A;
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->maxWordLength) length = ZI_WORK->maxWordLength;
if (length > ZI_WORK->unk_0x0A) length = ZI_WORK->unk_0x0A;
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->maxWordLength = 0xff;
ZI_WORK->unk_0x0A = 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->maxWordLength = 0xff;
ZI_WORK->unk_0x0A = 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->capacity;
options.capacity = ZI_WORK->unk_0x141A;
return Zi8GetCandidatesOrCount(parameters, &options, ZI_WORK);
}
ziU8 _Zi8CheckCandidates(ziGetParam* parameters ZI_NEED_WORK) {
ZiCandidateOptions options = {0};
options.capacity = ZI_WORK->capacity;
options.capacity = ZI_WORK->unk_0x141A;
options.flags = 1;
return Zi8GetCandidatesOrCount(parameters, &options, ZI_WORK);
}
@@ -493,8 +493,8 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
ZI_WORK->subLanguage = parameters->subLanguage;
ZI_WORK->cangjieEnabled = Zi8GetFormatVersion(1,ZI_WORK) & 2;
options->maxCount = ZI_WORK->unk_0x10;
options->maxWordLength = ZI_WORK->maxWordLength;
ZI_WORK->maxWordLength = -1;
options->maxWordLength = ZI_WORK->unk_0x0A;
ZI_WORK->unk_0x0A = -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->maxWordLength = length;
ZI_WORK->unk_0x0A = length;
return 1;
}

View File

@@ -18,7 +18,7 @@ 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->maxWordLength = 0xFF;
ZI_WORK->unk_0x0A = 0xFF;
ZI_WORK->unk_0x10 = 0x64;
*(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF;
ZI_WORK->separator = 0x20;
@@ -44,7 +44,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
ZI_WORK->unk_0x1874 = 0x2D;
ZI_WORK->language = 0;
ZI_WORK->unk_0x1C[3] = 0;
ZI_WORK->capacity = 0x100;
ZI_WORK->unk_0x141A = 0x100;
Zi8SetLatinSearchOrder(0, 0, ZI_WORK);
ZADP_Zi8SetPDremoveOpt(1, ZI_WORK);
ZI_WORK->unk_0x17 = 5;

View File

@@ -46,7 +46,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
ziU8* data;
ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0};
ziU32 savedFormats = ZI_WORK->formats;
ziU8 savedCount = ZI_WORK->formatCount;
ziU8 savedCount = ZI_WORK->unk_0x1418;
ziSearchState search = {0};
Zi8LogError(100, __zi8_work_data);
if (word == 0 || *word == 0) {
@@ -75,20 +75,20 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
request.firstCandidate = 0;
ZI_WORK->formats = (ziU32)formats;
if (ZI_WORK->unk_0x1C[0] == 2) {
ZI_WORK->formatCount = 0;
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->formatCount++] = 1;
if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->formatCount++] = 2;
if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->formatCount++] = 3;
if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->formatCount++] = 4;
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->formatCount++] = 5;
if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->formatCount++] = 6;
if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->formatCount++] = 7;
if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->formatCount++] = 8;
} else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->formatCount = 2;
else ZI_WORK->formatCount = 1;
ZI_WORK->unk_0x1418 = 0;
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 1;
if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->unk_0x1418++] = 2;
if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->unk_0x1418++] = 3;
if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->unk_0x1418++] = 4;
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 5;
if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->unk_0x1418++] = 6;
if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->unk_0x1418++] = 7;
if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->unk_0x1418++] = 8;
} else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->unk_0x1418 = 2;
else ZI_WORK->unk_0x1418 = 1;
count = Zi8GetCandidatesOrCount(&request, &search, __zi8_work_data);
ZI_WORK->formats = savedFormats;
ZI_WORK->formatCount = savedCount;
ZI_WORK->unk_0x1418 = savedCount;
if (count != 0) return 1;
}
if (language != 1) {

View File

@@ -19,7 +19,7 @@ typedef struct _CDBRecordFile {
#else
u8 unk_0x00[0x1C - 0x00];
#endif
int allocFlag; // 0x1C
int unk_0x1C;
CDBAttr attr; // 0x20
CDBBridgeFile bridgeFile; // 0x42C
u8 unk_0x434[0x438 - 0x434];

View File

@@ -24,7 +24,7 @@ typedef struct NWC24MsgObjPrivate {
#ifdef NWC24_MSG_READ
u32 headerSize;
#elif defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT)
u32 headerSize; // 0x10
u32 flags; // 0x10
#else
u8 unk_0x10[0x4];
#endif
@@ -73,7 +73,7 @@ typedef struct NWC24MsgObjPrivate {
};
u32 raw;
} msgBoardFlags; // 0xCC
NWC24Data extraData; // 0xD0
NWC24Data unk_0xD0;
NWC24Data faceData; // 0xD8
NWC24Data altName; // 0xE0
u32 textSize; // 0xE4

View File

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

View File

@@ -57,7 +57,7 @@ void CDBRecordInstanceInit(CDBRecordFile* recordFile, CDBRecord* record, int typ
OSLockMutex((OSMutex*)recordFile);
recordFile->used = 1;
OSUnlockMutex((OSMutex*)recordFile);
recordFile->allocFlag = type;
recordFile->unk_0x1C = type;
recordFile->database = record->unk_0x00;
CDBAttrInit(&recordFile->attr);
CDBRecordKeyCopy(&recordFile->key, &record->key);
@@ -310,7 +310,7 @@ CDBErr CDBRecordWrite_(CDBRecord* record, void* buffer, u32 size) {
CDBReportError("can't write data in the record; the record is closed\n");
return CDB_ERROR_27;
}
if ((recordFile->allocFlag & 2) == 0) {
if ((recordFile->unk_0x1C & 2) == 0) {
CDBReportError("can't write data in the record; the record is opened as READONLY\n");
return CDB_ERROR_27;
}
@@ -687,7 +687,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
if ((s32)recordFile == 0) {
return CDB_ERROR_27;
}
if (recordFile->allocFlag == 1) {
if (recordFile->unk_0x1C == 1) {
return CDB_ERROR_26;
}
if ((s32)buffer == 0) {
@@ -699,7 +699,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
tempFile = record->file;
if ((s32)tempFile == 0) {
result = CDB_ERROR_27;
} else if (tempFile->allocFlag == 1) {
} else if (tempFile->unk_0x1C == 1) {
result = CDB_ERROR_26;
} else {
CDBAttrSetWiiId(&tempFile->attr, CDBGetWiiId());
@@ -713,7 +713,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
CDBErr result;
if ((s32)record->file == 0) {
result = CDB_ERROR_27;
} else if (((CDBRecordFile*)record->file)->allocFlag == 1) {
} else if (((CDBRecordFile*)record->file)->unk_0x1C == 1) {
result = CDB_ERROR_26;
} else {
CDBAttrInitIV(&((CDBRecordFile*)record->file)->attr);
@@ -727,7 +727,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
CDBErr result;
if ((s32)record->file == 0) {
result = CDB_ERROR_27;
} else if (((CDBRecordFile*)record->file)->allocFlag == 1) {
} else if (((CDBRecordFile*)record->file)->unk_0x1C == 1) {
result = CDB_ERROR_26;
} else {
CDBAttrSetKeyStr(&((CDBRecordFile*)record->file)->attr, key);

View File

@@ -265,7 +265,7 @@ CDBErr CDBRecordFree(CDBRecord* record) {
OSLockMutex((OSMutex*)recordFile);
*(u32*)&recordFile->unk_0x00[0x18] = 0;
OSUnlockMutex((OSMutex*)recordFile);
recordFile->allocFlag = 0;
recordFile->unk_0x1C = 0;
record->file = NULL;
OSUnlockMutex(&s_mutex);
}

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->mbcEntry;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
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->mbcEntry;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
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->sendMbcHeader, 0, 128);
Mail_memset(NWC24WorkP->unk_0x1700, 0, 128);
err = GetCachedMBCHeader(NWC24_MBOX_TYPE_SEND, &header);
if (err != NWC24_OK)
return err;
Mail_memset(NWC24WorkP->recvMbcHeader, 0, 128);
Mail_memset(NWC24WorkP->unk_0x1780, 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->sendMbcHeader, 0, 128);
Mail_memset(NWC24WorkP->unk_0x1700, 0, 128);
sendResult = CreateCtrlFile(NWC24_MBOX_TYPE_SEND, FALSE);
if (sendResult < 0)
return sendResult;
Mail_memset(NWC24WorkP->recvMbcHeader, 0, 128);
Mail_memset(NWC24WorkP->unk_0x1780, 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->mbcEntry;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
if (type == NWC24_MBOX_TYPE_SEND)
header = (MBCHeader*)NWC24WorkP->sendMbcHeader;
header = (MBCHeader*)NWC24WorkP->unk_0x1700;
else if (type == NWC24_MBOX_TYPE_RECV)
header = (MBCHeader*)NWC24WorkP->recvMbcHeader;
header = (MBCHeader*)NWC24WorkP->unk_0x1780;
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->mbcEntry;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
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->mbcEntry;
entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
for (offset = 128; offset < header->fileSize; offset += 128) {
if (count >= header->numMessages)
break;
@@ -783,7 +783,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
continue;
}
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
entry->flags == msg->headerSize && (s32)entry->date == (s32)msg->date) {
entry->flags == msg->flags && (s32)entry->date == (s32)msg->date) {
duplicateId = entry->msgId;
duplicateOffset = offset;
continue;
@@ -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->sendMbcHeader;
*header = (MBCHeader*)NWC24WorkP->unk_0x1700;
else if (type == NWC24_MBOX_TYPE_RECV)
*header = (MBCHeader*)NWC24WorkP->recvMbcHeader;
*header = (MBCHeader*)NWC24WorkP->unk_0x1780;
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->mbcEntry;
MBCEntry* entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
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->mbcEntry;
MBCEntry* entry = (MBCEntry*)NWC24WorkP->unk_0x1800;
NWC24Err err = NWC24FSeek(file, offset, NWC24_SEEK_BEG);
if (err != NWC24_OK)
return err;
@@ -956,7 +956,7 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
entry->type = msg->type;
entry->length = msg->length;
entry->appId = msg->appId;
entry->flags = msg->headerSize;
entry->flags = msg->flags;
entry->tag = msg->tag;
entry->ledPattern = msg->ledPattern;
entry->crc = msg->unk_0x1C;
@@ -1003,7 +1003,7 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
msg->type = entry->type;
msg->length = entry->length;
msg->appId = entry->appId;
msg->headerSize = entry->flags;
msg->flags = entry->flags;
msg->tag = entry->tag;
msg->ledPattern = entry->ledPattern;
msg->unk_0x1C = entry->crc;

View File

@@ -243,11 +243,11 @@ static inline NWC24Err WriteMBDelayField(NWC24MsgObjPrivate* msg) {
static inline NWC24Err WriteExtraFields(NWC24MsgObjPrivate* msg) {
NWC24Err err;
if (msg->extraData.size == 0)
if (msg->unk_0xD0.size == 0)
return NWC24_OK;
err = NWC24FWrite(msg->extraData.ptr, msg->extraData.size, m_pFile);
err = NWC24FWrite(msg->unk_0xD0.ptr, msg->unk_0xD0.size, m_pFile);
if (err == NWC24_OK)
msg->length += msg->extraData.size;
msg->length += msg->unk_0xD0.size;
return err;
}
@@ -330,7 +330,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
}
CHECK_WRITE(WriteString(msg, buffer));
if (msg->type & 0x10000) {
msg->headerSize = msg->length;
msg->flags = msg->length;
buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024);
Mail_sprintf(buffer, "\r\n--%s", MultiPartDivider);
@@ -339,7 +339,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
}
CHECK_WRITE(WriteContentTypeField(msg));
if (!(msg->type & 0x10000))
msg->headerSize = msg->length;
msg->flags = msg->length;
text.ptr = (const void*)msg->length;
{ NWC24Err textResult = WritePlainText(msg);
err = textResult == NWC24_ERR_NULL ? NWC24_OK : textResult; }

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->extraData);
NWC24Data_Init(&msgObj->unk_0xD0);
NWC24Data_Init(&msgObj->faceData);
NWC24Data_Init(&msgObj->altName);

View File

@@ -648,7 +648,7 @@ namespace ipl {
}
if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped()) {
if (System::getNwc24Manager() && !System::getNwc24Manager()->isReceivingIdle()) {
if (System::getNwc24Manager() && !System::getNwc24Manager()->isUnk0xA31()) {
goto scn_continue;
}

View File

@@ -353,7 +353,7 @@ FaderSceneCommand SDChannelTitle::calcFadeout() {
mWpadStopTick = OSGetTick();
}
if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped() &&
(!System::getNwc24Manager() || System::getNwc24Manager()->isReceivingIdle())) {
(!System::getNwc24Manager() || System::getNwc24Manager()->isUnk0xA31())) {
OSReport("NWC24 Scheduler stopped.\n");
NandSDWorker* worker = mpChannelSelect->getWorker();
if (mNextScene == 17) {

View File

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

View File

@@ -130,24 +130,24 @@ namespace ipl {
}
void ipl::controller::Revolution::read() {
if (!isValidDpd()) {
mpStatus->pos.y = 1.0f / 0.0f;
mpStatus->pos.x = 1.0f / 0.0f;
mpStatus->speed = 0.0f;
mpStatus->vec.y = 0.0f;
mpStatus->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;
}
mbPrevPinch = mbPinch;
mbWasPinching = mbPinching;
if (isValidBtn()) {
if (mbPrevPinch == 0) {
if (mbWasPinching == 0) {
if (down(0x800) && down(0x400)) {
mbPinch = 1;
mbPinching = 1;
}
} else if (!down(0x800) || !down(0x400)) {
mbPinch = 0;
mbPinching = 0;
}
} else {
mbPinch = 0;
mbPinching = 0;
}
Base::read();
@@ -157,17 +157,17 @@ namespace ipl {
return false;
}
return (mpStatus->wpad_err == 0 || mpStatus->wpad_err == -7) && mpStatus->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 = mpStatus->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 (mpStatus->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 = {mpStatus->pos.x, mpStatus->pos.y};
Vec2 src = {mpKpadStatus->pos.x, mpKpadStatus->pos.y};
nw4r::ut::Rect nw4r_rect; // constructor shouldn't be inlined
Rect kpad_rect;
@@ -216,8 +216,8 @@ namespace ipl {
y = fy;
}
ipl::controller::Classic::Classic(int arg0, KPADStatus& arg1) : Revolution(arg0, arg1) {
mClassicCursor.x = 0.01f;
mClassicCursor.y = 0.01f;
mClassicCursorPos.x = 0.01f;
mClassicCursorPos.y = 0.01f;
mClassicCursorTimer = 0;
}
ipl::controller::Base::~Base() {
@@ -230,14 +230,14 @@ namespace ipl {
}
void ipl::controller::Classic::read() {
if (!Revolution::isValidDpd()) {
math::VEC2 lstick(mpStatus->ex_status.cl.lstick.x, mpStatus->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) {
mClassicCursor.x = math::abs_clamp(mClassicCursor.x + mpStatus->ex_status.cl.lstick.x * 0.05f, 1.8f);
mClassicCursor.y = math::abs_clamp(mClassicCursor.y - mpStatus->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(mpStatus->ex_status.cl.rstick.x, mpStatus->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) {
mClassicCursorTimer = 180;
@@ -247,15 +247,15 @@ namespace ipl {
mClassicCursorTimer = 0;
}
} else {
mClassicCursor.y = 0.01f;
mClassicCursor.x = 0.01f;
mClassicCursorPos.y = 0.01f;
mClassicCursorPos.x = 0.01f;
mClassicCursorTimer = 0;
}
Revolution::read();
}
int ipl::controller::Classic::getClassicHoldFlag() const {
return mpStatus->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(mpStatus->horizon.x, mpStatus->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(mpStatus->pos.x, mpStatus->pos.y);
ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
} else if (mClassicCursorTimer != 0) {
ret = mClassicCursor;
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(mpStatus->pos.x, mpStatus->pos.y);
ret.set(mpKpadStatus->pos.x, mpKpadStatus->pos.y);
} else if (mClassicCursorTimer != 0) {
ret = mClassicCursor;
ret = mClassicCursorPos;
} else {
ret.set(1.0f / 0.0f, 1.0f / 0.0f);
}
@@ -463,43 +463,43 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
return mChan;
}
KPADStatus* ipl::controller::Revolution::getKPADStatus() const {
return mpStatus;
return mpKpadStatus;
}
f32 ipl::controller::Revolution::getDpdDistance() const {
return mpStatus->dist;
return mpKpadStatus->dist;
}
int ipl::controller::Revolution::getReleaseFlag() const {
return mpStatus->release;
return mpKpadStatus->release;
}
int ipl::controller::Revolution::getTrigFlag() const {
return mpStatus->trig;
return mpKpadStatus->trig;
}
int ipl::controller::Revolution::getHoldFlag() const {
return mpStatus->hold;
return mpKpadStatus->hold;
}
int ipl::controller::Revolution::pinchOffTrg() const {
int ret = 0;
if (isValidBtn() && mbPinch == 0 && mbPrevPinch != 0) {
if (isValidBtn() && mbPinching == 0 && mbWasPinching != 0) {
ret = 1;
}
return ret;
}
int ipl::controller::Revolution::pinch() const {
int ret = 0;
if (isValidBtn() && mbPinch != 0) {
if (isValidBtn() && mbPinching != 0) {
ret = 1;
}
return ret;
}
int ipl::controller::Revolution::pinchTrg() const {
int ret = 0;
if (isValidBtn() && mbPinch != 0 && mbPrevPinch == 0) {
if (isValidBtn() && mbPinching != 0 && mbWasPinching == 0) {
ret = 1;
}
return ret;
}
bool ipl::controller::Revolution::repeat(u32 button) const {
return down(button) && (mpStatus->hold & 0x80000000) != 0;
return down(button) && (mpKpadStatus->hold & 0x80000000) != 0;
}
BOOL ipl::controller::Classic::isValidDpdClassic() const {
return mClassicCursorTimer != 0;
@@ -512,16 +512,16 @@ void ipl::controller::Master::setForceInvalid(bool flag) {
return (Revolution::isValidDpd() != 0) || (mClassicCursorTimer != 0);
}
int ipl::controller::Classic::getClassicReleaseFlag() const {
return mpStatus->ex_status.cl.release;
return mpKpadStatus->ex_status.cl.release;
}
int ipl::controller::Classic::getClassicTrigFlag() const {
return mpStatus->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 = mpStatus;
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 = mpStatus;
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 ((mpStatus->hold & (button & 0xFFFF)) == 0) {
if ((mpStatus->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(mpStatus->horizon.x, mpStatus->horizon.y);
return math::VEC2(mpKpadStatus->horizon.x, mpKpadStatus->horizon.y);
}
ipl::math::VEC2 ipl::controller::Revolution::getDpdPos() const {
return math::VEC2(mpStatus->pos.x, mpStatus->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 (mpStatus->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 (mpStatus->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) {
mbPinch = 0;
mbPrevPinch = 0;
mpStatus = &status;
mbPinching = 0;
mbWasPinching = 0;
mpKpadStatus = &status;
}
Interface* Manager::getMasterController() {

View File

@@ -43,13 +43,13 @@ namespace ipl {
mMessageID = msgId;
// Debug related? (seems to be incomplete; unused)
mArg2 = arg2;
mArg3 = arg3;
unk_0x0C = arg2;
unk_0x10 = arg3;
if (arg1) {
strncpy(mArg1, arg1, sizeof(mArg1));
mArg1[sizeof(mArg1) - 1] = 0;
strncpy(unk_0x14, arg1, sizeof(unk_0x14));
unk_0x14[sizeof(unk_0x14) - 1] = 0;
} else {
memset(mArg1, 0, sizeof(mArg1));
memset(unk_0x14, 0, sizeof(unk_0x14));
}
curThread = OSGetCurrentThread();

View File

@@ -47,7 +47,7 @@ namespace ipl {
(((mLastError > NWC24_ERR_FILE_OPEN || mLastError < NWC24_ERR_FILE_OTHER) && mLastError != NWC24_ERR_NAND_CORRUPT) && \
(mLastError != NWC24_ERR_FILE_EXISTS && mLastError != NWC24_ERR_INTERNAL_VF && mLastError != NWC24_ERR_FILE_BROKEN))
Manager::Manager(EGG::Heap* heap) : mbReviecedMsg(false), mbReceiving(false), mbReceivePaused(false), mbNewTitleTblReady(false) {
Manager::Manager(EGG::Heap* heap) : mbReviecedMsg(false), unk_0xA31(false), mbReceivePaused(false), unk_0xA33(false) {
OSInitMutex(&mLock);
OSInitMutex(&mAutoLock);
@@ -526,7 +526,7 @@ namespace ipl {
return;
}
mbReceiving = true;
unk_0xA31 = true;
NWC24UserId myUserId;
getMyUserId(&myUserId);
@@ -910,8 +910,8 @@ namespace ipl {
close();
mbNewTitleTblReady = true;
mbReceiving = false;
unk_0xA33 = true;
unk_0xA31 = false;
}
void Manager::addDlTask() {
@@ -996,7 +996,7 @@ namespace ipl {
}
BOOL Manager::getNewTitleTbl(u32* titleTbl) const {
if (!mbNewTitleTblReady) {
if (!unk_0xA33) {
return FALSE;
}

View File

@@ -61,7 +61,7 @@ namespace ipl {
if (System::getPostmanManager()->IsUnknown() ||
(System::getSceneManager() != NULL && System::getScene(SCENE_ADDRESS) != NULL)) {
if (System::getNwc24Manager() != NULL && !System::isNandFull()) {
if (System::createdAfterAndLibMgr() && !System::getNwc24Manager()->isReceivingIdle()) {
if (System::createdAfterAndLibMgr() && !System::getNwc24Manager()->isUnk0xA31()) {
return;
}
}