d_seafightgame, m_Do_machine_exception, m_Do_reset, m_Do_DVDError OK (#41)

* m_Do_machine_exception OK

* m_Do_Reset OK

* m_Do_DVDError OK

* some fixes for JP

* JP OK again

* d_seafightgame OK

* cleanup m_Do_Reset a bit
This commit is contained in:
TakaRikka
2023-09-16 13:46:37 -07:00
committed by GitHub
parent f00e07e4c4
commit 00fe8a0873
13 changed files with 515 additions and 76 deletions
+69
View File
@@ -0,0 +1,69 @@
#ifndef D_A_MGAMEBOARD_H
#define D_A_MGAMEBOARD_H
#include "f_op/f_op_actor_mng.h"
#include "d/d_seafightgame.h"
#include "d/d_lib.h"
class dDlst_2DNumber_c;
class dDlst_2DMinigame_c;
class dDlst_2DObject_c;
class daMgBoard_c : public fopAc_ac_c {
public:
void checkClearGame();
void getScore();
void reqStartGame();
void checkEndGame();
void setGInfoDraw();
void clrGInfoDraw();
void CreateHeap();
void set_2dposition();
void CreateInit();
void MiniGameInit();
void set_mtx();
void _execute();
void execGameMain();
void execEndGame();
void MinigameMain();
void CursorMove();
void _draw();
/* 0x290 */ request_of_phase_process_class mPhase;
/* 0x298 */ J3DModel* mpBoardModel;
/* 0x29C */ J3DModel* mpCursorModel;
/* 0x2A0 */ J3DModel* mpHitModel[20];
/* 0x2F0 */ J3DModel* mpMissModel[32];
/* 0x370 */ J3DModel* mpShip2Model[2];
/* 0x378 */ J3DModel* mpShip3Model[2];
/* 0x380 */ J3DModel* mpShip4Model;
/* 0x384 */ u8 field_0x384[0x468 - 0x384];
/* 0x468 */ u8 mBoardPosX;
/* 0x469 */ u8 mBoardPosY;
/* 0x46A */ u8 field_0x46A[0x46C - 0x46A];
/* 0x46C */ int mLastFirePosX;
/* 0x470 */ int mLastFirePosY;
/* 0x474 */ u8 field_0x474[0x47C - 0x474];
/* 0x47C */ dSeaFightGame_info_c mSeaFightGame;
/* 0x57C */ u8 field_0x57C[0x580 - 0x57C];
/* 0x580 */ int mMissModelCount;
/* 0x584 */ int mHitModelCount;
/* 0x588 */ s16 mMinigameStartIdx;
/* 0x58A */ s16 mMinigameEndIdx;
/* 0x58C */ STControl mStickControl;
/* 0x5B4 */ cXyz mNPCPos;
/* 0x5C0 */ dDlst_2DNumber_c* mpNumber0;
/* 0x5C4 */ dDlst_2DNumber_c* mpNumber1;
/* 0x5C8 */ dDlst_2DMinigame_c* mpMinigameDList;
/* 0x5CC */ dDlst_2DObject_c* mpSquidIcon[3];
/* 0x5D8 */ u8 mpBombIcons;
/* 0x5D9 */ u8 field_0x5D9[0x638 - 0x5D9];
/* 0x638 */ int mState;
/* 0x63C */ u8 mbDraw;
/* 0x63D */ u8 mbStartGame;
/* 0x63E */ u8 mbEndGame;
/* 0x63F */ u8 mbForceEnd;
/* 0x640 */ u8 mTimer;
};
#endif /* D_A_MGAMEBOARD_H */
+41
View File
@@ -0,0 +1,41 @@
#ifndef D_LIB_H
#define D_LIB_H
#include "dolphin/types.h"
class STControl {
public:
void STControl(s16, s16, s16, s16, f32, f32, s16, s16);
void setWaitParm(s16, s16, s16, s16, f32, f32, s16, s16);
void init();
void Xinit();
void Yinit();
void getValueStick();
void getAngleStick();
void checkTrigger();
void checkLeftTrigger();
void checkRightTrigger();
void checkUpTrigger();
void checkDownTrigger();
/* 0x00 */ void* vtbl;
/* 0x04 */ f32 field_0x04;
/* 0x08 */ f32 field_0x08;
/* 0x0C */ u8 field_0x0c;
/* 0x0D */ u8 field_0x0d;
/* 0x0E */ u16 field_0x0e;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ s16 field_0x14;
/* 0x16 */ s16 field_0x16;
/* 0x18 */ u16 field_0x18;
/* 0x1A */ u16 field_0x1a;
/* 0x1C */ u16 field_0x1c;
/* 0x1E */ u16 field_0x1e;
/* 0x20 */ u16 field_0x20;
/* 0x22 */ u16 field_0x22;
/* 0x24 */ s16 field_0x24;
/* 0x26 */ s16 field_0x26;
};
#endif /* D_LIB_H */
+32
View File
@@ -0,0 +1,32 @@
#ifndef D_SEAFIGHTGAME_H
#define D_SEAFIGHTGAME_H
#include "dolphin/types.h"
struct dSeaFightGame_ship_data {
/* 0x0 */ u8 m_pos[4][2];
/* 0x8 */ u8 field_0x8;
/* 0x9 */ u8 field_0x9;
/* 0xA */ u8 field_0xa;
/* 0xB */ u8 field_0xb;
/* 0xC */ u8 field_0xc;
/* 0xD */ u8 field_0xd;
/* 0xE */ u8 field_0xe;
};
class dSeaFightGame_info_c {
public:
int init(int, int);
int put_ship(u8, u8);
bool checkPutShip(int, int, int, int);
int attack(u8, u8);
/* 0x00 */ u8 mGrid[8][8];
/* 0x40 */ dSeaFightGame_ship_data mShips[4];
/* 0x7C */ u8 mAliveShipNum;
/* 0x7D */ u8 mBulletNum;
/* 0x7E */ u8 mScore;
/* 0x80 */ int mDeadShipNum;
};
#endif /* D_SEAFIGHTGAME_H */
+8
View File
@@ -0,0 +1,8 @@
#ifndef M_DO_M_DO_DVD_ERROR_H
#define M_DO_M_DO_DVD_ERROR_H
#include "dolphin/types.h"
void mDoDvdErr_ThdCleanup();
#endif /* M_DO_M_DO_DVD_ERROR_H */
+22 -22
View File
@@ -13,22 +13,11 @@ struct mDoRstData {
/* 0x04 */ int mResetPrepare;
/* 0x08 */ int m3ButtonReset;
/* 0x0C */ int m3ButtonResetPort;
/* 0x10 */ bool mShutdown;
/* 0x11 */ bool mReturnToMenu;
/* 0x12 */ u8 mLogoScnFlag;
/* 0x13 */ u8 mProgSeqFlag;
/* 0x14 */ u8 mProgChgFlag;
/* 0x15 */ u8 mWarningDispFlag;
}; // Size = 0x18
}; // Size = 0x10
class mDoRst {
public:
static void offReturnToMenu() { mResetData->mReturnToMenu = false; }
static void offShutdown() { mResetData->mShutdown = false; }
static void setWarningDispFlag(u8 flag) { mResetData->mWarningDispFlag = flag; }
static void setProgChgFlag(u8 flag) { mResetData->mProgChgFlag = flag; }
static void setProgSeqFlag(u8 flag) { mResetData->mProgSeqFlag = flag; }
static void setLogoScnFlag(u8 flag) { mResetData->mLogoScnFlag = flag; }
#if VERSION != VERSION_JP
static void set3ButtonResetPort(int port) { mResetData->m3ButtonResetPort = port; }
static void off3ButtonReset() { mResetData->m3ButtonReset = 0; }
static void offResetPrepare() { mResetData->mResetPrepare = 0; }
@@ -36,24 +25,35 @@ public:
mResetData->mReset = 0;
mResetData->mResetPrepare = 0;
}
static u8 getLogoScnFlag() { return mResetData->mLogoScnFlag; }
static u8 getProgSeqFlag() { return mResetData->mProgSeqFlag; }
static u8 getWarningDispFlag() { return mResetData->mWarningDispFlag; }
static BOOL isReturnToMenu() { return mResetData->mReturnToMenu; }
static BOOL isShutdown() { return mResetData->mShutdown; }
static int isReset() { return mResetData->mReset; }
static int get3ButtonResetPort() { return mResetData->m3ButtonResetPort; }
static int is3ButtonReset() { return mResetData->m3ButtonReset; }
static void onReset() { mResetData->mReset = 1; }
static void onReturnToMenu() { mResetData->mReturnToMenu = true; }
static void on3ButtonReset() { mResetData->m3ButtonReset = 1; }
static void onShutdown() { mResetData->mShutdown = true; }
static mDoRstData* getResetData();
static mDoRstData* i_getResetData() { return mResetData; }
static mDoRstData* getResetData() { return mResetData; }
static void setResetData(mDoRstData* rstData) { mResetData = rstData; }
static mDoRstData* mResetData;
#else
static void set3ButtonResetPort(int port) { m3ButtonResetPort = port; }
static void off3ButtonReset() { m3ButtonResetFlag = 0; }
static void offResetPrepare() { mResetPrepare = 0; }
static void offReset() {
mResetFlag = 0;
mResetPrepare = 0;
}
static int isReset() { return mResetFlag; }
static int get3ButtonResetPort() { return m3ButtonResetPort; }
static int is3ButtonReset() { return m3ButtonResetFlag; }
static void onReset() { mResetFlag = 1; }
static void on3ButtonReset() { m3ButtonResetFlag = 1; }
static int mResetPrepare;
static int mResetFlag;
static int m3ButtonResetFlag;
static int m3ButtonResetPort;
#endif
};
extern bool mDoDvdErr_initialized;
+1
View File
@@ -16,6 +16,7 @@ public:
static void offResetFlag() { mResetFlag = false; }
static bool isInitFlag() { return mInitFlag; }
static void offInitFlag() { mInitFlag = false; }
static bool isBgmSet() { return mBgmSet; }
static void offBgmSet() { mBgmSet = false; }
+16
View File
@@ -0,0 +1,16 @@
#ifndef M_DO_M_DO_MACHINE_EXCEPTION_H
#define M_DO_M_DO_MACHINE_EXCEPTION_H
#include "dolphin/types.h"
class JUTConsole;
void print_f(char const*, ...);
void print(char const*);
void dispHeapInfo();
void dispGameInfo();
void dispDateInfo();
void dispConsoleToTerminal();
void exception_addition(JUTConsole* pConsole);
#endif /* M_DO_M_DO_MACHINE_EXCEPTION_H */