From bc42605acece13dd361f83bbf1d99332e2266e99 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 12 Oct 2023 17:17:38 -0700 Subject: [PATCH] d_com_inf_game matches --- include/d/actor/d_a_player.h | 2 ++ include/d/actor/d_a_player_link.h | 4 +++- include/d/d_particle.h | 5 +++++ src/d/d_com_inf_game.cpp | 31 +++++++++++++++++++------------ 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 3b13f16da..7831c0fd1 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -28,6 +28,8 @@ public: /* 0x08 */ MtxP mpMtx; }; +STATIC_ASSERT(sizeof(daPy_mtxFollowEcallBack_c) == 0x0C); + class daPy_HIO_c { public: }; diff --git a/include/d/actor/d_a_player_link.h b/include/d/actor/d_a_player_link.h index 96c533d7e..27523e115 100644 --- a/include/d/actor/d_a_player_link.h +++ b/include/d/actor/d_a_player_link.h @@ -97,6 +97,8 @@ public: /* 0x0 */ u8 field_0x0[0x28]; }; +STATIC_ASSERT(sizeof(daPy_swimTailEcallBack_c) == 0x28); + class daPy_waterDropEcallBack_c { public: void execute(JPABaseEmitter*); @@ -1177,7 +1179,7 @@ public: /* 0x3484 */ dAttList_c* mpAttnEntryA; /* 0x3488 */ dAttList_c* mpAttnEntryX; /* 0x348C */ dAttList_c* mpAttnEntryY; - /* 0x3490 */ dAttList_c* mpAttnentryZ; + /* 0x3490 */ dAttList_c* mpAttnEntryZ; /* 0x3494 */ u8 field_0x3494[0x34B9 - 0x3494]; /* 0x34B9 */ u8 mFrontWallType; /* 0x34BA */ u8 field_0x34BA[0x34BD - 0x34BA]; diff --git a/include/d/d_particle.h b/include/d/d_particle.h index cd5e6db0e..31e1746f7 100644 --- a/include/d/d_particle.h +++ b/include/d/d_particle.h @@ -257,8 +257,13 @@ public: virtual void executeAfter(JPABaseEmitter*); virtual void setup(JPABaseEmitter*, const cXyz*, const csXyz*, s8); void end(); + +public: + /* 0x04 */ u8 field_0x04[0x0c]; }; +STATIC_ASSERT(sizeof(dPa_cutTurnEcallBack_c) == 0x10); + class dPa_stripesEcallBack : public dPa_levelEcallBack { public: dPa_stripesEcallBack(); diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 94a396c98..b5e9e50de 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -178,12 +178,10 @@ void dComIfG_play_c::itemInit() { } /* 80052400-8005286C .text getLayerNo__14dComIfG_play_cFi */ -// NONMATCHING - almost int dComIfG_play_c::getLayerNo(int i_roomNo) { - int layer = dComIfGp_getStartStageLayer(); - - if (layer < 0) { - layer = dKy_getdaytime_hour(); + int stageLayer = dComIfGp_getStartStageLayer(); + if (stageLayer < 0) { + int layer = dKy_getdaytime_hour(); if (dKy_checkEventNightStop()) { layer = 1; } else { @@ -248,14 +246,16 @@ int dComIfG_play_c::getLayerNo(int i_roomNo) { if (!dComIfGs_isEventBit(0x3B02)) { return 8; } - } else if (strcmp(dComIfGp_getStartStageName(), "GTower") == 0 && - !dComIfGs_isEventBit(0x4002)) - { - return 8; + } else if (strcmp(dComIfGp_getStartStageName(), "GTower") == 0) { + if (!dComIfGs_isEventBit(0x4002)) { + return 8; + } } + + return layer; } - return layer; + return stageLayer; } /* 8005286C-800528F4 .text createParticle__14dComIfG_play_cFv */ @@ -642,7 +642,7 @@ void dComIfGp_setNextStage(const char* i_stageName, s16 i_point, s8 i_roomNo, s8 i_lastMode |= 0x8000; } - i_lastMode |= daPy_getPlayerLinkActorClass()->field_0x354e << 0x10; + i_lastMode |= daPy_getPlayerLinkActorClass()->field_0x354e << 16; if (mode & daPy_lk_c::daPy_FLG1_UNK8000) { i_lastMode |= 0x4000; @@ -1079,6 +1079,13 @@ int dComIfGd_setShadow(u32 id, s8 param_2, J3DModel* pModel, cXyz* pPos, f32 par return sid; } +static const char * dummy_str[] = { + "0 <= cam_id && cam_id < mapc->num", + "0 <= arrow_id && arrow_id < mapa->num", + "0 <= room_cam_id && room_cam_id < pcam->num", + "0 <= arrow_id && arrow_id < parr->num", +}; + /* 8005468C-800547BC .text getSceneList__Fi */ stage_scls_info_class* getSceneList(int i_no) { stage_scls_info_dummy_class* sclsInfo = dComIfGp_getStage().getSclsInfo(); @@ -1134,7 +1141,7 @@ BOOL dComIfGs_checkSeaLandingEvent(s8 i_roomNo) { } /* 800548FC-80054C70 .text dComIfGs_setGameStartStage__Fv */ -// NONMATCHING - one tiny reg swap, string data +// NONMATCHING - one tiny reg swap void dComIfGs_setGameStartStage() { struct check_data { /* 0x0 */ u8 mbHasEvent;