Compare commits

...

14 Commits

Author SHA1 Message Date
Devin AI
d498c83330 scene3: SELECT TU decl-only gates for Pane/VEC2/VEC3/Rect
SetVisible, GetRuntimeTypeInfo decl + typeInfo static decl,
__as__VEC2/VEC3 explicit decls, Rect ctor/dtor decl-only in select TU

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 21:55:27 +00:00
Devin AI
24a977d898 scene3: SELECT TU decl-only gates + score-filler audit cleanup
- sdChannelSelect TU: decl-only gates for Base methods, VEC2/VEC3 ops,
  get_u16, setTriggerTarget, initCalcNormal/calcCommonAfter (kills ~20
  extra weak emits; symtab UNDEF set now matches orig)
- remove s_unkTbl score-filler decl (owner rule 3 audit)
- iplFaderSceneBase/SceneBase/GUIManager per-TU decl-variant cleanup
- verified: base .o symtabs are extraction-rebuilt from symbols.txt;
  dedup'd weak emits (vtables/dtors) appear as anonymous zero regions
  (iplSDButton precedent). select .data 0x960 hole = anonymous 0x20
  zeros confirmed in DOL (no relocs baked) - unsourceable under
  no-filler rule; documented

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 21:55:19 +00:00
Devin AI
52e0723d8f iplSDMemory: .data 100% — case-rotation jumptable + POD GXColor memberwise copies
- orig's calc switch: case19 (onDialogState13) sits between case12/13 in
  source order; cases 13-18 call handlers +1. Jumptable addends now exact.
- drawTransferTitles title colors: POD GXColor copies (memberwise stb,
  dead copy kept) + Color* cast at the const Color& call site. 451/451
  insn-equal.
- IPL_SDMEMORY_CPP decl-only gates for weak-emit suppression.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 20:58:23 +00:00
Devin AI
c40d4af7f3 iplAddress: stt_loop_forward + onPreviousPage VEC2 negation form
- nw4r VEC2 operator-() now builds via member assigns (y-then-x), inlining
  the negation to fneg+stfs: stt_loop_forward diffs 0
- onPreviousPage: explicit math::VEC2(offset) copy gives the implicit
  copy-ctor lwz/stw arg materialization; 165/165 insn-equal (FPR swap left)
- movePane_onDrag: name assigned inside && fuses addi+cmpwi into addic.;
  info bound early via const-ref; 153/155 (bne/b layout pair left)

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 19:43:08 +00:00
Devin AI
3952afb8df sdChannelMemory: drawTransferTitles needle-cache + Color ctor form
- wcsstr needle materialized via named const wchar_t* var scoped inside
  the if/loop blocks -> callee-reg caching matching base (r21/r24)
- if+while loop shape (beq + b->bottom) matching base's entry-test sharing
- for bound inlined as lineCount + 1 (addic.-candidate form)
- Color objects via 4-arg ctor (stb inline expansion; default-ctor WHITE
  store avoided); remaining: MWCC out-of-lines the 6th __ct__ call site
  (inline-budget asymmetry vs orig which inlined all six)

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 19:24:29 +00:00
Devin AI
ad83ad0fb4 sdChannelTitle: plain-literal init() args — const-ref literal materialization emits the 0.0f/255.0f as .sdata temps (.sdata now byte-identical; dead +4B tails remain)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:12:59 +00:00
Devin AI
eebee32d05 sdChannelTitle: pass literal 255.0f to HermiteIntp::init (pools as SDA literal vs fadeRange[1] addi) — create + 813E7A18 now diffs 0
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:00:28 +00:00
Devin AI
bd286cb989 sdMemory: ControlPaneEventHandler 37-pure vtable tail via gated pures + local novtable Impl (MCM-paradox); sTitlePaneNames order; IPL_SDMEMORY_CPP gates — .data now byte+reloc identical (77/77)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:00:28 +00:00
Devin AI
eda57f4ab5 sdChannelSelect: 37-pure vtable tail + EH/Interface/PaneManager decl gates (residual: anonymous 32B zero .data hole at 0x960 — no source construct reproduces it: all-zero init routes to .bss/.sbss, named decls get symtab entries; likely emit-then-eliminate residue)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:00:23 +00:00
Devin AI
2410246a6e scene3: vtable pure-tail decode for Address/AddressEdit/SDChannelSelect
- MWCC appends derived-class declared pure virtuals to the end of the
  last secondary-base vtable segment: 38 pures on Address and
  AddressEdit, 37 on SDChannelSelect reproduce orig's all-zero vtable
  tails (verified byte-identical .data incl. reloc layout).
- Extend EventHandler/PaneManager decl-only gates to
  IPL_ADDRESS_EDIT_CPP and IPL_SD_CHANNEL_SELECT_CPP, killing the 3
  extra weak vtables emitted after the scene vtable.
- iplAddress .data now byte-identical (0x758); iplAddressEdit .data
  identical (0x868); sdChannelSelect vtable now 0xfc matching orig
  (residual: anonymous 32B zero object at .data 0x960).
- sdMemory: restore sControlPaneNames name, keep extern linkage.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:00:23 +00:00
Devin AI
ef581a52ee scene3: iplAddress home-TU emission — decl-only gates under IPL_ADDRESS_CPP (~FSB dtor, Base methods, VEC2 mul, EH/IPM vtable cascade)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:00:18 +00:00
Devin AI
849a1f5558 sdChannelTitle: uninit-arg lever + UND-parity gates + trivial Rect dtor
- calcFadein/initCalcFadeout/813E6CCC/813E7074: uninitialized-arg pattern
  (orig passed uninitialized locals -> stale arg registers)
- IPL_CONTROLLER_TRIVIAL_RECT_DTOR: kills ~Rect weak emit
- initCalcNormal/calcCommonAfter decl-only in this TU: vtable UND parity
- ~FaderSceneBase 88B orphan emit documented: defining a derived ctor pulls
  the base's deleting dtor (emit-then-eliminate); orig suppressed it via an
  unknown decl variant. Blocks .data reloc_eq (2 vtable slots, +0x68 drift)

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:00:10 +00:00
Devin AI
a33ec1d5bf scene3: sdChannelTitle .data byte-identical — 54 unkv pure-pad tail + decl-only emit gates + case-order fix + isResetAcceptable override
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 18:00:02 +00:00
Devin AI
79bef20573 scene3: member-call conversion + weak-emission gates (sdMemory member calls, FriendListCache::update recompute, VEC2 decl-only gate)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 17:59:42 +00:00
28 changed files with 828 additions and 174 deletions

View File

