Compare commits
24 Commits
matcher/up
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b25b1d5258 | ||
|
|
0e2c4bb16b | ||
|
|
c78488c5a0 | ||
|
|
a2ea065589 | ||
|
|
2ba011b662 | ||
|
|
50ea7b8a68 | ||
|
|
d2573092c2 | ||
|
|
ae8ffcf29d | ||
|
|
c69220a8ba | ||
|
|
35dca0a8a7 | ||
|
|
f338b7bfd0 | ||
|
|
dc7619b4ea | ||
|
|
bcb5af1c5d | ||
|
|
370264cd82 | ||
|
|
67e0218bcb | ||
|
|
14e19f18ba | ||
|
|
9a35669c9c | ||
|
|
ec3c0139fa | ||
|
|
3ec023f1e4 | ||
|
|
67df9c1b7c | ||
|
|
468c30f4ca | ||
|
|
2f0063ceec | ||
|
|
28d6126dbe | ||
|
|
f2471b3803 |
1
report.json
Normal file
1
report.json
Normal file
File diff suppressed because one or more lines are too long
@@ -333,9 +333,7 @@ namespace ipl {
|
||||
|
||||
nw4r::lyt::Pane* pane = mpLayout->FindPaneByName("N_note_a");
|
||||
for (int i = mNextPageNum; i >= 1; i--) {
|
||||
math::VEC2 trans;
|
||||
trans.y = sPageOffset.y * i;
|
||||
trans.x = sPageOffset.x * i;
|
||||
math::VEC2 trans = sPageOffset * i;
|
||||
pane->SetTranslate(trans);
|
||||
pane->CalculateMtx(*mpLayout->getDrawInfo());
|
||||
mpLayout->draw(pane);
|
||||
@@ -360,7 +358,7 @@ namespace ipl {
|
||||
|
||||
pane = mpLayout->FindPaneByName("N_note_d");
|
||||
for (int i = offset; i < mPrevPageNum + offset; i++) {
|
||||
math::VEC2 trans = sPageOffset * -i;
|
||||
nw4r::math::VEC2 trans = sPageOffset * -i;
|
||||
pane->SetTranslate(trans);
|
||||
pane->CalculateMtx(*mpLayout->getDrawInfo());
|
||||
mpLayout->draw(pane);
|
||||
@@ -371,7 +369,7 @@ namespace ipl {
|
||||
case STATE_LOOP_FORWARD:
|
||||
case STATE_LOOP_BACKWARD: {
|
||||
for (int i = 1; i < PAGE_MAX; i++) {
|
||||
math::VEC2 trans = sPageOffset * -i;
|
||||
nw4r::math::VEC2 trans = sPageOffset * -i;
|
||||
pane->SetTranslate(trans);
|
||||
pane->CalculateMtx(*mpLayout->getDrawInfo());
|
||||
mpLayout->draw(pane);
|
||||
@@ -379,7 +377,7 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
math::VEC2 trans = sPageOffset * -(mPrevPageNum + offset);
|
||||
nw4r::math::VEC2 trans = sPageOffset * -(mPrevPageNum + offset);
|
||||
pane->SetTranslate(trans);
|
||||
pane->CalculateMtx(*mpLayout->getDrawInfo());
|
||||
mpLayout->draw("N_note_e");
|
||||
@@ -1151,67 +1149,77 @@ namespace ipl {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mState != STATE_NORMAL || mMode != 0) {
|
||||
return;
|
||||
}
|
||||
switch (mState) {
|
||||
case STATE_NORMAL: {
|
||||
switch (mMode) {
|
||||
case 0: {
|
||||
if (!mpFriendCache->isThere(buttonNo + mPage * BTN_MAX)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mpFriendCache->isThere(buttonNo + mPage * BTN_MAX)) {
|
||||
return;
|
||||
}
|
||||
mDrag.mbDragging = true;
|
||||
mDrag.mChan = con->getChannel();
|
||||
|
||||
mDrag.mbDragging = true;
|
||||
mDrag.mChan = con->getChannel();
|
||||
if (con->isValidDpd()) {
|
||||
mDrag.mPos = System::getControllerManager()->getController(mDrag.mChan)->getDpdProjectionPos();
|
||||
} else {
|
||||
mDrag.mPos = nw4r::math::VEC2(0.0f, 0.0f);
|
||||
}
|
||||
|
||||
if (con->isValidDpd()) {
|
||||
mDrag.mPos = System::getControllerManager()->getController(mDrag.mChan)->getDpdProjectionPos();
|
||||
} else {
|
||||
mDrag.mPos = nw4r::math::VEC2(0.0f, 0.0f);
|
||||
}
|
||||
mDrag.mPage = mPage;
|
||||
mDrag.mButton = buttonNo;
|
||||
mDrag.mNextCount = -1;
|
||||
mDrag.mPrevCount = -1;
|
||||
mDrag.unk_0x1C = 0;
|
||||
|
||||
mDrag.mPage = mPage;
|
||||
mDrag.mButton = buttonNo;
|
||||
mDrag.mNextCount = -1;
|
||||
mDrag.mPrevCount = -1;
|
||||
mDrag.unk_0x1C = 0;
|
||||
System::getPointer()->changeType(con->getChannel(), 1);
|
||||
static_cast<Button*>(System::getScene(SCENE_BUTTON))->disableBtn();
|
||||
|
||||
System::getPointer()->changeType(con->getChannel(), 1);
|
||||
static_cast<Button*>(System::getScene(SCENE_BUTTON))->disableBtn();
|
||||
wchar_t blank[2] = {0, 0};
|
||||
static_cast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName(sTextNameB[mDrag.mButton]))->SetString(blank, 0);
|
||||
|
||||
wchar_t blank[2] = {0, 0};
|
||||
static_cast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName(sTextNameB[mDrag.mButton]))->SetString(blank, 0);
|
||||
nigaoe::Object* nigaoe = mMiiObj[buttonNo].mpNigaoe;
|
||||
if (nigaoe != NULL) {
|
||||
nw4r::lyt::Pane* miiPane = mpLayout->FindPaneByName("mii_move");
|
||||
miiPane->SetVisible(true);
|
||||
|
||||
nigaoe::Object* nigaoe = mMiiObj[buttonNo].mpNigaoe;
|
||||
if (nigaoe != NULL) {
|
||||
nw4r::lyt::Pane* miiPane = mpLayout->FindPaneByName("mii_move");
|
||||
miiPane->SetVisible(true);
|
||||
mDragTexObj = nigaoe->getIconTexture();
|
||||
memcpy(mpWork, nigaoe->getIconImage(), 0x2D20);
|
||||
GXInitTexObj(&mDragTexObj, mpWork, 76, 76, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
miiPane->GetMaterial()->SetTexture(GX_TEXMAP0, mDragTexObj);
|
||||
|
||||
mDragTexObj = nigaoe->getIconTexture();
|
||||
memcpy(mpWork, nigaoe->getIconImage(), 0x2D20);
|
||||
GXInitTexObj(&mDragTexObj, mpWork, 76, 76, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
miiPane->GetMaterial()->SetTexture(GX_TEXMAP0, mDragTexObj);
|
||||
mMiiObj[buttonNo].reset();
|
||||
} else {
|
||||
mpLayout->FindPaneByName("mii_move")->SetVisible(false);
|
||||
}
|
||||
|
||||
mMiiObj[buttonNo].reset();
|
||||
} else {
|
||||
mpLayout->FindPaneByName("mii_move")->SetVisible(false);
|
||||
}
|
||||
mpGui->init();
|
||||
|
||||
mpGui->init();
|
||||
for (int i = 0; i < BTN_MAX; i++) {
|
||||
mPointCount[i] = 0;
|
||||
|
||||
for (int i = 0; i < BTN_MAX; i++) {
|
||||
mPointCount[i] = 0;
|
||||
if (mbFaceValid[i]) {
|
||||
mpLayout->getAnim(i + 6)->initAnmFrame();
|
||||
} else {
|
||||
mpLayout->getAnim(i + 21)->initAnmFrame();
|
||||
}
|
||||
}
|
||||
|
||||
if (mbFaceValid[i]) {
|
||||
mpLayout->getAnim(i + 6)->initAnmFrame();
|
||||
} else {
|
||||
mpLayout->getAnim(i + 21)->initAnmFrame();
|
||||
movePane_onDrag();
|
||||
|
||||
snd::getSystem()->startSEwithPos("WIPL_SE_CH_HOLD", mDrag.mPos.x);
|
||||
|
||||
mState = STATE_DRAG;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
movePane_onDrag();
|
||||
|
||||
snd::getSystem()->startSEwithPos("WIPL_SE_CH_HOLD", mDrag.mPos.x);
|
||||
|
||||
mState = STATE_DRAG;
|
||||
}
|
||||
|
||||
void Address::start_drag_point_event(const char* paneName, controller::Interface* con) {
|
||||
@@ -1580,7 +1588,7 @@ namespace ipl {
|
||||
void Address::set_err_msg(wchar_t* errMsg, u32 errMsgLen, NWC24Err err) {
|
||||
memset(errMsg, 0, errMsgLen * sizeof(wchar_t));
|
||||
wcsncat(errMsg, System::getMessage(MESG_ERROR_CODE), errMsgLen - wcslen(errMsg));
|
||||
u32 msgId = MESG_ERROR_CODE;
|
||||
u32 msgId;
|
||||
|
||||
wchar_t errCode[32];
|
||||
memset(errCode, 0, sizeof(errCode));
|
||||
@@ -1749,7 +1757,7 @@ namespace ipl {
|
||||
width += textBox->GetFont()->GetCharWidth(*name);
|
||||
}
|
||||
}
|
||||
width += 0.01f;
|
||||
width = 0.01f + width;
|
||||
|
||||
nw4r::ut::Rect rect;
|
||||
nw4r::ut::Rect rect4x3;
|
||||
@@ -1906,8 +1914,8 @@ namespace ipl {
|
||||
NWC24FriendInfo* info = &mInfos[index];
|
||||
info->attr.fdId = fdId;
|
||||
memset(info->attr.name, 0, sizeof(info->attr.name));
|
||||
wcsncpy((wchar_t*)info->attr.name, name, 10);
|
||||
System::getNwc24Manager()->updateFriendInfo(info, index);
|
||||
wcsncpy((wchar_t*)mInfos[index].attr.name, name, 10);
|
||||
System::getNwc24Manager()->updateFriendInfo(&mInfos[index], index);
|
||||
}
|
||||
|
||||
void FriendListCache::del(u32 index) {
|
||||
|
||||
@@ -131,8 +131,8 @@ void ipl::scene::AddressEdit::reset_gui() {
|
||||
ipl::layout::Animator* animator = mpCodeLayout->getAnim(i + 0xb);
|
||||
animator->initFrame();
|
||||
animator->restart();
|
||||
mPointCount[i] = 0;
|
||||
}
|
||||
mPointCount[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,11 @@ void ipl::scene::AddressEdit::reset_gui() {
|
||||
extern "C" void* __nw__FUl(u32);
|
||||
extern "C" BOOL RFLSearchOfficialData(const RFLCreateID*, u16*);
|
||||
|
||||
extern "C" NWC24FriendInfo sFriendInfo__Q23ipl5scene;
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
NWC24FriendInfo sFriendInfo;
|
||||
}
|
||||
}
|
||||
extern "C" const char* smButtonName__Q33ipl5scene6Button[];
|
||||
|
||||
|
||||
@@ -318,24 +322,6 @@ void ipl::scene::AddressEdit::String::clear() {
|
||||
mbHasWiiNo = false;
|
||||
}
|
||||
|
||||
void ipl::scene::AddressEdit::String::setEMail(const wchar_t* value) {
|
||||
mbHasWiiNo = false;
|
||||
memset(mValue, 0, sizeof(mValue));
|
||||
wcsncpy(mValue, value, 0xff);
|
||||
u32 length = wcslen(value);
|
||||
memset(mDisplayText, 0, sizeof(mDisplayText));
|
||||
if (length > 0x10) {
|
||||
wcsncpy(mDisplayText, value, 0xe);
|
||||
wcscpy(mDisplayText + 0xe, L"...");
|
||||
} else {
|
||||
wcscpy(mDisplayText, value);
|
||||
}
|
||||
u8 address[0x100];
|
||||
memset(address, 0, sizeof(address));
|
||||
ipl::utility::CharacterCode::UTF16ToANSI(address, value, sizeof(address));
|
||||
mbValidMail = !NWC24CheckPublicMailAddr_(reinterpret_cast<const char*>(address));
|
||||
}
|
||||
|
||||
void ipl::scene::AddressEdit::String::setWiiNo(const wchar_t* value) {
|
||||
mbHasWiiNo = true;
|
||||
memset(mValue, 0, sizeof(mValue));
|
||||
@@ -500,7 +486,7 @@ void ipl::scene::AddressEdit::create() {
|
||||
->getAnim(0)->initAnmFrame();
|
||||
|
||||
mString.clear();
|
||||
memset(&sFriendInfo__Q23ipl5scene, 0, sizeof(sFriendInfo__Q23ipl5scene));
|
||||
memset(&sFriendInfo, 0, sizeof(sFriendInfo));
|
||||
mpNigaoe = 0;
|
||||
mNigaoeState = 0;
|
||||
ipl::scene::SceneObj* addressScene = ipl::System::getScene(0x14);
|
||||
@@ -593,15 +579,29 @@ create_mode_done:
|
||||
ipl::System::getKeyboard()->init();
|
||||
|
||||
ipl::scene::TextBalloon* balloon = reinterpret_cast<ipl::scene::TextBalloon*>(__nw__FUl(0x3c));
|
||||
if (balloon != NULL) {
|
||||
f32 balloonWidth = 30.0f;
|
||||
f32 balloonHeight = 120.0f;
|
||||
EGG::Heap* heap = getHeap();
|
||||
ipl::math::VEC3 position(0.0f, 0.0f, 0.0f);
|
||||
balloon = new (balloon) ipl::scene::TextBalloon(heap, mpBalloonFile, "arc", "my_IplTopBalloon_a.brlyt", position, balloonHeight, balloonWidth);
|
||||
}
|
||||
f32 balloonWidth = 30.0f;
|
||||
f32 balloonHeight = 120.0f;
|
||||
balloon = new (balloon) ipl::scene::TextBalloon(getHeap(), mpBalloonFile, "arc", "my_IplTopBalloon_a.brlyt", ipl::math::VEC3(0.0f, 0.0f, 0.0f), balloonHeight, balloonWidth);
|
||||
mpBalloon = balloon;
|
||||
}
|
||||
void ipl::scene::AddressEdit::String::setEMail(const wchar_t* value) {
|
||||
mbHasWiiNo = false;
|
||||
memset(mValue, 0, sizeof(mValue));
|
||||
wcsncpy(mValue, value, 0xff);
|
||||
u32 length = wcslen(value);
|
||||
memset(mDisplayText, 0, sizeof(mDisplayText));
|
||||
if (length > 0x10) {
|
||||
wcsncpy(mDisplayText, value, 0xe);
|
||||
wcscpy(mDisplayText + 0xe, L"...");
|
||||
} else {
|
||||
wcscpy(mDisplayText, value);
|
||||
}
|
||||
u8 address[0x100];
|
||||
memset(address, 0, sizeof(address));
|
||||
ipl::utility::CharacterCode::UTF16ToANSI(address, value, sizeof(address));
|
||||
mbValidMail = !NWC24CheckPublicMailAddr_(reinterpret_cast<const char*>(address));
|
||||
}
|
||||
|
||||
|
||||
void ipl::scene::AddressEdit::stt_wait_decide_anm() {
|
||||
bool complete = true;
|
||||
@@ -889,14 +889,13 @@ void ipl::scene::AddressEdit::stt_add_mii_normal() {
|
||||
void ipl::scene::AddressEdit::stt_add_mii_input() {
|
||||
ipl::scene::Base* child = getChild();
|
||||
if (child != NULL) {
|
||||
ipl::scene::FaceSelect* faceSelect = static_cast<ipl::scene::FaceSelect*>(child);
|
||||
s32 faceId = faceSelect->getSelectedFaceId();
|
||||
s32 faceId = static_cast<ipl::scene::FaceSelect*>(getChild())->getSelectedFaceId();
|
||||
if (faceId >= 0 && ipl::System::getMiiManager()->isAvalable(faceId) &&
|
||||
mNigaoeState == 0) {
|
||||
RFLAdditionalInfo additionalInfo;
|
||||
RFLGetAdditionalInfo(&additionalInfo, RFLDataSource_Official, NULL, faceId);
|
||||
if (!RFLiIsSameID(&mCreateID, &additionalInfo.createID)) {
|
||||
mCreateID = additionalInfo.createID;
|
||||
memcpy(&mCreateID, &additionalInfo.createID, sizeof(RFLCreateID));
|
||||
ipl::System::getMiiManager()->create(ipl::System::getMem2App(), 0x4c, 0x4c, faceId,
|
||||
ipl::scene::AddressEdit::nigaoe_create_callback_add,
|
||||
this);
|
||||
@@ -2222,82 +2221,57 @@ void ipl::scene::AddressEdit::start_left_event(
|
||||
const char* paneName) {
|
||||
int buttonNo = get_button_no(paneName);
|
||||
switch (mState) {
|
||||
case 0x22:
|
||||
goto state22;
|
||||
case 0:
|
||||
switch (buttonNo) {
|
||||
case 3:
|
||||
goto state0Button3;
|
||||
case 0:
|
||||
goto state0Friend;
|
||||
case 0: {
|
||||
u32 friendType = mpFriendCache->getInfo(mSelectedFriend).attr.status;
|
||||
if (friendType != 2) {
|
||||
break;
|
||||
}
|
||||
if (mPointCount[buttonNo] == 1) {
|
||||
ipl::layout::Animator* pane = mpCodeLayout->getAnim(buttonNo + 0xb);
|
||||
pane->initFrame();
|
||||
pane->restart();
|
||||
}
|
||||
if (mPointCount[buttonNo] > 0) {
|
||||
--mPointCount[buttonNo];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 2:
|
||||
goto state0Common;
|
||||
goto common;
|
||||
case 3:
|
||||
if (mPointCount[buttonNo] == 1) {
|
||||
mpBalloon->fadeoutForce();
|
||||
}
|
||||
common:
|
||||
if (mPointCount[buttonNo] == 1) {
|
||||
ipl::layout::Animator* pane = mpCodeLayout->getAnim(buttonNo + 0xb);
|
||||
pane->initFrame();
|
||||
pane->restart();
|
||||
}
|
||||
if (mPointCount[buttonNo] > 0) {
|
||||
--mPointCount[buttonNo];
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x22:
|
||||
switch (buttonNo) {
|
||||
case 3:
|
||||
if (mPointCount[buttonNo] == 1) {
|
||||
mpBalloon->fadeoutForce();
|
||||
}
|
||||
--mPointCount[buttonNo];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
goto done;
|
||||
|
||||
state0Friend: {
|
||||
u32 friendIndex = mSelectedFriend;
|
||||
u32 friendType = mpFriendCache->getInfo(friendIndex).attr.status;
|
||||
if (friendType != 2) {
|
||||
goto done;
|
||||
}
|
||||
s32* count = &mPointCount[buttonNo];
|
||||
if (*count == 1) {
|
||||
ipl::layout::Object* layout = mpCodeLayout;
|
||||
ipl::layout::Animator* pane = layout->getAnim(buttonNo + 0xb);
|
||||
pane->initFrame();
|
||||
pane->restart();
|
||||
}
|
||||
if (*count > 0) {
|
||||
--*count;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
state0Button3: {
|
||||
s32* count = &mPointCount[buttonNo];
|
||||
if (*count == 1) {
|
||||
(mpBalloon)->fadeoutForce();
|
||||
}
|
||||
--*count;
|
||||
goto done;
|
||||
}
|
||||
|
||||
state0Common: {
|
||||
s32* count = &mPointCount[buttonNo];
|
||||
if (*count == 1) {
|
||||
ipl::layout::Object* layout = mpCodeLayout;
|
||||
ipl::layout::Animator* pane = layout->getAnim(buttonNo + 0xb);
|
||||
pane->initFrame();
|
||||
pane->restart();
|
||||
}
|
||||
if (*count > 0) {
|
||||
--*count;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
state22:
|
||||
if (buttonNo != 3) {
|
||||
goto done;
|
||||
}
|
||||
{
|
||||
s32* count = &mPointCount[buttonNo];
|
||||
if (*count == 1) {
|
||||
(mpBalloon)->fadeoutForce();
|
||||
}
|
||||
--*count;
|
||||
}
|
||||
|
||||
done:
|
||||
return;
|
||||
done:;
|
||||
}
|
||||
|
||||
void ipl::scene::AddressEdit::start_trig_event(
|
||||
@@ -2392,7 +2366,8 @@ void ipl::scene::AddressEdit::start_ipt_trig_event(
|
||||
if (controller->getChannel() != channel) {
|
||||
return;
|
||||
}
|
||||
if (!strcmp(sInputPaneName, paneName)) {
|
||||
bool isInputPane = strcmp(sInputPaneName, paneName) == 0;
|
||||
if (isInputPane) {
|
||||
s32 state = mState;
|
||||
switch (state) {
|
||||
case 0xd: {
|
||||
@@ -2410,8 +2385,8 @@ void ipl::scene::AddressEdit::start_ipt_trig_event(
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(true);
|
||||
setting.type = static_cast<ipl::keyboard::Manager::KeyboardType>(0xd);
|
||||
ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2464,8 +2439,8 @@ void ipl::scene::AddressEdit::start_ipt_trig_event(
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(true);
|
||||
setting.type = static_cast<ipl::keyboard::Manager::KeyboardType>(0xd);
|
||||
ipl::System::getKeyboard()->baseMgr()->enableKSXFilter(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2478,7 +2453,6 @@ void ipl::scene::AddressEdit::start_ipt_trig_event(
|
||||
} else {
|
||||
button->reserveAnm(0xc);
|
||||
}
|
||||
button->reserveText(1, 0x2e);
|
||||
ipl::snd::getSystem()->startSE("WIPL_SE_DECIDE");
|
||||
mState = 0x1a;
|
||||
break;
|
||||
@@ -2805,7 +2779,7 @@ void ipl::scene::AddressEdit::set_err_msg(wchar_t* outErrMsg, u32 outErrMsgLen,
|
||||
swprintf(nwc24ErrStr, sizeof(nwc24ErrStr) / sizeof(wchar_t), L"%06d\n", errorCode);
|
||||
wcsncat(outErrMsg, nwc24ErrStr, outErrMsgLen - wcslen(outErrMsg));
|
||||
|
||||
u32 messageId = MESG_ERROR_NWC24_SERVER;
|
||||
u32 messageId;
|
||||
switch (nwc24Err) {
|
||||
case NWC24_ERR_NETWORK:
|
||||
messageId = MESG_ERROR_NWC24_NETWORK;
|
||||
@@ -2888,9 +2862,9 @@ void ipl::scene::AddressEdit::add_friendinfo() {
|
||||
}
|
||||
|
||||
void ipl::scene::AddressEdit::get_friendinfo() {
|
||||
memcpy(&sFriendInfo__Q23ipl5scene, &mpFriendCache->getInfo(mSelectedFriend),
|
||||
sizeof(sFriendInfo__Q23ipl5scene));
|
||||
mString.setName(reinterpret_cast<const wchar_t*>(sFriendInfo__Q23ipl5scene.attr.name));
|
||||
memcpy(&sFriendInfo, &mpFriendCache->getInfo(mSelectedFriend),
|
||||
sizeof(sFriendInfo));
|
||||
mString.setName(reinterpret_cast<const wchar_t*>(sFriendInfo.attr.name));
|
||||
const wchar_t* name = mString.mName;
|
||||
nw4r::lyt::Pane* namePane =
|
||||
mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_name_00", true);
|
||||
@@ -2898,29 +2872,29 @@ void ipl::scene::AddressEdit::get_friendinfo() {
|
||||
|
||||
wchar_t wiiNo[0x100];
|
||||
wchar_t email[0x102];
|
||||
if (sFriendInfo__Q23ipl5scene.attr.type == 1) {
|
||||
if (sFriendInfo.attr.type == 1) {
|
||||
memset(wiiNo, 0, sizeof(wiiNo));
|
||||
ipl::scene::AddressEdit::wiiid_utf16(sFriendInfo__Q23ipl5scene.addr.wiiId, wiiNo);
|
||||
ipl::scene::AddressEdit::wiiid_utf16(sFriendInfo.addr.wiiId, wiiNo);
|
||||
mString.setWiiNo(wiiNo);
|
||||
} else {
|
||||
memset(email, 0, sizeof(email));
|
||||
ipl::utility::CharacterCode::ANSIToUTF16(email, reinterpret_cast<const u8*>(&sFriendInfo__Q23ipl5scene.addr), 0x102);
|
||||
ipl::utility::CharacterCode::ANSIToUTF16(email, reinterpret_cast<const u8*>(&sFriendInfo.addr), 0x102);
|
||||
mString.setEMail(email);
|
||||
}
|
||||
const wchar_t* displayText = mString.mDisplayText;
|
||||
nw4r::lyt::Pane* friendCodePane =
|
||||
mpCodeLayout->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true);
|
||||
set_textbox(friendCodePane, displayText);
|
||||
memcpy(&mCreateID, &sFriendInfo__Q23ipl5scene.attr.fdId, sizeof(mCreateID));
|
||||
memcpy(&mCreateID, &sFriendInfo.attr.fdId, sizeof(mCreateID));
|
||||
}
|
||||
|
||||
void ipl::scene::AddressEdit::update_friendinfo() {
|
||||
memset(sFriendInfo__Q23ipl5scene.attr.name, 0, 0x18);
|
||||
wcsncpy(reinterpret_cast<wchar_t*>(sFriendInfo__Q23ipl5scene.attr.name), mString.mName, 0xa);
|
||||
memcpy(&sFriendInfo__Q23ipl5scene.attr.fdId, &mCreateID, sizeof(mCreateID));
|
||||
memset(sFriendInfo.attr.name, 0, 0x18);
|
||||
wcsncpy(reinterpret_cast<wchar_t*>(sFriendInfo.attr.name), mString.mName, 0xa);
|
||||
memcpy(&sFriendInfo.attr.fdId, &mCreateID, sizeof(mCreateID));
|
||||
mpFriendCache->update(
|
||||
mSelectedFriend,
|
||||
reinterpret_cast<const wchar_t*>(sFriendInfo__Q23ipl5scene.attr.name),
|
||||
sFriendInfo__Q23ipl5scene.attr.fdId);
|
||||
reinterpret_cast<const wchar_t*>(sFriendInfo.attr.name),
|
||||
sFriendInfo.attr.fdId);
|
||||
static_cast<ipl::scene::Address*>(ipl::System::getScene(0x14))->reset_friend();
|
||||
}
|
||||
|
||||
70
tools/decomp-assist/ctxdiff2.py
Normal file
70
tools/decomp-assist/ctxdiff2.py
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Standalone ctxdiff replacement using dtk elf disasm.
|
||||
|
||||
Usage: ctxdiff2.py <unit> <symbol>
|
||||
unit: path relative to src/ and obj/ dirs (e.g. src/scene/channelSelect/iplChannelSelect)
|
||||
symbol: mangled name
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import difflib
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
DTK = 'build/tools/dtk'
|
||||
MINE = 'build/43U/src/%s.o'
|
||||
BASE = 'build/43U/obj/%s.o'
|
||||
|
||||
|
||||
def disasm_fn(path, name, tmp):
|
||||
out = os.path.join(tmp, 'out.s')
|
||||
subprocess.run([DTK, 'elf', 'disasm', path, out], check=True,
|
||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
lines = []
|
||||
inside = False
|
||||
for line in open(out, errors='replace'):
|
||||
line = line.rstrip('\n')
|
||||
if line.startswith('.fn ' + name):
|
||||
inside = True
|
||||
continue
|
||||
if inside and line.startswith('.endfn ' + name):
|
||||
break
|
||||
if inside:
|
||||
lines.append(line)
|
||||
return lines
|
||||
|
||||
|
||||
def norm(line):
|
||||
# keep only instruction part: strip leading comment/addr bytes
|
||||
m = re.search(r'\*/\s*(.*)$', line)
|
||||
if m:
|
||||
ins = m.group(1).strip()
|
||||
else:
|
||||
ins = line.strip()
|
||||
return ins
|
||||
|
||||
|
||||
def main():
|
||||
unit, name = sys.argv[1], sys.argv[2]
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
a = disasm_fn(MINE % unit, name, os.path.join(tmp, 'a'))
|
||||
b = disasm_fn(BASE % unit, name, os.path.join(tmp, 'b'))
|
||||
print(f"src insns {len(a)} base insns {len(b)}")
|
||||
sm = difflib.SequenceMatcher(None, [norm(x) for x in a], [norm(x) for x in b], autojunk=False)
|
||||
ndiff = 0
|
||||
for tag, i1, i2, j1, j2 in sm.get_opcodes():
|
||||
if tag == 'equal':
|
||||
continue
|
||||
ndiff += 1
|
||||
print(f"--- {tag} mine {i1}:{i2} base {j1}:{j2}")
|
||||
for k in range(i1, i2):
|
||||
print(f" M {k:>4} {a[k]}")
|
||||
for k in range(j1, j2):
|
||||
print(f" B {k:>4} {b[k]}")
|
||||
if ndiff == 0:
|
||||
print('diffs 0')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user