Compare commits

..

1 Commits

Author SHA1 Message Date
coah
c7c373ee80 cleanup(CDBRecordFile): rename unk_0x1C to allocFlag
Stores CDB_RECORD_ALLOC_* from CDBRecordInstanceInit type arg.
2026-10-02 14:04:31 -05:00
28 changed files with 274 additions and 274 deletions

View File

@@ -332,12 +332,12 @@ namespace ipl {
scroller mScroller; // 0x58
picture mPicture; // 0xC8
int unused_0xF8;
u8 unused_0xFC;
int unk_0xF8;
u8 unk_0xFC;
EGG::Allocator mGUIAlloc; // 0x100
wchar_t mUrlEndCodes[6];
wchar_t unk_0x114[6];
u8* mpCmpArcData; // 0x120
u8* mpArcData; // 0x124

View File

@@ -18,11 +18,11 @@ namespace ipl {
class line_collision {
public:
line_collision() : mLeft(0.0f), mRight(0.0f), mY(0.0f) {}
line_collision() : unk_0x00(0.0f), unk_0x04(0.0f), unk_0x08(0.0f) {}
f32 mLeft;
f32 mRight;
f32 mY;
f32 unk_0x00;
f32 unk_0x04;
f32 unk_0x08;
nw4r::ut::Link mLinkList; // 0x0C
};
@@ -31,9 +31,9 @@ namespace ipl {
url_collision();
~url_collision();
int mTagNo;
wchar_t* mpStart;
wchar_t* mpEnd;
int unk_0x00;
wchar_t* unk_0x04;
wchar_t* unk_0x08;
nw4r::ut::Link mLinkList; // 0x0C
nw4r::ut::List mLineCollisions; // 0x14
};
@@ -53,19 +53,19 @@ namespace ipl {
void parse(nw4r::ut::PrintContext<wchar_t>* context);
BOOL is_focused() const;
void select(int tagNo);
void select(int unk);
int get_focused_tagno(int chan) const;
url_collision* get_selected_col();
void get_url(char* urlOut, u32 urlLen);
void setHitYOffset(f32 val) { mHitYOffset = val; }
void setMemoTranslateY(f32 val) { mMemoTranslateY = val; }
void setFocusEnabled(bool val) { mbFocusEnabled = val; }
void setUnk_0x40(f32 val) { unk_0x40 = val; }
void setUnk_0x44(f32 val) { unk_0x44 = val; }
void setUnk_0x53(bool val) { unk_0x53 = val; }
u8 getColorPass() const { return mbColorPass; }
void setColorPass(u8 val) { mbColorPass = val; }
u8 getUnk_0x50() const { return unk_0x50; }
void setUnk_0x50(u8 val) { unk_0x50 = val; }
private:
typedef struct {
@@ -75,14 +75,14 @@ namespace ipl {
con_data mConData[WPAD_MAX_CONTROLLERS]; // 0x00
nw4r::ut::List mUrlCollisions; // 0x34
f32 mHitYOffset;
f32 mMemoTranslateY;
int mCurTagNo;
int mSelectedTagNo;
u8 mbColorPass;
u8 mbInTag;
u8 mbHoverOffset;
u8 mbFocusEnabled;
f32 unk_0x40;
f32 unk_0x44;
int unk_0x48;
int unk_0x4C;
u8 unk_0x50;
u8 unk_0x51;
u8 unk_0x52;
u8 unk_0x53;
};
} // namespace scene
} // namespace ipl

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

@@ -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

@@ -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;
}
@@ -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);
}

View File

@@ -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

@@ -242,8 +242,8 @@ typedef struct WPADCB {
WPADCallback getInfoCB; // 0x988
u8 getInfoBusy; // 0x98C
u8 encStatus; // 0x98D
u8 continuous; // 0x98E
u8 unk_0x98D; // 0x98D
u8 unk_0x98E; // 0x98E
u8 unk_0x98F[0x9A0 - 0x990];
} WPADCB;
@@ -261,7 +261,7 @@ void WPADiExcludeButton(s32 chan);
void WPADiCopyOut(s32 chan);
BOOL WPADiSendSetPort(WPADCommandQueue* pQueue, u8 port, WPADCallback pCallback);
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL continuous, WPADCallback pCallback);
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL unk, WPADCallback pCallback);
BOOL WPADiSendEnableDPD(WPADCommandQueue* pQueue, BOOL enable, WPADCallback pCallback);
BOOL WPADiSendEnableSpeaker(WPADCommandQueue* pQueue, BOOL enable, WPADCallback pCallback);
BOOL WPADiSendGetContStat(WPADCommandQueue* pQueue, WPADInfo* pInfo, WPADCallback pCallback);

View File

