fmap and fmap_sv: Fix several mixups

Add missing aramCmapDat_c class (runtime version of the separate aramCmapDatPat_t struct) to fix inline signature.
Fix inlines and fields for dMenu_FmapSv_c being mixed up.
This commit is contained in:
LagoLunatic
2026-08-23 22:47:08 -04:00
parent 19bf9bdc77
commit a4e1d2bd4b
6 changed files with 211 additions and 179 deletions
+44 -74
View File
@@ -5,6 +5,7 @@
#include "d/d_drawlist.h"
#include "d/d_lib.h"
#include "d/d_menu_fmap_sv.h"
// #include "d/d_menu_fmapSv.h"
#include "dolphin/types.h"
#include "JSystem/JParticle/JPAEmitter.h"
#include "SSystem/SComponent/c_xyz.h"
@@ -25,27 +26,6 @@ struct cursorTable_t {
/* 0x6 */ s8 down;
};
struct aramCmapSalvagePnt_t {
/* 0x0 */ s16 field_0x0;
/* 0x2 */ s16 field_0x2;
/* 0x4 */ s16 x;
/* 0x6 */ s16 y;
}; // Size: 0x8
struct aramCmapDatPnt_t {
/* 0x00 */ s8 gridNo;
/* 0x01 */ s8 collectMapNo;
/* 0x02 */ s8 cmapIdx;
/* 0x03 */ s8 field_0x3;
/* 0x04 */ s16 field_0x4;
/* 0x06 */ aramCmapSalvagePnt_t salvagePnt[4];
}; // Size: 0x26
struct aramCmapDatPat_t {
/* 0x00 */ u32 m_0x0;
/* 0x04 */ aramCmapDatPnt_t* m_0x4;
};
enum FmapMode {
FMAP_MODE_NORMAL = 0,
FMAP_MODE_WARP = 1,
@@ -77,90 +57,78 @@ public:
virtual ~dMenu_Fmap_c() {}
void draw() { _draw(); }
u8 getCtActive() {
u8 getCtDispMode() {
JUT_ASSERT(467, fmapSv != NULL);
return fmapSv->active;
return fmapSv->dispMode;
}
void setCtActive(u8 val) {
void setCtDispMode(u8 val) {
JUT_ASSERT(472, fmapSv != NULL);
fmapSv->active = val;
fmapSv->dispMode = val;
}
s8 getCtCmapSelNo() {
s8 getCtFmapZoom() {
JUT_ASSERT(478, fmapSv != NULL);
return fmapSv->cmapSelNo;
return fmapSv->fmapZoom;
}
void setCtCmapSelNo(s8 val) {
void setCtFmapZoom(u8 val) {
JUT_ASSERT(483, fmapSv != NULL);
fmapSv->cmapSelNo = val;
}
s8 getCtCurWX() {
JUT_ASSERT(489, fmapSv != NULL);
return fmapSv->curWX;
}
void setCtCurWX(s8 val) {
JUT_ASSERT(494, fmapSv != NULL);
fmapSv->curWX = val;
}
s8 getCtCurWY() {
JUT_ASSERT(500, fmapSv != NULL);
return fmapSv->curWY;
}
void setCtCurWY(s8 val) {
JUT_ASSERT(505, fmapSv != NULL);
fmapSv->curWY = val;
}
s8 getCtCurHX() {
JUT_ASSERT(511, fmapSv != NULL);
return fmapSv->curHX;
}
void setCtCurHX(s8 val) {
JUT_ASSERT(516, fmapSv != NULL);
fmapSv->curHX = val;
}
s8 getCtCurHY() {
JUT_ASSERT(522, fmapSv != NULL);
return fmapSv->curHY;
}
void setCtCurHY(s8 val) {
JUT_ASSERT(527, fmapSv != NULL);
fmapSv->curHY = val;
fmapSv->fmapZoom = val;
}
s8 getCtCurX() {
JUT_ASSERT(533, fmapSv != NULL);
JUT_ASSERT(489, fmapSv != NULL);
return fmapSv->curX;
}
void setCtCurX(s8 val) {
JUT_ASSERT(538, fmapSv != NULL);
JUT_ASSERT(494, fmapSv != NULL);
fmapSv->curX = val;
}
s8 getCtCurY() {
JUT_ASSERT(543, fmapSv != NULL);
JUT_ASSERT(500, fmapSv != NULL);
return fmapSv->curY;
}
void setCtCurY(s8 val) {
JUT_ASSERT(548, fmapSv != NULL);
JUT_ASSERT(505, fmapSv != NULL);
fmapSv->curY = val;
}
s8 getCtCurWX() {
JUT_ASSERT(511, fmapSv != NULL);
return fmapSv->curWX;
}
void setCtCurWX(s8 val) {
JUT_ASSERT(516, fmapSv != NULL);
fmapSv->curWX = val;
}
s8 getCtCurWY() {
JUT_ASSERT(522, fmapSv != NULL);
return fmapSv->curWY;
}
void setCtCurWY(s8 val) {
JUT_ASSERT(527, fmapSv != NULL);
fmapSv->curWY = val;
}
s8 getCtZoomGridX() {
JUT_ASSERT(553, fmapSv != NULL);
JUT_ASSERT(533, fmapSv != NULL);
return fmapSv->zoomGridX;
}
void setCtZoomGridX(s8 val) {
JUT_ASSERT(559, fmapSv != NULL);
JUT_ASSERT(538, fmapSv != NULL);
fmapSv->zoomGridX = val;
}
s8 getCtZoomGridY() {
JUT_ASSERT(563, fmapSv != NULL);
JUT_ASSERT(543, fmapSv != NULL);
return fmapSv->zoomGridY;
}
void setCtZoomGridY(s8 val) {
JUT_ASSERT(569, fmapSv != NULL);
JUT_ASSERT(548, fmapSv != NULL);
fmapSv->zoomGridY = val;
}
void getCtDispMode() {}
void setCtDispMode(u8) {}
void getCtFmapZoom() {}
void setCtFmapZoom(u8) {}
void setCtCurHX(s8 val) {
JUT_ASSERT(559, fmapSv != NULL);
fmapSv->curHX = val;
}
void setCtCurHY(s8 val) {
JUT_ASSERT(569, fmapSv != NULL);
fmapSv->curHY = val;
}
void lineInter0to1(f32, f32, f32) {}
void lineInter0to1ForU8(u8, u8, f32) {}
void setFont(JUTFont* font, JUTFont* rfont) {
@@ -324,7 +292,7 @@ public:
/* 0x0024 */ dMenu_Fmap2_c mFmap2;
/* 0x2874 */ u8 padding_0x2874[0x2878 - 0x2874];
/* 0x2878 */ dMenu_FmapSv_c* fmapSv;
/* 0x287C */ aramCmapDatPat_t mCmapDatPnt;
/* 0x287C */ aramCmapDat_c mCmapDatPnt;
/* 0x2884 */ dDlst_2DOutFont_c* outFont;
/* 0x2888 */ dDlst_2DOutFont_c* outFont2;
/* 0x288C */ fopMsgM_pane_class mFddmPane;
@@ -488,6 +456,8 @@ public:
dMf_HIO_c();
virtual ~dMf_HIO_c() {}
void genMessage(JORMContext* ctx) { UNUSED(ctx); }
public:
/* 0x004 */ s8 mNo;
/* 0x005 */ u8 field_0x05;
+4 -5
View File
@@ -9,10 +9,9 @@ struct fopMsgM_pane_class;
class J2DScreen;
struct ResTIMG;
class aramCmapDat_c;
class aramCmapDatPnt_t;
class dMenu_FmapSv_c;
struct aramCmapDatPat_t;
class dDlst_FMAP2GS_c : public dDlst_base_c {
public:
virtual ~dDlst_FMAP2GS_c() {}
@@ -39,7 +38,7 @@ public:
void getCtCurY() {}
void getCtDispMode() {}
void lineInter0to1ForU8(unsigned char, unsigned char, float) {}
void setAramCmapDat(aramCmapDatPat_t* i_ptr) { mpFmapDatPnt = i_ptr; }
void setAramCmapDat(aramCmapDat_c* i_ptr) { mpFmapDatPnt = i_ptr; }
void setCtActive(unsigned char) {}
void setCtCmapSelNo(signed char) {}
void setCtCurHX(signed char) {}
@@ -146,7 +145,7 @@ public:
void calcFinCollectMap();
void getNowCmapFirstNum();
void getNowCmapNextNum(signed char, int);
aramCmapDatPat_t* getCmapDatPnt4(int);
aramCmapDatPnt_t* getCmapDatPnt4(int);
void readPaneCmapTexture(const ResTIMG*, int);
void readFmapTexture(const char*);
int getButtonIconMode();
@@ -161,7 +160,7 @@ public:
/* 0x0004 */ u8 padding_0x4[0x10 - 0x4];
/* 0x0010 */ dMenu_FmapSv_c* fmapSv;
/* 0x0014 */ u8 padding_0x14[0x1C - 0x14];
/* 0x001C */ aramCmapDatPat_t* mpFmapDatPnt;
/* 0x001C */ aramCmapDat_c* mpFmapDatPnt;
/* 0x0020 */ dDlst_FMAP2_c mDlst;
/* 0x0024 */ u8 padding_0x24[0x28 - 0x24];
/* 0x0028 */ dDlst_FMAP2GS_c mDlstGs;
+103 -34
View File
@@ -1,31 +1,104 @@
#ifndef D_MENU_FMAP_SV_H
#define D_MENU_FMAP_SV_H
#ifndef D_MENU_FMAPSV_H
#define D_MENU_FMAPSV_H
#include "dolphin/types.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "global.h"
struct aramCmapSalvagePnt_t {
/* 0x0 */ s16 field_0x0;
/* 0x2 */ s16 field_0x2;
/* 0x4 */ s16 x;
/* 0x6 */ s16 y;
}; // Size: 0x8
struct aramCmapDatPnt_t {
/* 0x00 */ s8 gridNo;
/* 0x01 */ s8 collectMapNo;
/* 0x02 */ s8 cmapNo;
/* 0x03 */ s8 mapType;
/* 0x04 */ s16 field_0x4;
/* 0x06 */ aramCmapSalvagePnt_t salvagePnt[4];
}; // Size: 0x26
STATIC_ASSERT(sizeof(aramCmapDatPnt_t) == 0x26);
struct aramCmapDatPat_t {
/* 0x00 */ int num;
/* 0x04 */ aramCmapDatPnt_t pnt[];
}; // Size: 0x4+
class aramCmapDat_c {
public:
void init(aramCmapDatPat_t* a_pat) {
if (a_pat != NULL) {
mNum = a_pat->num;
mpPnt = a_pat->pnt;
} else {
JUT_ASSERT(252, FALSE);
}
}
void getAramCmapDatValue() {}
void getCmapDatPnt(int) {}
aramCmapDatPnt_t* getCmapDatPnt3(int i_gridIdx) {
aramCmapDatPnt_t* pnt = mpPnt;
int i;
for (i = 0; i < mNum; i++) {
if (pnt->gridNo == i_gridIdx + 1) {
break;
}
pnt++;
}
if (i < mNum) {
return pnt;
}
return NULL;
}
aramCmapDatPnt_t* getCmapDatPnt4(int i_cmapIdx) {
aramCmapDatPnt_t* pnt = mpPnt;
int i;
for (i = 0; i < mNum; i++) {
if (pnt->cmapNo == i_cmapIdx + 1) {
break;
}
pnt++;
}
if (i < mNum) {
return pnt;
}
return NULL;
}
private:
/* 0x00 */ int mNum;
/* 0x04 */ aramCmapDatPnt_t* mpPnt;
}; // Size: 0x8
class dMenu_FmapSv_c {
public:
dMenu_FmapSv_c() {
active = 0;
cmapSelNo = 0;
dispMode = 0;
fmapZoom = 0;
zoomGridX = -10;
zoomGridY = -10;
curX = -10;
curY = -10;
curWX = -10;
curWY = -10;
active = 0;
cmapSelNo = -1;
curHX = -10;
curHY = -10;
dispMode = 0;
fmapZoom = -1;
zoomGridX = -10;
zoomGridY = -10;
}
~dMenu_FmapSv_c() {}
s8 getActive() { return active; }
void setActive(s8 val) { active = val; }
s8 getCmapSelNo() { return cmapSelNo; }
void setCmapSelNo(s8 val) { cmapSelNo = val; }
u8 getDispMode() { return dispMode; }
void setDispMode(u8 val) { dispMode = val; }
u8 getFmapZoom() { return fmapZoom; }
void setFmapZoom(u8 val) { fmapZoom = val; }
s8 getZoomGridX() { return zoomGridX; }
void setZoomGridX(s8 val) { zoomGridX = val; }
s8 getZoomGridY() { return zoomGridY; }
void setZoomGridY(s8 val) { zoomGridY = val; }
s8 getCurX() { return curX; }
void setCurX(s8 val) { curX = val; }
s8 getCurY() { return curY; }
@@ -34,32 +107,28 @@ public:
void setCurWX(s8 val) { curWX = val; }
s8 getCurWY() { return curWY; }
void setCurWY(s8 val) { curWY = val; }
u8 getActive() { return active; }
void setActive(u8 val) { active = val; }
u8 getCmapSelNo() { return cmapSelNo; }
void setCmapSelNo(s8 val) { cmapSelNo = val; }
s8 getCurHX() { return curHX; }
void setCurHX(s8 val) { curHX = val; }
s8 getCurHY() { return curHY; }
void setCurHY(s8 val) { curHY = val; }
s8 getDispMode() { return dispMode; }
void setDispMode(s8 val) { dispMode = val; }
s8 getFmapZoom() { return fmapZoom; }
void setFmapZoom(s8 val) { fmapZoom = val; }
s8 getZoomGridX() { return zoomGridX; }
void setZoomGridX(s8 val) { zoomGridX = val; }
s8 getZoomGridY() { return zoomGridY; }
void setZoomGridY(s8 val) { zoomGridY = val; }
public:
/* 0x0 */ s8 active;
/* 0x1 */ s8 cmapSelNo;
/* 0x2 */ s8 curX;
/* 0x3 */ s8 curY;
/* 0x4 */ s8 curWX;
/* 0x5 */ s8 curWY;
/* 0x6 */ s8 curHX;
/* 0x7 */ s8 curHY;
/* 0x8 */ s8 dispMode;
/* 0x9 */ s8 fmapZoom;
/* 0xA */ s8 zoomGridX;
/* 0xB */ s8 zoomGridY;
/* 0x0 */ u8 dispMode;
/* 0x1 */ u8 fmapZoom;
/* 0x2 */ s8 zoomGridX;
/* 0x3 */ s8 zoomGridY;
/* 0x4 */ s8 curX;
/* 0x5 */ s8 curY;
/* 0x6 */ s8 curWX;
/* 0x7 */ s8 curWY;
/* 0x8 */ u8 active;
/* 0x9 */ s8 cmapSelNo;
/* 0xA */ s8 curHX;
/* 0xB */ s8 curHY;
};
#endif //D_MENU_FMAP_SV_H
#endif /* D_MENU_FMAPSV_H */