diff --git a/configure.py b/configure.py index 4fe1c2869..99ee4bd1d 100755 --- a/configure.py +++ b/configure.py @@ -597,13 +597,13 @@ config.libs = [ # Object(DEBUG_ONLY, "d/d_kankyo_debug.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_agb.cpp"), Object(Matching, "d/actor/d_a_arrow.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_bg.cpp"), + Object(Matching, "d/actor/d_a_bg.cpp"), Object(Matching, "d/actor/d_a_bomb.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_bomb2.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_boomerang.cpp"), Object(Matching, "d/actor/d_a_dai_item.cpp"), Object(Matching, "d/actor/d_a_demo00.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/actor/d_a_disappear.cpp"), + Object(Matching, "d/actor/d_a_disappear.cpp"), Object(Matching, "d/actor/d_a_esa.cpp"), Object(NonMatching, "d/actor/d_a_grid.cpp"), Object(NonMatching, "d/actor/d_a_himo2.cpp"), @@ -627,9 +627,9 @@ config.libs = [ Object(Matching, "d/d_envse.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_file_error.cpp"), Object(MatchingFor("D44J01", "GZLJ01", "GZLE01"), "d/d_file_select.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_gameover.cpp"), + Object(Matching, "d/d_gameover.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_kankyo.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_kyeff.cpp"), + Object(Matching, "d/d_kyeff.cpp"), Object(Matching, "d/d_kyeff2.cpp"), Object(Matching, "d/d_ky_thunder.cpp"), Object(Matching, "d/d_letter.cpp"), @@ -659,7 +659,7 @@ config.libs = [ Object(Matching, "d/d_ovlp_fade3.cpp"), Object(Matching, "d/d_ovlp_fade4.cpp"), Object(NonMatching, "d/d_picture_box.cpp"), - Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_s_logo.cpp"), + Object(Matching, "d/d_s_logo.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_s_menu.cpp"), Object(NonMatching, "d/d_s_name.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_s_open.cpp"), @@ -1484,14 +1484,14 @@ config.libs = [ ActorRel(Matching, "d_a_obj_kanat"), ActorRel(Matching, "d_a_obj_leaves"), ActorRel(Matching, "d_a_obj_lpalm"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_monument"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_movebox"), + ActorRel(Matching, "d_a_obj_monument"), + ActorRel(Matching, "d_a_obj_movebox"), ActorRel(Matching, "d_a_obj_mshokki"), ActorRel(Matching, "d_a_obj_ohatch"), ActorRel(Matching, "d_a_obj_otble"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_pbco"), + ActorRel(Matching, "d_a_obj_pbco"), ActorRel(Matching, "d_a_obj_pirateship"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_quake"), + ActorRel(Matching, "d_a_obj_quake"), ActorRel(Matching, "d_a_obj_rcloud"), ActorRel(Matching, "d_a_obj_roten"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_shelf"), @@ -1501,7 +1501,7 @@ config.libs = [ ActorRel(Matching, "d_a_obj_tenmado"), ActorRel(Equivalent, "d_a_obj_tide"), # Nondeterministic compiler bug? Do not link ActorRel(Matching, "d_a_obj_timer"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_toripost"), + ActorRel(Matching, "d_a_obj_toripost"), ActorRel(Matching, "d_a_obj_tousekiki"), ActorRel(Matching, "d_a_obj_warpt"), ActorRel(Matching, "d_a_obj_wood"), @@ -1518,7 +1518,7 @@ config.libs = [ ActorRel(Matching, "d_a_stone"), ActorRel(Matching, "d_a_stone2"), ActorRel(Matching, "d_a_swc00"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_swhit0"), + ActorRel(Matching, "d_a_swhit0"), ActorRel(Matching, "d_a_swtdoor"), ActorRel(Matching, "d_a_tag_attention"), ActorRel(NonMatching, "d_a_tag_ba1"), @@ -1702,7 +1702,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_npc_pf1"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_photo"), ActorRel(NonMatching, "d_a_npc_pm1"), - ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_roten"), + ActorRel(Matching, "d_a_npc_roten"), ActorRel(Matching, "d_a_npc_rsh1"), ActorRel(NonMatching, "d_a_npc_sarace"), ActorRel(NonMatching, "d_a_npc_sv"), diff --git a/include/DynamicLink.h b/include/DynamicLink.h index 724335427..68cc044d9 100644 --- a/include/DynamicLink.h +++ b/include/DynamicLink.h @@ -62,7 +62,7 @@ struct DynamicModuleControl : DynamicModuleControlBase { virtual bool do_unlink(); DynamicModuleControl(char const*); static JKRArchive* mountCallback(void*); - static void mountCreate(); + static mDoDvdThd_callback_c* mountCreate(); static bool initialize(); static bool callback(void*); diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h index 6f46ba1b1..bc0bd18f3 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -133,14 +133,14 @@ class J3DJoint : public J3DNode { public: void initialize(); void addMesh(J3DMaterial*); - void calcIn(); - void calcOut(); - void entryIn(); - u32 getType() const { return 'NJNT'; } + virtual void calcIn(); + virtual void calcOut(); + virtual void entryIn(); + virtual u32 getType() const { return 'NJNT'; } void recursiveCalc(); J3DJoint() { initialize(); } - ~J3DJoint() {} + virtual ~J3DJoint() {} J3DMaterial* getMesh() { return mMesh; } u16 getJntNo() const { return mJntNo; } @@ -176,4 +176,12 @@ private: /* 0x60 */ J3DMaterial* mMesh; }; // Size: 0x64 +inline BOOL checkScaleOne(Vec v) { + if (v.x == 1.0f && v.y == 1.0f && v.z == 1.0f) { + return TRUE; + } else { + return FALSE; + } +} + #endif /* J3DJOINT_H */ diff --git a/include/JSystem/J3DGraphBase/J3DPacket.h b/include/JSystem/J3DGraphBase/J3DPacket.h index d934eefde..a33d01c42 100644 --- a/include/JSystem/J3DGraphBase/J3DPacket.h +++ b/include/JSystem/J3DGraphBase/J3DPacket.h @@ -3,6 +3,7 @@ #include "JSystem/J3DGraphBase/J3DDrawBuffer.h" #include "JSystem/J3DGraphBase/J3DSys.h" +#include "JSystem/JUtility/JUTAssert.h" #include "dolphin/gd/GDBase.h" #include "dolphin/types.h" @@ -197,15 +198,20 @@ public: void beginDiff(); void endDiff(); - J3DMaterial* getMaterial() const { return mpMaterial; } - J3DShapePacket* getShapePacket() const { return mpShapePacket; } + J3DMaterial* getMaterial() { return mpMaterial; } + J3DShapePacket* getShapePacket() { return mpShapePacket; } void setShapePacket(J3DShapePacket* packet) { mpShapePacket = packet; } - void setMaterial(J3DMaterial* pMaterial) { mpMaterial = pMaterial; } + void setMaterial(J3DMaterial* pMaterial) { + J3D_ASSERT(646, pMaterial != NULL, "Error : null pointer."); + mpMaterial = pMaterial; + } void setTexture(J3DTexture* pTexture) { mpTexture = pTexture; } void setInitShapePacket(J3DShapePacket* packet) { mpInitShapePacket = packet; } - void setMaterialAnmID(J3DMaterialAnm* materialAnm) { mpMaterialAnm = materialAnm; } - bool isChanged() const { return mDiffFlag & 0x80000000; } - bool isEnabled_Diff() const { return mpInitShapePacket->getDisplayListObj() != NULL; } + void setMaterialAnmID(u32 materialAnm) { mpMaterialAnm = (J3DMaterialAnm*)materialAnm; } + void setMaterialID(u32 id) { mDiffFlag = id; } + bool isChanged() { return mDiffFlag & 0x80000000; } + bool isEnabled_Diff() { return mpInitShapePacket->getDisplayListObj() != NULL; } + J3DTexture* getTexture() { return mpTexture; } virtual ~J3DMatPacket(); virtual int entry(J3DDrawBuffer* param_1) { diff --git a/include/SSystem/SComponent/c_bg_w.h b/include/SSystem/SComponent/c_bg_w.h index 9726b5fd6..b09723933 100644 --- a/include/SSystem/SComponent/c_bg_w.h +++ b/include/SSystem/SComponent/c_bg_w.h @@ -141,7 +141,7 @@ public: }; enum PRIORITY { - + // TODO }; cBgW(); diff --git a/include/d/actor/d_a_obj_movebox.h b/include/d/actor/d_a_obj_movebox.h index e151c1447..718b5e6a1 100644 --- a/include/d/actor/d_a_obj_movebox.h +++ b/include/d/actor/d_a_obj_movebox.h @@ -169,9 +169,24 @@ namespace daObjMovebox { int prm_get_type() const { return daObj::PrmAbstract(this, PRM_TYPE_W, PRM_TYPE_S); } int prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWSAVE_W, PRM_SWSAVE_S); } int prm_get_swSave1() const; - int prmZ_get_swSave2() const { return mType == TYPE_BLACK_BOX_WITH_MKIE ? 0xFF : (u8)(mPrmZ >> 8); } - int prmZ_get_swSave2_MkieB() const { return mType == TYPE_BLACK_BOX_WITH_MKIE ? (u8)(mPrmZ >> 8) : 0xFF; } - int prmZ_get_pathId() const { return mType == TYPE_BLACK_BOX_WITH_MKIE ? 0xFF : (mPrmZ & 0x00FF) >> 0; } + int prmZ_get_swSave2() const { + if (mType == TYPE_BLACK_BOX_WITH_MKIE) { + return 0xFF; + } + return (u32)(mPrmZ >> 8) & 0xFF; + } + int prmZ_get_swSave2_MkieB() const { + if (mType == TYPE_BLACK_BOX_WITH_MKIE) { + return (u32)(mPrmZ >> 8) & 0xFF; + } + return 0xFF; + } + int prmZ_get_pathId() const { + if (mType == TYPE_BLACK_BOX_WITH_MKIE) { + return 0xFF; + } + return mPrmZ & 0xFF; + } int prmX_get_evId() const { return (mPrmX & 0x00FF) >> 0; } int prm_get_itemNo() const { return daObj::PrmAbstract(this, PRM_ITEMNO_W, PRM_ITEMNO_S); } int prm_get_itemSave() const { return daObj::PrmAbstract(this, PRM_ITEMSAVE_W, PRM_ITEMSAVE_S); } diff --git a/include/d/actor/d_a_obj_toripost.h b/include/d/actor/d_a_obj_toripost.h index 07dee22c7..75a8aa5af 100644 --- a/include/d/actor/d_a_obj_toripost.h +++ b/include/d/actor/d_a_obj_toripost.h @@ -92,7 +92,7 @@ public: static const dCcD_SrcCyl m_cyl_src; private: - static const s32 m_send_price[]; + static const int m_send_price[]; /* 0x6C4 */ u32 mCurMode; /* 0x6C8 */ s8 mBckIdx; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index fc82d7d05..ec3c3823e 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -634,14 +634,8 @@ public: JKRAramBlock* getPictureBoxData(int i) { return mPictureBoxData[i]; } void setPictureBoxData(JKRAramBlock* aramBlock, int i) { mPictureBoxData[i] = aramBlock; } bool isPictureFlag(u8 i) { return mPictureFlag & (u8)(1 << i); } - void onPictureFlag(u8 i) { - u8 mask = (1 << i); - mPictureFlag |= mask; - } - void offPictureFlag(u8 i) { - u8 mask = (1 << i); - mPictureFlag &= ~mask; - } + void onPictureFlag(u8 i) { mPictureFlag |= (u8)(1 << i); } + void offPictureFlag(u8 i) { mPictureFlag &= ~(u8)(1 << i); } u8 getPictureFormat() { return mPictureFormat; } void setPictureFormat(u8 fmt) { mPictureFormat = fmt; } u8 getSelectPicture() { return mSelectPicture; } @@ -1190,15 +1184,13 @@ inline BOOL dComIfGs_isGetItemReserve(u8 i_no) { return g_dComIfG_gameInfo.save.getPlayer().getGetBagItem().isReserve(i_no); } -inline void dComIfGs_onGetItemReserve(int i_no) { +inline void dComIfGs_onGetItemReserve(u8 i_no) { g_dComIfG_gameInfo.save.getPlayer().getGetBagItem().onReserve(i_no); } -#if VERSION == VERSION_DEMO inline void dComIfGs_offGetItemReserve(u8 i_no) { g_dComIfG_gameInfo.save.getPlayer().getGetBagItem().offReserve(i_no); } -#endif inline BOOL dComIfGs_isGetCollectMap(int i_no) { return g_dComIfG_gameInfo.save.getPlayer().getMap().isGetMap(i_no - 1); @@ -4393,9 +4385,18 @@ inline int dComIfG_getTimerRestTimeMs() { return limit - now; } -inline void dComIfG_TimerDeleteRequest() { - if (dComIfG_getTimerPtr() != NULL) - dComIfG_getTimerPtr()->deleteRequest(); +inline int dComIfG_TimerDeleteRequest(int i_mode) { + if (i_mode == dComIfG_getTimerMode()) { + dTimer_c* timer = dComIfG_getTimerPtr(); + if (timer != NULL) { + timer->deleteRequest(); + return 1; + } else { + return 0; + } + } + + return 0; } inline void dComIfG_TimerStart(int mode, s16 timer) { if (dComIfG_getTimerMode() == mode && dComIfG_getTimerPtr() != NULL) { diff --git a/include/d/d_flower.h b/include/d/d_flower.h index ffb772cbf..b59e3f8c6 100644 --- a/include/d/d_flower.h +++ b/include/d/d_flower.h @@ -59,7 +59,7 @@ public: dFlower_data_c* newData(s8, cXyz&, int, s8); int newAnm(); void setAnm(int, s16); - void deleteRoom(s32 roomNo) { mRoom[roomNo].deleteData(); } + void deleteRoom(int roomNo) { mRoom[roomNo].deleteData(); } virtual void draw(); virtual ~dFlower_packet_c(); diff --git a/include/d/d_resorce.h b/include/d/d_resorce.h index e61d328fc..6b5b3a5df 100644 --- a/include/d/d_resorce.h +++ b/include/d/d_resorce.h @@ -52,7 +52,7 @@ class dRes_control_c { public: dRes_control_c() {} ~dRes_control_c(); - static BOOL setRes(char const*, dRes_info_c*, int, char const*, u8, JKRHeap*); + static int setRes(char const*, dRes_info_c*, int, char const*, u8, JKRHeap*); static int syncRes(char const*, dRes_info_c*, int); static int deleteRes(char const*, dRes_info_c*, int); static void* getRes(char const*, char const*, dRes_info_c*, int); @@ -62,11 +62,11 @@ public: static void* getRes(char const*, s32, dRes_info_c*, int); static void* getIDRes(char const*, u16, dRes_info_c*, int); static int syncAllRes(dRes_info_c*, int); - BOOL setStageRes(char const*, JKRHeap*); + int setStageRes(char const*, JKRHeap*); void dump(); int getObjectResName2Index(char const*, char const*); - BOOL setObjectRes(const char* name, u8 direction, JKRHeap* heap) { + int setObjectRes(const char* name, u8 direction, JKRHeap* heap) { return setRes(name, &mObjectInfo[0], ARRAY_SIZE(mObjectInfo), "/res/Object/", direction, heap); } diff --git a/include/d/d_s_logo.h b/include/d/d_s_logo.h index 32e2ff520..1000519df 100644 --- a/include/d/d_s_logo.h +++ b/include/d/d_s_logo.h @@ -25,7 +25,7 @@ public: /* 0x1F2 */ u16 field_0x1f2; /* 0x1F4 */ u16 field_0x1f4; /* 0x1F8 */ void * field_0x1f8; - /* 0x1FC */ u32 field_0x1fc; + /* 0x1FC */ void * field_0x1fc; }; #endif /* D_S_LOGO_H */ diff --git a/include/d/d_save.h b/include/d/d_save.h index 4159cff5b..ab0a3a3db 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -240,9 +240,7 @@ public: void onBait(u8); BOOL isBait(u8); void onReserve(u8); -#if VERSION == VERSION_DEMO void offReserve(u8); -#endif BOOL isReserve(u8); /* 0x0 */ u32 mReserveFlags; diff --git a/include/dolphin/mtx/vec.h b/include/dolphin/mtx/vec.h index 48f0bbfc8..fa3e90424 100644 --- a/include/dolphin/mtx/vec.h +++ b/include/dolphin/mtx/vec.h @@ -47,14 +47,6 @@ f32 PSVECDistance(const Vec* a, const Vec* b); void C_VECHalfAngle(const Vec* a, const Vec* b, Vec* half); void C_VECReflect(const Vec* src, const Vec* normal, Vec* dst); -inline BOOL checkScaleOne(Vec v) { - if (v.x == 1.0f && v.y == 1.0f && v.z == 1.0f) { - return TRUE; - } else { - return FALSE; - } -} - /* When compiling in debug mode, use C implementations */ #if defined(DEBUG) || !defined(__MWERKS__) #define VECAdd C_VECAdd diff --git a/src/DynamicLink.cpp b/src/DynamicLink.cpp index 9b014a255..724e31573 100644 --- a/src/DynamicLink.cpp +++ b/src/DynamicLink.cpp @@ -192,7 +192,7 @@ JKRArchive* DynamicModuleControl::mountCallback(void* param_0) { return sArchive; } -void DynamicModuleControl::mountCreate() { +mDoDvdThd_callback_c* DynamicModuleControl::mountCreate() { mDoDvdThd_callback_c::create((mDoDvdThd_callback_func)DynamicModuleControl::mountCallback, NULL); } diff --git a/src/JSystem/J3DGraphAnimator/J3DJoint.cpp b/src/JSystem/J3DGraphAnimator/J3DJoint.cpp index 5ea7d2cc4..286161762 100644 --- a/src/JSystem/J3DGraphAnimator/J3DJoint.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DJoint.cpp @@ -245,7 +245,7 @@ void J3DJoint::entryIn() { mesh->calc(anmMtx); } mesh->setCurrentMtx(); - matPacket->setMaterialAnmID(mesh->getMaterialAnm()); + matPacket->setMaterialAnmID((u32)mesh->getMaterialAnm()); matPacket->setShapePacket(shapePacket); J3DDrawBuffer* drawBuffer = j3dSys.getDrawBuffer(mesh->isDrawModeOpaTexEdge()); if ((u8)matPacket->entry(drawBuffer)) { diff --git a/src/JSystem/J3DGraphAnimator/J3DModel.cpp b/src/JSystem/J3DGraphAnimator/J3DModel.cpp index 1bd00a120..bb6fb8ee0 100644 --- a/src/JSystem/J3DGraphAnimator/J3DModel.cpp +++ b/src/JSystem/J3DGraphAnimator/J3DModel.cpp @@ -256,7 +256,7 @@ s32 J3DModel::createMatPacket(J3DModelData* pModelData, u32 flag) { mpMatPacket[i].setInitShapePacket(shapePacket); mpMatPacket[i].addShapePacket(shapePacket); mpMatPacket[i].setTexture(pModelData->getTexture()); - mpMatPacket[i].mDiffFlag = pModelData->getMaterialNodePointer(i)->mDiffFlag; + mpMatPacket[i].setMaterialID(pModelData->getMaterialNodePointer(i)->mDiffFlag); if (pModelData->getModelDataType() == 1) mpMatPacket[i].mFlags |= 0x01; diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp index fc92aa5a9..6fdfc66bd 100644 --- a/src/d/actor/d_a_bg.cpp +++ b/src/d/actor/d_a_bg.cpp @@ -211,7 +211,7 @@ BOOL daBg_c::createHeap() { if (bgw->Set(dzb, cBgW::GLOBAL_e, NULL)) return FALSE; dStage_roomControl_c::setBgW(roomNo, bgw); - bgw->mWallCorrectPriority = 0; + bgw->SetPriority((cBgW::PRIORITY)0); } else { bgw = NULL; } @@ -226,9 +226,7 @@ static void escapeRestart() { daPy_lk_c* player_p = daPy_getPlayerLinkActorClass(); dComIfGs_setTurnRestart(player_p->current.pos, player_p->shape_angle.y, fopAcM_GetRoomNo(player_p), player_p->getDayNightParamData()); - if (dComIfG_getTimerMode() == 3) { - dComIfG_TimerDeleteRequest(); - } + dComIfG_TimerDeleteRequest(3); dComIfGp_setNextStage(dComIfGp_getStartStageName(), -3, dComIfGs_getTurnRestartRoomNo(), -1, 0.0f, 0, FALSE, 9); } @@ -313,6 +311,17 @@ BOOL daBg_c::execute() { mUnloadTimer = 1; #endif } else { +#if VERSION == VERSION_DEMO + if (!mDoGph_gInf_c::isMonotone()) { + BgModel * bgm = &bg[0]; + for (s32 i = 0; i < 4; i++, bgm++) { + if (bgm->btk != NULL) + bgm->btk->play(); + if (bgm->brk != NULL) + bgm->brk->play(); + } + } +#else BgModel * bgm = &bg[0]; for (s32 i = 0; i < 4; i++, bgm++) { if (!mDoGph_gInf_c::isMonotone() || i == 2) { @@ -322,6 +331,7 @@ BOOL daBg_c::execute() { bgm->brk->play(); } } +#endif } return TRUE; @@ -359,25 +369,28 @@ static cPhs_State daBg_Create(fopAc_ac_c* i_ac) { cPhs_State daBg_c::create() { fopAcM_ct(this, daBg_c); - s32 roomNo = fopAcM_GetParam(this); + int roomNo = fopAcM_GetParam(this); JKRExpHeap * roomHeap = dStage_roomControl_c::getMemoryBlock(roomNo); if (roomHeap != NULL) { heap = JKRSolidHeap::create(-1, roomHeap, false); - JUT_ASSERT(0x2fd, heap != NULL); + JUT_ASSERT(DEMO_SELECT(796, 765), heap != NULL); JKRHeap * oldHeap = mDoExt_setCurrentHeap(heap); BOOL rt = createHeap(); - JUT_ASSERT(0x302, rt == TRUE); + JUT_ASSERT(DEMO_SELECT(801, 770), rt == TRUE); mDoExt_setCurrentHeap(oldHeap); heap->adjustSize(); } else { - if (!fopAcM_entrySolidHeap(this, checkCreateHeap, 0)) { #if VERSION == VERSION_DEMO + if (REG1_S(0) != 0 || !fopAcM_entrySolidHeap(this, checkCreateHeap, 0)) { escapeRestart(); -#else - dStage_escapeRestart(); -#endif return cPhs_ERROR_e; } +#else + if (!fopAcM_entrySolidHeap(this, checkCreateHeap, 0)) { + dStage_escapeRestart(); + return cPhs_ERROR_e; + } +#endif } BgModel * bgm = &bg[0]; @@ -406,17 +419,27 @@ cPhs_State daBg_c::create() { } } - if (bgw != NULL && dComIfG_Bgsp()->Regist(bgw, this)) { #if VERSION == VERSION_DEMO + if (bgw != NULL && (REG1_S(0) != 0 || dComIfG_Bgsp()->Regist(bgw, this))) { escapeRestart(); -#else - dStage_escapeRestart(); -#endif return cPhs_ERROR_e; } +#else + if (bgw != NULL && dComIfG_Bgsp()->Regist(bgw, this)) { + dStage_escapeRestart(); + return cPhs_ERROR_e; + } +#endif +#if VERSION == VERSION_DEMO + dComIfGp_roomControl_getTevStr(roomNo)->mEnvrIdxOverride = 0xFF; + dComIfGp_roomControl_getTevStr(roomNo)->mRoomNo = roomNo; +#else dKy_tevstr_init(dComIfGp_roomControl_getTevStr(roomNo), roomNo, 0xFF); +#endif + dComIfGp_roomControl_onStatusFlag(roomNo, 0x10); + return cPhs_COMPLEATE_e; } diff --git a/src/d/actor/d_a_bgn.cpp b/src/d/actor/d_a_bgn.cpp index b63b1e806..9dbf6ef27 100644 --- a/src/d/actor/d_a_bgn.cpp +++ b/src/d/actor/d_a_bgn.cpp @@ -463,7 +463,7 @@ void mDoExt_J3DModelPacketS::draw() { while (mesh != NULL) { if (!mesh->getShape()->checkFlag(J3DShpFlag_Hide)) { matPacket = mpModel->getMatPacket(mesh->getIndex()); - j3dSys.setTexture(matPacket->mpTexture); + j3dSys.setTexture(matPacket->getTexture()); j3dSys.setMatPacket(matPacket); mesh->load(); setMaterial(); diff --git a/src/d/actor/d_a_dai.cpp b/src/d/actor/d_a_dai.cpp index 759272efb..7cc250b39 100644 --- a/src/d/actor/d_a_dai.cpp +++ b/src/d/actor/d_a_dai.cpp @@ -99,12 +99,18 @@ void daDai_c::CreateInit() { m850 = fpcM_ERROR_PROCESS_ID_e; if (dComIfGs_getEventReg(m_savelabel[mSaveID])) { + void* dai_item = fopAcM_fastCreate( + fpcNm_STANDITEM_e, + dComIfGs_getEventReg(m_savelabel[mSaveID]), + ¤t.pos, #if VERSION <= VERSION_JPN - void* pfVar3 = fopAcM_fastCreate(fpcNm_STANDITEM_e, dComIfGs_getEventReg(m_savelabel[mSaveID]), ¤t.pos, -1, ¤t.angle); + -1, #else - void* pfVar3 = fopAcM_fastCreate(fpcNm_STANDITEM_e, dComIfGs_getEventReg(m_savelabel[mSaveID]), ¤t.pos, fopAcM_GetRoomNo(this), ¤t.angle); + fopAcM_GetRoomNo(this), #endif - m850 = fopAcM_GetID(pfVar3); + ¤t.angle + ); + m850 = fopAcM_GetID(dai_item); incNowItemNum(); } incNowDaizaNum(); @@ -181,16 +187,16 @@ void daDai_c::checkOrder() { if (dComIfGp_evmng_startCheck(mEvtDaiItemIdx) && player->getGrabActorID() != fpcM_ERROR_PROCESS_ID_e) { m850 = player->getGrabActorID(); - daStandItem_c* pfVar2 = (daStandItem_c*)fopAcM_SearchByID(m850); - if (pfVar2 != NULL) { - m84B = pfVar2->mItemNo; + daStandItem_c* dai_item = (daStandItem_c*)fopAcM_SearchByID(m850); + if (dai_item != NULL) { + m84B = dai_item->mItemNo; } } if (dComIfGp_evmng_endCheck(mEvtDaiItemIdx)) { - fopAc_ac_c* pfVar3 = fopAcM_SearchByID(m850); - if (pfVar3 != NULL) { - pfVar3->current.pos = current.pos; + fopAc_ac_c* dai_item = fopAcM_SearchByID(m850); + if (dai_item != NULL) { + dai_item->current.pos = current.pos; } dComIfGs_setEventReg(m_savelabel[mSaveID], m84B); dComIfGs_setReserveItemEmpty(); @@ -279,15 +285,15 @@ bool daDai_c::_draw() { /* 00000E48-00000EDC .text getMsg__7daDai_cFv */ u32 daDai_c::getMsg() { - u32 uVar2; + u32 msgNo; if (dComIfGp_event_chkTalkXY()) { - uVar2 = 0xf13; + msgNo = 0xF13; } else if (dComIfGs_getEventReg(m_savelabel[mSaveID])) { - uVar2 = 0xf0d; + msgNo = 0xF0D; } else { - uVar2 = 0xf11; + msgNo = 0xF11; } - return uVar2; + return msgNo; } /* 00000EDC-0000109C .text next_msgStatus__7daDai_cFPUl */ @@ -295,20 +301,20 @@ u16 daDai_c::next_msgStatus(u32* pMsgNo) { u16 msgStatus = fopMsgStts_MSG_CONTINUES_e; switch (*pMsgNo) { - case 0xF11: - *pMsgNo = 0xf12; + case 0xF11: // Check when empty + *pMsgNo = 0xF12; break; - case 0xF0D: + case 0xF0D: // Check when item is placed, ask to remove switch (mpCurrMsg->mSelectNum) { - case 0: + case 0: // Yes if (dComIfGs_checkReserveItemEmpty() && getRotenItemNumInBag() < 3) { fopAcM_seStart(this, JA_SE_LK_W_DAIZA_TAKEOFF, 0); - *pMsgNo = 0xf0f; + *pMsgNo = 0xF0F; - fopAc_ac_c* pfVar4 = fopAcM_SearchByID(m850); - if (pfVar4 != NULL) { - fopAcM_delete(pfVar4); + fopAc_ac_c* dai_item = fopAcM_SearchByID(m850); + if (dai_item != NULL) { + fopAcM_delete(dai_item); } u8 uVar5 = dComIfGs_getEventReg(m_savelabel[mSaveID]); @@ -317,11 +323,11 @@ u16 daDai_c::next_msgStatus(u32* pMsgNo) { decNowItemNum(); m84A = 0; } else { - *pMsgNo = 0xf0e; + *pMsgNo = 0xF0E; } break; - case 1: + case 1: // No default: msgStatus = fopMsgStts_MSG_ENDS_e; break; diff --git a/src/d/actor/d_a_disappear.cpp b/src/d/actor/d_a_disappear.cpp index 38a1f8bfe..2017b7c66 100644 --- a/src/d/actor/d_a_disappear.cpp +++ b/src/d/actor/d_a_disappear.cpp @@ -25,7 +25,7 @@ static BOOL daDisappear_Execute(disappear_class* i_this) { if (dropType != daDisItem_NONE1_e && dropType != daDisItem_NONE3_e) { if (dropType == daDisItem_HEART_CONTAINER_e) { - fopAcM_createItemForBoss(&i_this->current.pos, 0, i_this->current.roomNo, &i_this->current.angle, NULL, 0); + fopAcM_createItemForBoss(&i_this->current.pos, 0, fopAcM_GetRoomNo(i_this), &i_this->current.angle, NULL, 0); } else if (dropType >= daDisItem_HEART_e && dropType <= daDisItem_NONE13_e) { // Special type for Keese (ki) spawned in the Puppet Ganon fight. @@ -40,7 +40,7 @@ static BOOL daDisappear_Execute(disappear_class* i_this) { } } else { - fopAcM_createIball(&i_this->current.pos, i_this->itemTableIdx, i_this->current.roomNo, &i_this->current.angle, i_this->mItemBitNo); + fopAcM_createIball(&i_this->current.pos, i_this->itemTableIdx, fopAcM_GetRoomNo(i_this), &i_this->current.angle, i_this->mItemBitNo); } } } diff --git a/src/d/actor/d_a_kui.cpp b/src/d/actor/d_a_kui.cpp index 040dd130d..139d357cc 100644 --- a/src/d/actor/d_a_kui.cpp +++ b/src/d/actor/d_a_kui.cpp @@ -69,13 +69,12 @@ static void setEffectMtx(fopAc_ac_c* a_this, J3DModelData* modelData, float scal mDoMtx_stack_c::scaleS(scale, scale, 1.0f); mDoMtx_stack_c::concat(mtx_adj); mDoMtx_stack_c::concat(reflMtx); - MtxP mtx = mDoMtx_stack_c::get(); - mtx[0][3] = 0.0f; - mtx[1][3] = 0.0f; - mtx[2][3] = 0.0f; + mDoMtx_stack_c::get()[0][3] = 0.0f; + mDoMtx_stack_c::get()[1][3] = 0.0f; + mDoMtx_stack_c::get()[2][3] = 0.0f; Mtx now_copy; - PSMTXCopy(mDoMtx_stack_c::get(), now_copy); + cMtx_copy(mDoMtx_stack_c::get(), now_copy); for (u16 i = 0; i < modelData->getMaterialNum(); i++) { J3DMaterial* mat = modelData->getMaterialNodePointer(i); @@ -171,7 +170,10 @@ static void demo_camera(kui_class* i_this) { i_this->field_0x2F8.y += REG8_F(0) + 200.0f; cMtx_YrotS(*calc_mtx, i_this->current.angle.y); - cXyz vec(REG8_F(1) + 800.f, REG8_F(2), REG8_F(3) + 100.0f); + cXyz vec; + vec.x = REG8_F(1) + 800.f; + vec.y = REG8_F(2); + vec.z = REG8_F(3) + 100.0f; cXyz posVec; MtxPosition(&vec, &posVec); @@ -311,21 +313,21 @@ static BOOL daKui_Execute(kui_class* i_this) { cLib_addCalcAngleS2(&i_this->field_0x2E6, REG17_S(7) + 0x100, 1, REG17_S(8) + 0x40); MtxTrans(actor->home.pos.x, actor->home.pos.y, actor->home.pos.z, FALSE); - mDoMtx_YrotM(*calc_mtx, actor->current.angle.y); + cMtx_YrotM(*calc_mtx, actor->current.angle.y); MtxPush(); - mDoMtx_YrotM(*calc_mtx, actor->shape_angle.y); - mDoMtx_XrotM(*calc_mtx, x + i_this->field_0x2E2); - mDoMtx_ZrotM(*calc_mtx, z); - mDoMtx_YrotM(*calc_mtx, -actor->shape_angle.y); + cMtx_YrotM(*calc_mtx, actor->shape_angle.y); + cMtx_XrotM(*calc_mtx, x + i_this->field_0x2E2); + cMtx_ZrotM(*calc_mtx, z); + cMtx_YrotM(*calc_mtx, -actor->shape_angle.y); MtxScale(unk_f, unk_f, unk_f, TRUE); i_this->mpModel->setBaseTRMtx(*calc_mtx); MtxPull(); - mDoMtx_YrotM(*calc_mtx, actor->shape_angle.y + REG0_S(5)); - mDoMtx_XrotM(*calc_mtx, actor->current.angle.x + REG0_S(6)); - mDoMtx_YrotM(*calc_mtx, -(actor->shape_angle.y + REG0_S(5) + 0x4000)); + cMtx_YrotM(*calc_mtx, actor->shape_angle.y + REG0_S(5)); + cMtx_XrotM(*calc_mtx, actor->current.angle.x + REG0_S(6)); + cMtx_YrotM(*calc_mtx, -(actor->shape_angle.y + REG0_S(5) + 0x4000)); MtxScale(unk_f, 1.0, unk_f, TRUE); i_this->mpModel2->setBaseTRMtx(*calc_mtx); @@ -335,13 +337,13 @@ static BOOL daKui_Execute(kui_class* i_this) { MtxPosition(&temp2, &actor->current.pos); MtxTrans(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z, FALSE); - mDoMtx_YrotM(*calc_mtx, actor->current.angle.y); + cMtx_YrotM(*calc_mtx, actor->current.angle.y); MtxScale(actor->scale.x, actor->scale.y, actor->scale.z, TRUE); cMtx_copy(*calc_mtx, i_this->field_0x2A8); i_this->field_0x2D8->Move(); } else { MtxTrans(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z, FALSE); - mDoMtx_YrotM(*calc_mtx, actor->current.angle.y); + cMtx_YrotM(*calc_mtx, actor->current.angle.y); if (i_this->type == 2 || i_this->type == 4) { i_this->mpModel->setBaseTRMtx(*calc_mtx); } @@ -397,7 +399,7 @@ static BOOL daKui_IsDelete(kui_class*) { /* 000012EC-00001340 .text daKui_Delete__FP9kui_class */ static BOOL daKui_Delete(kui_class* i_this) { - dComIfG_resDelete(&i_this->mPhs, "Kui"); + dComIfG_resDeleteDemo(&i_this->mPhs, "Kui"); dComIfG_Bgsp()->Release(i_this->field_0x2D8); return TRUE; } @@ -410,7 +412,7 @@ static BOOL daKui_CreateHeap(fopAc_ac_c* a_this) { if (i_this->type == 3) { // Bell body modelData = (J3DModelData*)dComIfG_getObjectRes("Kui", dRes_INDEX_KUI_BDL_HKANE1_e); - JUT_ASSERT(0x353, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(836, 851), modelData != NULL); i_this->mpModel = mDoExt_J3DModel__create(modelData, 0, 0x11020203); if (!i_this->mpModel) { @@ -419,7 +421,7 @@ static BOOL daKui_CreateHeap(fopAc_ac_c* a_this) { // Bell handle modelData = (J3DModelData*)dComIfG_getObjectRes("Kui", dRes_INDEX_KUI_BDL_HKANE2_e); - JUT_ASSERT(0x35F, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(848, 863), modelData != NULL); i_this->mpModel2 = mDoExt_J3DModel__create(modelData, 0, 0x11020203); if (!i_this->mpModel2) { @@ -428,7 +430,7 @@ static BOOL daKui_CreateHeap(fopAc_ac_c* a_this) { } else { // Rope modelData = (J3DModelData*)dComIfG_getObjectRes("Kui", dRes_INDEX_KUI_BDL_OBI_ROPETAG_e); - JUT_ASSERT(0x36B, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(860, 875), modelData != NULL); i_this->mpModel2 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000002); if (!i_this->mpModel2) { @@ -438,7 +440,7 @@ static BOOL daKui_CreateHeap(fopAc_ac_c* a_this) { if (i_this->type == 2 || i_this->type == 4) { // Rope swing attachment modelData = (J3DModelData*)dComIfG_getObjectRes("Kui", dRes_INDEX_KUI_BDL_MROPESW_e); - JUT_ASSERT(0x377, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(872, 887), modelData != NULL); i_this->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000002); if (!i_this->mpModel) { @@ -468,11 +470,13 @@ static cPhs_State daKui_Create(fopAc_ac_c* a_this) { kui_class* i_this; cPhs_State result; - fopAcM_ct(a_this, kui_class); + fopAcM_ct_Retail(a_this, kui_class); i_this = (kui_class*) a_this; result = dComIfG_resLoad(&i_this->mPhs, "Kui"); if (result == cPhs_COMPLEATE_e) { + fopAcM_ct_Demo(a_this, kui_class); + if (fopAcM_GetParam(a_this) == -1) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_npc_ah.cpp b/src/d/actor/d_a_npc_ah.cpp index 7944caa55..eac3a2f68 100644 --- a/src/d/actor/d_a_npc_ah.cpp +++ b/src/d/actor/d_a_npc_ah.cpp @@ -135,12 +135,12 @@ static BOOL da_Npc_Ah_nodeCallBack(J3DNode* node, int calcTiming) { MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); if(jointNo == i_this->m_jnt.getHeadJntNum()){ - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getHead_y()); - cMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getHead_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getHead_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getHead_x()); } else if(jointNo == i_this->m_jnt.getBackboneJntNum()){ - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getBackbone_y()); - cMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getBackbone_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getBackbone_x()); } #if VERSION > VERSION_DEMO MTXCopy(*calc_mtx, model->getAnmMtx(jointNo)); diff --git a/src/d/actor/d_a_npc_bs1.cpp b/src/d/actor/d_a_npc_bs1.cpp index 93fd202c1..bbbea5ef2 100644 --- a/src/d/actor/d_a_npc_bs1.cpp +++ b/src/d/actor/d_a_npc_bs1.cpp @@ -192,8 +192,8 @@ static BOOL nodeCallBack_Bs(J3DNode* node, int calcTiming) { MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); if (jntNo == i_this->getHeadJntNum()) { cXyz offset(0.0f, 0.0f, 0.0f); - mDoMtx_XrotM(*calc_mtx, i_this->getHead_y()); - cMtx_ZrotM(*calc_mtx, -i_this->getHead_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->getHead_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->getHead_x()); cXyz pos; MtxPosition(&offset, &pos); i_this->setAttentionBasePos(pos); @@ -204,8 +204,8 @@ static BOOL nodeCallBack_Bs(J3DNode* node, int calcTiming) { i_this->setEyePos(pos); i_this->incAttnSetCount(); } else if (jntNo == i_this->getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->getBackbone_y()); - cMtx_ZrotM(*calc_mtx, -i_this->getBackbone_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->getBackbone_x()); } cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); model->setAnmMtx(jntNo, *calc_mtx); diff --git a/src/d/actor/d_a_npc_hr.cpp b/src/d/actor/d_a_npc_hr.cpp index 68c962ff6..a6cae4f77 100644 --- a/src/d/actor/d_a_npc_hr.cpp +++ b/src/d/actor/d_a_npc_hr.cpp @@ -986,7 +986,7 @@ static BOOL nodeCallBack_Hr(J3DNode* node, int calcTiming) { i_this->setEyePos(temp2); i_this->incAttnSetCount(); } else if (jntNo == i_this->getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->getBackbone_y()); + cMtx_XrotM(*calc_mtx, (s16)i_this->getBackbone_y()); } else if (jntNo == i_this->m_waist_jnt_num) { temp.set(0.0f, 0.0f, 0.0f); MtxPosition(&temp, &i_this->mCloudPos); diff --git a/src/d/actor/d_a_npc_ji1.cpp b/src/d/actor/d_a_npc_ji1.cpp index 360d2f341..2a34c9daa 100644 --- a/src/d/actor/d_a_npc_ji1.cpp +++ b/src/d/actor/d_a_npc_ji1.cpp @@ -3965,7 +3965,10 @@ BOOL daNpc_Ji1_c::battleGuardCheck() { if(field_0xC3C > 2) { if(checkAction(&daNpc_Ji1_c::battleAction)) { - dComIfG_TimerDeleteRequest(); + dTimer_c* timer = dComIfG_getTimerPtr(); + if (timer != NULL) { + timer->deleteRequest(); + } if(isClearRecord(field_0xD70)) { setClearRecord(field_0xD70); diff --git a/src/d/actor/d_a_npc_mk.cpp b/src/d/actor/d_a_npc_mk.cpp index 6059246c3..26ebec783 100644 --- a/src/d/actor/d_a_npc_mk.cpp +++ b/src/d/actor/d_a_npc_mk.cpp @@ -48,8 +48,8 @@ static BOOL nodeCallBack_Mk(J3DNode* node, int calcTiming) { MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); if (jntNo == i_this->getHeadJntNum()) { temp.setall(0.0f); - mDoMtx_XrotM(*calc_mtx, (s16)i_this->getHead_y()); - mDoMtx_ZrotM(*calc_mtx, (s16)i_this->getHead_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->getHead_y()); + cMtx_ZrotM(*calc_mtx, (s16)i_this->getHead_x()); MtxPosition(&temp, &temp2); i_this->setAttentionBasePos(temp2); temp.set(20.0f, -20.0f, 0.0f); @@ -59,8 +59,8 @@ static BOOL nodeCallBack_Mk(J3DNode* node, int calcTiming) { i_this->incAttnSetCount(); } else if (jntNo == i_this->getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->getBackbone_y()); - mDoMtx_ZrotM(*calc_mtx, i_this->getBackbone_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)i_this->getBackbone_x()); } cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); model->setAnmMtx(jntNo, *calc_mtx); diff --git a/src/d/actor/d_a_npc_p1.cpp b/src/d/actor/d_a_npc_p1.cpp index 6f0387655..bd81db041 100644 --- a/src/d/actor/d_a_npc_p1.cpp +++ b/src/d/actor/d_a_npc_p1.cpp @@ -946,8 +946,8 @@ static BOOL nodeCallBack1(J3DNode* i_node, int i_param_2) { MtxPosition(&local_28, &i_this->eyePos); } if (jntNo == i_this->m_jnt.getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getBackbone_y()); - mDoMtx_ZrotM(*calc_mtx, i_this->m_jnt.getBackbone_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)i_this->m_jnt.getBackbone_x()); } model->setAnmMtx(jntNo, *calc_mtx); diff --git a/src/d/actor/d_a_npc_photo.cpp b/src/d/actor/d_a_npc_photo.cpp index caa680c6f..ed1bad16a 100644 --- a/src/d/actor/d_a_npc_photo.cpp +++ b/src/d/actor/d_a_npc_photo.cpp @@ -588,16 +588,16 @@ static BOOL daNpc_Photo_nodeCallBack(J3DNode* node, int calcTiming) { J3DJoint* joint = (J3DJoint*)node; daNpcPhoto_c* i_this = (daNpcPhoto_c*)model->getUserArea(); s32 jntNo = joint->getJntNo(); - cMtx_copy(model->getAnmMtx(jntNo), *calc_mtx); + MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); if(jntNo == i_this->m_jnt.getHeadJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getHead_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getHead_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getHead_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getHead_x()); } if(jntNo == i_this->m_jnt.getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getBackbone_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getBackbone_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getBackbone_x()); } model->setAnmMtx(jntNo, *calc_mtx); diff --git a/src/d/actor/d_a_npc_roten.cpp b/src/d/actor/d_a_npc_roten.cpp index e933af893..c79b4d1c6 100644 --- a/src/d/actor/d_a_npc_roten.cpp +++ b/src/d/actor/d_a_npc_roten.cpp @@ -411,7 +411,11 @@ static u32 l_msg_xy_invalid_item_B[] = { }; static u32 l_msg_xy_invalid_item_C[] = { +#if VERSION == VERSION_DEMO + 0x29DE, +#else 0x29DD, +#endif 0x0000, }; @@ -1586,16 +1590,15 @@ static BOOL daNpc_Roten_nodeCallBack(J3DNode* node, int calcTiming) { daNpcRoten_c* i_this = (daNpcRoten_c*)model->getUserArea(); s32 jntNo = joint->getJntNo(); - MtxP mtx = model->getAnmMtx(jntNo); - cMtx_copy(mtx, *calc_mtx); + MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); if(jntNo == i_this->m_jnt.getHeadJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getHead_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getHead_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getHead_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getHead_x()); } if(jntNo == i_this->m_jnt.getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getBackbone_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getBackbone_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->m_jnt.getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)-i_this->m_jnt.getBackbone_x()); } model->setAnmMtx(jntNo, *calc_mtx); @@ -1739,7 +1742,7 @@ cPhs_State daNpcRoten_c::createInit() { weight = 0xFE; } - gravity = -9.0f; + fopAcM_SetGravity(this, -9.0f); field_0x99E = dComIfGp_evmng_getEventIdx("ROTEN_EXCHANGE_1ST"); field_0x9A0 = dComIfGp_evmng_getEventIdx("ROTEN_EXCHANGE_2ND"); diff --git a/src/d/actor/d_a_npc_tt.cpp b/src/d/actor/d_a_npc_tt.cpp index 0f4d6cffd..98bfbc8f3 100644 --- a/src/d/actor/d_a_npc_tt.cpp +++ b/src/d/actor/d_a_npc_tt.cpp @@ -55,8 +55,8 @@ static BOOL nodeCallBack_Tt(J3DNode* node, int calcTiming) { i_this->incAttnSetCount(); } else if (jntNo == i_this->getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->getBackbone_y()); - mDoMtx_ZrotM(*calc_mtx, i_this->getBackbone_x()); + cMtx_XrotM(*calc_mtx, (s16)i_this->getBackbone_y()); + cMtx_ZrotM(*calc_mtx, (s16)i_this->getBackbone_x()); } cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); model->setAnmMtx(jntNo, *calc_mtx); diff --git a/src/d/actor/d_a_obj_monument.cpp b/src/d/actor/d_a_obj_monument.cpp index 421de9d07..771fc2811 100644 --- a/src/d/actor/d_a_obj_monument.cpp +++ b/src/d/actor/d_a_obj_monument.cpp @@ -80,7 +80,7 @@ cPhs_State daObjMonument::Act_c::_create() { bool daObjMonument::Act_c::_delete() { if (mpBgW != NULL && mpBgW->ChkUsed()) dComIfG_Bgsp()->Release(mpBgW); - dComIfG_resDelete(&mPhs, M_arcname); + dComIfG_resDeleteDemo(&mPhs, M_arcname); return true; } diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index 1d90c95ac..dd7157f0f 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -145,7 +145,7 @@ void Bgc_c::wrt_pos(const cXyz& pos) { f32 roofY = pos.y + 400.0f; groundPos.y -= 100.0f; M_wrt_work.Set(groundPos, roofY); - if (dComIfG_Bgsp()->SplGrpChk(&M_wrt_work)) { + if (dComIfG_Bgsp()->WaterChk(&M_wrt_work)) { mWaterY = M_wrt_work.GetHeight(); cLib_onBit(mStateFlags, BgcState_ABOVE_WATER_e); if (mWaterY > pos.y) { @@ -1399,12 +1399,16 @@ void Act_c::afl_sway() { m610 *= temp; } + f32 f1; + f32 f5; + f32 f0; + f32 f6; f32 temp2 = m614 - m60C; f32 temp1 = m618 - m610; - f32 f1 = -temp2 * attr()->m50; - f32 f5 = -temp1 * attr()->m50; - f32 f0 = -m61C * attr()->m54; - f32 f6 = -m620 * attr()->m54; + f1 = -temp2 * attr()->m50; + f5 = -temp1 * attr()->m50; + f0 = -m61C * attr()->m54; + f6 = -m620 * attr()->m54; m61C += f1 + f0; m620 += f5 + f6; m614 += m61C; @@ -1580,7 +1584,7 @@ void Act_c::mode_wait() { if (r31 != -1) { m634 = r31; eff_smoke_slip_start(); - daPy_getPlayerActorClass()->onPushPullKeep(); + ((daPy_py_c*)dComIfGp_getPlayer(0))->onPushPullKeep(); mode_walk_init(); if (cLib_checkBit(mPPLabel, dBgW::PPLABEL_PULL)) { @@ -1650,7 +1654,7 @@ void Act_c::mode_walk() { } else if (m634 == 3) { m628--; } - daPy_getPlayerActorClass()->offPushPullKeep(); + ((daPy_py_c*)dComIfGp_getPlayer(0))->offPushPullKeep(); mode_wait_init(); } } @@ -1864,9 +1868,8 @@ BOOL Act_c::Draw() { int temp = mBgc.mMaxGroundIdx; f32 groundH = mBgc.mGroundY[temp]; cM3dGPla* triPla = dComIfG_Bgsp()->GetTriPla(mBgc.M_gnd_work[temp]); - cXyz* norm = triPla->GetNP(); - if (norm && groundH != -G_CM3D_F_INF) { - dComIfGd_setSimpleShadow(¤t.pos, groundH, attr()->m10, norm, shape_angle.y, 1.0f, NULL); + if (triPla && groundH != -G_CM3D_F_INF) { + dComIfGd_setSimpleShadow(¤t.pos, groundH, attr()->m10, &triPla->mNormal, shape_angle.y, 1.0f, NULL); } } diff --git a/src/d/actor/d_a_obj_pbco.cpp b/src/d/actor/d_a_obj_pbco.cpp index 34d08dacb..5f3669971 100644 --- a/src/d/actor/d_a_obj_pbco.cpp +++ b/src/d/actor/d_a_obj_pbco.cpp @@ -63,9 +63,10 @@ cPhs_State daObj_Pbco_c::CreateInit() { } cPhs_State daObj_Pbco_c::_create() { - fopAcM_ct(this, daObj_Pbco_c); + fopAcM_ct_Retail(this, daObj_Pbco_c); cPhs_State phase_state = dComIfG_resLoad(&mPhs, M_arcname); if (phase_state == cPhs_COMPLEATE_e) { + fopAcM_ct_Demo(this, daObj_Pbco_c); if (fopAcM_entrySolidHeap(this, CheckCreateHeap, 0x10000)) { phase_state = CreateInit(); } else { diff --git a/src/d/actor/d_a_obj_quake.cpp b/src/d/actor/d_a_obj_quake.cpp index 2b921cd07..08c16e170 100644 --- a/src/d/actor/d_a_obj_quake.cpp +++ b/src/d/actor/d_a_obj_quake.cpp @@ -26,13 +26,15 @@ daObjQuake_HIO_c::daObjQuake_HIO_c() { /* 00000134-000002C4 .text _create__12daObjQuake_cFv */ cPhs_State daObjQuake_c::_create() { - fopAcM_ct(this, daObjQuake_c); + fopAcM_ct_Retail(this, daObjQuake_c); if (dComIfGs_isSymbol(dSymbol_DIN_e)) { return cPhs_STOP_e; } if (getPrmType() < 3) { + fopAcM_ct_Demo(this, daObjQuake_c); + fopAcM_offDraw(this); mType = getPrmType(); m2A1 = false; @@ -135,8 +137,8 @@ BOOL daObjQuake_c::_execute() { u8 sch = getPrmSch(); bool var_r27 = false; if (sch & dKy_get_schbit() && !dComIfGp_event_chkEventFlag(dEvtFlag_TALK_e)) { - f32 a = (m29C / 6.0f) * m290; f32 b = (m298 / 6.0f) * m290; + f32 a = (m29C / 6.0f) * m290; if (m294 >= b && m294 < a) { var_r27 = true; } diff --git a/src/d/actor/d_a_obj_toripost.cpp b/src/d/actor/d_a_obj_toripost.cpp index e4e121ca2..9cadf6d4e 100644 --- a/src/d/actor/d_a_obj_toripost.cpp +++ b/src/d/actor/d_a_obj_toripost.cpp @@ -59,7 +59,11 @@ const dCcD_SrcCyl daObjTpost_c::m_cyl_src = { /* SrcObjAt Type */ 0, /* SrcObjAt Atp */ 0, /* SrcObjAt SPrm */ 0, +#if VERSION == VERSION_DEMO + /* SrcObjTg Type */ ~(AT_TYPE_WATER | AT_TYPE_UNK20000 | AT_TYPE_WIND | AT_TYPE_UNK400000 | AT_TYPE_LIGHT), +#else /* SrcObjTg Type */ ~(AT_TYPE_BOOMERANG), +#endif /* SrcObjTg SPrm */ cCcD_TgSPrm_Set_e | cCcD_TgSPrm_GrpAll_e, /* SrcObjCo SPrm */ cCcD_CoSPrm_Set_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_VsGrpAll_e, /* SrcGObjAt Se */ 0, @@ -85,7 +89,7 @@ const dCcD_SrcCyl daObjTpost_c::m_cyl_src = { #ifdef __MWERKS__ static #endif -const s32 daObjTpost_c::m_send_price[] = { +const int daObjTpost_c::m_send_price[] = { 0x05, 0x0A, 0x14 @@ -101,7 +105,7 @@ static BOOL createHeap_CB(fopAc_ac_c* i_this) { /* 0000010C-0000022C .text _createHeap__12daObjTpost_cFv */ BOOL daObjTpost_c::_createHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(m_arc_name, dRes_INDEX_TORIPOST_BDL_VPOST_e); - JUT_ASSERT(132, modelData != NULL); + JUT_ASSERT(DEMO_SELECT(131, 132), modelData != NULL); mMorf = new mDoExt_McaMorf( modelData, @@ -246,7 +250,8 @@ void daObjTpost_c::deliverLetter() { /* 00000650-000006C0 .text getReceiveLetterNum__12daObjTpost_cFv */ s16 daObjTpost_c::getReceiveLetterNum() { s16 num = 0; - for(int i = 1; i < (int)ARRAY_SIZE(m_letter); i++) { + int letter_count = ARRAY_SIZE(m_letter); + for(int i = 1; i < letter_count; i++) { if(dLetter_isStock(m_letter[i].mEventReg)) { num = num + 1; } @@ -257,12 +262,13 @@ s16 daObjTpost_c::getReceiveLetterNum() { /* 000006C0-00000750 .text getReadableLetterNum__12daObjTpost_cFv */ s32 daObjTpost_c::getReadableLetterNum() { - s32 num = 0; - s32 startIdx = mNumReadable != 0 ? mNumReadable : 1; - s32 readable = mNumReadable; + int num = 0; + int letter_count = ARRAY_SIZE(m_letter); + int startIdx = mNumReadable != 0 ? mNumReadable : 1; + int readable = mNumReadable; - if(readable < (int)ARRAY_SIZE(m_letter)) { - for(int i = startIdx; i < (int)ARRAY_SIZE(m_letter); i++) { + if(readable < letter_count) { + for(int i = startIdx; i < letter_count; i++) { if(!dLetter_isStock(m_letter[i].mEventReg)) { continue; } @@ -339,7 +345,7 @@ u8 daObjTpost_c::checkSendPrice() { /* 000007B8-0000092C .text getMsgXY__12daObjTpost_cFv */ int daObjTpost_c::getMsgXY() { - s32 msgId; + u32 msgNo; GXColor col = {0x00, 0x00, 0x00, 0x80}; cXyz pos(REG12_F(0), REG12_F(1), REG12_F(2)); cXyz scale(2.0f, 2.0f, 2.0f); @@ -347,7 +353,7 @@ int daObjTpost_c::getMsgXY() { switch(mPreItemNo) { case dItemNo_NOTE_TO_MOM_e: case dItemNo_MAGGIES_LETTER_e: - msgId = 0xCE8; + msgNo = 0xCE8; col.r = REG12_S(0) + 0x80; col.g = REG12_S(1) + 0x80; col.b = REG12_S(2) + 0x80; @@ -360,38 +366,38 @@ int daObjTpost_c::getMsgXY() { case dItemNo_MOBLINS_LETTER_e: setAnm(AnmPrm_POST_PUTOUT, false); field_0x8EA = 1; - msgId = 0xCEA; + msgNo = 0xCEA; break; default: setAnm(AnmPrm_POST_PUTOUT, false); field_0x8EA = 1; - msgId = 0xCE9; + msgNo = 0xCE9; break; } - return msgId; + return msgNo; } /* 0000092C-00000990 .text getMsgNormal__12daObjTpost_cFv */ int daObjTpost_c::getMsgNormal() { - s32 msgId; + u32 msgNo; if(field_0x8EB) { dComIfGp_setMessageCountNumber(field_0x8F0); - msgId = 0xCF7; + msgNo = 0xCF7; field_0x8EB = 0; } else { if(dKy_daynight_check() == dKy_TIME_DAY_e) { - msgId = 0xCE5; + msgNo = 0xCE5; } else { - msgId = 0xCE6; + msgNo = 0xCE6; } } - return msgId; + return msgNo; } /* 00000990-000009EC .text getMsg__12daObjTpost_cFv */ @@ -858,12 +864,16 @@ void daObjTpost_c::modeProc(daObjTpost_c::Proc_e proc, int newMode) { /* 00001758-000018CC .text _execute__12daObjTpost_cFv */ bool daObjTpost_c::_execute() { +#if VERSION == VERSION_DEMO + mNumReadable = getReadableLetterNum(); +#else if(dComIfGs_isSymbol(dSymbol_DIN_e)) { mNumReadable = getReadableLetterNum(); } else { mNumReadable = 0; } +#endif checkOrder(); setAttention(); @@ -879,7 +889,7 @@ bool daObjTpost_c::_execute() { mAcch.CrrPos(*dComIfG_Bgsp()); mStts.Move(); if(mCyl.ChkTgHit()) { - daObj::HitSeStart(&eyePos, current.roomNo, &mCyl, 0x0B); + daObj::HitSeStart(&eyePos, fopAcM_GetRoomNo(this), &mCyl, 0x0B); } daObj::HitEff_kikuzu(this, &mCyl); fopAcM_rollPlayerCrash(this, 40.0f, 7); @@ -926,7 +936,7 @@ void daObjTpost_c::createInit() { dLetter_autoStock(dSv_event_flag_c::LETTER_BAITO); } - if(dComIfGs_isEventBit(dSv_event_flag_c::UNK_1E80)) { + if(dComIfGs_isEventBit(DEMO_SELECT(dSv_event_flag_c::UNK_2D04, dSv_event_flag_c::UNK_1E80))) { dLetter_autoStock(dSv_event_flag_c::LETTER_ORCA); } @@ -972,11 +982,13 @@ void daObjTpost_c::getArg() { /* 00001BA8-00001D88 .text _create__12daObjTpost_cFv */ cPhs_State daObjTpost_c::_create() { - fopAcM_ct(this, daObjTpost_c); + fopAcM_ct_Retail(this, daObjTpost_c); getArg(); cPhs_State step = dComIfG_resLoad(&mPhs, m_arc_name); if(step == cPhs_COMPLEATE_e) { + fopAcM_ct_Demo(this, daObjTpost_c); + if(fopAcM_entrySolidHeap(this, createHeap_CB, 0x7E0) == 0) { return cPhs_ERROR_e; } @@ -989,7 +1001,7 @@ cPhs_State daObjTpost_c::_create() { /* 00002094-000020C4 .text _delete__12daObjTpost_cFv */ bool daObjTpost_c::_delete() { - dComIfG_resDelete(&mPhs, m_arc_name); + dComIfG_resDeleteDemo(&mPhs, m_arc_name); return true; } diff --git a/src/d/actor/d_a_player_dproc.inc b/src/d/actor/d_a_player_dproc.inc index dfee70b36..8f374ce15 100644 --- a/src/d/actor/d_a_player_dproc.inc +++ b/src/d/actor/d_a_player_dproc.inc @@ -1714,12 +1714,6 @@ BOOL daPy_lk_c::dProcWindChange() { /* 80130F98-8013116C .text dProcStandItemPut_init__9daPy_lk_cFv */ BOOL daPy_lk_c::dProcStandItemPut_init() { - daPy_py_c* pdVar1; - fopAc_ac_c* pfVar2; - f32 dVar5; - double in_f4; - csXyz* angle; - if (mCurProc == daPyProc_DEMO_STAND_ITEM_PUT_e) { return true; } @@ -1727,27 +1721,24 @@ BOOL daPy_lk_c::dProcStandItemPut_init() { mNormalSpeed = 0.0f; keepItemData(); mProcVar6.m3570 = 0; - pdVar1 = (daPy_py_c*)fopAcM_getEventPartner(this); - if (pdVar1 != NULL) { - cXyz local_20 = pdVar1->current.pos - current.pos; + fopAc_ac_c* event_partner = fopAcM_getEventPartner(this); + csXyz* angle; + if (event_partner != NULL) { + cXyz local_20 = event_partner->current.pos - current.pos; angle = fopAcM_GetShapeAngle_p(this); - angle->y = fopAcM_searchActorAngleY(this, pdVar1); - dVar5 = local_20.absXZ(); - if (0.0f < dVar5) { - in_f4 = 0.5; - } - m35C8 = dVar5 - 47.0f; - angle = fopAcM_GetShapeAngle_p(pdVar1); + angle->y = fopAcM_searchActorAngleY(this, event_partner); + m35C8 = local_20.absXZ() - 47.0f; + angle = fopAcM_GetShapeAngle_p(event_partner); } else { m35C8 = 15.0f; angle = fopAcM_GetShapeAngle_p(this); } mProcVar6.m3570 = 1; setSingleMoveAnime(ANM_GRABWAIT, m_HIO->mGrab.m.field_0x78, 0.0f, -1, -1.0f); - pfVar2 = (fopAc_ac_c*)fopAcM_fastCreate(fpcNm_STANDITEM_e, dComIfGp_event_getPreItemNo(), ¤t.pos, -1, angle); - if (pfVar2 != NULL) { - mActorKeepGrab.setData(pfVar2); - fopAcM_setCarryNow(pfVar2, FALSE); + fopAc_ac_c* stand_item = (fopAc_ac_c*)fopAcM_fastCreate(fpcNm_STANDITEM_e, dComIfGp_event_getPreItemNo(), ¤t.pos, -1, angle); + if (stand_item != NULL) { + mActorKeepGrab.setData(stand_item); + fopAcM_setCarryNow(stand_item, FALSE); } return true; } diff --git a/src/d/actor/d_a_race_item.cpp b/src/d/actor/d_a_race_item.cpp index cb26fdc57..a80d5cca0 100644 --- a/src/d/actor/d_a_race_item.cpp +++ b/src/d/actor/d_a_race_item.cpp @@ -127,6 +127,8 @@ static BOOL daRaceItem_Execute(daRaceItem_c* i_this) { /* 0000073C-00000C44 .text execute__12daRaceItem_cFv */ BOOL daRaceItem_c::execute() { + daPy_getPlayerActorClass(); + m_timer++; animPlay(1.0f, 1.0f, 1.0f, 1.0f, 1.0f); eyePos = current.pos; diff --git a/src/d/actor/d_a_rd.cpp b/src/d/actor/d_a_rd.cpp index 64981fb44..10a39e54f 100644 --- a/src/d/actor/d_a_rd.cpp +++ b/src/d/actor/d_a_rd.cpp @@ -426,7 +426,7 @@ bool daRd_c::createArrowHeap() { }; mpJntHit = JntHit_create(mpMorf->getModel(), search_data, ARRAY_SIZE(search_data)); if (mpJntHit) { - jntHit = mpJntHit; + fopAcM_SetJntHit(this, mpJntHit); } else { return false; } @@ -669,7 +669,7 @@ bool daRd_c::checkTgHit() { cXyz* hitPos = mCyl.GetTgHitPosP(); cc_at_check(this, &atInfo); if (mHitType == 1 || mHitType == 7 || mHitType == 8 || health <= 0) { - dComIfGp_particle_set(dPa_name::ID_AK_JN_CRITICALHITFLASH, mCyl.GetTgHitPosP()); + dComIfGp_particle_set(dPa_name::ID_AK_JN_CRITICALHITFLASH, hitPos); cXyz scale(2.0f, 2.0f, 2.0f); dComIfGp_particle_set(dPa_name::ID_AK_JN_CRITICALHIT, hitPos, &player->shape_angle, &scale); if (health <= 0) { @@ -1634,7 +1634,7 @@ bool daRd_c::_execute() { if (mMode != MODE_SILENT_PRAY && mMode != MODE_DEATH && mMode != MODE_DAMAGE && mMode != MODE_ATTACK && mMode != MODE_CRY && mMode != MODE_CRY_WAIT) { - daRd_c* corpse = (daRd_c*)fopAcIt_Judge(&searchNeadDeadRd_CB, this); + daRd_c* corpse = (daRd_c*)fopAcM_Search(&searchNeadDeadRd_CB, this); if (corpse != NULL) { mCorpseID = fopAcM_GetID(corpse); modeProcInit(MODE_SILENT_PRAY); @@ -1690,7 +1690,7 @@ bool daRd_c::_execute() { lookBack(); } - if (mbIkari) { + if (isIkari()) { cLib_addCalc2(&mD38, l_HIO.m60, 0.1f, l_HIO.m64); } else { cLib_addCalc2(&mD38, 0.0f, 0.1f, l_HIO.m64); @@ -1888,13 +1888,13 @@ void daRd_c::createInit() { /* 000046A4-00004720 .text getArg__6daRd_cFv */ void daRd_c::getArg() { - u32 params = fopAcM_GetParam(this); - mWhichIdleAnm = fopAcM_GetParamBit(params, 0x00, 1); - u8 radiusParam = fopAcM_GetParamBit(params, 0x01, 7); - s32 areaRadius = radiusParam; - mChecksSwitch = fopAcM_GetParamBit(params, 0x08, 8); - mSwNo = fopAcM_GetParamBit(params, 0x18, 8); - if ((s32)radiusParam == 0x7F) { + u32 param = fopAcM_GetParam(this); + mWhichIdleAnm = fopAcM_GetParamBit(param, 0x00, 1); + u8 radiusParam = fopAcM_GetParamBit(param, 0x01, 7); + int areaRadius = radiusParam; + mChecksSwitch = fopAcM_GetParamBit(param, 0x08, 8); + mSwNo = fopAcM_GetParamBit(param, 0x18, 8); + if (areaRadius == 0x7F) { areaRadius = 0; } mAreaRadius = l_HIO.m30 + areaRadius; diff --git a/src/d/actor/d_a_swhit0.cpp b/src/d/actor/d_a_swhit0.cpp index 4be0d6c17..bd1023941 100644 --- a/src/d/actor/d_a_swhit0.cpp +++ b/src/d/actor/d_a_swhit0.cpp @@ -163,7 +163,7 @@ BOOL daSwhit0_c::CreateInit() { mColSph.SetStts(&mColStatus); mColSph.SetC(attention_info.position); - if (dComIfGs_isSwitch(getSwNo(), current.roomNo)) { + if (dComIfGs_isSwitch(getSwNo(), fopAcM_GetRoomNo(this))) { mState = 4; onFlag(0x01); } @@ -326,7 +326,7 @@ s32 daSwhit0_c::actionOnWait() { } if (getType() == 0x02) { - if (!dComIfGs_isSwitch(getSwNo(), current.roomNo)) { + if (!dComIfGs_isSwitch(getSwNo(), fopAcM_GetRoomNo(this))) { offFlag(0x01); mState = 0; @@ -349,7 +349,7 @@ s32 daSwhit0_c::actionOnTimer() { fopAcM_seStart(this, JA_SE_OBJ_COL_SWC_NSTONE, 0); } - if (dComIfGs_isSwitch(getSwNo2(), current.roomNo)) { + if (dComIfGs_isSwitch(getSwNo2(), fopAcM_GetRoomNo(this))) { mState = 4; } else if (mOnTimer > 0) { @@ -359,7 +359,7 @@ s32 daSwhit0_c::actionOnTimer() { offFlag(0x01); mState = 0; - dComIfGs_offSwitch(getSwNo(), current.roomNo); + dComIfGs_offSwitch(getSwNo(), fopAcM_GetRoomNo(this)); } return TRUE; diff --git a/src/d/actor/d_a_tag_volcano.cpp b/src/d/actor/d_a_tag_volcano.cpp index 6d0632383..54c175b15 100644 --- a/src/d/actor/d_a_tag_volcano.cpp +++ b/src/d/actor/d_a_tag_volcano.cpp @@ -70,8 +70,8 @@ bool daTagvolcano::Act_c::check_timer_clear() { /* 00000338-000003BC .text _delete__Q212daTagvolcano5Act_cFv */ bool daTagvolcano::Act_c::_delete() { - if (check_timer_clear() && dComIfG_getTimerMode() == 3) - dComIfG_TimerDeleteRequest(); + if (check_timer_clear()) + dComIfG_TimerDeleteRequest(3); fopAcM_offSwitch(this, prm_get_swSave()); return true; } @@ -103,8 +103,7 @@ bool daTagvolcano::Act_c::_execute() { mDoAud_seStart(JA_SE_ISLE_TIMER_0); dComIfGp_getVibration().StartShock(6, -33, cXyz(0.0f, 1.0f, 0.0f)); fopAcM_offSwitch(this, prm_get_swSave()); - if (dComIfG_getTimerMode() == 3) - dComIfG_TimerDeleteRequest(); + dComIfG_TimerDeleteRequest(3); field_0x298 = 0; field_0x299 = 0; @@ -129,8 +128,8 @@ bool daTagvolcano::Act_c::_execute() { } } else { if (dComIfGs_isTbox(prm_get_bitTRB())) { - if (dComIfG_getTimerPtr() != NULL && dComIfG_getTimerMode() == 3) - dComIfG_TimerDeleteRequest(); + if (dComIfG_getTimerPtr() != NULL) + dComIfG_TimerDeleteRequest(3); if (mType == 1) dComIfGs_onEventBit(dSv_event_flag_c::UNK_1902); else @@ -148,8 +147,7 @@ bool daTagvolcano::Act_c::_execute() { if (dComIfG_getTimerRestTimeMs() <= 0) { mDoAud_seStart(JA_SE_ISLE_TIMER_0); dComIfGp_getVibration().StartShock(6, -33, cXyz(0.0f, 1.0f, 0.0f)); - if (dComIfG_getTimerMode() == 3) - dComIfG_TimerDeleteRequest(); + dComIfG_TimerDeleteRequest(3); field_0x2a4 = 1; fopAcM_orderOtherEvent(this, "TAG_VOLCANO"); diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index 718d18ddd..c81c4818c 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -3074,7 +3074,7 @@ void dFile_select_c::setSaveData() { ((J2DTextBox*)pane[i]->pane)->setFontSize(field_0x38e0); - J2DTextBox::TFontSize size; + J2DTextBox::TFontSize fontSize; fopMsgM_paneTrans(pane[i], 0.0f, 0.0f); if(mDoMemCdRWm_TestCheckSumGameData(data)) { @@ -3092,14 +3092,14 @@ void dFile_select_c::setSaveData() { if(data[0x157] == 0) { fopMsgM_paneScaleXY(pane[i], g_fsHIO.field_0x54); - size.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; - size.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; + fontSize.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; + fontSize.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; #if VERSION > VERSION_JPN strcpy(field_0x38f4[i], "New Game"); #endif - ((J2DTextBox*)pane[i]->pane)->setFontSize(size); + ((J2DTextBox*)pane[i]->pane)->setFontSize(fontSize); fopMsgM_paneTrans(pane[i], pane[i]->mPosTopLeftOrig.x - pane[i]->mPosTopLeft.x, pane[i]->mPosTopLeftOrig.y - pane[i]->mPosTopLeft.y + g_fsHIO.field_0x58); @@ -3137,18 +3137,18 @@ void dFile_select_c::setSaveData() { fopMsgM_paneScaleXY(pane[i], g_fsHIO.field_0x54); #if VERSION <= VERSION_JPN - size.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; - size.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; + fontSize.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; + fontSize.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; #else - size.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; - size.mSizeX = field_0x38e0.mSizeX * 0.9f; + fontSize.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; + fontSize.mSizeX = field_0x38e0.mSizeX * 0.9f; #endif #if VERSION > VERSION_JPN strcpy(field_0x38f4[i], "This data is corrupted."); #endif - ((J2DTextBox*)pane[i]->pane)->setFontSize(size); + ((J2DTextBox*)pane[i]->pane)->setFontSize(fontSize); fopMsgM_paneTrans(pane[i], pane[i]->mPosTopLeftOrig.x - pane[i]->mPosTopLeft.x, pane[i]->mPosTopLeftOrig.y - pane[i]->mPosTopLeft.y + g_fsHIO.field_0x58); #if VERSION <= VERSION_JPN @@ -3187,7 +3187,7 @@ void dFile_select_c::setSaveData() { ((J2DTextBox*)pane->pane)->setFontSize(field_0x38e0); - J2DTextBox::TFontSize size; + J2DTextBox::TFontSize fontSize; fopMsgM_paneTrans(pane, 0.0f, 0.0f); if(mDoMemCdRWm_TestCheckSumGameData(data)) { @@ -3205,14 +3205,14 @@ void dFile_select_c::setSaveData() { if(data[0x157] == 0) { fopMsgM_paneScaleXY(pane, g_fsHIO.field_0x54); - size.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; - size.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; + fontSize.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; + fontSize.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; #if VERSION > VERSION_JPN strcpy(field_0x38f4[i], "New Game"); #endif - ((J2DTextBox*)pane->pane)->setFontSize(size); + ((J2DTextBox*)pane->pane)->setFontSize(fontSize); fopMsgM_paneTrans(pane, pane->mPosTopLeftOrig.x - pane->mPosTopLeft.x, pane->mPosTopLeftOrig.y - pane->mPosTopLeft.y + g_fsHIO.field_0x58); @@ -3250,18 +3250,18 @@ void dFile_select_c::setSaveData() { fopMsgM_paneScaleXY(pane, g_fsHIO.field_0x54); #if VERSION <= VERSION_JPN - size.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; - size.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; + fontSize.mSizeX = field_0x38e0.mSizeX * g_fsHIO.field_0x54; + fontSize.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; #else - size.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; - size.mSizeX = field_0x38e0.mSizeX * 0.9f; + fontSize.mSizeY = field_0x38e0.mSizeY * g_fsHIO.field_0x54; + fontSize.mSizeX = field_0x38e0.mSizeX * 0.9f; #endif #if VERSION > VERSION_JPN strcpy(field_0x38f4[i], "This data is corrupted."); #endif - ((J2DTextBox*)pane->pane)->setFontSize(size); + ((J2DTextBox*)pane->pane)->setFontSize(fontSize); fopMsgM_paneTrans(pane, pane->mPosTopLeftOrig.x - pane->mPosTopLeft.x, pane->mPosTopLeftOrig.y - pane->mPosTopLeft.y + g_fsHIO.field_0x58); #if VERSION <= VERSION_JPN diff --git a/src/d/d_gameover.cpp b/src/d/d_gameover.cpp index fa1e718c9..9ac832a28 100644 --- a/src/d/d_gameover.cpp +++ b/src/d/d_gameover.cpp @@ -83,8 +83,13 @@ cPhs_State dGameover_c::_create() { dMs_c = new dMenu_save_c(); JUT_ASSERT(VERSION_SELECT(0xa7, 0xa7, 0xb6, 0xb6), dMs_c != NULL); +#if VERSION == VERSION_DEMO + dMs_c->_create(); + dMs_c->setUseType(2); +#else dMs_c->setUseType(2); dMs_c->_create(); +#endif dgo_capture_c = new dDlst_Gameover_CAPTURE_c(); JUT_ASSERT(VERSION_SELECT(0xac, 0xac, 0xbb, 0xbb), dgo_capture_c != NULL); @@ -105,10 +110,16 @@ BOOL dGameover_c::_execute() { JKRHeap* oldHeap = mDoExt_setCurrentHeap(mpHeap); if (mState == 3) { +#if VERSION == VERSION_DEMO + dComIfGp_setGameoverStatus(3); + dMenu_flagSet(0); + mDoRst::onReset(); +#else if (dMs_c->_open()) { mState = 4; dComIfGs_setLife(12); } +#endif } else if (mState == 4) { dMs_c->_move(); if (dMs_c->getSaveStatus() == 3) @@ -381,9 +392,8 @@ BOOL dDlst_GameOverScrnDraw_c::anime2(int idx) { letter[idx].mUserArea += 1; - f32 y = letter[idx].mUserArea / 7.0f; f32 y2 = (f32)letter[idx].mUserArea * (f32)letter[idx].mUserArea / 49.0f; - setRotate(&letter[idx], (f32)mRotate[idx] * (1.0f - y)); + setRotate(&letter[idx], (f32)mRotate[idx] * (1.0f - (letter[idx].mUserArea / 7.0f))); fopMsgM_paneTrans(&letter[idx], 0.0f, y2 * 244.0f); } diff --git a/src/d/d_kyeff.cpp b/src/d/d_kyeff.cpp index 7a91af731..49d1c4010 100644 --- a/src/d/d_kyeff.cpp +++ b/src/d/d_kyeff.cpp @@ -27,7 +27,8 @@ static f32 get_parcent(f32 param_0, f32 param_1, f32 param_2) { f32 temp_f4 = param_0 - param_1; if (0.0f != temp_f4) { - temp_f1 = 1.0f - (param_0 - param_2) / temp_f4; + f32 temp = param_0 - param_2; + temp_f1 = 1.0f - temp / temp_f4; if (!(temp_f1 >= 1.0f)) { return temp_f1; } @@ -58,9 +59,10 @@ void menu_vrbox_set() { pCamera->mLookat.mCenter.z = 1000.0f; g_env_light.mWind.mWindPower = 0.7f; - curTime = g_env_light.mCurTime; - g_env_light.mCurTime += 0.03f; + f32 temp = 0.03f; + curTime = g_env_light.mCurTime; + g_env_light.mCurTime += temp; if ((u32)g_env_light.mCurTime >= 360.0f) g_env_light.mCurTime = 0.0f; @@ -149,11 +151,21 @@ static cPhs_State dKyeff_Create(kankyo_class* i_ky) { dKyw_rain_set(250); g_env_light.mThunderEff.mMode = 1; } else if (stType == dStageType_MISC_e) { - if (strcmp(dComIfGp_getStartStageName(), "Ocrogh") == 0 || strcmp(dComIfGp_getStartStageName(), "Omori") == 0 || - strcmp(dComIfGp_getStartStageName(), "Orichh") == 0 || strcmp(dComIfGp_getStartStageName(), "Atorizk") == 0 || - strcmp(dComIfGp_getStartStageName(), "LinkRM") == 0 || strcmp(dComIfGp_getStartStageName(), "Ojhous2") == 0 || - strcmp(dComIfGp_getStartStageName(), "Onobuta") == 0 || strcmp(dComIfGp_getStartStageName(), "Omasao") == 0 || - strcmp(dComIfGp_getStartStageName(), "Obombh") == 0 || strcmp(dComIfGp_getStartStageName(), "Opub") == 0) { + if ( + strcmp(dComIfGp_getStartStageName(), "Ocrogh") == 0 || + strcmp(dComIfGp_getStartStageName(), "Omori") == 0 || + strcmp(dComIfGp_getStartStageName(), "Orichh") == 0 || + strcmp(dComIfGp_getStartStageName(), "Atorizk") == 0 || +#if VERSION == VERSION_DEMO + strcmp(dComIfGp_getStartStageName(), "Atorizk") == 0 || // duplicate check +#endif + strcmp(dComIfGp_getStartStageName(), "LinkRM") == 0 || + strcmp(dComIfGp_getStartStageName(), "Ojhous2") == 0 || + strcmp(dComIfGp_getStartStageName(), "Onobuta") == 0 || + strcmp(dComIfGp_getStartStageName(), "Omasao") == 0 || + strcmp(dComIfGp_getStartStageName(), "Obombh") == 0 || + strcmp(dComIfGp_getStartStageName(), "Opub") == 0 + ) { dKyw_rain_set(250); g_env_light.mThunderEff.mMode = 10; } diff --git a/src/d/d_mesg.cpp b/src/d/d_mesg.cpp index 3024323ee..da123df86 100644 --- a/src/d/d_mesg.cpp +++ b/src/d/d_mesg.cpp @@ -1152,11 +1152,11 @@ void dMesg_screenData_c::setCommonData() { ((J2DTextBox*)field_0x88[2].pane)->setFont(field_0x10); ((J2DTextBox*)field_0x88[3].pane)->setFont(field_0x14); - J2DTextBox::TFontSize size; - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)field_0x88[0].pane)->setFontSize(size); - ((J2DTextBox*)field_0x88[2].pane)->setFontSize(size); + J2DTextBox::TFontSize fontSize; + fontSize.mSizeX = g_msgHIO.field_0x70; + fontSize.mSizeY = g_msgHIO.field_0x70; + ((J2DTextBox*)field_0x88[0].pane)->setFontSize(fontSize); + ((J2DTextBox*)field_0x88[2].pane)->setFontSize(fontSize); ((J2DTextBox*)field_0x88[0].pane)->setCharSpace(g_msgHIO.field_0x5a); ((J2DTextBox*)field_0x88[1].pane)->setCharSpace(g_msgHIO.field_0x5c); diff --git a/src/d/d_message.cpp b/src/d/d_message.cpp index 7e4d0aaa2..292cf9ea7 100644 --- a/src/d/d_message.cpp +++ b/src/d/d_message.cpp @@ -215,7 +215,7 @@ void dMsg2_screenDataSet(sub_msg2_class* i_Msg, u8 i_index) { } /* 801E7AB8-801E8154 .text dMsg2_screenDataInit__FP14sub_msg2_classUc */ -// NONMATCHING - some reg alloc +// NONMATCHING - USA/PAL-only regalloc and load issues void dMsg2_screenDataInit(sub_msg2_class* i_Msg, u8 i_index) { fopMsgM_setPaneData(&i_Msg->text_pane[i_index], sScreen2[i_index]->search('tx23')); fopMsgM_setPaneData(&i_Msg->ruby_pane[i_index], sScreen2[i_index]->search('tx29')); @@ -272,33 +272,33 @@ void dMsg2_screenDataInit(sub_msg2_class* i_Msg, u8 i_index) { ((J2DTextBox*)i_Msg->rubySdw_pane[i_index].pane)->setFont(i_Msg->rx); f32 var_f31; - J2DTextBox::TFontSize size; + J2DTextBox::TFontSize fontSize; + J2DTextBox::TFontSize rubySize; #if VERSION <= VERSION_JPN if (!g_msgDHIO.field_0x08) { - size.mSizeX = (int)g_messageHIO.field_0x32; - size.mSizeY = (int)g_messageHIO.field_0x32; + fontSize.mSizeX = (int)g_messageHIO.field_0x32; + fontSize.mSizeY = (int)g_messageHIO.field_0x32; - J2DTextBox::TFontSize size2; - size2.mSizeX = g_msgHIO.field_0x68; - size2.mSizeY = g_msgHIO.field_0x68; + rubySize.mSizeX = g_msgHIO.field_0x68; + rubySize.mSizeY = g_msgHIO.field_0x68; - ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->ruby_pane[i_index].pane)->setFontSize(size2); - ((J2DTextBox*)i_Msg->textSdw_pane[i_index].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->rubySdw_pane[i_index].pane)->setFontSize(size2); + ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->ruby_pane[i_index].pane)->setFontSize(rubySize); + ((J2DTextBox*)i_Msg->textSdw_pane[i_index].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->rubySdw_pane[i_index].pane)->setFontSize(rubySize); } else { - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; + fontSize.mSizeX = g_msgHIO.field_0x70; + fontSize.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->textSdw_pane[i_index].pane)->setFontSize(size); + ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->textSdw_pane[i_index].pane)->setFontSize(fontSize); } #else - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; + fontSize.mSizeX = g_msgHIO.field_0x70; + fontSize.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->textSdw_pane[i_index].pane)->setFontSize(size); + ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->textSdw_pane[i_index].pane)->setFontSize(fontSize); #endif ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->setCharSpace(0.0f); @@ -321,8 +321,8 @@ void dMsg2_screenDataInit(sub_msg2_class* i_Msg, u8 i_index) { ((J2DTextBox*)i_Msg->textSdw_pane[i_index].pane)->setLineSpace(g_msgHIO.field_0x5e); #endif - i_Msg->field_0xeb4 = size.mSizeX; - i_Msg->field_0xeb8 = var_f31; + i_Msg->field_0xeb4 = fontSize.mSizeX; + i_Msg->field_0xeb8 = rubySize.mSizeX; // !@bug uninitialized use } /* 801E8154-801E8260 .text dMsg2_ScreenDataValueInit__FP14sub_msg2_class */ @@ -373,9 +373,11 @@ void dMsg2_stickInfoCheck(sub_msg2_class* i_Msg) { /* 801E833C-801E84E8 .text dMsg2_multiTexDraw__FP14sub_msg2_classssss */ void dMsg2_multiTexDraw(sub_msg2_class* i_Msg, s16 param_1, s16 param_2, s16 param_3, s16 param_4) { + s16 r6 = param_1 + param_3; + s16 r7 = param_2 + param_4; f32 var_f31 = (i_Msg->field_0xeac * g_messageHIO.field_0x5b) / 255.0f; - board.setPos(param_1, param_2, param_1 + param_3, param_2 + param_4); + board.setPos(param_1, param_2, r6, r7); if (i_Msg->mesgEntry.mTextboxType == 7) { board.setBlackColor((GXColor){0xFF, 0xFF, 0xFF, 0xFF}); @@ -486,7 +488,6 @@ void dMsg2_arrowMove(sub_msg2_class* i_Msg) { } /* 801E8994-801E8A70 .text dMsg2_aimAlphaSqare__FP14sub_msg2_classii */ -// NONMATCHING - float reg alloc void dMsg2_aimAlphaSqare(sub_msg2_class* i_Msg, int param_0, int param_1) { if (param_1 < 0) { param_1 = 0; @@ -494,7 +495,9 @@ void dMsg2_aimAlphaSqare(sub_msg2_class* i_Msg, int param_0, int param_1) { param_1 = param_0; } - i_Msg->field_0xea8 = 255.0f - (255.0f - dMsg2_aimBrightness()) * (((f32)param_1 * (f32)param_1) / ((f32)param_0 * (f32)param_0)); + f32 f31 = (((f32)param_1 * (f32)param_1) / ((f32)param_0 * (f32)param_0)); + f32 f0 = (255.0f - dMsg2_aimBrightness()); + i_Msg->field_0xea8 = 255.0f - f0 * f31; } /* 801E8A70-801E8B90 .text dMsg2_aimAlphaSqrt__FP14sub_msg2_classii */ @@ -505,7 +508,9 @@ void dMsg2_aimAlphaSqrt(sub_msg2_class* i_Msg, int param_0, int param_1) { param_1 = param_0; } - i_Msg->field_0xea8 = 255.0f - (255.0f - dMsg2_aimBrightness()) * std::sqrtf((f32)param_1 / (f32)param_0); + f32 f31 = std::sqrtf((f32)param_1 / (f32)param_0); + f32 f0 = (255.0f - dMsg2_aimBrightness()); + i_Msg->field_0xea8 = 255.0f - f0 * f31; } /* 801E8B90-801E8C2C .text dMsg2_kankyoBrightness__Fv */ @@ -638,8 +643,10 @@ void dMsg2_messageShow(sub_msg2_class* i_Msg) { /* 801E9108-801E9254 .text dMsg2_messageDataInit__FP14sub_msg2_classi */ void dMsg2_messageDataInit(sub_msg2_class* i_Msg, int i_index) { - f32 char_space = ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->getCharSpace(); - f32 ruby_space = ((J2DTextBox*)i_Msg->ruby_pane[i_index].pane)->getCharSpace(); + int line_width = 503; + int center_line_width = 486; + int char_space = ((J2DTextBox*)i_Msg->text_pane[i_index].pane)->getCharSpace(); + int ruby_space = ((J2DTextBox*)i_Msg->ruby_pane[i_index].pane)->getCharSpace(); i_Msg->msgDataProc[i_index].dataInit(); i_Msg->msgDataProc[i_index].setBmgData(i_Msg->message); @@ -656,8 +663,8 @@ void dMsg2_messageDataInit(sub_msg2_class* i_Msg, int i_index) { i_Msg->msgDataProc[i_index].setMesgEntry(&i_Msg->mesgEntry); i_Msg->msgDataProc[i_index].setFontSize(i_Msg->field_0xeb4); i_Msg->msgDataProc[i_index].setRubyFontSize(i_Msg->field_0xeb8); - i_Msg->msgDataProc[i_index].setLineWidth(503); - i_Msg->msgDataProc[i_index].setCenterLineWidth(486); + i_Msg->msgDataProc[i_index].setLineWidth(line_width); + i_Msg->msgDataProc[i_index].setCenterLineWidth(center_line_width); i_Msg->msgDataProc[i_index].setSpaceFlagOff(); } @@ -1009,8 +1016,12 @@ void dDlst_2DCopy_c::draw() { /* 801EA0C8-801EA224 .text dMsg2_Draw__FP14sub_msg2_class */ static BOOL dMsg2_Draw(sub_msg2_class* i_Msg) { - int sp8 = (int)(i_Msg->field_0xda8[0].mPosTopLeftOrig.x + 288.0f) - 288; - int sp10 = (int)(i_Msg->field_0xda8[0].mPosTopLeftOrig.y + 120.0f) - 120; + int r0 = 576; + int r3 = 240; + int r4 = (int)(i_Msg->field_0xda8[0].mPosTopLeftOrig.x + 288.0f); + int r5 = (int)(i_Msg->field_0xda8[0].mPosTopLeftOrig.y + 120.0f); + int sp8 = r4 - (r0 / 2); + int sp10 = r5 - (r3 / 2); for (int i = 0; i < 3; i++) { i_Msg->text_pane[i].mNowAlpha = i_Msg->field_0xeac; diff --git a/src/d/d_msg.cpp b/src/d/d_msg.cpp index b0c15a7a5..38509d00b 100644 --- a/src/d/d_msg.cpp +++ b/src/d/d_msg.cpp @@ -260,18 +260,18 @@ void dMsg_screenDataSetTalk(sub_msg_class* i_Msg) { numberPane[i]->setFont(textFont); } textOffsetY = 2; - J2DTextBox::TFontSize size; - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m011C[0].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m011C[2].pane)->setFontSize(size); + J2DTextBox::TFontSize fontSize; + fontSize.mSizeX = g_msgHIO.field_0x70; + fontSize.mSizeY = g_msgHIO.field_0x70; + ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m011C[0].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m011C[2].pane)->setFontSize(fontSize); for (s32 i = 0; i < 3; i++) { - numberPane[i]->setFontSize(size); - numberPane[i]->resize(size.mSizeX, size.mSizeY); + numberPane[i]->setFontSize(fontSize); + numberPane[i]->resize(fontSize.mSizeX, fontSize.mSizeY); } - maskPane->resize(size.mSizeX, size.mSizeY); + maskPane->resize(fontSize.mSizeX, fontSize.mSizeY); ((J2DTextBox*)i_Msg->m0544[0].pane)->setCharSpace(g_msgHIO.field_0x5a); ((J2DTextBox*)i_Msg->m0544[1].pane)->setCharSpace(g_msgHIO.field_0x5c); ((J2DTextBox*)i_Msg->m0544[2].pane)->setCharSpace(g_msgHIO.field_0x5a); @@ -292,10 +292,10 @@ void dMsg_screenDataSetTalk(sub_msg_class* i_Msg) { } fopMsgM_blendInit(&i_Msg->m01FC, "cursor_00_02.bti"); fopMsgM_blendInit(&i_Msg->m0234, "cursor_00_02.bti"); - J2DTextBox::TFontSize size2; - ((J2DTextBox*)i_Msg->m0544[0].pane)->getFontSize(size); - i_Msg->m110C = (int)size.mSizeX; - i_Msg->m1110 = (int)size2.mSizeX; + J2DTextBox::TFontSize rubySize; + ((J2DTextBox*)i_Msg->m0544[0].pane)->getFontSize(fontSize); + i_Msg->m110C = (int)fontSize.mSizeX; + i_Msg->m1110 = (int)rubySize.mSizeX; // !@bug uninitialized use i_Msg->m10BC.set(((J2DPicture*)i_Msg->m050C.pane)->getBlack()); i_Msg->m10C4.set(((J2DPicture*)i_Msg->m050C.pane)->getWhite()); i_Msg->m026C[0].mUserArea = 0; @@ -442,21 +442,21 @@ void dMsg_screenDataSetItem(sub_msg_class* i_Msg) { numberPane[i]->setFont(textFont); } textOffsetY = 2; - J2DTextBox::TFontSize size; - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); + J2DTextBox::TFontSize fontSize; + fontSize.mSizeX = g_msgHIO.field_0x70; + fontSize.mSizeY = g_msgHIO.field_0x70; + ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(fontSize); for (s32 i = 0; i < 3; i++) { - numberPane[i]->setFontSize(size); - numberPane[i]->resize(size.mSizeX, size.mSizeY); + numberPane[i]->setFontSize(fontSize); + numberPane[i]->resize(fontSize.mSizeX, fontSize.mSizeY); } - maskPane->resize(size.mSizeX, size.mSizeY); - J2DTextBox::TFontSize size2; - size2.mSizeX = g_msgHIO.field_0x68; - size2.mSizeY = g_msgHIO.field_0x68; - ((J2DTextBox*)i_Msg->m0544[1].pane)->setFontSize(size2); - ((J2DTextBox*)i_Msg->m0544[3].pane)->setFontSize(size2); + maskPane->resize(fontSize.mSizeX, fontSize.mSizeY); + J2DTextBox::TFontSize rubySize; + rubySize.mSizeX = g_msgHIO.field_0x68; + rubySize.mSizeY = g_msgHIO.field_0x68; + ((J2DTextBox*)i_Msg->m0544[1].pane)->setFontSize(rubySize); + ((J2DTextBox*)i_Msg->m0544[3].pane)->setFontSize(rubySize); ((J2DTextBox*)i_Msg->m0544[0].pane)->setCharSpace(g_msgHIO.field_0x5a); ((J2DTextBox*)i_Msg->m0544[1].pane)->setCharSpace(g_msgHIO.field_0x5c); ((J2DTextBox*)i_Msg->m0544[2].pane)->setCharSpace(g_msgHIO.field_0x5a); @@ -469,9 +469,9 @@ void dMsg_screenDataSetItem(sub_msg_class* i_Msg) { for (s32 i = 0; i < 3; i++) { numberPane[i]->setLineSpace(g_msgHIO.field_0x5e); } - ((J2DTextBox*)i_Msg->m0544[0].pane)->getFontSize(size); - i_Msg->m110C = (int)size.mSizeX; - i_Msg->m1110 = (int)size2.mSizeX; + ((J2DTextBox*)i_Msg->m0544[0].pane)->getFontSize(fontSize); + i_Msg->m110C = (int)fontSize.mSizeX; + i_Msg->m1110 = (int)rubySize.mSizeX; i_Msg->m10BC.set(((J2DPicture*)i_Msg->m050C.pane)->getBlack()); i_Msg->m10C4.set(((J2DPicture*)i_Msg->m050C.pane)->getWhite()); i_Msg->m026C[0].mUserArea = 0; @@ -493,36 +493,36 @@ void dMsg_screenDataSetDemo(sub_msg_class* i_Msg) { numberPane[i]->setFont(textFont); } - J2DTextBox::TFontSize size; - J2DTextBox::TFontSize size2; + J2DTextBox::TFontSize fontSize; + J2DTextBox::TFontSize rubySize; #if VERSION <= VERSION_JPN if (g_msgDHIO.field_0x08 == 0) { - size.mSizeX = (int)g_msgHIO.field_0x58; - size.mSizeY = (int)g_msgHIO.field_0x58; - size2.mSizeX = g_msgHIO.field_0x68; - size2.mSizeY = g_msgHIO.field_0x68; - ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m0544[1].pane)->setFontSize(size2); - ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m0544[3].pane)->setFontSize(size2); + fontSize.mSizeX = (int)g_msgHIO.field_0x58; + fontSize.mSizeY = (int)g_msgHIO.field_0x58; + rubySize.mSizeX = g_msgHIO.field_0x68; + rubySize.mSizeY = g_msgHIO.field_0x68; + ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m0544[1].pane)->setFontSize(rubySize); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m0544[3].pane)->setFontSize(rubySize); for (s32 i = 0; i < 3; i++) { - numberPane[i]->setFontSize(size); - numberPane[i]->resize(size.mSizeX, size.mSizeY); + numberPane[i]->setFontSize(fontSize); + numberPane[i]->resize(fontSize.mSizeX, fontSize.mSizeY); } - maskPane->resize(size.mSizeX, size.mSizeY); + maskPane->resize(fontSize.mSizeX, fontSize.mSizeY); } else #endif { textOffsetY = VERSION_SELECT(4, 4, 2, 2); - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); + fontSize.mSizeX = g_msgHIO.field_0x70; + fontSize.mSizeY = g_msgHIO.field_0x70; + ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(fontSize); for (s32 i = 0; i < 3; i++) { - numberPane[i]->setFontSize(size); - numberPane[i]->resize(size.mSizeX, size.mSizeY); + numberPane[i]->setFontSize(fontSize); + numberPane[i]->resize(fontSize.mSizeX, fontSize.mSizeY); } - maskPane->resize(size.mSizeX, size.mSizeY); + maskPane->resize(fontSize.mSizeX, fontSize.mSizeY); } ((J2DTextBox*)i_Msg->m0544[0].pane)->setCharSpace(g_msgHIO.field_0x5a); @@ -552,8 +552,8 @@ void dMsg_screenDataSetDemo(sub_msg_class* i_Msg) { } } - i_Msg->m110C = (int)size.mSizeX; - i_Msg->m1110 = (int)size2.mSizeX; // !@bug uninitialized use + i_Msg->m110C = (int)fontSize.mSizeX; + i_Msg->m1110 = (int)rubySize.mSizeX; // !@bug uninitialized use i_Msg->m026C[0].mUserArea = 0; } @@ -610,21 +610,21 @@ void dMsg_screenDataSetTact(sub_msg_class* i_Msg) { numberPane[i]->setFont(textFont); } textOffsetY = 2; - J2DTextBox::TFontSize size; - size.mSizeX = g_msgHIO.field_0x70; - size.mSizeY = g_msgHIO.field_0x70; - ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(size); - ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(size); + J2DTextBox::TFontSize fontSize; + fontSize.mSizeX = g_msgHIO.field_0x70; + fontSize.mSizeY = g_msgHIO.field_0x70; + ((J2DTextBox*)i_Msg->m0544[0].pane)->setFontSize(fontSize); + ((J2DTextBox*)i_Msg->m0544[2].pane)->setFontSize(fontSize); for (s32 i = 0; i < 3; i++) { - numberPane[i]->setFontSize(size); - numberPane[i]->resize(size.mSizeX, size.mSizeY); + numberPane[i]->setFontSize(fontSize); + numberPane[i]->resize(fontSize.mSizeX, fontSize.mSizeY); } - maskPane->resize(size.mSizeX, size.mSizeY); - J2DTextBox::TFontSize size2; - size2.mSizeX = g_msgHIO.field_0x68; - size2.mSizeY = g_msgHIO.field_0x68; - ((J2DTextBox*)i_Msg->m0544[1].pane)->setFontSize(size2); - ((J2DTextBox*)i_Msg->m0544[3].pane)->setFontSize(size2); + maskPane->resize(fontSize.mSizeX, fontSize.mSizeY); + J2DTextBox::TFontSize rubySize; + rubySize.mSizeX = g_msgHIO.field_0x68; + rubySize.mSizeY = g_msgHIO.field_0x68; + ((J2DTextBox*)i_Msg->m0544[1].pane)->setFontSize(rubySize); + ((J2DTextBox*)i_Msg->m0544[3].pane)->setFontSize(rubySize); ((J2DTextBox*)i_Msg->m0544[0].pane)->setCharSpace(g_msgHIO.field_0x5a); ((J2DTextBox*)i_Msg->m0544[1].pane)->setCharSpace(g_msgHIO.field_0x5c); ((J2DTextBox*)i_Msg->m0544[2].pane)->setCharSpace(g_msgHIO.field_0x5a); @@ -637,9 +637,9 @@ void dMsg_screenDataSetTact(sub_msg_class* i_Msg) { for (s32 i = 0; i < 3; i++) { numberPane[i]->setLineSpace(g_msgHIO.field_0x5e); } - ((J2DTextBox*)i_Msg->m0544[0].pane)->getFontSize(size); - i_Msg->m110C = (int)size.mSizeX; - i_Msg->m1110 = (int)size2.mSizeX; + ((J2DTextBox*)i_Msg->m0544[0].pane)->getFontSize(fontSize); + i_Msg->m110C = (int)fontSize.mSizeX; + i_Msg->m1110 = (int)rubySize.mSizeX; i_Msg->m1168 = mDoAud_tact_getBeat(); i_Msg->m1144 = 0; i_Msg->buffer_p = (ResTIMG*)i_Msg->mpHeap->alloc(0x1a280, 0x20); diff --git a/src/d/d_npc.cpp b/src/d/d_npc.cpp index bf360140b..f09de4aa5 100644 --- a/src/d/d_npc.cpp +++ b/src/d/d_npc.cpp @@ -77,7 +77,8 @@ bool dNpc_JntCtrl_c::move(s16 param_1, int param_2) { param_1 -= (int)angle; angles[i] = angle; angleL = mAngles[i][param_2]; - cLib_addCalcAngleL(&angleL, angle, 4, mMaxTurnStep[i][param_2], 1); + s16 maxStep = mMaxTurnStep[i][param_2]; + cLib_addCalcAngleL(&angleL, angle, 4, maxStep, 1); mAngles[i][param_2] = angleL; } @@ -698,15 +699,26 @@ u16 fopNpc_npc_c::talk(int param_1) { /* 8021C120-8021C238 .text dNpc_setAnm_2__FP14mDoExt_McaMorfiffiiPCc */ bool dNpc_setAnm_2(mDoExt_McaMorf* pMorf, int loopMode, f32 morf, f32 speed, int animFileIdx, int soundFileIdx, const char* arcName) { if(0 <= soundFileIdx) { - void* pSoundAnimRes = dComIfG_getObjectRes(arcName, soundFileIdx); - J3DAnmTransform* pAnimRes = static_cast(dComIfG_getObjectRes(arcName, animFileIdx)); - - pMorf->setAnm(pAnimRes, loopMode, morf, speed, 0.0f, -1.0f, pSoundAnimRes); + pMorf->setAnm( + static_cast(dComIfG_getObjectRes(arcName, animFileIdx)), + loopMode, + morf, + speed, + 0.0f, + -1.0f, + dComIfG_getObjectRes(arcName, soundFileIdx) + ); } else { - J3DAnmTransform* pAnimRes = static_cast(dComIfG_getObjectRes(arcName, animFileIdx)); - - pMorf->setAnm(pAnimRes, loopMode, morf, speed, 0.0f, -1.0f, 0); + pMorf->setAnm( + static_cast(dComIfG_getObjectRes(arcName, animFileIdx)), + loopMode, + morf, + speed, + 0.0f, + -1.0f, + NULL + ); } diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 16d9e36ac..843f206ad 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -206,12 +206,12 @@ J3DModel * dPa_modelControl_c::newModel(J3DModelData* modelData) { J3DModel * j3dmodel = model->mModel; j3dmodel->setModelData(modelData); - J3DShapePacket * shapePacket = j3dmodel->getShapePacket(0); + J3DShapePacket * shapePacket = j3dmodel->getShapePacketArray(); for (u16 j = 0; j < modelData->getShapeNum(); shapePacket++, j++) { shapePacket->setShape(modelData->getShapeNodePointer(j)); } - J3DMatPacket * matPacket = j3dmodel->getMatPacket(0); + J3DMatPacket * matPacket = j3dmodel->getMatPacketArray(); for (u16 j = 0; j < modelData->getMaterialNum(); matPacket++, j++) { J3DMaterial* mat = modelData->getMaterialNodePointer(j); matPacket->setMaterial(mat); diff --git a/src/d/d_picture_box.cpp b/src/d/d_picture_box.cpp index 974009b9e..0b6534452 100644 --- a/src/d/d_picture_box.cpp +++ b/src/d/d_picture_box.cpp @@ -194,17 +194,17 @@ void dJle_Pb_c::screenSet2() { ((J2DTextBox *)(pane_tx[2].pane))->setFont(font0); ((J2DTextBox *)(pane_tx[3].pane))->setFont(font1); -#if VERSION <= VERSION_JPN J2DTextBox::TFontSize fontSize; + J2DTextBox::TFontSize rubySize; +#if VERSION <= VERSION_JPN if (g_msgDHIO.field_0x08 == 0) { fontSize.mSizeX = fontSize.mSizeY = (int)g_msgHIO.field_0x58; - J2DTextBox::TFontSize fontSize2; - fontSize2.mSizeX = fontSize2.mSizeY = g_msgHIO.field_0x68; + rubySize.mSizeX = rubySize.mSizeY = g_msgHIO.field_0x68; ((J2DTextBox *)(pane_tx[0].pane))->setFontSize(fontSize); - ((J2DTextBox *)(pane_tx[1].pane))->setFontSize(fontSize2); + ((J2DTextBox *)(pane_tx[1].pane))->setFontSize(rubySize); ((J2DTextBox *)(pane_tx[2].pane))->setFontSize(fontSize); - ((J2DTextBox *)(pane_tx[3].pane))->setFontSize(fontSize2); + ((J2DTextBox *)(pane_tx[3].pane))->setFontSize(rubySize); } else { fontSize.mSizeX = fontSize.mSizeY = g_msgHIO.field_0x70; @@ -212,7 +212,6 @@ void dJle_Pb_c::screenSet2() { ((J2DTextBox *)(pane_tx[2].pane))->setFontSize(fontSize); } #else - J2DTextBox::TFontSize fontSize; fontSize.mSizeX = fontSize.mSizeY = g_msgHIO.field_0x70; ((J2DTextBox *)(pane_tx[0].pane))->setFontSize(fontSize); diff --git a/src/d/d_resorce.cpp b/src/d/d_resorce.cpp index 0e0230d2a..9424c863a 100644 --- a/src/d/d_resorce.cpp +++ b/src/d/d_resorce.cpp @@ -549,7 +549,7 @@ dRes_control_c::~dRes_control_c() { } /* 8006EF34-8006F01C .text setRes__14dRes_control_cFPCcP11dRes_info_ciPCcUcP7JKRHeap */ -BOOL dRes_control_c::setRes(const char* pArcName, dRes_info_c* pInfoArr, int infoNum, const char* pArcPath, u8 direction, JKRHeap* pHeap) { +int dRes_control_c::setRes(const char* pArcName, dRes_info_c* pInfoArr, int infoNum, const char* pArcPath, u8 direction, JKRHeap* pHeap) { dRes_info_c * pInfo = getResInfo(pArcName, pInfoArr, infoNum); if (pInfo == NULL) { @@ -557,18 +557,18 @@ BOOL dRes_control_c::setRes(const char* pArcName, dRes_info_c* pInfoArr, int inf if (pInfo == NULL) { OSReport_Error("<%s.arc> dRes_control_c::setRes: 空きリソース情報ポインタがありません\n", pArcName); pInfo->~dRes_info_c(); - return FALSE; + return 0; } if (!pInfo->set(pArcName, pArcPath, direction, pHeap)) { OSReport_Error("<%s.arc> dRes_control_c::setRes: res info set error !!\n", pArcName); pInfo->~dRes_info_c(); - return FALSE; + return 0; } } pInfo->incCount(); - return TRUE; + return 1; } /* 8006F01C-8006F074 .text syncRes__14dRes_control_cFPCcP11dRes_info_ci */ @@ -703,7 +703,7 @@ int dRes_control_c::syncAllRes(dRes_info_c* pInfo, int infoNum) { } /* 8006F430-8006F500 .text setStageRes__14dRes_control_cFPCcP7JKRHeap */ -BOOL dRes_control_c::setStageRes(char const* pArcName, JKRHeap* pHeap) { +int dRes_control_c::setStageRes(char const* pArcName, JKRHeap* pHeap) { char path[20]; snprintf(path, sizeof(path), "/res/Stage/%s/", strcmp(dComIfGp_getStartStageName(), "ma2room") == 0 && dComIfGs_isEventBit(dSv_event_flag_c::UNK_1820) ? "ma3room" : dComIfGp_getStartStageName()); return setRes(pArcName, &mStageInfo[0], ARRAY_SIZE(mStageInfo), path, 1, pHeap); diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index 98f96c5c2..89f09dfe3 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -24,6 +24,7 @@ #endif #include "m_Do/m_Do_Reset.h" #include "m_Do/m_Do_dvd_thread.h" +#include "DynamicLink.h" #include "JSystem/JKernel/JKRExpHeap.h" #include "JSystem/JKernel/JKRAram.h" #include "JSystem/JKernel/JKRAramBlock.h" @@ -66,7 +67,7 @@ mDoDvdThd_toMainRam_c * l_itemTableCommand; mDoDvdThd_toMainRam_c * l_ActorDataCommand; mDoDvdThd_toMainRam_c * l_FmapDataCommand; #if VERSION == VERSION_DEMO -mDoDvdThd_mountXArchive_c * l_DmcMountCommand; +mDoDvdThd_callback_c * l_DmcMountCommand; #else mDoDvdThd_mountXArchive_c * l_lodCommand; #endif @@ -87,18 +88,23 @@ enum { /* 8022C0B4-8022C130 .text checkProgSelect__FP10dScnLogo_c */ void checkProgSelect(dScnLogo_c* i_this) { -#if VERSION == VERSION_PAL - if (OSGetResetCode() == 0 || OSGetResetCode() == 1) { - if (OSGetEuRgb60Mode() == 1 || CPad_CHECK_HOLD_B(0)) { +#if VERSION == VERSION_DEMO + if (VIGetDTVStatus() != 0 && (OSGetProgressiveMode() == 1 || CPad_CHECK_HOLD_B(0))) { + i_this->field_0x1ea = 1; + i_this->mInterFlag = 0; + } +#elif VERSION <= VERSION_USA + if (OSGetResetCode() == 0) { + if (VIGetDTVStatus() != 0 && (OSGetProgressiveMode() == 1 || CPad_CHECK_HOLD_B(0))) { i_this->field_0x1ea = 1; i_this->mInterFlag = 0; } } else { i_this->field_0x1ea = 0; } -#else - if (OSGetResetCode() == 0) { - if (VIGetDTVStatus() != 0 && (OSGetProgressiveMode() == 1 || CPad_CHECK_HOLD_B(0))) { +#else // VERSION_PAL + if (OSGetResetCode() == 0 || OSGetResetCode() == 1) { + if (OSGetEuRgb60Mode() == 1 || CPad_CHECK_HOLD_B(0)) { i_this->field_0x1ea = 1; i_this->mInterFlag = 0; } @@ -167,7 +173,8 @@ BOOL progInDraw(dScnLogo_c* i_this) { dComIfGd_set2DOpa(i_this->progyesImg); dComIfGd_set2DOpa(i_this->prognoImg); - u8 alpha = (1.0f - (i_this->mTimer / 30.0f)) * 0xFF; + f32 temp = 1.0f - (i_this->mTimer / 30.0f); + u8 alpha = temp * 0xFF; i_this->progchoiceImg->setAlpha(alpha); i_this->progyesImg->setAlpha(alpha); i_this->prognoImg->setAlpha(alpha); @@ -274,7 +281,8 @@ BOOL progSelDraw(dScnLogo_c* i_this) { /* 8022CAA8-8022CC54 .text progOutDraw__FP10dScnLogo_c */ BOOL progOutDraw(dScnLogo_c* i_this) { - u8 alpha = (i_this->mTimer / 30.0f) * 0xFF; + f32 temp = i_this->mTimer / 30.0f; + u8 alpha = temp * 0xFF; i_this->progchoiceImg->setAlpha(alpha); i_this->progyesImg->setAlpha(alpha); i_this->prognoImg->setAlpha(alpha); @@ -286,18 +294,21 @@ BOOL progOutDraw(dScnLogo_c* i_this) { if (i_this->mTimer == 0) { #if VERSION == VERSION_PAL - if (OSGetEuRgb60Mode() == 1 && !i_this->mInterFlag) { + if (OSGetEuRgb60Mode() == 1 && !i_this->mInterFlag) #else - if (OSGetProgressiveMode() && !i_this->mInterFlag) { + if (OSGetProgressiveMode() && !i_this->mInterFlag) #endif + { i_this->mAction = ACT_nintendoOut2Draw; i_this->mTimer = 30; mDoGph_gInf_c::startFadeOut(30); + } #if VERSION == VERSION_PAL - } else if (OSGetEuRgb60Mode() == 0 && i_this->mInterFlag) { + else if (OSGetEuRgb60Mode() == 0 && i_this->mInterFlag) #else - } else if (!OSGetProgressiveMode() && i_this->mInterFlag) { + else if (!OSGetProgressiveMode() && i_this->mInterFlag) #endif + { i_this->mAction = ACT_nintendoOutDraw; i_this->mTimer = 30; mDoGph_gInf_c::startFadeOut(30); @@ -319,7 +330,8 @@ BOOL progOutDraw(dScnLogo_c* i_this) { BOOL progSetDraw(dScnLogo_c* i_this) { u8 alpha; if (i_this->field_0x1f0 != 0) { - alpha = (1.0f - (i_this->field_0x1f0 / 30.0f)) * 0xFF; + f32 temp = 1.0f - (i_this->field_0x1f0 / 30.0f); + alpha = temp * 0xFF; i_this->field_0x1f0--; } else { alpha = 0xFF; @@ -438,7 +450,9 @@ BOOL dvdWaitDraw(dScnLogo_c* i_this) { && l_itemTableCommand->sync() && l_ActorDataCommand->sync() && l_FmapDataCommand->sync() -#if VERSION > VERSION_DEMO +#if VERSION == VERSION_DEMO + && l_DmcMountCommand->sync() +#else && l_lodCommand->sync() && !mDoRst::isReset() #endif ) { @@ -486,7 +500,7 @@ static BOOL dScnLogo_IsDelete(dScnLogo_c* i_this) { /* 8022D224-8022D984 .text dScnLogo_Delete__FP10dScnLogo_c */ static BOOL dScnLogo_Delete(dScnLogo_c* i_this) { if (mDoRst::isReset()) - mDoRst_reset(0, 0x80000000, 0); + mDoRst_reset(0, DEMO_SELECT(0, 0x80000000), 0); delete i_this->nintendoImg; delete i_this->dolbyImg; @@ -617,7 +631,10 @@ static BOOL dScnLogo_Delete(dScnLogo_c* i_this) { /* 8022D984-8022DB20 .text phase_0__FP10dScnLogo_c */ cPhs_State phase_0(dScnLogo_c* i_this) { -#if VERSION != VERSION_PAL +#if VERSION == VERSION_DEMO + if (!VIGetDTVStatus()) + OSSetProgressiveMode(0); +#elif VERSION <= VERSION_USA if (!OSGetResetCode()) { if (!VIGetDTVStatus()) OSSetProgressiveMode(0); @@ -642,17 +659,24 @@ cPhs_State phase_0(dScnLogo_c* i_this) { rt = dComIfG_setObjectRes("System", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); - JUT_ASSERT(VERSION_SELECT(1169, 1169, 1350, 1378), rt == 1); + JUT_ASSERT(VERSION_SELECT(1128, 1169, 1350, 1378), rt == 1); +#if VERSION <= VERSION_DEMO + rt = dComIfG_setObjectRes("Logo", JKRArchive::MOUNT_DIRECTION_HEAD, NULL); +#else rt = dComIfG_setObjectRes("Logo", JKRArchive::MOUNT_DIRECTION_TAIL, NULL); - JUT_ASSERT(VERSION_SELECT(1173, 1173, 1354, 1382), rt == 1); +#endif + JUT_ASSERT(VERSION_SELECT(1131, 1173, 1354, 1382), rt == 1); #if VERSION == VERSION_PAL g_mDoMemCd_control.load2(); #endif +#if VERSION > VERSION_DEMO i_this->field_0x1ea = 0; archiveHeap->dump_sort(); +#endif + return cPhs_NEXT_e; } @@ -684,14 +708,18 @@ cPhs_State phase_1(dScnLogo_c* i_this) { toonImage = (ResTIMG *)dComIfG_getObjectRes("System", dRes_INDEX_SYSTEM_BTI_TOON_e); - JUT_ASSERT(VERSION_SELECT(1208, 1208, 1426, 1466), toonImage != NULL); + JUT_ASSERT(VERSION_SELECT(1161, 1208, 1426, 1466), toonImage != NULL); dDlst_list_c::setToonImage(toonImage); toonImage = (ResTIMG *)dComIfG_getObjectRes("System", dRes_INDEX_SYSTEM_BTI_TOONEX_e); - JUT_ASSERT(VERSION_SELECT(1213, 1213, 1431, 1471), toonImage != NULL); + JUT_ASSERT(VERSION_SELECT(1166, 1213, 1431, 1471), toonImage != NULL); dDlst_list_c::setToonExImage(toonImage); i_this->field_0x1f8 = mDoExt_getGameHeap()->alloc(0x3c8a0, 4); +#if VERSION == VERSION_DEMO + i_this->field_0x1fc = mDoExt_getArchiveHeap()->alloc(0xf24e0, 4); +#endif + return cPhs_NEXT_e; } @@ -710,7 +738,7 @@ cPhs_State phase_2(dScnLogo_c* i_this) { s32 rt; rt = dComIfG_syncObjectRes("Logo"); - JUT_ASSERT(VERSION_SELECT(1251, 1251, 1469, 1509), rt >= 0); + JUT_ASSERT(VERSION_SELECT(1202, 1251, 1469, 1509), rt >= 0); if (rt != 0) return cPhs_INIT_e; @@ -720,9 +748,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) { ResTIMG * timg; timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_NINTENDO_376X104_e); - JUT_ASSERT(VERSION_SELECT(1264, 1264, 1482, 1522), timg != NULL); + JUT_ASSERT(VERSION_SELECT(1214, 1264, 1482, 1522), timg != NULL); i_this->nintendoImg = new dDlst_2D_c(timg, 133, 170, 0); - JUT_ASSERT(VERSION_SELECT(1267, 1267, 1485, 1525), i_this->nintendoImg != NULL); + JUT_ASSERT(VERSION_SELECT(1216, 1267, 1485, 1525), i_this->nintendoImg != NULL); i_this->nintendoImg->setAlpha(0xFF); #if VERSION <= VERSION_JPN // Blue Nintendo logo for JPN. @@ -733,9 +761,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) { #endif timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_TITLE_DOLBY_MARK_e); - JUT_ASSERT(VERSION_SELECT(1276, 1276, 1498, 1538), timg != NULL); + JUT_ASSERT(VERSION_SELECT(1224, 1276, 1498, 1538), timg != NULL); i_this->dolbyImg = new dDlst_2D_c(timg, 218, 166, 0); - JUT_ASSERT(VERSION_SELECT(1280, 1280, 1502, 1542), i_this->dolbyImg != NULL); + JUT_ASSERT(VERSION_SELECT(1226, 1280, 1502, 1542), i_this->dolbyImg != NULL); i_this->dolbyImg->setAlpha(0xFF); #if VERSION == VERSION_PAL @@ -781,9 +809,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) { #else timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_CHOICE_e); #endif - JUT_ASSERT(VERSION_SELECT(1286, 1286, 1565, 1605), timg != NULL); + JUT_ASSERT(VERSION_SELECT(1232, 1286, 1565, 1605), timg != NULL); i_this->progchoiceImg = new dDlst_2D_c(timg, 113, 281, 0); - JUT_ASSERT(VERSION_SELECT(1288, 1288, 1567, 1607), i_this->progchoiceImg != NULL); + JUT_ASSERT(VERSION_SELECT(1234, 1288, 1567, 1607), i_this->progchoiceImg != NULL); i_this->progchoiceImg->setAlpha(0x00); #if VERSION == VERSION_PAL @@ -791,9 +819,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) { #else timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_YES_e); #endif - JUT_ASSERT(VERSION_SELECT(1295, 1295, 1579, 1619), timg != NULL); + JUT_ASSERT(VERSION_SELECT(1240, 1295, 1579, 1619), timg != NULL); i_this->progyesImg = new dDlst_2D_c(timg, 211, 372, 0); - JUT_ASSERT(VERSION_SELECT(1297, 1297, 1581, 1621), i_this->progyesImg != NULL); + JUT_ASSERT(VERSION_SELECT(1242, 1297, 1581, 1621), i_this->progyesImg != NULL); i_this->progyesImg->getPicture()->setWhite((GXColor){0xFF, 0xC8, 0x00, 0xFF}); i_this->progyesImg->setAlpha(0x00); @@ -802,9 +830,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) { #else timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_NO_e); #endif - JUT_ASSERT(VERSION_SELECT(1305, 1305, 1594, 1634), timg != NULL); + JUT_ASSERT(VERSION_SELECT(1249, 1305, 1594, 1634), timg != NULL); i_this->prognoImg = new dDlst_2D_c(timg, 350, 372, 0); - JUT_ASSERT(VERSION_SELECT(1307, 1307, 1596, 1636), i_this->prognoImg != NULL); + JUT_ASSERT(VERSION_SELECT(1251, 1307, 1596, 1636), i_this->prognoImg != NULL); i_this->prognoImg->getPicture()->setWhite((GXColor){0xA0, 0xA0, 0xA0, 0xFF}); i_this->prognoImg->setAlpha(0x00); @@ -813,9 +841,9 @@ cPhs_State phase_2(dScnLogo_c* i_this) { #else timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_PRO_e); #endif - JUT_ASSERT(VERSION_SELECT(1315, 1315, 1609, 1649), timg != NULL); + JUT_ASSERT(VERSION_SELECT(1258, 1315, 1609, 1649), timg != NULL); i_this->progImg = new dDlst_2D_c(timg, 153, 309, 0); - JUT_ASSERT(VERSION_SELECT(1317, 1317, 1611, 1651), i_this->progImg != NULL); + JUT_ASSERT(VERSION_SELECT(1260, 1317, 1611, 1651), i_this->progImg != NULL); i_this->progImg->setAlpha(0x00); #if VERSION == VERSION_PAL @@ -823,12 +851,15 @@ cPhs_State phase_2(dScnLogo_c* i_this) { #else timg = (ResTIMG *)dComIfG_getObjectRes("Logo", dRes_INDEX_LOGO_BTI_PROGRESSIVE_INTER_e); #endif - JUT_ASSERT(VERSION_SELECT(1324, 1324, 1623, 1663), timg != NULL); + JUT_ASSERT(VERSION_SELECT(1266, 1324, 1623, 1663), timg != NULL); i_this->interImg = new dDlst_2D_c(timg, 153, 309, 0); - JUT_ASSERT(VERSION_SELECT(1326, 1326, 1625, 1665), i_this->interImg != NULL); + JUT_ASSERT(VERSION_SELECT(1268, 1326, 1625, 1665), i_this->interImg != NULL); i_this->interImg->setAlpha(0x00); JKRHeap::free(i_this->field_0x1f8, NULL); +#if VERSION == VERSION_DEMO + JKRHeap::free(i_this->field_0x1fc, NULL); +#endif #if VERSION > VERSION_DEMO l_lodCommand = aramMount("/res/Stage/sea/LODALL.arc"); @@ -836,17 +867,17 @@ cPhs_State phase_2(dScnLogo_c* i_this) { #endif rt = dComIfG_setObjectRes("Always", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); - JUT_ASSERT(VERSION_SELECT(1351, 1351, 1650, 1690), rt == 1); + JUT_ASSERT(VERSION_SELECT(1280, 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); + JUT_ASSERT(VERSION_SELECT(1283, 1356, 1655, 1695), rt == 1); rt = dComIfG_setObjectRes("Agb", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); - JUT_ASSERT(VERSION_SELECT(1360, 1360, 1659, 1699), rt == 1); + JUT_ASSERT(VERSION_SELECT(1286, 1360, 1659, 1699), rt == 1); l_anmCommand = aramMount("/res/Object/LkAnm.arc"); l_fmapCommand = aramMount("/res/Fmap/Fmap.arc"); @@ -899,11 +930,15 @@ cPhs_State phase_2(dScnLogo_c* i_this) { l_rubyCommand = onMemMount("/res/Msg/rubyres.arc"); l_particleCommand = mDoDvdThd_toMainRam_c::create("/res/Particle/common.jpc", JKRArchive::DEFAULT_MOUNT_DIRECTION, dComIfGp_particle_getCommonHeap()); l_itemTableCommand = mDoDvdThd_toMainRam_c::create("/res/ItemTable/item_table.bin", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); - JUT_ASSERT(VERSION_SELECT(1418, 1418, 1743, 1783), l_itemTableCommand != NULL); + JUT_ASSERT(VERSION_SELECT(1342, 1418, 1743, 1783), l_itemTableCommand != NULL); l_ActorDataCommand = mDoDvdThd_toMainRam_c::create("/res/ActorDat/ActorDat.bin", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); - JUT_ASSERT(VERSION_SELECT(1422, 1422, 1747, 1787), l_ActorDataCommand != NULL); + JUT_ASSERT(VERSION_SELECT(1346, 1422, 1747, 1787), l_ActorDataCommand != NULL); l_FmapDataCommand = mDoDvdThd_toMainRam_c::create("/res/FmapDat/FmapDat.bin", JKRArchive::DEFAULT_MOUNT_DIRECTION, NULL); - JUT_ASSERT(VERSION_SELECT(1426, 1426, 1751, 1791), l_FmapDataCommand != NULL); + JUT_ASSERT(VERSION_SELECT(1350, 1426, 1751, 1791), l_FmapDataCommand != NULL); +#if VERSION == VERSION_DEMO + l_DmcMountCommand = DynamicModuleControl::mountCreate(); + JUT_ASSERT(VERSION_SELECT(1354, 1426, 1751, 1791), l_DmcMountCommand != NULL); +#endif mDoAud_loadStaticWaves(); mDoGph_gInf_c::setTickRate((OS_BUS_CLOCK / 4) / 60); diff --git a/src/d/d_salvage.cpp b/src/d/d_salvage.cpp index 022bd6199..e5427fe30 100644 --- a/src/d/d_salvage.cpp +++ b/src/d/d_salvage.cpp @@ -11,7 +11,7 @@ // maybe belongs in d_a_salvage.h? namespace daSalvage_prm { inline u8 getKindCmapNo(fopAc_ac_c* pact) { return pact->home.angle.z & 0x03; } - inline s32 getSwitchNo(fopAc_ac_c* pact) { return pact->home.angle.z & 0xFF; } + inline int getSwitchNo(fopAc_ac_c* pact) { return pact->home.angle.z & 0xFF; } inline u8 getRoomNo(fopAc_ac_c* pact) { return fopAcM_GetParam(pact) >> 12; } inline u8 getSvNo(fopAc_ac_c* pact) { return fopAcM_GetParam(pact) >> 20; } inline u8 getType(fopAc_ac_c* pact) { return fopAcM_GetParam(pact) & 0x0F; } @@ -46,9 +46,9 @@ void dSalvage_control_c::entry(fopAc_ac_c* pact, JPABaseEmitter* emtr) { u32 type = daSalvage_prm::getType(pact); u32 saveNo = daSalvage_prm::getSvNo(pact); s8 roomNoPrm = daSalvage_prm::getRoomNo(pact); - s32 switchNo = daSalvage_prm::getSwitchNo(pact); + int switchNo = daSalvage_prm::getSwitchNo(pact); s8 cmapNo; - s32 no; + int no; bool invalid = false; if (roomNo != 0) { diff --git a/src/d/d_save.cpp b/src/d/d_save.cpp index 7e8c91a76..4d4e199d6 100644 --- a/src/d/d_save.cpp +++ b/src/d/d_save.cpp @@ -702,12 +702,10 @@ void dSv_player_get_bag_item_c::onReserve(u8 i_no) { mReserveFlags |= (1 << i_no); } -#if VERSION == VERSION_DEMO void dSv_player_get_bag_item_c::offReserve(u8 i_no) { JUT_ASSERT(1334, 0 <= i_no && i_no < 32); mReserveFlags &= ~(1 << i_no); } -#endif /* 8005ABB4-8005AC48 .text isReserve__25dSv_player_get_bag_item_cFUc */ BOOL dSv_player_get_bag_item_c::isReserve(u8 i_no) { diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 194c08023..417201be3 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -2398,9 +2398,7 @@ void dStage_escapeRestart() { daPy_lk_c* player_p = daPy_getPlayerLinkActorClass(); dComIfGs_setTurnRestart(player_p->current.pos, player_p->shape_angle.y, fopAcM_GetRoomNo(player_p), player_p->getDayNightParamData()); - if (dComIfG_getTimerMode() == 3) { - dComIfG_TimerDeleteRequest(); - } + dComIfG_TimerDeleteRequest(3); dComIfGp_setNextStage(dComIfGp_getStartStageName(), -3, dComIfGs_getTurnRestartRoomNo(), -1, 0.0f, 0, FALSE, 9); } diff --git a/src/f_op/f_op_msg_mng.cpp b/src/f_op/f_op_msg_mng.cpp index 7e4429706..cf1338366 100644 --- a/src/f_op/f_op_msg_mng.cpp +++ b/src/f_op/f_op_msg_mng.cpp @@ -835,10 +835,10 @@ fopMsgM_unk_struct fopMsgM_selectMessageGet(J2DPane* i_textPane, J2DPane* i_ruby strcpy(param_5, ""); strcpy(param_6, ""); - J2DTextBox::TFontSize size; - J2DTextBox::TFontSize size2; - ((J2DTextBox*)i_rubyPane)->getFontSize(size); - ((J2DTextBox*)i_textPane)->getFontSize(size2); + J2DTextBox::TFontSize fontSize; + J2DTextBox::TFontSize rubySize; + ((J2DTextBox*)i_rubyPane)->getFontSize(rubySize); + ((J2DTextBox*)i_textPane)->getFontSize(fontSize); mesg_header* head_p = msgGet.getMesgHeader(i_msgNo); JUT_ASSERT(VERSION_SELECT(1866, 1866, 1947, 1956), head_p); @@ -857,8 +857,8 @@ fopMsgM_unk_struct fopMsgM_selectMessageGet(J2DPane* i_textPane, J2DPane* i_ruby msgData.setRubyCharSpace(((J2DTextBox*)i_rubyPane)->getCharSpace()); msgData.setLineSpace(((J2DTextBox*)i_textPane)->getLineSpace()); msgData.setMesgEntry(&entry); - msgData.setFontSize(size2.mSizeX); - msgData.setRubyFontSize(size.mSizeX); + msgData.setFontSize(fontSize.mSizeX); + msgData.setRubyFontSize(rubySize.mSizeX); msgData.setLineWidth(i_textPane->getWidth()); msgData.setCenterLineWidth(i_textPane->getWidth()); msgData.setSendSpeed(2); diff --git a/src/f_pc/f_pc_manager.cpp b/src/f_pc/f_pc_manager.cpp index 2af5afba5..17cba8485 100644 --- a/src/f_pc/f_pc_manager.cpp +++ b/src/f_pc/f_pc_manager.cpp @@ -101,17 +101,17 @@ void messageSet(u32 status) { J2DPicture * ppane = new J2DPicture('PIC1', JGeometry::TBox2(0.0f, 0.0f, 665.0f, 530.0f), (ResTIMG*)black_tex, NULL); JUT_ASSERT(VERSION_SELECT(312, 312, 334, 334), ppane != NULL); - J2DTextBox::TFontSize size; - size.mSizeX = 27.0f; - size.mSizeY = 27.0f; - tpane->setFontSize(size); + J2DTextBox::TFontSize fontSize; + fontSize.mSizeX = 27.0f; + fontSize.mSizeY = 27.0f; + tpane->setFontSize(fontSize); tpane->setCharColor(JUtility::TColor(0xFF, 0xC8, 0x00, 0xFF)); tpane->setGradColor(JUtility::TColor(0xFF, 0xB4, 0x00, 0xFF)); tpane->setCharSpace(0.0f); tpane->setLineSpace(27.0f); tpane->setBlack(JUtility::TColor(0xFF, 0xFF, 0xFF, 0x00)); - spane->setFontSize(size); + spane->setFontSize(fontSize); spane->setCharColor(JUtility::TColor(0x00, 0x00, 0x00, 0xC8)); spane->setGradColor(JUtility::TColor(0x00, 0x00, 0x00, 0xC8)); spane->setCharSpace(0.0f);