Compare commits

...

13 Commits

Author SHA1 Message Date
coah
96d9867915 continue odh matching 2026-09-28 20:39:41 +00:00
coah
e648cfd25b name odh codec variables 2026-09-28 20:39:41 +00:00
coah
d387e2b42c continue odh matching 2026-09-28 20:39:41 +00:00
coah
e65e9d06cd wip: salvage uncommitted luna worktree state 2026-09-28 20:39:41 +00:00
coah
1f3dbb0ff0 improve address matching (#235) 2026-09-28 15:35:07 -05:00
coah
041460fc6b convert channel select asm bodies (#234) 2026-09-28 15:04:52 -05:00
coah
287f88ae75 Decompile iplAddress to 86/101 functions, drop its inline asm (#233)
* wip: salvage uncommitted luna worktree state

* continue address scene decompilation

* match address page advance

* match address page rewind

* match address friend cache types

* match address error message codegen
2026-09-28 14:56:13 -05:00
coah
c3e50612b2 Revert padding/asm-hack links from #225, #229, #230 (#232)
* Revert "Link iplChannelSelect + fix channelTitle pad interaction (clean subset) (#230)"

This reverts commit 27844c37b3.

* Revert "Link iplBoard + iplBoardObject as matching (#229)"

This reverts commit abf047bc3b.

* Revert "Link iplChannelTitle, iplController, iplSaveDataManager, eggAudioExpMgr (#225)"

This reverts commit 52977bb782.
2026-09-28 14:15:36 -05:00
coah
99d70b31f7 fix: run ctxdiff.py against the current checkout (#231)
It chdir'd into /home/cole/projects/tests/wii-ipl, so worktrees diffed
another tree's objects.
2026-09-28 14:10:00 -05:00
devin-ai-integration[bot]
27844c37b3 Link iplChannelSelect + fix channelTitle pad interaction (clean subset) (#230)
* Link iplChannelSelect as matching

Co-Authored-By: wch <usernamecole7@gmail.com>

* Fix DOL link: trim iplChannelTitle .data pad shim to original size

The padNN zero-fill shim overshot the original object's .data tail
(0x96c vs 0x950) by 7 f32 entries. The extra 0x1c + alignment pushed
.sdata2/.sdata bases +0x20, shifting the entire downstream layout and
breaking the byte-identical DOL hash on current main (0ed25ee...).

Removing pad46-pad52 restores .data to 0x950 and the full build verifies:
build/43U/main.dol sha1 26116613f624061ba99c8d1a299aaa6efa85670d.

Co-Authored-By: wch <usernamecole7@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: wch <usernamecole7@gmail.com>
2026-09-28 18:26:25 +00:00
devin-ai-integration[bot]
abf047bc3b Link iplBoard + iplBoardObject as matching (#229)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: wch <usernamecole7@gmail.com>
2026-09-28 15:03:56 +00:00
devin-ai-integration[bot]
52977bb782 Link iplChannelTitle, iplController, iplSaveDataManager, eggAudioExpMgr (#225)
Flip the four units to Matching. eggAudioExpMgr uses an
EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS guard (external decls for the
header-inline virtuals and AutoLock) plus an unused inline Sample
subclass so the @52@ adjustor thunks emit in the original order.
Full ninja build passes with build/43U/main.dol: OK.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: wch <usernamecole7@gmail.com>
2026-09-28 15:02:26 +00:00
coah
b1fd404137 Improve iplBoard and iplChannelSelect matching (#223)
* feat: improve iplBoard matching

Restructure calc, stt_wait_fadeaway and edge_arrow with early returns
and split conditions, iterate hovered objects with an explicit next
pointer, and add the VEC3 add helper used by calc_board_object. 93/94
functions now match; appendRecord still differs because the original
keeps the interrupt state on the stack.

Ported from agent/continue0923/src_scene_board_iplboard without its
string-pool and volatile workarounds.

* feat: improve iplChannelSelect matching

Build the constructor with an initializer list, specialize
HermiteIntp<VEC3>::get and HermiteIntp<f32>::get in the forms this unit
inlines, keep only the three zoom frames setChanZoomOrtho reads, compute
the drag delta as a VEC2 with an explicit zero-speed branch, and give
setChannelScissor its ortho bounds as named locals. 101/102 functions
now match.

Ported from agent/continue0923/src_scene_channelselect_iplchannelselect
without its IPL_CHANNEL_TITLE_NOVTABLE define, hand-placed lbl_ data,
volatile constant loads or register keywords.
2026-09-28 00:09:53 -05:00
10 changed files with 4743 additions and 1567 deletions

View File

@@ -1,44 +1,274 @@
#ifndef IPL_SCENE_ADDRESS_H
#define IPL_SCENE_ADDRESS_H
#include "iplSceneHeader.h"
#include "iplSceneUIHeader.h"
#include "scene/button/iplButton.h"
#include <revolution/nwc24.h>
namespace ipl {
namespace nigaoe {
class Object;
}
namespace scene {
class AddressEvent;
class FriendListCache {
public:
enum {
FRIEND_MAX = 100,
};
FriendListCache() : mbOpened(false) {}
BOOL init();
void fin();
void add(u32 index, const NWC24FriendInfo& info);
void update(u32 index, const wchar_t* name, u64 fdId);
void del(u32 index);
void swap(u32 index1, u32 index2);
BOOL isValidId(const NWC24UserId& userId);
BOOL isDupId(const NWC24UserId& userId);
BOOL isDupMail(const char* mailAddr);
void sendRegisterMail(u32 index);
s32 check();
s32 getErrCode() const;
const NWC24FriendInfo& getInfo(int index) const { return mInfos[index]; }
BOOL isThere(u32 index) const { return mbThere[index]; }
u32 getRegFriendNum() const { return mRegFriendNum; }
NWC24UserId getMyUserId() const { return mMyUserId; }
s32 getLastErr() const { return mErrCode; }
private:
NWC24FriendInfo mInfos[100];
NWC24FriendInfo mInfos[FRIEND_MAX]; // 0x0000
u8 mbThere[FRIEND_MAX]; // 0x7D00
NWC24UserId mMyUserId; // 0x7D68
u32 mRegFriendNum; // 0x7D70
u8 mSendWork[0x2000]; // 0x7D74
s32 mErrCode; // 0x9D74
bool mbOpened; // 0x9D78
};
FADER_SCENE_CLASS(Address) {
FADER_SCENE_CLASS(Address), public ButtonEventHandlerBase {
public:
Address(EGG::Heap * heap, int);
virtual void destroy() override;
Address(EGG::Heap * heap, int mode);
virtual ~Address();
virtual void prepare();
virtual void create();
virtual void draw();
virtual void destroy();
virtual FaderSceneCommand calcFadein();
virtual void initCalcNormal();
virtual FaderSceneCommand calcNormal();
virtual void initCalcFadeout();
virtual FaderSceneCommand calcFadeout();
virtual void calcCommonAfter();
virtual void onEventDerived(u32 compId, u32 event, const controller::Interface* con);
enum {
SCENE_ADD_WII = 1,
SCENE_ADD_EMAIL,
};
enum {
BTN_MAX = 5,
BTN_SPACE_MAX = BTN_MAX - 1,
PAGE_MAX = 20,
};
int getChosenFriendIndex() {
return unk_0xC0;
return mChosenFriend;
}
FriendListCache* getFriendCache() {
return unk_0x274;
return mpFriendCache;
}
private:
u8 unk_0x58[0x68];
int unk_0xC0;
u8 unk_0xC4[0x1B0];
FriendListCache* unk_0x274;
u8 unk_0x278[0x28];
enum {
FADEIN_STATE_WAIT_OPEN = 0,
FADEIN_STATE_FADEIN,
FADEIN_STATE_DONE,
};
enum {
STATE_INIT = 0,
STATE_COVER_NORMAL,
STATE_COVER_FORWARD,
STATE_COVER_BACKWARD,
STATE_NORMAL,
STATE_FORWARD,
STATE_BACKWARD,
STATE_LOOP_FORWARD,
STATE_LOOP_BACKWARD,
STATE_DECIDE,
STATE_DRAG,
STATE_RELEASE,
STATE_WAIT_CHILD_CST,
STATE_WAIT_CHILD_DST,
STATE_WAIT_CHILD_FADEOUT,
STATE_MSG_NET,
STATE_WAIT_PARENTAL,
STATE_WAIT_PARENTAL_DST,
STATE_MSG_WC,
STATE_WAIT_PARENTAL_WC,
STATE_WAIT_PARENTAL_DST_WC,
STATE_MSG_NWC24_ERROR,
STATE_MSG_FI_FULL,
STATE_MSG_PARENTAL,
STATE_MSG_OPEN_FAILURE,
STATE_WAIT_DIALOG,
STATE_DONE,
};
class MiiObj {
public:
MiiObj();
~MiiObj();
void init(nw4r::lyt::Pane* pane);
void set(u64 fdId);
void reset();
static void create_callback(nigaoe::Object* object, void* work);
GXTexObj mTexObj; // 0x00
nigaoe::Object* mpNigaoe; // 0x20
nw4r::lyt::Material* mpMaterial; // 0x24
};
struct DragInfo {
nw4r::math::VEC2 mPos; // 0x00
int mChan; // 0x08
int mPage; // 0x0C
int mButton; // 0x10
int mNextCount; // 0x14
int mPrevCount; // 0x18
int unk_0x1C; // 0x1C
bool mbDragging; // 0x20
};
void fistt_wait_open();
void fistt_fadein();
void onInitFriendList();
void stt_cover_normal();
void stt_cover_forward();
void stt_cover_backward();
void stt_normal();
void stt_forward();
void stt_backward();
void stt_loop_forward();
void stt_loop_backward();
void stt_decide();
void stt_drag();
void stt_release();
void stt_wait_child_cst();
void stt_wait_child_dst();
void stt_wait_child_fadeout();
void stt_msg_net();
void stt_wait_parental();
void stt_wait_parental_dst();
void stt_msg_wc();
void stt_wait_parental_wc();
void stt_wait_parental_dst_wc();
void stt_msg_nwc24_error();
void stt_msg_fi_full();
void stt_msg_parental();
void stt_msg_open_failure();
void stt_wait_dialog();
void add_translate(nw4r::lyt::Pane* pane, const math::VEC2& offset);
void set_friend(const char* paneName, u32 friendNo, u32 buttonNo, MiiObj& miiObj, bool bDrag);
void set_page_text(const char* paneName, int page);
void set_textbox(const char* paneName, const wchar_t* text);
void set_textbox(const char* paneName, u32 msgId);
void reset_friend();
void start_point_event(const char* paneName, controller::Interface* con);
void start_left_event(const char* paneName);
void start_trig_event(const char* paneName);
void start_drag_event(const char* paneName, const controller::Interface* con);
void start_drag_point_event(const char* paneName, controller::Interface* con);
void start_drag_left_event(const char* paneName);
void start_release_event(const char* paneName);
void on_point_event(int buttonNo, controller::Interface* con);
void left_point_event(int buttonNo);
int get_button_no(const char* paneName);
int get_button_space_no(const char* paneName);
void reset_gui(bool bKeepPointed);
BOOL is_selectable(u32 friendNo);
void onNextPage();
void onPreviousPage();
void set_err_msg(wchar_t* errMsg, u32 errMsgLen, NWC24Err err);
void entry_friend();
bool isReleasableArea(int page, int buttonNo);
void changePage_onDrag();
void movePane_onDrag();
DragInfo mDrag; // 0x64
int mMode; // 0x88
layout::Object* mpLayout; // 0x8C
int unk_0x90; // 0x90
AddressEvent* mpEvent; // 0x94
gui::PaneManager* mpGui; // 0x98
layout::Object* mpBackLayout; // 0x9C
layout::Object* mpDialogLayout; // 0xA0
int mFadeinState; // 0xA4
int mWaitOpenCount; // 0xA8
int mState; // 0xAC
int mPage; // 0xB0
int mNextPageNum; // 0xB4
int mPrevPageNum; // 0xB8
int mSelectedButton; // 0xBC
u32 mChosenFriend; // 0xC0
bool mbFaceValid[BTN_MAX]; // 0xC4
int mPointCount[BTN_MAX]; // 0xCC
bool mbParentalOK; // 0xE0
bool mbCover; // 0xE1
MiiObj mMiiObj[BTN_MAX]; // 0xE4
MiiObj mNextMiiObj[BTN_MAX]; // 0x1AC
FriendListCache* mpFriendCache; // 0x274
GXTexObj mDragTexObj; // 0x278
u8* mpWork; // 0x298
f32 mDragOffsetX; // 0x29C
static const math::VEC2 smcPageOffset;
friend class AddressEvent;
};
class AddressEvent : public ::gui::EventHandler {
public:
AddressEvent(Address* instance) : ::gui::EventHandler(), mpInstance(instance) {}
virtual void onEvent(u32 compId, u32 event, void* data);
private:
Address* mpInstance; // 0x0C
int mTrigChan; // 0x10
};
} // namespace scene
} // namespace ipl

View File

@@ -35,7 +35,14 @@ namespace ipl {
virtual void onSend();
virtual int sendMessageByNWC24(NWC24UserId userId, const wchar_t* wcString);
#ifdef IPL_ADDRESS_MATCHING
virtual void setFriendInfo(const NWC24FriendInfo& info) {
mbToFriend = true;
mFriendInfo = info;
}
#else
virtual void setFriendInfo(const NWC24FriendInfo& info);
#endif
virtual void setPhoto(const GXTexObj& texObj);
virtual int sendToWii(NWC24UserId userId, const wchar_t* wcString);

View File

@@ -38,6 +38,9 @@ namespace ipl {
}
const GXTexObj& getIconTexture() const { return mFaceTexObj; }
#ifdef IPL_ADDRESS_MATCHING
u8* getIconImage() const { return mpIconTex; }
#endif
u32 getIndex() const { return mFaceId; }
BOOL created() const { return mbCreated; }

View File

@@ -50,6 +50,10 @@ namespace nw4r {
f32 FrSqrt(f32 x);
u32 CntBit1(u32 x);
#ifdef IPL_ADDRESS_MATCHING
inline f32 FSqrt(f32 x) { return (x <= 0.0f) ? 0.0f : x * FrSqrt(x); }
#endif
} // namespace math
} // namespace nw4r

View File

@@ -118,6 +118,10 @@ namespace nw4r {
return *this;
}
#ifdef IPL_ADDRESS_MATCHING
VEC2 operator-() const { return VEC2(-x, -y); }
#endif
VEC2 operator+(const VEC2& rhs) const { return VEC2(x + rhs.x, y + rhs.y); }
VEC2 operator-(const VEC2& rhs) const { return VEC2(x - rhs.x, y - rhs.y); }
VEC2 operator*(f32 val) const { return VEC2(val * x, val * y); }
@@ -130,6 +134,10 @@ namespace nw4r {
bool operator!=(const VEC2& rhs) const { return x != rhs.x || y != rhs.y; }
} VEC2;
#ifdef IPL_ADDRESS_MATCHING
inline f32 VEC2LenSq(const VEC2* p) { return p->x * p->x + p->y * p->y; }
#endif
typedef struct VEC3 VEC3;
inline VEC3* VEC3Transform(VEC3* pOut, const MTX34* pMtx, const VEC3* pVec);

File diff suppressed because it is too large Load Diff

View File

@@ -197,55 +197,53 @@ namespace ipl {
mpLayoutBg->calc();
mpLayoutFocusBg->calc();
if (mState != STATE_TO_SETTINGS && mState != STATE_TERMINATE) {
if (mState == STATE_DONE) {
return;
if (mState == STATE_TO_SETTINGS || mState == STATE_TERMINATE || mState == STATE_DONE) {
return;
}
calc_board_object();
Button* button = get_button();
if (mbNewMsgAnimCount && button != NULL) {
/* Message count on button icon */
wchar_t numStr[3] = L"";
int index = 0;
int mailCount;
if (mMsgCount >= 0) {
mailCount = 99;
if (mMsgCount <= 99) {
mailCount = mMsgCount;
}
} else {
mailCount = 0;
}
calc_board_object();
if (mailCount >= 10) {
index = 1;
numStr[0] = scNumber[(mailCount / 10) % 10];
}
numStr[index++] = scNumber[mailCount % 10];
Button* button = get_button();
button->setText("T_BbsMark1", numStr);
if (mbNewMsgAnimCount && button != NULL) {
/* Message count on button icon */
// New mail animation
int index = 0;
wchar_t numStr[3] = L"";
int mailCount;
if (mMsgCount >= 0) {
mailCount = 99;
if (mMsgCount <= 99) {
mailCount = mMsgCount;
}
} else {
mailCount = 0;
}
if (mailCount >= 10) {
index = 1;
numStr[0] = scNumber[(mailCount / 10) % 10];
}
numStr[index++] = scNumber[mailCount % 10];
button->setText("T_BbsMark1", numStr);
// New mail animation
if (mailCount != 0) {
button->startMailNumAnm();
} else {
button->stopMailNumAnm();
}
mbNewMsgAnimCount = false;
if (mailCount != 0) {
button->startMailNumAnm();
} else {
button->stopMailNumAnm();
}
// Do SD process
if (System::getCdbManager() != NULL && mState != STATE_WAIT_INIT) {
mBoardSD.update();
}
mbNewMsgAnimCount = false;
}
// Do SD process
if (System::getCdbManager() != NULL && mState != STATE_WAIT_INIT) {
mBoardSD.update();
}
}
}
@@ -907,14 +905,16 @@ namespace ipl {
if (mState == STATE_NORMAL) {
for (int i = 0; i < WPAD_MAX_CONTROLLERS; i++) {
BoardObject* object = NULL;
FOREACH_OBJ_IN_LIST(object) {
BoardObject* nextObject = NULL;
while ((nextObject = mObjList.getNext(object)) != NULL) {
object = nextObject;
if ((mHoveredObjs[i] == NULL || mHoveredObjs[i] == object) && mState == STATE_NORMAL) {
object->update(i);
}
}
if (System::getController(i) == NULL && mHoveredObjs[i] != NULL) {
object->start_left_event(i);
mHoveredObjs[i]->start_left_event(i);
mHoveredObjs[i] = NULL;
}
}
@@ -1134,9 +1134,11 @@ namespace ipl {
bool result = mbDoReadTask == false;
BoardObject* object = NULL;
FOREACH_OBJ_IN_LIST(object) {
result = (result & (!object->mbRightWay && !object->mbLeftWay && !object->mMoveAnim.isPlaying() && object->mpLayout != NULL &&
!object->mpLayout->getAnim(BoardObject::ANIM_NEXT_PAGE)->isPlaying())) != false &&
object->mbModifiedPos == false;
bool stillMoving = (result & (!object->mbRightWay && !object->mbLeftWay && !object->mMoveAnim.isPlaying() &&
object->mpLayout != NULL &&
!object->mpLayout->getAnim(BoardObject::ANIM_NEXT_PAGE)->isPlaying())) != false;
bool modifiedPos = object->mbModifiedPos;
result = stillMoving & (modifiedPos == false);
}
if (result) {
@@ -1565,31 +1567,30 @@ namespace ipl {
void Board::edge_arrow() {
Button* button = get_button();
if (System::getScene(SCENE_CHANNEL_SELECT) == NULL && System::getReservedScene() == NULL) {
if (mState == STATE_WAIT_CHILD_CST) {
} else {
enable_licon();
enable_ricon();
if (System::getScene(SCENE_CHANNEL_SELECT) != NULL || System::getReservedScene() != NULL || mState == STATE_WAIT_CHILD_CST) {
return;
}
if (mCurrentDate == utility::Date::getMaxDate()) {
if (button->isArrowVisible(Button::ARROW_BTN_RIGHT) && mbRIconEnable != true) {
button->animation(Button::IDANIM_ARROW_RIGHT_DISAPPEAR);
}
if (!button->isArrowVisible(Button::ARROW_BTN_LEFT)) {
button->animation(Button::IDANIM_ARROW_LEFT_APPEAR);
}
} else {
if (mCurrentDate == utility::Date::getMinDate()) {
if (button->isArrowVisible(Button::ARROW_BTN_LEFT) && mbLIconEnable != true) {
button->animation(Button::IDANIM_ARROW_LEFT_DISAPPEAR);
}
if (!button->isArrowVisible(Button::ARROW_BTN_RIGHT)) {
button->animation(Button::IDANIM_ARROW_RIGHT_APPEAR);
}
} else {
appear_arrow();
}
enable_licon();
enable_ricon();
if (mCurrentDate == utility::Date::getMaxDate()) {
if (button->isArrowVisible(Button::ARROW_BTN_RIGHT) && mbRIconEnable != true) {
button->animation(Button::IDANIM_ARROW_RIGHT_DISAPPEAR);
}
if (!button->isArrowVisible(Button::ARROW_BTN_LEFT)) {
button->animation(Button::IDANIM_ARROW_LEFT_APPEAR);
}
} else {
if (mCurrentDate == utility::Date::getMinDate()) {
if (button->isArrowVisible(Button::ARROW_BTN_LEFT) && mbLIconEnable != true) {
button->animation(Button::IDANIM_ARROW_LEFT_DISAPPEAR);
}
if (!button->isArrowVisible(Button::ARROW_BTN_RIGHT)) {
button->animation(Button::IDANIM_ARROW_RIGHT_APPEAR);
}
} else {
appear_arrow();
}
}
}
@@ -1675,6 +1676,12 @@ namespace ipl {
return result;
}
static inline nw4r::math::VEC3 addTranslate(const nw4r::math::VEC3& a, const nw4r::math::VEC3& b) {
nw4r::math::VEC3 sum;
nw4r::math::VEC3Add(&sum, &a, &b);
return sum;
}
void Board::calc_board_object() {
nw4r::lyt::Pane* pane = mpLayoutBg->FindPaneByName("N_TopBack");
@@ -1682,8 +1689,7 @@ namespace ipl {
FOREACH_OBJ_IN_LIST(object) {
nw4r::lyt::Pane* posPane = mpLayoutBg->FindPaneByName(scScrollPane[get_date_label(object->mBoardDate)]);
math::VEC3 pos;
nw4r::math::VEC3Add(&pos, &pane->GetTranslate(), &posPane->GetTranslate());
math::VEC3 pos = addTranslate(pane->GetTranslate(), posPane->GetTranslate());
object->calc(math::VEC2(pos.x, pos.y));
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -7,8 +7,6 @@ from odiff import dis, sym
import os
import itertools
os.chdir("/home/cole/projects/tests/wii-ipl")
def main():
unit, name = sys.argv[1], sys.argv[2]