From 0d3242ab2297357483830ecfbe7fe55bef651a4d Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sat, 3 Feb 2024 13:41:11 -0500 Subject: [PATCH] work on inlines --- include/JAZelAudio/JAIZelBasic.h | 4 + include/d/d_com_inf_game.h | 93 ++++++++++++++++++------ include/d/d_drawlist.h | 7 +- include/d/d_event.h | 4 +- src/JAZelAudio/JAIZelBasic.cpp | 28 ++++--- src/JSystem/JKernel/JKRDvdAramRipper.cpp | 2 +- src/d/actor/d_a_am2.cpp | 2 +- src/d/actor/d_a_bg.cpp | 4 +- src/d/actor/d_a_mmusic.cpp | 6 +- src/d/d_com_inf_game.cpp | 2 +- src/d/d_event.cpp | 14 ++-- src/d/d_s_logo.cpp | 21 +++--- src/d/d_s_room.cpp | 2 +- src/m_Do/m_Do_machine_exception.cpp | 2 +- src/m_Do/m_Do_main.cpp | 2 +- 15 files changed, 124 insertions(+), 69 deletions(-) diff --git a/include/JAZelAudio/JAIZelBasic.h b/include/JAZelAudio/JAIZelBasic.h index 5a5e2f1fb..7a7819aca 100644 --- a/include/JAZelAudio/JAIZelBasic.h +++ b/include/JAZelAudio/JAIZelBasic.h @@ -218,7 +218,9 @@ public: /* 0x0054 */ Vec field_0x0054; /* 0x0060 */ u8 mbLandingDemoStarted; /* 0x0061 */ u8 field_0x0061; +#if VERSION != VERSION_JPN /* 0x0062 */ u8 field_0x0062; +#endif /* 0x0063 */ u8 field_0x0063; /* 0x0064 */ u8 field_0x0064; /* 0x0065 */ u8 field_0x0065; @@ -254,7 +256,9 @@ public: /* 0x00BC */ u8 field_0x00bc; /* 0x00BD */ u8 field_0x00bd; /* 0x00BE */ u8 field_0x00be; +#if VERSION != VERSION_JPN /* 0x00BF */ u8 field_0x00bf; +#endif /* 0x00C0 */ u8 field_0x00c0; /* 0x00C1 */ s8 field_0x00c1; /* 0x00C4 */ int field_0x00c4; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index dc4d48eee..fc2321726 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -228,7 +228,7 @@ public: /* 0x04 */ s32 mTimerNowTimeMs; /* 0x08 */ s32 mTimerLimitTimeMs; /* 0x0C */ s32 mTimerMode; - /* 0x10 */ u16 mTimerType; + /* 0x10 */ u16 mWaveFrame; }; class dADM_CharTbl : public cDT { @@ -478,6 +478,8 @@ public: s32 getTimerNowTimeMs() { return mTimerInfo.mTimerNowTimeMs; } void setTimerLimitTimeMs(s32 ms) { mTimerInfo.mTimerLimitTimeMs = ms; } s32 getTimerLimitTimeMs() { return mTimerInfo.mTimerLimitTimeMs; } + void setWaveFrame(u16 frame) { mTimerInfo.mWaveFrame = frame; } + u16 getWaveFrame() { return mTimerInfo.mWaveFrame; } s16 getItemMagicCount() { return mItemMagicCount; } void setItemMagicCount(s16 magic) { mItemMagicCount += magic; } @@ -602,6 +604,13 @@ public: ItemTableList* getItemTable() { return mpItemTable; } void setFmapData(void * pData) { mpFmapData = pData; } + void setPictureBoxData(JKRAramBlock* aramHeap, int i) { mPictureBoxDataHeap[i] = aramHeap; } + void offPictureFlag(u8 i) { + u8 mask = (1 << i); + mPictureFlag &= ~mask; + } + void setBossBattleData(JKRAramBlock* aramHeap, int i) { mBossBattleDataHeap[i] = aramHeap; } + void stopFwaterTimer() { mFwaterTimer = 0; } u8 checkFwaterTimer() { return mFwaterTimer; } @@ -660,13 +669,13 @@ public: /* 0x47F8 */ JKRArchive* mpEnglishTextArchive; #if VERSION != VERSION_JPN /* 0x47FC */ JKRArchive* mpHyruleTextArchive; - /* 0x4800 */ JKRAramBlock* mAramHeap0[3]; - /* 0x480C */ JKRAramBlock* mAramHeap1[4]; + /* 0x4800 */ JKRAramBlock* mPictureBoxDataHeap[3]; + /* 0x480C */ JKRAramBlock* mBossBattleDataHeap[4]; /* 0x481C */ JKRAramBlock* field_0x481c; /* 0x4820 */ JKRAramBlock* field_0x4820; #else - /* 0x47FC */ JKRAramBlock* mAramHeap0[3]; - /* 0x480C */ JKRAramBlock* mAramHeap1[4]; + /* 0x47FC */ JKRAramBlock* mPictureBoxDataHeap[3]; + /* 0x480C */ JKRAramBlock* mBossBattleDataHeap[4]; #endif /* Offsets below are for USA/PAL */ @@ -753,7 +762,7 @@ public: /* 0x4958 */ u8 mPlacenameState; /* 0x4959 */ u8 mGameoverStatus; /* 0x495A */ u8 field_0x495a; - /* 0x495B */ u8 field_0x495b; + /* 0x495B */ u8 mPictureFlag; /* 0x495C */ u8 field_0x495c; /* 0x495D */ u8 field_0x495d; /* 0x495E */ u8 mPictureStatus; @@ -1295,24 +1304,6 @@ inline void dComIfGs_onSaveSwitch(int i_stageNo, int i_no) { g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().onSwitch(i_no); } -BOOL dComIfGs_isStageBossEnemy(int i_stageNo); - -inline BOOL dComIfGs_isStageBossEnemy() { - return g_dComIfG_gameInfo.save.getMemory().getBit().isStageBossEnemy(); -} - -inline void dComIfGs_onStageLife() { - g_dComIfG_gameInfo.save.getMemory().getBit().onStageLife(); -} - -void dComIfGs_onStageLife(int i_stageNo); - -BOOL dComIfGs_isStageLife(int i_stageNo); - -inline BOOL dComIfGs_isStageLife() { - return g_dComIfG_gameInfo.save.getMemory().getBit().isStageLife(); -} - inline BOOL dComIfGs_isCollect(int i_idx, u8 i_item) { return g_dComIfG_gameInfo.save.getPlayer().getCollect().isCollect(i_idx, i_item); } @@ -1381,6 +1372,36 @@ inline void dComIfGs_onDungeonItemBossKey() { g_dComIfG_gameInfo.save.getMemory().getBit().onDungeonItemBossKey(); } +BOOL dComIfGs_isStageBossEnemy(int i_stageNo); + +inline BOOL dComIfGs_isStageBossEnemy() { + return g_dComIfG_gameInfo.save.getMemory().getBit().isStageBossEnemy(); +} + +inline BOOL dComIfGs_isStageBossEnemySaveBit(int i_stageNo) { + return g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().isStageBossEnemy(); +} + +inline void dComIfGs_onStageLife() { + g_dComIfG_gameInfo.save.getMemory().getBit().onStageLife(); +} + +BOOL dComIfGs_isStageLife(int i_stageNo); + +inline BOOL dComIfGs_isStageLife() { + return g_dComIfG_gameInfo.save.getMemory().getBit().isStageLife(); +} + +void dComIfGs_onStageLife(int i_stageNo); + +inline BOOL dComIfGs_isStageBossDemo() { + return g_dComIfG_gameInfo.save.getMemory().getBit().isStageBossDemo(); +} + +inline BOOL dComIfGs_isStageBossDemoSaveBit(int i_stageNo) { + return g_dComIfG_gameInfo.save.getSavedata().getSave(i_stageNo).getBit().isStageBossDemo(); +} + inline void dComIfGs_onSwitch(int i_no, int i_roomNo) { g_dComIfG_gameInfo.save.onSwitch(i_no, i_roomNo); } @@ -2486,6 +2507,18 @@ inline void dComIfGp_clearMesgAnimeTagInfo() { g_dComIfG_gameInfo.play.clearNowAnimeID(); } +inline void dComIfGp_setPictureBoxData(JKRAramBlock* aramHeap, int i) { + g_dComIfG_gameInfo.play.setPictureBoxData(aramHeap, i); +} + +inline void dComIfGp_offPictureFlag(u8 i) { + g_dComIfG_gameInfo.play.offPictureFlag(i); +} + +inline void dComIfGp_setBossBattleData(JKRAramBlock* aramHeap, int i) { + g_dComIfG_gameInfo.play.setBossBattleData(aramHeap, i); +} + /** * === EVENT === */ @@ -2998,6 +3031,10 @@ inline dRes_info_c* dComIfG_getObjectResInfo(const char* arcName) { return g_dComIfG_gameInfo.mResControl.getObjectResInfo(arcName); } +inline void dComIfG_dumpResControl() { + g_dComIfG_gameInfo.mResControl.dump(); +} + /** * === PARTICLE === */ @@ -3151,6 +3188,10 @@ inline bool dComIfGp_particle_readScene(u8 particle_no, mDoDvdThd_toMainRam_c** return g_dComIfG_gameInfo.play.getParticle()->readScene(particle_no, param_1); } +inline void dComIfGp_particle_create() { + g_dComIfG_gameInfo.play.createParticle(); +} + inline void dComIfGp_particle_createCommon(const void * pArc) { g_dComIfG_gameInfo.play.getParticle()->createCommon(pArc); } @@ -3189,6 +3230,7 @@ inline void dComIfGp_particle_draw2DmenuBack(JPADrawInfo* inf) { if (g_dComIfG_g inline u32 dComIfGp_particle_getParticleNum() { return g_dComIfG_gameInfo.play.getParticle()->getParticleNum(); } inline u32 dComIfGp_particle_getEmitterNum() { return g_dComIfG_gameInfo.play.getParticle()->getEmitterNum(); } +inline JKRHeap* dComIfGp_particle_getCommonHeap() { return g_dComIfG_gameInfo.play.getParticle()->getHeap(); } /** * === ATTENTION === @@ -3220,6 +3262,9 @@ inline u32 dComIfG_getTimerLimitTimeMs() { return g_dComIfG_gameInfo.play.getTim inline void dComIfG_setTimerNowTimeMs(int ms) { g_dComIfG_gameInfo.play.setTimerNowTimeMs(ms); } inline u32 dComIfG_getTimerNowTimeMs() { return g_dComIfG_gameInfo.play.getTimerNowTimeMs(); } +inline void dComIfGp_setWaveFrame(u16 frame) { g_dComIfG_gameInfo.play.setWaveFrame(frame); } +inline u16 dComIfGp_getWaveFrame() { return g_dComIfG_gameInfo.play.getWaveFrame(); } + inline u32 dComIfG_getTimerRestTimeMs() { return g_dComIfG_gameInfo.play.getTimerLimitTimeMs() - g_dComIfG_gameInfo.play.getTimerNowTimeMs(); } inline void dComIfG_TimerDeleteRequest() { dComIfG_getTimerPtr()->deleteRequest(); } diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index d912a4911..f2eb68a0b 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -364,16 +364,15 @@ public: dDlst_shadowControl_c() { mRealNum = 0; } void init(); void reset(); - void imageDraw(f32 (*)[4]); - void draw(f32 (*)[4]); + void imageDraw(Mtx); + void draw(Mtx); int setReal(u32, s8, J3DModel*, cXyz*, f32, f32, dKy_tevstr_c*); int setReal2(u32, s8, J3DModel*, cXyz*, f32, f32, dKy_tevstr_c*); bool addReal(u32, J3DModel*); int setSimple(cXyz*, f32, f32, cXyz*, s16, f32, GXTexObj*); - static void setSimpleTex(void *); + static void setSimpleTex(void*); static GXTexObj* getSimpleTex() { return &mSimpleTexObj; } - static GXTexObj mSimpleTexObj; private: diff --git a/include/d/d_event.h b/include/d/d_event.h index d3b449d09..3c682a8ed 100644 --- a/include/d/d_event.h +++ b/include/d/d_event.h @@ -90,7 +90,7 @@ public: void remove(); dStage_Event_dt_c* getStageEventDt(); dStage_Event_dt_c* nextStageEventDt(void*); - int getPId(void*); + u32 getPId(void*); fopAc_ac_c* convPId(unsigned int); u8 getTactFreeMStick(int); u8 getTactFreeCStick(int); @@ -119,7 +119,7 @@ public: void offEventFlag(u16 flag) { mEventFlag &= ~flag; } void reset() { onEventFlag(8); } - bool runCheck() { return mMode != 0; } + bool runCheck() { return mMode != dEvtMode_NONE_e; } u32 getMode() { return mMode & 0xFF; } // &0xFF added to fix dEvt_control_c::moveApproval, probably fakematch void checkHind(u16) {} diff --git a/src/JAZelAudio/JAIZelBasic.cpp b/src/JAZelAudio/JAIZelBasic.cpp index 0b97e93c5..76dbad9ff 100644 --- a/src/JAZelAudio/JAIZelBasic.cpp +++ b/src/JAZelAudio/JAIZelBasic.cpp @@ -138,9 +138,11 @@ JAIZelBasic::JAIZelBasic() { field_0x0200 = 0; field_0x0205 = 0; field_0x0066 = 0; +#if VERSION != VERSION_JPN field_0x00bf = 0; field_0x0028 = 0; field_0x0062 = 0; +#endif } /* 802A1EB4-802A2F48 .text zeldaGFrameWork__11JAIZelBasicFv */ @@ -250,7 +252,9 @@ void JAIZelBasic::resetRecover() { field_0x0206 = 0; field_0x0207 = 0; field_0x0201 = 0; +#if VERSION != VERSION_JPN field_0x00bf = 0; +#endif } /* 802A334C-802A33D0 .text bgmStreamPrepare__11JAIZelBasicFUl */ @@ -985,9 +989,11 @@ void JAIZelBasic::setCameraGroupInfo(u8 param_1) { if (field_0x00bd) { return; } +#if VERSION != VERSION_JPN if (field_0x00bf) { return; } +#endif if (param_1 != mCameraSeaFloorGroupInfo) { if ((param_1 & 0x80)) { mIslandRoomNo = param_1 & 0x3f; @@ -1141,10 +1147,10 @@ void JAIZelBasic::setScene(s32 param_1, s32 roomNo, s32 param_3, s32 layerNo) { } else if (param_1 == 19 && checkEventBit(0x801) == 0) { bgmNum = 0; } else if (param_1 == 2 && field_0x0021 != 0) { - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[3].getBit().isDungeonItem(5)) { + if (dComIfGs_isStageBossDemoSaveBit(dSv_save_c::STAGE_DRC)) { field_0x00cd = 1; } - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[3].getBit().isDungeonItem(3)) { + if (dComIfGs_isStageBossEnemySaveBit(dSv_save_c::STAGE_DRC)) { bgmNum = m_scene_info[1].bgmNum; bgmNum = expandSceneBgmNum(bgmNum); field_0x0204 = 1; @@ -1153,10 +1159,10 @@ void JAIZelBasic::setScene(s32 param_1, s32 roomNo, s32 param_3, s32 layerNo) { bgmNum = expandSceneBgmNum(bgmNum); } } else if (param_1 == 7 && field_0x0021 != 0) { - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[4].getBit().isDungeonItem(5)) { + if (dComIfGs_isStageBossDemoSaveBit(dSv_save_c::STAGE_FW)) { field_0x00cd = 1; } - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[4].getBit().isDungeonItem(3)) { + if (dComIfGs_isStageBossEnemySaveBit(dSv_save_c::STAGE_FW)) { bgmNum = m_scene_info[3].bgmNum; bgmNum = expandSceneBgmNum(bgmNum); } else { @@ -1164,10 +1170,10 @@ void JAIZelBasic::setScene(s32 param_1, s32 roomNo, s32 param_3, s32 layerNo) { bgmNum = expandSceneBgmNum(bgmNum); } } else if (param_1 == 37 && field_0x0021 != 0) { - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[5].getBit().isDungeonItem(5)) { + if (dComIfGs_isStageBossDemoSaveBit(dSv_save_c::STAGE_TOTG)) { field_0x00cd = 1; } - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[5].getBit().isDungeonItem(3)) { + if (dComIfGs_isStageBossEnemySaveBit(dSv_save_c::STAGE_TOTG)) { bgmNum = m_scene_info[10].bgmNum; bgmNum = expandSceneBgmNum(bgmNum); } else { @@ -1175,24 +1181,24 @@ void JAIZelBasic::setScene(s32 param_1, s32 roomNo, s32 param_3, s32 layerNo) { bgmNum = expandSceneBgmNum(bgmNum); } } else if (param_1 == 24 && field_0x0021 != 0) { - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[7].getBit().isDungeonItem(5)) { + if (dComIfGs_isStageBossDemoSaveBit(dSv_save_c::STAGE_WT)) { field_0x00cd = 1; } if (layerNo == 8 || layerNo == 9 || layerNo == 10 || layerNo == 11) { bgmNum = 0; - } else if (g_dComIfG_gameInfo.save.getSavedata().mMemory[7].getBit().isDungeonItem(3)) { + } else if (dComIfGs_isStageBossEnemySaveBit(dSv_save_c::STAGE_WT)) { bgmNum = 0; } else { bgmNum = m_scene_info[param_1].bgmNum; bgmNum = expandSceneBgmNum(bgmNum); } } else if (param_1 == 45 && field_0x0021 != 0) { - if (g_dComIfG_gameInfo.save.getSavedata().mMemory[6].getBit().isDungeonItem(5)) { + if (dComIfGs_isStageBossDemoSaveBit(dSv_save_c::STAGE_ET)) { field_0x00cd = 1; } if (layerNo == 8 || layerNo == 9 || layerNo == 10 || layerNo == 11) { bgmNum = 0; - } else if (g_dComIfG_gameInfo.save.getSavedata().mMemory[6].getBit().isDungeonItem(3)) { + } else if (dComIfGs_isStageBossEnemySaveBit(dSv_save_c::STAGE_ET)) { bgmNum = 0; } else { bgmNum = m_scene_info[param_1].bgmNum; @@ -1316,7 +1322,9 @@ void JAIZelBasic::setSceneName(char* param_1, s32 roomNo, s32 param_3) { } menuOut(); field_0x0066 = 1; +#if VERSION != VERSION_JPN field_0x00bf = 0; +#endif } else { field_0x0066 = 0; } diff --git a/src/JSystem/JKernel/JKRDvdAramRipper.cpp b/src/JSystem/JKernel/JKRDvdAramRipper.cpp index 16703a8ae..e18e81555 100644 --- a/src/JSystem/JKernel/JKRDvdAramRipper.cpp +++ b/src/JSystem/JKernel/JKRDvdAramRipper.cpp @@ -129,7 +129,7 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) { if (command->mExpandSwitch == EXPAND_SWITCH_UNKNOWN1) { if (command->mAddress == 0 && command->mBlock == NULL) { command->mBlock = - JKRAram::getAramHeap()->alloc(uncompressedSize, JKRAramHeap::HEAD); + JKRAllocFromAram(uncompressedSize, JKRAramHeap::HEAD); if (command->mBlock) { command->mAddress = command->mBlock->getAddress(); } diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index 0ad39b67a..1568ba5a9 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -206,7 +206,7 @@ static BOOL medama_atari_check(am2_class* i_this) { i_this->mState = 2; } else { dComIfGp_particle_set(0x10, &hitPos, &player->shape_angle); - // Using the fopAcM_seStart breaks the codegen. + // Using the fopAcM_seStart inline breaks the codegen. // fopAcM_seStart(i_this, JA_SE_CM_AM2_PARALYZED, 0); mDoAud_seStart(JA_SE_CM_AM2_PARALYZED, &i_this->mEyePos, 0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); fopAcM_monsSeStart(i_this, JA_SE_CV_AM2_PARALYZED, 0x42); diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp index 9df6552a2..381ba94df 100644 --- a/src/d/actor/d_a_bg.cpp +++ b/src/d/actor/d_a_bg.cpp @@ -78,7 +78,7 @@ void daBg_btkAnm_c::entry(J3DModelData* modelData) { /* 800D86C4-800D8728 .text play__13daBg_btkAnm_cFv */ void daBg_btkAnm_c::play() { if (special == 1) { - anm->setFrame(g_dComIfG_gameInfo.play.mTimerInfo.mTimerType); + anm->setFrame(dComIfGp_getWaveFrame()); } else { anm->play(); } @@ -343,7 +343,7 @@ s32 daBg_c::create() { fopAcM_SetupActor(this, daBg_c); s32 roomNo = fopAcM_GetParam(this); - JKRExpHeap * roomHeap = g_dComIfG_gameInfo.play.getRoomControl()->getMemoryBlock(roomNo); + JKRExpHeap * roomHeap = dStage_roomControl_c::getMemoryBlock(roomNo); if (roomHeap != NULL) { heap = JKRSolidHeap::create(-1, roomHeap, false); JUT_ASSERT(0x2fd, heap != 0); diff --git a/src/d/actor/d_a_mmusic.cpp b/src/d/actor/d_a_mmusic.cpp index 22a7ef468..aa5d3ebd9 100644 --- a/src/d/actor/d_a_mmusic.cpp +++ b/src/d/actor/d_a_mmusic.cpp @@ -37,9 +37,9 @@ bool daMmusic::Act_c::create_heap() { /* 000000A4-0000013C .text Macore_is_playing__Q28daMmusic5Act_cFv */ BOOL daMmusic::Act_c::Macore_is_playing() { if (dComIfGs_isStageBossEnemy(dSv_save_c::STAGE_WT) || - g_dComIfG_gameInfo.save.mSavedata.mEvent.isEventBit(0x2910) || - g_dComIfG_gameInfo.save.mSavedata.mEvent.isEventBit(0x2e02) || - g_dComIfG_gameInfo.save.mSavedata.mEvent.isEventBit(0x1610) || + dComIfGs_isEventBit(0x2910) || + dComIfGs_isEventBit(0x2e02) || + dComIfGs_isEventBit(0x1610) || !dComIfGs_checkGetItem(LV3_SWORD)) return FALSE; diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 0d518677d..7a7fbd323 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -152,7 +152,7 @@ void dComIfG_play_c::itemInit() { mPlacenameState = 0; mGameoverStatus = 0; field_0x495a = 0; - field_0x495b = 0; + mPictureFlag = 0; field_0x495c = 0; field_0x495d = 0; mPictureStatus = 0; diff --git a/src/d/d_event.cpp b/src/d/d_event.cpp index 8f73d1b01..855ec248c 100644 --- a/src/d/d_event.cpp +++ b/src/d/d_event.cpp @@ -108,7 +108,7 @@ void dEvt_control_c::afterFlagProc(dEvt_order_c* order) { mPt2 = getPId(NULL); if ((order->mFlag & dEvtFlag_STAFF_ALL_e)) - g_dComIfG_gameInfo.play.getEvtManager().issueStaff("ALL"); + dComIfGp_getPEvtManager()->issueStaff("ALL"); if ((order->mFlag & dEvtFlag_UNK8_e)) onEventFlag(0x20); @@ -272,7 +272,7 @@ BOOL dEvt_control_c::talkEnd() { if (actor2 != NULL) actor2->mEvtInfo.setCommand(dEvtCmd_NONE_e); if (mEventId != -1) { - g_dComIfG_gameInfo.play.getEvtManager().endProc(mEventId, 1); + dComIfGp_getPEvtManager()->endProc(mEventId, 1); mEventId = -1; } fopAc_ac_c* itemPartner = fopAcM_getItemEventPartner(NULL); @@ -324,10 +324,10 @@ BOOL dEvt_control_c::demoEnd() { if (actor2 != NULL) actor2->mEvtInfo.setCommand(dEvtCmd_NONE_e); if (mEventId != -1) { - g_dComIfG_gameInfo.play.getEvtManager().endProc(mEventId, 1); + dComIfGp_getPEvtManager()->endProc(mEventId, 1); mEventId = -1; } - g_dComIfG_gameInfo.play.getEvtManager().cancelStaff("ALL"); + dComIfGp_getPEvtManager()->cancelStaff("ALL"); return TRUE; } @@ -355,7 +355,7 @@ BOOL dEvt_control_c::doorCheck(dEvt_order_c* order) { fopAc_ac_c* actor2 = getPt2(); if (mEventId == -1 && actor2 != NULL && actor2->mEvtInfo.getEventId() != -1) mEventId = actor2->mEvtInfo.getEventId(); - if (mEventId != -1 && g_dComIfG_gameInfo.play.getEvtManager().getEventData(mEventId) != NULL) { + if (mEventId != -1 && dComIfGp_getPEvtManager()->getEventData(mEventId) != NULL) { if (!dComIfGp_evmng_order(mEventId)) JUT_ASSERT(0x2c0, 0); } else { @@ -700,7 +700,7 @@ dStage_Event_dt_c* dEvt_control_c::nextStageEventDt(void* idxp) { } /* 800715B8-800715DC .text getPId__14dEvt_control_cFPv */ -int dEvt_control_c::getPId(void* ac) { +u32 dEvt_control_c::getPId(void* ac) { if (ac == NULL) return -1; return fopAcM_GetID(ac); @@ -745,7 +745,7 @@ char* dEvt_info_c::getEventName() { if (mEventId == -1) { return NULL; } else { - dEvDtEvent_c* evtData = g_dComIfG_gameInfo.play.getEvtManager().getEventData(mEventId); + dEvDtEvent_c* evtData = dComIfGp_getPEvtManager()->getEventData(mEventId); if (evtData == NULL) return NULL; return evtData->getName(); diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index 53c1b2630..13357d9c2 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -609,9 +609,9 @@ BOOL dScnLogo_Delete(dScnLogo_c* i_this) { mDoExt_getRubyFont(); #if VERSION == VERSION_JPN - if (g_msgDHIO.field_0x08 == 0 && g_dComIfG_gameInfo.play.mpFont0Archive != NULL) { - g_dComIfG_gameInfo.play.mpFont0Archive->unmount(); - g_dComIfG_gameInfo.play.mpFont0Archive = NULL; + if (g_msgDHIO.field_0x08 == 0 && dComIfGp_getFontArchive() != NULL) { + dComIfGp_getFontArchive()->unmount(); + dComIfGp_setFontArchive(NULL); } #endif @@ -626,22 +626,21 @@ BOOL dScnLogo_Delete(dScnLogo_c* i_this) { delete l_lodCommand; ResTIMG * timg = (ResTIMG *)dComIfG_getObjectRes("Always", ALWAYS_I4_BALL128B); - g_dComIfG_gameInfo.drawlist.mShadowControl.setSimpleTex(timg); + dDlst_shadowControl_c::setSimpleTex(timg); dComIfG_deleteObjectRes("Logo"); dComIfGp_setWindowNum(0); for (s32 i = 0; i < 3; i++) { - g_dComIfG_gameInfo.play.mAramHeap0[i] = JKRAram::getAramHeap()->alloc(0x2000, JKRAramHeap::HEAD); - u8 mask = (1 << (u8)i); - g_dComIfG_gameInfo.play.field_0x495b &= ~mask; + dComIfGp_setPictureBoxData(JKRAllocFromAram(0x2000, JKRAramHeap::HEAD), i); + dComIfGp_offPictureFlag(i); } for (s32 i = 0; i < 4; i++) { - g_dComIfG_gameInfo.play.mAramHeap1[i] = JKRAram::getAramHeap()->alloc(0x70, JKRAramHeap::HEAD); + dComIfGp_setBossBattleData(JKRAllocFromAram(0x70, JKRAramHeap::HEAD), i); } #if VERSION == VERSION_PAL - g_dComIfG_gameInfo.play.field_0x4820 = JKRAram::getAramHeap()->alloc(0xB000, JKRAramHeap::HEAD); + g_dComIfG_gameInfo.play.field_0x4820 = JKRAllocFromAram(0xB000, JKRAramHeap::HEAD); #endif mDoExt_setSafeGameHeapSize(); @@ -752,7 +751,7 @@ s32 phase_2(dScnLogo_c* i_this) { if (rt != 0) return cPhs_INIT_e; - g_dComIfG_gameInfo.play.createParticle(); + dComIfGp_particle_create(); ResTIMG * timg; @@ -928,7 +927,7 @@ s32 phase_2(dScnLogo_c* i_this) { l_fontCommand = onMemMount("/res/Msg/fontres.arc"); #endif l_rubyCommand = onMemMount("/res/Msg/rubyres.arc"); - l_particleCommand = mDoDvdThd_toMainRam_c::create("/res/Particle/common.jpc", JKRArchive::UNKNOWN_MOUNT_DIRECTION, g_dComIfG_gameInfo.play.getParticle()->getHeap()); + l_particleCommand = mDoDvdThd_toMainRam_c::create("/res/Particle/common.jpc", JKRArchive::UNKNOWN_MOUNT_DIRECTION, dComIfGp_particle_getCommonHeap()); l_itemTableCommand = mDoDvdThd_toMainRam_c::create("/res/ItemTable/item_table.bin", JKRArchive::UNKNOWN_MOUNT_DIRECTION, NULL); JUT_ASSERT(VERSION_SELECT(1418, 1743, 1783), l_itemTableCommand != 0); l_ActorDataCommand = mDoDvdThd_toMainRam_c::create("/res/ActorDat/ActorDat.bin", JKRArchive::UNKNOWN_MOUNT_DIRECTION, NULL); diff --git a/src/d/d_s_room.cpp b/src/d/d_s_room.cpp index 4863ab0e3..8ba71f6ae 100644 --- a/src/d/d_s_room.cpp +++ b/src/d/d_s_room.cpp @@ -169,7 +169,7 @@ s32 phase_0(room_of_scene_class* i_this) { /* 80236D58-80236DE8 .text phase_1__FP19room_of_scene_class */ s32 phase_1(room_of_scene_class* i_this) { s32 roomNo = fopScnM_GetParam(i_this); - JKRExpHeap * pHeap = g_dComIfG_gameInfo.play.getRoomControl()->getMemoryBlock(roomNo); + JKRExpHeap * pHeap = dStage_roomControl_c::getMemoryBlock(roomNo); if (pHeap != NULL && pHeap->getTotalUsedSize() != 0) return cPhs_INIT_e; diff --git a/src/m_Do/m_Do_machine_exception.cpp b/src/m_Do/m_Do_machine_exception.cpp index ebeb36b0a..765be439b 100644 --- a/src/m_Do/m_Do_machine_exception.cpp +++ b/src/m_Do/m_Do_machine_exception.cpp @@ -52,7 +52,7 @@ void dispHeapInfo() { JKRAram::getAramHeap()->dump(); } DynamicModuleControlBase::dump(); - g_dComIfG_gameInfo.mResControl.dump(); + dComIfG_dumpResControl(); zelda->dump_sort(); game->dump_sort(); diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 6a45c3821..9fa0cf9f2 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -321,7 +321,7 @@ bool Debug_console(JUTGamePad* i_pad) { } DynamicModuleControlBase::dump(); - g_dComIfG_gameInfo.mResControl.dump(); + dComIfG_dumpResControl(); } if (i_pad->getTrigger() & CButton::DPAD_RIGHT) {