Compare commits

..

12 Commits

Author SHA1 Message Date
coah
19a013e64a add SDChannelSelect state/worker accessors used by iplSDMemory 2026-09-29 09:21:07 +00:00
coah
44fd31e660 sdmemory: carry over worker delta (sd channel select header changes left out) 2026-09-29 09:14:24 +00:00
coah
ac51d83fa5 iplSetting: 78/112 functions (worker 3adbf457) (#259) 2026-09-29 04:14:07 -05:00
coah
6490b90f65 Decompile PrFILE2 pf_volume to 6/37 functions (worker 0686f984) (#258) 2026-09-29 04:13:13 -05:00
coah
823ee31937 Decompile PrFILE2 pf_file to 23/45 functions (worker 90e4121e) (#257) 2026-09-29 04:11:22 -05:00
coah
51f940c1ea Decompile iplSetting to 68/112 functions (#256)
* start decompiling setting scene

* match basic setting scene helpers

* match setting constructor and storage

* match setting lookup helpers

* match setting cleanup methods

* restore setting scene name tables

* match setting fadein state copy

* decompile setting screen transitions

* match setting video mode transition

* decompile setting normal update

* decompile setting fadeout

* match setting data initialization

* decompile setting input initialization

* decompile setting access point flow

* decompile setting network workflows

* match setting helper frames

* match setting update initialization

* match setting eula initialization

* match setting fadein readiness

* type setting helper allocations

* localize browser setting tables

* match setting controller flow

* match setting exit condition

* improve setting screen mode flow

* match setting normal state cases

* improve setting keyboard initialization

* match setting text input handling

* match setting ssid initialization

* match setting address initialization

* match setting proxy initialization

* match setting nickname save

* match setting security and ssid writes

* match setting proxy profile updates

* match setting mtu parsing

* match parental password results

* match parental security answer result

* match master key result order

* improve setting text validation

* implement setting reverse ip conversion

* type setting text buffer as wide characters

* match setting default back string

* improve setting safe mode match

* match setting access point reset

* match setting access point redraw

* match setting access point events

* match setting left event

* improve setting creation and AP traversal
2026-09-29 01:28:56 -05:00
coah
8e254f1c88 wad: refine import/backup paths (21/40) (#255) 2026-09-29 00:39:13 -05:00
coah
313e396989 sdmemory: continue decompilation (worker snapshot d94f5e95) (#254) 2026-09-28 23:57:13 -05:00
coah
f98e550b24 sdchansel: continue decompilation (worker snapshot b063d97f) (#253) 2026-09-28 23:57:07 -05:00
coah
7f8b4c8a4f wad: continue decompilation (worker snapshot f33bf397) (#252) 2026-09-28 23:57:01 -05:00
devin-ai-integration[bot]
6806dc1926 net: link nettime (genuine implementation, objdiff 100%) (#251)
Co-authored-by: devin <devin@cognition.ai>
Co-authored-by: wch <usernamecole7@gmail.com>
2026-09-29 04:39:06 +00:00
coah
f0f1462ff4 match pf dir handle checks (#250) 2026-09-28 23:05:09 -05:00
20 changed files with 10252 additions and 378 deletions

View File

@@ -4580,9 +4580,9 @@ handleNandTitleUsage__Q33ipl5scene15SDChannelSelectFv = .text:0x813DBD94; // typ
compareTitleUsage__Q33ipl5scene15SDChannelSelectFPCvPCv = .text:0x813DBE6C; // type:function size:0x28
handleSDTitleList__Q33ipl5scene15SDChannelSelectFv = .text:0x813DBE94; // type:function size:0x124
compareTitleInfo__Q33ipl5scene15SDChannelSelectFPCvPCv = .text:0x813DBFB8; // type:function size:0x28
iplSDChannelSelect_813DBFE0 = .text:0x813DBFE0; // type:function size:0x2AC
handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv = .text:0x813DBFE0; // type:function size:0x2AC
handleSDMountComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC28C; // type:function size:0x64
iplSDChannelSelect_813DC2F0 = .text:0x813DC2F0; // type:function size:0x1B0
handleSDChannelUpdateComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC2F0; // type:function size:0x1B0
handleSDCardReady__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC4A0; // type:function size:0x5C
handleCardCommand__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC4FC; // type:function size:0x78
handleCopyComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC574; // type:function size:0x80
@@ -4592,7 +4592,7 @@ handleMoveComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC684; // type:
handleBackupFitComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC714; // type:function size:0x48
handleNandSDCleanupComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC75C; // type:function size:0x48
handleSDDeleteComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC7A4; // type:function size:0x48
iplSDChannelSelect_813DC7EC = .text:0x813DC7EC; // type:function size:0x14C
updateChannelNotices__Q33ipl5scene15SDChannelSelectFii = .text:0x813DC7EC; // type:function size:0x14C
processWorkerState__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC938; // type:function size:0x18C
updateDialogAnimation__Q33ipl5scene15SDChannelSelectFv = .text:0x813DCAC4; // type:function size:0x42C
setDialogMessage__Q33ipl5scene15SDChannelSelectFUlUl = .text:0x813DCEF0; // type:function size:0x24
@@ -4632,15 +4632,15 @@ iplSDChannelSelect_813DF3FC = .text:0x813DF3FC; // type:function size:0x110
iplSDChannelSelect_813DF50C = .text:0x813DF50C; // type:function size:0x4C
iplSDChannelSelect_813DF558 = .text:0x813DF558; // type:function size:0x178
iplSDChannelSelect_813DF6D0 = .text:0x813DF6D0; // type:function size:0x164
iplSDChannelSelect_813DF834 = .text:0x813DF834; // type:function size:0x110
iplSDChannelSelect_813DF944 = .text:0x813DF944; // type:function size:0x84
iplSDChannelSelect_813DF9C8 = .text:0x813DF9C8; // type:function size:0xF8
iplSDChannelSelect_813DFAC0 = .text:0x813DFAC0; // type:function size:0xFC
iplSDChannelSelect_813DFBBC = .text:0x813DFBBC; // type:function size:0xE4
createChannelList__Q33ipl5scene15SDChannelSelectFib = .text:0x813DF834; // type:function size:0x110
createChannelObject__Q33ipl5scene15SDChannelSelectFii = .text:0x813DF944; // type:function size:0x84
destroyUnusedChannelObjects__Q33ipl5scene15SDChannelSelectFiPQ33ipl5scene12SDChannelObj = .text:0x813DF9C8; // type:function size:0xF8
refreshChannelList__Q33ipl5scene15SDChannelSelectFv = .text:0x813DFAC0; // type:function size:0xFC
refreshAfterSDTitleList__Q33ipl5scene15SDChannelSelectFv = .text:0x813DFBBC; // type:function size:0xE4
destroyChannelObject__Q33ipl5scene15SDChannelSelectFPQ33ipl5scene12SDChannelObj = .text:0x813DFCA0; // type:function size:0x50
iplSDChannelSelect_813DFCF0 = .text:0x813DFCF0; // type:function size:0x74
iplSDChannelSelect_813DFD64 = .text:0x813DFD64; // type:function size:0x154
iplSDChannelSelect_813DFEB8 = .text:0x813DFEB8; // type:function size:0x74
findChannelObject__Q33ipl5scene15SDChannelSelectCFii = .text:0x813DFEB8; // type:function size:0x74
iplSDChannelSelect_813DFF2C = .text:0x813DFF2C; // type:function size:0x1C0
hasChannelObject__Q33ipl5scene15SDChannelSelectCFii = .text:0x813E00EC; // type:function size:0x140
isChannelInCalc__Q33ipl5scene15SDChannelSelectCFiii = .text:0x813E022C; // type:function size:0x68
@@ -4837,7 +4837,7 @@ onEvent__Q33ipl5scene22SDMenuEventHandlerBaseFUlUlPv = .text:0x813EB51C; // type
onEventDerived__Q33ipl5scene22SDMenuEventHandlerBaseFUlUlPCQ33ipl10controller9Interface = .text:0x813EB5E8; // type:function size:0x4
__ct__Q33ipl5scene8SDMemoryFv = .text:0x813EB5EC; // type:function size:0x48
__dt__Q33ipl5scene8SDMemoryFv = .text:0x813EB634; // type:function size:0x5C
create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene17NandSDCardManager = .text:0x813EB690; // type:function size:0x10A0
create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene15SDChannelSelect = .text:0x813EB690; // type:function size:0x10A0
setTitleLists__Q33ipl5scene8SDMemoryFRCQ43ipl5scene8SDMemory10TitleRangeRCQ43ipl5scene8SDMemory10TitleRange = .text:0x813EC730; // type:function size:0xD4
setScrollLimit__Q33ipl5scene8SDMemoryFv = .text:0x813EC804; // type:function size:0x144
init__Q33ipl7utility8ScrollerFv = .text:0x813EC948; // type:function size:0x20
@@ -4879,28 +4879,28 @@ onDialogState21__Q33ipl5scene8SDMemoryFv = .text:0x813EEB94; // type:function si
onDialogState22__Q33ipl5scene8SDMemoryFv = .text:0x813EECDC; // type:function size:0x11C
onDialogState23__Q33ipl5scene8SDMemoryFv = .text:0x813EEDF8; // type:function size:0x78
onDialogState24__Q33ipl5scene8SDMemoryFv = .text:0x813EEE70; // type:function size:0xC0
iplSDMemory_813EEF30 = .text:0x813EEF30; // type:function size:0x88
iplSDMemory_813EEFB8 = .text:0x813EEFB8; // type:function size:0x70C
iplSDMemory_813EF6C4 = .text:0x813EF6C4; // type:function size:0x14
iplSDMemory_813EF6D8 = .text:0x813EF6D8; // type:function size:0x48
draw__Q33ipl5scene8SDMemoryFv = .text:0x813EEF30; // type:function size:0x88
drawTransferTitles__Q33ipl5scene8SDMemoryFv = .text:0x813EEFB8; // type:function size:0x70C
writeFourFlagBytes__Q23ipl5sceneFPUcUcUcUcUc = .text:0x813EF6C4; // type:function size:0x14
setTitleRowColors__Q23ipl5sceneFPQ34nw4r3lyt7TextBoxRCQ34nw4r2ut5ColorRCQ34nw4r2ut5Color = .text:0x813EF6D8; // type:function size:0x48
GetBeginIter__Q34nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>Fv = .text:0x813EF720; // type:function size:0x8
iplSDMemory_813EF728 = .text:0x813EF728; // type:function size:0x8
GetEndIter__Q34nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>Fv = .text:0x813EF728; // type:function size:0x8
__ne__Q24nw4r2utFQ44nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>8IteratorQ44nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>8Iterator = .text:0x813EF730; // type:function size:0x18
iplSDMemory_813EF748 = .text:0x813EF748; // type:function size:0x74
iplSDMemory_813EF7BC = .text:0x813EF7BC; // type:function size:0x128
iplSDMemory_813EF8E4 = .text:0x813EF8E4; // type:function size:0xF0
iplSDMemory_813EF9D4 = .text:0x813EF9D4; // type:function size:0x120
iplSDMemory_813EFAF4 = .text:0x813EFAF4; // type:function size:0xD8
iplSDMemory_813EFBCC = .text:0x813EFBCC; // type:function size:0xC0
iplSDMemory_813EFC8C = .text:0x813EFC8C; // type:function size:0x160
iplSDMemory_813EFDEC = .text:0x813EFDEC; // type:function size:0x128
iplSDMemory_813EFF14 = .text:0x813EFF14; // type:function size:0x24C
iplSDMemory_813F0160 = .text:0x813F0160; // type:function size:0xD8
iplSDMemory_813F0238 = .text:0x813F0238; // type:function size:0x74
iplSDMemory_813F02AC = .text:0x813F02AC; // type:function size:0x144
iplSDMemory_813F03F0 = .text:0x813F03F0; // type:function size:0x10C
iplSDMemory_813F04FC = .text:0x813F04FC; // type:function size:0x1A0
iplSDMemory_813F069C = .text:0x813F069C; // type:function size:0xD8
getControlPaneIndex__Q33ipl5scene8SDMemoryFPCc = .text:0x813EF748; // type:function size:0x74
activateControlPane__Q33ipl5scene8SDMemoryFPCcPQ23gui9Component = .text:0x813EF7BC; // type:function size:0x128
deactivateControlPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EF8E4; // type:function size:0xF0
cancelControlPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EF9D4; // type:function size:0x120
onEvent__Q43ipl5scene8SDMemory23ControlPaneEventHandlerFUlUlPv = .text:0x813EFAF4; // type:function size:0xD8
getTitlePaneIndex__Q33ipl5scene8SDMemoryFPCc = .text:0x813EFBCC; // type:function size:0xC0
activateTitlePane__Q33ipl5scene8SDMemoryFPCcPQ23gui9Component = .text:0x813EFC8C; // type:function size:0x160
deactivateTitlePane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EFDEC; // type:function size:0x128
selectTitlePane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EFF14; // type:function size:0x24C
onEvent__Q43ipl5scene8SDMemory21TitlePaneEventHandlerFUlUlPv = .text:0x813F0160; // type:function size:0xD8
getDialogPaneIndex__Q33ipl5scene8SDMemoryFPCc = .text:0x813F0238; // type:function size:0x74
activateDialogPane__Q33ipl5scene8SDMemoryFPCcPQ23gui9Component = .text:0x813F02AC; // type:function size:0x144
deactivateDialogPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813F03F0; // type:function size:0x10C
selectDialogPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813F04FC; // type:function size:0x1A0
onEvent__Q43ipl5scene8SDMemory22DialogPaneEventHandlerFUlUlPv = .text:0x813F069C; // type:function size:0xD8
__ct__Q33ipl5scene7SettingFPQ23EGG4Heapi = .text:0x813F0774; // type:function size:0xF8
isAnimating__Q33ipl5scene7SettingFv = .text:0x813F086C; // type:function size:0x3C
getFuncMsgQ__Q33ipl5scene7SettingFv = .text:0x813F08A8; // type:function size:0x68

View File

@@ -1041,7 +1041,7 @@ config.libs = [
]
),
RevoEXLib("net", [
Object(NonMatching, "net/nettime.c"),
Object(Matching, "net/nettime.c"),
Object(Matching, "net/crc.c"),
Object(NonMatching, "net/md5.c"),
Object(NonMatching, "net/sha1.c"),

View File

@@ -180,7 +180,11 @@ namespace ipl {
/*** TODO: These always generate a weak. Try and make them not do that. ***/
const nw4r::ut::Rect getTextDrawRect(const nw4r::lyt::TextBox* textBox) const { return textBox->GetTextDrawRect(mDrawInfo); }
#ifdef IPL_SDMEMORY_GET_TEXT_DRAW_RECT_OUT_OF_LINE
const nw4r::ut::Rect getTextDrawRect(const char* paneName) const;
#else
const nw4r::ut::Rect getTextDrawRect(const char* paneName) const { return getTextDrawRect(nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mLayout.GetRootPane()->FindPaneByName(paneName))); }
#endif
const nw4r::ut::Rect getPaneRect(nw4r::lyt::Pane* pane) const { return pane->GetPaneRect(mDrawInfo); }
const nw4r::ut::Rect getPaneRect(const char* paneName) const { return getPaneRect(mLayout.GetRootPane()->FindPaneByName(paneName)); }

View File

@@ -85,6 +85,9 @@ namespace ipl {
}
const utility::BScroller& getBInst() { return mBScroller; }
#ifdef IPL_SDMEMORY_SCROLLER_BINST_RESET
void resetBInst() { mBScroller.reset(); }
#endif
bool isDownEnd() const { return mScroller.isDownEnd(); }
bool isUpEnd() const { return mScroller.isUpEnd(); }
@@ -98,6 +101,9 @@ namespace ipl {
void setDownLimit(f32 v) { mScroller.setDownLimit(v); }
void setUpLimit(f32 v) { mScroller.setUpLimit(v); }
#ifdef IPL_SDMEMORY_SCROLLER_STATE_ACCESSOR
void setState(int state) { mScroller.setState(state); }
#endif
bool isActive() const { return mScroller.isActive(); }

View File

@@ -10,19 +10,22 @@
namespace ipl {
namespace scene {
class SDChannelSelect;
class SDMemory {
public:
struct TitleRange {
ESTitleId* mpTitles;
s32 mByteSize;
u32 mCount;
};
SDMemory();
~SDMemory();
void create(EGG::Heap* heap, nand::LayoutFile* layoutFile, NandSDCardManager* manager);
void create(EGG::Heap* heap, nand::LayoutFile* layoutFile, SDChannelSelect* channelSelect);
void setTitleLists(const TitleRange& nandTitles, const TitleRange& sdTitles);
bool calc();
void draw();
void setScrollLimit();
void updateSideArrows();
void resetScrollArrows();
@@ -38,6 +41,7 @@ namespace ipl {
private:
s32 updateState();
void drawTransferTitles();
void onDialogState0();
void onDialogState2();
bool onDialogState3();
@@ -62,6 +66,45 @@ namespace ipl {
void onDialogState23();
bool onDialogState24();
void resetDialogPaneAnimations();
s32 getControlPaneIndex(const char* paneName);
void activateControlPane(const char* paneName, ::gui::Component* component);
void deactivateControlPane(const char* paneName);
void cancelControlPane(const char* paneName);
s32 getTitlePaneIndex(const char* paneName);
void activateTitlePane(const char* paneName, ::gui::Component* component);
void deactivateTitlePane(const char* paneName);
void selectTitlePane(const char* paneName);
s32 getDialogPaneIndex(const char* paneName);
void activateDialogPane(const char* paneName, ::gui::Component* component);
void deactivateDialogPane(const char* paneName);
void selectDialogPane(const char* paneName);
class ControlPaneEventHandler : public ::gui::EventHandler {
public:
ControlPaneEventHandler(SDMemory* instance) : ::gui::EventHandler(), mpInstance(instance) {}
virtual void onEvent(u32 compId, u32 event, void* data);
private:
SDMemory* mpInstance;
};
class TitlePaneEventHandler : public ::gui::EventHandler {
public:
TitlePaneEventHandler(SDMemory* instance) : ::gui::EventHandler(), mpInstance(instance) {}
virtual void onEvent(u32 compId, u32 event, void* data);
private:
SDMemory* mpInstance;
};
class DialogPaneEventHandler : public ::gui::EventHandler {
public:
DialogPaneEventHandler(SDMemory* instance) : ::gui::EventHandler(), mpInstance(instance) {}
virtual void onEvent(u32 compId, u32 event, void* data);
private:
SDMemory* mpInstance;
};
layout::Object* mpMainLayout;
layout::Object* mpTitleLayout;
@@ -76,7 +119,7 @@ namespace ipl {
u32 mPanelStates[3];
u32 mTitlePanelStates[5];
u32 mPanelAnimationStates[4];
NandSDCardManager* mpNandSDCardManager;
SDChannelSelect* mpSDChannelSelect;
TitleRange mNandTitleRange;
TitleRange mSDTitleRange;
u32 mTitleCount;
@@ -85,11 +128,11 @@ namespace ipl {
ESTitleId mTitleIds[96];
wchar_t mTitleNames[96][21];
u32 mTitleNameCount;
u32 mNandTitleNameCount;
ESTitleId mNandTitleIds[96];
u32 mNandTitleCount;
u32 mSDTitleCount;
ESTitleId mSDTitleIds[96];
u32 mNandTitleCount;
u32 mNandTitleNameCount;
ESTitleId mNandTitleIds[96];
wchar_t mCurrentTitleName[0x840];
u8 mTransferFlags[4];
u32 mTransferStatus;

View File

@@ -12,6 +12,7 @@ namespace ipl {
namespace scene {
class SDChannelObj {
public:
SDChannelObj(EGG::Heap* heap, int page, int index);
~SDChannelObj();
EGG::Heap* getHeap() const { return mpHeap; }
@@ -19,13 +20,41 @@ namespace ipl {
int getIndex() const { return mIndex; }
private:
friend class SDChannelSelect;
nw4r::ut::Link mListLink;
f32 mOffsetX;
f32 mOffsetY;
EGG::ExpHeap* mpDialogHeap;
EGG::ExpHeap* mpChannelHeap;
EGG::Heap* mpHeap;
u32 mState;
int mPage;
int mIndex;
nand::LayoutFile* mpLayoutFile;
nw4r::lyt::Pane* mpPane;
layout::Animator* mpPaneAnimator;
layout::Object* mpBaseLayout;
layout::Animator* mpBaseAnimator;
layout::Object* mpPageLayout;
layout::Animator* mpPageAnimators[3];
int mPageAnimation;
int mPageAnimationFrame;
layout::Object* mpDialogLayout;
layout::Animator* mpDialogAnimator;
int mDialogState;
int mDialogFrame;
int mDialogTimer;
int mAnimationState;
nw4r::lyt::Group* mpNewMessageGroup;
int mNewMessageCount;
u8 mbNewMessageGroupActive;
int mNewMessageState;
int mNewMessageFrame;
f32 mOffsetX;
f32 mOffsetY;
f32 mAspectRatioScale;
int mStateFlags;
void* mpThumbnailData;
NandSDWorker::SDAppMetaEntry mAppMeta;
};
extern "C" void iplSDChannelObj_813E3104(SDChannelObj* channel);
extern "C" void iplSDChannelObj_813E311C(SDChannelObj* channel, EGG::ExpHeap* firstHeap,
@@ -35,6 +64,8 @@ namespace ipl {
extern "C" void iplSDChannelObj_813E3180(SDChannelObj* channel, nand::LayoutFile* layoutFile);
extern "C" void iplSDChannelObj_813E3304(SDChannelObj* channel);
extern "C" void iplSDChannelObj_813E330C(SDChannelObj* channel);
extern "C" void* iplSDChannelObj_813E3128(SDChannelObj* channel);
extern "C" bool iplSDChannelObj_813E3330(SDChannelObj* channel);
union SDChannelSelectCommandArguments {
u32 values[3];
@@ -68,7 +99,7 @@ namespace ipl {
struct SDChannelSelectTitleInfo {
ESTitleId32 titleId;
u32 state;
bool used;
};
struct SDChannelSelectNoticeQueue {
@@ -94,6 +125,11 @@ namespace ipl {
SDChannelSelect(EGG::Heap* heap);
virtual ~SDChannelSelect();
NandSDWorker::WorkSDState getSDState() const {
return static_cast<NandSDWorker::WorkSDState>(mCurrentSDState);
}
NandSDWorker* getWorker() const { return mpSDWorker; }
virtual BOOL isResetProcessDone();
virtual void startResetting();
virtual void prepare();
@@ -147,6 +183,10 @@ namespace ipl {
void handleNandTitleUsage();
void handleNandTitleUsageComplete();
void handleSDTitleList();
void handleSDTitleListResult();
void refreshAfterSDTitleList();
void handleSDChannelUpdateComplete();
void updateChannelNotices(int pageOffset, int index);
void handleSDMountComplete();
void handleCopyComplete();
void handleDeleteComplete();
@@ -164,7 +204,10 @@ namespace ipl {
static int compareTitleInfo(const void* lhs, const void* rhs);
void createChannelList(int page, bool force);
void destroyChannelObject(SDChannelObj* channel);
void destroyUnusedChannelObjects(int currentPage, SDChannelObj* keepChannel);
void refreshChannelList();
bool hasChannelObject(int page, int index) const;
SDChannelObj* findChannelObject(int page, int index) const;
void createChannelObject(int page, int index);
void createBaseLayout();
void updateNoCardLayouts();

View File

@@ -17,7 +17,11 @@ namespace ipl {
virtual ~APScanThread(); // 0x08
virtual void* Run(); // 0x0C
virtual void unk_0x2C() = 0; // 0x2C
#ifdef IPL_SETTING_IMPLEMENTATION
virtual void unk_0x2C();
#else
virtual void unk_0x2C() = 0;
#endif
void setResultData(unsigned short* buffer);
void setParam();

View File

@@ -3,14 +3,171 @@
#include "iplSceneHeader.h"
#ifdef IPL_SETTING_IMPLEMENTATION
#include <revolution/os.h>
#include "layout/iplGuiManager.h"
#include "layout/GUIManager.h"
#include "iplwww/www_wiisetting.h"
#include "iplwww/www_browser.h"
#include "system/iplKeyboard.h"
#include "system/iplNand.h"
#include "utility/iplThread.h"
extern "C" {
#include <revolution/wd.h>
}
#endif
namespace ipl {
namespace controller {
class Interface;
}
}
namespace ipl {
namespace scene {
#ifdef IPL_SETTING_IMPLEMENTATION
class Setting;
class APScanThread;
class APEvent : public ::gui::EventHandler {
public:
APEvent(Setting* setting) : ::gui::EventHandler(), mpSetting(setting) {}
virtual void onEvent(u32 componentID, u32 event, void* data);
private:
Setting* mpSetting;
};
struct SettingAnimation {
u8 unknown[0x14];
int state;
};
struct SettingAPScanList {
u8 unknown[0x14];
u16 count;
u8 entries[0x7fe];
union {
WDBssDesc_* currentDescriptor;
u16* currentDescriptorWords;
};
};
#endif
FADER_SCENE_CLASS(Setting) {
public:
Setting(EGG::Heap * heap, int arg);
void setInitializeResult(bool, int);
#ifdef IPL_SETTING_IMPLEMENTATION
virtual ~Setting();
bool isAnimating();
void getFuncMsgQ();
void resetFuncMsgQ();
void createBrowser();
void initDirectUrl();
void initString();
void initWiiSettingData();
void initNickName();
void initSecurityKey();
void initSSID();
void initIP();
void initDNS();
void initProxy();
void initBasic();
void initMTU();
void initSecA();
void initVersion();
void updateController_();
void setSE();
void changeVideoMode();
bool isInitialSequenceExit(const ::ipl::controller::Interface* input);
bool updateScreenMode();
void initHTMLText();
void initMessage();
void initKeyboard(const char* text);
bool checkInputString(const wchar_t* text);
int checkIPString(const wchar_t* text);
void setDefaultBackString();
void calcKeyboard();
void calcSetting();
void onTextInputOK();
void setDisPos();
void setNickName();
void setSecurityKey();
void setSSID();
void setIP();
void setDNS();
void setProxy();
void setBasic();
void setMTU();
void setParePass();
void setPareRePass();
void setPareJudgePass();
void setSecA();
void setReSecA();
void setMasterKey();
void adjustSecA(wchar_t* text);
void reAdjustSecA();
u8 checkTextNum(const char* text);
bool checkSpace();
void convertIP(char* destination, const u8* address);
void convertRevIP(u8* destination, const char* address);
void initScroll();
void updateScroll();
void setAPDraw();
int getRadioLevel(const WDBssDesc_* descriptor);
void setUseEULA_Init_();
void setUseEULA_Cancel_();
void setUseEULA_Start_();
void setUseEULA_WaitStopMotor_();
bool validateEULA_();
void setUpdate_Init_();
void setUpdate_WaitAcceptDialog_();
void setUpdate_ConnectTestStart_();
void setUpdate_ConnectTestCreateWait_();
void setUpdate_ConnectTestRun_();
void setUpdate_ConnectTestFailed_();
void setUpdate_SuccessDialog_();
void setUpdate_NoUpdateDialog_();
void setUpdate_EULAInit_();
void setUpdate_Reboot_();
void makeErrorMessage();
bool calcSafeMode();
void waitStart();
void waitFinish();
bool isWaitPlaying();
void initAP();
void resetAP();
void redrawAP();
void scanAP();
void setNUP();
void setUSBAP();
void cancelUSBAP();
void AOSSProcess();
void RakuProcess();
void setUpdate_();
void setUseEULA_();
void start_point_event(const char* pageName);
void start_trig_event(const char* pageName);
void start_left_event(const char* pageName);
int get_arw_no(const char* paneName);
int get_ap_no(const char* buttonName);
void makeSupportCode();
int getErrorNum();
virtual void destroy();
virtual void prepare();
virtual void create();
virtual void calc();
virtual void draw();
virtual FaderSceneCommand calcFadein();
virtual FaderSceneCommand calcNormal();
virtual FaderSceneCommand calcFadeout();
virtual BOOL isResetAcceptable() const;
#endif
u16 getProfileID();
void setInitializeResult(bool, int);
void setConnectTestResult(int, int, bool, int);
int getUpdateTiming();
@@ -25,7 +182,85 @@ namespace ipl {
};
private:
#ifdef IPL_SETTING_IMPLEMENTATION
int mUpdateTiming;
u8 unk_0x5C;
u8 unk_0x5D[3];
nand::Base* mpWWWLibraryFile;
nand::Base* mpSettingHTMLFile;
nand::Base* mpWWWArchiveFile;
nand::Base* mpFontFile;
nand::Base* mpBackgroundTPLFile;
int unk_0x74;
int unk_0x78;
int unk_0x7C;
int mProfileIDMode;
int unk_0x84;
int mAOSSState;
int mRakuState;
int mFuncMsgPending;
int unk_0x94;
ESTitleId mUpdateTitleId;
u32 mPrepareTick;
u8 mSettingData[0x16];
u8 unk_0xBA[2];
nand::LayoutFile* mpSettingLayoutFile;
layout::Object* mpChangeLayout;
layout::Object* mpMainLayout;
layout::Object* mpWaitLayout;
SettingAnimation* mpFirstAnimation;
SettingAnimation* mpSecondAnimation;
APEvent* mpEventHandler;
gui::PaneManager* mpPaneManager;
void* mpUSBAPThread;
utility::ut_thread* mpAOSSThread;
utility::ut_thread* mpRakuRakuThread;
APScanThread* mpAPScanThread;
SettingAPScanList mAPScanList;
void* mpMem1BrowserBuffer;
u32 unk_0x908;
void* mpMem2BrowserBuffer;
void* mpBrowserStringBuffer;
int unk_0x914;
int unk_0x918;
u8 unk_0x91C[4];
ext_ead::www::ImeData* mpBrowserData;
www::wiisetting::WiiData* mpWiiSettingData;
www::wiisetting::WiiFlag* mpWiiSettingFlag;
u8 unk_0x92C;
u8 unk_0x92D[3];
int unk_0x930;
www::wiisetting::SetStringBuf* mpStringBuffer;
#ifdef IPL_SETTING_IMPLEMENTATION
wchar_t unk_0x938[0x101];
#else
u8 unk_0x938[0x202];
#endif
u8 unk_0xB3A;
u8 mBrowserCreated;
keyboard::Manager::State mKeyboardState;
int mInitialArgument;
int mAspectRatio;
int mProgressiveMode;
int mEuRgb60Mode;
u8 mIsResetAcceptable;
u8 unk_0xB5D[3];
OSMessageQueue mFuncMessageQueue;
OSMessage mFuncMessages[5];
int unk_0xB94;
int mState;
int unk_0xB9C;
OSTime mCreatePageTime;
u32 unk_0xBA8;
u8 unk_0xBAC;
u8 unk_0xBAD[3];
u8 unk_0xBB0[0x10];
static void* mem1Buffer_;
static void* mem2Buffer_;
#else
u8 unk_0x58[0xB68];
#endif
};
} // namespace scene
} // namespace ipl

View File

@@ -121,6 +121,7 @@ namespace ipl {
#ifdef IPL_SDMEMORY_DIALOG_STATE_ACCESSOR
int getStateForSDMemory() const { return mState; }
int getResultForSDMemory() const { return mResult; }
void setTitleForSDMemory(const wchar_t* text) { set_title(text); }
#endif
/*=================*/
@@ -326,6 +327,9 @@ namespace ipl {
void setProgBarLength(int len) { mProgBarLen = len; }
/** @return The current length of the progress bar */
int getProgBarLength() { return mProgBarLen; }
#ifdef IPL_SDMEMORY_DIALOG_PROGRESS_FRAME_ACCESSOR
int getProgBarFrame() const { return mProgBarFrame; }
#endif
/**
* Dialog component handler (Automatically executed by the GUI manager)

View File

@@ -63,8 +63,15 @@ namespace ipl {
textinput::MemoManager::StateType type; // 0x00
KeyboardState iplType; // 0x04
bool pressOK; // 0x08
#ifdef IPL_SETTING_IMPLEMENTATION
u8 reservedByte;
#else
u8 unused_0x09;
#endif
wchar_t* wcString; // 0x0C
#ifdef IPL_SETTING_IMPLEMENTATION
State& operator=(const State& other);
#endif
} State;
Manager() : mpManager(NULL), mEvent(), mCurrentConChan(0), mbActivated(false), mpSaveFile(NULL) {}

View File

@@ -179,6 +179,10 @@ namespace ipl {
static const int SD_APP_BACKUP_THUMBNAIL_LENGTH = 0xC800;
#ifdef IPL_SDMEMORY_COMPLETION_PCT_ACCESSOR
static int getCompletionPct() { return s_completion_pct; }
#endif
protected:
static const int FAT_PAGES = 8;
static const int DATA_PAGES = 32;

View File

@@ -73,6 +73,9 @@ namespace ipl {
void setDownLimit(f32 v) { mDownLimit = v; }
void setUpLimit(f32 v) { mUpLimit = v; }
#ifdef IPL_SDMEMORY_SCROLLER_STATE_ACCESSOR
void setState(int state) { mState = state; }
#endif
void addScroll(f32 v) { mScroll += v; }

View File

@@ -55,6 +55,12 @@ namespace nw4r {
NW4R_ASSERT(type < TEXTCOLOR_MAX);
return mTextColors[type];
}
#ifdef IPL_SDMEMORY_SET_TEXT_COLORS
void SetTextColors(const ut::Color& first, const ut::Color& second) {
mTextColors[0] = first;
mTextColors[1] = second;
}
#endif
void SetTextColor(u32 type, ut::Color value) {
NW4R_ASSERT(type < TEXTCOLOR_MAX);
mTextColors[type] = value;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,33 @@
#include <revolution/net.h>
#include <private/nwc24.h>
#include <private/os.h>
#include <revolution/NWC24.h>
#include <revolution/OS.h>
NWC24Err NWC24iEpochSecondsToDate(NWC24Date* date, OSTime time);
NWC24Err NWC24iDateToOSCalendarTime(OSCalendarTime* cal, const NWC24Date* date);
BOOL NETGetUniversalCalendar(OSCalendarTime* pTime) {
static s64 whenCached = 0;
NWC24Date date;
s64 universalTime;
if (whenCached == 0 ||
whenCached + OSSecondsToTicks(60) < __OSGetSystemTime()) {
NWC24iSynchronizeRtcCounter(FALSE);
whenCached = __OSGetSystemTime();
}
if (NWC24iGetUniversalTime(&universalTime) >= 0 &&
NWC24iEpochSecondsToDate(&date, universalTime) >= 0 &&
NWC24iDateToOSCalendarTime(pTime, &date) >= 0) {
return TRUE;
}
OSTicksToCalendarTime(OSGetTime(), pTime);
return FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@@ -433,7 +433,7 @@ namespace ipl {
mpSDWorker->startup_async();
mWorkerState = 2;
} else if (mPreviousSDState != mCurrentSDState && mCurrentSDState == 7) {
System::getErrorHandler()->set(ErrorHandler::DEFAULT, 1);
setDialogMessage(8, 0xaa);
}
}
@@ -544,6 +544,91 @@ namespace ipl {
return left->titleId != right->titleId;
}
void SDChannelSelect::handleSDTitleListResult() {
if (mpSDWorker->is_working()) {
return;
}
mLastOperation = 14;
if (mDialogState != 0) {
return;
}
if (OSGetTime() - mOperationStartTime >= OS_TIMER_CLOCK) {
setDialogMessage(1, 0);
int result = mpSDWorker->get_async_result();
if (result == NandSDWorker::RESULT_OK ||
result == NandSDWorker::RESULT_SD_APP_LOC_NOT_FOUND) {
for (int channelIndex = 0; channelIndex < mPageCount * 12;
++channelIndex) {
if (mpChannelTitleIds[channelIndex] != 0) {
SDChannelSelectTitleInfo* info =
static_cast<SDChannelSelectTitleInfo*>(
bsearch(mpChannelTitleIds + channelIndex, mpSDTitleInfo,
mSDTitleCount, sizeof(SDChannelSelectTitleInfo),
compareTitleInfo));
if (info != NULL) {
info->used = true;
} else {
mpChannelTitleIds[channelIndex] = 0;
}
}
}
int channelIndex = 0;
u32 titleIndex = 0;
bool addedTitle = false;
for (; channelIndex < mPageCount * 12; ++channelIndex) {
if (mpChannelTitleIds[channelIndex] == 0) {
if (titleIndex == mSDTitleCount) {
break;
}
for (; titleIndex < mSDTitleCount; ++titleIndex) {
SDChannelSelectTitleInfo* info = &mpSDTitleInfo[titleIndex];
if (!info->used && info->titleId != 0x48415A41) {
mpChannelTitleIds[channelIndex] = info->titleId;
addedTitle = true;
++titleIndex;
break;
}
}
}
}
if (addedTitle || result == NandSDWorker::RESULT_SD_APP_LOC_NOT_FOUND) {
enqueueLoadNotice();
}
} else {
int channelCount = 0;
int channelIndex = 0;
u32 titleIndex = 0;
for (; titleIndex < mSDTitleCount; ++titleIndex) {
u32 titleId = mpSDTitleInfo[titleIndex].titleId;
if (titleId != 0x48415A41) {
++channelCount;
mpChannelTitleIds[channelIndex++] = titleId;
if (channelCount == mPageCount * 12) {
break;
}
}
}
enqueueLoadNotice();
}
mWorkerCommand = 1;
mbNeedsRefresh = true;
u32 titleCount = mbHazardTitleFound ? mSDTitleCount - 1 : mSDTitleCount;
if (titleCount > static_cast<u32>(mPageCount * 12)) {
mbOperationActive = true;
}
if (titleCount >= static_cast<u32>(mPageCount * 12)) {
mbSDCardBroken = true;
}
refreshAfterSDTitleList();
}
}
void SDChannelSelect::processWorkerCommands() {
if (mpSDWorker->is_working() || mWorkerState != 4) {
return;
@@ -643,6 +728,53 @@ namespace ipl {
}
}
void SDChannelSelect::handleSDChannelUpdateComplete() {
if (mpSDWorker->is_working()) {
return;
}
mLastOperation = 14;
SDChannelObj* channel = mpCurrentLoadedChannel;
int page = channel->mPage;
int index = channel->mIndex;
if (!isChannelInCalc(page, index, mCurrentPage) ||
static_cast<u32>(mCurrentSDState) - 1 <= 1) {
destroyChannelObject(channel);
mWorkerCommand = 1;
mpCurrentLoadedChannel = NULL;
return;
}
if (mpSDWorker->get_async_result() >= 0) {
channel->mStateFlags = 0;
channel->mState = 2;
DCFlushRange(iplSDChannelObj_813E3128(channel), 0x19000);
} else {
memcpy(iplSDChannelObj_813E3128(channel),
mpCorruptIconFile->getBuffer(), mpCorruptIconFile->getLength());
memset(&channel->mAppMeta, 0, sizeof(channel->mAppMeta));
channel->mStateFlags = 3;
channel->mState = 2;
}
SDChannelObj* previous = findChannelObject(page, index);
if (previous != NULL) {
nw4r::ut::List_Insert(&mChannelObjects, previous, channel);
nw4r::ut::List_Remove(&mChannelObjects, previous);
destroyChannelObject(previous);
} else {
nw4r::ut::List_Append(&mChannelObjects, channel);
}
updateChannelObject(channel);
if (mCurrentPage == page) {
mpPaneManager->initPane(getChannelPane(index));
}
mWorkerCommand = 1;
mpCurrentLoadedChannel = NULL;
}
void SDChannelSelect::handleCopyComplete() {
if (!mpSDWorker->is_working()) {
mLastOperation = 14;
@@ -736,6 +868,50 @@ namespace ipl {
}
}
void SDChannelSelect::updateChannelNotices(int pageOffset, int index) {
int page = mCurrentPage + pageOffset;
if (page < 0 || mpChannelTitleIds == NULL) {
return;
}
int firstIndex;
int indexStep;
if (pageOffset == 2) {
firstIndex = 0;
indexStep = 4;
} else if (pageOffset < 2) {
if (pageOffset == -2) {
firstIndex = 3;
indexStep = 4;
} else {
firstIndex = 0;
indexStep = 1;
}
} else {
firstIndex = 0;
indexStep = 1;
}
int pageTitleIndex = page * 12;
SDChannelObj* channel;
if (index >= 0 && index < 12 &&
(channel = findChannelObject(page, index)) != NULL && channel->mState == 2 &&
mpChannelTitleIds[pageTitleIndex + index] != 0) {
enqueueNotice(mpChannelTitleIds[pageTitleIndex + index], page, index);
}
for (int channelIndex = firstIndex; channelIndex < 12;
channelIndex += indexStep) {
if (channelIndex != index &&
(channel = findChannelObject(page, channelIndex)) != NULL &&
channel->mState == 2 &&
mpChannelTitleIds[pageTitleIndex + channelIndex] != 0) {
enqueueNotice(mpChannelTitleIds[pageTitleIndex + channelIndex], page,
channelIndex);
}
}
}
void SDChannelSelect::processWorkerState() {
mPreviousSDState = mCurrentSDState;
mCurrentSDState = mpSDWorker->get_sd_state();
@@ -761,7 +937,7 @@ namespace ipl {
handleSDTitleList();
break;
case 3:
handleCopyComplete();
handleSDChannelUpdateComplete();
break;
case 4:
handleSDMountComplete();
@@ -1337,6 +1513,129 @@ namespace ipl {
return mpLayout->FindPaneByName(mscChannelPaneNames[2][index]);
}
void SDChannelSelect::createChannelList(int page, bool force) {
for (int index = 0; index < MAX_CHANNEL_INDEX; ++index) {
if (force || findChannelObject(page, index) == NULL) {
createChannelObject(page, index);
}
}
if (page < mPageCount - 1) {
for (int index = 0; index < MAX_CHANNEL_INDEX; index += 4) {
if (force || findChannelObject(page + 1, index) == NULL) {
createChannelObject(page + 1, index);
}
}
}
if (page > 0) {
for (int index = 3; index < MAX_CHANNEL_INDEX; index += 4) {
if (force || findChannelObject(page - 1, index) == NULL) {
createChannelObject(page - 1, index);
}
}
}
}
void SDChannelSelect::destroyUnusedChannelObjects(int currentPage,
SDChannelObj* keepChannel) {
int keepPage;
int keepIndex;
if (keepChannel != NULL) {
keepPage = keepChannel->getPage();
keepIndex = keepChannel->getIndex();
}
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(
nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
int page = channel->getPage();
int index = channel->getIndex();
if (keepChannel != NULL && page == keepPage && index == keepIndex) {
continue;
}
if (mState < 0x18) {
if (mState >= 0xF && page == mSourcePage && index == mSourceIndex) {
continue;
}
}
if (!isChannelInCalc(page, index, currentPage)) {
SDChannelObj* previous = static_cast<SDChannelObj*>(
nw4r::ut::List_GetPrev(&mChannelObjects, channel));
nw4r::ut::List_Remove(&mChannelObjects, channel);
destroyChannelObject(channel);
channel = previous;
}
}
}
void SDChannelSelect::createChannelObject(int page, int index) {
EGG::FrmHeap* objectHeap = EGG::FrmHeap::create(0x212B8, mpLayoutHeap, 2);
SDChannelObj* channel = new (mpThumbnailHeap, 4) SDChannelObj(objectHeap, page, index);
nw4r::ut::List_Append(&mChannelObjects, channel);
}
void SDChannelSelect::refreshChannelList() {
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(
nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
if (iplSDChannelObj_813E3330(channel)) {
SDChannelObj* previous = static_cast<SDChannelObj*>(
nw4r::ut::List_GetPrev(&mChannelObjects, channel));
nw4r::ut::List_Remove(&mChannelObjects, channel);
destroyChannelObject(channel);
channel = previous;
} else if (channel->mStateFlags == 2) {
channel->mStateFlags = 1;
}
}
createChannelList(mCurrentPage, false);
if (mCurrentPage < mPageCount - 1) {
createChannelList(mCurrentPage + 1, false);
}
if (mCurrentPage > 0) {
createChannelList(mCurrentPage - 1, false);
}
updateChannelObjects();
}
void SDChannelSelect::refreshAfterSDTitleList() {
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(
nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
int channelIndex = channel->mPage * 12 + channel->mIndex;
if (!iplSDChannelObj_813E3330(channel) &&
mpChannelTitleIds[channelIndex] != 0) {
channel->mStateFlags = 2;
}
}
clearNoticeQueue();
updateChannelNotices(0, -1);
updateChannelNotices(-1, -1);
updateChannelNotices(1, -1);
updateChannelNotices(-2, -1);
updateChannelNotices(2, -1);
}
SDChannelObj* SDChannelSelect::findChannelObject(int page, int index) const {
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(
nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
if (page == channel->getPage()) {
if (index == channel->getIndex()) {
return channel;
}
}
}
return NULL;
}
math::VEC3 SDChannelSelect::getChannelPanePosition(SDChannelSelect* scene, int index) {
math::VEC3 position(0.0f, 0.0f, 0.0f);
MTXMultVec(scene->getCenterChannelPane(index)->GetGlobalMtx(), position, position);

File diff suppressed because it is too large Load Diff