diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-05-21 00:49:35 -0400 |
|---|---|---|
| committer | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-05-21 00:49:35 -0400 |
| commit | 86c96002bc1afee55138ab058dda088d72d032af (patch) | |
| tree | c8060d491506479a508b0a2b3729f805d4b916b2 /src | |
| parent | e7fc0a2992ac1d72ea54ab8b80f2f0aefbd3058b (diff) | |
Fix demo version diffs in gameinfo/save/stage/etc
Diffstat (limited to 'src')
| -rw-r--r-- | src/d/d_mesg.cpp | 16 | ||||
| -rw-r--r-- | src/d/d_metronome.cpp | 4 | ||||
| -rw-r--r-- | src/d/d_s_logo.cpp | 44 | ||||
| -rw-r--r-- | src/d/d_save.cpp | 2 | ||||
| -rw-r--r-- | src/d/d_stage.cpp | 59 | ||||
| -rw-r--r-- | src/m_Do/m_Do_ext.cpp | 6 |
6 files changed, 118 insertions, 13 deletions
diff --git a/src/d/d_mesg.cpp b/src/d/d_mesg.cpp index 035fc090..5a31136f 100644 --- a/src/d/d_mesg.cpp +++ b/src/d/d_mesg.cpp @@ -1327,7 +1327,11 @@ void dMesg_screenDataTalk_c::createScreen() { JUtility::TColor black(30, 30, 75, 0); scrn = new J2DScreen(); JUT_ASSERT(2145, scrn != NULL); +#if VERSION == VERSION_DEMO + scrn->set("hukidashi_d00.blo", dComIfGp_getMsgArchive()); +#else scrn->set("hukidashi_d00.blo", dComIfGp_getDmsgArchive()); +#endif fopMsgM_setPaneData(&field_0x18, scrn->search('dt00')); fopMsgM_setPaneData(&field_0x50, scrn->search('yz00')); fopMsgM_setPaneData(&field_0x88[0], scrn->search('tx02')); @@ -1489,7 +1493,11 @@ void dMesg_screenDataItem_c::createScreen() { JUT_ASSERT(2424, texBuffer != NULL); field_0x3e4 = NULL; +#if VERSION == VERSION_DEMO + scrn->set("hukidashi_d09.blo", dComIfGp_getMsgArchive()); +#else scrn->set("hukidashi_d09.blo", dComIfGp_getDmsgArchive()); +#endif fopMsgM_setPaneData(&field_0x18, scrn->search('dt90')); fopMsgM_setPaneData(&field_0x50, scrn->search('yz90')); fopMsgM_setPaneData(&field_0x88[0], scrn->search('tx92')); @@ -2084,7 +2092,11 @@ void dMesg_closeProc(sub_mesg_class* i_Msg) { JKRHeap* oldHeap = mDoExt_setCurrentHeap(i_Msg->field_0x100); if (i_Msg->screen->closeAnime()) { delete i_Msg->screen->scrn; +#if VERSION == VERSION_DEMO + dComIfGp_getMsgArchive()->removeResourceAll(); +#else dComIfGp_getDmsgArchive()->removeResourceAll(); +#endif delete (void*)i_Msg->screen; i_Msg->screen = NULL; dMesg_reset(); @@ -2163,7 +2175,11 @@ static BOOL dMsg_Delete(sub_mesg_class* i_Msg) { mDoExt_setCurrentHeap(i_Msg->field_0x100); if (i_Msg->screen) { delete i_Msg->screen->scrn; +#if VERSION == VERSION_DEMO + dComIfGp_getMsgArchive()->removeResourceAll(); +#else dComIfGp_getDmsgArchive()->removeResourceAll(); +#endif delete (void*)i_Msg->screen; i_Msg->screen = NULL; } diff --git a/src/d/d_metronome.cpp b/src/d/d_metronome.cpp index 83a27c38..6e96f1d3 100644 --- a/src/d/d_metronome.cpp +++ b/src/d/d_metronome.cpp @@ -508,7 +508,7 @@ void dMetronome_c::initialize() { void dMetronome_c::_create() { scrn = new J2DScreen(); JUT_ASSERT(0x2db, scrn != NULL); - scrn->set("baton_input.blo", dComIfGp_getTmsgArchive()); + scrn->set("baton_input.blo", dComIfGp_getTactMsgArchive()); screenSet(); initialize(); } @@ -516,7 +516,7 @@ void dMetronome_c::_create() { /* 8022319C-802231F4 .text _delete__12dMetronome_cFv */ void dMetronome_c::_delete() { delete scrn; - dComIfGp_getTmsgArchive()->removeResourceAll(); + dComIfGp_getTactMsgArchive()->removeResourceAll(); } /* 802231F4-80223314 .text _move__12dMetronome_cFv */ diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index 5694b905..1deae803 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -49,7 +49,9 @@ mDoDvdThd_mountXArchive_c * l_swimResCommand; mDoDvdThd_mountXArchive_c * l_windResCommand; mDoDvdThd_mountXArchive_c * l_nameResCommand; mDoDvdThd_mountXArchive_c * l_tmsgCommand; +#if VERSION > VERSION_DEMO mDoDvdThd_mountXArchive_c * l_dmsgCommand; +#endif mDoDvdThd_mountXArchive_c * l_errorResCommand; mDoDvdThd_mountXArchive_c * l_msgDtCommand; #if VERSION > VERSION_JPN @@ -63,7 +65,11 @@ mDoDvdThd_toMainRam_c * l_particleCommand; mDoDvdThd_toMainRam_c * l_itemTableCommand; mDoDvdThd_toMainRam_c * l_ActorDataCommand; mDoDvdThd_toMainRam_c * l_FmapDataCommand; +#if VERSION == VERSION_DEMO +mDoDvdThd_mountXArchive_c * l_DmcMountCommand; +#else mDoDvdThd_mountXArchive_c * l_lodCommand; +#endif enum { ACT_nintendoInDraw = 0, @@ -416,7 +422,9 @@ BOOL dvdWaitDraw(dScnLogo_c* i_this) { && l_windResCommand->sync() && l_nameResCommand->sync() && l_tmsgCommand->sync() +#if VERSION > VERSION_DEMO && l_dmsgCommand->sync() +#endif && l_errorResCommand->sync() && l_msgDtCommand->sync() #if VERSION > VERSION_JPN @@ -430,7 +438,10 @@ BOOL dvdWaitDraw(dScnLogo_c* i_this) { && l_itemTableCommand->sync() && l_ActorDataCommand->sync() && l_FmapDataCommand->sync() - && l_lodCommand->sync() && !mDoRst::isReset()) { +#if VERSION > VERSION_DEMO + && l_lodCommand->sync() && !mDoRst::isReset() +#endif + ) { dComIfG_changeOpeningScene(i_this, PROC_OPENING_SCENE); } @@ -491,19 +502,21 @@ static BOOL dScnLogo_Delete(dScnLogo_c* i_this) { dComIfGp_setItemResArchive(l_itemResCommand->getArchive()); dComIfGp_setFmapResArchive(l_fmapResCommand->getArchive()); dComIfGp_setDmapResArchive(l_dmapResCommand->getArchive()); - dComIfGp_setClctResArchive(l_clctResCommand->getArchive()); - dComIfGp_setOptResArchive(l_optResCommand->getArchive()); + dComIfGp_setCollectResArchive(l_clctResCommand->getArchive()); + dComIfGp_setOptionResArchive(l_optResCommand->getArchive()); dComIfGp_setSaveResArchive(l_saveResCommand->getArchive()); dComIfGp_setClothResArchive(l_clothResCommand->getArchive()); dComIfGp_setItemIconArchive(l_itemiconCommand->getArchive()); dComIfGp_setActionIconArchive(l_actioniconCommand->getArchive()); dComIfGp_setScopeResArchive(l_scopeResCommand->getArchive()); - dComIfGp_setCamResArchive(l_camResCommand->getArchive()); + dComIfGp_setCameraResArchive(l_camResCommand->getArchive()); dComIfGp_setSwimResArchive(l_swimResCommand->getArchive()); dComIfGp_setWindResArchive(l_windResCommand->getArchive()); dComIfGp_setNameResArchive(l_nameResCommand->getArchive()); - dComIfGp_setTmsgArchive(l_tmsgCommand->getArchive()); + dComIfGp_setTactMsgArchive(l_tmsgCommand->getArchive()); +#if VERSION > VERSION_DEMO dComIfGp_setDmsgArchive(l_dmsgCommand->getArchive()); +#endif dComIfGp_setErrorResArchive(l_errorResCommand->getArchive()); dComIfGp_setMsgDtArchive(l_msgDtCommand->getArchive()); #if VERSION > VERSION_JPN @@ -531,7 +544,9 @@ static BOOL dScnLogo_Delete(dScnLogo_c* i_this) { delete l_windResCommand; delete l_nameResCommand; delete l_tmsgCommand; +#if VERSION > VERSION_DEMO delete l_dmsgCommand; +#endif delete l_errorResCommand; delete l_msgDtCommand; #if VERSION > VERSION_JPN @@ -561,7 +576,11 @@ static BOOL dScnLogo_Delete(dScnLogo_c* i_this) { delete l_ActorDataCommand; delete l_FmapDataCommand; +#if VERSION == VERSION_DEMO + delete l_DmcMountCommand; +#else delete l_lodCommand; +#endif ResTIMG * timg = (ResTIMG *)dComIfG_getObjectRes("Always", ALWAYS_I4_BALL128B); dDlst_shadowControl_c::setSimpleTex(timg); @@ -581,10 +600,16 @@ static BOOL dScnLogo_Delete(dScnLogo_c* i_this) { g_dComIfG_gameInfo.play.field_0x4820 = JKRAllocFromAram(0xB000, JKRAramHeap::HEAD); #endif +#if VERSION == VERSION_DEMO + mDoRst::offReset(); +#endif + +#if VERSION > VERSION_DEMO mDoExt_setSafeGameHeapSize(); mDoExt_setSafeZeldaHeapSize(); mDoExt_setSafeCommandHeapSize(); mDoExt_setSafeArchiveHeapSize(); +#endif return TRUE; } @@ -804,13 +829,17 @@ cPhs_State phase_2(dScnLogo_c* i_this) { JKRHeap::free(i_this->field_0x1f8, NULL); +#if VERSION > VERSION_DEMO l_lodCommand = aramMount("/res/Stage/sea/LODALL.arc"); JUT_ASSERT(VERSION_SELECT(1346, 1346, 1645, 1685), l_lodCommand != NULL); +#endif rt = dComIfG_setObjectRes("Always", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); JUT_ASSERT(VERSION_SELECT(1351, 1351, 1650, 1690), rt == 1); +#if VERSION > VERSION_DEMO archiveHeap->dump_sort(); +#endif rt = dComIfG_setObjectRes("Link", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); JUT_ASSERT(VERSION_SELECT(1356, 1356, 1655, 1695), rt == 1); @@ -843,7 +872,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) { l_windResCommand = aramMount("/res/Msg/windres.arc"); l_nameResCommand = aramMount("/res/Msg/nameres.arc"); l_tmsgCommand = aramMount("/res/Msg/tmsgres.arc"); +#if VERSION > VERSION_DEMO l_dmsgCommand = aramMount("/res/Msg/dmsgres.arc"); +#endif l_errorResCommand = aramMount("/res/Msg/errorres.arc"); l_saveResCommand = aramMount("/res/Msg/saveres.arc"); @@ -884,8 +915,11 @@ cPhs_State phase_2(dScnLogo_c* i_this) { mDoRst::offResetPrepare(); #endif +#if VERSION > VERSION_DEMO JUTGamePad::clearResetOccurred(); JUTGamePad::setResetCallback(mDoRst_resetCallBack, NULL); +#endif + return cPhs_COMPLEATE_e; } diff --git a/src/d/d_save.cpp b/src/d/d_save.cpp index bd6f57c5..5b7325f5 100644 --- a/src/d/d_save.cpp +++ b/src/d/d_save.cpp @@ -1336,7 +1336,9 @@ void dSv_turnRestart_c::set(const cXyz& i_pos, s16 i_angle, s8 i_roomNo, u32 i_p field_0x13 = 0; mShipPos = i_shipPos; mShipAngleY = i_shipAngle; +#if VERSION > VERSION_DEMO mHasShip = i_hasShip; +#endif } /* 8005D604-8005D660 .text init__10dSv_info_cFv */ diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index be5ae23e..f760b716 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -354,7 +354,9 @@ u32 dStage_roomControl_c::getDarkMode() { /* 80041370-800413D4 .text createMemoryBlock__20dStage_roomControl_cFiUl */ JKRExpHeap* dStage_roomControl_c::createMemoryBlock(int i_blockIdx, u32 i_heapSize) { +#if VERSION > VERSION_DEMO archiveHeap->getCurrentGroupId(); +#endif mMemoryBlock[i_blockIdx] = JKRExpHeap::create(i_heapSize, mDoExt_getArchiveHeap(), false); return mMemoryBlock[i_blockIdx]; } @@ -720,7 +722,11 @@ dStage_objectNameInf l_objectName[] = { OBJNAME("Bmcon2", PROC_NPC_BMCON1, 1, 0), OBJNAME("Bmsw", PROC_NPC_BMSW, 255, 0), OBJNAME("Btsw", PROC_NPC_BTSW, 255, 0), +#if VERSION == VERSION_DEMO + OBJNAME("Btsw2", PROC_NPC_BTSW2, 255, 0), +#else OBJNAME("Btsw2", PROC_NPC_BTSW2, 255, 59), +#endif OBJNAME("Zk1", PROC_NPC_ZK1, 255, 59), OBJNAME("Zl1", PROC_NPC_ZL1, 255, 60), OBJNAME("Ob1", PROC_NPC_OB1, 255, 60), @@ -1016,7 +1022,11 @@ dStage_objectNameInf l_objectName[] = { OBJNAME("UkD2", PROC_NPC_UK, 7, 0), OBJNAME("Co1", PROC_NPC_CO1, 255, 59), OBJNAME("Mt", PROC_NPC_MT, 255, 0), +#if VERSION == VERSION_DEMO + OBJNAME("Mn", PROC_NPC_MN, 255, 0), +#else OBJNAME("Mn", PROC_NPC_MN, 255, 59), +#endif OBJNAME("Ah", PROC_NPC_AH, 255, 0), OBJNAME("Hyuf1", PROC_Hmlif, 255, 61), OBJNAME("Hyuf2", PROC_Hmlif, 255, 61), @@ -1830,6 +1840,32 @@ int dStage_mecoInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { return 1; } +#if VERSION == VERSION_DEMO +bool dStage_setShipPos(int param_0, int i_roomNo) { + /* Nonmatching */ + i_roomNo = i_roomNo == 0xFF ? dComIfGp_roomControl_getStayNo() : i_roomNo; + if (param_0 != 0xFF) { + dStage_Ship_dt_c* ship_data_p = dComIfGp_getShip(i_roomNo, param_0); + if (ship_data_p != NULL) { + daShip_c* ship_p = (daShip_c*)fopAcM_SearchByName(PROC_SHIP); + if (ship_p != NULL) { + if (dComIfGp_getStartStagePoint() == -3 ) { + if (dComIfGs_getTurnRestartParam() & 0x100) { + ship_p = (daShip_c*)fopAcM_SearchByName(PROC_SHIP); + if (ship_p != NULL) { + ship_p->initStartPos(&dComIfGs_getTurnRestartShipPos(), dComIfGs_getTurnRestartShipAngleY()); + } + } + } else { + ship_p->initStartPos(&ship_data_p->m_pos, ship_data_p->m_angle); + } + return true; + } + } + } + return false; +} +#else /* 800429C0-80042B10 .text dStage_setShipPos__Fii */ bool dStage_setShipPos(int param_0, int i_roomNo) { if (strcmp(dComIfGp_getStartStageName(), "GanonM") == 0 && !dComIfGs_isEventBit(0x3D02)) { @@ -1862,6 +1898,7 @@ bool dStage_setShipPos(int param_0, int i_roomNo) { return false; } +#endif /* 80042B10-80042B70 .text dStage_chkTaura__Fi */ bool dStage_chkTaura(int i_roomNo) { @@ -1874,19 +1911,28 @@ bool dStage_chkTaura(int i_roomNo) { /* 80042B70-80042C38 .text dStage_shipInfoInit__FP11dStage_dt_cPviPv */ int dStage_shipInfoInit(dStage_dt_c* i_stage, void* i_data, int i_num, void*) { - i_stage->setShip((dStage_Ship_c*)((char*)i_data + 4)); + dStage_Ship_c* ship_p = (dStage_Ship_c*)((char*)i_data + 4); + i_stage->setShip(ship_p); - s32 shipId = dComIfGp_getShipId(); - s32 roomId = dComIfGp_getShipRoomId(); + int shipId = dComIfGp_getShipId(); + int roomId = dComIfGp_getShipRoomId(); - if (dStage_chkTaura(roomId)) { - if (!dComIfGs_isEventBit(dSv_evtBit_c::RODE_KORL) && dStage_setShipPos(0x80, roomId)) { + if (dStage_chkTaura(roomId) && !dComIfGs_isEventBit(dSv_evtBit_c::RODE_KORL)) { + if (dStage_setShipPos(0x80, roomId)) { shipId = 0xFF; roomId = 0xFF; dComIfGp_setShipId(0xFF); dComIfGp_setShipRoomId(0xFF); } } +#if VERSION == VERSION_DEMO + else if (strcmp(dComIfGp_getStartStageName(), "GanonM") == 0 && !dComIfGs_isEventBit(0x3D02)) { + shipId = 0xFF; + roomId = 0xFF; + dComIfGp_setShipId(0xFF); + dComIfGp_setShipRoomId(0xFF); + } +#endif if (dStage_setShipPos(shipId, roomId)) { dComIfGp_setShipId(0xFF); @@ -2345,7 +2391,8 @@ void dStage_escapeRestart() { /* 80043C84-80043CD0 .text dStage_checkRestart__Fv */ BOOL dStage_checkRestart() { if (dComIfGp_isEnableNextStage()) { - if (dComIfGp_getStartStagePoint() == -2 || dComIfGp_getStartStagePoint() == -3) { + int point = dComIfGp_getStartStagePoint(); + if (point == -2 || point == -3) { return FALSE; } diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index a2904b27..18b981d3 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -2454,8 +2454,14 @@ s32 mDoExt_font0_getCount; /* 80016884-800168E0 .text mDoExt_initFont0__Fv */ void mDoExt_initFont0() { +#if VERSION == VERSION_DEMO + int r30 = g_msgDHIO.field_0x08; + static const char fontdata[] = "rock_24_20_4i_usa.bfn"; + mDoExt_initFontCommon(&mDoExt_font0, &mDoExt_resfont0, mDoExt_getZeldaHeap(), fontdata, dComIfGp_getFontArchive(), r30, 0xB4, 0x800); +#else static const char fontdata[] = "rock_24_20_4i_usa.bfn"; mDoExt_initFontCommon(&mDoExt_font0, &mDoExt_resfont0, mDoExt_getZeldaHeap(), fontdata, dComIfGp_getFontArchive(), 1, 0, 0); +#endif } /* 800168E0-8001691C .text mDoExt_getMesgFont__Fv */ |