@@ -24,7 +24,7 @@ typedef struct WPADMemBlock {
int unk_0x04; // 0x04
s16 unk_0x08; // 0x08
int unk_0x0C; // 0x0C
WPADCallback callback; // 0x10
WPADCallback unk_0x10; // 0x10
} WPADMemBlock;
typedef struct WPADGameInfo {

View File

@@ -1283,7 +1283,7 @@ static void __ClearControlBlock(s32 chan) {
p->sleeping = TRUE;
p->getInfoBusy = FALSE;
p->getInfoCB = NULL;
p->continuous = 0;
p->unk_0x98E = 0;
memset(&p->wpInfo, 0, sizeof(p->wpInfo));
memset(&p->wmReadDataBuf, 0, sizeof(p->wmReadDataBuf));
@@ -1315,7 +1315,7 @@ static void __ClearControlBlock(s32 chan) {
_wmb[chan].unk_0x04 = 0;
_wmb[chan].unk_0x08 = 0;
_wmb[chan].unk_0x0C = 0;
_wmb[chan].callback = NULL;
_wmb[chan].unk_0x10 = NULL;
_rumbleCnt[chan] = 0;
}
@@ -1551,7 +1551,7 @@ static void firmwareCheckCallback(s32 chan, s32 status) {
DEBUGPrint(" ==>this error means that the firmware is for NDEV %s\n", p->configIndex != 0 ? "2.0" : "2.1 or later");
WPADiSendSetReportType(&p->stdCmdQueue, WPAD_FMT_CORE_BTN, p->continuous, &abortConnCallback);
WPADiSendSetReportType(&p->stdCmdQueue, WPAD_FMT_CORE_BTN, p->unk_0x98E, &abortConnCallback);
WPADiSendDPDCSB(&p->stdCmdQueue, FALSE, &abortConnCallback);
WPADiSendSetPort(&p->stdCmdQueue, port, &abortConnCallback);
@@ -1626,7 +1626,7 @@ static void WPADiConnCallback(WUDDevInfo* devInfo, u8 open) {
p->status = WPAD_ERR_OK;
p->radioSensitivity = 100;
p->sleeping = FALSE;
p->encStatus = FALSE;
p->unk_0x98D = FALSE;
WPADiSendReadData(&p->stdCmdQueue, p->wmReadDataBuf, 1, WM_ADDR_MEM_1770, firmwareCheckCallback);
@@ -1643,8 +1643,8 @@ static void WPADiConnCallback(WUDDevInfo* devInfo, u8 open) {
if (p->cmdBlkCB != NULL) {
p->cmdBlkCB(chan, WPAD_ERR_NO_CONTROLLER);
} else if (_wmb[chan].callback != NULL) {
_wmb[chan].callback(chan, WPAD_ERR_NO_CONTROLLER);
} else if (_wmb[chan].unk_0x10 != NULL) {
_wmb[chan].unk_0x10(chan, WPAD_ERR_NO_CONTROLLER);
}
do {
@@ -1886,7 +1886,7 @@ s32 WPADSetDataFormat(s32 chan, u32 format) {
}
if (currFormat != format) {
if (!WPADiSendSetReportType(&p->stdCmdQueue, format, p->continuous, NULL)) {
if (!WPADiSendSetReportType(&p->stdCmdQueue, format, p->unk_0x98E, NULL)) {
status = WPAD_ERR_COMMUNICATION_ERROR;
} else {
enabled = OSDisableInterrupts();
@@ -2741,13 +2741,13 @@ BOOL WPADiSendSetPort(WPADCommandQueue* pQueue, u8 port, WPADCallback pCallback)
return success;
}
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL continuous, WPADCallback pCallback) {
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL unk, WPADCallback pCallback) {
BOOL success;
WPADCommand command;
command.reportID = RPTID_SET_DATA_REPORT_MODE;
command.dataLength = RPT12_SIZE;
command.dataBuf[RPT12_CONT_REPORT] = continuous ? 0 : 4; // Always continuous reporting
command.dataBuf[RPT12_CONT_REPORT] = unk ? 0 : 4; // Always continuous reporting
command.cmdCB = pCallback;
switch (format) {

View File

@@ -111,8 +111,8 @@ static void initExtension(s32 chan) {
WPADiClearQueue(&p_wpd->extCmdQueue);
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat,
p_wpd->continuous, abortInitExtension);
p_wpd->encStatus = 1;
p_wpd->unk_0x98E, abortInitExtension);
p_wpd->unk_0x98D = 1;
WPADiSendWriteDataCmd(&p_wpd->extCmdQueue, 0x55, 0x04a400f0,
abortInitExtension);
WPADiSendWriteDataCmd(&p_wpd->extCmdQueue, 0, 0x04a400fb,
@@ -127,7 +127,7 @@ static void abortInitExtension(s32 chan, s32 result) {
if (result != WPAD_ERR_NONE) {
WPADiClearQueue(&p_wpd->extCmdQueue);
p_wpd->encStatus = 0;
p_wpd->unk_0x98D = 0;
if (result == WPAD_ERR_NO_CONTROLLER) {
type = WPAD_DEV_NOT_FOUND;
}
@@ -142,7 +142,7 @@ static void abortInitExtension(s32 chan, s32 result) {
else {
DEBUGPrint("detaching extension during initialization.\n");
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->continuous, NULL);
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->unk_0x98E, NULL);
return;
}
p_wpd->devType = (u8)type;
@@ -509,7 +509,7 @@ static void getExtType(s32 chan, s32 result) {
}
} else {
if (isExtEncMain(_devType[chan])) {
p_wpd->encStatus = 2;
p_wpd->unk_0x98D = 2;
WPADiSendWriteDataCmd(cmdq, 0xAA, 0x4A400F0, abortInitExtension);
WPADiCreateKey(chan);
WPADiSendWriteData(cmdq, p_wpd->encryptionKey, 6, 0x4A40040, abortInitExtension);
@@ -517,7 +517,7 @@ static void getExtType(s32 chan, s32 result) {
WPADiSendWriteData(cmdq, p_wpd->encryptionKey + 12, 4, 0x4A4004C, abortInitExtension);
WPADiSendReadData(cmdq, p_wpd->wmReadDataBuf, 32, 0x4A40020, p_wpd->extensionCB);
} else {
p_wpd->encStatus = 3;
p_wpd->unk_0x98D = 3;
WPADiSendWriteDataCmd(cmdq, 0xAA, 0x4A400F0, abortInitExtension);
WPADiCreateKeyFor3rd(chan);
WPADiSendWriteData(cmdq, p_wpd->encryptionKey, 6, 0x4A40040, abortInitExtension);
@@ -651,7 +651,7 @@ void __a1_20_status_report(u8 chan, u8* data) {
p_wpd->devMode = 0;
WPADiClearQueue(&p_wpd->extCmdQueue);
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->continuous, NULL);
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->unk_0x98E, NULL);
if (attach) {
if (p_wpd->extensionCB) {
@@ -741,11 +741,11 @@ void __a1_21_user_data(u8 chan, u8* data) {
DEBUGPrint("length : %d\n", p_wpd->wmReadLength);
status = (p_wpd->wmReadHadError < 0) ? WPAD_ERR_TRANSFER : 0;
DEBUGPrint("i2c = %04x\n", i2c);
DEBUGPrint("enc = %d\n", p_wpd->encStatus);
DEBUGPrint("enc = %d\n", p_wpd->unk_0x98D);
if (i2c == 0x04a4) {
DEBUGPrint("Access to extension register.\n");
if (p_wpd->encStatus == 2 || p_wpd->encStatus == 3) {
if (p_wpd->unk_0x98D == 2 || p_wpd->unk_0x98D == 3) {
DEBUGPrint("Decode!!!!\n");
DEBUGPrint(" len = %d, addr = %04x\n", len, base);

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 unk_0x10;
#else
u8 unk_0x10[0x4];
#endif
@@ -46,8 +46,8 @@ typedef struct NWC24MsgObjPrivate {
#endif
u32 date; // 0x28
u32 receivedDate; // 0x2C
NWC24Data fromData; // 0x30
NWC24Data toData; // 0x38
NWC24Data unk_0x30;
NWC24Data unk_0x38;
NWC24Data subject; // 0x40
NWC24Data text; // 0x48
NWC24Data unk_0x50;
@@ -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

@@ -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->unk_0x10 && (s32)entry->date == (s32)msg->date) {
duplicateId = entry->msgId;
duplicateOffset = offset;
continue;
@@ -947,8 +947,8 @@ static NWC24Err MountVFMBox(NWC24MBoxType type) {
}
static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entry) {
u32 field1 = ((u32)msg->fromData.ptr & 0xFFFFF) | (msg->fromData.size << 20);
u32 field2 = ((u32)msg->toData.ptr & 0xFFFFF) | (msg->toData.size << 20);
u32 field1 = ((u32)msg->unk_0x30.ptr & 0xFFFFF) | (msg->unk_0x30.size << 20);
u32 field2 = ((u32)msg->unk_0x38.ptr & 0xFFFFF) | (msg->unk_0x38.size << 20);
u32 field3 = ((u32)msg->subject.ptr & 0xFFFFF) | (msg->subject.size << 20);
u32 field4 = ((u32)msg->unk_0x50.ptr & 0xFFFFF) | (msg->unk_0x50.size << 20);
u32 field5 = ((u32)msg->unk_0x58.ptr & 0xFFFFF) | (msg->unk_0x58.size << 20);
@@ -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->unk_0x10;
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->unk_0x10 = entry->flags;
msg->tag = entry->tag;
msg->ledPattern = entry->ledPattern;
msg->unk_0x1C = entry->crc;
@@ -1019,10 +1019,10 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
msg->textSize = entry->textSize;
msg->dwcId = entry->dwcId;
msg->iconNew = entry->iconNew;
msg->fromData.ptr = (void*)offset1;
msg->fromData.size = size1;
msg->toData.ptr = (void*)offset2;
msg->toData.size = size2;
msg->unk_0x30.ptr = (void*)offset1;
msg->unk_0x30.size = size1;
msg->unk_0x38.ptr = (void*)offset2;
msg->unk_0x38.size = size2;
msg->subject.ptr = (void*)offset3;
msg->subject.size = size3;
msg->unk_0x50.ptr = (void*)offset4;

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->unk_0x10 = 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->unk_0x10 = msg->length;
text.ptr = (const void*)msg->length;
{ NWC24Err textResult = WritePlainText(msg);
err = textResult == NWC24_ERR_NULL ? NWC24_OK : textResult; }
@@ -577,7 +577,7 @@ static NWC24Err WriteFromField(NWC24MsgObjPrivate* msg) {
Mail_memset(buffer, 0, 1024);
Mail_strncat(buffer, "From: ", 1022);
address = buffer + 6;
msg->fromData.ptr = (const void*)(msg->length + 6);
msg->unk_0x30.ptr = (const void*)(msg->length + 6);
type = 1;
if (msg->type & 0x100000)
type = 2;
@@ -596,7 +596,7 @@ static NWC24Err WriteFromField(NWC24MsgObjPrivate* msg) {
err = NWC24FWrite(NWC24WorkP->stringWork, total, m_pFile);
if (err == NWC24_OK) {
msg->length += total;
msg->fromData.size = msg->length - (u32)msg->fromData.ptr - 2;
msg->unk_0x30.size = msg->length - (u32)msg->unk_0x30.ptr - 2;
}
}
return err;
@@ -612,7 +612,7 @@ static NWC24Err WriteToField(NWC24MsgObjPrivate* msg) {
cursor += 4;
index = 0;
total = 4;
msg->toData.ptr = (const void*)(msg->length + 4);
msg->unk_0x38.ptr = (const void*)(msg->length + 4);
remaining = 1018;
for (; index < msg->numTo; ++index) {
err = SynthesizeAddrStr(&msg->toAddrs[index], msg->type, cursor, remaining, &length);
@@ -641,7 +641,7 @@ static NWC24Err WriteToField(NWC24MsgObjPrivate* msg) {
err = NWC24FWrite(NWC24WorkP->stringWork, total + 2, m_pFile);
if (err == NWC24_OK) {
msg->length += total + 2;
msg->toData.size = msg->length - (u32)msg->toData.ptr - 2;
msg->unk_0x38.size = msg->length - (u32)msg->unk_0x38.ptr - 2;
}
}
return err;

View File

@@ -73,11 +73,11 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
msgObj->attachedType[i] = NWC24_TEXT_PLAIN;
}
NWC24Data_Init(&msgObj->fromData);
NWC24Data_Init(&msgObj->toData);
NWC24Data_Init(&msgObj->unk_0x30);
NWC24Data_Init(&msgObj->unk_0x38);
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

@@ -289,7 +289,7 @@ NWC24Err NWC24ReadMsgFromAddr(const NWC24MsgObj* msg, char* address, u32 capacit
default:
return result;
}
if (privateMsg->fromData.size == 0)
if (privateMsg->unk_0x30.size == 0)
return NWC24_ERR_NULL;
result = NWC24iMBoxOpenStoredMsg(type, privateMsg->msgId, &file);
switch (result) {
@@ -300,9 +300,9 @@ NWC24Err NWC24ReadMsgFromAddr(const NWC24MsgObj* msg, char* address, u32 capacit
}
result = NWC24FStreamInit(&stream, &file, 0, privateMsg->length, buffer, 1024);
if (result == NWC24_OK) {
result = NWC24FStreamSeek(&stream, (u32)privateMsg->fromData.ptr);
result = NWC24FStreamSeek(&stream, (u32)privateMsg->unk_0x30.ptr);
if (result == NWC24_OK)
result = NWC24iExtractAddrSpec(&stream, privateMsg->fromData.size, 0, address, capacity);
result = NWC24iExtractAddrSpec(&stream, privateMsg->unk_0x30.size, 0, address, capacity);
}
closeResult = NWC24iMBoxCloseMsg(&file);
if (result != NWC24_OK)

View File

@@ -144,7 +144,7 @@ namespace ipl {
focus_object::focus_object(nand::LayoutFile* layoutFile, nand::LayoutFile* balloonFile, BoardObject* boardObject)
: mState(STATE_INIT_NORMAL), mNextState(STATE_NONE), mPrevState(STATE_NONE), mFinalResult(RESULT_NONE), mCurrentResult(RESULT_NONE),
mpBoardObj(boardObject), mpLayout(NULL), mpGui(NULL), mpNigaoeBalloon(NULL), mpParsedText(NULL), mEvent(this), mButtonEvent(this),
mOptOutEvent(this), mScroller(), mPicture(), unused_0xF8(0), unused_0xFC(0), mGUIAlloc(System::getMem2App(), 4), mpCmpArcData(NULL),
mOptOutEvent(this), mScroller(), mPicture(), unk_0xF8(0), unk_0xFC(0), mGUIAlloc(System::getMem2App(), 4), mpCmpArcData(NULL),
mpArcData(NULL), mArcLength(0), mbChanJump(false), mpChJpData(NULL), mpSoundData(NULL), mSoundSize(0), mbSoundPlaying(false),
mURLProc(), mFadeAnim(), mNwc24ErrCountdown(0), mChanJumpCountdown(0), mbShowUArw(false), mbShowDArw(false), mbScaleUArw(false),
mbScaleDArw(false), mbParentalSuccess(false) {
@@ -156,12 +156,12 @@ namespace ipl {
mbHoveredURL[i] = false;
}
mUrlEndCodes[0] = L' ';
mUrlEndCodes[1] = L' ';
mUrlEndCodes[2] = L'\n';
mUrlEndCodes[3] = L'\t';
mUrlEndCodes[4] = 0;
mUrlEndCodes[5] = 0;
unk_0x114[0] = L' ';
unk_0x114[1] = L' ';
unk_0x114[2] = L'\n';
unk_0x114[3] = L'\t';
unk_0x114[4] = 0;
unk_0x114[5] = 0;
make_layout(layoutFile);
make_gui_mgr();
@@ -930,13 +930,13 @@ namespace ipl {
math::VEC3 translate(mpLayout->FindPaneByName("N_Memo")->GetTranslate());
mURLProc.clear_prev_drawing();
mURLProc.setMemoTranslateY(translate.y);
mURLProc.setUnk_0x44(translate.y);
bool result = false;
if (mState == STATE_NORMAL && mScroller.is_busy() == FALSE) {
result = true;
}
mURLProc.setFocusEnabled(result);
mURLProc.setUnk_0x53(result);
if (translate.y < 500.0f) {
mpLayout->draw("N_Header");
@@ -983,8 +983,8 @@ namespace ipl {
mpLayout->draw("ReplyMask");
}
if (!mURLProc.getColorPass()) {
mURLProc.setColorPass(1);
if (!mURLProc.getUnk_0x50()) {
mURLProc.setUnk_0x50(1);
}
}
@@ -1196,7 +1196,7 @@ namespace ipl {
const wchar_t* pURLStr = &inText[i];
// Parse the URL
mUrlEndCodes[5] = 0;
unk_0x114[5] = 0;
if (pURLStr != pStr) {
check_paren(pURLStr[-1]);
@@ -1225,8 +1225,8 @@ namespace ipl {
BOOL focus_object::is_url_end_code(wchar_t ch) const {
bool result = FALSE;
for (int i = 0; i < ARRAY_LENGTH(mUrlEndCodes); i++) {
result |= ((mUrlEndCodes[i] - ch) == 0);
for (int i = 0; i < ARRAY_LENGTH(unk_0x114); i++) {
result |= ((unk_0x114[i] - ch) == 0);
}
return result;
}
@@ -1278,7 +1278,7 @@ namespace ipl {
for (int i = 0; i < ARRAY_LENGTH(patterns); i++) {
if (ch == patterns[i][0]) {
mUrlEndCodes[5] = patterns[i][1];
unk_0x114[5] = patterns[i][1];
break;
}
}
@@ -1512,7 +1512,7 @@ namespace ipl {
mURLProc.init();
if (mpBoardObj->mLetterType == BoardObject::TYPE_MEMO) {
mURLProc.setHitYOffset(8.0f);
mURLProc.setUnk_0x40(8.0f);
}
nw4r::lyt::Pane* pane = mpLayout->FindPaneByName("T_Letter");

View File

@@ -15,16 +15,16 @@ namespace ipl {
}
void UrlProcessor::init() {
mbHoverOffset = 0;
mbInTag = 0;
mbColorPass = 0;
mbFocusEnabled = 1;
unk_0x52 = 0;
unk_0x51 = 0;
unk_0x50 = 0;
unk_0x53 = 1;
mHitYOffset = 0.0f;
mMemoTranslateY = 0.0f;
unk_0x40 = 0.0f;
unk_0x44 = 0.0f;
mCurTagNo = 0;
mSelectedTagNo = -1;
unk_0x48 = 0;
unk_0x4C = -1;
for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) {
mConData[i].valid = false;
@@ -60,14 +60,14 @@ namespace ipl {
}
void UrlProcessor::clear_prev_drawing() {
mCurTagNo = 0;
mbHoverOffset = 0;
mbInTag = 0;
unk_0x48 = 0;
unk_0x52 = 0;
unk_0x51 = 0;
}
nw4r::ut::Operation UrlProcessor::Process(u16 code, nw4r::ut::PrintContext<wchar_t>* context) {
if (code == SEPERATOR || code == (u16)'\n') {
if (mbColorPass == 0) {
if (unk_0x50 == 0) {
make_collision(context, code);
} else if (code == SEPERATOR) {
parse(context);
@@ -78,42 +78,42 @@ namespace ipl {
void UrlProcessor::make_collision(nw4r::ut::PrintContext<wchar_t>* context, u16 code) {
if (code == SEPERATOR) {
if (mbInTag == 0) {
if (unk_0x51 == 0) {
url_collision* const url_col = new (System::getMem2App(), 4) url_collision();
line_collision* const line_col = new (System::getMem2App(), 4) line_collision();
url_col->mTagNo = mCurTagNo;
url_col->mpStart = (wchar_t*)context->str;
url_col->unk_0x00 = unk_0x48;
url_col->unk_0x04 = (wchar_t*)context->str;
line_col->mLeft = context->writer->GetCursorX();
line_col->unk_0x00 = context->writer->GetCursorX();
nw4r::ut::List_Append(&url_col->mLineCollisions, line_col);
nw4r::ut::List_Append(&mUrlCollisions, url_col);
mbInTag = 1;
unk_0x51 = 1;
} else {
void* url_col_raw = nw4r::ut::List_GetPrev(&mUrlCollisions, NULL);
void* line_col_raw = nw4r::ut::List_GetPrev(&((url_collision*)url_col_raw)->mLineCollisions, NULL);
url_collision* url_col = (url_collision*)url_col_raw;
line_collision* line_col = (line_collision*)line_col_raw;
line_col->mRight = context->writer->GetCursorX();
line_col->mY = context->writer->GetCursorY();
line_col->unk_0x04 = context->writer->GetCursorX();
line_col->unk_0x08 = context->writer->GetCursorY();
url_col->mpEnd = (wchar_t*)context->str;
url_col->unk_0x08 = (wchar_t*)context->str;
mbInTag = 0;
mCurTagNo++;
unk_0x51 = 0;
unk_0x48++;
}
} else {
if (mbInTag != 0) {
if (unk_0x51 != 0) {
url_collision* url_col = (url_collision*)nw4r::ut::List_GetPrev(&mUrlCollisions, NULL);
line_collision* line_col = (line_collision*)nw4r::ut::List_GetPrev(&url_col->mLineCollisions, NULL);
line_col->mRight = context->writer->GetCursorX();
line_col->mY = context->writer->GetCursorY();
line_col->unk_0x04 = context->writer->GetCursorX();
line_col->unk_0x08 = context->writer->GetCursorY();
line_col = new (System::getMem2App(), 4) line_collision();
line_col->mLeft = -208.0f;
line_col->unk_0x00 = -208.0f;
nw4r::ut::List_Append(&url_col->mLineCollisions, line_col);
}
@@ -122,41 +122,41 @@ namespace ipl {
void UrlProcessor::parse(nw4r::ut::PrintContext<wchar_t>* context) {
f32 curY = context->writer->GetCursorY();
if (mbInTag == 0) {
if (mSelectedTagNo == mCurTagNo) {
if (unk_0x51 == 0) {
if (unk_0x4C == unk_0x48) {
context->writer->SetTextColor(0xFFE664FF);
} else if (mbFocusEnabled != 0 && is_focused()) {
} else if (unk_0x53 != 0 && is_focused()) {
context->writer->SetCursorY(curY - 2.0f);
context->writer->SetTextColor(0xF06E28FF);
mbHoverOffset = 1;
unk_0x52 = 1;
} else {
context->writer->SetTextColor(0x34BEEDFF);
}
mbInTag = 1;
unk_0x51 = 1;
} else {
if (mbHoverOffset != 0) {
if (unk_0x52 != 0) {
context->writer->SetCursorY(2.0f + curY);
mbHoverOffset = 0;
unk_0x52 = 0;
}
context->writer->SetTextColor(0x646464FF);
mbInTag = 0;
mCurTagNo++;
unk_0x51 = 0;
unk_0x48++;
}
}
BOOL UrlProcessor::is_focused() const {
for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) {
if (mCurTagNo == get_focused_tagno(i)) {
if (unk_0x48 == get_focused_tagno(i)) {
return TRUE;
}
}
return FALSE;
}
void UrlProcessor::select(int tagNo) {
mSelectedTagNo = tagNo;
void UrlProcessor::select(int unk) {
unk_0x4C = unk;
}
int UrlProcessor::get_focused_tagno(int chan) const {
@@ -174,13 +174,13 @@ namespace ipl {
while (url_col = (url_collision*)nw4r::ut::List_GetNext(&mUrlCollisions, url_col), url_col != NULL) {
while (line_col = (line_collision*)nw4r::ut::List_GetNext(&url_col->mLineCollisions, line_col), line_col != NULL) {
f32 left = line_col->mLeft - var_f28;
f32 right = var_f28 + line_col->mRight;
f32 temp_f0 = ((mMemoTranslateY + mHitYOffset) - line_col->mY);
f32 left = line_col->unk_0x00 - var_f28;
f32 right = var_f28 + line_col->unk_0x04;
f32 temp_f0 = ((unk_0x44 + unk_0x40) - line_col->unk_0x08);
f32 top = (var_f29 + temp_f0) - var_f28;
f32 bottom = var_f28 + (var_f30 + temp_f0);
if (left <= var_f31 && var_f31 <= right && top <= -pos.y && -pos.y <= bottom) {
return url_col->mTagNo;
return url_col->unk_0x00;
}
}
}
@@ -194,7 +194,7 @@ namespace ipl {
url_collision* url_col = NULL;
while (got = (url_collision*)nw4r::ut::List_GetNext(&mUrlCollisions, got), got != NULL) {
if (got->mTagNo == mSelectedTagNo) {
if (got->unk_0x00 == unk_0x4C) {
url_col = got;
break;
}
@@ -210,10 +210,10 @@ namespace ipl {
int chIdx2 = 0;
int chIdx = 0;
u32 count = (u32)url_col->mpEnd - (u32)url_col->mpStart;
u32 count = (u32)url_col->unk_0x08 - (u32)url_col->unk_0x04;
count >>= 1;
for (u32 i = 0; i < count; i++) {
wchar_t wch = url_col->mpStart[i];
wchar_t wch = url_col->unk_0x04[i];
if (wch != SEPERATOR && chIdx2 < 0x200) {
url[chIdx2++] = wch;
}
@@ -226,9 +226,9 @@ namespace ipl {
}
UrlProcessor::url_collision::url_collision() {
mTagNo = 0;
mpStart = NULL;
mpEnd = NULL;
unk_0x00 = 0;
unk_0x04 = NULL;
unk_0x08 = NULL;
nw4r::ut::List_Init(&mLineCollisions, offsetof(line_collision, mLinkList));
}

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

@@ -25,16 +25,16 @@ typedef struct {
undefined4 result;
undefined4 errCode;
HTTPTestState httpTestState;
undefined4 natState;
undefined4 gsAvailable;
undefined4 natTimedOut;
undefined4 natFailed;
undefined4 unk_0x030;
undefined4 unk_0x034;
undefined4 unk_0x038;
undefined4 unk_0x03c;
OSTime detectStartTime;
NHTTPConnection httpConnection;
NHTTPRequest* httpRequest;
NHTTPResponse* httpResponse;
NCDProxyProfile proxy;
void* httpBuf;
void* unk_0x7f0;
NAT nat;
} StaticSession;
@@ -64,14 +64,14 @@ void IPLContestInitialize(void* heapBuf, NCDProxyProfile* proxy) {
g_session.result = 0xFF00;
g_session.errCode = 0;
g_session.httpTestState = HTTP_TEST_NOT_STARTED;
g_session.natState = 0;
g_session.unk_0x030 = 0;
g_session.detectStartTime = 0;
g_session.httpConnection = 0;
g_session.httpRequest = 0;
g_session.httpResponse = NULL;
g_session.gsAvailable = 0;
g_session.natTimedOut = 0;
g_session.natFailed = 1;
g_session.unk_0x034 = 0;
g_session.unk_0x038 = 0;
g_session.unk_0x03c = 1;
g_session.proxy = *proxy;
}
@@ -100,7 +100,7 @@ int IPLContestProcess() {
g_session.errCode = g_session.errCode != 0 ? g_session.errCode : -52200;
OSReport("[error] Failed to start up NHTTP.\n");
} else {
g_session.httpBuf = IPLContestAlloc(0x400);
g_session.unk_0x7f0 = IPLContestAlloc(0x400);
g_session.httpTestState = HTTP_TEST_STARTED;
OSReport("Starting HTTP conectting test.\n");
}
@@ -108,7 +108,7 @@ int IPLContestProcess() {
}
case HTTP_TEST_STARTED: {
g_session.httpRequest =
NHTTPCreateRequest("http://conntest.nintendowifi.net/", 0, g_session.httpBuf, 0x400, sNHTTPReqCallback, 0);
NHTTPCreateRequest("http://conntest.nintendowifi.net/", 0, g_session.unk_0x7f0, 0x400, sNHTTPReqCallback, 0);
if (g_session.httpRequest == 0) {
g_session.httpTestState = HTTP_TEST_RESPONSE_ERRORED;
g_session.result |= 4;
@@ -156,9 +156,9 @@ int IPLContestProcess() {
NHTTPDestroyResponse(g_session.httpResponse);
g_session.httpResponse = NULL;
}
if (g_session.httpBuf != NULL) {
IPLContestFree(g_session.httpBuf, 0);
g_session.httpBuf = NULL;
if (g_session.unk_0x7f0 != NULL) {
IPLContestFree(g_session.unk_0x7f0, 0);
g_session.unk_0x7f0 = NULL;
}
g_session.httpTestState = HTTP_TEST_DONE;
NHTTPCleanupAsync(sNHTTPCleanupCallback);
@@ -176,9 +176,9 @@ int IPLContestProcess() {
NHTTPDestroyResponse(g_session.httpResponse);
g_session.httpResponse = NULL;
}
if (g_session.httpBuf != NULL) {
IPLContestFree(g_session.httpBuf, 0);
g_session.httpBuf = NULL;
if (g_session.unk_0x7f0 != NULL) {
IPLContestFree(g_session.unk_0x7f0, 0);
g_session.unk_0x7f0 = NULL;
}
g_session.httpTestState = HTTP_TEST_DONE;
NHTTPCleanupAsync(sNHTTPCleanupCallback);
@@ -198,11 +198,11 @@ int IPLContestProcess() {
OSReport("Port mapping detectioning test has been skipped.\n");
} else
switch (g_session.natState) {
switch (g_session.unk_0x030) {
case 0: {
gsiMemoryCallbacksSet(IPLContestGSMalloc, IPLContestGSFree, IPLContestGSRealloc, IPLContestGSMemalign);
GSIStartAvailableCheckA("wiinat");
g_session.natState = 1;
g_session.unk_0x030 = 1;
OSReport("Starting GameSpy available check.\n");
break;
}
@@ -212,14 +212,14 @@ int IPLContestProcess() {
break;
}
case GSIACAvailable: {
g_session.gsAvailable = 1;
g_session.natState = 2;
g_session.unk_0x034 = 1;
g_session.unk_0x030 = 2;
OSReport("GameSpy server is currently available.\n");
break;
}
default: {
g_session.gsAvailable = 0;
g_session.natState = 5;
g_session.unk_0x034 = 0;
g_session.unk_0x030 = 5;
OSReport("GameSpy server is currently unavailable.\n");
break;
}
@@ -228,7 +228,7 @@ int IPLContestProcess() {
}
case 2: {
NNStartNatDetection(onNatDetectionDone);
g_session.natState = 3;
g_session.unk_0x030 = 3;
OSReport("Port mapping detectioning test has been started.\n");
g_session.detectStartTime = OSGetTime();
break;
@@ -238,8 +238,8 @@ int IPLContestProcess() {
if (OSGetTime() - g_session.detectStartTime < OSMillisecondsToTicks((OSTime)90000)) {
break;
}
g_session.natState = 5;
g_session.natTimedOut = 1;
g_session.unk_0x030 = 5;
g_session.unk_0x038 = 1;
OSReport("[error] NAT timeout.\n");
break;
}
@@ -289,10 +289,10 @@ int IPLGetNATSupportCode(int conntype) {
nat = g_session.nat;
if (g_session.gsAvailable != 0) {
if (g_session.natTimedOut != 0) {
if (g_session.unk_0x034 != 0) {
if (g_session.unk_0x038 != 0) {
code = 11180;
} else if (g_session.natFailed != 0) {
} else if (g_session.unk_0x03c != 0) {
code = 11170;
} else {
if (nat.mappingScheme == 0 && nat.mappings[2].publicPort == nat.mappings[1].publicPort * 2 - nat.mappings[0].publicPort) {
@@ -464,10 +464,10 @@ void sNHTTPCleanupCallback() {
void onNatDetectionDone(gsi_bool success, NAT nat) {
if (success) {
g_session.nat = nat;
g_session.natFailed = 0;
g_session.unk_0x03c = 0;
} else {
g_session.natFailed = 1;
g_session.unk_0x03c = 1;
}
g_session.natState = 4;
g_session.unk_0x030 = 4;
return;
}

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

@@ -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;
}
}