diff --git a/configure.py b/configure.py index da91a0a6c..33c3a6b3f 100644 --- a/configure.py +++ b/configure.py @@ -318,6 +318,7 @@ LIBS = [ # machine Object(NonMatching, "m_Do/m_Do_main.cpp"), + Object(NonMatching, "m_Do/m_Do_audio.cpp"), Object(NonMatching, "m_Do/m_Do_controller_pad.cpp"), Object(Matching, "m_Do/m_Do_hostIO.cpp"), Object(NonMatching, "m_Do/m_Do_mtx.cpp"), diff --git a/include/JAZelAudio/JAIZelBasic.h b/include/JAZelAudio/JAIZelBasic.h index 842b90c45..bfc614ecf 100644 --- a/include/JAZelAudio/JAIZelBasic.h +++ b/include/JAZelAudio/JAIZelBasic.h @@ -1,6 +1,155 @@ #ifndef JAZELAUDIO_JAIZELBASIC_H #define JAZELAUDIO_JAIZELBASIC_H +#include "dolphin/types.h" + +class Vec; +class JAISound; +class JKRSolidHeap; +class JAIZelBasic { +public: + JAIZelBasic(); + + void zeldaGFrameWork(); + void heartGaugeOn(); + void processHeartGaugeSound(); + void gframeProcess(); + void resetProcess(); + void resetRecover(); + void bgmStreamPrepare(u32); + void bgmStreamPlay(); + void bgmStart(u32, u32, s32); + void bgmStop(u32, s32); + void mainBgmStopOnly(u32); + void subBgmStart(u32); + void subBgmStop(); + void subBgmStopInner(); + void bgmNowBattle(f32); + void bgmBattleGFrame(); + void stopBattleBgm(); + void bgmNowKaitengiri(); + void bgmHitSound(s32); + void bgmSetSwordUsing(s32); + void onEnemyDamage(); + void mbossBgmMuteProcess(); + void mbossBgmNearByProcess(f32); + void checkBgmPlaying(); + void checkPlayingMainBgmFlag(); + void checkSubBgmPlaying(); + void checkPlayingSubBgmFlag(); + void checkPlayingStreamBgmFlag(); + void changeBgmStatus(s32); + void changeSubBgmStatus(s32); + void bgmMuteMtDragon(); + void enemyNearBy(); + void enemyNearByGFrame(); + void bgmAllMute(u32); + void taktModeMute(); + void taktModeMuteOff(); + void cbPracticePlay(Vec*); + void cbPracticeProcess(); + void cbPracticeStop(); + void checkCbPracticePlay(); + void prepareLandingDemo(s32); + void startLandingDemo(); + void endLandingDemo(); + void initSe(); + void seStart(u32, Vec*, u32, s8, f32, f32, f32, f32, u8); + void seStop(u32, s32); + void checkSePlaying(u32); + void seStopActor(Vec*, u32); + void seDeleteObject(Vec*); + void getLinkVoiceVowel(u32); + void linkVoiceStart(u32, Vec*, u8, s8); + void monsSeInit(); + void monsSeStart(u32, Vec*, u32, u32, s8); + void kuroboMotionPlay(u32, Vec*, u32, s8); + void kuroboVoicePlay(u32, Vec*, s8); + void setLevObjSE(u32, Vec*, s8); + void processLevObjSE(); + void initLevObjSE(); + void charVoicePlay(s32, s32, Vec*, s8); + void messageSePlay(u16, Vec*, s8); + void shipCruiseSePlay(Vec*, f32); + void setShipSailState(s32); + void init(JKRSolidHeap*, u32); + void setOutputMode(u32); + void talkIn(); + void talkOut(); + void menuIn(); + void menuOut(); + void getCameraInfo(Vec*, f32*[][][][], u32); + void getCameraMapInfo(u32); + void setCameraPolygonPos(Vec*); + void setCameraGroupInfo(u8); + void changeSeaBgm(); + void startIsleBgm(); + void setLinkGroupInfo(u8); + void getMapInfoFxline(u32); + void getMapInfoFxParameter(u32); + void getMapInfoGround(u32); + void setScene(s32, s32, s32, s32); + void expandSceneBgmNum(u32); + void checkLinkOnSea(); + void checkLinkOnBoardSea(); + void setSceneName(char*, s32, s32); + void spotNameToId(char*); + void sceneChange(u32, u32, u32, s32); + void sceneBgmStart(); + void load1stDynamicWave(); + void check1stDynamicWave(); + void load2ndDynamicWave(); + void loadStaticWaves(); + void checkFirstWaves(); + void setLinkHp(s32, s32); + void setLinkSwordType(s32, s32); + void setLinkShieldType(s32, s32); + void setLinkBootsType(s32); + void setLinkOnBoard(s32); + void bgmMute(JAISound**, u32, s32, u32); + void checkStreamPlaying(u32); + void stWaterLevelUp(); + void stWaterLevelDown(); + void stSkyCloisters(); + void stSkyCloistersProcess(); + void getRandomU32(u32); + void setEventBit(void*); + void checkEventBit(u16); + void checkDayTime(); + void processTime(); + void processMorningToNormal(); + void checkOnOuterSea(f32*); + void makeSound(u32); + void checkSeqIDDemoPlaying(u32); + void checkDemoFanfarePlaying(); + void processDemoFanfareMute(); + void muteMainBgmAll(); + void unmuteMainBgmAll(); + void demoBgmStop(u32); + void isDemo(); + void checkSeaBgmID(); + void initSeaEnvPos(); + void registSeaEnvPos(Vec*); + void seaEnvSePlay(u32, s8); + void calcPosPanLR(Vec*); + void calcPosPanSR(Vec*, f32); + void calcPosVolume(Vec*, f32); + void seaShoreSE(u32, Vec*, u32, s8); + void initRiverPos(); + void registRiverPos(Vec*); + void riverSePlay(u8, s8); + void waterfallSePlay(u8, Vec*, s8); + void initWindowPos(); + void registWindowPos(Vec*); + void rainPlay(s32); + + static JAIZelBasic* getInterface() { return zel_basic; } + + static JAIZelBasic* zel_basic; + + /* 0x0 */ u8 field_0x0[0x20F4]; +}; + class JAIZelAnime { public: /* 0x0 */ u8 field_0x0[0x98]; diff --git a/include/SSystem/SComponent/c_bg_s_chk.h b/include/SSystem/SComponent/c_bg_s_chk.h index 8367b50e2..f78a86dbd 100644 --- a/include/SSystem/SComponent/c_bg_s_chk.h +++ b/include/SSystem/SComponent/c_bg_s_chk.h @@ -2,6 +2,7 @@ #define C_BG_S_CHK_H #include "dolphin/mtx/vec.h" +#include "global.h" struct cBgD_Vtx_t : public Vec {}; @@ -32,7 +33,9 @@ public: cBgS_PolyPassChk* GetPolyPassChk() const { return mPolyPassChk; } cBgS_GrpPassChk* GetGrpPassChk() const { return mGrpPassChk; } - virtual ~cBgS_Chk(void); + virtual ~cBgS_Chk(); }; // Size: 0x14 +STATIC_ASSERT(sizeof(cBgS_Chk) == 0x14); + #endif /* C_BG_S_CHK_H */ diff --git a/include/SSystem/SComponent/c_bg_s_gnd_chk.h b/include/SSystem/SComponent/c_bg_s_gnd_chk.h index 77e0a9914..c669863d2 100644 --- a/include/SSystem/SComponent/c_bg_s_gnd_chk.h +++ b/include/SSystem/SComponent/c_bg_s_gnd_chk.h @@ -24,6 +24,9 @@ private: /* 0x30 */ u32 mFlags; /* 0x34 */ f32 mNowY; /* 0x38 */ u32 mWallPrecheck; + /* 0x3C */ u32 mGndPrecheck; }; +STATIC_ASSERT(sizeof(cBgS_GndChk) == 0x40); + #endif /* C_BG_S_GND_CHK_H */ diff --git a/include/SSystem/SComponent/c_bg_s_poly_info.h b/include/SSystem/SComponent/c_bg_s_poly_info.h index 2ac1d58e4..55c265b49 100644 --- a/include/SSystem/SComponent/c_bg_s_poly_info.h +++ b/include/SSystem/SComponent/c_bg_s_poly_info.h @@ -32,4 +32,6 @@ public: } }; // Size: 0x10 +STATIC_ASSERT(sizeof(cBgS_PolyInfo) == 0x10); + #endif /* C_BG_S_POLY_INFO_H */ diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index 509b15bd5..005bd6cef 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -186,9 +186,12 @@ public: /* 0x0D0 */ f32 field_0xd8; /* 0x0D4 */ dBgS_GndChk m_gnd; /* 0x128 */ dBgS_RoofChk m_roof; + /* 0x16C */ u8 field_0x16c[0x174 - 0x16C]; /* 0x174 */ dBgS_WtrChk m_wtr; }; // Size: 0x1C4 +STATIC_ASSERT(sizeof(dBgS_Acch) == 0x1C4); + class dBgS_LinkAcch : public dBgS_Acch { public: dBgS_LinkAcch() { /* SetLink(); */ } diff --git a/include/d/d_bg_s_chk.h b/include/d/d_bg_s_chk.h index 08c24f34d..bfeb5b42c 100644 --- a/include/d/d_bg_s_chk.h +++ b/include/d/d_bg_s_chk.h @@ -13,4 +13,6 @@ public: virtual ~dBgS_Chk(); }; // Size: 0x14 +STATIC_ASSERT(sizeof(dBgS_Chk) == 0x14); + #endif /* D_BG_D_BG_S_CHK_H */ \ No newline at end of file diff --git a/include/d/d_bg_s_gnd_chk.h b/include/d/d_bg_s_gnd_chk.h index 7c81b7350..a597bb64f 100644 --- a/include/d/d_bg_s_gnd_chk.h +++ b/include/d/d_bg_s_gnd_chk.h @@ -10,6 +10,8 @@ public: /* 800775F0 */ virtual ~dBgS_GndChk(); }; // Size: 0x54 +STATIC_ASSERT(sizeof(dBgS_GndChk) == 0x54); + class dBgS_LinkGndChk : public dBgS_GndChk { public: dBgS_LinkGndChk() { /* SetLink(); */ } diff --git a/include/d/d_bg_s_grp_pass_chk.h b/include/d/d_bg_s_grp_pass_chk.h index 3e8960337..e107c08b1 100644 --- a/include/d/d_bg_s_grp_pass_chk.h +++ b/include/d/d_bg_s_grp_pass_chk.h @@ -27,4 +27,6 @@ private: /* 0x4 */ u32 mGrp; }; +STATIC_ASSERT(sizeof(dBgS_GrpPassChk) == 0x8); + #endif /* D_BG_D_BG_S_GRP_PASS_CHK_H */ \ No newline at end of file diff --git a/include/d/d_bg_s_poly_pass_chk.h b/include/d/d_bg_s_poly_pass_chk.h index 4b0c596bc..99507e5dc 100644 --- a/include/d/d_bg_s_poly_pass_chk.h +++ b/include/d/d_bg_s_poly_pass_chk.h @@ -6,6 +6,14 @@ class cBgS_PolyPassChk { public: virtual ~cBgS_PolyPassChk(); + + /* 0x4 */ u8 mbObjThrough; + /* 0x5 */ u8 mbCamThrough; + /* 0x6 */ u8 mbLinkThrough; + /* 0x7 */ u8 mbArrowsAndLightThrough; + /* 0x8 */ u8 mbBombThrough; + /* 0x9 */ u8 mbBoomerangThrough; + /* 0xA */ u8 mbHookshotThrough; }; class dBgS_PolyPassChk : public cBgS_PolyPassChk { @@ -14,4 +22,6 @@ public: virtual ~dBgS_PolyPassChk(); }; +STATIC_ASSERT(sizeof(dBgS_PolyPassChk) == 0xC); + #endif /* D_BG_D_BG_S_POLY_PASS_CHK_H */ \ No newline at end of file diff --git a/include/d/d_bg_s_roof_chk.h b/include/d/d_bg_s_roof_chk.h index b91037ac0..fb234e054 100644 --- a/include/d/d_bg_s_roof_chk.h +++ b/include/d/d_bg_s_roof_chk.h @@ -20,6 +20,8 @@ private: /* 0x38 */ cXyz m_pos; }; // Size: 0x44 +STATIC_ASSERT(sizeof(dBgS_RoofChk) == 0x44); + class dBgS_LinkRoofChk : public dBgS_RoofChk { public: dBgS_LinkRoofChk() { /* SetLink(); */ } diff --git a/include/d/d_bg_s_wtr_chk.h b/include/d/d_bg_s_wtr_chk.h index ce70935e7..5069ae1a6 100644 --- a/include/d/d_bg_s_wtr_chk.h +++ b/include/d/d_bg_s_wtr_chk.h @@ -10,4 +10,6 @@ public: /* 8001DF30 */ virtual ~dBgS_WtrChk(); }; // Size: 0x50 +STATIC_ASSERT(sizeof(dBgS_WtrChk) == 0x50); + #endif /* D_BG_D_BG_S_WTR_CHK_H */ \ No newline at end of file diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index db22bfd60..022c4f011 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -309,7 +309,7 @@ public: class dComIfG_inf_c { public: dComIfG_inf_c() { ct(); } - ~dComIfG_inf_c(); + ~dComIfG_inf_c() {} void ct(); @@ -344,6 +344,10 @@ inline void dComIfGs_setEventReg(u16 i_reg, u8 i_no) { g_dComIfG_gameInfo.save.getEvent().setEventReg(i_reg, i_no); } +inline u8 dComIfGs_getEventReg(u16 i_reg) { + return g_dComIfG_gameInfo.save.getEvent().getEventReg(i_reg); +} + inline BOOL dComIfGs_isEventBit(u16 id) { return g_dComIfG_gameInfo.save.getEvent().isEventBit(id); } @@ -503,6 +507,18 @@ inline dBgS* dComIfG_Bgsp() { return &g_dComIfG_gameInfo.play.mBgS; } +inline daShip_c* dComIfGp_getShipActor() { + return (daShip_c*)g_dComIfG_gameInfo.play.getPlayerPtr(2); +} + +inline void dComIfGp_getIkadaShipBeforePos(Vec* o_pos) { + *o_pos = g_dComIfG_gameInfo.play.mIkadaLinkPos; +} + +inline dStage_stageDt_c& dComIfGp_getStage() { + return g_dComIfG_gameInfo.play.getStage(); +} + inline daPy_lk_c* daPy_getPlayerLinkActorClass() { return (daPy_lk_c*)g_dComIfG_gameInfo.play.getPlayerPtr(0); } diff --git a/include/d/d_demo.h b/include/d/d_demo.h new file mode 100644 index 000000000..aad241265 --- /dev/null +++ b/include/d/d_demo.h @@ -0,0 +1,61 @@ +#ifndef D_DEMO_H +#define D_DEMO_H + +#include "dolphin/types.h" + +class dDemo_actor_c; +class dDemo_camera_c; +class dDemo_ambient_c; +class dDemo_light_c; +class dDemo_system_c; +class TControl; +class dMesg_tControl; + +class dDemo_object_c { +public: + dDemo_object_c(); + ~dDemo_object_c(); + + void appendActor(fopAc_ac_c*); + void getActor(u8); + void createCamera(); + void getActiveCamera(); + void createAmbient(); + void appendLight(); + void createFog(); + void remove(); + + /* 0x00 */ u8 mNumActor; + /* 0x01 */ u8 mNumLight; + /* 0x04 */ dDemo_actor_c* mpActors[32]; + /* 0x84 */ dDemo_camera_c* mpActiveCamera; + /* 0x88 */ dDemo_ambient_c* mpAmbient; + /* 0x8C */ dDemo_light_c* mpLight[8]; + /* 0xAC */ u8 field_0xac[4]; +}; + +class dDemo_manager_c { +public: + dDemo_manager_c(); + ~dDemo_manager_c(); + + void create(u8 const*, cXyz*, f32); + void remove(); + void update(); + + /* 0x00 */ dDemo_system_c* mpSystem; + /* 0x04 */ TControl* mpControl; + /* 0x08 */ void* mpStage; + /* 0x0C */ void* mpAudio; + /* 0x10 */ void* mpParticle; + /* 0x14 */ void* field_0x14; + /* 0x18 */ dMesg_tControl* mpMesgControl; + /* 0x1C */ void* mpMessage; + /* 0x20 */ dDemo_object_c mDemoObj; + /* 0xD0 */ void* field_0xd0; + /* 0xD4 */ void* field_0xd4; + /* 0xD8 */ int field_0xd8; + /* 0xDC */ int mState; +}; + +#endif /* D_DEMO_H */ \ No newline at end of file diff --git a/include/d/d_grass.h b/include/d/d_grass.h index cc614a28c..83863f999 100644 --- a/include/d/d_grass.h +++ b/include/d/d_grass.h @@ -30,53 +30,53 @@ public: class dGrass_anm_c { public: - dGrass_anm_c(); + dGrass_anm_c(); - /* 0x00 */ u8 mState; - /* 0x02 */ s16 mRotY; - /* 0x04 */ s16 mRotX; - /* 0x08 */ Mtx mAnimMtx; + /* 0x00 */ u8 mState; + /* 0x02 */ s16 mRotY; + /* 0x04 */ s16 mRotX; + /* 0x08 */ Mtx mAnimMtx; }; class dGrass_room_c { public: - void newData(dGrass_data_c*); - void deleteData(); - dGrass_room_c(); + void newData(dGrass_data_c*); + void deleteData(); + dGrass_room_c(); - /* 0x0 */ dGrass_data_c* mpData; + /* 0x0 */ dGrass_data_c* mpData; }; class dGrass_packet_c : public J3DPacket { public: - dGrass_packet_c(); - - void calc(); - void update(); - void setData(dGrass_data_c*, int, cXyz&, int, s8); - void newData(cXyz&, int, s8); - void newAnm(); - void setAnm(int, s16); + dGrass_packet_c(); + + void calc(); + void update(); + void setData(dGrass_data_c*, int, cXyz&, int, s8); + void newData(cXyz&, int, s8); + void newAnm(); + void setAnm(int, s16); virtual void draw(); virtual ~dGrass_packet_c(); - /* 0x00010 */ s16 mRndm; - /* 0x00012 */ u8 field_0x00012[0x00014 - 0x00012]; - /* 0x00014 */ dGrass_data_c mGrassData[1500]; - /* 0x18E84 */ dGrass_anm_c mGrassAnm[104]; - /* 0x1A544 */ dGrass_room_c mGrassRoom[64]; - /* 0x1A644 */ f32* mpPosArr; - /* 0x1A648 */ GXColor* mpColorArr; - /* 0x1A64C */ f32* mpTexCoordArr; - /* 0x1A650 */ void* mpMatDL; - /* 0x1A654 */ u32 mMatDLSize; - /* 0x1A658 */ void* mpDL; - /* 0x1A65C */ u32 mDLSize; - /* 0x1A660 */ void* mpDLCut; - /* 0x1A664 */ u32 mDLCutSize; - /* 0x1A668 */ u16 mCoParticle; - /* 0x1A66A */ u16 field_0x1a66a; + /* 0x00010 */ s16 mRndm; + /* 0x00012 */ u8 field_0x00012[0x00014 - 0x00012]; + /* 0x00014 */ dGrass_data_c mGrassData[1500]; + /* 0x18E84 */ dGrass_anm_c mGrassAnm[104]; + /* 0x1A544 */ dGrass_room_c mGrassRoom[64]; + /* 0x1A644 */ f32* mpPosArr; + /* 0x1A648 */ GXColor* mpColorArr; + /* 0x1A64C */ f32* mpTexCoordArr; + /* 0x1A650 */ void* mpMatDL; + /* 0x1A654 */ u32 mMatDLSize; + /* 0x1A658 */ void* mpDL; + /* 0x1A65C */ u32 mDLSize; + /* 0x1A660 */ void* mpDLCut; + /* 0x1A664 */ u32 mDLCutSize; + /* 0x1A668 */ u16 mCoParticle; + /* 0x1A66A */ u16 field_0x1a66a; }; #endif /* D_GRASS_H */ \ No newline at end of file diff --git a/include/d/d_kankyo.h b/include/d/d_kankyo.h index 700495906..f857d33cb 100644 --- a/include/d/d_kankyo.h +++ b/include/d/d_kankyo.h @@ -62,6 +62,7 @@ extern dScnKy_env_light_c g_env_light; int dKy_getdaytime_hour(); BOOL dKy_checkEventNightStop(); +void dKy_set_nexttime(f32); #endif /* D_KANKYO_D_KANKYO_H */ diff --git a/include/d/d_magma.h b/include/d/d_magma.h index 47b3eb542..3219cc8dd 100644 --- a/include/d/d_magma.h +++ b/include/d/d_magma.h @@ -8,53 +8,53 @@ class dMagma_ball_c; class dMagma_floor_c { public: - void draw(); - void calc(int); - void update(); - void create(cXyz&, cXyz&, s16, u8, int); - void remove(); + void draw(); + void calc(int); + void update(); + void create(cXyz&, cXyz&, s16, u8, int); + void remove(); - ~dMagma_floor_c(); - dMagma_floor_c(); + ~dMagma_floor_c(); + dMagma_floor_c(); - /* 0x00 */ dMagma_ball_c** mpBalls; - /* 0x04 */ u8 mBallNum; - /* 0x05 */ u8 mPathNo; - /* 0x06 */ u8 field_0x06[0x08 - 0x06]; - /* 0x08 */ cXyz mBallPos; - /* 0x14 */ f32 field_0x14; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ Mtx mPosMtx; - /* 0x4C */ Mtx mTexMtx0; - /* 0x7C */ Mtx mBallPostMtx0; - /* 0xAC */ dMagma_floor_c* mpNext; + /* 0x00 */ dMagma_ball_c** mpBalls; + /* 0x04 */ u8 mBallNum; + /* 0x05 */ u8 mPathNo; + /* 0x06 */ u8 field_0x06[0x08 - 0x06]; + /* 0x08 */ cXyz mBallPos; + /* 0x14 */ f32 field_0x14; + /* 0x18 */ f32 field_0x18; + /* 0x1C */ Mtx mPosMtx; + /* 0x4C */ Mtx mTexMtx0; + /* 0x7C */ Mtx mBallPostMtx0; + /* 0xAC */ dMagma_floor_c* mpNext; }; class dMagma_room_c{ public: - void newFloor(dMagma_floor_c*); - void deleteFloor(); + void newFloor(dMagma_floor_c*); + void deleteFloor(); - dMagma_room_c(); + dMagma_room_c(); - /* 0x0 */ dMagma_floor_c* mpFirst; + /* 0x0 */ dMagma_floor_c* mpFirst; }; class dMagma_packet_c : public J3DPacket { public: - dMagma_packet_c(); - void calc(); - void update(); - void checkYpos(cXyz&); - void newFloor(cXyz&, cXyz&, int, s16); + dMagma_packet_c(); + void calc(); + void update(); + void checkYpos(cXyz&); + void newFloor(cXyz&, cXyz&, int, s16); virtual void draw(); virtual ~dMagma_packet_c(); - - /* 0x010 */ dMagma_floor_c mFloor[8]; - /* 0x590 */ dMagma_room_c mRoom[64]; - /* 0x690 */ GXColor mColor1; - /* 0x694 */ f32 mTimer; + + /* 0x010 */ dMagma_floor_c mFloor[8]; + /* 0x590 */ dMagma_room_c mRoom[64]; + /* 0x690 */ GXColor mColor1; + /* 0x694 */ f32 mTimer; }; #endif /* D_MAGMA_H */ \ No newline at end of file diff --git a/include/d/d_particle.h b/include/d/d_particle.h index eae5ceb03..d3e2c644c 100644 --- a/include/d/d_particle.h +++ b/include/d/d_particle.h @@ -16,73 +16,73 @@ struct csXyz; class dPa_simpleData_c { public: - ~dPa_simpleData_c(); - dPa_simpleData_c(); + ~dPa_simpleData_c(); + dPa_simpleData_c(); - /* 0x00 */ Vec mPos; - /* 0x0C */ GXColor mPrmColor; - /* 0x10 */ u8 mEnvColor[3]; - /* 0x13 */ u8 mbAffectedByWind; + /* 0x00 */ Vec mPos; + /* 0x0C */ GXColor mPrmColor; + /* 0x10 */ u8 mEnvColor[3]; + /* 0x13 */ u8 mbAffectedByWind; }; class dPa_simpleEcallBack { public: - dPa_simpleEcallBack(); + dPa_simpleEcallBack(); ~dPa_simpleEcallBack(); - void executeAfter(JPABaseEmitter*); - void draw(JPABaseEmitter*); - void create(JPAEmitterManager*, u16, u8); - void createEmitter(JPAEmitterManager*); - void set(cXyz const*, u8, GXColor const&, GXColor const&, int); + void executeAfter(JPABaseEmitter*); + void draw(JPABaseEmitter*); + void create(JPAEmitterManager*, u16, u8); + void createEmitter(JPAEmitterManager*); + void set(cXyz const*, u8, GXColor const&, GXColor const&, int); - /* 0x000 */ void* vtbl; - /* 0x004 */ JPABaseEmitter* mpBaseEmitter; - /* 0x008 */ u16 mResID; - /* 0x00A */ u8 mGrpID; - /* 0x00B */ u8 mbIsSmoke; - /* 0x00C */ s16 mCount; - /* 0x00E */ u8 field_0x00E[0x010 - 0x00E]; - /* 0x010 */ dPa_simpleData_c mSimpleData[32]; + /* 0x000 */ void* vtbl; + /* 0x004 */ JPABaseEmitter* mpBaseEmitter; + /* 0x008 */ u16 mResID; + /* 0x00A */ u8 mGrpID; + /* 0x00B */ u8 mbIsSmoke; + /* 0x00C */ s16 mCount; + /* 0x00E */ u8 field_0x00E[0x010 - 0x00E]; + /* 0x010 */ dPa_simpleData_c mSimpleData[32]; }; class dPa_control_c { public: - dPa_control_c(); + dPa_control_c(); - void getRM_ID(u16); - void swapFrameBufferTexture(); - void createCommon(void const*); - void createRoomScene(void const*); - void readScene(u8, mDoDvdThd_toMainRam_c**); - void createScene(void const*); - void removeRoomScene(); - void removeScene(); - void calc3D(); - void calc2D(); - void calcMenu(); - void draw(JPADrawInfo*, u8); - JPABaseEmitter * set(u8, u16, cXyz const*, csXyz const*, cXyz const*, u8, dPa_levelEcallBack*, s8, GXColor const*, GXColor const*, cXyz const*); - void setBombSmoke(u16, cXyz const*, csXyz const*, cXyz const*, u8); - void setSimpleLand(int, cXyz const*, csXyz const*, f32, f32, f32, dKy_tevstr_c*, int*, int); - void setSimpleLand(cBgS_PolyInfo&, cXyz const*, csXyz const*, f32, f32, f32, dKy_tevstr_c*, int*, int); - void checkAtrCodeEffect(int); - void setNormalStripes(u16, cXyz const*, csXyz const*, cXyz const*, u8, u16); - void newSimple(u16, u8); - void setSimple(u16, cXyz const*, u8, GXColor const&, GXColor const&, int); - void getSimple(u16); + void getRM_ID(u16); + void swapFrameBufferTexture(); + void createCommon(void const*); + void createRoomScene(void const*); + void readScene(u8, mDoDvdThd_toMainRam_c**); + void createScene(void const*); + void removeRoomScene(); + void removeScene(); + void calc3D(); + void calc2D(); + void calcMenu(); + void draw(JPADrawInfo*, u8); + JPABaseEmitter * set(u8, u16, cXyz const*, csXyz const*, cXyz const*, u8, dPa_levelEcallBack*, s8, GXColor const*, GXColor const*, cXyz const*); + void setBombSmoke(u16, cXyz const*, csXyz const*, cXyz const*, u8); + void setSimpleLand(int, cXyz const*, csXyz const*, f32, f32, f32, dKy_tevstr_c*, int*, int); + void setSimpleLand(cBgS_PolyInfo&, cXyz const*, csXyz const*, f32, f32, f32, dKy_tevstr_c*, int*, int); + void checkAtrCodeEffect(int); + void setNormalStripes(u16, cXyz const*, csXyz const*, cXyz const*, u8, u16); + void newSimple(u16, u8); + void setSimple(u16, cXyz const*, u8, GXColor const&, GXColor const&, int); + void getSimple(u16); - /* 0x0000 */ JKRHeap* mpHeap; - /* 0x0004 */ JPAResourceManager* mpCommonResMgr; - /* 0x0008 */ dPa_modelControl_c* mModelCtrl; - /* 0x000C */ JKRHeap* mpSceneHeap; - /* 0x0010 */ void* mpData; - /* 0x0014 */ JPAResourceManager* mpSceneResMgr; - /* 0x0018 */ u8 mSceneNo; - /* 0x0019 */ u8 mCount; - /* 0x001A */ u8 mNumSimple; - /* 0x001B */ u8 mNumSimpleCommon; - /* 0x001C */ dPa_simpleEcallBack mSimpleCallbacks[25]; + /* 0x0000 */ JKRHeap* mpHeap; + /* 0x0004 */ JPAResourceManager* mpCommonResMgr; + /* 0x0008 */ dPa_modelControl_c* mModelCtrl; + /* 0x000C */ JKRHeap* mpSceneHeap; + /* 0x0010 */ void* mpData; + /* 0x0014 */ JPAResourceManager* mpSceneResMgr; + /* 0x0018 */ u8 mSceneNo; + /* 0x0019 */ u8 mCount; + /* 0x001A */ u8 mNumSimple; + /* 0x001B */ u8 mNumSimpleCommon; + /* 0x001C */ dPa_simpleEcallBack mSimpleCallbacks[25]; }; #endif /* D_PARTICLE */ \ No newline at end of file diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 48982611c..bc4135554 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -24,9 +24,18 @@ struct stage_stag_info_class { /* 0x1C */ u32 field_0x1c; }; -struct stage_scls_info_class {}; +struct stage_scls_info_class { + /* 0x0 */ char mStage[8]; + /* 0x8 */ u8 mStart; + /* 0x9 */ u8 mRoom; + /* 0xA */ u8 field_0xa; + /* 0xB */ s8 mWipe; +}; -struct stage_scls_info_dummy_class {}; +struct stage_scls_info_dummy_class { + /* 0x00 */ int num; + /* 0x04 */ stage_scls_info_class* m_entries; +}; struct stage_lightvec_info_class {}; @@ -433,22 +442,22 @@ public: dStage_roomControl_c() {} void init(); - dStage_roomStatus_c* getStatusRoomDt(int); - bool checkRoomDisp(int) const; - int loadRoom(int, u8*); - void zoneCountCheck(int) const; - void checkDrawArea() const; - void getDarkStatus(); - void getDarkMode(); + dStage_roomStatus_c* getStatusRoomDt(int); + bool checkRoomDisp(int) const; + int loadRoom(int, u8*); + void zoneCountCheck(int) const; + void checkDrawArea() const; + void getDarkStatus(); + void getDarkMode(); void getBgW(int); - static void createMemoryBlock(int, u32); - static void destroyMemoryBlock(void); - static void SetTimePass(int); - static JKRExpHeap* getMemoryBlock(int); - static void setStayNo(int); - static s8 GetTimePass(); - static void setZoneNo(int, int); + static void createMemoryBlock(int, u32); + static void destroyMemoryBlock(void); + static void SetTimePass(int); + static JKRExpHeap* getMemoryBlock(int); + static void setStayNo(int); + static s8 GetTimePass(); + static void setZoneNo(int, int); static int getZoneNo(int i_roomNo); static s8 getStayNo() { return mStayNo; } @@ -524,9 +533,15 @@ private: }; // Size: 0xE s8 dStage_roomRead_dt_c_GetReverbStage(roomRead_class&, int); +int dStage_mapInfo_GetOceanZ(stage_map_info_class*); +int dStage_mapInfo_GetOceanX(stage_map_info_class*); inline s32 dStage_stagInfo_GetSaveTbl(stage_stag_info_class* i_stagInfo) { return (i_stagInfo->field_0x09 >> 1) & 0x7F; } +inline u32 dStage_stagInfo_GetSTType(stage_stag_info_class* i_stagInfo) { + return (i_stagInfo->field_0x0c >> 16) & 7; +} + #endif /* D_D_STAGE_H */ \ No newline at end of file diff --git a/include/d/d_tree.h b/include/d/d_tree.h index d609ec8b6..50fd94765 100644 --- a/include/d/d_tree.h +++ b/include/d/d_tree.h @@ -7,46 +7,46 @@ class dTree_data_c { public: - ~dTree_data_c(); + ~dTree_data_c(); dTree_data_c(); - void WorkCo(fopAc_ac_c*, u32, int); - void WorkAt_NoCutAnim(fopAc_ac_c*, u32, int, dCcMassS_HitInf*, cCcD_Obj*); - void WorkAt(fopAc_ac_c*, u32, int, dCcMassS_HitInf*); - void hitCheck(fopAc_ac_c*, int); - void animation(int); - - /* 0x000 */ u8 field_0x000; - /* 0x001 */ u8 field_0x001; - /* 0x002 */ u8 mAnimIdx; - /* 0x003 */ s8 field_0x003; - /* 0x004 */ cXyz mPos; - /* 0x010 */ Mtx field_0x010; - /* 0x040 */ Mtx field_0x040; - /* 0x070 */ Mtx field_0x070; - /* 0x0A0 */ Mtx mShadowMtx; - /* 0x0D0 */ u8 field_0x0D0[0x100 - 0x0D0]; - /* 0x100 */ dTree_data_c* mpNext; + void WorkCo(fopAc_ac_c*, u32, int); + void WorkAt_NoCutAnim(fopAc_ac_c*, u32, int, dCcMassS_HitInf*, cCcD_Obj*); + void WorkAt(fopAc_ac_c*, u32, int, dCcMassS_HitInf*); + void hitCheck(fopAc_ac_c*, int); + void animation(int); + + /* 0x000 */ u8 field_0x000; + /* 0x001 */ u8 field_0x001; + /* 0x002 */ u8 mAnimIdx; + /* 0x003 */ s8 field_0x003; + /* 0x004 */ cXyz mPos; + /* 0x010 */ Mtx field_0x010; + /* 0x040 */ Mtx field_0x040; + /* 0x070 */ Mtx field_0x070; + /* 0x0A0 */ Mtx mShadowMtx; + /* 0x0D0 */ u8 field_0x0D0[0x100 - 0x0D0]; + /* 0x100 */ dTree_data_c* mpNext; }; class dTree_anm_c { public: - ~dTree_anm_c(); - dTree_anm_c(); + ~dTree_anm_c(); + dTree_anm_c(); - /* 0x00 */ u8 field_0x00[0x02 - 0x00]; - /* 0x02 */ s16 field_0x02; - /* 0x04 */ s16 field_0x04; - /* 0x06 */ u8 field_0x06[0x08 - 0x06]; - /* 0x08 */ s16 field_0x08; - /* 0x0A */ s16 field_0x0a; - /* 0x0C */ f32 mAnimTimer; - /* 0x10 */ f32 field_0x10; - /* 0x14 */ f32 field_0x14; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ f32 field_0x1c; - /* 0x20 */ f32 field_0x20; - /* 0x24 */ Mtx field_0x24; + /* 0x00 */ u8 field_0x00[0x02 - 0x00]; + /* 0x02 */ s16 field_0x02; + /* 0x04 */ s16 field_0x04; + /* 0x06 */ u8 field_0x06[0x08 - 0x06]; + /* 0x08 */ s16 field_0x08; + /* 0x0A */ s16 field_0x0a; + /* 0x0C */ f32 mAnimTimer; + /* 0x10 */ f32 field_0x10; + /* 0x14 */ f32 field_0x14; + /* 0x18 */ f32 field_0x18; + /* 0x1C */ f32 field_0x1c; + /* 0x20 */ f32 field_0x20; + /* 0x24 */ Mtx field_0x24; /* 0x54 */ u8 field_0x54[0x84 - 0x54]; }; @@ -54,34 +54,34 @@ class dTree_room_c { public: dTree_room_c(); - void newData(dTree_data_c*); - void deleteData(); + void newData(dTree_data_c*); + void deleteData(); - /* 0x0 */ dTree_data_c* mpHead; + /* 0x0 */ dTree_data_c* mpHead; }; class dTree_packet_c : public J3DPacket { public: - dTree_packet_c(); + dTree_packet_c(); - void calc(); - void update(); - void setData(dTree_data_c*, int, cXyz&, u8, int); - void newData(cXyz&, u8, int); - void newAnm(s16); - void setAnm(int, s16); + void calc(); + void update(); + void setData(dTree_data_c*, int, cXyz&, u8, int); + void newData(cXyz&, u8, int); + void newAnm(s16); + void setAnm(int, s16); virtual void draw(); virtual ~dTree_packet_c(); - /* 0x0010 */ s16 field_0x0010; - /* 0x0014 */ dTree_data_c mData[64]; - /* 0x4114 */ dTree_anm_c mAnm[72]; - /* 0x6634 */ dTree_room_c mRoom[64]; - /* 0x6734 */ u8 field_0x6734; - /* 0x6736 */ s16 field_0x6736; - /* 0x6738 */ s16 field_0x6738; - /* 0x673C */ cXyz field_0x673c; + /* 0x0010 */ s16 field_0x0010; + /* 0x0014 */ dTree_data_c mData[64]; + /* 0x4114 */ dTree_anm_c mAnm[72]; + /* 0x6634 */ dTree_room_c mRoom[64]; + /* 0x6734 */ u8 field_0x6734; + /* 0x6736 */ s16 field_0x6736; + /* 0x6738 */ s16 field_0x6738; + /* 0x673C */ cXyz field_0x673c; }; #endif /* D_TREE_H */ \ No newline at end of file diff --git a/include/d/d_wood.h b/include/d/d_wood.h index 6e51fc54d..c7dba1573 100644 --- a/include/d/d_wood.h +++ b/include/d/d_wood.h @@ -23,15 +23,15 @@ public: void cc_hit_after_cut(Packet_c*); void proc(Packet_c*); - /* 0x000 */ cXyz mPos; - /* 0x00C */ u8 field_0x00C[0x010 - 0x00C]; - /* 0x010 */ u32 mFlags; - /* 0x014 */ int mAnmIdx; - /* 0x018 */ Mtx field_0x018; - /* 0x048 */ Mtx field_0x048; - /* 0x078 */ Mtx field_0x078; - /* 0x0A8 */ Mtx field_0x0a8; - /* 0x0D8 */ Unit_c* mpNext; + /* 0x000 */ cXyz mPos; + /* 0x00C */ u8 field_0x00C[0x010 - 0x00C]; + /* 0x010 */ u32 mFlags; + /* 0x014 */ int mAnmIdx; + /* 0x018 */ Mtx field_0x018; + /* 0x048 */ Mtx field_0x048; + /* 0x078 */ Mtx field_0x078; + /* 0x0A8 */ Mtx field_0x0a8; + /* 0x0D8 */ Unit_c* mpNext; /* 0x0DC */ u8 field_0xdc[0x18C - 0xDC]; }; @@ -58,11 +58,11 @@ public: void mode_to_norm_init(AnmID_e); void mode_to_norm(Packet_c*); - /* 0x00 */ u8 field_0x00[0x60 - 0x00]; - /* 0x60 */ int field_0x60; - /* 0x64 */ s16 field_0x64; - /* 0x66 */ u8 field_0x66[0x8A - 0x66]; - /* 0x8A */ u8 field_0x8a; + /* 0x00 */ u8 field_0x00[0x60 - 0x00]; + /* 0x60 */ int field_0x60; + /* 0x64 */ s16 field_0x64; + /* 0x66 */ u8 field_0x66[0x8A - 0x66]; + /* 0x8A */ u8 field_0x8a; }; STATIC_ASSERT(sizeof(Anm_c) == 0x8C); @@ -73,7 +73,7 @@ public: void entry_unit(Unit_c*); void delete_all_unit(); - /* 0x0 */ Unit_c* mpUnit; + /* 0x0 */ Unit_c* mpUnit; }; class Packet_c : public J3DPacket { @@ -84,7 +84,7 @@ public: void put_unit(const cXyz&, int); void calc_cc(); void calc(); - void update(); + void update(); void search_empty_UnitID() const; void search_anm(Anm_c::Mode_e); diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h index 70abfb98d..6a4b643fa 100644 --- a/include/m_Do/m_Do_audio.h +++ b/include/m_Do/m_Do_audio.h @@ -1,10 +1,46 @@ #ifndef M_DO_AUDIO_H #define M_DO_AUDIO_H +#include "JAZelAudio/JAIZelBasic.h" + +class mDoAud_zelAudio_c : public JAIZelBasic { +public: + mDoAud_zelAudio_c() {} + + void reset(); + + static void calcLoadTimer(); + + static bool isResetFlag() { return mResetFlag; } + static void onResetFlag() { mResetFlag = true; } + + static bool isInitFlag() { return mInitFlag; } + + static void setLoadTimer(u8 i_timer) { mLoadTimer = i_timer; } + static u8 getLoadTimer() { return mLoadTimer; } + + static bool mInitFlag; + static bool mResetFlag; + static bool mBgmSet; + static u8 mLoadTimer; +}; + +extern mDoAud_zelAudio_c g_mDoAud_zelAudio; + void mDoAud_setSceneName(const char*, s32, s32); void mDoAud_Execute(); -class JKRSolidHeap; extern JKRSolidHeap* g_mDoAud_audioHeap; +inline void mDoAud_bgmStop(u32 param_0) { + mDoAud_zelAudio_c::getInterface()->bgmStop(param_0, 0); +} + +inline void mDoAud_resetProcess() { + if (mDoAud_zelAudio_c::isResetFlag()) { + mDoAud_zelAudio_c::getInterface()->resetProcess(); + mDoAud_zelAudio_c::onResetFlag(); + } +} + #endif /* M_DO_AUDIO_H */ diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 2550c796d..fabe63ee3 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -9,6 +9,7 @@ #include "SSystem/SComponent/c_phase.h" #include "d/actor/d_a_player.h" #include "d/d_com_lib_game.h" +#include "d/d_demo.h" #include "d/d_flower.h" #include "d/d_grass.h" #include "d/d_item_data.h" @@ -16,6 +17,7 @@ #include "d/d_particle.h" #include "d/d_tree.h" #include "f_op/f_op_scene_mng.h" +#include "m_Do/m_Do_Reset.h" #include "m_Do/m_Do_audio.h" class J3DModel; @@ -24,6 +26,10 @@ public: static void setKeepType(u8); }; +class daShip_c : public fopAc_ac_c { +public: +}; + dComIfG_inf_c g_dComIfG_gameInfo; /* 80052134-800521A4 .text ct__14dComIfG_play_cFv */ @@ -153,7 +159,7 @@ void dComIfG_play_c::itemInit() { field_0x4962 = 0; field_0x4965 = 0; - strcpy(field_0x4966, ""); + strcpy(field_0x4966, "\0"); field_0x4977 = 0; field_0x4978 = 0; @@ -261,17 +267,20 @@ void dComIfG_play_c::createParticle() { /* 800528F4-8005297C .text createDemo__14dComIfG_play_cFv */ void dComIfG_play_c::createDemo() { - /* Nonmatching */ + mDemo = new dDemo_manager_c(); + + JUT_ASSERT(390, mDemo != 0); } /* 8005297C-800529B8 .text removeDemo__14dComIfG_play_cFv */ void dComIfG_play_c::removeDemo() { - /* Nonmatching */ + delete mDemo; + mDemo = NULL; } /* 800529B8-800529DC .text executeEvtManager__14dComIfG_play_cFv */ void dComIfG_play_c::executeEvtManager() { - mEventMgr.runProc(); + mEvtManager.runProc(); } /* 800529DC-80052A30 .text createMagma__14dComIfG_play_cFv */ @@ -472,8 +481,15 @@ int dComIfG_changeOpeningScene(scene_class* i_scene, s16 i_procName) { } /* 8005326C-800532D8 .text dComIfG_resetToOpening__FP11scene_class */ -void dComIfG_resetToOpening(scene_class*) { - /* Nonmatching */ +int dComIfG_resetToOpening(scene_class* i_scene) { + if (!mDoRst::isReset()) { + return 0; + } + + dComIfG_changeOpeningScene(i_scene, 8); + mDoAud_bgmStop(30); + mDoAud_resetProcess(); + return 1; } /* 800532D8-80053330 .text phase_1__FPc */ @@ -633,7 +649,7 @@ void dComIfGp_setNextStage(const char* i_stageName, s16 i_point, s8 i_roomNo, s8 } } - g_dComIfG_gameInfo.info.getRestart().setLastSceneInfo(i_lastSpeed, i_lastMode); + g_dComIfG_gameInfo.save.getRestart().setLastSceneInfo(i_lastSpeed, i_lastMode); if (i_setPoint) { dComIfGs_setStartPoint(i_point); } @@ -668,7 +684,7 @@ BOOL dComIfGs_isStageBossEnemy(int i_stageNo) { if (i_stageNo == dStage_stagInfo_GetSaveTbl(stag_info)) { return dComIfGs_isStageBossEnemy(); } else { - return g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().isStageBossEnemy(); + return g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().isStageBossEnemy(); } } @@ -680,7 +696,7 @@ void dComIfGs_onStageLife(int i_stageNo) { dComIfGs_onStageLife(); } - g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().onStageLife(); + g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().onStageLife(); } /* 80053AAC-80053B30 .text dComIfGs_isStageLife__Fi */ @@ -690,7 +706,7 @@ BOOL dComIfGs_isStageLife(int i_stageNo) { if (i_stageNo == dStage_stagInfo_GetSaveTbl(stag_info)) { return dComIfGs_isStageLife(); } else { - return g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().isStageLife(); + return g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().isStageLife(); } } @@ -803,15 +819,15 @@ u8 dComIfGs_checkGetItem(u8 i_itemNo) { } else if (i < 24) { item = NO_ITEM; } else if (i < 32) { - item = g_dComIfG_gameInfo.info.getPlayer().getGetItem().mItemFlags[i - 0x18]; + item = g_dComIfG_gameInfo.save.getPlayer().getGetItem().mItemFlags[i - 0x18]; } else if (i < 36) { item = NO_ITEM; } else if (i < 44) { - item = g_dComIfG_gameInfo.info.getPlayer().getGetItem().mItemFlags[i - 0x1C]; + item = g_dComIfG_gameInfo.save.getPlayer().getGetItem().mItemFlags[i - 0x1C]; } else if (i < 48) { item = NO_ITEM; } else if (i < 56) { - item = g_dComIfG_gameInfo.info.getPlayer().getGetItem().mItemFlags[i - 0x20]; + item = g_dComIfG_gameInfo.save.getPlayer().getGetItem().mItemFlags[i - 0x20]; } else { item = NO_ITEM; } @@ -828,7 +844,7 @@ u8 dComIfGs_checkGetItem(u8 i_itemNo) { } if (i_itemNo >= 0xBF && i_itemNo <= 0xFE && - g_dComIfG_gameInfo.info.getPlayer().getMap().isGetMap(i_itemNo - 1)) + g_dComIfG_gameInfo.save.getPlayer().getMap().isGetMap(i_itemNo - 1)) { get_item++; } @@ -851,32 +867,153 @@ void dComIfGd_setShadow(u32, s8, J3DModel*, cXyz*, f32, f32, f32, f32, cBgS_Poly } /* 8005468C-800547BC .text getSceneList__Fi */ -void getSceneList(int) { - /* Nonmatching */ +stage_scls_info_class* getSceneList(int i_no) { + stage_scls_info_dummy_class* sclsInfo = dComIfGp_getStage().getSclsInfo(); + JUT_ASSERT(2132, sclsInfo != 0); + + JUT_ASSERT(2134, 0 <= i_no && i_no < sclsInfo->num); + + stage_scls_info_class* sclsData = sclsInfo->m_entries; + JUT_ASSERT(2136, sclsData != 0); + + return &sclsData[i_no]; } /* 800547BC-80054870 .text dComIfGd_getMeshSceneList__FR3Vec */ -void dComIfGd_getMeshSceneList(Vec&) { +stage_scls_info_class* dComIfGd_getMeshSceneList(Vec&) { /* Nonmatching */ } /* 80054870-800548FC .text dComIfGs_checkSeaLandingEvent__FSc */ -void dComIfGs_checkSeaLandingEvent(s8) { - /* Nonmatching */ +BOOL dComIfGs_checkSeaLandingEvent(s8 i_roomNo) { + struct landing_event { + /* 0x0 */ s8 roomNo; + /* 0x2 */ u16 event; + }; + + static landing_event l_landingEvent[] = { + {1, 0x3040}, {4, 0x2E02}, {13, 0x902}, {23, 0xA02}, {41, 0xA20}, {45, 0x2E04}, + }; + + landing_event* event_check = l_landingEvent; + + for (u32 i = 0; i < 6; i++) { + if (i_roomNo == event_check->roomNo && !dComIfGs_isEventBit(event_check->event)) { + return FALSE; + } + + event_check++; + } + + return TRUE; } /* 800548FC-80054C70 .text dComIfGs_setGameStartStage__Fv */ +// NONMATCHING - one tiny reg swap, string data void dComIfGs_setGameStartStage() { - /* Nonmatching */ + struct check_data { + /* 0x0 */ u8 mbHasEvent; + /* 0x2 */ u16 mEvent; + /* 0x4 */ char mStage[8]; + /* 0xC */ s8 mRoomNo; + /* 0xD */ u8 mStartCode; + }; + + static check_data l_checkData[] = { + {true, 0x2A08, "", 0, 0}, {true, 0xF80, "sea", 11, 128}, + {true, 0x801, "MajyuE", 0, 0}, {true, 0x808, "MajyuE", 0, 18}, + {true, 0x2401, "A_umikz", 0, 204}, {false, 0, "sea", 44, 128}, + }; + + check_data* data_p = l_checkData; + for (int i = 0; i < 5; i++) { + if (data_p->mbHasEvent == true && dComIfGs_isEventBit(data_p->mEvent)) { + break; + } + + data_p++; + } + + char stage_name[8]; + s8 room_no; + u8 point; + + if (strcmp(data_p->mStage, "") != 0) { + strcpy(stage_name, data_p->mStage); + room_no = data_p->mRoomNo; + point = data_p->mStartCode; + } else { + u32 stage_type = dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()); + int save_tbl = dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()); + BOOL isNot_PShip = strcmp(dComIfGp_getStartStageName(), "PShip"); + + if (!isNot_PShip) { + strcpy(stage_name, "sea"); + room_no = dComIfGs_getEventReg(0xC3FF); + point = dComIfGs_getEventReg(0x85FF); + dKy_set_nexttime(120.0f); + } else if (stage_type == 7) { + daPy_lk_c* player_p = daPy_getPlayerLinkActorClass(); + point = player_p->field_0x3594; + + s8 temp_r3 = player_p->current.roomNo; + room_no = temp_r3; + + stage_scls_info_class* scls_p; + if (temp_r3 >= 0 && point != 0xFF && dComIfGs_checkSeaLandingEvent(room_no)) { + strcpy(stage_name, dComIfGp_getStartStageName()); + } else { + if (dComIfGp_getShipActor() != NULL) { + scls_p = dComIfGd_getMeshSceneList(dComIfGp_getShipActor()->current.pos); + } else { + scls_p = dComIfGd_getMeshSceneList(player_p->current.pos); + } + + strcpy(stage_name, scls_p->mStage); + room_no = scls_p->mRoom; + point = scls_p->mStart; + } + } else if (stage_type == 1 || stage_type == 6 || stage_type == 3 || stage_type == 8 || + save_tbl == 9) + { + stage_scls_info_class* scls_p = getSceneList(0); + strcpy(stage_name, scls_p->mStage); + room_no = scls_p->mRoom; + point = scls_p->mStart; + } else if (save_tbl == 10) { + cXyz ikada_pos; + dComIfGp_getIkadaShipBeforePos(&ikada_pos); + + stage_scls_info_class* scls_p = dComIfGd_getMeshSceneList(ikada_pos); + strcpy(stage_name, scls_p->mStage); + room_no = scls_p->mRoom; + point = scls_p->mStart; + } else if (save_tbl == 11 || save_tbl == 12 || save_tbl == 13) { + strcpy(stage_name, "sea"); + + stage_map_info_class* mapInfo = dComIfGp_getStage().getMapInfo(); + JUT_ASSERT(2362, mapInfo != 0); + + room_no = dStage_mapInfo_GetOceanX(mapInfo) + + (((dStage_mapInfo_GetOceanZ(mapInfo) + 3) * 7) + 4); + point = 0; + } else { + strcpy(stage_name, "sea"); + room_no = 11; + point = 0; + } + } + + g_dComIfG_gameInfo.save.getPlayer().getPlayerReturnPlace().set(stage_name, room_no, point); } /* 80054C70-80054CC0 .text dComIfGs_gameStart__Fv */ void dComIfGs_gameStart() { dComIfGp_offEnableNextStage(); - s8 roomNo = g_dComIfG_gameInfo.info.getPlayer().getPlayerReturnPlace().getRoomNo(); - s16 point = g_dComIfG_gameInfo.info.getPlayer().getPlayerReturnPlace().getPlayerStatus(); - char* name = g_dComIfG_gameInfo.info.getPlayer().getPlayerReturnPlace().getName(); + s8 roomNo = g_dComIfG_gameInfo.save.getPlayer().getPlayerReturnPlace().getRoomNo(); + s16 point = g_dComIfG_gameInfo.save.getPlayer().getPlayerReturnPlace().getPlayerStatus(); + char* name = g_dComIfG_gameInfo.save.getPlayer().getPlayerReturnPlace().getName(); dComIfGp_setNextStage(name, point, roomNo, -1, 0.0f, 0, 1, 0); } @@ -936,5 +1073,5 @@ void dComIfGs_setSelectEquip(int i_type, u8 i_itemNo) { break; } - g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().mSelectEquip[i_type] = i_itemNo; + g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().mSelectEquip[i_type] = i_itemNo; } diff --git a/src/m_Do/m_Do_audio.cpp b/src/m_Do/m_Do_audio.cpp index be6ad2930..c8d9c8dde 100644 --- a/src/m_Do/m_Do_audio.cpp +++ b/src/m_Do/m_Do_audio.cpp @@ -4,21 +4,35 @@ // #include "m_Do/m_Do_audio.h" -#include "dolphin/types.h" +#include "JSystem/JKernel/JKRSolidHeap.h" +#include "SSystem/SComponent/c_lib.h" + +mDoAud_zelAudio_c g_mDoAud_zelAudio; + +bool mDoAud_zelAudio_c::mInitFlag; +bool mDoAud_zelAudio_c::mResetFlag; +bool mDoAud_zelAudio_c::mBgmSet; +u8 mDoAud_zelAudio_c::mLoadTimer; + +JKRSolidHeap* g_mDoAud_audioHeap; /* 80006D84-80006D90 .text reset__17mDoAud_zelAudio_cFv */ void mDoAud_zelAudio_c::reset() { - /* Nonmatching */ + mBgmSet = false; } /* 80006D90-80006DC0 .text calcLoadTimer__17mDoAud_zelAudio_cFv */ void mDoAud_zelAudio_c::calcLoadTimer() { - /* Nonmatching */ + if (mLoadTimer > 1) { + cLib_calcTimer(&mLoadTimer); + } } +BOOL mDoAud_StreamBufferPointer; + /* 80006DC0-80006DD4 .text mDoAud_isUsedHeapForStreamBuffer__Fv */ -void mDoAud_isUsedHeapForStreamBuffer() { - /* Nonmatching */ +BOOL mDoAud_isUsedHeapForStreamBuffer() { + return mDoAud_StreamBufferPointer != false; } /* 80006DD4-80006F88 .text mDoAud_allocStreamBuffer__Fv */ @@ -32,9 +46,7 @@ void mDoAud_deallocStreamBuffer() { } /* 8000703C-80007040 .text mDoAud_executeStreamBuffer__Fv */ -void mDoAud_executeStreamBuffer() { - /* Nonmatching */ -} +void mDoAud_executeStreamBuffer() {} /* 80007040-80007090 .text mDoAud_setupStreamBuffer__Fv */ void mDoAud_setupStreamBuffer() { @@ -48,7 +60,13 @@ void mDoAud_Create() { /* 80007224-80007268 .text mDoAud_Execute__Fv */ void mDoAud_Execute() { - /* Nonmatching */ + if (!mDoAud_zelAudio_c::isInitFlag()) { + mDoAud_Create(); + } else { + mDoAud_executeStreamBuffer(); + g_mDoAud_zelAudio.gframeProcess(); + mDoAud_zelAudio_c::calcLoadTimer(); + } } /* 80007268-800073D8 .text mDoAud_getTactDirection__Fii */ @@ -57,26 +75,22 @@ void mDoAud_getTactDirection(int, int) { } /* 800073D8-80007424 .text mDoAud_setSceneName__FPCcll */ -void mDoAud_setSceneName(const char*, long, long) { - /* Nonmatching */ +void mDoAud_setSceneName(const char* i_name, s32 i_point, s32 i_layer) { + if (mDoAud_zelAudio_c::getLoadTimer() == 0) { + mDoAud_zelAudio_c::getInterface()->setSceneName((char*)i_name, i_point, i_layer); + mDoAud_zelAudio_c::setLoadTimer(36); + } } /* 80007424-80007478 .text mDoAud_load1stDynamicWave__Fv */ -void mDoAud_load1stDynamicWave() { - /* Nonmatching */ -} - -/* 80007478-80007494 .text cLib_calcTimer__FPUc */ -void cLib_calcTimer(unsigned char*) { - /* Nonmatching */ -} - -/* 80007500-8000755C .text __dt__17mDoAud_zelAudio_cFv */ -mDoAud_zelAudio_c::~mDoAud_zelAudio_c() { - /* Nonmatching */ -} - -/* 8000755C-80007598 .text __dt__10JAIZelInstFv */ -JAIZelInst::~JAIZelInst() { - /* Nonmatching */ +int mDoAud_load1stDynamicWave() { + if (mDoAud_zelAudio_c::getLoadTimer() == 0) { + return 1; + } else if (mDoAud_zelAudio_c::getLoadTimer() <= 1) { + mDoAud_zelAudio_c::getInterface()->load1stDynamicWave(); + mDoAud_zelAudio_c::setLoadTimer(0); + return 1; + } else { + return 0; + } }