Compare commits
10 Commits
cleanup/se
...
cleanup/nw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c50581dc7f | ||
|
|
fc2d150c6d | ||
|
|
7851b2b29f | ||
|
|
263411ccac | ||
|
|
09de907f0b | ||
|
|
4e3ab6eae5 | ||
|
|
99d6fe20a2 | ||
|
|
00013016df | ||
|
|
3e279ef189 | ||
|
|
32417fe8a2 |
@@ -89,10 +89,10 @@ namespace ipl {
|
|||||||
|
|
||||||
int mIPLState; // 0x04
|
int mIPLState; // 0x04
|
||||||
volatile BS2State mState; // 0x08
|
volatile BS2State mState; // 0x08
|
||||||
bool unk_0x0C;
|
bool mbTickEnabled; // 0x0C
|
||||||
bool unk_0x0D;
|
bool mbUpdateRequested; // 0x0D
|
||||||
bool unk_0x0E;
|
bool mbAbortRequested; // 0x0E
|
||||||
bool unk_0x0F;
|
bool mbRestartRequested; // 0x0F
|
||||||
bool mbIsDiagDisc; // 0x10
|
bool mbIsDiagDisc; // 0x10
|
||||||
bool mbIncludesSeatTitles; // 0x11
|
bool mbIncludesSeatTitles; // 0x11
|
||||||
u8* mpBannerBuffer; // 0x14
|
u8* mpBannerBuffer; // 0x14
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ typedef struct _ziUwdNode {
|
|||||||
|
|
||||||
struct __zi8_work_data_s {
|
struct __zi8_work_data_s {
|
||||||
ziU8 unk_0x00;
|
ziU8 unk_0x00;
|
||||||
ziU8 unk_0x01;
|
ziU8 countOnly; // 0x01
|
||||||
ziU8 unk_0x02[2];
|
ziU8 unk_0x02[2];
|
||||||
ziLanguageEntry* langEntries; // 0x04
|
ziLanguageEntry* langEntries; // 0x04
|
||||||
ziU8 unk_0x08;
|
ziU8 unk_0x08;
|
||||||
@@ -265,7 +265,7 @@ 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;
|
||||||
@@ -273,7 +273,7 @@ struct __zi8_work_data_s {
|
|||||||
ziU8 unk_0x141C;
|
ziU8 unk_0x141C;
|
||||||
ziU8 unk_0x141D;
|
ziU8 unk_0x141D;
|
||||||
ziU8 unk_0x141E;
|
ziU8 unk_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
|
||||||
@@ -283,7 +283,7 @@ struct __zi8_work_data_s {
|
|||||||
ziU16 unk_0x17EA;
|
ziU16 unk_0x17EA;
|
||||||
ziU8 unk_0x17EC;
|
ziU8 unk_0x17EC;
|
||||||
ziU8 unk_0x17ED[3];
|
ziU8 unk_0x17ED[3];
|
||||||
ziU8* unk_0x17F0;
|
ziU8* dawgGroup; // 0x17F0
|
||||||
ziWChar unk_0x17F4[0x40]; // 0x17F4..0x1874
|
ziWChar unk_0x17F4[0x40]; // 0x17F4..0x1874
|
||||||
ziU16 unk_0x1874;
|
ziU16 unk_0x1874;
|
||||||
ziU8 unk_0x1876;
|
ziU8 unk_0x1876;
|
||||||
|
|||||||
@@ -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) {
|
||||||
@@ -238,7 +238,7 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
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,
|
||||||
@@ -306,7 +306,7 @@ ziU32 Zi8MatchROMdata(ziWChar* elements, ziU8 count, ziU8 language,
|
|||||||
} else {
|
} else {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
ZI_WORK->unk_0x17EC = 0;
|
ZI_WORK->unk_0x17EC = 0;
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(0, language, ZI_WORK);
|
||||||
} else if (ZI_WORK->unk_0x17EC != 0) {
|
} else if (ZI_WORK->unk_0x17EC != 0) {
|
||||||
Zi8LogError(100, ZI_WORK);
|
Zi8LogError(100, ZI_WORK);
|
||||||
goto finish_match;
|
goto finish_match;
|
||||||
@@ -316,30 +316,30 @@ ziU32 Zi8MatchROMdata(ziWChar* elements, ziU8 count, ziU8 language,
|
|||||||
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
mode, status, reservedMode, 0, acceptPrefix, ZI_WORK);
|
mode, status, reservedMode, 0, acceptPrefix, ZI_WORK);
|
||||||
} else {
|
} else {
|
||||||
while (ZI_WORK->unk_0x17F0 != 0) {
|
while (ZI_WORK->dawgGroup != 0) {
|
||||||
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
result = Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
mode, status, reservedMode, ZI_WORK->unk_0x17F0,
|
mode, status, reservedMode, ZI_WORK->dawgGroup,
|
||||||
acceptPrefix, ZI_WORK);
|
acceptPrefix, ZI_WORK);
|
||||||
if ((ziU8)result != 0) break;
|
if ((ziU8)result != 0) break;
|
||||||
status = 0;
|
status = 0;
|
||||||
if (count <= 1 && language == 0x36) break;
|
if (count <= 1 && language == 0x36) break;
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(ZI_WORK->unk_0x17F0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(ZI_WORK->dawgGroup, language, ZI_WORK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((ziU8)result == 0 && status == 0 && mode == 1 && count == 1 && capacity >= 1) {
|
if ((ziU8)result == 0 && status == 0 && mode == 1 && count == 1 && capacity >= 1) {
|
||||||
mode = 0;
|
mode = 0;
|
||||||
ZI_WORK->unk_0x17EC = 1;
|
ZI_WORK->unk_0x17EC = 1;
|
||||||
if (tableSize != 0) {
|
if (tableSize != 0) {
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(0, language, ZI_WORK);
|
||||||
while (ZI_WORK->unk_0x17F0 != 0) {
|
while (ZI_WORK->dawgGroup != 0) {
|
||||||
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
mode, status, reservedMode, ZI_WORK->unk_0x17F0,
|
mode, status, reservedMode, ZI_WORK->dawgGroup,
|
||||||
acceptPrefix, ZI_WORK) != 0) {
|
acceptPrefix, ZI_WORK) != 0) {
|
||||||
*output = *elements;
|
*output = *elements;
|
||||||
result = 1;
|
result = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ZI_WORK->unk_0x17F0 = NextDawgGroup(ZI_WORK->unk_0x17F0, language, ZI_WORK);
|
ZI_WORK->dawgGroup = NextDawgGroup(ZI_WORK->dawgGroup, language, ZI_WORK);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
if ((ziU8)Zi8MatchROMdata2(elements, count, language, output, capacity,
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -339,11 +339,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
|
|||||||
if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) {
|
if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) {
|
||||||
switch (parameters->language) {
|
switch (parameters->language) {
|
||||||
case 1:
|
case 1:
|
||||||
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) {
|
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
|
||||||
switch(ZI_WORK->unk_0x00) {
|
switch(ZI_WORK->unk_0x00) {
|
||||||
case '\0':
|
case '\0':
|
||||||
if (parameters->elements[0] == 0xEF04) {
|
if (parameters->elements[0] == 0xEF04) {
|
||||||
ZI_WORK->unk_0x01 = options->countOnly;
|
ZI_WORK->countOnly = options->countOnly;
|
||||||
ZI_WORK->unk_0x00 = '\x01';
|
ZI_WORK->unk_0x00 = '\x01';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -400,11 +400,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
|
|||||||
break;
|
break;
|
||||||
case 0x11:
|
case 0x11:
|
||||||
default:
|
default:
|
||||||
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) {
|
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
|
||||||
switch(ZI_WORK->unk_0x00) {
|
switch(ZI_WORK->unk_0x00) {
|
||||||
case '\0':
|
case '\0':
|
||||||
if (parameters->elements[0] == 0xEFF2) {
|
if (parameters->elements[0] == 0xEFF2) {
|
||||||
ZI_WORK->unk_0x01 = options->countOnly;
|
ZI_WORK->countOnly = options->countOnly;
|
||||||
ZI_WORK->unk_0x00 = '\x01';
|
ZI_WORK->unk_0x00 = '\x01';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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));
|
||||||
@@ -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);
|
||||||
|
|
||||||
@@ -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
|
||||||
@@ -73,7 +73,7 @@ typedef struct NWC24MsgObjPrivate {
|
|||||||
};
|
};
|
||||||
u32 raw;
|
u32 raw;
|
||||||
} msgBoardFlags; // 0xCC
|
} msgBoardFlags; // 0xCC
|
||||||
NWC24Data unk_0xD0;
|
NWC24Data extraData; // 0xD0
|
||||||
NWC24Data faceData; // 0xD8
|
NWC24Data faceData; // 0xD8
|
||||||
NWC24Data altName; // 0xE0
|
NWC24Data altName; // 0xE0
|
||||||
u32 textSize; // 0xE4
|
u32 textSize; // 0xE4
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -243,11 +243,11 @@ static inline NWC24Err WriteMBDelayField(NWC24MsgObjPrivate* msg) {
|
|||||||
|
|
||||||
static inline NWC24Err WriteExtraFields(NWC24MsgObjPrivate* msg) {
|
static inline NWC24Err WriteExtraFields(NWC24MsgObjPrivate* msg) {
|
||||||
NWC24Err err;
|
NWC24Err err;
|
||||||
if (msg->unk_0xD0.size == 0)
|
if (msg->extraData.size == 0)
|
||||||
return NWC24_OK;
|
return NWC24_OK;
|
||||||
err = NWC24FWrite(msg->unk_0xD0.ptr, msg->unk_0xD0.size, m_pFile);
|
err = NWC24FWrite(msg->extraData.ptr, msg->extraData.size, m_pFile);
|
||||||
if (err == NWC24_OK)
|
if (err == NWC24_OK)
|
||||||
msg->length += msg->unk_0xD0.size;
|
msg->length += msg->extraData.size;
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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; }
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
|
|||||||
NWC24Data_Init(&msgObj->unk_0x38);
|
NWC24Data_Init(&msgObj->unk_0x38);
|
||||||
NWC24Data_Init(&msgObj->unk_0x50);
|
NWC24Data_Init(&msgObj->unk_0x50);
|
||||||
NWC24Data_Init(&msgObj->unk_0x58);
|
NWC24Data_Init(&msgObj->unk_0x58);
|
||||||
NWC24Data_Init(&msgObj->unk_0xD0);
|
NWC24Data_Init(&msgObj->extraData);
|
||||||
NWC24Data_Init(&msgObj->faceData);
|
NWC24Data_Init(&msgObj->faceData);
|
||||||
NWC24Data_Init(&msgObj->altName);
|
NWC24Data_Init(&msgObj->altName);
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
namespace ipl {
|
namespace ipl {
|
||||||
namespace bs2 {
|
namespace bs2 {
|
||||||
Manager::Manager(EGG::Heap* pHeap)
|
Manager::Manager(EGG::Heap* pHeap)
|
||||||
: mIPLState(IPL_STATE_NO_DISK), mState(BS2_STT_NO_DISK), unk_0x0C(true), unk_0x0D(false), unk_0x0E(false), unk_0x0F(false),
|
: mIPLState(IPL_STATE_NO_DISK), mState(BS2_STT_NO_DISK), mbTickEnabled(true), mbUpdateRequested(false), mbAbortRequested(false), mbRestartRequested(false),
|
||||||
mbIsDiagDisc(false), mbIncludesSeatTitles(false), mbHasBanner(FALSE), mUnlockedState(BS2_STT_NO_DISK), mbStartUpdate(false),
|
mbIsDiagDisc(false), mbIncludesSeatTitles(false), mbHasBanner(FALSE), mUnlockedState(BS2_STT_NO_DISK), mbStartUpdate(false),
|
||||||
mEntries(NULL), mEntrySize(1), mEntryOffset(0) {
|
mEntries(NULL), mEntrySize(1), mEntryOffset(0) {
|
||||||
mpBannerBuffer = new (pHeap, DEFAULT_ALIGN) u8[BS2_DEFAULT_BANNER_SIZE];
|
mpBannerBuffer = new (pHeap, DEFAULT_ALIGN) u8[BS2_DEFAULT_BANNER_SIZE];
|
||||||
@@ -30,13 +30,13 @@ namespace ipl {
|
|||||||
return mIPLState;
|
return mIPLState;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unk_0x0F && !System::isNandFull()) {
|
if (mbRestartRequested && !System::isNandFull()) {
|
||||||
BS2RestartStateMachine();
|
BS2RestartStateMachine();
|
||||||
|
|
||||||
unk_0x0C = true;
|
mbTickEnabled = true;
|
||||||
mIPLState = IPL_STATE_NO_DISK;
|
mIPLState = IPL_STATE_NO_DISK;
|
||||||
unk_0x0F = false;
|
mbRestartRequested = false;
|
||||||
} else if (unk_0x0C) {
|
} else if (mbTickEnabled) {
|
||||||
BOOL old = OSDisableInterrupts();
|
BOOL old = OSDisableInterrupts();
|
||||||
|
|
||||||
mState = BS2Tick();
|
mState = BS2Tick();
|
||||||
@@ -51,7 +51,7 @@ namespace ipl {
|
|||||||
|
|
||||||
if (mbIsDiagDisc && System::isRsrcLoaded()) {
|
if (mbIsDiagDisc && System::isRsrcLoaded()) {
|
||||||
__WPADReconnect(TRUE);
|
__WPADReconnect(TRUE);
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
bootNewSystem();
|
bootNewSystem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::startUpdate() {
|
void Manager::startUpdate() {
|
||||||
unk_0x0D = true;
|
mbUpdateRequested = true;
|
||||||
mbStartUpdate = true;
|
mbStartUpdate = true;
|
||||||
mPrevEntry = 0;
|
mPrevEntry = 0;
|
||||||
mPrevFound = 0;
|
mPrevFound = 0;
|
||||||
@@ -88,11 +88,11 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::reserveRVLGame() {
|
void Manager::reserveRVLGame() {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::reserveGCGame() {
|
void Manager::reserveGCGame() {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::startRVLGame() {
|
void Manager::startRVLGame() {
|
||||||
@@ -103,13 +103,13 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::abort() {
|
void Manager::abort() {
|
||||||
unk_0x0E = true;
|
mbAbortRequested = true;
|
||||||
unk_0x0F = false;
|
mbRestartRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::restart() {
|
void Manager::restart() {
|
||||||
unk_0x0E = false;
|
mbAbortRequested = false;
|
||||||
unk_0x0F = true;
|
mbRestartRequested = true;
|
||||||
|
|
||||||
System::checkNandOverFlowFlagAsync();
|
System::checkNandOverFlowFlagAsync();
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ namespace ipl {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BS2_STT_64: {
|
case BS2_STT_64: {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
mIPLState = IPL_STATE_8;
|
mIPLState = IPL_STATE_8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -216,25 +216,25 @@ namespace ipl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::execTick(BS2State state) {
|
void Manager::execTick(BS2State state) {
|
||||||
if (unk_0x0D) {
|
if (mbUpdateRequested) {
|
||||||
if (state == BS2_STT_UPDATE_DISK) {
|
if (state == BS2_STT_UPDATE_DISK) {
|
||||||
BS2StartUpdate();
|
BS2StartUpdate();
|
||||||
} else {
|
} else {
|
||||||
mbStartUpdate = false;
|
mbStartUpdate = false;
|
||||||
}
|
}
|
||||||
} else if (unk_0x0E) {
|
} else if (mbAbortRequested) {
|
||||||
if (state == BS2_STT_NO_DISK || state == BS2_STT_COVER_OPEN || state == BS2_STT_55 || state == BS2_STT_WRONG_DISK ||
|
if (state == BS2_STT_NO_DISK || state == BS2_STT_COVER_OPEN || state == BS2_STT_55 || state == BS2_STT_WRONG_DISK ||
|
||||||
state == BS2_STT_66 || state == BS2_STT_67 || state == BS2_STT_68 || state == BS2_STT_FATAL_ERROR ||
|
state == BS2_STT_66 || state == BS2_STT_67 || state == BS2_STT_68 || state == BS2_STT_FATAL_ERROR ||
|
||||||
state == BS2_STT_UPDATE_FAILED || state == BS2_STT_DIRTY_DISK) {
|
state == BS2_STT_UPDATE_FAILED || state == BS2_STT_DIRTY_DISK) {
|
||||||
unk_0x0C = false;
|
mbTickEnabled = false;
|
||||||
mIPLState = IPL_STATE_8;
|
mIPLState = IPL_STATE_8;
|
||||||
} else {
|
} else {
|
||||||
BS2AbortStateMachine();
|
BS2AbortStateMachine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unk_0x0D = false;
|
mbUpdateRequested = false;
|
||||||
unk_0x0E = false;
|
mbAbortRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::updateTick() {
|
void Manager::updateTick() {
|
||||||
|
|||||||
Reference in New Issue
Block a user