diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2025-04-06 11:08:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-06 21:08:25 +0300 |
| commit | 54dd7640969e1f414f9b1111f874f85171ab6987 (patch) | |
| tree | 8f83caa22c5ab811736e3625be599061d478af10 /src/d/d_com_inf_game.cpp | |
| parent | 4361019959acf84f347fec62315f8aefb2d63a6f (diff) | |
GCN pal / jpn support, some debug work (#2375)
* d_save debug cleanup / d_s_menu debug
* gameinfo / kankyo struct debug fixes
* pal building ok
* jp building ok
* some tests with jp
* some more pal/jp tests
Diffstat (limited to 'src/d/d_com_inf_game.cpp')
| -rw-r--r-- | src/d/d_com_inf_game.cpp | 207 |
1 files changed, 184 insertions, 23 deletions
diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 08695e76e0..d66c26a7bb 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -13,7 +13,10 @@ #include "d/d_map_path_dmap.h" #include "d/d_menu_fmap.h" #include "d/d_meter2_info.h" +#include "d/d_meter_HIO.h" +#include "d/d_menu_window_HIO.h" #include "f_op/f_op_scene_mng.h" +#include "f_op/f_op_msg_mng.h" #include "m_Do/m_Do_Reset.h" #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_graphic.h" @@ -43,10 +46,10 @@ void dComIfG_play_c::init() { mPlayerPtr[i] = NULL; } - if (mGameoverStatus == 2) { + if (mItemInfo.mGameoverStatus == 2) { dComIfGp_roomControl_initZone(); } - mGameoverStatus = 0; + mItemInfo.mGameoverStatus = 0; } BOOL dComIfGp_checkItemGet(u8 i_itemNo, int param_1) { @@ -56,41 +59,41 @@ BOOL dComIfGp_checkItemGet(u8 i_itemNo, int param_1) { void dComIfG_play_c::itemInit() { dMeter2Info_Initialize(); - JKRExpHeap* heap = mExpHeap2D; - memset(&mMsgObjectClass, 0, 300); - mExpHeap2D = heap; - mOxygen = 600; - mNowOxygen = 600; - mMaxOxygen = 600; + JKRExpHeap* heap = mItemInfo.mExpHeap2D; + memset(&mItemInfo.mMsgObjectClass, 0, 300); + mItemInfo.mExpHeap2D = heap; + mItemInfo.mOxygen = 600; + mItemInfo.mNowOxygen = 600; + mItemInfo.mMaxOxygen = 600; if (dComIfGs_checkGetItem(fpcNm_ITEM_HAWK_EYE)) { - field_0x4f4b = 0; + mItemInfo.field_0x4f4b = 0; } else { - field_0x4f4b = 21; + mItemInfo.field_0x4f4b = 21; } - field_0x4f4c = 7; + mItemInfo.field_0x4f4c = 7; - mNowVibration = dComIfGs_getOptVibration(); + mItemInfo.mNowVibration = dComIfGs_getOptVibration(); } void dComIfG_play_c::setItemBombNumCount(u8 i_item, s16 count) { - mItemBombNumCount[i_item] += count; + mItemInfo.mItemBombNumCount[i_item] += count; } s16 dComIfG_play_c::getItemBombNumCount(u8 i_item) { - return mItemBombNumCount[i_item]; + return mItemInfo.mItemBombNumCount[i_item]; } void dComIfG_play_c::clearItemBombNumCount(u8 i_item) { - mItemBombNumCount[i_item] = 0; + mItemInfo.mItemBombNumCount[i_item] = 0; } void dComIfG_play_c::setNowVibration(u8 i_vibration) { - mNowVibration = i_vibration; + mItemInfo.mNowVibration = i_vibration; } u32 dComIfG_play_c::getNowVibration() { - return mNowVibration; + return mItemInfo.mNowVibration; } void dComIfG_play_c::setStartStage(dStage_startStage_c* i_startStage) { @@ -1467,6 +1470,14 @@ u16 dComIfGs_getMaxLifeGauge() { return (dComIfGs_getMaxLife() / 5) * 4; } +void dComIfGs_onGetMagicUseFlag() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().onMagicFlag(0); + if (dComIfGs_getMaxMagic() == 0) { + dComIfGp_setItemMaxMagicCount(16); + dComIfGp_setItemMagicCount(16); + } +} + void dComIfGs_setSelectItemIndex(int i_no, u8 i_slotNo) { g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setSelectItemIndex(i_no, i_slotNo); dComIfGp_setSelectItem(i_no); @@ -1828,6 +1839,156 @@ void dComIfGs_gameStart() { dComIfGp_setNextStage(name, point, roomNo, -1, 0.0f, 0, 1, 0, 0, 0, 0); } +#ifdef DEBUG +void dComIfG_playerStatusD() { + dComIfGs_setDataNum(0); + dComIfGs_setMaxLife(50); + dComIfGs_setLife(20); + dComIfGs_setRupee(64); + dComIfGs_setMaxMagic(32); + dComIfGs_setMagic(16); + dComIfGs_setWalletSize(1); + dComIfGs_setMaxOil(21600); + dComIfGs_setOil(21600); + dComIfGp_setMaxOxygen(600); + dComIfGp_setOxygen(600); + + for (int i = 0; i < 4; i++) { + dComIfGs_setMixItemIndex(i, 0xFF); + } + + dComIfGs_setSelectItemIndex(0, SLOT_0); + dComIfGs_setSelectItemIndex(1, SLOT_4); + dComIfGs_setSelectItemIndex(2, 0xFF); + dComIfGs_setSelectItemIndex(3, 0xFF); + + for (int i = 23; i >= 0; i--) { + dComIfGs_setItem(i, fopMsgM_itemNumIdx(i)); + } + + for (int i = 0; i < 0x100; i++) { + dComIfGs_onItemFirstBit(i); + } + + dComIfGs_offItemFirstBit(fpcNm_ITEM_L2_KEY_PIECES1); + dComIfGs_offItemFirstBit(fpcNm_ITEM_L2_KEY_PIECES2); + dComIfGs_offItemFirstBit(fpcNm_ITEM_L2_KEY_PIECES3); + dComIfGs_offItemFirstBit(fpcNm_ITEM_LV2_BOSS_KEY); + dComIfGs_offItemFirstBit(fpcNm_ITEM_BOMB_BAG_LV2); + dComIfGs_offItemFirstBit(fpcNm_ITEM_TOMATO_PUREE); + dComIfGs_offItemFirstBit(fpcNm_ITEM_TASTE); + dComIfGs_offItemFirstBit(fpcNm_ITEM_POU_FIRE1); + dComIfGs_offItemFirstBit(fpcNm_ITEM_POU_FIRE2); + dComIfGs_offItemFirstBit(fpcNm_ITEM_POU_FIRE3); + dComIfGs_offItemFirstBit(fpcNm_ITEM_POU_FIRE4); + + for (int i = 0; i < 24; i++) { + dComIfGs_offItemFirstBit(i + fpcNm_ITEM_M_BEETLE); + } + + dComIfGs_offItemFirstBit(fpcNm_ITEM_LIGHT_SWORD); + dComIfGs_offItemFirstBit(fpcNm_ITEM_SHIELD); + dComIfGs_offItemFirstBit(fpcNm_ITEM_ZORAS_JEWEL); + + for (int i = 0; i < 19; i++) { + dComIfGs_offItemFirstBit(i); + } + + dComIfGs_setCollectSmell(fpcNm_ITEM_SMELL_PUMPKIN); + + if (!mDoCPd_c::isConnect(PAD_3)) { + dComIfGs_offItemFirstBit(fpcNm_ITEM_SMELL_POH); + } + + dComIfGs_setArrowNum(30); + dComIfGs_setArrowMax(30); + dComIfGs_setPachinkoNum(dComIfGs_getPachinkoMax()); + dComIfGs_setBombNum(0, 30); + dComIfGs_setBombNum(1, 15); + dComIfGs_setBombNum(2, 10); + + for (int i = 0; i < 4; i++) { + dComIfGs_setBottleNum(i, dComIfGs_getBottleMax()); + } + + dComIfGs_setSaveTotalTime(dComIfGs_getTotalTime()); + dComIfGs_setSaveStartTime(OSGetTime()); + + dComIfGs_setBombNum(8, 30); + dComIfGs_setBombMax(fpcNm_ITEM_NORMAL_BOMB, 30); + dComIfGs_setBombMax(fpcNm_ITEM_WATER_BOMB, 15); + dComIfGs_setBombMax(fpcNm_ITEM_POKE_BOMB, 10); + + dMeter2Info_setCloth(fpcNm_ITEM_WEAR_KOKIRI, false); + dMeter2Info_setSword(fpcNm_ITEM_SWORD, false); + dMeter2Info_setShield(fpcNm_ITEM_HYLIA_SHIELD, false); + dComIfGs_onGetMagicUseFlag(); + + dComIfGs_onEventBit(0x540); + dComIfGs_onEventBit(0xc10); + dComIfGs_onEventBit(0x510); + dMeter2Info_offTempBit(0); + dComIfGs_onEventBit(0x5c01); + dComIfGs_onEventBit(0x5d80); + + if (!mDoCPd_c::isConnect(PAD_3)) { + g_fmapHIO.mRangeCheckInterval = 0; + } else { + g_fmapHIO.mRangeCheckInterval = 1; + } + + g_fmapHIO.mRegionImageDebug = 1; + g_fmapHIO.update(); + + g_mwHIO.setArrowFlag(1); + g_mwHIO.setPachinkoFlag(1); + g_mwHIO.setBombFlag(1); + g_mwHIO.update(); + g_mwHIO.setBombFlag(1); +} + +void dComIfG_playerStatusD_pre_clear() { + dComIfGs_setDataNum(0); + dComIfGs_setMaxLife(15); + dComIfGs_setLife(12); + dComIfGs_setRupee(0); + dComIfGs_setMaxMagic(0); + dComIfGs_setMagic(0); + dComIfGs_setWalletSize(0); + dComIfGs_setMaxOil(21600); + dComIfGs_setOil(21600); + dComIfGp_setMaxOxygen(600); + dComIfGp_setOxygen(600); + + for (int i = 0; i < 4; i++) { + dComIfGs_setMixItemIndex(i, 0xFF); + dComIfGs_setSelectItemIndex(i, 0xFF); + } + + dComIfGs_setSelectEquipClothes(fpcNm_ITEM_WEAR_CASUAL); + dComIfGp_setSelectEquipClothes(fpcNm_ITEM_WEAR_CASUAL); + dComIfGs_setSelectEquipSword(fpcNm_ITEM_NONE); + dComIfGp_setSelectEquipSword(fpcNm_ITEM_NONE); + dComIfGs_setSelectEquipShield(fpcNm_ITEM_NONE); + dComIfGp_setSelectEquipShield(fpcNm_ITEM_NONE); + + for (int i = 0; i < 24; i++) { + dComIfGs_setItem(i, fpcNm_ITEM_NONE); + } + + for (int i = 0; i < 0x100; i++) { + dComIfGs_offItemFirstBit(i); + } + + dComIfGs_setArrowNum(0); + dComIfGs_setBombNum(0); + dComIfGs_setArrowMax(0); + dComIfGs_setBombMax(0); + dComIfGs_setSelectEquipShield(fpcNm_ITEM_SHIELD); + dComIfGp_setSelectEquipShield(fpcNm_ITEM_SHIELD); +} +#endif + u32 dComIfG_getTrigA(u32 i_padNo) { return mDoCPd_c::getTrigA(i_padNo); } @@ -2045,12 +2206,12 @@ static void dComIfGs_setWarpItemData(int, char const* i_stage, cXyz i_pos, s16 i void dComIfG_play_c::setWarpItemData(char const* i_stage, cXyz i_pos, s16 i_angle, s8 i_roomNo, u8 param_4, u8 param_5) { - strcpy(mWarpItemStage, i_stage); - mWarpItemPos.set(i_pos); - mWarpItemAngle = i_angle; - mWarpItemRoom = i_roomNo; - field_0x4fac = param_5; - field_0x4fab = param_4; + strcpy(mItemInfo.mWarpItemData.mWarpItemStage, i_stage); + mItemInfo.mWarpItemData.mWarpItemPos.set(i_pos); + mItemInfo.mWarpItemData.mWarpItemAngle = i_angle; + mItemInfo.mWarpItemData.mWarpItemRoom = i_roomNo; + mItemInfo.mWarpItemData.field_0x4fac = param_5; + mItemInfo.mWarpItemData.field_0x4fab = param_4; } void dComIfGs_setWarpItemData(char const* i_stage, cXyz i_pos, s16 i_angle, s8 i_roomNo, u8 param_4, |
