Compare commits
2 Commits
cleanup/er
...
cleanup/nw
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26090e7222 | ||
|
|
99d6fe20a2 |
@@ -265,7 +265,7 @@ struct __zi8_work_data_s {
|
||||
ziPtr unk_0x11FC;
|
||||
ziPtr userKeys[0x83]; // 0x1200
|
||||
ziU8 unk_0x140C[4];
|
||||
ziU32 unk_0x1410;
|
||||
ziU32 formats; // 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->unk_0x1410 = (ziU32)Zi8SOdefaultArray;
|
||||
ZI_WORK->formats = (ziU32)Zi8SOdefaultArray;
|
||||
ZI_WORK->unk_0x1418 = 9;
|
||||
} else {
|
||||
ZI_WORK->unk_0x1410 = (ziU32)searchArray;
|
||||
ZI_WORK->formats = (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->unk_0x1410;
|
||||
ziU32 savedFormats = ZI_WORK->formats;
|
||||
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->unk_0x1410 = (ziU32)formats;
|
||||
ZI_WORK->formats = (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->unk_0x1410 = savedFormats;
|
||||
ZI_WORK->formats = 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 unk_0x50;
|
||||
NWC24Data unk_0x58;
|
||||
NWC24Data charsetData; // 0x50
|
||||
NWC24Data encodingData; // 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->unk_0x50.ptr & 0xFFFFF) | (msg->unk_0x50.size << 20);
|
||||
u32 field5 = ((u32)msg->unk_0x58.ptr & 0xFFFFF) | (msg->unk_0x58.size << 20);
|
||||
u32 field4 = ((u32)msg->charsetData.ptr & 0xFFFFF) | (msg->charsetData.size << 20);
|
||||
u32 field5 = ((u32)msg->encodingData.ptr & 0xFFFFF) | (msg->encodingData.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->unk_0x50.ptr = (void*)offset4;
|
||||
msg->unk_0x50.size = size4;
|
||||
msg->unk_0x58.ptr = (void*)offset5;
|
||||
msg->unk_0x58.size = size5;
|
||||
msg->charsetData.ptr = (void*)offset4;
|
||||
msg->charsetData.size = size4;
|
||||
msg->encodingData.ptr = (void*)offset5;
|
||||
msg->encodingData.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->unk_0x50.ptr = (const void*)(msg->length + 34);
|
||||
msg->unk_0x50.size = Mail_strlen(name) + 1;
|
||||
msg->charsetData.ptr = (const void*)(msg->length + 34);
|
||||
msg->charsetData.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->unk_0x58.ptr = (const void*)(total + msg->length + 27);
|
||||
msg->unk_0x58.size = Mail_strlen(encoding) + 1;
|
||||
msg->encodingData.ptr = (const void*)(total + msg->length + 27);
|
||||
msg->encodingData.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->unk_0x50);
|
||||
NWC24Data_Init(&msgObj->unk_0x58);
|
||||
NWC24Data_Init(&msgObj->charsetData);
|
||||
NWC24Data_Init(&msgObj->encodingData);
|
||||
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->unk_0x50.size >= charsetCapacity)
|
||||
if (privateMsg->charsetData.size >= charsetCapacity)
|
||||
result = NWC24_ERR_FORMAT;
|
||||
else {
|
||||
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 (privateMsg->charsetData.size != 0) {
|
||||
NWC24FSeek(&file, (u32)privateMsg->charsetData.ptr, NWC24_SEEK_BEG);
|
||||
result = NWC24FRead(charset, privateMsg->charsetData.size, &file);
|
||||
if (result != NWC24_OK)
|
||||
goto close;
|
||||
}
|
||||
if (privateMsg->unk_0x58.size != 0 && privateMsg->unk_0x58.size < 32) {
|
||||
if (privateMsg->encodingData.size != 0 && privateMsg->encodingData.size < 32) {
|
||||
Mail_memset(buffer, 0, 32);
|
||||
NWC24FSeek(&file, (u32)privateMsg->unk_0x58.ptr, NWC24_SEEK_BEG);
|
||||
result = NWC24FRead(buffer, privateMsg->unk_0x58.size, &file);
|
||||
NWC24FSeek(&file, (u32)privateMsg->encodingData.ptr, NWC24_SEEK_BEG);
|
||||
result = NWC24FRead(buffer, privateMsg->encodingData.size, &file);
|
||||
if (result != NWC24_OK)
|
||||
goto close;
|
||||
result = NWC24ParseEncodingStr(encoding, buffer);
|
||||
|
||||
Reference in New Issue
Block a user