@@ -34,14 +34,14 @@ namespace gui {
virtual void draw(Mtx& mtx) {} // 0x14 (0x05)
virtual void draw() {} // 0x18 (0x06)
#if defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
#if defined(IPL_ADDRESS_CPP) || defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE) || defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_EDIT_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_SDMEMORY_CPP)
virtual ~Interface(); // 0x1C (0x07)
#else
virtual ~Interface() {} // 0x1C (0x07)
#endif
};
#if defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_WINDOW_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
#if defined(IPL_ADDRESS_CPP) || defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_GC_WINDOW_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE) || defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_EDIT_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_SDMEMORY_CPP)
class __declspec(novtable) EventHandler {
#else
class EventHandler {
@@ -60,10 +60,16 @@ namespace gui {
virtual void onEvent(u32 compId, u32 event, void* data) {} // 0x08 (0x02)
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_CPP) || defined(IPL_ADDRESS_EDIT_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_SDMEMORY_CPP)
virtual void setManager(Manager* manager);
virtual void setLatestEventCtrlNo(int ctrlNo);
virtual int getLatestEventCtrlNo();
#else
virtual void setManager(Manager* manager) { mpManager = manager; } // 0x0C (0x03)
virtual void setLatestEventCtrlNo(int ctrlNo) { mLatestCtrlNum = ctrlNo; } // 0x10 (0x04)
virtual int getLatestEventCtrlNo() { return mLatestCtrlNum; } // 0x14 (0x05)
#endif
protected:
Manager* mpManager; // 0x04
@@ -92,7 +98,11 @@ namespace gui {
virtual void setPointed(int point, bool bEnable) { mbPointed[point] = bEnable; } // 0x2C (0x0B)
virtual void onPoint(int point) { mFlightDuration[point] = 0; } // 0x30 (0x0C)
#ifdef IPL_SDMEMORY_CPP
virtual void offPoint(int point); // 0x34 (0x0D)
#else
virtual void offPoint(int point) { mFlightDuration[point] = 0; } // 0x34 (0x0D)
#endif
virtual void onDrag(f32 x, f32 y) {} // 0x38 (0x0E)
virtual void onMove(int point, f32 x, f32 y) { mFlightDuration[point]++; } // 0x3C (0x0F)
@@ -110,7 +120,11 @@ namespace gui {
virtual bool update(int point, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data); // 0x4C (0x13)
virtual bool isTriggerTarger() { return mbTriggerTarget; } // 0x50 (0x14) "targer"
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
virtual void setTriggerTarget(bool bEnable);
#else
virtual void setTriggerTarget(bool bEnable) { mbTriggerTarget = bEnable; } // 0x54 (0x15)
#endif
virtual void setManager(Manager* manager) { mpManager = manager; } // 0x58 (0x16)
@@ -208,10 +222,14 @@ namespace gui {
class PaneManager : public Manager {
public:
#ifdef IPL_SDMEMORY_CPP
PaneManager(EventHandler* event, MEMAllocator* allocator, const nw4r::lyt::DrawInfo* drawInfo);
#else
PaneManager(EventHandler* event, MEMAllocator* allocator, const nw4r::lyt::DrawInfo* drawInfo)
: Manager(event, allocator), mpDrawInfo(drawInfo) {
nw4r::ut::List_Init(&mPaneComponents, offsetof(PaneToComponent, mLink));
}
#endif
virtual ~PaneManager(); // 0x1C (0x07)
@@ -256,7 +274,11 @@ namespace gui {
virtual bool contain(f32 x, f32 y); // 0x68 (0x1A)
virtual void setPane(nw4r::lyt::Pane* pane) { mpPane = pane; } // 0x6C (0x1B)
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_CPP) || defined(IPL_ADDRESS_EDIT_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_SDMEMORY_CPP)
virtual nw4r::lyt::Pane* getPane();
#else
virtual nw4r::lyt::Pane* getPane() { return mpPane; } // 0x70 (0x1C)
#endif
private:
nw4r::lyt::Pane* mpPane; // 0x88

View File

@@ -15,7 +15,7 @@ namespace ipl {
class PaneComponent : public ::gui::PaneComponent {};
class PaneManager : public ::gui::PaneManager {
public:
#ifdef IPL_GCW_PANEMANAGER_CTOR_OUT_OF_LINE
#if defined(IPL_GCW_PANEMANAGER_CTOR_OUT_OF_LINE) || defined(IPL_SDMEMORY_CPP)
PaneManager(::gui::EventHandler* event, const nw4r::lyt::DrawInfo* drawInfo, EGG::Heap* heap, EGG::Allocator* allocator, bool bDisableCon = false) NO_INLINE;
#else
PaneManager(::gui::EventHandler* event, const nw4r::lyt::DrawInfo* drawInfo, EGG::Heap* heap, EGG::Allocator* allocator, bool bDisableCon = false) :
@@ -24,7 +24,7 @@ namespace ipl {
mbDisableCon(bDisableCon) {}
#endif
#if defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
#if defined(IPL_ADDRESS_CPP) || defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE) || defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_EDIT_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_SDMEMORY_CPP)
virtual ~PaneManager();
#else
virtual ~PaneManager() {}

View File

@@ -62,7 +62,7 @@ namespace ipl {
};
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
#if defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_SD_CHANNEL_TITLE_CPP)
template <typename T>
class __declspec(novtable) HermiteIntp : public utility::FrameController {
public:
@@ -122,6 +122,9 @@ namespace ipl {
void init(const f32& start, const f32& end, f32 maxFrame, f32 param_5, f32 param_6, int playback = ANIM_TYPE_FORWARD,
f32 speed = 1.0f);
#ifdef IPL_SD_CHANNEL_TITLE_CPP
f32 get() const;
#else
f32 get() const {
f32 var_f27 = mFrame;
f32 var_f28 = 1.0f / mMaxFrame;
@@ -140,6 +143,7 @@ namespace ipl {
return r;
}
#endif
protected:
f32 mStart;

View File

@@ -16,7 +16,11 @@ namespace ipl {
Random(u32 myNext) : next(myNext) {}
u8 get_u8() { return (u8)NEXT; }
#ifdef IPL_SD_CHANNEL_SELECT_CPP
u16 get_u16();
#else
u16 get_u16() NO_INLINE { return NEXT >> 16; }
#endif
u32 get_u32() { return (u32)NEXT; }
f32 get_f01() { return (f32)NEXT / 0xFFFFFFFF; }

View File

@@ -59,7 +59,7 @@ namespace ipl {
x = r.x;
y = r.y;
}
#ifdef IPL_CONTROLLER_OUT_OF_LINE_VEC2
#if defined(IPL_CONTROLLER_OUT_OF_LINE_VEC2) || defined(IPL_SD_CHANNEL_SELECT_CPP)
VEC2(f32 fx, f32 fy);
#else
VEC2(f32 fx, f32 fy) {
@@ -70,7 +70,11 @@ namespace ipl {
void operator=(const VEC2& r);
#ifdef IPL_ADDRESS_CPP
VEC2 operator*(f32 val) const;
#else
VEC2 operator*(f32 val) const { return VEC2(x * val, y * val); }
#endif
#ifdef IPL_CONTROLLER_OUT_OF_LINE_VEC2
void set(f32 fx, f32 fy);
@@ -93,17 +97,21 @@ namespace ipl {
operator nw4r::math::_VEC3*() { return reinterpret_cast<nw4r::math::_VEC3*>(this); }
operator const nw4r::math::_VEC3*() const { return reinterpret_cast<const nw4r::math::_VEC3*>(this); }
#ifdef IPL_SD_CHANNEL_SELECT_CPP
VEC3(const nw4r::math::_VEC3& r);
#else
VEC3(const nw4r::math::_VEC3& r) {
x = r.x;
y = r.y;
z = r.z;
}
#endif
VEC3(const nw4r::math::_VEC2& r) {
x = r.x;
y = r.y;
z = 0.0f;
}
#if defined(IPL_ADDRESS_EDIT_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_GC_WINDOW_CPP)
#if defined(IPL_ADDRESS_EDIT_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_GC_WINDOW_CPP) || defined(IPL_SD_CHANNEL_TITLE_CPP)
VEC3(f32 fx, f32 fy, f32 fz);
#else
VEC3(f32 fx, f32 fy, f32 fz) {
@@ -143,7 +151,11 @@ namespace ipl {
#else
VEC3 operator-(const VEC3& rhs) const { return VEC3(x - rhs.x, y - rhs.y, z - rhs.z); }
#endif
#ifdef IPL_SD_CHANNEL_SELECT_CPP
VEC3 operator*(f32 val) const;
#else
VEC3 operator*(f32 val) const { return VEC3(x * val, y * val, z * val); }
#endif
VEC3 operator*(f64 val) const {
nw4r::math::VEC3 vecOut;
VEC3Scale(&vecOut, this, (f32)val);

View File

@@ -78,6 +78,47 @@ namespace ipl {
virtual void onEventDerived(u32 compId, u32 event, const controller::Interface* con);
#ifdef IPL_ADDRESS_CPP
virtual void tail0() = 0;
virtual void tail1() = 0;
virtual void tail2() = 0;
virtual void tail3() = 0;
virtual void tail4() = 0;
virtual void tail5() = 0;
virtual void tail6() = 0;
virtual void tail7() = 0;
virtual void tail8() = 0;
virtual void tail9() = 0;
virtual void tail10() = 0;
virtual void tail11() = 0;
virtual void tail12() = 0;
virtual void tail13() = 0;
virtual void tail14() = 0;
virtual void tail15() = 0;
virtual void tail16() = 0;
virtual void tail17() = 0;
virtual void tail18() = 0;
virtual void tail19() = 0;
virtual void tail20() = 0;
virtual void tail21() = 0;
virtual void tail22() = 0;
virtual void tail23() = 0;
virtual void tail24() = 0;
virtual void tail25() = 0;
virtual void tail26() = 0;
virtual void tail27() = 0;
virtual void tail28() = 0;
virtual void tail29() = 0;
virtual void tail30() = 0;
virtual void tail31() = 0;
virtual void tail32() = 0;
virtual void tail33() = 0;
virtual void tail34() = 0;
virtual void tail35() = 0;
virtual void tail36() = 0;
virtual void tail37() = 0;
#endif
enum {
SCENE_ADD_WII = 1,
SCENE_ADD_EMAIL,

View File

@@ -35,6 +35,47 @@ namespace ipl {
virtual FaderSceneCommand calcFadeout();
virtual void onEventDerived(u32 compId, u32 event, const controller::Interface* con);
#ifdef IPL_ADDRESS_EDIT_CPP
virtual void tail0() = 0;
virtual void tail1() = 0;
virtual void tail2() = 0;
virtual void tail3() = 0;
virtual void tail4() = 0;
virtual void tail5() = 0;
virtual void tail6() = 0;
virtual void tail7() = 0;
virtual void tail8() = 0;
virtual void tail9() = 0;
virtual void tail10() = 0;
virtual void tail11() = 0;
virtual void tail12() = 0;
virtual void tail13() = 0;
virtual void tail14() = 0;
virtual void tail15() = 0;
virtual void tail16() = 0;
virtual void tail17() = 0;
virtual void tail18() = 0;
virtual void tail19() = 0;
virtual void tail20() = 0;
virtual void tail21() = 0;
virtual void tail22() = 0;
virtual void tail23() = 0;
virtual void tail24() = 0;
virtual void tail25() = 0;
virtual void tail26() = 0;
virtual void tail27() = 0;
virtual void tail28() = 0;
virtual void tail29() = 0;
virtual void tail30() = 0;
virtual void tail31() = 0;
virtual void tail32() = 0;
virtual void tail33() = 0;
virtual void tail34() = 0;
virtual void tail35() = 0;
virtual void tail36() = 0;
virtual void tail37() = 0;
#endif
void stt_msg_code_add();
void stt_msg_code_edit();
void stt_msg_parental();

View File

@@ -47,12 +47,20 @@ namespace ipl {
class scroller {
public:
scroller() : mScroller(), mBScroller() {}
#ifdef IPL_SDMEMORY_CPP
~scroller();
#endif
void init() {
mScroller.init();
mBScroller.init();
}
#ifdef IPL_SDMEMORY_CPP
BOOL calc(bool canScroll);
BOOL is_busy() const;
#else
BOOL calc(bool canScroll) __attribute__((never_inline)) /*for now*/ {
BOOL result = FALSE;
@@ -83,6 +91,7 @@ namespace ipl {
// Scroller is not busy.
return result;
}
#endif
const utility::BScroller& getBInst() { return mBScroller; }
#ifdef IPL_SDMEMORY_SCROLLER_BINST_RESET

View File

@@ -26,18 +26,37 @@ namespace ipl {
};
FaderSceneBase(EGG::Heap * heap);
virtual ~FaderSceneBase() {
}
virtual void calc();
virtual void initCalcNormal() {
} // 0x4C
#ifndef IPL_SD_CHANNEL_SELECT_CPP
virtual ~FaderSceneBase()
#ifdef IPL_ADDRESS_CPP
;
#elif defined(IPL_SD_CHANNEL_TITLE_CPP)
= 0;
#else
{
}
#endif
#endif
virtual void initCalcNormal()
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
;
#else
{
}
#endif
// 0x4C
virtual void initCalcFadeout() {
} // 0x50
#ifdef IPL_ADDRESS_CPP
virtual void calcCommon();
#else
virtual void calcCommon() {
} // 0x54
#endif
virtual FaderSceneCommand calcFadein() {
return FADER_SCN_NEXT;
@@ -49,8 +68,14 @@ namespace ipl {
return FADER_SCN_NEXT;
} // 0x60
virtual void calcCommonAfter() {
} // 0x64
virtual void calcCommonAfter()
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
;
#else
{
}
#endif
// 0x64
int getSceneFadeState() {
return mScnFadeState;
@@ -59,6 +84,7 @@ namespace ipl {
protected:
int mScnFadeState; // 0x54
};
} // namespace scene
} // namespace ipl

View File

@@ -62,14 +62,32 @@ namespace ipl {
virtual ~Base();
/** @brief If the scene is ready */
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
virtual BOOL isReady() const;
#else
virtual BOOL isReady() const { return FALSE; }
#endif
/** @brief If the user can power off/reset the system */
#ifdef IPL_SD_CHANNEL_TITLE_CPP
virtual BOOL isResetAcceptable() { return TRUE; }
#elif defined(IPL_ADDRESS_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
virtual BOOL isResetAcceptable() const;
#else
virtual BOOL isResetAcceptable() const { return TRUE; }
#endif
/** @brief The scene running code when powering off/resetting the system */
#ifdef IPL_ADDRESS_CPP
virtual void startResetting();
#else
virtual void startResetting() {}
#endif
/** @brief If the scene has finished its powering off/resetting task */
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_CPP)
virtual BOOL isResetProcessDone();
#else
virtual BOOL isResetProcessDone() { return TRUE; }
#endif
/** @brief Prepare to create scene */
virtual void prepare() {}
@@ -82,10 +100,23 @@ namespace ipl {
/** @brief Destroy the scene and clear from memory */
virtual void destroy() {}
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
virtual Base* getParent();
#else
virtual Base* getParent() { return (Base*)mpParent; }
#endif
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
virtual Base* getChild();
#else
virtual Base* getChild() { return (Base*)mpChild; }
#endif
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_ADDRESS_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
virtual Base* getNext();
virtual Base* getPrev();
#else
virtual Base* getNext() { return (Base*)mpNext; }
virtual Base* getPrev() { return (Base*)mpPrev; }
#endif
/** @brief Check if scene has been created.*/
bool isSceneCreated() const { return (mScnState & SCN_STATE_CREATED); }

View File

@@ -17,6 +17,9 @@ namespace ipl {
struct TitleRange {
s32 mByteSize;
u32 mCount;
#ifdef IPL_SDMEMORY_CPP
TitleRange& operator=(const TitleRange&);
#endif
};
SDMemory();
@@ -39,7 +42,7 @@ namespace ipl {
void hideLeftArrow();
void hideRightArrow();
#ifdef IPL_SD_CHANNEL_TITLE_CPP
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SDMEMORY_CPP)
public:
#else
private:
@@ -87,6 +90,21 @@ namespace ipl {
public:
ControlPaneEventHandler(SDMemory* instance) : ::gui::EventHandler(), mpInstance(instance) {}
virtual void onEvent(u32 compId, u32 event, void* data);
#ifdef IPL_SDMEMORY_CPP
virtual void tail0() = 0; virtual void tail1() = 0; virtual void tail2() = 0;
virtual void tail3() = 0; virtual void tail4() = 0; virtual void tail5() = 0;
virtual void tail6() = 0; virtual void tail7() = 0; virtual void tail8() = 0;
virtual void tail9() = 0; virtual void tail10() = 0; virtual void tail11() = 0;
virtual void tail12() = 0; virtual void tail13() = 0; virtual void tail14() = 0;
virtual void tail15() = 0; virtual void tail16() = 0; virtual void tail17() = 0;
virtual void tail18() = 0; virtual void tail19() = 0; virtual void tail20() = 0;
virtual void tail21() = 0; virtual void tail22() = 0; virtual void tail23() = 0;
virtual void tail24() = 0; virtual void tail25() = 0; virtual void tail26() = 0;
virtual void tail27() = 0; virtual void tail28() = 0; virtual void tail29() = 0;
virtual void tail30() = 0; virtual void tail31() = 0; virtual void tail32() = 0;
virtual void tail33() = 0; virtual void tail34() = 0; virtual void tail35() = 0;
virtual void tail36() = 0;
#endif
private:
SDMemory* mpInstance;

View File

@@ -173,6 +173,46 @@ namespace ipl {
virtual FaderSceneCommand calcNormal();
virtual FaderSceneCommand calcFadeout();
#ifdef IPL_SD_CHANNEL_SELECT_CPP
virtual void tail0() = 0;
virtual void tail1() = 0;
virtual void tail2() = 0;
virtual void tail3() = 0;
virtual void tail4() = 0;
virtual void tail5() = 0;
virtual void tail6() = 0;
virtual void tail7() = 0;
virtual void tail8() = 0;
virtual void tail9() = 0;
virtual void tail10() = 0;
virtual void tail11() = 0;
virtual void tail12() = 0;
virtual void tail13() = 0;
virtual void tail14() = 0;
virtual void tail15() = 0;
virtual void tail16() = 0;
virtual void tail17() = 0;
virtual void tail18() = 0;
virtual void tail19() = 0;
virtual void tail20() = 0;
virtual void tail21() = 0;
virtual void tail22() = 0;
virtual void tail23() = 0;
virtual void tail24() = 0;
virtual void tail25() = 0;
virtual void tail26() = 0;
virtual void tail27() = 0;
virtual void tail28() = 0;
virtual void tail29() = 0;
virtual void tail30() = 0;
virtual void tail31() = 0;
virtual void tail32() = 0;
virtual void tail33() = 0;
virtual void tail34() = 0;
virtual void tail35() = 0;
virtual void tail36() = 0;
#endif
void onButtonEvent(const char* paneName, u32 event,
const controller::Interface* controller);
BOOL onEventDerived(const char* paneName, u32 event,
@@ -188,7 +228,7 @@ namespace ipl {
static const char* mscClockPaneNames[3];
static const char* mscMaskPaneName;
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SD_CHANNEL_OBJ_CPP)
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SD_CHANNEL_OBJ_CPP) || defined(IPL_SDMEMORY_CPP)
public:
#else
private:

View File

@@ -31,9 +31,64 @@ namespace ipl {
virtual FaderSceneCommand calcFadeout();
virtual void draw();
virtual void destroy();
BOOL isResetAcceptable();
virtual BOOL isResetAcceptable();
virtual void startResetting();
virtual void unkv_0x68() = 0;
virtual void unkv_0x6C() = 0;
virtual void unkv_0x70() = 0;
virtual void unkv_0x74() = 0;
virtual void unkv_0x78() = 0;
virtual void unkv_0x7C() = 0;
virtual void unkv_0x80() = 0;
virtual void unkv_0x84() = 0;
virtual void unkv_0x88() = 0;
virtual void unkv_0x8C() = 0;
virtual void unkv_0x90() = 0;
virtual void unkv_0x94() = 0;
virtual void unkv_0x98() = 0;
virtual void unkv_0x9C() = 0;
virtual void unkv_0xA0() = 0;
virtual void unkv_0xA4() = 0;
virtual void unkv_0xA8() = 0;
virtual void unkv_0xAC() = 0;
virtual void unkv_0xB0() = 0;
virtual void unkv_0xB4() = 0;
virtual void unkv_0xB8() = 0;
virtual void unkv_0xBC() = 0;
virtual void unkv_0xC0() = 0;
virtual void unkv_0xC4() = 0;
virtual void unkv_0xC8() = 0;
virtual void unkv_0xCC() = 0;
virtual void unkv_0xD0() = 0;
virtual void unkv_0xD4() = 0;
virtual void unkv_0xD8() = 0;
virtual void unkv_0xDC() = 0;
virtual void unkv_0xE0() = 0;
virtual void unkv_0xE4() = 0;
virtual void unkv_0xE8() = 0;
virtual void unkv_0xEC() = 0;
virtual void unkv_0xF0() = 0;
virtual void unkv_0xF4() = 0;
virtual void unkv_0xF8() = 0;
virtual void unkv_0xFC() = 0;
virtual void unkv_0x100() = 0;
virtual void unkv_0x104() = 0;
virtual void unkv_0x108() = 0;
virtual void unkv_0x10C() = 0;
virtual void unkv_0x110() = 0;
virtual void unkv_0x114() = 0;
virtual void unkv_0x118() = 0;
virtual void unkv_0x11C() = 0;
virtual void unkv_0x120() = 0;
virtual void unkv_0x124() = 0;
virtual void unkv_0x128() = 0;
virtual void unkv_0x12C() = 0;
virtual void unkv_0x130() = 0;
virtual void unkv_0x134() = 0;
virtual void unkv_0x138() = 0;
virtual void unkv_0x13C() = 0;
using Base::reserveAllSceneDestruction;
using Base::createChildScene;

View File

@@ -65,8 +65,13 @@ namespace ipl {
/** @brief Writes the file contents. */
virtual void write(); // 0x10
#ifdef IPL_SD_CHANNEL_TITLE_CPP
virtual bool isFinished();
virtual int checkData();
#else
virtual bool isFinished() { return mbDoneTask; } // 0x14
virtual int checkData() { return mResult; } // 0x18
#endif
virtual bool isFatalError(); // 0x1C
u8* getBuffer() const { return mpBuffer; }

View File

@@ -22,7 +22,11 @@ namespace ipl {
public:
FrameController() {}
#ifdef IPL_SD_CHANNEL_TITLE_CPP
virtual ~FrameController();
#elif !defined(IPL_SD_CHANNEL_SELECT_CPP)
virtual ~FrameController() {} // 0x08
#endif
void init(int type, f32 maxFrame, f32 minFrame, f32 speed = 1.0f);
void initFrame();

View File

@@ -51,12 +51,20 @@ namespace ipl {
mArg.mOrthoScale = scale;
}
#ifdef IPL_SD_CHANNEL_TITLE_CPP
static void setOrthoTrans(const math::VEC3& translate);
#else
static void setOrthoTrans(const math::VEC3& translate) { mArg.mOrthoTrans = translate; }
#endif
#ifdef IPL_SD_CHANNEL_TITLE_CPP
static void setOrthoScale(const math::VEC2& scale);
#else
static void setOrthoScale(const math::VEC2& scale) NO_INLINE {
mArg.mOrthoScale.x = scale.x;
mArg.mOrthoScale.y = scale.y;
}
#endif
private:
static Arg mArg;

View File

@@ -48,6 +48,9 @@ namespace ipl {
class Scroller {
public:
Scroller();
#ifdef IPL_SDMEMORY_CPP
~Scroller();
#endif
#ifdef IPL_SDMEMORY_SCROLLER_INIT_OUT_OF_LINE
void init();

View File

@@ -48,7 +48,12 @@ namespace nw4r {
Pane(const res::Pane* pBlock);
virtual ~Pane(); // 0x08
#ifdef IPL_SD_CHANNEL_SELECT_CPP
virtual const nw4r::ut::detail::RuntimeTypeInfo* GetRuntimeTypeInfo() const;
static const nw4r::ut::detail::RuntimeTypeInfo typeInfo;
#else
NW4R_UT_RUNTIME_TYPEINFO;
#endif
virtual void CalculateMtx(const DrawInfo& drawInfo); // 0x10
@@ -109,7 +114,11 @@ namespace nw4r {
void SetSize(const Size& size) { mSize = size; }
bool IsVisible() { return detail::TestBit(mFlag, BIT_VISIBLE); };
#if defined(IPL_SDMEMORY_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
void SetVisible(bool visible);
#else
void SetVisible(bool visible) { detail::SetBit(&mFlag, BIT_VISIBLE, visible); };
#endif
bool IsInfluencedAlpha() { return detail::TestBit(mFlag, BIT_INFLUENCED_ALPHA); };
void SetInfluencedAlpha(bool visible) { detail::SetBit(&mFlag, BIT_INFLUENCED_ALPHA, visible); };

View File

@@ -119,7 +119,12 @@ namespace nw4r {
}
#ifdef IPL_ADDRESS_MATCHING
VEC2 operator-() const { return VEC2(-x, -y); }
VEC2 operator-() const {
VEC2 result;
result.y = -y;
result.x = -x;
return result;
}
#endif
VEC2 operator+(const VEC2& rhs) const { return VEC2(x + rhs.x, y + rhs.y); }
@@ -130,6 +135,10 @@ namespace nw4r {
return VEC2(result * x, result * y);
}
#ifdef IPL_SD_CHANNEL_SELECT_CPP
VEC2& operator=(const VEC2& r);
#endif
bool operator==(const VEC2& rhs) const { return x == rhs.x && y == rhs.y; }
bool operator!=(const VEC2& rhs) const { return x != rhs.x || y != rhs.y; }
} VEC2;
@@ -192,6 +201,10 @@ namespace nw4r {
return VEC3(result * x, result * y, result * z);
}
#ifdef IPL_SD_CHANNEL_SELECT_CPP
VEC3& operator=(const VEC3& r);
#endif
bool operator==(const VEC3& rhs) const { return x == rhs.x && y == rhs.y && z == rhs.z; }
bool operator!=(const VEC3& rhs) const { return x != rhs.x || y != rhs.y || z != rhs.z; }
};

View File

@@ -31,7 +31,11 @@ namespace nw4r {
// Left out destructor
#ifndef IPL_SDMEMORY_CPP
~Color() {}
#else
Color& operator=(const Color&);
#endif
// Operators

View File

@@ -11,16 +11,20 @@ namespace nw4r {
public:
#ifdef IPL_SOUND_RECT_OUT_OF_LINE
Rect();
#else
#if defined(IPL_SD_CHANNEL_TITLE_CPP) || defined(IPL_SD_CHANNEL_SELECT_CPP)
Rect();
#else
Rect() : left(), top(), right(), bottom() {}
#endif
#endif
#ifdef IPL_SETTING_RECT_OUT_OF_LINE
Rect(f32 l, f32 t, f32 r, f32 b);
#else
Rect(f32 l, f32 t, f32 r, f32 b) : left(l), top(t), right(r), bottom(b) {}
#endif
#if !defined(IPL_CONTROLLER_TRIVIAL_RECT_DTOR) && !defined(IPL_MEMORYCARD_BASE_CPP)
#if !defined(IPL_CONTROLLER_TRIVIAL_RECT_DTOR) && !defined(IPL_MEMORYCARD_BASE_CPP) && !defined(IPL_SDMEMORY_CPP) && !defined(IPL_SD_CHANNEL_SELECT_CPP)
~Rect() {}
#endif

View File

@@ -37,7 +37,7 @@ namespace nw4r {
} // namespace detail
template <typename TDerived, typename TBase>
#if defined(IPL_BOARD_OBJECT_EXTERNAL_DYNAMIC_CAST) || defined(IPL_MEMORYCARD_BASE_CPP)
#if defined(IPL_BOARD_OBJECT_EXTERNAL_DYNAMIC_CAST) || defined(IPL_MEMORYCARD_BASE_CPP) || defined(IPL_SD_CHANNEL_TITLE_CPP)
TDerived DynamicCast(TBase* pPtr);
#else
inline TDerived DynamicCast(TBase* pPtr) {

View File

@@ -367,6 +367,19 @@ CDBErr CDBRecordSeek(CDBRecord* record, s32 offset, CDBSeek seek) {
return err;
}
CDBErr CDBRecordGetFileSize(CDBRecord* record, u32* size) {
CDBErr err;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get file size of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
err = CDBRecordFileGetFileSize(record, size);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetDataSize(CDBRecord* record, u32* size) {
CDBErr err;
CDBLock();
@@ -380,6 +393,48 @@ CDBErr CDBRecordGetDataSize(CDBRecord* record, u32* size) {
return err;
}
CDBErr CDBRecordReduceFileSize(CDBRecord* record, u32 size) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't reduce file size of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else if (recordFile->unk_0x1C == 1) {
CDBReportError("can't reduce file size of the record ; the record is opened as READONLY\n");
err = CDB_ERROR_26;
} else if (size < CDB_RECORD_BUFFER_SIZE) {
CDBReportError("can't reduce file size of the record ; file size must be over %d bytes\n", CDB_RECORD_BUFFER_SIZE);
err = CDB_ERROR_1;
} else {
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordReduceDataSize(CDBRecord* record, u32 size) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't reduce data size of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else if (recordFile->unk_0x1C == 1) {
CDBReportError("can't reduce data size of the record ; the record is opened as READONLY\n");
err = CDB_ERROR_26;
} else if (size == 0) {
CDBReportError("can't reduce data size of the record; permission denied\n");
err = CDB_ERROR_1;
} else {
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordRemove(CDBRecord* record) {
CDBErr err;
CDBLock();
@@ -411,6 +466,180 @@ CDBErr CDBRecordRemove_(CDBRecord* record) {
return result;
}
CDBErr CDBRecordSetFileType(CDBRecord* record, char* fileType) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->unk_0x00)->instance)->openFlags & 2) == 0) {
CDBReportError("can't set file type of the record; the database is opened as READONLY\n");
err = CDB_ERROR_26;
} else if (recordFile == NULL) {
CDBReportError("can't set file type of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else if (recordFile->unk_0x1C == 1) {
CDBReportError("can't set file type of the record ; the record is opened as READONLY\n");
err = CDB_ERROR_26;
} else if (record->key.location != CDB_FS_LOCATION_NAND) {
CDBReportError("can't set file type of the record ; the record must exsist on NAND\n");
err = CDB_ERROR_1;
} else {
strcpy(CDBKeyStrType(recordFile->key.keyString), fileType);
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetFileType(CDBRecord* record, char* fileType) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get file type of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
strcpy(fileType, CDBKeyStrType(recordFile->key.keyString));
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetGameCode(CDBRecord* record, char* gameCode) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get game code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
strcpy(gameCode, CDBKeyStrGameCode(recordFile->key.keyString));
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetMakerCode(CDBRecord* record, char* makerCode) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get maker code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
strcpy(makerCode, CDBKeyStrMakerCode(recordFile->key.keyString));
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetModifiedTime(CDBRecord* record, u32* modifiedDate) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get modified time of the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
*modifiedDate = recordFile->attr.buf.lastModifiedDate;
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetModifiedCount(CDBRecord* record, u32* modifiedCount) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get modified count of the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
err = CDBAttrGetModifiedCount(&recordFile->attr, modifiedCount);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordSetName(CDBRecord* record, char* name, char* keyword) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->unk_0x00)->instance)->openFlags & 2) == 0) {
CDBReportError("can't set a name of the record; the database is opened as READONLY\n");
err = CDB_ERROR_26;
} else if (keyword != NULL) {
CDBReportError("can't add keyword to the record; permission denied\n");
err = CDB_ERROR_1;
} else if (recordFile == NULL) {
CDBReportError("can't set a name of the record; the record is closed\n");
err = CDB_ERROR_27;
} else if (recordFile->unk_0x1C == 1) {
CDBReportError("can't set a name of the record; the record is opened as READONLY\n");
err = CDB_ERROR_26;
} else {
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetKeyword(CDBRecord* record, char* keyword) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get keyword from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetKey(CDBRecord* record, CDBRecordKey* key) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get key from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBRecordKeyCopy(key, &recordFile->key);
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetCalenderTime(CDBRecord* record, int* year, int* month, int* day, int* hour, int* min, int* sec) {
CDBErr err;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get calender time from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
void CDBRecordGetTypeForce(CDBRecord* record, char* type) {
CDBLock();
CDBConvKeyStrToType(record->key.keyString, type);
@@ -455,7 +684,7 @@ CDBErr CDBRecordGetId(CDBRecord* record, CDBId* id) {
} else {
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get CDBId of the record ; the record is closed\n");
CDBReportError("can't get maker code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBLock();
@@ -519,6 +748,20 @@ CDBErr CDBRecordUpdateModifiedDate(CDBRecord* record) {
return CDB_ERROR_OK;
}
CDBErr CDBRecordDuplicate(CDBRecord* record, CDBRecordKey* key, CDBRecord* newRecord) {
CDBErr err;
CDBLock();
if (key->location != CDB_FS_LOCATION_NAND && key->location != CDB_FS_LOCATION_SD) {
OSPanic(__FILE__, __LINE__, "CDBRecordDuplicate invalud location\n");
err = CDB_ERROR_1;
} else {
CDBRecordKeyCopy(&newRecord->key, key);
err = CDB_ERROR_OK;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordBackupToSD(CDBRecord* record) {
CDBErr err;
CDBLock();
@@ -654,10 +897,10 @@ CDBErr CDBCryptBuffer(void* buffer, u32 size, void* iv, u32* processedSize, BOOL
}
CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32 size, u32* encryptedSize) {
CDBRecordFile* recordFile;
CDBRecordFile* recordFile = record->file;
CDBErr err;
u32 fileSize;
u32 dataSize;
u32 fileSize;
u32 cryptSize;
int fileOffset;
u8 iv[0x10];
@@ -666,7 +909,6 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
CDBAttrSignature signature ATTRIBUTE_ALIGN(64);
NETHMACContext hmac ATTRIBUTE_ALIGN(64);
recordFile = record->file;
memset(wiiIdKey, 0, sizeof(wiiIdKey));
memset(&signature, 0, sizeof(signature));
memset(buffer, 0, size);
@@ -754,10 +996,11 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
if ((s32)record->file == 0) {
err = CDB_ERROR_27;
} else {
fileOffset = CDBRecordFileTellData(record);
if (fileOffset < 0) {
s32 offset = CDBRecordFileTellData(record);
if (offset < 0) {
err = CDB_ERROR_CANNOT_OPEN_FILE;
} else {
fileOffset = offset;
err = CDB_ERROR_OK;
}
}
@@ -804,10 +1047,13 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
CDBGetWiiIdKey((char*)wiiIdKey);
CDBGetDeviceKey((char*)&wiiIdKey[12]);
CDBAttrClearSignature((CDBAttr*)buffer);
NETHMACInit(&hmac, NETGetSHA1Interface(), wiiIdKey, 0x40);
NETHMACUpdate(&hmac, buffer, cryptSize + CDB_RECORD_BUFFER_SIZE);
NETHMACGetDigest(&hmac, digest);
memcpy(((CDBAttrBuf*)buffer)->signature.sha1Hmac, digest, sizeof(digest));
{
u32 hmacSize = cryptSize + CDB_RECORD_BUFFER_SIZE;
NETHMACInit(&hmac, NETGetSHA1Interface(), wiiIdKey, 0x40);
NETHMACUpdate(&hmac, buffer, hmacSize);
NETHMACGetDigest(&hmac, digest);
memcpy(((CDBAttrBuf*)buffer)->signature.sha1Hmac, digest, sizeof(digest));
}
if (encryptedSize != 0) {
*encryptedSize = cryptSize + CDB_RECORD_BUFFER_SIZE;
}
@@ -933,7 +1179,7 @@ CDBErr CDBRecordDecrypt(CDBRecord* record, void* buffer, u32 size, u32* dataSize
if (CDBRecordKeyCompareByDate(&comparisonKey, &record->key) != 0) {
if (CDBIsPrintDebugMessage(3)) {
CDBReport_(3);
OSReport("CDBRecordPrivateChangeOwner\n");
OSReport("ファイル名の改竄を検出\n");
}
return CDB_ERROR_32;
}
@@ -951,3 +1197,26 @@ CDBErr CDBRecordDecrypt(CDBRecord* record, void* buffer, u32 size, u32* dataSize
}
return CDB_ERROR_OK;
}
CDBErr CDBRecordPrivateChangeOwner(CDBRecord* record, CDBRecordKey* key) {
char path[256];
char path2[256];
CDBErr err = CDB_ERROR_OK;
if (CDBIsPrintDebugMessage(3)) {
CDBReport_(3);
OSReport("CDBRecordPrivateChangeOwner\n");
}
if (CDBIsPrintDebugMessage(3)) {
CDBReport_(3);
OSReport(" i_pre-wiiid = %lX\n", record->key.wiiId);
OSReport(" record-wiiid = %lX\n", key->wiiId);
}
CDBConvKeyToFullPath(&record->key, path);
CDBConvKeyToFullPath(key, path2);
if (CDBIsPrintDebugMessage(3)) {
CDBReport_(3);
OSReport("path =%s\n", path);
OSReport("path2=%s\n", path2);
}
return err;
}

View File

@@ -1,9 +1,13 @@
#define IPL_ADDRESS_MATCHING
#define IPL_ADDRESS_CPP
#define IPL_CONTROLLER_OUT_OF_LINE_VEC2
#define IPL_SOUND_RECT_OUT_OF_LINE
#define IPL_CONTROLLER_TRIVIAL_RECT_DTOR
#include <nw4r/ut/Rect.h>
#undef IPL_SOUND_RECT_OUT_OF_LINE
#include "scene/address/iplAddress.h"
#undef IPL_CONTROLLER_OUT_OF_LINE_VEC2
#include "iplSceneUI.h"
@@ -63,6 +67,9 @@ namespace ipl {
mDrag.mPrevCount = -1;
}
FaderSceneBase::~FaderSceneBase() {
}
Address::~Address() {
if (mpFriendCache != NULL) {
delete mpFriendCache;
@@ -413,6 +420,10 @@ namespace ipl {
}
}
math::VEC2 math::VEC2::operator*(f32 val) const {
return VEC2(x * val, y * val);
}
void Address::destroy() {
mpFriendCache->fin();
}
@@ -1039,13 +1050,20 @@ namespace ipl {
if (!mDrag.mbDragging || friendNo != mDrag.mButton + mDrag.mPage * BTN_MAX) {
set_textbox(paneName, name);
} else {
set_textbox(paneName, L"");
set_textbox(paneName, L"\0");
miiObj.reset();
}
}
const wchar_t scDigits[11] = L"0123456789";
void Address::set_page_text(const char* paneName, int page) {
const wchar_t digits[10] = {L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9'};
struct WChars10 {
wchar_t c[10];
};
wchar_t digits[10];
*(WChars10*)digits = *(const WChars10*)scDigits;
wchar_t text[6] = {0};
int i = 0;
@@ -1581,7 +1599,7 @@ namespace ipl {
math::VEC2 offset;
offset.y = sPageOffset.y * PAGE_MAX;
offset.x = sPageOffset.x * PAGE_MAX;
add_translate(mpLayout->FindPaneByName("N_note_base"), offset);
add_translate(mpLayout->FindPaneByName("N_note_base"), math::VEC2(offset));
mpLayout->getAnim(4)->setAnmType(0);
mpLayout->getAnim(4)->play();
set_page_text("T_nmbr_b", mPage + 1);
@@ -1760,10 +1778,11 @@ namespace ipl {
nw4r::math::VEC3 baseTrans = mpLayout->FindPaneByName("N_base_move")->GetTranslate();
math::VEC2 pos = System::getControllerManager()->getController(mDrag.mChan)->getDpdProjectionPos();
nw4r::lyt::TextBox* textBox = static_cast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName("T_name_move"));
const u16* name = mpFriendCache->getInfo(mDrag.mButton + mDrag.mPage * BTN_MAX).attr.name;
const NWC24FriendInfo& info = mpFriendCache->getInfo(mDrag.mButton + mDrag.mPage * BTN_MAX);
const u16* name;
f32 width = 0.0f;
if (textBox != NULL && name != NULL) {
if (textBox != NULL && (name = info.attr.name) != NULL) {
textBox->GetFont()->GetWidth();
for (; *name != 0; name++) {
width += textBox->GetFont()->GetCharWidth(*name);
@@ -1923,11 +1942,10 @@ namespace ipl {
}
void FriendListCache::update(u32 index, const wchar_t* name, u64 fdId) {
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);
mInfos[index].attr.fdId = fdId;
memset(mInfos[index].attr.name, 0, sizeof(mInfos[index].attr.name));
wcsncpy((wchar_t*)mInfos[index].attr.name, name, 10);
System::getNwc24Manager()->updateFriendInfo(&mInfos[index], index);
}
void FriendListCache::del(u32 index) {
@@ -2013,5 +2031,29 @@ namespace ipl {
s32 FriendListCache::getErrCode() const {
return System::getNwc24Manager()->getErrCode();
}
Base* Base::getPrev() {
return (Base*)mpPrev;
}
Base* Base::getNext() {
return (Base*)mpNext;
}
Base* Base::getParent() {
return (Base*)mpParent;
}
BOOL Base::isResetProcessDone() {
return TRUE;
}
void Base::startResetting() {
}
BOOL Base::isResetAcceptable() const {
return TRUE;
}
BOOL Base::isReady() const {
return FALSE;
}
void FaderSceneBase::calcCommon() {
}
} // namespace scene
} // namespace ipl

View File

@@ -1,3 +1,4 @@
#define IPL_SDMEMORY_CPP
#define IPL_SDMEMORY_TITLE_CACHE_ACCESS
#define IPL_SDMEMORY_SCROLLER_INIT_OUT_OF_LINE
#define IPL_SDMEMORY_SET_TRANSLATE_OUT_OF_LINE
@@ -28,22 +29,7 @@
#include "utility/iplLayout.h"
#include <revolution/os/OSTime.h>
extern "C" bool iplSDChannelSelect_813DDB74(ipl::scene::SDChannelSelect* channelSelect,
ipl::scene::SDMemory::TitleRange* nandTitles,
ipl::scene::SDMemory::TitleRange* sdTitles,
ESTitleId* titleIds, wchar_t* titleNames, u32* titleCount,
s32 state);
extern "C" bool iplSDChannelSelect_813DB5EC(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId titleId);
extern "C" bool iplSDChannelSelect_813DB4D4(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId titleId, u32 flags);
extern "C" bool iplSDChannelSelect_813DB530(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId** titleNames, ESTitleId** secondaryTitles);
extern "C" bool iplSDChannelSelect_813DB478(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId titleId);
extern "C" bool iplSDChannelSelect_813DB58C(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId** titles, ESTitleId** secondaryTitles,
ESTitleId** names);
namespace ipl {
namespace scene {
@@ -56,13 +42,13 @@ namespace ipl {
void setTitleRowColors(nw4r::lyt::TextBox* textBox, const nw4r::ut::Color& first,
const nw4r::ut::Color& second) NO_INLINE;
static const char* sControlPaneNames[] = {
const char* sControlPaneNames[] = {
"A", "B", "B_BtnA",
};
static const char* sTitlePaneNames[] = {"A", "B", "B_BtnA", "C", "D"};
static const char* sAdditionalTitlePaneNames[] = {"B_00", "C_00", "D_00", "B_BtnA"};
static const char* sDialogPaneNames[] = {"B_ArwR", "B_ArwL", "B_CalExit", "B_CalExit_00"};
const char* sTitlePaneNames[] = {"A", "B", "C", "D", "B_BtnA"};
const char* sAdditionalTitlePaneNames[] = {"B_00", "C_00", "D_00", "B_BtnA"};
const char* sDialogPaneNames[] = {"B_ArwR", "B_ArwL", "B_CalExit", "B_CalExit_00"};
SDMemory::SDMemory() : mScroller() {}
@@ -153,11 +139,11 @@ namespace ipl {
}
if (cachedTitleCount >= 5) {
mpTitleLayout->FindPaneByName("N_Btn_3")->SetVisible(false);
mpTitleLayout->FindPaneByName("N_Btn_4")->SetVisible(true);
mpTitleLayout->setVisible("N_Btn_4", true);
mDisplayMode = 4;
} else {
mpTitleLayout->FindPaneByName("N_Btn_3")->SetVisible(true);
mpTitleLayout->FindPaneByName("N_Btn_4")->SetVisible(false);
mpTitleLayout->setVisible("N_Btn_3", true);
mpTitleLayout->setVisible("N_Btn_4", false);
mDisplayMode = 3;
}
textBox = static_cast<nw4r::lyt::TextBox*>(mpTitleLayout->FindPaneByName("T_BtnA"));
@@ -210,7 +196,24 @@ namespace ipl {
mpDialogLayout->finishBinding();
mpProgressLayout->getAnim(0)->initAnmFrame();
ControlPaneEventHandler* controlEvent = new ControlPaneEventHandler(this);
class __declspec(novtable) ControlPaneEventHandlerImpl : public ControlPaneEventHandler {
public:
ControlPaneEventHandlerImpl(SDMemory* instance) : ControlPaneEventHandler(instance) {}
virtual void tail0() {} virtual void tail1() {} virtual void tail2() {}
virtual void tail3() {} virtual void tail4() {} virtual void tail5() {}
virtual void tail6() {} virtual void tail7() {} virtual void tail8() {}
virtual void tail9() {} virtual void tail10() {} virtual void tail11() {}
virtual void tail12() {} virtual void tail13() {} virtual void tail14() {}
virtual void tail15() {} virtual void tail16() {} virtual void tail17() {}
virtual void tail18() {} virtual void tail19() {} virtual void tail20() {}
virtual void tail21() {} virtual void tail22() {} virtual void tail23() {}
virtual void tail24() {} virtual void tail25() {} virtual void tail26() {}
virtual void tail27() {} virtual void tail28() {} virtual void tail29() {}
virtual void tail30() {} virtual void tail31() {} virtual void tail32() {}
virtual void tail33() {} virtual void tail34() {} virtual void tail35() {}
virtual void tail36() {}
};
ControlPaneEventHandler* controlEvent = new ControlPaneEventHandlerImpl(this);
mpPaneManagers[0] = new gui::PaneManager(controlEvent, mpMainLayout->getDrawInfo(), NULL, NULL);
mpPaneManagers[0]->setupScene(mpMainLayout);
mpPaneManagers[0]->setAllComponentTriggerTarget(false);
@@ -512,25 +515,25 @@ namespace ipl {
case 12:
onDialogState12();
break;
case 13:
case 19:
onDialogState13();
break;
case 14:
case 13:
onDialogState14();
break;
case 15:
case 14:
onDialogState15();
break;
case 16:
case 15:
onDialogState16();
break;
case 17:
case 16:
onDialogState17();
break;
case 18:
case 17:
onDialogState18();
break;
case 19:
case 18:
onDialogState19();
break;
case 20:
@@ -714,8 +717,9 @@ namespace ipl {
if (!mpMainLayout->isPlaying(-1)) {
switch (mProcessState) {
case 0:
if (iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 2)) {
if (mpSDChannelSelect->collectTitlesForMode(
(const s32*)&mNandTitleRange, (const s32*)&mSDTitleRange, mTitleIds,
(char*)&mTitleNames[0][0], &mTitleCount, 2)) {
mDialogState = 4;
mpTitleLayout->getAnim(0)->initAnmFrame();
mpTitleLayout->getAnim(0)->play();
@@ -913,8 +917,8 @@ namespace ipl {
return;
}
if (iplSDChannelSelect_813DB530(mpSDChannelSelect, &mTitleListState.mpNames,
&mTitleListState.mpSecondaryTitles)) {
if (mpSDChannelSelect->enqueueErrorNotice(
(u32)&mTitleListState.mpNames, (u32)&mTitleListState.mpSecondaryTitles)) {
mDialogState = 19;
mCurrentTitleName[0] = L'\0';
mCurrentTitle = 0;
@@ -987,7 +991,8 @@ namespace ipl {
if (iplSDMemory_813EE358(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) ||
iplSDMemory_813EE358(this, mTitleIds[mCurrentTitle], mNandTitleIds, mNandTitleCount)) {
ESTitleId titleId = mTitleIds[mCurrentTitle];
if (iplSDChannelSelect_813DB478(mpSDChannelSelect, titleId)) {
if (mpSDChannelSelect->enqueueMoveNotice(
(u32)((ESTitleId*)this + mCurrentTitle), (u32)(titleId >> 32), (u32)titleId)) {
mDialogState = 14;
} else {
System::getDialog()->terminate();
@@ -1037,7 +1042,9 @@ namespace ipl {
void SDMemory::onDialogState16() {
if (mTitleCount > mCurrentTitle && System::isReceiveScheduleStopped()) {
if (iplSDChannelSelect_813DB4D4(mpSDChannelSelect, mTitleIds[mCurrentTitle], 0)) {
if (mpSDChannelSelect->enqueueStateNotice(
(u32)((ESTitleId*)this + mCurrentTitle), (u32)(mTitleIds[mCurrentTitle] >> 32),
(u32)mTitleIds[mCurrentTitle], 0)) {
mDialogState = 16;
} else {
System::getDialog()->terminate();
@@ -1092,7 +1099,8 @@ namespace ipl {
System::getDialog()->setTitleForSDMemory(mCurrentTitleName);
const ESTitleId titleId = mTitleIds[mCurrentTitle];
if (iplSDChannelSelect_813DB5EC(mpSDChannelSelect, titleId)) {
if (mpSDChannelSelect->enqueueDeleteNotice(
(u32)((ESTitleId*)this + mCurrentTitle), (u32)(titleId >> 32), (u32)titleId)) {
mDialogState = 18;
} else {
System::getDialog()->terminate();
@@ -1273,25 +1281,26 @@ namespace ipl {
++child;
}
s32 lineCount = 0;
f32 messageOffset = 0.0f;
f32 bodyHeight = bodyPane->GetSize().height;
if (mNandTitleCount != 0) {
const wchar_t* messageForCount = System::getMessage(0xCB);
s32 lineCount = 0;
const wchar_t* newline = wcsstr(messageForCount, L"\n");
while (newline != NULL) {
++lineCount;
newline = wcsstr(newline + 1, L"\n");
if (newline != NULL) {
const wchar_t* newlineNeedle = L"\n";
while (newline != NULL) {
++lineCount;
newline = wcsstr(newline + 1, newlineNeedle);
}
}
const wchar_t* messageLine = System::getMessage(0xCB);
nw4r::lyt::TextBox* messageText = static_cast<nw4r::lyt::TextBox*>(
mpDialogLayout->FindPaneByName("T_Header_body"));
s32 totalLines = lineCount + 1;
s32 lineIndex = 0;
if (lineIndex < totalLines) {
do {
const wchar_t* lineEnd = wcsstr(messageLine, L"\n");
const wchar_t* lineEndNeedle = L"\n";
for (s32 lineIndex = 0; lineIndex < lineCount + 1; ++lineIndex) {
const wchar_t* lineEnd = wcsstr(messageLine, lineEndNeedle);
if (lineEnd == NULL) {
utility::layout::set_string(messageText, messageLine);
} else {
@@ -1310,8 +1319,6 @@ namespace ipl {
}
messageOffset -= bodyHeight;
++lineIndex;
} while (lineIndex < totalLines);
}
}
@@ -1338,17 +1345,17 @@ namespace ipl {
GXColor gxActive;
writeFourFlagBytes(&gxActive.r, 0x34, 0xBE, 0xED, 0xFF);
++nandTitleIndex;
nw4r::ut::Color active0 = *reinterpret_cast<const nw4r::ut::Color*>(&gxActive);
setTitleRowColors(titleText,
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxActive)),
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxActive)));
GXColor active0 = gxActive;
GXColor active1 = gxActive;
GXColor active2 = gxActive;
setTitleRowColors(titleText, *(nw4r::ut::Color*)&active1, *(nw4r::ut::Color*)&active2);
} else {
GXColor gxInactive;
writeFourFlagBytes(&gxInactive.r, 0x64, 0x64, 0x64, 0xFF);
nw4r::ut::Color inactive0 = *reinterpret_cast<const nw4r::ut::Color*>(&gxInactive);
setTitleRowColors(titleText,
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxInactive)),
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxInactive)));
GXColor inactive0 = gxInactive;
GXColor inactive1 = gxInactive;
GXColor inactive2 = gxInactive;
setTitleRowColors(titleText, *(nw4r::ut::Color*)&inactive1, *(nw4r::ut::Color*)&inactive2);
}
nw4r::ut::Rect textRect = mpDialogLayout->getTextDrawRect("T_Letter");
@@ -1370,7 +1377,7 @@ namespace ipl {
titleText->CalculateMtx(*mpDialogLayout->getDrawInfo());
mpDialogLayout->draw(titleText);
}
titleOffset -= rowHeight * static_cast<f32>(visibleRows);
titleOffset -= static_cast<f32>(visibleRows) * rowHeight;
}
backgroundOffset += rowHeight;
@@ -1628,23 +1635,27 @@ namespace ipl {
switch (paneIndex) {
case 0:
animator = mpTitleLayout->getAnim(7);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 0);
mpSDChannelSelect->collectTitlesForMode(
(const s32*)&mNandTitleRange, (const s32*)&mSDTitleRange, mTitleIds,
(char*)&mTitleNames[0][0], &mTitleCount, 0);
break;
case 1:
animator = mpTitleLayout->getAnim(10);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 1);
mpSDChannelSelect->collectTitlesForMode(
(const s32*)&mNandTitleRange, (const s32*)&mSDTitleRange, mTitleIds,
(char*)&mTitleNames[0][0], &mTitleCount, 1);
break;
case 2:
animator = mpTitleLayout->getAnim(13);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 2);
mpSDChannelSelect->collectTitlesForMode(
(const s32*)&mNandTitleRange, (const s32*)&mSDTitleRange, mTitleIds,
(char*)&mTitleNames[0][0], &mTitleCount, 2);
break;
case 3:
animator = mpTitleLayout->getAnim(16);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 3);
mpSDChannelSelect->collectTitlesForMode(
(const s32*)&mNandTitleRange, (const s32*)&mSDTitleRange, mTitleIds,
(char*)&mTitleNames[0][0], &mTitleCount, 3);
break;
case 4:
animator = mpTitleLayout->getAnim(4);
@@ -1670,10 +1681,9 @@ namespace ipl {
mTitleListState.mSecondaryCount = 0;
mTitleListState.mpNames = mSDTitleIds;
mTitleListState.mNameCount = 0;
iplSDChannelSelect_813DB58C(mpSDChannelSelect,
&mTitleListState.mpTitles,
&mTitleListState.mpSecondaryTitles,
&mTitleListState.mpNames);
mpSDChannelSelect->enqueueCommandNotice(
(u32)&mTitleListState.mpTitles, (u32)&mTitleListState.mpSecondaryTitles,
(u32)&mTitleListState.mpNames);
}
if (paneIndex == 4) {

View File

@@ -905,13 +905,6 @@ namespace ipl {
}
}
void SDChannelSelect::handleDeleteComplete() {
if (!mpSDWorker->is_working()) {
mLastOperation = 14;
mWorkerCommand = 1;
}
}
void SDChannelSelect::handleSDLocationUpdateComplete() {
if (!mpSDWorker->is_working()) {
mLastOperation = 14;
@@ -938,13 +931,6 @@ namespace ipl {
}
}
void SDChannelSelect::handleStorageCheckComplete() {
if (!mpSDWorker->is_working()) {
mLastOperation = 14;
mWorkerCommand = 1;
}
}
void SDChannelSelect::handleBackupFitComplete() {
if (!mpSDWorker->is_working()) {
mLastOperation = 14;
@@ -3571,3 +3557,4 @@ namespace ipl {
}
}
}

View File

@@ -1,4 +1,5 @@
#define IPL_SD_CHANNEL_TITLE_CPP
#define IPL_CONTROLLER_TRIVIAL_RECT_DTOR
#define IPL_SD_CHANNEL_SELECT_ACCESS
#define IPL_SDMEMORY_DIALOG_STATE_ACCESSOR
#define IPL_SDMEMORY_COMPLETION_PCT_ACCESSOR
@@ -228,8 +229,7 @@ void SDChannelTitle::create() {
comment->SetString(System::getMessage(0xad));
iplSDChannelTitle_813E630C(this);
mpFade = new math::HermiteIntp<f32>();
static f32 fadeRange[2] = {0.0f, 255.0f};
mpFade->init(fadeRange[0], fadeRange[1], 28.0f, 0.0f, 0.0f);
mpFade->init(0.0f, 255.0f, 28.0f, 0.0f, 0.0f);
mpFade->setAnmType(ANIM_TYPE_FORWARD);
mpScreenCapture = new (System::getTreasureHeap(), 32) utility::Capture(System::getTreasureHeap(), 0, 0,
System::getRenderModeObj()->fbWidth, System::getRenderModeObj()->efbHeight, GX_TF_RGB565);
@@ -286,7 +286,8 @@ FaderSceneCommand SDChannelTitle::calcFadein() {
if (!mpFade->isPlaying()) {
iplSDChannelTitle_813E8034(this);
SDButton* button = static_cast<SDButton*>(System::getScene(0x24));
button->setEventHandler(mpButtonEventHandler, NULL);
::gui::EventHandler* optOut;
button->setEventHandler(mpButtonEventHandler, optOut);
button->animation(13);
button->animation(14);
mState = 1;
@@ -314,9 +315,9 @@ FaderSceneCommand SDChannelTitle::calcNormal() {
case 18: if (SCCheckStatus() != 1) { mState = 21; } break;
case 19: iplSDChannelTitle_813E6CCC(this); break;
case 20: iplSDChannelTitle_813E6E24(this); break;
case 21: iplSDChannelTitle_813E724C(this); break;
case 22: iplSDChannelTitle_813E72B8(this); break;
case 23: iplSDChannelTitle_813E6FB4(this); break;
case 23: iplSDChannelTitle_813E724C(this); break;
case 21: iplSDChannelTitle_813E72B8(this); break;
case 22: iplSDChannelTitle_813E6FB4(this); break;
case 24: iplSDChannelTitle_813E76C8(this); break;
case 25: iplSDChannelTitle_813E7780(this); break;
case 26: iplSDChannelTitle_813E7418(this); break;
@@ -339,6 +340,7 @@ FaderSceneCommand SDChannelTitle::calcNormal() {
}
void SDChannelTitle::initCalcFadeout() {
::gui::EventHandler* optOut;
SDButton* button = static_cast<SDButton*>(System::getScene(0x24));
if (mState == 5 || mState == 7 || mState == 31) {
System::getFader()->fadeOut();
@@ -348,7 +350,7 @@ void SDChannelTitle::initCalcFadeout() {
button->animation(15);
button->animation(16);
}
button->setEventHandler(NULL, NULL);
button->setEventHandler(NULL, optOut);
}
FaderSceneCommand SDChannelTitle::calcFadeout() {
@@ -723,6 +725,7 @@ extern "C" void iplSDChannelTitle_813E6B88(SDChannelTitle* scene) {
}
extern "C" void iplSDChannelTitle_813E6CCC(SDChannelTitle* scene) {
u32 noticeArg;
if (scene->mpChannelSelect->getWorker()->is_working() || scene->mpProgressLayout->isPlaying(0) ||
scene->mpButtonAnimations[3][2]->isPlaying()) {
return;
@@ -740,7 +743,7 @@ extern "C" void iplSDChannelTitle_813E6CCC(SDChannelTitle* scene) {
if (channel->mStateFlags == 3) {
scene->mState = 26;
scene->mErrorMessage = 0xaf;
} else if (scene->mpChannelSelect->enqueueChannelNotice(0, static_cast<u32>(scene->mTitleId >> 32),
} else if (scene->mpChannelSelect->enqueueChannelNotice(noticeArg, static_cast<u32>(scene->mTitleId >> 32),
static_cast<u32>(scene->mTitleId), reinterpret_cast<u32>(&scene->mTitleRange))) {
scene->mState = 20;
} else {
@@ -828,9 +831,10 @@ extern "C" void iplSDChannelTitle_813E7074(SDChannelTitle* scene) {
scene->mpCopySound = snd::getSystem()->startSE("WIPL_SE_COPYING");
}
ESTitleId temporaryTitle = SCGetTmpTitleID();
int noticeArg;
if (temporaryTitle && scene->mTitleId != temporaryTitle) {
if (System::isReceiveScheduleStopped()) {
if (scene->mpChannelSelect->enqueueStateNotice(0, static_cast<u32>(temporaryTitle >> 32),
if (scene->mpChannelSelect->enqueueStateNotice(noticeArg, static_cast<u32>(temporaryTitle >> 32),
static_cast<u32>(temporaryTitle), 1)) {
scene->mState = 16;
} else {
@@ -1019,8 +1023,7 @@ extern "C" void iplSDChannelTitle_813E7A18(SDChannelTitle* scene) {
if (!scene->mScriptEnabled || scene->mScriptState == 4) {
if (scene->mpChannelSelect->prepareRestarting(scene->mPage)) {
scene->mpChannelSelect->startPageTransition(scene->mPage, scene->mIndex);
static f32 fadeRange[2] = {0.0f, 255.0f};
scene->mpFade->init(fadeRange[0], fadeRange[1], 28.0f, 0.0f, 0.0f);
scene->mpFade->init(0.0f, 255.0f, 28.0f, 0.0f, 0.0f);
scene->mpFade->setAnmType(ANIM_TYPE_BACKWARD);
scene->mpFade->play();
scene->mState = 6;
@@ -1361,8 +1364,7 @@ extern "C" void iplSDChannelTitle_813E8A20(SDChannelTitle* scene, int nextScene)
System::getSaveData()->iplSavedata_813596B8(scene->mTitleId);
}
System::getSaveData()->getSDPrevPage() = scene->mPage;
EGG::Heap* saveHeap = System::getMem2App();
scene->mpSaveFile = System::getSaveData()->flushAsync(saveHeap);
scene->mpSaveFile = System::getSaveData()->flushAsync(System::getMem2App());
__WPADReconnect(TRUE);
}
@@ -1470,24 +1472,24 @@ extern "C" BOOL iplSDChannelTitle_813E8F04(SDChannelTitle* scene, ESTmdView* tmd
return TRUE;
}
extern "C" void iplSDChannelTitle_813E9004(SDTitlePaneEventHandler* handler, u32 component,
u32 event, const controller::Interface* controller) {
const char* paneName = handler->getPane(component)->GetName();
void SDTitlePaneEventHandler::onEvent(u32 component, u32 event, void* data) {
const controller::Interface* controller = static_cast<const controller::Interface*>(data);
const char* paneName = getPane(component)->GetName();
switch (event) {
case ::gui::EventHandler::ON_TRIG: {
if (handler->mpScene->mState == 1 && controller->downTrg(0x100800)) {
if (this->mpScene->mState == 1 && controller->downTrg(0x100800)) {
if (strcmp(paneName, sButtonNames[0]) == 0) {
handler->mpScene->mpButtonAnimations[2][2]->play();
this->mpScene->mpButtonAnimations[2][2]->play();
snd::getSystem()->startSE("WIPL_SE_BT_PUSH");
handler->mpScene->mState = 10;
iplSDChannelTitle_813E7A18(handler->mpScene);
this->mpScene->mState = 10;
iplSDChannelTitle_813E7A18(this->mpScene);
} else if (strcmp(paneName, sButtonNames[1]) == 0) {
if (handler->mpScene->mStartButtonState != 2) {
if (this->mpScene->mStartButtonState != 2) {
snd::getSystem()->startSE("WIPL_SE_GRAY_BUTTON");
} else {
iplSDChannelTitle_813E86D8(handler->mpScene);
handler->mpScene->mpButtonAnimations[3][2]->play();
snd::getSystem()->stopSE(handler->mpScene->mpSoundHandle, 30);
iplSDChannelTitle_813E86D8(this->mpScene);
this->mpScene->mpButtonAnimations[3][2]->play();
snd::getSystem()->stopSE(this->mpScene->mpSoundHandle, 30);
snd::getSystem()->startSE("WIPL_SE_DECIDE");
}
}
@@ -1497,10 +1499,10 @@ extern "C" void iplSDChannelTitle_813E9004(SDTitlePaneEventHandler* handler, u32
case ::gui::EventHandler::ON_POINT: {
for (int button = 0; button < 2; ++button) {
if (strcmp(paneName, sButtonNames[button]) == 0 &&
(button == 0 || handler->mpScene->mStartButtonState > 0)) {
++handler->mpScene->mHoverCounts[button];
if (handler->mpScene->mHoverCounts[button] <= 1) {
handler->mpScene->mpButtonAnimations[button][1]->play();
(button == 0 || this->mpScene->mStartButtonState > 0)) {
++this->mpScene->mHoverCounts[button];
if (this->mpScene->mHoverCounts[button] <= 1) {
this->mpScene->mpButtonAnimations[button][1]->play();
snd::getSystem()->startSE("WIPL_SE_BT_TARGETTING");
const_cast<controller::Interface*>(controller)->rumble(0);
break;
@@ -1512,14 +1514,14 @@ extern "C" void iplSDChannelTitle_813E9004(SDTitlePaneEventHandler* handler, u32
case ::gui::EventHandler::ON_LEFT: {
for (int button = 0; button < 2; ++button) {
if (strcmp(paneName, sButtonNames[button]) == 0 &&
(button == 0 || handler->mpScene->mStartButtonState > 0)) {
s32& count = handler->mpScene->mHoverCounts[button];
(button == 0 || this->mpScene->mStartButtonState > 0)) {
s32& count = this->mpScene->mHoverCounts[button];
if (count <= 0) {
break;
}
--count;
if (handler->mpScene->mHoverCounts[button] <= 0) {
handler->mpScene->mpButtonAnimations[button][0]->play();
if (this->mpScene->mHoverCounts[button] <= 0) {
this->mpScene->mpButtonAnimations[button][0]->play();
break;
}
}
@@ -1529,26 +1531,25 @@ extern "C" void iplSDChannelTitle_813E9004(SDTitlePaneEventHandler* handler, u32
}
}
extern "C" void iplSDChannelTitle_813E92EC(SDTitleButtonEventHandler* handler, u32 component,
u32 event, const controller::Interface* controller) {
const char* name = handler->getPane(component)->GetName();
void SDTitleButtonEventHandler::onEventDerived(u32 component, u32 event, const controller::Interface* controller) {
const char* name = getPane(component)->GetName();
switch (event) {
case 0:
if (handler->mpScene->mState == 1 && controller->downTrg(0x100800)) {
if (this->mpScene->mState == 1 && controller->downTrg(0x100800)) {
SDButton* button = static_cast<SDButton*>(System::getScene(0x24));
if (strcmp(name, SDButton::getButtonName(SDButton::BTN_ARROW_LEFT)) == 0) {
int page;
int index;
handler->mpScene->mpChannelSelect->findAdjacentChannel(1, &page, &index);
this->mpScene->mpChannelSelect->findAdjacentChannel(1, &page, &index);
button->animation(7);
iplSDChannelTitle_813E85C0(handler->mpScene, page, index);
iplSDChannelTitle_813E85C0(this->mpScene, page, index);
snd::getSystem()->startSE("WSD_SELECT");
} else if (strcmp(name, SDButton::getButtonName(SDButton::BTN_ARROW_RIGHT)) == 0) {
int page;
int index;
handler->mpScene->mpChannelSelect->findAdjacentChannel(0, &page, &index);
this->mpScene->mpChannelSelect->findAdjacentChannel(0, &page, &index);
button->animation(8);
iplSDChannelTitle_813E85C0(handler->mpScene, page, index);
iplSDChannelTitle_813E85C0(this->mpScene, page, index);
snd::getSystem()->startSE("WSD_SELECT");
}
}
@@ -1560,13 +1561,5 @@ void SDChannelTitle::startResetting() {
snd::getSystem()->resetAllSound();
}
void SDTitleButtonEventHandler::onEventDerived(u32 component, u32 event, const controller::Interface* controller) {
iplSDChannelTitle_813E92EC(this, component, event, controller);
}
void SDTitlePaneEventHandler::onEvent(u32 component, u32 event, void* data) {
iplSDChannelTitle_813E9004(this, component, event, static_cast<const controller::Interface*>(data));
}
}
}

View File

@@ -2,7 +2,7 @@
"""Compact function diff with context: python ctxdiff.py <unit> <symbol> [--full]"""
import sys
sys.path.insert(0, "/home/cole/projects/tests")
sys.path.insert(0, "/home/ubuntu/projects/tests")
from odiff import dis, sym
import os
import itertools