Compare commits
9 Commits
cleanup/ip
...
cleanup/ez
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cdb804e8c | ||
|
|
0a925c7053 | ||
|
|
c0126c37d4 | ||
|
|
fc2d150c6d | ||
|
|
7851b2b29f | ||
|
|
263411ccac | ||
|
|
09de907f0b | ||
|
|
4e3ab6eae5 | ||
|
|
99d6fe20a2 |
@@ -18,11 +18,11 @@ namespace ipl {
|
|||||||
|
|
||||||
class line_collision {
|
class line_collision {
|
||||||
public:
|
public:
|
||||||
line_collision() : unk_0x00(0.0f), unk_0x04(0.0f), unk_0x08(0.0f) {}
|
line_collision() : mLeft(0.0f), mRight(0.0f), mY(0.0f) {}
|
||||||
|
|
||||||
f32 unk_0x00;
|
f32 mLeft;
|
||||||
f32 unk_0x04;
|
f32 mRight;
|
||||||
f32 unk_0x08;
|
f32 mY;
|
||||||
nw4r::ut::Link mLinkList; // 0x0C
|
nw4r::ut::Link mLinkList; // 0x0C
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -31,9 +31,9 @@ namespace ipl {
|
|||||||
url_collision();
|
url_collision();
|
||||||
~url_collision();
|
~url_collision();
|
||||||
|
|
||||||
int unk_0x00;
|
int mTagNo;
|
||||||
wchar_t* unk_0x04;
|
wchar_t* mpStart;
|
||||||
wchar_t* unk_0x08;
|
wchar_t* mpEnd;
|
||||||
nw4r::ut::Link mLinkList; // 0x0C
|
nw4r::ut::Link mLinkList; // 0x0C
|
||||||
nw4r::ut::List mLineCollisions; // 0x14
|
nw4r::ut::List mLineCollisions; // 0x14
|
||||||
};
|
};
|
||||||
@@ -53,19 +53,19 @@ namespace ipl {
|
|||||||
void parse(nw4r::ut::PrintContext<wchar_t>* context);
|
void parse(nw4r::ut::PrintContext<wchar_t>* context);
|
||||||
|
|
||||||
BOOL is_focused() const;
|
BOOL is_focused() const;
|
||||||
void select(int unk);
|
void select(int tagNo);
|
||||||
|
|
||||||
int get_focused_tagno(int chan) const;
|
int get_focused_tagno(int chan) const;
|
||||||
url_collision* get_selected_col();
|
url_collision* get_selected_col();
|
||||||
|
|
||||||
void get_url(char* urlOut, u32 urlLen);
|
void get_url(char* urlOut, u32 urlLen);
|
||||||
|
|
||||||
void setUnk_0x40(f32 val) { unk_0x40 = val; }
|
void setHitYOffset(f32 val) { mHitYOffset = val; }
|
||||||
void setUnk_0x44(f32 val) { unk_0x44 = val; }
|
void setMemoTranslateY(f32 val) { mMemoTranslateY = val; }
|
||||||
void setUnk_0x53(bool val) { unk_0x53 = val; }
|
void setFocusEnabled(bool val) { mbFocusEnabled = val; }
|
||||||
|
|
||||||
u8 getUnk_0x50() const { return unk_0x50; }
|
u8 getColorPass() const { return mbColorPass; }
|
||||||
void setUnk_0x50(u8 val) { unk_0x50 = val; }
|
void setColorPass(u8 val) { mbColorPass = val; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -75,14 +75,14 @@ namespace ipl {
|
|||||||
|
|
||||||
con_data mConData[WPAD_MAX_CONTROLLERS]; // 0x00
|
con_data mConData[WPAD_MAX_CONTROLLERS]; // 0x00
|
||||||
nw4r::ut::List mUrlCollisions; // 0x34
|
nw4r::ut::List mUrlCollisions; // 0x34
|
||||||
f32 unk_0x40;
|
f32 mHitYOffset;
|
||||||
f32 unk_0x44;
|
f32 mMemoTranslateY;
|
||||||
int unk_0x48;
|
int mCurTagNo;
|
||||||
int unk_0x4C;
|
int mSelectedTagNo;
|
||||||
u8 unk_0x50;
|
u8 mbColorPass;
|
||||||
u8 unk_0x51;
|
u8 mbInTag;
|
||||||
u8 unk_0x52;
|
u8 mbHoverOffset;
|
||||||
u8 unk_0x53;
|
u8 mbFocusEnabled;
|
||||||
};
|
};
|
||||||
} // namespace scene
|
} // namespace scene
|
||||||
} // namespace ipl
|
} // namespace ipl
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ typedef struct {
|
|||||||
u8 mcuYRem; // 0x0F
|
u8 mcuYRem; // 0x0F
|
||||||
u16 mcuYCount; // 0x10
|
u16 mcuYCount; // 0x10
|
||||||
u16 mcuXCount2; // 0x12
|
u16 mcuXCount2; // 0x12
|
||||||
u32 unk_0x14;
|
u32 mcuTotal; // 0x14
|
||||||
u8 remX; // 0x18
|
u8 remX; // 0x18
|
||||||
u8 remY; // 0x19
|
u8 remY; // 0x19
|
||||||
u8 compCount; // 0x1A
|
u8 compCount; // 0x1A
|
||||||
@@ -142,7 +142,7 @@ struct TMCCJPEGDecWork_t {
|
|||||||
u8 mcuYRem; // 0x17FF
|
u8 mcuYRem; // 0x17FF
|
||||||
u16 mcuYCount; // 0x1800
|
u16 mcuYCount; // 0x1800
|
||||||
u16 mcuXCount2; // 0x1802
|
u16 mcuXCount2; // 0x1802
|
||||||
u32 unk_0x1804;
|
u32 mcuTotal; // 0x1804
|
||||||
u8 remX; // 0x1808
|
u8 remX; // 0x1808
|
||||||
u8 remY; // 0x1809
|
u8 remY; // 0x1809
|
||||||
u8 compCount; // 0x180A
|
u8 compCount; // 0x180A
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ s32 TMCJPEGDEC_Setsize(TMCCJPEGDecWork* work) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
state->componentCount = work->componentCount;
|
state->componentCount = work->componentCount;
|
||||||
state->result = work->unk_0x1804;
|
state->result = work->mcuTotal;
|
||||||
state->maxX = work->mcuYCount;
|
state->maxX = work->mcuYCount;
|
||||||
state->maxY = work->mcuXCount2;
|
state->maxY = work->mcuXCount2;
|
||||||
|
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ s32 TMCJPEGDEC_scan_varinit(TMCCJPEGDecWork* work) {
|
|||||||
|
|
||||||
p->mcuYCount = p->mcuYCount + ((u8)remX != 0 ? 1 : 0);
|
p->mcuYCount = p->mcuYCount + ((u8)remX != 0 ? 1 : 0);
|
||||||
p->mcuXCount2 = p->mcuXCount2 + ((u8)remY != 0 ? 1 : 0);
|
p->mcuXCount2 = p->mcuXCount2 + ((u8)remY != 0 ? 1 : 0);
|
||||||
p->unk_0x14 = (u32)p->mcuYCount * (u32)p->mcuXCount2;
|
p->mcuTotal = (u32)p->mcuYCount * (u32)p->mcuXCount2;
|
||||||
|
|
||||||
for (idx = 0; idx < (s32)p->scanCompCount; idx++) {
|
for (idx = 0; idx < (s32)p->scanCompCount; idx++) {
|
||||||
u8 compId;
|
u8 compId;
|
||||||
@@ -1929,7 +1929,7 @@ static s32 TMCJPEGDEC_parse_sof(TMCCJPEGDecWork* work) {
|
|||||||
mcuCountY += yr;
|
mcuCountY += yr;
|
||||||
frameInfo->mcuYCount = mcuCountX;
|
frameInfo->mcuYCount = mcuCountX;
|
||||||
frameInfo->mcuXCount2 = mcuCountY;
|
frameInfo->mcuXCount2 = mcuCountY;
|
||||||
work->unk_0x1804 = (u32)mcuCountX * (u32)mcuCountY;
|
work->mcuTotal = (u32)mcuCountX * (u32)mcuCountY;
|
||||||
}
|
}
|
||||||
|
|
||||||
compCount2 = frameInfo->compCount;
|
compCount2 = frameInfo->compCount;
|
||||||
|
|||||||
@@ -265,15 +265,15 @@ struct __zi8_work_data_s {
|
|||||||
ziPtr unk_0x11FC;
|
ziPtr unk_0x11FC;
|
||||||
ziPtr userKeys[0x83]; // 0x1200
|
ziPtr userKeys[0x83]; // 0x1200
|
||||||
ziU8 unk_0x140C[4];
|
ziU8 unk_0x140C[4];
|
||||||
ziU32 unk_0x1410;
|
ziU32 formats; // 0x1410
|
||||||
ziU8 unk_0x1414[4];
|
ziU8 unk_0x1414[4];
|
||||||
ziU8 unk_0x1418;
|
ziU8 unk_0x1418;
|
||||||
ziU8 unk_0x1419;
|
ziU8 unk_0x1419;
|
||||||
ziU16 unk_0x141A;
|
ziU16 unk_0x141A;
|
||||||
ziU8 unk_0x141C;
|
ziU8 unk_0x141C;
|
||||||
ziU8 unk_0x141D;
|
ziU8 unk_0x141D;
|
||||||
ziU8 unk_0x141E;
|
ziU8 graphTableId; // 0x141E
|
||||||
ziU8 unk_0x141F;
|
ziU8 maxCnt; // 0x141F
|
||||||
ziU8 unk_0x1420[4];
|
ziU8 unk_0x1420[4];
|
||||||
zi8DawgCtx dawgCtx; // 0x1424
|
zi8DawgCtx dawgCtx; // 0x1424
|
||||||
ziU8 unk_0x1760[4]; // 0x1760
|
ziU8 unk_0x1760[4]; // 0x1760
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ ziU32 Zi8MatchROMdata0(ziWChar* elements, ziU8 count, ziU8 language,
|
|||||||
}
|
}
|
||||||
if (mode == 1) acceptPrefix = 0;
|
if (mode == 1) acceptPrefix = 0;
|
||||||
} else {
|
} else {
|
||||||
if (ZI_WORK->unk_0x141E != 0 && graphTable == 0xc &&
|
if (ZI_WORK->graphTableId != 0 && graphTable == 0xc &&
|
||||||
Zi8GetTableSize(language, ZI_WORK->unk_0x141E, ZI_WORK) != 0) {
|
Zi8GetTableSize(language, ZI_WORK->graphTableId, ZI_WORK) != 0) {
|
||||||
graphData = (ziU8*)Zi8GetTableAddress(language, ZI_WORK->unk_0x141E, ZI_WORK);
|
graphData = (ziU8*)Zi8GetTableAddress(language, ZI_WORK->graphTableId, ZI_WORK);
|
||||||
keyTable = ZI_WORK->unk_0x141E + 1;
|
keyTable = ZI_WORK->graphTableId + 1;
|
||||||
} else {
|
} else {
|
||||||
if (Zi8GetTableSize(language, graphTable, ZI_WORK) == 0) {
|
if (Zi8GetTableSize(language, graphTable, ZI_WORK) == 0) {
|
||||||
Zi8LogError(0x961, ZI_WORK);
|
Zi8LogError(0x961, ZI_WORK);
|
||||||
@@ -136,7 +136,7 @@ descend:
|
|||||||
records[context->cnt].node = ZiDAWGGetChild(records[context->cnt - 1].node);
|
records[context->cnt].node = ZiDAWGGetChild(records[context->cnt - 1].node);
|
||||||
if (records[context->cnt].node == (ziU8*)0) goto next_sibling;
|
if (records[context->cnt].node == (ziU8*)0) goto next_sibling;
|
||||||
context->cnt++;
|
context->cnt++;
|
||||||
if (ZI_WORK->unk_0x141F < context->cnt) ZI_WORK->unk_0x141F = context->cnt;
|
if (ZI_WORK->maxCnt < context->cnt) ZI_WORK->maxCnt = context->cnt;
|
||||||
goto update_current;
|
goto update_current;
|
||||||
next_sibling:
|
next_sibling:
|
||||||
while (context->cnt != 0) {
|
while (context->cnt != 0) {
|
||||||
@@ -232,13 +232,13 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language,
|
|||||||
ZI_WORK->unk_0x1768 = 0;
|
ZI_WORK->unk_0x1768 = 0;
|
||||||
ZI_WORK->unk_0x17EA = 0;
|
ZI_WORK->unk_0x17EA = 0;
|
||||||
if (group != 0 && *group == 0xc && language == 10 && ZI_WORK->unk_0x141C != 0) {
|
if (group != 0 && *group == 0xc && language == 10 && ZI_WORK->unk_0x141C != 0) {
|
||||||
ZI_WORK->unk_0x141E = 0x10;
|
ZI_WORK->graphTableId = 0x10;
|
||||||
} else {
|
} else {
|
||||||
ZI_WORK->unk_0x141E = 0;
|
ZI_WORK->graphTableId = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
search_segment:
|
search_segment:
|
||||||
ZI_WORK->unk_0x141F = 1;
|
ZI_WORK->maxCnt = 1;
|
||||||
result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA,
|
result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA,
|
||||||
count - ZI_WORK->unk_0x17EA, language,
|
count - ZI_WORK->unk_0x17EA, language,
|
||||||
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
|
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
|
||||||
@@ -262,8 +262,8 @@ search_segment:
|
|||||||
if (elements[index] == 0xeff1) goto finish_segments;
|
if (elements[index] == 0xeff1) goto finish_segments;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ZI_WORK->unk_0x141F > capacity) goto finish_segments;
|
if (ZI_WORK->maxCnt > capacity) goto finish_segments;
|
||||||
for (index = ZI_WORK->unk_0x141F; index != 0; index--) {
|
for (index = ZI_WORK->maxCnt; index != 0; index--) {
|
||||||
result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA, index, language,
|
result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA, index, language,
|
||||||
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
|
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
|
||||||
1, 0, ZI_WORK->unk_0x1768, (char*)group,
|
1, 0, ZI_WORK->unk_0x1768, (char*)group,
|
||||||
@@ -273,14 +273,14 @@ search_segment:
|
|||||||
if (ZI_WORK->unk_0x17EA == count) return 0;
|
if (ZI_WORK->unk_0x17EA == count) return 0;
|
||||||
ZI_WORK->unk_0x1768++;
|
ZI_WORK->unk_0x1768++;
|
||||||
status = 0;
|
status = 0;
|
||||||
ZI_WORK->unk_0x141E = 0;
|
ZI_WORK->graphTableId = 0;
|
||||||
if (ZI_WORK->dawgCtx.key == 0 && language == 10) {
|
if (ZI_WORK->dawgCtx.key == 0 && language == 10) {
|
||||||
for (index = 0; index < ZI_WORK->unk_0x17EA; index++) {
|
for (index = 0; index < ZI_WORK->unk_0x17EA; index++) {
|
||||||
switch (ZI_WORK->unk_0x17F4[index]) {
|
switch (ZI_WORK->unk_0x17F4[index]) {
|
||||||
case 0x61:
|
case 0x61:
|
||||||
case 0x6f:
|
case 0x6f:
|
||||||
case 0x75:
|
case 0x75:
|
||||||
ZI_WORK->unk_0x141E = 0x10;
|
ZI_WORK->graphTableId = 0x10;
|
||||||
goto search_segment;
|
goto search_segment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ ziBool Zi8ZHsetZYfuzzyPairs(ziFuzzyZYPairs pairs ZI_NEED_WORK) {
|
|||||||
|
|
||||||
ziBool Zi8SetLatinSearchOrder(ziU8* searchArray, ziU8 searchSize ZI_NEED_WORK) {
|
ziBool Zi8SetLatinSearchOrder(ziU8* searchArray, ziU8 searchSize ZI_NEED_WORK) {
|
||||||
if (searchArray == 0 || *searchArray == 0) {
|
if (searchArray == 0 || *searchArray == 0) {
|
||||||
ZI_WORK->unk_0x1410 = (ziU32)Zi8SOdefaultArray;
|
ZI_WORK->formats = (ziU32)Zi8SOdefaultArray;
|
||||||
ZI_WORK->unk_0x1418 = 9;
|
ZI_WORK->unk_0x1418 = 9;
|
||||||
} else {
|
} else {
|
||||||
ZI_WORK->unk_0x1410 = (ziU32)searchArray;
|
ZI_WORK->formats = (ziU32)searchArray;
|
||||||
ZI_WORK->unk_0x1418 = searchSize;
|
ZI_WORK->unk_0x1418 = searchSize;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
|
|||||||
ziWChar* cursor;
|
ziWChar* cursor;
|
||||||
ziU8* data;
|
ziU8* data;
|
||||||
ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0};
|
ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0};
|
||||||
ziU32 savedFormats = ZI_WORK->unk_0x1410;
|
ziU32 savedFormats = ZI_WORK->formats;
|
||||||
ziU8 savedCount = ZI_WORK->unk_0x1418;
|
ziU8 savedCount = ZI_WORK->unk_0x1418;
|
||||||
ziSearchState search = {0};
|
ziSearchState search = {0};
|
||||||
Zi8LogError(100, __zi8_work_data);
|
Zi8LogError(100, __zi8_work_data);
|
||||||
@@ -73,7 +73,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
|
|||||||
request.candidates = ordinals;
|
request.candidates = ordinals;
|
||||||
request.maxCandidates = 1;
|
request.maxCandidates = 1;
|
||||||
request.firstCandidate = 0;
|
request.firstCandidate = 0;
|
||||||
ZI_WORK->unk_0x1410 = (ziU32)formats;
|
ZI_WORK->formats = (ziU32)formats;
|
||||||
if (ZI_WORK->unk_0x1C[0] == 2) {
|
if (ZI_WORK->unk_0x1C[0] == 2) {
|
||||||
ZI_WORK->unk_0x1418 = 0;
|
ZI_WORK->unk_0x1418 = 0;
|
||||||
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 1;
|
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 1;
|
||||||
@@ -87,7 +87,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
|
|||||||
} else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->unk_0x1418 = 2;
|
} else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->unk_0x1418 = 2;
|
||||||
else ZI_WORK->unk_0x1418 = 1;
|
else ZI_WORK->unk_0x1418 = 1;
|
||||||
count = Zi8GetCandidatesOrCount(&request, &search, __zi8_work_data);
|
count = Zi8GetCandidatesOrCount(&request, &search, __zi8_work_data);
|
||||||
ZI_WORK->unk_0x1410 = savedFormats;
|
ZI_WORK->formats = savedFormats;
|
||||||
ZI_WORK->unk_0x1418 = savedCount;
|
ZI_WORK->unk_0x1418 = savedCount;
|
||||||
if (count != 0) return 1;
|
if (count != 0) return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,8 +242,8 @@ typedef struct WPADCB {
|
|||||||
WPADCallback getInfoCB; // 0x988
|
WPADCallback getInfoCB; // 0x988
|
||||||
u8 getInfoBusy; // 0x98C
|
u8 getInfoBusy; // 0x98C
|
||||||
|
|
||||||
u8 unk_0x98D; // 0x98D
|
u8 encStatus; // 0x98D
|
||||||
u8 unk_0x98E; // 0x98E
|
u8 continuous; // 0x98E
|
||||||
u8 unk_0x98F[0x9A0 - 0x990];
|
u8 unk_0x98F[0x9A0 - 0x990];
|
||||||
} WPADCB;
|
} WPADCB;
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@ void WPADiExcludeButton(s32 chan);
|
|||||||
void WPADiCopyOut(s32 chan);
|
void WPADiCopyOut(s32 chan);
|
||||||
|
|
||||||
BOOL WPADiSendSetPort(WPADCommandQueue* pQueue, u8 port, WPADCallback pCallback);
|
BOOL WPADiSendSetPort(WPADCommandQueue* pQueue, u8 port, WPADCallback pCallback);
|
||||||
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL unk, WPADCallback pCallback);
|
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL continuous, WPADCallback pCallback);
|
||||||
BOOL WPADiSendEnableDPD(WPADCommandQueue* pQueue, BOOL enable, WPADCallback pCallback);
|
BOOL WPADiSendEnableDPD(WPADCommandQueue* pQueue, BOOL enable, WPADCallback pCallback);
|
||||||
BOOL WPADiSendEnableSpeaker(WPADCommandQueue* pQueue, BOOL enable, WPADCallback pCallback);
|
BOOL WPADiSendEnableSpeaker(WPADCommandQueue* pQueue, BOOL enable, WPADCallback pCallback);
|
||||||
BOOL WPADiSendGetContStat(WPADCommandQueue* pQueue, WPADInfo* pInfo, WPADCallback pCallback);
|
BOOL WPADiSendGetContStat(WPADCommandQueue* pQueue, WPADInfo* pInfo, WPADCallback pCallback);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ typedef struct WPADMemBlock {
|
|||||||
int unk_0x04; // 0x04
|
int unk_0x04; // 0x04
|
||||||
s16 unk_0x08; // 0x08
|
s16 unk_0x08; // 0x08
|
||||||
int unk_0x0C; // 0x0C
|
int unk_0x0C; // 0x0C
|
||||||
WPADCallback unk_0x10; // 0x10
|
WPADCallback callback; // 0x10
|
||||||
} WPADMemBlock;
|
} WPADMemBlock;
|
||||||
|
|
||||||
typedef struct WPADGameInfo {
|
typedef struct WPADGameInfo {
|
||||||
|
|||||||
@@ -1283,7 +1283,7 @@ static void __ClearControlBlock(s32 chan) {
|
|||||||
p->sleeping = TRUE;
|
p->sleeping = TRUE;
|
||||||
p->getInfoBusy = FALSE;
|
p->getInfoBusy = FALSE;
|
||||||
p->getInfoCB = NULL;
|
p->getInfoCB = NULL;
|
||||||
p->unk_0x98E = 0;
|
p->continuous = 0;
|
||||||
|
|
||||||
memset(&p->wpInfo, 0, sizeof(p->wpInfo));
|
memset(&p->wpInfo, 0, sizeof(p->wpInfo));
|
||||||
memset(&p->wmReadDataBuf, 0, sizeof(p->wmReadDataBuf));
|
memset(&p->wmReadDataBuf, 0, sizeof(p->wmReadDataBuf));
|
||||||
@@ -1315,7 +1315,7 @@ static void __ClearControlBlock(s32 chan) {
|
|||||||
_wmb[chan].unk_0x04 = 0;
|
_wmb[chan].unk_0x04 = 0;
|
||||||
_wmb[chan].unk_0x08 = 0;
|
_wmb[chan].unk_0x08 = 0;
|
||||||
_wmb[chan].unk_0x0C = 0;
|
_wmb[chan].unk_0x0C = 0;
|
||||||
_wmb[chan].unk_0x10 = NULL;
|
_wmb[chan].callback = NULL;
|
||||||
|
|
||||||
_rumbleCnt[chan] = 0;
|
_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");
|
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->unk_0x98E, &abortConnCallback);
|
WPADiSendSetReportType(&p->stdCmdQueue, WPAD_FMT_CORE_BTN, p->continuous, &abortConnCallback);
|
||||||
|
|
||||||
WPADiSendDPDCSB(&p->stdCmdQueue, FALSE, &abortConnCallback);
|
WPADiSendDPDCSB(&p->stdCmdQueue, FALSE, &abortConnCallback);
|
||||||
WPADiSendSetPort(&p->stdCmdQueue, port, &abortConnCallback);
|
WPADiSendSetPort(&p->stdCmdQueue, port, &abortConnCallback);
|
||||||
@@ -1626,7 +1626,7 @@ static void WPADiConnCallback(WUDDevInfo* devInfo, u8 open) {
|
|||||||
p->status = WPAD_ERR_OK;
|
p->status = WPAD_ERR_OK;
|
||||||
p->radioSensitivity = 100;
|
p->radioSensitivity = 100;
|
||||||
p->sleeping = FALSE;
|
p->sleeping = FALSE;
|
||||||
p->unk_0x98D = FALSE;
|
p->encStatus = FALSE;
|
||||||
|
|
||||||
WPADiSendReadData(&p->stdCmdQueue, p->wmReadDataBuf, 1, WM_ADDR_MEM_1770, firmwareCheckCallback);
|
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) {
|
if (p->cmdBlkCB != NULL) {
|
||||||
p->cmdBlkCB(chan, WPAD_ERR_NO_CONTROLLER);
|
p->cmdBlkCB(chan, WPAD_ERR_NO_CONTROLLER);
|
||||||
} else if (_wmb[chan].unk_0x10 != NULL) {
|
} else if (_wmb[chan].callback != NULL) {
|
||||||
_wmb[chan].unk_0x10(chan, WPAD_ERR_NO_CONTROLLER);
|
_wmb[chan].callback(chan, WPAD_ERR_NO_CONTROLLER);
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -1886,7 +1886,7 @@ s32 WPADSetDataFormat(s32 chan, u32 format) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (currFormat != format) {
|
if (currFormat != format) {
|
||||||
if (!WPADiSendSetReportType(&p->stdCmdQueue, format, p->unk_0x98E, NULL)) {
|
if (!WPADiSendSetReportType(&p->stdCmdQueue, format, p->continuous, NULL)) {
|
||||||
status = WPAD_ERR_COMMUNICATION_ERROR;
|
status = WPAD_ERR_COMMUNICATION_ERROR;
|
||||||
} else {
|
} else {
|
||||||
enabled = OSDisableInterrupts();
|
enabled = OSDisableInterrupts();
|
||||||
@@ -2741,13 +2741,13 @@ BOOL WPADiSendSetPort(WPADCommandQueue* pQueue, u8 port, WPADCallback pCallback)
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL unk, WPADCallback pCallback) {
|
BOOL WPADiSendSetReportType(WPADCommandQueue* pQueue, s32 format, BOOL continuous, WPADCallback pCallback) {
|
||||||
BOOL success;
|
BOOL success;
|
||||||
WPADCommand command;
|
WPADCommand command;
|
||||||
|
|
||||||
command.reportID = RPTID_SET_DATA_REPORT_MODE;
|
command.reportID = RPTID_SET_DATA_REPORT_MODE;
|
||||||
command.dataLength = RPT12_SIZE;
|
command.dataLength = RPT12_SIZE;
|
||||||
command.dataBuf[RPT12_CONT_REPORT] = unk ? 0 : 4; // Always continuous reporting
|
command.dataBuf[RPT12_CONT_REPORT] = continuous ? 0 : 4; // Always continuous reporting
|
||||||
command.cmdCB = pCallback;
|
command.cmdCB = pCallback;
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ static void initExtension(s32 chan) {
|
|||||||
|
|
||||||
WPADiClearQueue(&p_wpd->extCmdQueue);
|
WPADiClearQueue(&p_wpd->extCmdQueue);
|
||||||
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat,
|
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat,
|
||||||
p_wpd->unk_0x98E, abortInitExtension);
|
p_wpd->continuous, abortInitExtension);
|
||||||
p_wpd->unk_0x98D = 1;
|
p_wpd->encStatus = 1;
|
||||||
WPADiSendWriteDataCmd(&p_wpd->extCmdQueue, 0x55, 0x04a400f0,
|
WPADiSendWriteDataCmd(&p_wpd->extCmdQueue, 0x55, 0x04a400f0,
|
||||||
abortInitExtension);
|
abortInitExtension);
|
||||||
WPADiSendWriteDataCmd(&p_wpd->extCmdQueue, 0, 0x04a400fb,
|
WPADiSendWriteDataCmd(&p_wpd->extCmdQueue, 0, 0x04a400fb,
|
||||||
@@ -127,7 +127,7 @@ static void abortInitExtension(s32 chan, s32 result) {
|
|||||||
|
|
||||||
if (result != WPAD_ERR_NONE) {
|
if (result != WPAD_ERR_NONE) {
|
||||||
WPADiClearQueue(&p_wpd->extCmdQueue);
|
WPADiClearQueue(&p_wpd->extCmdQueue);
|
||||||
p_wpd->unk_0x98D = 0;
|
p_wpd->encStatus = 0;
|
||||||
if (result == WPAD_ERR_NO_CONTROLLER) {
|
if (result == WPAD_ERR_NO_CONTROLLER) {
|
||||||
type = WPAD_DEV_NOT_FOUND;
|
type = WPAD_DEV_NOT_FOUND;
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ static void abortInitExtension(s32 chan, s32 result) {
|
|||||||
|
|
||||||
else {
|
else {
|
||||||
DEBUGPrint("detaching extension during initialization.\n");
|
DEBUGPrint("detaching extension during initialization.\n");
|
||||||
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->unk_0x98E, NULL);
|
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->continuous, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p_wpd->devType = (u8)type;
|
p_wpd->devType = (u8)type;
|
||||||
@@ -509,7 +509,7 @@ static void getExtType(s32 chan, s32 result) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isExtEncMain(_devType[chan])) {
|
if (isExtEncMain(_devType[chan])) {
|
||||||
p_wpd->unk_0x98D = 2;
|
p_wpd->encStatus = 2;
|
||||||
WPADiSendWriteDataCmd(cmdq, 0xAA, 0x4A400F0, abortInitExtension);
|
WPADiSendWriteDataCmd(cmdq, 0xAA, 0x4A400F0, abortInitExtension);
|
||||||
WPADiCreateKey(chan);
|
WPADiCreateKey(chan);
|
||||||
WPADiSendWriteData(cmdq, p_wpd->encryptionKey, 6, 0x4A40040, abortInitExtension);
|
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);
|
WPADiSendWriteData(cmdq, p_wpd->encryptionKey + 12, 4, 0x4A4004C, abortInitExtension);
|
||||||
WPADiSendReadData(cmdq, p_wpd->wmReadDataBuf, 32, 0x4A40020, p_wpd->extensionCB);
|
WPADiSendReadData(cmdq, p_wpd->wmReadDataBuf, 32, 0x4A40020, p_wpd->extensionCB);
|
||||||
} else {
|
} else {
|
||||||
p_wpd->unk_0x98D = 3;
|
p_wpd->encStatus = 3;
|
||||||
WPADiSendWriteDataCmd(cmdq, 0xAA, 0x4A400F0, abortInitExtension);
|
WPADiSendWriteDataCmd(cmdq, 0xAA, 0x4A400F0, abortInitExtension);
|
||||||
WPADiCreateKeyFor3rd(chan);
|
WPADiCreateKeyFor3rd(chan);
|
||||||
WPADiSendWriteData(cmdq, p_wpd->encryptionKey, 6, 0x4A40040, abortInitExtension);
|
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;
|
p_wpd->devMode = 0;
|
||||||
|
|
||||||
WPADiClearQueue(&p_wpd->extCmdQueue);
|
WPADiClearQueue(&p_wpd->extCmdQueue);
|
||||||
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->unk_0x98E, NULL);
|
WPADiSendSetReportType(&p_wpd->extCmdQueue, p_wpd->dataFormat, p_wpd->continuous, NULL);
|
||||||
|
|
||||||
if (attach) {
|
if (attach) {
|
||||||
if (p_wpd->extensionCB) {
|
if (p_wpd->extensionCB) {
|
||||||
@@ -741,11 +741,11 @@ void __a1_21_user_data(u8 chan, u8* data) {
|
|||||||
DEBUGPrint("length : %d\n", p_wpd->wmReadLength);
|
DEBUGPrint("length : %d\n", p_wpd->wmReadLength);
|
||||||
status = (p_wpd->wmReadHadError < 0) ? WPAD_ERR_TRANSFER : 0;
|
status = (p_wpd->wmReadHadError < 0) ? WPAD_ERR_TRANSFER : 0;
|
||||||
DEBUGPrint("i2c = %04x\n", i2c);
|
DEBUGPrint("i2c = %04x\n", i2c);
|
||||||
DEBUGPrint("enc = %d\n", p_wpd->unk_0x98D);
|
DEBUGPrint("enc = %d\n", p_wpd->encStatus);
|
||||||
|
|
||||||
if (i2c == 0x04a4) {
|
if (i2c == 0x04a4) {
|
||||||
DEBUGPrint("Access to extension register.\n");
|
DEBUGPrint("Access to extension register.\n");
|
||||||
if (p_wpd->unk_0x98D == 2 || p_wpd->unk_0x98D == 3) {
|
if (p_wpd->encStatus == 2 || p_wpd->encStatus == 3) {
|
||||||
DEBUGPrint("Decode!!!!\n");
|
DEBUGPrint("Decode!!!!\n");
|
||||||
DEBUGPrint(" len = %d, addr = %04x\n", len, base);
|
DEBUGPrint(" len = %d, addr = %04x\n", len, base);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ typedef struct NWC24MsgObjPrivate {
|
|||||||
#ifdef NWC24_MSG_READ
|
#ifdef NWC24_MSG_READ
|
||||||
u32 headerSize;
|
u32 headerSize;
|
||||||
#elif defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT)
|
#elif defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT)
|
||||||
u32 unk_0x10;
|
u32 flags; // 0x10
|
||||||
#else
|
#else
|
||||||
u8 unk_0x10[0x4];
|
u8 unk_0x10[0x4];
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -783,7 +783,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
|
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
|
||||||
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->date) {
|
entry->flags == msg->flags && (s32)entry->date == (s32)msg->date) {
|
||||||
duplicateId = entry->msgId;
|
duplicateId = entry->msgId;
|
||||||
duplicateOffset = offset;
|
duplicateOffset = offset;
|
||||||
continue;
|
continue;
|
||||||
@@ -956,7 +956,7 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
|
|||||||
entry->type = msg->type;
|
entry->type = msg->type;
|
||||||
entry->length = msg->length;
|
entry->length = msg->length;
|
||||||
entry->appId = msg->appId;
|
entry->appId = msg->appId;
|
||||||
entry->flags = msg->unk_0x10;
|
entry->flags = msg->flags;
|
||||||
entry->tag = msg->tag;
|
entry->tag = msg->tag;
|
||||||
entry->ledPattern = msg->ledPattern;
|
entry->ledPattern = msg->ledPattern;
|
||||||
entry->crc = msg->unk_0x1C;
|
entry->crc = msg->unk_0x1C;
|
||||||
@@ -1003,7 +1003,7 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
|
|||||||
msg->type = entry->type;
|
msg->type = entry->type;
|
||||||
msg->length = entry->length;
|
msg->length = entry->length;
|
||||||
msg->appId = entry->appId;
|
msg->appId = entry->appId;
|
||||||
msg->unk_0x10 = entry->flags;
|
msg->flags = entry->flags;
|
||||||
msg->tag = entry->tag;
|
msg->tag = entry->tag;
|
||||||
msg->ledPattern = entry->ledPattern;
|
msg->ledPattern = entry->ledPattern;
|
||||||
msg->unk_0x1C = entry->crc;
|
msg->unk_0x1C = entry->crc;
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
|
|||||||
}
|
}
|
||||||
CHECK_WRITE(WriteString(msg, buffer));
|
CHECK_WRITE(WriteString(msg, buffer));
|
||||||
if (msg->type & 0x10000) {
|
if (msg->type & 0x10000) {
|
||||||
msg->unk_0x10 = msg->length;
|
msg->flags = msg->length;
|
||||||
buffer = NWC24WorkP->stringWork;
|
buffer = NWC24WorkP->stringWork;
|
||||||
Mail_memset(buffer, 0, 1024);
|
Mail_memset(buffer, 0, 1024);
|
||||||
Mail_sprintf(buffer, "\r\n--%s", MultiPartDivider);
|
Mail_sprintf(buffer, "\r\n--%s", MultiPartDivider);
|
||||||
@@ -339,7 +339,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
|
|||||||
}
|
}
|
||||||
CHECK_WRITE(WriteContentTypeField(msg));
|
CHECK_WRITE(WriteContentTypeField(msg));
|
||||||
if (!(msg->type & 0x10000))
|
if (!(msg->type & 0x10000))
|
||||||
msg->unk_0x10 = msg->length;
|
msg->flags = msg->length;
|
||||||
text.ptr = (const void*)msg->length;
|
text.ptr = (const void*)msg->length;
|
||||||
{ NWC24Err textResult = WritePlainText(msg);
|
{ NWC24Err textResult = WritePlainText(msg);
|
||||||
err = textResult == NWC24_ERR_NULL ? NWC24_OK : textResult; }
|
err = textResult == NWC24_ERR_NULL ? NWC24_OK : textResult; }
|
||||||
|
|||||||
@@ -930,13 +930,13 @@ namespace ipl {
|
|||||||
math::VEC3 translate(mpLayout->FindPaneByName("N_Memo")->GetTranslate());
|
math::VEC3 translate(mpLayout->FindPaneByName("N_Memo")->GetTranslate());
|
||||||
|
|
||||||
mURLProc.clear_prev_drawing();
|
mURLProc.clear_prev_drawing();
|
||||||
mURLProc.setUnk_0x44(translate.y);
|
mURLProc.setMemoTranslateY(translate.y);
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (mState == STATE_NORMAL && mScroller.is_busy() == FALSE) {
|
if (mState == STATE_NORMAL && mScroller.is_busy() == FALSE) {
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
mURLProc.setUnk_0x53(result);
|
mURLProc.setFocusEnabled(result);
|
||||||
|
|
||||||
if (translate.y < 500.0f) {
|
if (translate.y < 500.0f) {
|
||||||
mpLayout->draw("N_Header");
|
mpLayout->draw("N_Header");
|
||||||
@@ -983,8 +983,8 @@ namespace ipl {
|
|||||||
mpLayout->draw("ReplyMask");
|
mpLayout->draw("ReplyMask");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mURLProc.getUnk_0x50()) {
|
if (!mURLProc.getColorPass()) {
|
||||||
mURLProc.setUnk_0x50(1);
|
mURLProc.setColorPass(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1512,7 +1512,7 @@ namespace ipl {
|
|||||||
mURLProc.init();
|
mURLProc.init();
|
||||||
|
|
||||||
if (mpBoardObj->mLetterType == BoardObject::TYPE_MEMO) {
|
if (mpBoardObj->mLetterType == BoardObject::TYPE_MEMO) {
|
||||||
mURLProc.setUnk_0x40(8.0f);
|
mURLProc.setHitYOffset(8.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
nw4r::lyt::Pane* pane = mpLayout->FindPaneByName("T_Letter");
|
nw4r::lyt::Pane* pane = mpLayout->FindPaneByName("T_Letter");
|
||||||
|
|||||||
@@ -15,16 +15,16 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UrlProcessor::init() {
|
void UrlProcessor::init() {
|
||||||
unk_0x52 = 0;
|
mbHoverOffset = 0;
|
||||||
unk_0x51 = 0;
|
mbInTag = 0;
|
||||||
unk_0x50 = 0;
|
mbColorPass = 0;
|
||||||
unk_0x53 = 1;
|
mbFocusEnabled = 1;
|
||||||
|
|
||||||
unk_0x40 = 0.0f;
|
mHitYOffset = 0.0f;
|
||||||
unk_0x44 = 0.0f;
|
mMemoTranslateY = 0.0f;
|
||||||
|
|
||||||
unk_0x48 = 0;
|
mCurTagNo = 0;
|
||||||
unk_0x4C = -1;
|
mSelectedTagNo = -1;
|
||||||
|
|
||||||
for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) {
|
for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) {
|
||||||
mConData[i].valid = false;
|
mConData[i].valid = false;
|
||||||
@@ -60,14 +60,14 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UrlProcessor::clear_prev_drawing() {
|
void UrlProcessor::clear_prev_drawing() {
|
||||||
unk_0x48 = 0;
|
mCurTagNo = 0;
|
||||||
unk_0x52 = 0;
|
mbHoverOffset = 0;
|
||||||
unk_0x51 = 0;
|
mbInTag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nw4r::ut::Operation UrlProcessor::Process(u16 code, nw4r::ut::PrintContext<wchar_t>* context) {
|
nw4r::ut::Operation UrlProcessor::Process(u16 code, nw4r::ut::PrintContext<wchar_t>* context) {
|
||||||
if (code == SEPERATOR || code == (u16)'\n') {
|
if (code == SEPERATOR || code == (u16)'\n') {
|
||||||
if (unk_0x50 == 0) {
|
if (mbColorPass == 0) {
|
||||||
make_collision(context, code);
|
make_collision(context, code);
|
||||||
} else if (code == SEPERATOR) {
|
} else if (code == SEPERATOR) {
|
||||||
parse(context);
|
parse(context);
|
||||||
@@ -78,42 +78,42 @@ namespace ipl {
|
|||||||
|
|
||||||
void UrlProcessor::make_collision(nw4r::ut::PrintContext<wchar_t>* context, u16 code) {
|
void UrlProcessor::make_collision(nw4r::ut::PrintContext<wchar_t>* context, u16 code) {
|
||||||
if (code == SEPERATOR) {
|
if (code == SEPERATOR) {
|
||||||
if (unk_0x51 == 0) {
|
if (mbInTag == 0) {
|
||||||
url_collision* const url_col = new (System::getMem2App(), 4) url_collision();
|
url_collision* const url_col = new (System::getMem2App(), 4) url_collision();
|
||||||
line_collision* const line_col = new (System::getMem2App(), 4) line_collision();
|
line_collision* const line_col = new (System::getMem2App(), 4) line_collision();
|
||||||
|
|
||||||
url_col->unk_0x00 = unk_0x48;
|
url_col->mTagNo = mCurTagNo;
|
||||||
url_col->unk_0x04 = (wchar_t*)context->str;
|
url_col->mpStart = (wchar_t*)context->str;
|
||||||
|
|
||||||
line_col->unk_0x00 = context->writer->GetCursorX();
|
line_col->mLeft = context->writer->GetCursorX();
|
||||||
nw4r::ut::List_Append(&url_col->mLineCollisions, line_col);
|
nw4r::ut::List_Append(&url_col->mLineCollisions, line_col);
|
||||||
nw4r::ut::List_Append(&mUrlCollisions, url_col);
|
nw4r::ut::List_Append(&mUrlCollisions, url_col);
|
||||||
|
|
||||||
unk_0x51 = 1;
|
mbInTag = 1;
|
||||||
} else {
|
} else {
|
||||||
void* url_col_raw = nw4r::ut::List_GetPrev(&mUrlCollisions, NULL);
|
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);
|
void* line_col_raw = nw4r::ut::List_GetPrev(&((url_collision*)url_col_raw)->mLineCollisions, NULL);
|
||||||
url_collision* url_col = (url_collision*)url_col_raw;
|
url_collision* url_col = (url_collision*)url_col_raw;
|
||||||
line_collision* line_col = (line_collision*)line_col_raw;
|
line_collision* line_col = (line_collision*)line_col_raw;
|
||||||
|
|
||||||
line_col->unk_0x04 = context->writer->GetCursorX();
|
line_col->mRight = context->writer->GetCursorX();
|
||||||
line_col->unk_0x08 = context->writer->GetCursorY();
|
line_col->mY = context->writer->GetCursorY();
|
||||||
|
|
||||||
url_col->unk_0x08 = (wchar_t*)context->str;
|
url_col->mpEnd = (wchar_t*)context->str;
|
||||||
|
|
||||||
unk_0x51 = 0;
|
mbInTag = 0;
|
||||||
unk_0x48++;
|
mCurTagNo++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (unk_0x51 != 0) {
|
if (mbInTag != 0) {
|
||||||
url_collision* url_col = (url_collision*)nw4r::ut::List_GetPrev(&mUrlCollisions, NULL);
|
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_collision* line_col = (line_collision*)nw4r::ut::List_GetPrev(&url_col->mLineCollisions, NULL);
|
||||||
|
|
||||||
line_col->unk_0x04 = context->writer->GetCursorX();
|
line_col->mRight = context->writer->GetCursorX();
|
||||||
line_col->unk_0x08 = context->writer->GetCursorY();
|
line_col->mY = context->writer->GetCursorY();
|
||||||
|
|
||||||
line_col = new (System::getMem2App(), 4) line_collision();
|
line_col = new (System::getMem2App(), 4) line_collision();
|
||||||
line_col->unk_0x00 = -208.0f;
|
line_col->mLeft = -208.0f;
|
||||||
|
|
||||||
nw4r::ut::List_Append(&url_col->mLineCollisions, line_col);
|
nw4r::ut::List_Append(&url_col->mLineCollisions, line_col);
|
||||||
}
|
}
|
||||||
@@ -122,41 +122,41 @@ namespace ipl {
|
|||||||
|
|
||||||
void UrlProcessor::parse(nw4r::ut::PrintContext<wchar_t>* context) {
|
void UrlProcessor::parse(nw4r::ut::PrintContext<wchar_t>* context) {
|
||||||
f32 curY = context->writer->GetCursorY();
|
f32 curY = context->writer->GetCursorY();
|
||||||
if (unk_0x51 == 0) {
|
if (mbInTag == 0) {
|
||||||
if (unk_0x4C == unk_0x48) {
|
if (mSelectedTagNo == mCurTagNo) {
|
||||||
context->writer->SetTextColor(0xFFE664FF);
|
context->writer->SetTextColor(0xFFE664FF);
|
||||||
} else if (unk_0x53 != 0 && is_focused()) {
|
} else if (mbFocusEnabled != 0 && is_focused()) {
|
||||||
context->writer->SetCursorY(curY - 2.0f);
|
context->writer->SetCursorY(curY - 2.0f);
|
||||||
context->writer->SetTextColor(0xF06E28FF);
|
context->writer->SetTextColor(0xF06E28FF);
|
||||||
unk_0x52 = 1;
|
mbHoverOffset = 1;
|
||||||
} else {
|
} else {
|
||||||
context->writer->SetTextColor(0x34BEEDFF);
|
context->writer->SetTextColor(0x34BEEDFF);
|
||||||
}
|
}
|
||||||
unk_0x51 = 1;
|
mbInTag = 1;
|
||||||
} else {
|
} else {
|
||||||
if (unk_0x52 != 0) {
|
if (mbHoverOffset != 0) {
|
||||||
context->writer->SetCursorY(2.0f + curY);
|
context->writer->SetCursorY(2.0f + curY);
|
||||||
unk_0x52 = 0;
|
mbHoverOffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
context->writer->SetTextColor(0x646464FF);
|
context->writer->SetTextColor(0x646464FF);
|
||||||
|
|
||||||
unk_0x51 = 0;
|
mbInTag = 0;
|
||||||
unk_0x48++;
|
mCurTagNo++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL UrlProcessor::is_focused() const {
|
BOOL UrlProcessor::is_focused() const {
|
||||||
for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) {
|
for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) {
|
||||||
if (unk_0x48 == get_focused_tagno(i)) {
|
if (mCurTagNo == get_focused_tagno(i)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UrlProcessor::select(int unk) {
|
void UrlProcessor::select(int tagNo) {
|
||||||
unk_0x4C = unk;
|
mSelectedTagNo = tagNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
int UrlProcessor::get_focused_tagno(int chan) const {
|
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 (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) {
|
while (line_col = (line_collision*)nw4r::ut::List_GetNext(&url_col->mLineCollisions, line_col), line_col != NULL) {
|
||||||
f32 left = line_col->unk_0x00 - var_f28;
|
f32 left = line_col->mLeft - var_f28;
|
||||||
f32 right = var_f28 + line_col->unk_0x04;
|
f32 right = var_f28 + line_col->mRight;
|
||||||
f32 temp_f0 = ((unk_0x44 + unk_0x40) - line_col->unk_0x08);
|
f32 temp_f0 = ((mMemoTranslateY + mHitYOffset) - line_col->mY);
|
||||||
f32 top = (var_f29 + temp_f0) - var_f28;
|
f32 top = (var_f29 + temp_f0) - var_f28;
|
||||||
f32 bottom = var_f28 + (var_f30 + temp_f0);
|
f32 bottom = var_f28 + (var_f30 + temp_f0);
|
||||||
if (left <= var_f31 && var_f31 <= right && top <= -pos.y && -pos.y <= bottom) {
|
if (left <= var_f31 && var_f31 <= right && top <= -pos.y && -pos.y <= bottom) {
|
||||||
return url_col->unk_0x00;
|
return url_col->mTagNo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,7 +194,7 @@ namespace ipl {
|
|||||||
url_collision* url_col = NULL;
|
url_collision* url_col = NULL;
|
||||||
|
|
||||||
while (got = (url_collision*)nw4r::ut::List_GetNext(&mUrlCollisions, got), got != NULL) {
|
while (got = (url_collision*)nw4r::ut::List_GetNext(&mUrlCollisions, got), got != NULL) {
|
||||||
if (got->unk_0x00 == unk_0x4C) {
|
if (got->mTagNo == mSelectedTagNo) {
|
||||||
url_col = got;
|
url_col = got;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -210,10 +210,10 @@ namespace ipl {
|
|||||||
|
|
||||||
int chIdx2 = 0;
|
int chIdx2 = 0;
|
||||||
int chIdx = 0;
|
int chIdx = 0;
|
||||||
u32 count = (u32)url_col->unk_0x08 - (u32)url_col->unk_0x04;
|
u32 count = (u32)url_col->mpEnd - (u32)url_col->mpStart;
|
||||||
count >>= 1;
|
count >>= 1;
|
||||||
for (u32 i = 0; i < count; i++) {
|
for (u32 i = 0; i < count; i++) {
|
||||||
wchar_t wch = url_col->unk_0x04[i];
|
wchar_t wch = url_col->mpStart[i];
|
||||||
if (wch != SEPERATOR && chIdx2 < 0x200) {
|
if (wch != SEPERATOR && chIdx2 < 0x200) {
|
||||||
url[chIdx2++] = wch;
|
url[chIdx2++] = wch;
|
||||||
}
|
}
|
||||||
@@ -226,9 +226,9 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UrlProcessor::url_collision::url_collision() {
|
UrlProcessor::url_collision::url_collision() {
|
||||||
unk_0x00 = 0;
|
mTagNo = 0;
|
||||||
unk_0x04 = NULL;
|
mpStart = NULL;
|
||||||
unk_0x08 = NULL;
|
mpEnd = NULL;
|
||||||
nw4r::ut::List_Init(&mLineCollisions, offsetof(line_collision, mLinkList));
|
nw4r::ut::List_Init(&mLineCollisions, offsetof(line_collision, mLinkList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,16 +25,16 @@ typedef struct {
|
|||||||
undefined4 result;
|
undefined4 result;
|
||||||
undefined4 errCode;
|
undefined4 errCode;
|
||||||
HTTPTestState httpTestState;
|
HTTPTestState httpTestState;
|
||||||
undefined4 unk_0x030;
|
undefined4 natState;
|
||||||
undefined4 unk_0x034;
|
undefined4 gsAvailable;
|
||||||
undefined4 unk_0x038;
|
undefined4 natTimedOut;
|
||||||
undefined4 unk_0x03c;
|
undefined4 natFailed;
|
||||||
OSTime detectStartTime;
|
OSTime detectStartTime;
|
||||||
NHTTPConnection httpConnection;
|
NHTTPConnection httpConnection;
|
||||||
NHTTPRequest* httpRequest;
|
NHTTPRequest* httpRequest;
|
||||||
NHTTPResponse* httpResponse;
|
NHTTPResponse* httpResponse;
|
||||||
NCDProxyProfile proxy;
|
NCDProxyProfile proxy;
|
||||||
void* unk_0x7f0;
|
void* httpBuf;
|
||||||
NAT nat;
|
NAT nat;
|
||||||
} StaticSession;
|
} StaticSession;
|
||||||
|
|
||||||
@@ -64,14 +64,14 @@ void IPLContestInitialize(void* heapBuf, NCDProxyProfile* proxy) {
|
|||||||
g_session.result = 0xFF00;
|
g_session.result = 0xFF00;
|
||||||
g_session.errCode = 0;
|
g_session.errCode = 0;
|
||||||
g_session.httpTestState = HTTP_TEST_NOT_STARTED;
|
g_session.httpTestState = HTTP_TEST_NOT_STARTED;
|
||||||
g_session.unk_0x030 = 0;
|
g_session.natState = 0;
|
||||||
g_session.detectStartTime = 0;
|
g_session.detectStartTime = 0;
|
||||||
g_session.httpConnection = 0;
|
g_session.httpConnection = 0;
|
||||||
g_session.httpRequest = 0;
|
g_session.httpRequest = 0;
|
||||||
g_session.httpResponse = NULL;
|
g_session.httpResponse = NULL;
|
||||||
g_session.unk_0x034 = 0;
|
g_session.gsAvailable = 0;
|
||||||
g_session.unk_0x038 = 0;
|
g_session.natTimedOut = 0;
|
||||||
g_session.unk_0x03c = 1;
|
g_session.natFailed = 1;
|
||||||
g_session.proxy = *proxy;
|
g_session.proxy = *proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ int IPLContestProcess() {
|
|||||||
g_session.errCode = g_session.errCode != 0 ? g_session.errCode : -52200;
|
g_session.errCode = g_session.errCode != 0 ? g_session.errCode : -52200;
|
||||||
OSReport("[error] Failed to start up NHTTP.\n");
|
OSReport("[error] Failed to start up NHTTP.\n");
|
||||||
} else {
|
} else {
|
||||||
g_session.unk_0x7f0 = IPLContestAlloc(0x400);
|
g_session.httpBuf = IPLContestAlloc(0x400);
|
||||||
g_session.httpTestState = HTTP_TEST_STARTED;
|
g_session.httpTestState = HTTP_TEST_STARTED;
|
||||||
OSReport("Starting HTTP conectting test.\n");
|
OSReport("Starting HTTP conectting test.\n");
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ int IPLContestProcess() {
|
|||||||
}
|
}
|
||||||
case HTTP_TEST_STARTED: {
|
case HTTP_TEST_STARTED: {
|
||||||
g_session.httpRequest =
|
g_session.httpRequest =
|
||||||
NHTTPCreateRequest("http://conntest.nintendowifi.net/", 0, g_session.unk_0x7f0, 0x400, sNHTTPReqCallback, 0);
|
NHTTPCreateRequest("http://conntest.nintendowifi.net/", 0, g_session.httpBuf, 0x400, sNHTTPReqCallback, 0);
|
||||||
if (g_session.httpRequest == 0) {
|
if (g_session.httpRequest == 0) {
|
||||||
g_session.httpTestState = HTTP_TEST_RESPONSE_ERRORED;
|
g_session.httpTestState = HTTP_TEST_RESPONSE_ERRORED;
|
||||||
g_session.result |= 4;
|
g_session.result |= 4;
|
||||||
@@ -156,9 +156,9 @@ int IPLContestProcess() {
|
|||||||
NHTTPDestroyResponse(g_session.httpResponse);
|
NHTTPDestroyResponse(g_session.httpResponse);
|
||||||
g_session.httpResponse = NULL;
|
g_session.httpResponse = NULL;
|
||||||
}
|
}
|
||||||
if (g_session.unk_0x7f0 != NULL) {
|
if (g_session.httpBuf != NULL) {
|
||||||
IPLContestFree(g_session.unk_0x7f0, 0);
|
IPLContestFree(g_session.httpBuf, 0);
|
||||||
g_session.unk_0x7f0 = NULL;
|
g_session.httpBuf = NULL;
|
||||||
}
|
}
|
||||||
g_session.httpTestState = HTTP_TEST_DONE;
|
g_session.httpTestState = HTTP_TEST_DONE;
|
||||||
NHTTPCleanupAsync(sNHTTPCleanupCallback);
|
NHTTPCleanupAsync(sNHTTPCleanupCallback);
|
||||||
@@ -176,9 +176,9 @@ int IPLContestProcess() {
|
|||||||
NHTTPDestroyResponse(g_session.httpResponse);
|
NHTTPDestroyResponse(g_session.httpResponse);
|
||||||
g_session.httpResponse = NULL;
|
g_session.httpResponse = NULL;
|
||||||
}
|
}
|
||||||
if (g_session.unk_0x7f0 != NULL) {
|
if (g_session.httpBuf != NULL) {
|
||||||
IPLContestFree(g_session.unk_0x7f0, 0);
|
IPLContestFree(g_session.httpBuf, 0);
|
||||||
g_session.unk_0x7f0 = NULL;
|
g_session.httpBuf = NULL;
|
||||||
}
|
}
|
||||||
g_session.httpTestState = HTTP_TEST_DONE;
|
g_session.httpTestState = HTTP_TEST_DONE;
|
||||||
NHTTPCleanupAsync(sNHTTPCleanupCallback);
|
NHTTPCleanupAsync(sNHTTPCleanupCallback);
|
||||||
@@ -198,11 +198,11 @@ int IPLContestProcess() {
|
|||||||
OSReport("Port mapping detectioning test has been skipped.\n");
|
OSReport("Port mapping detectioning test has been skipped.\n");
|
||||||
|
|
||||||
} else
|
} else
|
||||||
switch (g_session.unk_0x030) {
|
switch (g_session.natState) {
|
||||||
case 0: {
|
case 0: {
|
||||||
gsiMemoryCallbacksSet(IPLContestGSMalloc, IPLContestGSFree, IPLContestGSRealloc, IPLContestGSMemalign);
|
gsiMemoryCallbacksSet(IPLContestGSMalloc, IPLContestGSFree, IPLContestGSRealloc, IPLContestGSMemalign);
|
||||||
GSIStartAvailableCheckA("wiinat");
|
GSIStartAvailableCheckA("wiinat");
|
||||||
g_session.unk_0x030 = 1;
|
g_session.natState = 1;
|
||||||
OSReport("Starting GameSpy available check.\n");
|
OSReport("Starting GameSpy available check.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -212,14 +212,14 @@ int IPLContestProcess() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GSIACAvailable: {
|
case GSIACAvailable: {
|
||||||
g_session.unk_0x034 = 1;
|
g_session.gsAvailable = 1;
|
||||||
g_session.unk_0x030 = 2;
|
g_session.natState = 2;
|
||||||
OSReport("GameSpy server is currently available.\n");
|
OSReport("GameSpy server is currently available.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
g_session.unk_0x034 = 0;
|
g_session.gsAvailable = 0;
|
||||||
g_session.unk_0x030 = 5;
|
g_session.natState = 5;
|
||||||
OSReport("GameSpy server is currently unavailable.\n");
|
OSReport("GameSpy server is currently unavailable.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ int IPLContestProcess() {
|
|||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
NNStartNatDetection(onNatDetectionDone);
|
NNStartNatDetection(onNatDetectionDone);
|
||||||
g_session.unk_0x030 = 3;
|
g_session.natState = 3;
|
||||||
OSReport("Port mapping detectioning test has been started.\n");
|
OSReport("Port mapping detectioning test has been started.\n");
|
||||||
g_session.detectStartTime = OSGetTime();
|
g_session.detectStartTime = OSGetTime();
|
||||||
break;
|
break;
|
||||||
@@ -238,8 +238,8 @@ int IPLContestProcess() {
|
|||||||
if (OSGetTime() - g_session.detectStartTime < OSMillisecondsToTicks((OSTime)90000)) {
|
if (OSGetTime() - g_session.detectStartTime < OSMillisecondsToTicks((OSTime)90000)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
g_session.unk_0x030 = 5;
|
g_session.natState = 5;
|
||||||
g_session.unk_0x038 = 1;
|
g_session.natTimedOut = 1;
|
||||||
OSReport("[error] NAT timeout.\n");
|
OSReport("[error] NAT timeout.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -289,10 +289,10 @@ int IPLGetNATSupportCode(int conntype) {
|
|||||||
|
|
||||||
nat = g_session.nat;
|
nat = g_session.nat;
|
||||||
|
|
||||||
if (g_session.unk_0x034 != 0) {
|
if (g_session.gsAvailable != 0) {
|
||||||
if (g_session.unk_0x038 != 0) {
|
if (g_session.natTimedOut != 0) {
|
||||||
code = 11180;
|
code = 11180;
|
||||||
} else if (g_session.unk_0x03c != 0) {
|
} else if (g_session.natFailed != 0) {
|
||||||
code = 11170;
|
code = 11170;
|
||||||
} else {
|
} else {
|
||||||
if (nat.mappingScheme == 0 && nat.mappings[2].publicPort == nat.mappings[1].publicPort * 2 - nat.mappings[0].publicPort) {
|
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) {
|
void onNatDetectionDone(gsi_bool success, NAT nat) {
|
||||||
if (success) {
|
if (success) {
|
||||||
g_session.nat = nat;
|
g_session.nat = nat;
|
||||||
g_session.unk_0x03c = 0;
|
g_session.natFailed = 0;
|
||||||
} else {
|
} else {
|
||||||
g_session.unk_0x03c = 1;
|
g_session.natFailed = 1;
|
||||||
}
|
}
|
||||||
g_session.unk_0x030 = 4;
|
g_session.natState = 4;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user