Compare commits
1 Commits
cleanup/nw
...
cleanup/ip
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87a084da31 |
@@ -62,17 +62,17 @@ namespace ipl {
|
||||
void start_left_event(const char* paneName);
|
||||
void start_trig_event(const char* paneName);
|
||||
|
||||
typedef struct Unk {
|
||||
typedef struct CmdEntry {
|
||||
int command; // 0x00
|
||||
u32 msgID; // 0x04
|
||||
} Unk;
|
||||
} CmdEntry;
|
||||
|
||||
Unk unk_0x64[64];
|
||||
CmdEntry mCmdQueue[64];
|
||||
|
||||
int unk_0x264;
|
||||
int unk_0x268;
|
||||
int unk_0x26C;
|
||||
int unk_0x270;
|
||||
int mQueueCapacity;
|
||||
int mQueueCount;
|
||||
int mQueueRead;
|
||||
int mQueueWrite;
|
||||
|
||||
int mSettingArg; // 0x274
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ struct __zi8_work_data_s {
|
||||
ziPtr unk_0x11FC;
|
||||
ziPtr userKeys[0x83]; // 0x1200
|
||||
ziU8 unk_0x140C[4];
|
||||
ziU32 formats; // 0x1410
|
||||
ziU32 unk_0x1410;
|
||||
ziU8 unk_0x1414[4];
|
||||
ziU8 unk_0x1418;
|
||||
ziU8 unk_0x1419;
|
||||
|
||||
@@ -50,10 +50,10 @@ ziBool Zi8ZHsetZYfuzzyPairs(ziFuzzyZYPairs pairs ZI_NEED_WORK) {
|
||||
|
||||
ziBool Zi8SetLatinSearchOrder(ziU8* searchArray, ziU8 searchSize ZI_NEED_WORK) {
|
||||
if (searchArray == 0 || *searchArray == 0) {
|
||||
ZI_WORK->formats = (ziU32)Zi8SOdefaultArray;
|
||||
ZI_WORK->unk_0x1410 = (ziU32)Zi8SOdefaultArray;
|
||||
ZI_WORK->unk_0x1418 = 9;
|
||||
} else {
|
||||
ZI_WORK->formats = (ziU32)searchArray;
|
||||
ZI_WORK->unk_0x1410 = (ziU32)searchArray;
|
||||
ZI_WORK->unk_0x1418 = searchSize;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -45,7 +45,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
|
||||
ziWChar* cursor;
|
||||
ziU8* data;
|
||||
ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0};
|
||||
ziU32 savedFormats = ZI_WORK->formats;
|
||||
ziU32 savedFormats = ZI_WORK->unk_0x1410;
|
||||
ziU8 savedCount = ZI_WORK->unk_0x1418;
|
||||
ziSearchState search = {0};
|
||||
Zi8LogError(100, __zi8_work_data);
|
||||
@@ -73,7 +73,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
|
||||
request.candidates = ordinals;
|
||||
request.maxCandidates = 1;
|
||||
request.firstCandidate = 0;
|
||||
ZI_WORK->formats = (ziU32)formats;
|
||||
ZI_WORK->unk_0x1410 = (ziU32)formats;
|
||||
if (ZI_WORK->unk_0x1C[0] == 2) {
|
||||
ZI_WORK->unk_0x1418 = 0;
|
||||
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 ZI_WORK->unk_0x1418 = 1;
|
||||
count = Zi8GetCandidatesOrCount(&request, &search, __zi8_work_data);
|
||||
ZI_WORK->formats = savedFormats;
|
||||
ZI_WORK->unk_0x1410 = savedFormats;
|
||||
ZI_WORK->unk_0x1418 = savedCount;
|
||||
if (count != 0) return 1;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ typedef struct NWC24MsgObjPrivate {
|
||||
NWC24Data unk_0x38;
|
||||
NWC24Data subject; // 0x40
|
||||
NWC24Data text; // 0x48
|
||||
NWC24Data charsetData; // 0x50
|
||||
NWC24Data encodingData; // 0x58
|
||||
NWC24Data unk_0x50;
|
||||
NWC24Data unk_0x58;
|
||||
NWC24Charset charset; // 0x60
|
||||
NWC24Encoding encoding; // 0x64
|
||||
NWC24Data attached[NWC24_MSG_ATTACHMENT_MAX]; // 0x68
|
||||
|
||||
@@ -950,8 +950,8 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
|
||||
u32 field1 = ((u32)msg->unk_0x30.ptr & 0xFFFFF) | (msg->unk_0x30.size << 20);
|
||||
u32 field2 = ((u32)msg->unk_0x38.ptr & 0xFFFFF) | (msg->unk_0x38.size << 20);
|
||||
u32 field3 = ((u32)msg->subject.ptr & 0xFFFFF) | (msg->subject.size << 20);
|
||||
u32 field4 = ((u32)msg->charsetData.ptr & 0xFFFFF) | (msg->charsetData.size << 20);
|
||||
u32 field5 = ((u32)msg->encodingData.ptr & 0xFFFFF) | (msg->encodingData.size << 20);
|
||||
u32 field4 = ((u32)msg->unk_0x50.ptr & 0xFFFFF) | (msg->unk_0x50.size << 20);
|
||||
u32 field5 = ((u32)msg->unk_0x58.ptr & 0xFFFFF) | (msg->unk_0x58.size << 20);
|
||||
entry->msgId = msg->msgId;
|
||||
entry->type = msg->type;
|
||||
entry->length = msg->length;
|
||||
@@ -1025,10 +1025,10 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
|
||||
msg->unk_0x38.size = size2;
|
||||
msg->subject.ptr = (void*)offset3;
|
||||
msg->subject.size = size3;
|
||||
msg->charsetData.ptr = (void*)offset4;
|
||||
msg->charsetData.size = size4;
|
||||
msg->encodingData.ptr = (void*)offset5;
|
||||
msg->encodingData.size = size5;
|
||||
msg->unk_0x50.ptr = (void*)offset4;
|
||||
msg->unk_0x50.size = size4;
|
||||
msg->unk_0x58.ptr = (void*)offset5;
|
||||
msg->unk_0x58.size = size5;
|
||||
msg->attached[0].ptr = entry->attached[0].ptr;
|
||||
msg->attached[0].size = entry->attached[0].size;
|
||||
msg->attachedSize[0] = entry->attachedSize[0];
|
||||
|
||||
@@ -811,16 +811,16 @@ static NWC24Err WriteContentTypeField(NWC24MsgObjPrivate* msg) {
|
||||
name = NWC24GetCharsetStr(msg->charset);
|
||||
if (name != NULL) {
|
||||
Mail_sprintf(buffer, (char*)ContentTypeTP, name);
|
||||
msg->charsetData.ptr = (const void*)(msg->length + 34);
|
||||
msg->charsetData.size = Mail_strlen(name) + 1;
|
||||
msg->unk_0x50.ptr = (const void*)(msg->length + 34);
|
||||
msg->unk_0x50.size = Mail_strlen(name) + 1;
|
||||
total = Mail_strlen(buffer);
|
||||
buffer += total;
|
||||
}
|
||||
encoding = NWC24GetEncodingStr(msg->encoding);
|
||||
if (encoding != NULL) {
|
||||
Mail_sprintf(buffer, (char*)ContentTxEncT, encoding);
|
||||
msg->encodingData.ptr = (const void*)(total + msg->length + 27);
|
||||
msg->encodingData.size = Mail_strlen(encoding) + 1;
|
||||
msg->unk_0x58.ptr = (const void*)(total + msg->length + 27);
|
||||
msg->unk_0x58.size = Mail_strlen(encoding) + 1;
|
||||
total += Mail_strlen(buffer);
|
||||
}
|
||||
if (total == 0)
|
||||
|
||||
@@ -75,8 +75,8 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
|
||||
|
||||
NWC24Data_Init(&msgObj->unk_0x30);
|
||||
NWC24Data_Init(&msgObj->unk_0x38);
|
||||
NWC24Data_Init(&msgObj->charsetData);
|
||||
NWC24Data_Init(&msgObj->encodingData);
|
||||
NWC24Data_Init(&msgObj->unk_0x50);
|
||||
NWC24Data_Init(&msgObj->unk_0x58);
|
||||
NWC24Data_Init(&msgObj->unk_0xD0);
|
||||
NWC24Data_Init(&msgObj->faceData);
|
||||
NWC24Data_Init(&msgObj->altName);
|
||||
|
||||
@@ -426,19 +426,19 @@ static NWC24Err ReadMsgTextInternal(const NWC24MsgObj* msg, char* text, u32 capa
|
||||
return result;
|
||||
}
|
||||
Mail_memset(charset, 0, charsetCapacity);
|
||||
if (privateMsg->charsetData.size >= charsetCapacity)
|
||||
if (privateMsg->unk_0x50.size >= charsetCapacity)
|
||||
result = NWC24_ERR_FORMAT;
|
||||
else {
|
||||
if (privateMsg->charsetData.size != 0) {
|
||||
NWC24FSeek(&file, (u32)privateMsg->charsetData.ptr, NWC24_SEEK_BEG);
|
||||
result = NWC24FRead(charset, privateMsg->charsetData.size, &file);
|
||||
if (privateMsg->unk_0x50.size != 0) {
|
||||
NWC24FSeek(&file, (u32)privateMsg->unk_0x50.ptr, NWC24_SEEK_BEG);
|
||||
result = NWC24FRead(charset, privateMsg->unk_0x50.size, &file);
|
||||
if (result != NWC24_OK)
|
||||
goto close;
|
||||
}
|
||||
if (privateMsg->encodingData.size != 0 && privateMsg->encodingData.size < 32) {
|
||||
if (privateMsg->unk_0x58.size != 0 && privateMsg->unk_0x58.size < 32) {
|
||||
Mail_memset(buffer, 0, 32);
|
||||
NWC24FSeek(&file, (u32)privateMsg->encodingData.ptr, NWC24_SEEK_BEG);
|
||||
result = NWC24FRead(buffer, privateMsg->encodingData.size, &file);
|
||||
NWC24FSeek(&file, (u32)privateMsg->unk_0x58.ptr, NWC24_SEEK_BEG);
|
||||
result = NWC24FRead(buffer, privateMsg->unk_0x58.size, &file);
|
||||
if (result != NWC24_OK)
|
||||
goto close;
|
||||
result = NWC24ParseEncodingStr(encoding, buffer);
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace ipl {
|
||||
// clang-format on
|
||||
|
||||
SettingButton::SettingButton(EGG::Heap* heap, int arg) : FaderSceneBase(heap), ::gui::EventHandler() {
|
||||
unk_0x264 = 64;
|
||||
unk_0x268 = 0;
|
||||
unk_0x26C = 0;
|
||||
unk_0x270 = 0;
|
||||
mQueueCapacity = 64;
|
||||
mQueueCount = 0;
|
||||
mQueueRead = 0;
|
||||
mQueueWrite = 0;
|
||||
mSettingArg = arg;
|
||||
mpLayout = NULL;
|
||||
mpLayoutFile = NULL;
|
||||
@@ -81,9 +81,9 @@ namespace ipl {
|
||||
|
||||
FaderSceneCommand SettingButton::calcNormal() {
|
||||
if (!mpLayout->getAnim(ANIM_ALPHA_IN)->isPlaying() && !mpLayout->getAnim(ANIM_ALPHA_OUT)->isPlaying() &&
|
||||
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && unk_0x268 != 0) {
|
||||
Unk unk = unk_0x64[unk_0x26C];
|
||||
switch (unk.command) {
|
||||
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && mQueueCount != 0) {
|
||||
CmdEntry entry = mCmdQueue[mQueueRead];
|
||||
switch (entry.command) {
|
||||
case CMD_SHOW_BTN: {
|
||||
showBtn();
|
||||
break;
|
||||
@@ -93,16 +93,16 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
case CMD_SET_TEXT: {
|
||||
setText(unk.msgID);
|
||||
setText(entry.msgID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (unk_0x268 != 0) {
|
||||
if (++unk_0x26C >= unk_0x264) {
|
||||
unk_0x26C = 0;
|
||||
if (mQueueCount != 0) {
|
||||
if (++mQueueRead >= mQueueCapacity) {
|
||||
mQueueRead = 0;
|
||||
}
|
||||
unk_0x268--;
|
||||
mQueueCount--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,16 +225,16 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void SettingButton::reserve(int command, u32 msgId) {
|
||||
if (unk_0x264 != unk_0x268) {
|
||||
int unk = unk_0x270;
|
||||
unk_0x64[unk].command = command;
|
||||
unk_0x64[unk].msgID = msgId;
|
||||
unk_0x270++;
|
||||
if (mQueueCapacity != mQueueCount) {
|
||||
int writeIdx = mQueueWrite;
|
||||
mCmdQueue[writeIdx].command = command;
|
||||
mCmdQueue[writeIdx].msgID = msgId;
|
||||
mQueueWrite++;
|
||||
|
||||
if (unk_0x270 >= unk_0x264) {
|
||||
unk_0x270 = 0;
|
||||
if (mQueueWrite >= mQueueCapacity) {
|
||||
mQueueWrite = 0;
|
||||
}
|
||||
unk_0x268++;
|
||||
mQueueCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user