Compare commits

...

1 Commits

Author SHA1 Message Date
Devin AI
aef4d19df6 memoryCard: GCW decl-variant gates + create_icon register order
Reapplied vtable leaf work onto main@e60306db: GCWindow decl-variant
gates (novtable bases, per-TU pure-virtual vtable shaping), out-of-line
ctors for MemoryBase/PaneManager, VEC3/operator= decl-only variants —
iplGCWindow.o .data byte-identical to orig.

create_icon: declare s16 frame before u32 file so MWCC's volatile-reg
rotation matches orig (frame->r8, file->r9).

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-01 14:22:20 +00:00
8 changed files with 69 additions and 2 deletions

View File

@@ -60,10 +60,16 @@ namespace gui {
virtual void onEvent(u32 compId, u32 event, void* data) {} // 0x08 (0x02)
#ifdef IPL_MEMORYCARD_BASE_CPP
virtual void setManager(Manager* manager); // 0x0C (0x03)
virtual void setLatestEventCtrlNo(int ctrlNo); // 0x10 (0x04)
virtual int getLatestEventCtrlNo(); // 0x14 (0x05)
#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
@@ -256,7 +262,11 @@ namespace gui {
virtual bool contain(f32 x, f32 y); // 0x68 (0x1A)
virtual void setPane(nw4r::lyt::Pane* pane) { mpPane = pane; } // 0x6C (0x1B)
#ifdef IPL_MEMORYCARD_BASE_CPP
virtual nw4r::lyt::Pane* getPane(); // 0x70 (0x1C)
#else
virtual nw4r::lyt::Pane* getPane() { return mpPane; } // 0x70 (0x1C)
#endif
private:
nw4r::lyt::Pane* mpPane; // 0x88

View File

@@ -5,6 +5,7 @@
#include <nw4r/math.h>
#include "math/iplMathTypes.h"
#include "utility/iplFrameController.h"
#ifdef IPL_GCW_INTP_CTOR_OUT_OF_LINE
@@ -61,6 +62,46 @@ namespace ipl {
T get2() const { return (((mStart * (mMaxFrame - mFrame)) + (mEnd * mFrame)) / mMaxFrame); }
};
#ifdef IPL_GC_WINDOW_CPP
template <>
class __declspec(novtable) Interporation<VEC3> : public utility::FrameController {
public:
Interporation() {}
virtual ~Interporation();
void init(int playback, f32 maxFrame, f32 minFrame, const VEC3& start, const VEC3& end, f32 speed = 1.0f) {
mStart = start;
mEnd = end;
utility::FrameController::init(playback, maxFrame, minFrame, speed);
}
const VEC3& getStart() { return mStart; }
const VEC3& getEnd() { return mEnd; }
void playBackwards() {
mAnmType = ANIM_TYPE_BACKWARD;
mState = ANIM_STATE_PLAY;
}
protected:
VEC3 mStart;
VEC3 mEnd;
};
template <>
class LinearIntp<VEC3> : public Interporation<VEC3> {
public:
#ifdef IPL_GCW_INTP_CTOR_OUT_OF_LINE
LinearIntp() NO_INLINE;
#else
LinearIntp() NO_INLINE {}
#endif
virtual ~LinearIntp();
VEC3 get() const;
VEC3 get2() const { return (((mStart * (mMaxFrame - mFrame)) + (mEnd * mFrame)) / mMaxFrame); }
};
#endif
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
template <typename T>

View File

@@ -93,11 +93,15 @@ 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_MEMORY_CARD_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;

View File

@@ -12,7 +12,11 @@ namespace ipl {
};
namespace utility {
#ifdef IPL_GC_WINDOW_CPP
class __declspec(novtable) FrameController {
#else
class FrameController {
#endif
protected:
enum {
ANIM_STATE_STOP = 0,

View File

@@ -109,7 +109,11 @@ namespace nw4r {
void SetSize(const Size& size) { mSize = size; }
bool IsVisible() { return detail::TestBit(mFlag, BIT_VISIBLE); };
#ifdef IPL_GC_WINDOW_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

@@ -157,7 +157,7 @@ namespace nw4r {
y = pF[1];
z = pF[2];
}
#if defined(IPL_SD_CHANNEL_SELECT_CPP)
#if defined(IPL_SD_CHANNEL_SELECT_CPP) || defined(IPL_MEMORY_CARD_CPP)
VEC3(f32 fx, f32 fy, f32 fz);
#else
VEC3(f32 fx, f32 fy, f32 fz) {
@@ -170,6 +170,9 @@ namespace nw4r {
operator Vec*() { return reinterpret_cast<Vec*>(this); }
operator const Vec*() const { return reinterpret_cast<const Vec*>(this); }
#ifdef IPL_GC_WINDOW_CPP
VEC3& operator=(const VEC3& rhs);
#endif
VEC3& operator+=(const VEC3& rhs) {
VEC3Add(this, this, &rhs);
return *this;

View File

@@ -86,6 +86,7 @@ MemoryBase::MemoryBase() : mpLayout(NULL), unk_0x08(NULL) {
nw4r::ut::List_Init(&mAnmButtonList, offsetof(AnmButton, mLink));
}
MemCardEventHandler::~MemCardEventHandler() {}
MemoryBaseEvent::MemoryBaseEvent(MemoryBase* memoryBase) : mpBase(memoryBase) {}

View File

@@ -342,8 +342,8 @@ void MemoryCardManager::update_change_cardstate(u8 slot) {
GXTexObj* MemoryCardManager::create_icon(u8 slot, s16 index) {
memorycard::IconState (*icons)[0x7f] = reinterpret_cast<memorycard::IconState(*)[0x7f]>(memorycard::getIconStateArray());
int total = 0;
u32 file = mFile[slot][index].fileNo;
s16 frame = 0;
u32 file = mFile[slot][index].fileNo;
do {
u32 shift = frame << 1;
frame++;