Compare commits

..

1 Commits

Author SHA1 Message Date
coah
18326569a4 cleanup(iplBoardObject): name StandData step and angle index
Rename StandData lerp counter and angle index used by stt_stand.
2026-10-01 19:07:05 -05:00
15 changed files with 58 additions and 58 deletions

View File

@@ -162,14 +162,14 @@ namespace ipl {
class {
public:
void init() {
unk_0x0C = -1;
mAngleIdx = -1;
pos.x = 0.0f;
pos.y = 0.0f;
}
math::VEC2 pos; // pos
int unk_0x08;
int unk_0x0C;
int mStep;
int mAngleIdx;
} mStandData; // 0xE4
picture mPicture; // 0xF4

View File

@@ -42,7 +42,7 @@ namespace ipl {
};
virtual BOOL isResetAcceptable() const {
return mbResetAcceptable;
return unk_0x7D;
}
virtual void prepare();
@@ -108,7 +108,7 @@ namespace ipl {
static const int mToFace_Duration = 20;
bool mbClosing; // 0x7C
bool mbResetAcceptable;
bool unk_0x7D;
wchar_t* mWCString; // 0x80

View File

@@ -64,8 +64,8 @@ typedef struct {
u16 mcuYCount; // 0x10
u16 mcuXCount2; // 0x12
u32 unk_0x14;
u8 remX; // 0x18
u8 remY; // 0x19
u8 unk_0x18;
u8 unk_0x19;
u8 compCount; // 0x1A
u8 scanCompCount; // 0x1B
u8 blockCount[4]; // 0x1C
@@ -143,8 +143,8 @@ struct TMCCJPEGDecWork_t {
u16 mcuYCount; // 0x1800
u16 mcuXCount2; // 0x1802
u32 unk_0x1804;
u8 remX; // 0x1808
u8 remY; // 0x1809
u8 unk_0x1808;
u8 unk_0x1809;
u8 compCount; // 0x180A
u8 scanCompCount; // 0x180B
u8 blockCount[4]; // 0x180C

View File

@@ -59,8 +59,8 @@ s32 TMCJPEGDEC_Setsize(TMCCJPEGDecWork* work) {
state->stepY = (state->scaleFactor + work->mcuXRem - 1) / state->scaleFactor;
state->jpegWidth = ((s32)(work->frameWidth + state->scaleFactor) - 1) / state->scaleFactor;
state->jpegHeight = (state->scaleFactor + work->frameHeight - 1) / state->scaleFactor;
state->stepXExt = (state->scaleFactor + work->remX - 1) / state->scaleFactor;
state->stepYExt = (state->scaleFactor + work->remY - 1) / state->scaleFactor;
state->stepXExt = (state->scaleFactor + work->unk_0x1808 - 1) / state->scaleFactor;
state->stepYExt = (state->scaleFactor + work->unk_0x1809 - 1) / state->scaleFactor;
state->dataSizeX = (state->stepXExt != 0) ? (state->maxX - 1) * state->stepX : (state->maxX + 1) * state->stepX;
state->dataSizeY = (state->stepYExt != 0) ? (state->maxY - 1) * state->stepY : (state->maxY + 1) * state->stepY;

View File

@@ -562,8 +562,8 @@ s32 TMCJPEGDEC_scan_varinit(TMCCJPEGDecWork* work) {
remX = p->frameWidth % p->mcuXCount;
remY = p->frameHeight % p->mcuXRem;
p->remX = remX;
p->remY = remY;
p->unk_0x18 = remX;
p->unk_0x19 = remY;
p->mcuYCount = p->mcuYCount + ((u8)remX != 0 ? 1 : 0);
p->mcuXCount2 = p->mcuXCount2 + ((u8)remY != 0 ? 1 : 0);
@@ -1919,8 +1919,8 @@ static s32 TMCJPEGDEC_parse_sof(TMCCJPEGDecWork* work) {
remX = fw - mcuCountX * mcuX;
remY = fh - mcuCountY * mcuY;
work->remX = remX;
work->remY = remY;
work->unk_0x1808 = remX;
work->unk_0x1809 = remY;
{
u16 xr = (remX != 0) ? 1 : 0;

View File

@@ -54,9 +54,9 @@ typedef struct _CDBAttrBuf {
typedef struct _CDBAttr {
CDBAttrBuf buf; // 0x00
BOOL dirty; // 0x400
BOOL wiiIdDirty; // 0x404
BOOL wiiIdValid; // 0x408
BOOL unk_0x400; // 0x400
BOOL unk_0x404; // 0x404
BOOL unk_0x408; // 0x408
} CDBAttr;
#pragma pack(pop)

View File

@@ -44,8 +44,8 @@ typedef struct NWC24MsgObjPrivate {
#else
NWC24UserId fromId; // 0x20
#endif
u32 date; // 0x28
u32 receivedDate; // 0x2C
u32 unk_0x28;
u32 unk_0x2C;
NWC24Data unk_0x30;
NWC24Data unk_0x38;
NWC24Data subject; // 0x40

View File

@@ -55,9 +55,9 @@ CDBErr CDBAttrCheckAttrBuf(CDBAttr* attr) {
void CDBAttrInit(CDBAttr* attr) {
memset(&attr->buf, 0, sizeof(CDBAttrBuf));
attr->wiiIdValid = FALSE;
attr->dirty = FALSE;
attr->wiiIdDirty = FALSE;
attr->unk_0x408 = FALSE;
attr->unk_0x400 = FALSE;
attr->unk_0x404 = FALSE;
}
CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate) {
@@ -89,7 +89,7 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
err = CDB_ERROR_OK;
attr->dirty = TRUE;
attr->unk_0x400 = TRUE;
}
if (err != CDB_ERROR_OK) {
@@ -98,11 +98,11 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
attrLastModifiedDate = lastModifiedDate;
memcpy(&attr->buf.lastModifiedDate, &attrLastModifiedDate, sizeof(u32));
attr->dirty = TRUE;
attr->unk_0x400 = TRUE;
attrModifiedCount = 0;
memcpy(&attr->buf.cdbID.modifiedCount, &attrModifiedCount, sizeof(u32));
attr->dirty = TRUE;
attr->unk_0x400 = TRUE;
GenCDBIdNumber(&cdbNum);
attrCdbIDNum = cdbNum;
@@ -110,12 +110,12 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
attrWiiID = CDBGetWiiId();
memcpy(&attr->buf.wiiId, &attrWiiID, sizeof(u64));
attr->wiiIdValid = TRUE;
attr->unk_0x408 = TRUE;
err = CDB_ERROR_OK;
attr->dirty = TRUE;
attr->wiiIdDirty = TRUE;
attr->unk_0x400 = TRUE;
attr->unk_0x404 = TRUE;
return err;
}
@@ -123,7 +123,7 @@ CDBErr CDBAttrCreateOnNAND(CDBAttr* attr, const char* desc, u32 lastModifiedDate
CDBErr CDBAttrSetModifiedDate(CDBAttr* attr, u32 modifiedDate) {
u32 value = modifiedDate;
memcpy(&attr->buf.lastModifiedDate, &value, sizeof(u32));
attr->dirty = TRUE;
attr->unk_0x400 = TRUE;
return CDB_ERROR_OK;
}
@@ -131,7 +131,7 @@ CDBErr CDBAttrSetModifiedDate(CDBAttr* attr, u32 modifiedDate) {
CDBErr CDBAttrSetModifiedCount(CDBAttr* attr, u32 modifiedCount) {
u32 value = modifiedCount;
memcpy(&attr->buf.cdbID.modifiedCount, &value, sizeof(u32));
attr->dirty = TRUE;
attr->unk_0x400 = TRUE;
return CDB_ERROR_OK;
}
@@ -151,7 +151,7 @@ CDBErr CDBAttrGetIDNumber(CDBAttr* attr, CDBId* cdbID) {
CDBErr CDBAttrSetWiiId(CDBAttr* attr, u64 wiiId) {
u64 value = wiiId;
memcpy(&attr->buf.wiiId, &value, sizeof(u64));
attr->wiiIdDirty = TRUE;
attr->unk_0x404 = TRUE;
return CDB_ERROR_OK;
}

View File

@@ -21,7 +21,7 @@ CDBErr CDBRecordFileReadAttrBuf(CDBRecord* record) {
return err;
}
recordFile->attr.wiiIdValid = TRUE;
recordFile->attr.unk_0x408 = TRUE;
return CDB_ERROR_OK;
}
@@ -34,12 +34,12 @@ CDBErr CDBRecordFileWriteAttrBuf(CDBRecord* record) {
return CDB_ERROR_27;
}
if (recordFile->attr.dirty && !recordFile->attr.wiiIdDirty) {
if (recordFile->attr.unk_0x400 && !recordFile->attr.unk_0x404) {
err = CDBFWriteAttrOnlyLeadChunk(&recordFile->bridgeFile, &recordFile->attr, record->key.location);
if (err != CDB_ERROR_OK) {
return err;
}
} else if (recordFile->attr.dirty || recordFile->attr.wiiIdDirty) {
} else if (recordFile->attr.unk_0x400 || recordFile->attr.unk_0x404) {
err = CDBFWriteAttr(&recordFile->bridgeFile, &recordFile->attr, record->key.location);
if (err != CDB_ERROR_OK) {
return err;

View File

@@ -783,7 +783,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
continue;
}
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->date) {
entry->flags == msg->unk_0x10 && (s32)entry->date == (s32)msg->unk_0x28) {
duplicateId = entry->msgId;
duplicateOffset = offset;
continue;
@@ -962,8 +962,8 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
entry->crc = msg->unk_0x1C;
entry->fromIdHigh = msg->fromIdHigh;
entry->fromIdLow = msg->fromIdLow;
entry->date = msg->date;
entry->receivedDate = msg->receivedDate;
entry->date = msg->unk_0x28;
entry->receivedDate = msg->unk_0x2C;
entry->numTo = msg->numTo;
entry->numAttached = msg->numAttached;
entry->groupId = msg->groupId;
@@ -1009,8 +1009,8 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
msg->unk_0x1C = entry->crc;
msg->fromIdHigh = entry->fromIdHigh;
msg->fromIdLow = entry->fromIdLow;
msg->date = entry->date;
msg->receivedDate = entry->receivedDate;
msg->unk_0x28 = entry->date;
msg->unk_0x2C = entry->receivedDate;
msg->numTo = entry->numTo;
msg->numAttached = entry->numAttached;
msg->groupId = entry->groupId;

View File

@@ -158,7 +158,7 @@ static inline NWC24Err WriteMessageIdField(NWC24MsgObjPrivate* msg) {
Mail_memset(buffer, 0, 1024);
Mail_strcpy(buffer, "Message-Id: <");
Mail_memset(idText, 0, 32);
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->date);
Mail_sprintf(idText, "%05X%08X%08X%08X", msg->msgId, (u32)(myId >> 32), (u32)myId, msg->unk_0x28);
Mail_strcat(buffer, idText);
Mail_strcat(buffer, domain);
Mail_strcat(buffer, ">\r\n");
@@ -312,7 +312,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
}
CHECK_WRITE(WriteExtraFields(msg));
Mail_memset(MultiPartDivider, 0, 40);
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->date, msg->msgId);
Mail_sprintf(MultiPartDivider, "Boundary-NWC24-%08X%05X", msg->unk_0x28, msg->msgId);
buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024);
Mail_strcpy(buffer, "MIME-Version: 1.0\r\n");
@@ -654,9 +654,9 @@ static NWC24Err WriteDateField(NWC24MsgObjPrivate* msg) {
date.sec = calendar.sec;
if (date.month > 12)
return NWC24_ERR_FORMAT;
NWC24iDateToMinutes(&msg->date, &date);
NWC24iDateToMinutes(&msg->unk_0x28, &date);
if (msg->type & 0x1000000)
NWC24iMinutesToDate(&date, msg->receivedDate);
NWC24iMinutesToDate(&date, msg->unk_0x2C);
buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024);
Mail_sprintf(buffer, "Date: %02d %s %d %02d:%02d:%02d -0000\r\n", date.day, months[date.month - 1], date.year, date.hour, date.min, date.sec);

View File

@@ -46,9 +46,9 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
return NWC24_ERR_INVALID_VALUE;
}
msgObj->date = 0;
msgObj->unk_0x28 = 0;
msgObj->type |= 0x200000;
msgObj->receivedDate = 0;
msgObj->unk_0x2C = 0;
NWC24GetMyUserId(&msgObj->fromId);
msgObj->numTo = 0;
@@ -477,7 +477,7 @@ NWC24Err NWC24GetMsgFromId(const NWC24MsgObj* msg, NWC24UserId* fromId) {
NWC24Err NWC24GetMsgDate(const NWC24MsgObj* msg, OSCalendarTime* msgDate) {
const NWC24MsgObjPrivate* msgObj = (const NWC24MsgObjPrivate*)msg;
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->date);
NWC24iMinutesToOSCalendarTime(msgDate, msgObj->unk_0x28);
return NWC24_OK;
}

View File

@@ -485,16 +485,16 @@ namespace ipl {
}
void BoardObject::stt_stand() {
f32 degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
f32 degrees = mStandData.mAngleIdx * 30.0f + 30.0f;
f32 cosF = nw4r::math::CosFIdx(degrees * 0.7111111f);
degrees = mStandData.unk_0x0C * 30.0f + 30.0f;
degrees = mStandData.mAngleIdx * 30.0f + 30.0f;
f32 sinF = nw4r::math::SinFIdx(degrees * 0.7111111f);
math::VEC2 standPos;
__ct__Q33ipl4math4VEC2Fff(&standPos, sinF * 160.0f, cosF * 160.0f);
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.unk_0x08)) + (standPos * mStandData.unk_0x08)) / 10.0f);
mBoardPos = (((mStandData.pos * (f32)(10 - mStandData.mStep)) + (standPos * mStandData.mStep)) / 10.0f);
if ((mStandData.unk_0x08 += 1) > 10) {
if ((mStandData.mStep += 1) > 10) {
mStandData.init();
mState = STATE_NORMAL;
}

View File

@@ -71,7 +71,7 @@ namespace ipl {
mSelectedFaceId = -1;
mpNigaoe = NULL;
mbClosing = false;
mbResetAcceptable = true;
unk_0x7D = true;
mNwc24ErrCountdown = 0;
mbToFriend = false;
@@ -385,7 +385,7 @@ namespace ipl {
snd::getSystem()->startSE("WIPL_SE_DECIDE");
mbResetAcceptable = false;
unk_0x7D = false;
// Copy letter contents
wmemcpy(mWCString, getMemoInputForm()->getSendString()->getWCString(), WC_STRING_LENGTH);
@@ -409,7 +409,7 @@ namespace ipl {
closeNWC24();
}
mbResetAcceptable = true;
unk_0x7D = true;
// Button animation
button->animation(Button::IDANIM_SELECT_CREATE_R);

View File

@@ -36,7 +36,7 @@ namespace ipl {
}
TextWriter::TextWriter(EGG::Heap* heap)
: FaderSceneBase(heap), mState(STATE_NORMAL), mSelectedFaceId(-1), mpNigaoe(NULL), mbClosing(false), mbResetAcceptable(true),
: FaderSceneBase(heap), mState(STATE_NORMAL), mSelectedFaceId(-1), mpNigaoe(NULL), mbClosing(false), unk_0x7D(true),
mNwc24ErrCountdown(0) {
setSceneParentFlags(SCN_PARENTFLAG_DRAW | SCN_PARENTFLAG_CALC);
}
@@ -87,7 +87,7 @@ namespace ipl {
mSelectedFaceId = -1;
mpNigaoe = NULL;
mbClosing = false;
mbResetAcceptable = true;
unk_0x7D = true;
mNwc24ErrCountdown = 0;
// Text balloon for Mii face
@@ -398,7 +398,7 @@ namespace ipl {
snd::getSystem()->startSE("WIPL_SE_DECIDE");
mbResetAcceptable = false;
unk_0x7D = false;
// Copy memo contents
wmemcpy(mWCString, getMemoInputForm()->getSendString()->getWCString(), WC_STRING_LENGTH);
@@ -412,7 +412,7 @@ namespace ipl {
closeNWC24();
mbResetAcceptable = true;
unk_0x7D = true;
// Receive sent memo
System::receiveImmediately();