Skip to content

Commit

Permalink
Bit of Figurine Work (#665)
Browse files Browse the repository at this point in the history
* Bit of Figurine Work

Not super complete, was just poking around to figure a few things out

* Fix Build

I really need to stop having this every single time
  • Loading branch information
SuperDude88 authored Jul 10, 2024
1 parent a09fe96 commit 17a7656
Show file tree
Hide file tree
Showing 8 changed files with 1,601 additions and 116 deletions.
35 changes: 13 additions & 22 deletions include/d/actor/d_a_npc_mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ struct sMtAnmDat {

};

class daNpcMt_c : public fopAc_ac_c {
class daNpcMt_c : public fopNpc_npc_c {
public:
void attnOff() {}
void attnOn() {}
void getNpcNo() {}
void getPhaseP() {}
void setResFlag(unsigned char) {}
void setResFlag(u8) {}

daNpcMt_c();
s32 _create();
Expand All @@ -27,7 +27,7 @@ class daNpcMt_c : public fopAc_ac_c {
BOOL _draw();
BOOL _execute();
void executeCommon();
void executeSetMode(unsigned char);
void executeSetMode(u8);
void executeWaitInit();
void executeWait();
void executeTalkInit();
Expand All @@ -40,10 +40,10 @@ class daNpcMt_c : public fopAc_ac_c {
void eventMesSet();
void eventGetItemInit();
void talk2(int);
void next_msgStatus(unsigned long*);
void getMsg();
u16 next_msgStatus(u32*);
u32 getMsg();
void chkMsg();
void setMessage(unsigned long);
void setMessage(u32);
void setAnmFromMsgTag();
void getPrmNpcNo();
void setMtx();
Expand All @@ -52,27 +52,18 @@ class daNpcMt_c : public fopAc_ac_c {
void initTexPatternAnm(bool);
void playTexPatternAnm();
void playAnm();
void setAnm(unsigned char, int, float);
void setAnm(u8, int, f32);
void setAnmTbl(sMtAnmDat*);
void XyCheckCB(int);
void setCollision(dCcD_Cyl*, cXyz, float, float);
void setCollision(dCcD_Cyl*, cXyz, f32, f32);
void chkEndEvent();
void isFigureGet(unsigned char);
void setFigure(unsigned char);
void getFigureMakeNum();
void isComp();
void changePhotoNo(unsigned char);
bool isFigureGet(u8);
void setFigure(u8);
int getFigureMakeNum();
bool isComp();
void changePhotoNo(u8);

public:
/* 0x290 */ dNpc_JntCtrl_c mJnt;
/* 0x2C4 */ dNpc_EventCut_c mEventCut;
/* 0x328 */ u8 m328[0x330 - 0x328];
/* 0x330 */ mDoExt_McaMorf* mpMorf;
/* 0x334 */ dBgS_Acch mAcch;
/* 0x4F8 */ dBgS_AcchCir mAcchCir;
/* 0x538 */ dCcD_Stts mStts;
/* 0x574 */ dCcD_GObjInf mGObjInf;
/* 0x66C */ u8 m66C[0x6C4 - 0x66C];
/* 0x6C4 */ request_of_phase_process_class mPhsArcname;
/* 0x6CC */ request_of_phase_process_class mPhs;
/* 0x6D4 */ u8 m6D4[0x6D8 - 0x6D4];
Expand Down
60 changes: 35 additions & 25 deletions include/d/actor/d_a_obj_figure.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,38 @@ class daObjFigure_c : public fopAc_ac_c {
public:
daObjFigure_c();

void getFigureNo() {}
void getPhase1P() {}
void getPhase2P() {}
void isDispFigure() {}
void setResFlag(unsigned char) {}
u8 getFigureNo() { return mFigureNo; }
request_of_phase_process_class* getPhase1P() { return &mPhsFigure; }
request_of_phase_process_class* getPhase2P() { return &mPhsRoomArc; }
bool isDispFigure() { return mbDisplay; }
void setResFlag(u8 flag) { mLoadFlags |= flag; }

s32 _create();
void createHeap();
void createInit();
BOOL createHeap();
s32 createInit();
BOOL _delete();
BOOL _draw();
BOOL _execute();
void executeNormal();
void eventMove();
void privateCut();
void eventMesSetInit(int);
void eventMesSet();
bool eventMesSet();
void eventOnPlrInit();
void eventOffPlrInit();
void talk(int);
void next_msgStatus(unsigned long*);
void getMsg();
void setMessage(unsigned long);
void getPrmFigureNo();
u16 talk(int);
u16 next_msgStatus(u32*);
u32 getMsg();
void setMessage(u32);
u8 getPrmFigureNo();
void setMtx();
void isFigureGet(unsigned char);
void getFigureBmd(unsigned char);
BOOL isFigureGet(u8);
int getFigureBmd(u8);

enum Prm_e {
PRM_FIGURE_NO_W = 8,
PRM_FIGURE_NO_S = 0,
};

public:
/* 0x290 */ request_of_phase_process_class mPhsLoad;
Expand All @@ -56,22 +61,27 @@ class daObjFigure_c : public fopAc_ac_c {
/* 0x3F8 */ dCcD_Stts mStts;
/* 0x434 */ dCcD_Cyl mCyl1;
/* 0x564 */ dCcD_Cyl mCyl2;
/* 0x694 */ int m694;
/* 0x698 */ u8 m698[0x69C - 0x698];
/* 0x69C */ int m69C;
/* 0x694 */ uint m694;
/* 0x698 */ msg_class* mpCurrMsg;
/* 0x69C */ u32 m69C;
/* 0x6A0 */ dNpc_EventCut_c mEventCut;
/* 0x704 */ u8 m704[0x72C - 0x704];
/* 0x72C */ int m72C;
/* 0x70C */ cXyz m70C;
/* 0x718 */ cXyz m718;
/* 0x724 */ f32 m724;
/* 0x728 */ f32 m728;
/* 0x72C */ u32* m72C;
/* 0x730 */ s16 mFigureCheckEvtIdx;
/* 0x732 */ s16 m732;
/* 0x734 */ s16 m734;
/* 0x736 */ s16 m736;
/* 0x738 */ u8 m738[0x73C - 0x738];
/* 0x738 */ s16 m738;
/* 0x73A */ s16 m73A;
/* 0x73C */ u8 m73C;
/* 0x73D */ u8 mPrmFigureNo;
/* 0x73E */ u8 mbIsFigureGet;
/* 0x73F */ u8 m73F[0x741 - 0x73F];
/* 0x741 */ u8 m741;
/* 0x73D */ u8 mFigureNo;
/* 0x73E */ u8 mbDisplay;
/* 0x73F */ u8 m73F;
/* 0x740 */ u8 m740;
/* 0x741 */ s8 m741;
/* 0x742 */ u8 mLoadFlags;
/* 0x743 */ u8 m743[0x744 - 0x743];
};
Expand Down
2 changes: 1 addition & 1 deletion include/d/d_snap.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class dSnap_packet : public J3DPacket {
};

int dSnap_PhotoIndex2TableIndex(int);
u8 dSnap_GetFigRoomId(int);
int dSnap_GetFigRoomId(int);
void dSnap_MatDl();
void dSnap_AlphaClearDL();
void dSnap_Create();
Expand Down
4 changes: 2 additions & 2 deletions include/m_Do/m_Do_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ class mDoExt_invisibleModel {

class mDoExt_offCupOnAupPacket : public J3DPacket {
public:
~mDoExt_offCupOnAupPacket();
~mDoExt_offCupOnAupPacket() {}

void draw();

Expand All @@ -549,7 +549,7 @@ class mDoExt_offCupOnAupPacket : public J3DPacket {

class mDoExt_onCupOffAupPacket : public J3DPacket {
public:
~mDoExt_onCupOffAupPacket();
~mDoExt_onCupOffAupPacket() {}

void draw();

Expand Down
72 changes: 59 additions & 13 deletions src/d/actor/d_a_npc_mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,29 @@
//

#include "d/actor/d_a_npc_mt.h"
#include "d/d_com_inf_game.h"
#include "d/d_procname.h"

static u16 l_figure_comp[] = {
0x95FF,
0x94FF,
0x93FF,
0x92FF,
0x91FF,
0x90FF,
0x8FFF,
0x8EFF,
0x8DFF,
0x8CFF,
0xB1FF,
0x9CFF,
0x84FF,
0x83FF,
0x82FF,
0x81FF,
0x80FF,
};

/* 00000078-00000228 .text __ct__9daNpcMt_cFv */
daNpcMt_c::daNpcMt_c() {
/* Nonmatching */
Expand Down Expand Up @@ -72,7 +93,7 @@ void daNpcMt_c::executeCommon() {
}

/* 00001240-00001294 .text executeSetMode__9daNpcMt_cFUc */
void daNpcMt_c::executeSetMode(unsigned char) {
void daNpcMt_c::executeSetMode(u8) {
/* Nonmatching */
}

Expand Down Expand Up @@ -137,12 +158,12 @@ void daNpcMt_c::talk2(int) {
}

/* 000019BC-00001A8C .text next_msgStatus__9daNpcMt_cFPUl */
void daNpcMt_c::next_msgStatus(unsigned long*) {
u16 daNpcMt_c::next_msgStatus(u32*) {
/* Nonmatching */
}

/* 00001A8C-00001FC8 .text getMsg__9daNpcMt_cFv */
void daNpcMt_c::getMsg() {
u32 daNpcMt_c::getMsg() {
/* Nonmatching */
}

Expand All @@ -152,7 +173,7 @@ void daNpcMt_c::chkMsg() {
}

/* 00001FCC-00001FD4 .text setMessage__9daNpcMt_cFUl */
void daNpcMt_c::setMessage(unsigned long) {
void daNpcMt_c::setMessage(u32) {
/* Nonmatching */
}

Expand Down Expand Up @@ -197,7 +218,7 @@ void daNpcMt_c::playAnm() {
}

/* 0000280C-000028E4 .text setAnm__9daNpcMt_cFUcif */
void daNpcMt_c::setAnm(unsigned char, int, float) {
void daNpcMt_c::setAnm(u8, int, f32) {
/* Nonmatching */
}

Expand All @@ -212,7 +233,7 @@ void daNpcMt_c::XyCheckCB(int) {
}

/* 00002A28-00002AA0 .text setCollision__9daNpcMt_cFP8dCcD_Cyl4cXyzff */
void daNpcMt_c::setCollision(dCcD_Cyl*, cXyz, float, float) {
void daNpcMt_c::setCollision(dCcD_Cyl*, cXyz, f32, f32) {
/* Nonmatching */
}

Expand All @@ -222,27 +243,52 @@ void daNpcMt_c::chkEndEvent() {
}

/* 00002AFC-00002B98 .text isFigureGet__9daNpcMt_cFUc */
void daNpcMt_c::isFigureGet(unsigned char) {
bool daNpcMt_c::isFigureGet(u8) {
/* Nonmatching */
}

/* 00002B98-00002C38 .text setFigure__9daNpcMt_cFUc */
void daNpcMt_c::setFigure(unsigned char) {
void daNpcMt_c::setFigure(u8 figure) {
/* Nonmatching */

if(figure < 0x86) {
u8 reg = dComIfGs_getEventReg(l_figure_comp[figure / 8]);
reg |= 1 << (figure & 7);
dComIfGs_setEventReg(l_figure_comp[figure / 8], reg);
dComIfGs_onEventBit(0x3A01);
}
}

/* 00002C38-00002CA0 .text getFigureMakeNum__9daNpcMt_cFv */
void daNpcMt_c::getFigureMakeNum() {
/* Nonmatching */
int daNpcMt_c::getFigureMakeNum() {
int num = 0;

for(u8 i = 0; i < 0x86; i++) {
if(isFigureGet(i)) {
num++;
}
}

return num;
}

/* 00002CA0-00002D08 .text isComp__9daNpcMt_cFv */
void daNpcMt_c::isComp() {
/* Nonmatching */
bool daNpcMt_c::isComp() {
int ownedNum = getFigureMakeNum();
int totalNum = 0x84;
if(isFigureGet(0x32)) {
totalNum = 0x85;
}

if(ownedNum >= totalNum) {
return true;
}

return false;
}

/* 00002D08-00002D4C .text changePhotoNo__9daNpcMt_cFUc */
void daNpcMt_c::changePhotoNo(unsigned char) {
void daNpcMt_c::changePhotoNo(u8) {
/* Nonmatching */
}

Expand Down
Loading

0 comments on commit 17a7656

Please sign in to comment.