summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2022-06-01 04:55:21 -0700
committerGitHub <noreply@github.com>2022-06-01 04:55:21 -0700
commitab03edeb80df5bc65f4a001cda3f0320f57af01f (patch)
tree40a834ecb4a9324a1f8021224edba6a659422c62 /src
parent9bcbccbeb5966896e10b9f29cc4c69bc49abe20d (diff)
parent132f0cbfb7109828e0edb6312803fae6eb60d0a7 (diff)
Merge pull request #197 from lepelog/event
event manager
Diffstat (limited to 'src')
-rw-r--r--src/d/d_camera.cpp416
-rw-r--r--src/d/event/d_event.cpp26
-rw-r--r--src/d/event/d_event_data.cpp2
-rw-r--r--src/d/event/d_event_manager.cpp1220
4 files changed, 787 insertions, 877 deletions
diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp
index 55949c71f9..b2034a0ff3 100644
--- a/src/d/d_camera.cpp
+++ b/src/d/d_camera.cpp
@@ -16,34 +16,6 @@ namespace std {
/* 80182D10 */ void fabs(f32);
}; // namespace std
-struct stage_camera2_data_class {};
-
-struct request_of_phase_process_class {};
-
-struct Vec {};
-
-struct cXyz {
- /* 80009184 */ ~cXyz();
- /* 800977F4 */ cXyz(cXyz const&);
- /* 8014195C */ cXyz(f32, f32, f32);
- /* 800125DC */ cXyz();
- /* 8008E790 */ void abs() const;
- /* 8008E8D0 */ void operator-=(Vec const&);
- /* 8008E904 */ void operator+=(Vec const&);
- /* 800977D8 */ void operator=(cXyz const&);
- /* 80182D8C */ void set(f32, f32, f32);
- /* 80266AE4 */ void operator+(Vec const&) const;
- /* 80266B34 */ void operator-(Vec const&) const;
- /* 80266B84 */ void operator*(f32) const;
- /* 80266BD0 */ void operator*(Vec const&) const;
- /* 80266CE4 */ void norm() const;
- /* 80266EF4 */ void normalize();
- /* 8026706C */ bool operator!=(Vec const&) const;
-
- static f32 Zero[3];
- static u8 BaseY[12];
-};
-
struct mDoMtx_stack_c {
/* 8000CD9C */ void transM(f32, f32, f32);
/* 8000CE70 */ void scaleM(cXyz const&);
@@ -67,10 +39,6 @@ struct mDoCPd_c {
static u8 m_cpadInfo[256];
};
-struct fopAc_ac_c {
- static u8 stopStatus[4];
-};
-
struct daTagMwait_c {
/* 80182D9C */ void checkEndMessage();
};
@@ -126,22 +94,6 @@ struct dVibration_c {
/* 8006FA24 */ void StartShock(int, int, cXyz);
};
-struct dSv_info_c {
- /* 80035360 */ void isSwitch(int, int) const;
-};
-
-struct dSv_event_tmp_flag_c {
- static u8 const tempBitLabels[370 + 2 /* padding */];
-};
-
-struct dSv_event_c {
- /* 800349BC */ void isEventBit(u16) const;
-};
-
-struct dStage_roomControl_c {
- /* 80024384 */ void getStatusRoomDt(int);
-};
-
struct dRes_info_c {};
struct dRes_control_c {
@@ -164,8 +116,6 @@ struct dDlst_window_c {
/* 80051ADC */ void setScissor(f32, f32, f32, f32);
};
-struct _GXColor {};
-
struct dDlst_effectLine_c {
/* 800541F4 */ void update(cXyz&, _GXColor&, u16, u16, u16, u16, f32, f32, f32, f32);
};
@@ -206,226 +156,6 @@ struct dCcMassS_Mng {
/* 80085EB8 */ void GetCamTopPos(Vec*);
};
-struct cSAngle {
- /* 80030510 */ ~cSAngle();
- /* 8027100C */ void Val(f32);
- /* 8016C2CC */ void Val() const;
- /* 80270FF8 */ void Val(cSAngle const&);
- /* 80270F98 */ cSAngle(s16);
- /* 80182A48 */ cSAngle();
- /* 80270FC8 */ cSAngle(f32);
- /* 80270F68 */ cSAngle(cSAngle const&);
- /* 80182A6C */ bool operator<(cSAngle const&) const;
- /* 80182A8C */ bool operator>(cSAngle const&) const;
- /* 80182C14 */ void __ops() const;
- /* 80182CA8 */ void operator=(cSAngle const&);
- /* 80271030 */ void Degree() const;
- /* 80271098 */ void Norm() const;
- /* 802710CC */ void Abs() const;
- /* 802710E8 */ void Inv() const;
- /* 802710F8 */ void Sin() const;
- /* 80271120 */ void Cos() const;
- /* 802711A4 */ void operator-(cSAngle const&) const;
- /* 80271228 */ void operator-(s16) const;
- /* 80271148 */ void operator-() const;
- /* 80271174 */ void operator+(cSAngle const&) const;
- /* 802711FC */ void operator+(s16) const;
- /* 802711D4 */ void operator+=(cSAngle const&);
- /* 80271254 */ void operator+=(s16);
- /* 802711E8 */ void operator-=(cSAngle const&);
- /* 80271264 */ void operator*(f32) const;
- /* 802712B4 */ void operator*=(f32);
-
- static u8 _0[2 + 2 /* padding */];
- static u8 _90[2 + 2 /* padding */];
- static u8 _180[2 + 2 /* padding */];
- static u8 _270[2 + 6 /* padding */];
-};
-
-struct dCamMapToolData {
- /* 8015FEB8 */ void Set(s32, s32, fopAc_ac_c*, u16, u8);
-};
-
-struct camera_class {};
-
-struct dBgS_LinChk {
- /* 80077D64 */ void Set(cXyz const*, cXyz const*, fopAc_ac_c const*);
-};
-
-struct dCamera_c {
- struct dCamInfo_c {
- /* 8018291C */ dCamInfo_c();
- /* 80182920 */ ~dCamInfo_c();
- };
-
- /* 8008908C */ void getEvIntData(int*, char*, int);
- /* 80088CB0 */ void getEvIntData(int*, char*);
- /* 80089154 */ void getEvFloatData(f32*, char*, f32);
- /* 80088D90 */ void getEvFloatData(f32*, char*);
- /* 8008933C */ void getEvStringData(char*, char*, char*);
- /* 800894C4 */ void getEvActor(char*);
- /* 800895F4 */ void getEvActor(char*, char*);
- /* 80089730 */ void pauseEvCamera();
- /* 800897E8 */ void fixedFrameEvCamera();
- /* 8008A510 */ void stokerEvCamera();
- /* 8008A974 */ void rollingEvCamera();
- /* 8008B9B0 */ void fixedPositionEvCamera();
- /* 8008BE2C */ void uniformTransEvCamera();
- /* 8008BE50 */ void uniformBrakeEvCamera();
- /* 8008BE74 */ void uniformAcceleEvCamera();
- /* 8008E938 */ void watchActorEvCamera();
- /* 8008FAE8 */ void restorePosEvCamera();
- /* 80090174 */ void talktoEvCamera();
- /* 80090230 */ void maptoolIdEvCamera();
- /* 80090478 */ void styleEvCamera();
- /* 80090514 */ void gameOverEvCamera();
- /* 80091468 */ void tactEvCamera();
- /* 800923B8 */ bool turnToActorEvCamera();
- /* 800923C0 */ void stbWaitEvCamera();
- /* 800924D0 */ void saveEvCamera();
- /* 8009258C */ void loadEvCamera();
- /* 800929AC */ void useItem0EvCamera();
- /* 800937AC */ void useItem1EvCamera();
- /* 80094240 */ void getItemEvCamera();
- /* 80094A70 */ void possessedEvCamera();
- /* 80095010 */ void fixedFramesEvCamera();
- /* 8009544C */ void bSplineEvCamera();
- /* 800956E4 */ void twoActor0EvCamera();
- /* 80095E7C */ void peepHoleEvCamera();
- /* 80095FD0 */ void digHoleEvCamera();
- /* 800965AC */ void hintTalkEvCamera();
- /* 80096EDC */ void bspTransEvCamera();
- /* 80097694 */ bool portalWarpEvCamera();
- /* 8009771C */ void attentionPos(fopAc_ac_c*);
- /* 80097738 */ void directionOf(fopAc_ac_c*);
- /* 8009775C */ void positionOf(fopAc_ac_c*);
- /* 80097778 */ void setFlag(u32);
- /* 8009778C */ void eyePos(fopAc_ac_c*);
- /* 8016008C */ dCamera_c(camera_class*);
- /* 80160304 */ ~dCamera_c();
- /* 80160470 */ void initialize(camera_class*, fopAc_ac_c*, u32, u32);
- /* 801614AC */ void Start();
- /* 801614C4 */ void QuickStart();
- /* 801614D0 */ void Stop();
- /* 801614E8 */ void Stay();
- /* 801614F4 */ void ChangeModeOK(s32);
- /* 80161550 */ void initPad();
- /* 801617B0 */ void updatePad();
- /* 80161D84 */ void initMonitor();
- /* 80161E34 */ void updateMonitor();
- /* 80162088 */ void checkForceLockTarget();
- /* 801622B0 */ void infoReport();
- /* 801622B4 */ void Run();
- /* 80162D38 */ void NotRun();
- /* 80162FB8 */ void V();
- /* 80162FD4 */ void U();
- /* 8016300C */ void SetTrimSize(s32);
- /* 80163028 */ void SetTrimTypeForce(s32);
- /* 80163034 */ void CalcTrimSize();
- /* 80163154 */ void Draw();
- /* 8016317C */ void setStageMapToolData();
- /* 80163340 */ void setMapToolData();
- /* 80163558 */ void SetTagData(fopAc_ac_c*, s32, u16, u8);
- /* 801635AC */ void setRoomMapToolData(dCamMapToolData*, s32, s32);
- /* 801635E4 */ void nextMode(s32);
- /* 80163C38 */ void onModeChange(s32, s32);
- /* 80163D50 */ void ModeFix(s32);
- /* 80163D5C */ void nextType(s32);
- /* 8016444C */ void onTypeChange(s32, s32);
- /* 8016469C */ void onStyleChange(s32, s32);
- /* 801647B0 */ void onRoomChange(s32);
- /* 80164878 */ void getParamTargetActor(s32);
- /* 80164944 */ void GetCameraTypeFromMapToolID(s32, s32);
- /* 80164B64 */ void GetCameraTypeFromCameraName(char const*);
- /* 80164C10 */ void GetCameraTypeFromToolData(stage_camera2_data_class*);
- /* 80164C64 */ void pushInfo(dCamera_c::dCamInfo_c*, s16);
- /* 80164CAC */ void popInfo(dCamera_c::dCamInfo_c*);
- /* 80164D2C */ void heightOf(fopAc_ac_c*);
- /* 80164E20 */ void relationalPos(fopAc_ac_c*, fopAc_ac_c*, cXyz*, f32);
- /* 80164D6C */ void relationalPos(fopAc_ac_c*, cXyz*);
- /* 80165104 */ void setUSOAngle();
- /* 80165158 */ void getUSOAngle(cSAngle);
- /* 8016517C */ void pointInSight(cXyz*);
- /* 80167C24 */ void radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*);
- /* 80165238 */ void radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*, cXyz*, cXyz*, f32, s16, f32);
- /* 801657EC */ void groundHeight(cXyz*);
- /* 801658C0 */ void lineBGCheck(cXyz*, cXyz*, dBgS_LinChk*, u32);
- /* 80165AF0 */ void lineBGCheck(cXyz*, cXyz*, u32);
- /* 801659F4 */ void lineBGCheck(cXyz*, cXyz*, cXyz*, u32);
- /* 80165B60 */ void lineCollisionCheckBush(cXyz*, cXyz*);
- /* 80165CE0 */ void compWallMargin(cXyz*, cXyz*, f32);
- /* 80165EF4 */ void defaultTriming();
- /* 80165FB4 */ void setView(f32, f32, f32, f32);
- /* 8016608C */ void forwardCheckAngle();
- /* 80166764 */ void bumpCheck(u32);
- /* 80167BF8 */ void lineBGCheckBoth(cXyz*, cXyz*, dBgS_LinChk*, u32);
- /* 80167CD8 */ void jutOutCheck(cXyz*, f32);
- /* 80167E3C */ void tooNearEscape(cXyz*);
- /* 80167EF4 */ void getWaterSurfaceHeight(cXyz*);
- /* 80167FEC */ void checkGroundInfo();
- /* 80168744 */ void chaseCamera(s32);
- /* 8016C384 */ void lockonCamera(s32);
- /* 8016E448 */ void getMsgCmdSpeaker();
- /* 8016E4A4 */ void getMsgCmdCut(s32);
- /* 8016E4F4 */ void talktoCamera(s32);
- /* 80174E18 */ void talkBasePos(fopAc_ac_c*);
- /* 80174E34 */ void talkEyePos(fopAc_ac_c*);
- /* 80174EA4 */ bool CalcSubjectAngle(s16*, s16*);
- /* 80174EAC */ void SaveZoomRatio();
- /* 80174ED4 */ void subjectCamera(s32);
- /* 80176074 */ void magneCamera(s32);
- /* 801767F8 */ void colosseumCamera(s32);
- /* 80176DF0 */ bool test1Camera(s32);
- /* 80176DF8 */ bool test2Camera(s32);
- /* 80176E00 */ void towerCamera(s32);
- /* 80178E50 */ void hookshotCamera(s32);
- /* 80179590 */ void railCamera(s32);
- /* 8017A2A0 */ void paraRailCamera(s32);
- /* 8017ADC0 */ void rideCamera(s32);
- /* 8017D974 */ bool manualCamera(s32);
- /* 8017D97C */ void observeCamera(s32);
- /* 8017DFAC */ void fixedFrameCamera(s32);
- /* 8017E730 */ void fixedPositionCamera(s32);
- /* 8017F25C */ void oneSideCamera(s32);
- /* 8017F828 */ void eventCamera(s32);
- /* 8018050C */ void currentEvCamera();
- /* 801806D4 */ bool letCamera(s32);
- /* 801806DC */ void setEventRecoveryTrans(s16);
- /* 80180738 */ void runEventRecoveryTrans();
- /* 80180A40 */ void EventRecoverNotime();
- /* 80180AA8 */ void Set(cXyz, cXyz);
- /* 80180AE0 */ void Set(cXyz, cXyz, f32, s16);
- /* 80180B40 */ void Set(cXyz, cXyz, s16, f32);
- /* 80180C18 */ void Reset(cXyz, cXyz);
- /* 80180C68 */ void Reset();
- /* 80180BA0 */ void Reset(cXyz, cXyz, f32, s16);
- /* 80180D24 */ void shakeCamera();
- /* 80181000 */ void StartShake(s32, u8*, s32, cXyz);
- /* 80181158 */ void StopShake();
- /* 80181170 */ void StartBlure(int, fopAc_ac_c*, f32, f32);
- /* 801811B8 */ void ResetBlure();
- /* 80181208 */ void SetBlureAlpha(f32);
- /* 80181210 */ void SetBlureScale(f32, f32, f32);
- /* 80181220 */ void SetBlurePosition(f32, f32, f32);
- /* 80181278 */ void SetBlureActor(fopAc_ac_c*);
- /* 80181280 */ void blureCamera();
- /* 80181490 */ void onHorseDush();
- /* 80181500 */ void GetForceLockOnActor();
- /* 80181534 */ void ForceLockOn(fopAc_ac_c*);
- /* 80181560 */ void ForceLockOff(unsigned int);
- /* 8018159C */ void ForceLockOff(fopAc_ac_c*);
- /* 80181E20 */ void Up();
- /* 80181E64 */ void Eye();
- /* 80181E98 */ void Center();
- /* 8018295C */ void footHeightOf(fopAc_ac_c*);
- /* 80182964 */ void push_any_key();
- /* 8018296C */ void clrFlag(u32);
- /* 80182980 */ void chkFlag(u32);
- /* 801829AC */ void Bank();
-
- static u8 engine_tbl[240];
-};
-
struct dCamSetup_c {
/* 80088668 */ dCamSetup_c();
/* 800888B8 */ ~dCamSetup_c();
@@ -486,14 +216,6 @@ struct dBgS_RoofChk {
/* 80079090 */ ~dBgS_RoofChk();
};
-struct dBgS_PolyPassChk {
- /* 80078E68 */ void SetObj();
- /* 80078E74 */ void ClrObj();
- /* 80078E80 */ void SetCam();
- /* 80078E8C */ void ClrCam();
- /* 80078EEC */ void SetUnderwaterRoof();
-};
-
struct dBgS_GndChk {
/* 8007757C */ dBgS_GndChk();
/* 800775F0 */ ~dBgS_GndChk();
@@ -503,10 +225,7 @@ struct dBgS_CamSphChk {
/* 80165E74 */ ~dBgS_CamSphChk();
};
-struct dBgS_CamLinChk {
- /* 80077DA4 */ dBgS_CamLinChk();
- /* 80077E00 */ ~dBgS_CamLinChk();
-};
+struct cBgD_Vtx_t;
struct dBgS_CamGndChk_Wtr {
/* 80077A00 */ dBgS_CamGndChk_Wtr();
@@ -517,10 +236,6 @@ struct dBgS_CamGndChk {
/* 80077988 */ ~dBgS_CamGndChk();
};
-struct cBgS_PolyInfo {};
-
-struct csXyz {};
-
struct dBgS {
/* 80074ABC */ void ChkMoveBG(cBgS_PolyInfo const&);
/* 80074EF0 */ void GetGroundCode(cBgS_PolyInfo const&);
@@ -552,31 +267,6 @@ struct d2DBSplinePath {
struct camera_process_class {};
-struct cSPolar {
- /* 802716EC */ void Xyz() const;
-};
-
-struct cSGlobe {
- /* 8007167C */ ~cSGlobe();
- /* 8008E774 */ void operator=(cSGlobe const&);
- /* 80182C84 */ void U() const;
- /* 8008E894 */ void U(cSAngle const&);
- /* 80182A08 */ void V() const;
- /* 8008FA58 */ void V(cSAngle const&);
- /* 8016E420 */ cSGlobe();
- /* 80271820 */ cSGlobe(f32, s16, s16);
- /* 80271880 */ cSGlobe(cXyz const&);
- /* 802717F0 */ cSGlobe(cSGlobe const&);
- /* 80271850 */ cSGlobe(f32, cSAngle const&, cSAngle const&);
- /* 80182A64 */ void R() const;
- /* 80182A4C */ void R(f32);
- /* 802719A4 */ void Val(f32, s16, s16);
- /* 80271A08 */ void Val(f32, cSAngle const&, cSAngle const&);
- /* 80271A70 */ void Val(cXyz const&);
- /* 80271AB4 */ void Xyz() const;
- /* 80271B7C */ void Invert();
-};
-
struct cM_rnd_c {
/* 80053CDC */ void init(int, int, int);
};
@@ -585,51 +275,11 @@ struct cM3dGSph {
/* 8026F664 */ void Set(cXyz const&, f32);
};
-struct cM3dGPla {
- /* 8001DB90 */ ~cM3dGPla();
- /* 801411F0 */ cM3dGPla();
- /* 801829EC */ void GetNP();
-};
-
-struct cM3dGLin {
- /* 80036A5C */ ~cM3dGLin();
- /* 8026F2A8 */ cM3dGLin(cXyz const&, cXyz const&);
- /* 8026F31C */ void SetStartEnd(Vec const&, Vec const&);
-};
-
struct cM3dGCyl {
/* 80030E3C */ ~cM3dGCyl();
/* 8026F0A8 */ cM3dGCyl(cXyz const*, f32, f32);
};
-struct cDegree {
- /* 800882E0 */ ~cDegree();
- /* 8027134C */ cDegree(f32);
- /* 80271418 */ void Cos() const;
- /* 80271440 */ void Tan() const;
-};
-
-struct cBgS_LinChk {
- /* 801829F0 */ void GetCross();
-};
-
-struct cBgS_GndChk {
- /* 80267D28 */ void SetPos(cXyz const*);
-};
-
-struct cBgS {
- /* 800743B4 */ void LineCross(cBgS_LinChk*);
- /* 800744A0 */ void GroundCross(cBgS_GndChk*);
- /* 80074618 */ void GetActorPointer(int) const;
- /* 80074744 */ void GetTriPla(cBgS_PolyInfo const&, cM3dGPla*) const;
-};
-
-struct cBgD_Vtx_t {};
-
-struct cAngle {
- /* 80182D28 */ void d2s(f32);
-};
-
struct Z2StatusMgr {
/* 802B6760 */ void setCameraPolygonPos(Vec*);
/* 802B6784 */ void setCameraGroupInfo(u8);
@@ -1139,17 +789,6 @@ extern "C" void setCameraGroupInfo__11Z2StatusMgrFUc();
extern "C" void setCameraInWaterDepth__11Z2StatusMgrFf();
extern "C" void setAudioCamera__10Z2AudienceFPA4_fR3VecR3Vecffbib();
extern "C" void __dl__FPv();
-extern "C" void PSMTXCopy();
-extern "C" void PSMTXInverse();
-extern "C" void PSMTXTrans();
-extern "C" void PSMTXMultVec();
-extern "C" void PSMTXMultVecSR();
-extern "C" void C_MTXPerspective();
-extern "C" void PSVECAdd();
-extern "C" void PSVECSubtract();
-extern "C" void PSVECSquareMag();
-extern "C" void PSVECDotProduct();
-extern "C" void PSVECCrossProduct();
extern "C" void __register_global_object();
extern "C" void __destroy_arr();
extern "C" void __construct_array();
@@ -1179,15 +818,11 @@ extern "C" void _restgpr_26();
extern "C" void _restgpr_27();
extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
-extern "C" void strncmp();
-extern "C" void strcmp();
-extern "C" void tan();
extern "C" u8 const tempBitLabels__20dSv_event_tmp_flag_c[370 + 2 /* padding */];
extern "C" extern u8 g_mDoMtx_identity[48 + 24 /* padding */];
extern "C" extern void* __vt__8cM3dGPla[3];
extern "C" extern void* g_fopCam_Method[5 + 1 /* padding */];
extern "C" extern void* g_fopVw_Method[5 + 1 /* padding */];
-extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" extern void* __vt__12dDlst_base_c[3];
extern "C" extern void* __vt__8cM3dGLin[3];
extern "C" extern void* __vt__8cM3dGSph[3];
@@ -1198,13 +833,10 @@ extern "C" u8 now__14mDoMtx_stack_c[48];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" f32 Zero__4cXyz[3];
extern "C" u8 BaseY__4cXyz[12];
-extern "C" extern u8 j3dSys[284];
extern "C" extern u8 g_dComIfGoat_gameInfo[4 + 4 /* padding */];
-extern "C" extern u32 __float_nan;
extern "C" extern u8 data_80450B44[4];
extern "C" extern u8 struct_80450BE4[4];
extern "C" u8 stopStatus__10fopAc_ac_c[4];
-extern "C" extern u8 struct_80450D64[4];
extern "C" u8 m_object__7dDemo_c[4];
extern "C" u8 m_midnaActor__9daPy_py_c[4];
extern "C" u8 _0__7cSAngle[2 + 2 /* padding */];
@@ -3220,7 +2852,8 @@ static asm void func_8016C25C() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cSAngle::Val() const {
+// asm void cSAngle::Val() const {
+extern "C" asm void Val__7cSAngleCFv() {
nofralloc
#include "asm/d/d_camera/Val__7cSAngleCFv.s"
}
@@ -3328,7 +2961,8 @@ static asm void func_8016E410() {
#pragma pop
/* 8016E420-8016E424 168D60 0004+00 2/2 0/0 0/0 .text __ct__7cSGlobeFv */
-cSGlobe::cSGlobe() {
+// cSGlobe::cSGlobe() {
+extern "C" asm void __ct__7cSGlobeFv() {
/* empty function */
}
@@ -4189,7 +3823,7 @@ asm void dCam_getCamera() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void dCam_getBody() {
+asm dCamera_c* dCam_getBody() {
nofralloc
#include "asm/d/d_camera/dCam_getBody__Fv.s"
}
@@ -4253,7 +3887,7 @@ asm void dCamera_c::Eye() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void dCamera_c::Center() {
+asm cXyz dCamera_c::Center() {
nofralloc
#include "asm/d/d_camera/Center__9dCamera_cFv.s"
}
@@ -4632,7 +4266,8 @@ static asm void dComIfG_Bgsp() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cSGlobe::V() const {
+// asm void cSGlobe::V() const {
+extern "C" asm void V__7cSGlobeCFv() {
nofralloc
#include "asm/d/d_camera/V__7cSGlobeCFv.s"
}
@@ -4670,7 +4305,8 @@ asm void std::fabsf(f32 param_0) {
#pragma pop
/* 80182A48-80182A4C 17D388 0004+00 2/2 0/0 0/0 .text __ct__7cSAngleFv */
-cSAngle::cSAngle() {
+// cSAngle::cSAngle() {
+extern "C" asm void __ct__7cSAngleFv() {
/* empty function */
}
@@ -4678,7 +4314,8 @@ cSAngle::cSAngle() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cSGlobe::R(f32 param_0) {
+// asm void cSGlobe::R(f32 param_0) {
+extern "C" asm void R__7cSGlobeFf() {
nofralloc
#include "asm/d/d_camera/R__7cSGlobeFf.s"
}
@@ -4698,7 +4335,8 @@ static asm void dComIfGp_evmng_cameraPlay() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cSGlobe::R() const {
+// asm void cSGlobe::R() const {
+extern "C" asm void R__7cSGlobeCFv() {
nofralloc
#include "asm/d/d_camera/R__7cSGlobeCFv.s"
}
@@ -4708,7 +4346,8 @@ asm void cSGlobe::R() const {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm bool cSAngle::operator<(cSAngle const& param_0) const {
+// asm bool cSAngle::operator<(cSAngle const& param_0) const {
+extern "C" asm bool __lt__7cSAngleCFRC7cSAngle() {
nofralloc
#include "asm/d/d_camera/__lt__7cSAngleCFRC7cSAngle.s"
}
@@ -4718,7 +4357,8 @@ asm bool cSAngle::operator<(cSAngle const& param_0) const {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm bool cSAngle::operator>(cSAngle const& param_0) const {
+// asm bool cSAngle::operator>(cSAngle const& param_0) const {
+extern "C" asm bool __gt__7cSAngleCFRC7cSAngle() {
nofralloc
#include "asm/d/d_camera/__gt__7cSAngleCFRC7cSAngle.s"
}
@@ -4838,7 +4478,8 @@ asm void mDoCPd_c::getTrigA(u32 param_0) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cSAngle::__ops() const {
+// asm void cSAngle::__ops() const {
+extern "C" asm void __ops__7cSAngleCFv() {
nofralloc
#include "asm/d/d_camera/__ops__7cSAngleCFv.s"
}
@@ -4953,7 +4594,8 @@ void dCamParam_c::Fovy(u8 param_0) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cSGlobe::U() const {
+// asm void cSGlobe::U() const {
+extern "C" asm void U__7cSGlobeCFv() {
nofralloc
#include "asm/d/d_camera/U__7cSGlobeCFv.s"
}
@@ -4973,7 +4615,8 @@ asm void dCamParam_c::Flag(s32 param_0, u16 param_1) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cSAngle::operator=(cSAngle const& param_0) {
+// asm void cSAngle::operator=(cSAngle const& param_0) {
+extern "C" asm void __as__7cSAngleFRC7cSAngle() {
nofralloc
#include "asm/d/d_camera/__as__7cSAngleFRC7cSAngle.s"
}
@@ -5064,7 +4707,8 @@ asm void daHorse_c::checkTurnStandCamera() const {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cAngle::d2s(f32 param_0) {
+// asm void cAngle::d2s(f32 param_0) {
+extern "C" asm void d2s__6cAngleFf() {
nofralloc
#include "asm/d/d_camera/d2s__6cAngleFf.s"
}
@@ -5084,7 +4728,8 @@ asm void daHorse_c::checkJump() const {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-static asm void fopAcM_GetParam(void const* param_0) {
+// static asm void fopAcM_GetParam(void const* param_0) {
+extern "C" static asm void fopAcM_GetParam__FPCv() {
nofralloc
#include "asm/d/d_camera/fopAcM_GetParam__FPCv.s"
}
@@ -5116,7 +4761,8 @@ asm void daTagMhint_c::checkNoAttention() const {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void cXyz::set(f32 param_0, f32 param_1, f32 param_2) {
+// asm void cXyz::set(f32 param_0, f32 param_1, f32 param_2) {
+extern "C" asm void set__4cXyzFfff() {
nofralloc
#include "asm/d/d_camera/set__4cXyzFfff.s"
}
diff --git a/src/d/event/d_event.cpp b/src/d/event/d_event.cpp
index bd2455821b..efa6e95b28 100644
--- a/src/d/event/d_event.cpp
+++ b/src/d/event/d_event.cpp
@@ -203,7 +203,7 @@ dEvt_order_c::dEvt_order_c() {
*/
bool dEvt_control_c::orderOld(u16 param_0, u16 param_1, u16 param_2, u16 param_3, void* param_4,
void* param_5, void const* param_6) {
- s16 eventIdx = dComIfGp_getEventManager().getEventIdx((char*)param_6, -1, -1);
+ int eventIdx = dComIfGp_getEventManager().getEventIdx((char*)param_6, -1, -1);
return order(param_0, param_1, param_2, param_3, param_4, param_5, eventIdx, -1);
}
@@ -657,13 +657,12 @@ void dEvt_control_c::remove() {
/* 80043278-80043280 03DBB8 0008+00 2/2 2/2 0/0 .text getStageEventDt__14dEvt_control_cFv
*/
-// ret type probably wrong, fix later
-void* dEvt_control_c::getStageEventDt() {
+dStage_MapEvent_dt_c* dEvt_control_c::getStageEventDt() {
return mStageEventDt;
}
-void dEvt_control_c::sceneChange(int param_0) {
- dStage_changeScene4Event__FiScibfUlsi(param_0, field_0x12c, -1, field_0x129, 0.0f, 0, 0, -1);
+void dEvt_control_c::sceneChange(int exitId) {
+ dStage_changeScene4Event__FiScibfUlsi(exitId, field_0x12c, -1, field_0x129, 0.0f, 0, 0, -1);
}
u32 dEvt_control_c::getPId(void* param_0) {
@@ -676,14 +675,14 @@ u32 dEvt_control_c::getPId(void* param_0) {
/* 800432EC-8004331C 03DC2C 0030+00 7/7 13/13 16/16 .text convPId__14dEvt_control_cFUi */
#ifdef NONMATCHING
-void dEvt_control_c::convPId(unsigned int param_0) {
- fopAcIt_Judge(fpcSch_JudgeByID, (void*)param_0);
+void* dEvt_control_c::convPId(unsigned int param_0) {
+ return fopAcIt_Judge(fpcSch_JudgeByID, (void*)param_0);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void dEvt_control_c::convPId(unsigned int param_0) {
+asm void* dEvt_control_c::convPId(unsigned int param_0) {
nofralloc
#include "asm/d/event/d_event/convPId__14dEvt_control_cFUi.s"
}
@@ -720,14 +719,15 @@ void dEvt_info_c::setEventName(char* param_0) {
}
/* 80043480-800434CC 03DDC0 004C+00 1/1 0/0 0/0 .text getEventName__11dEvt_info_cFv */
-// fake match?
-s16 dEvt_info_c::getEventName() {
+char* dEvt_info_c::getEventName() {
if (mEventId == -1) {
return 0;
} else {
dEvDtEvent_c* data = dComIfGp_getEventManager().getEventData(mEventId);
if (data == NULL) {
return 0;
+ } else {
+ return data->getName();
}
}
}
@@ -737,15 +737,15 @@ void dEvt_info_c::beforeProc() {
}
/* 800434D8-80043500 03DE18 0028+00 0/0 4/4 1/1 .text searchMapEventData__14dEvt_control_cFUc */
-void dEvt_control_c::searchMapEventData(u8 param_0) {
- searchMapEventData(param_0, (s32)struct_80450D64);
+dStage_MapEvent_dt_c* dEvt_control_c::searchMapEventData(u8 param_0) {
+ return searchMapEventData(param_0, (s32)struct_80450D64);
}
/* 80043500-8004360C 03DE40 010C+00 3/3 7/7 5/5 .text searchMapEventData__14dEvt_control_cFUcl */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void dEvt_control_c::searchMapEventData(u8 param_0, s32 param_1) {
+asm dStage_MapEvent_dt_c* dEvt_control_c::searchMapEventData(u8 param_0, s32 param_1) {
nofralloc
#include "asm/d/event/d_event/searchMapEventData__14dEvt_control_cFUcl.s"
}
diff --git a/src/d/event/d_event_data.cpp b/src/d/event/d_event_data.cpp
index e52bbfe19d..6545d61c9a 100644
--- a/src/d/event/d_event_data.cpp
+++ b/src/d/event/d_event_data.cpp
@@ -417,7 +417,7 @@ void dEvDtFlag_c::init() {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void dEvDtEvent_c::finishCheck() {
+asm int dEvDtEvent_c::finishCheck() {
nofralloc
#include "asm/d/event/d_event_data/finishCheck__12dEvDtEvent_cFv.s"
}
diff --git a/src/d/event/d_event_manager.cpp b/src/d/event/d_event_manager.cpp
index e8e0db6958..d3da00c8f6 100644
--- a/src/d/event/d_event_manager.cpp
+++ b/src/d/event/d_event_manager.cpp
@@ -4,34 +4,14 @@
//
#include "d/event/d_event_manager.h"
+#include "SSystem/SComponent/c_math.h"
+#include "Z2AudioLib/Z2AudioMgr.h"
#include "d/com/d_com_inf_game.h"
+#include "d/d_camera.h"
+#include "d/d_stage.h"
#include "dol2asm.h"
#include "dolphin/types.h"
-
-//
-// Types:
-//
-
-struct dCamera_c {
- /* 80180A40 */ void EventRecoverNotime();
- /* 80181E98 */ void Center();
-};
-
-struct Z2StatusMgr {
- /* 802B61E8 */ void setDemoName(char*);
-};
-
-struct Z2SeMgr {
- /* 802AB984 */ void seStart(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8);
-};
-
-struct Z2AudioMgr {
- static u8 mAudioMgrPtr[4 + 4 /* padding */];
-};
-
-struct JMath {
- static u8 sincosTable_[65536];
-};
+#include "m_Do/m_Do_audio.h"
//
// Forward References:
@@ -154,6 +134,18 @@ extern "C" u8 mDemoArcName__20dStage_roomControl_c[10 + 2 /* padding */];
extern "C" u8 sincosTable___5JMath[65536];
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
+inline dEvent_manager_c& dComIfGp_getEventManager() {
+ return g_dComIfG_gameInfo.play.getEvtManager();
+}
+
+inline dEvt_control_c& dComIfGp_getEvent() {
+ return g_dComIfG_gameInfo.play.getEvent();
+}
+
+BOOL daPy_py_c::checkNowWolf() {
+ return dComIfGp_getLinkPlayer()->i_checkWolf();
+}
+
//
// Declarations:
//
@@ -164,57 +156,62 @@ void dEvent_exception_c::init() {
}
/* 800463F0-80046480 040D30 0090+00 0/0 2/2 0/0 .text setStartDemo__18dEvent_exception_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_exception_c::setStartDemo(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/setStartDemo__18dEvent_exception_cFi.s"
+s32 dEvent_exception_c::setStartDemo(int index) {
+ int tmp = dComIfGp_roomControl_getStayNo();
+ dStage_MapEvent_dt_c* eventData = dEvt_control_c::searchMapEventData(index, tmp);
+ if (eventData != NULL && eventData->field_0x1B != 0xFF &&
+ dComIfGs_isSwitch(eventData->field_0x1B, tmp)) {
+ return 0xFF;
+ } else if (mEventInfoIdx != index) {
+ mEventInfoIdx = index;
+ }
+ return index;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_80379F60 = "NORMAL_COMEBACK";
-SECTION_DEAD static char const* const stringBase_80379F70 = "DEFAULT_START";
-SECTION_DEAD static char const* const stringBase_80379F7E = "SHUTTER_START";
-SECTION_DEAD static char const* const stringBase_80379F8C = "SHUTTER_START_STOP";
-SECTION_DEAD static char const* const stringBase_80379F9F = "BS_SHUTTER_START";
-SECTION_DEAD static char const* const stringBase_80379FB0 = "BS_SHUTTER_START_B";
-SECTION_DEAD static char const* const stringBase_80379FC3 = "KNOB_START";
-SECTION_DEAD static char const* const stringBase_80379FCE = "KNOB_START_B";
-SECTION_DEAD static char const* const stringBase_80379FDB = "FMASTER_START";
-SECTION_DEAD static char const* const stringBase_80379FE9 = "FALL_START";
-SECTION_DEAD static char const* const stringBase_80379FF4 = "CRAWLOUT_START";
-SECTION_DEAD static char const* const stringBase_8037A003 = "BOSSWARP_START";
-SECTION_DEAD static char const* const stringBase_8037A012 = "PORTALWARP_START";
-SECTION_DEAD static char const* const stringBase_8037A023 = "PORTALWARP_START_B";
-SECTION_DEAD static char const* const stringBase_8037A036 = "(!NO REGIST!)";
-SECTION_DEAD static char const* const stringBase_8037A044 = "(!NO INFO!)";
-SECTION_DEAD static char const* const stringBase_8037A050 = "(!BAD NUMBER!)";
-SECTION_DEAD static char const* const stringBase_8037A05F = "(MAP TOOL CAMERA)";
-SECTION_DEAD static char const* const stringBase_8037A071 = "(!BAD DATA!)";
-#pragma pop
-
-/* 803A8270-803A82A8 -00001 0038+00 1/1 0/0 0/0 .data soecial_names$3966 */
-SECTION_DATA static char* soecial_names[14] = {
- "NORMAL_COMEBACK", "DEFAULT_START", "SHUTTER_START", "SHUTTER_START_STOP",
- "BS_SHUTTER_START", "BS_SHUTTER_START_B", "KNOB_START", "KNOB_START_B",
- "FMASTER_START", "FALL_START", "CRAWLOUT_START", "BOSSWARP_START",
- "PORTALWARP_START", "PORTALWARP_START_B",
-};
/* 80046480-800465E8 040DC0 0168+00 1/1 0/0 0/0 .text getEventName__18dEvent_exception_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_exception_c::getEventName() {
- nofralloc
-#include "asm/d/event/d_event_manager/getEventName__18dEvent_exception_cFv.s"
+const char* dEvent_exception_c::getEventName() {
+ /* 803A8270-803A82A8 -00001 0038+00 1/1 0/0 0/0 .data soecial_names$3966 */
+ static char* soecial_names[14] = {
+ "NORMAL_COMEBACK", "DEFAULT_START", "SHUTTER_START", "SHUTTER_START_STOP",
+ "BS_SHUTTER_START", "BS_SHUTTER_START_B", "KNOB_START", "KNOB_START_B",
+ "FMASTER_START", "FALL_START", "CRAWLOUT_START", "BOSSWARP_START",
+ "PORTALWARP_START", "PORTALWARP_START_B",
+ };
+ s32 roomNo = dComIfGp_roomControl_getStayNo();
+ dStage_roomStatus_c* roomStatus = dComIfGp_roomControl_getStatusRoomDt(roomNo);
+ dStage_MapEventInfo_c* eventInfo = roomStatus->mRoomDt.getMapEventInfo();
+ if (mEventInfoIdx == -1) {
+ return "(!NO REGIST!)";
+ }
+ if (0xC8 < mEventInfoIdx && mEventInfoIdx < 0xD7) {
+ if (mEventInfoIdx == 0xCB) {
+ dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo());
+ } else if (mEventInfoIdx == 0xD5) {
+ switch (dComIfGp_SelectWarpPt_get()) {
+ case 3:
+ mEventInfoIdx = 0xD6;
+ }
+ }
+ return soecial_names[mEventInfoIdx - 0xC9];
+ } else {
+ if (eventInfo == NULL) {
+ return "(!NO INFO!)";
+ }
+ if (mEventInfoIdx < 0 || mEventInfoIdx > eventInfo->mCount) {
+ return "(!BAD NUMBER!)";
+ }
+ dStage_MapEvent_dt_c* revt = &eventInfo->mData[mEventInfoIdx];
+ switch (revt->mType) {
+ case 1:
+ case 2:
+ return revt->mName;
+ case 0:
+ return "(MAP TOOL CAMERA)";
+ default:
+ return "(!BAD DATA!)";
+ }
+ }
}
-#pragma pop
/* 800465E8-80046688 040F28 00A0+00 1/1 0/0 0/0 .text
* getSubstance__16dEvent_manager_cFP11dEvDtData_ci */
@@ -240,28 +237,18 @@ dEvent_manager_c::dEvent_manager_c() {
mDataLoaded = false;
}
-dEvDtBase_c::dEvDtBase_c() {
- init();
-}
-
/* ############################################################################################## */
/* 80379F50-80379F60 0065B0 000F+01 6/6 0/0 0/0 .rodata
* DataFileName__29@unnamed@d_event_manager_cpp@ */
-SECTION_RODATA static char const data_80379F50[16] = "event_list.dat";
-
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A07E = "Event";
-#pragma pop
+static char const DataFileName[] = "event_list.dat";
/* 80046710-80046800 041050 00F0+00 0/0 1/1 0/0 .text create__16dEvent_manager_cFv */
int dEvent_manager_c::create() {
mCameraPlay = 0;
mEventException.init();
mFlags.init();
- field_0x1b4 = 0;
- field_0x1aa = -1;
+ mCurrentEventType = 0;
+ mCurrentEventCompositId = -1;
field_0x1b8 = 0;
mRoomNo = -1;
mDataLoaded = 0;
@@ -270,9 +257,9 @@ int dEvent_manager_c::create() {
mEventList[i].init();
}
- mEventList[3].init((char*)dComIfG_getStageRes(data_80379F50), -1);
+ mEventList[3].init((char*)dComIfG_getStageRes(DataFileName), -1);
mEventList[10].init();
- mEventList[1].init((char*)dComIfG_getObjectRes("Event", data_80379F50), -1);
+ mEventList[1].init((char*)dComIfG_getObjectRes("Event", DataFileName), -1);
mEventList[2].init();
return 1;
}
@@ -282,7 +269,7 @@ bool dEvent_manager_c::setObjectArchive(char* param_0) {
char* rt = NULL;
if (param_0 != NULL) {
- char* res = (char*)dComIfG_getObjectRes(param_0, data_80379F50);
+ char* res = (char*)dComIfG_getObjectRes(param_0, DataFileName);
rt = res;
mEventList[2].init(res, -1);
} else {
@@ -292,54 +279,45 @@ bool dEvent_manager_c::setObjectArchive(char* param_0) {
}
/* 80046888-80046904 0411C8 007C+00 0/0 1/1 0/0 .text demoInit__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::demoInit() {
- nofralloc
-#include "asm/d/event/d_event_manager/demoInit__16dEvent_manager_cFv.s"
+void dEvent_manager_c::demoInit() {
+ if (mDataLoaded == false) {
+ if (dStage_roomControl_c::getDemoArcName()[0] != '\0') {
+ mEventList[10].init(
+ (char*)dComIfG_getObjectRes(dStage_roomControl_c::getDemoArcName(), DataFileName),
+ -1);
+ }
+ mDataLoaded = true;
+ }
}
-#pragma pop
/* 80046904-800469EC 041244 00E8+00 0/0 1/1 0/0 .text roomInit__16dEvent_manager_cFi */
-// reversed reg alloc
-#ifdef NONMATCHING
void dEvent_manager_c::roomInit(int roomNo) {
if (roomNo == -1) {
roomNo = dComIfGp_roomControl_getStayNo();
}
char arc_name[8];
strcpy(arc_name, dComIfG_getRoomArcName(roomNo));
- char* data = (char*)dComIfG_getStageRes(arc_name, data_80379F50);
+ char* data = (char*)dComIfG_getStageRes(arc_name, DataFileName);
- int tmp = -1;
- for (int i = 4; i <= 9; i++) {
+ int i;
+ int eventIdx = -1;
+ for (i = 4; i <= 9; i++) {
if (mEventList[i].getHeaderP() == NULL) {
- tmp = i;
+ eventIdx = i;
continue;
}
if (mEventList[i].roomNo() == roomNo) {
- tmp = i;
+ eventIdx = i;
break;
}
}
- if (tmp != -1) {
- mEventList[tmp].init(data, roomNo);
+ if (eventIdx != -1) {
+ mEventList[eventIdx].init(data, roomNo);
}
mRoomNo = roomNo;
}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::roomInit(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/roomInit__16dEvent_manager_cFi.s"
-}
-#pragma pop
-#endif
void dEvent_manager_c::roomFinish(int param_0) {
for (int i = 4; i <= 9; i++) {
@@ -349,23 +327,31 @@ void dEvent_manager_c::roomFinish(int param_0) {
}
}
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A084 = "WOLF_WORLD_CHANGE_OUT";
-SECTION_DEAD static char const* const stringBase_8037A09A = "WORLD_CHANGE_OUT";
-#pragma pop
-
/* 80046A58-80046C0C 041398 01B4+00 0/0 1/1 0/0 .text orderStartDemo__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::orderStartDemo() {
- nofralloc
-#include "asm/d/event/d_event_manager/orderStartDemo__16dEvent_manager_cFv.s"
+int dEvent_manager_c::orderStartDemo() {
+ BOOL success = FALSE;
+ if (mEventException.mEventInfoIdx == -2) {
+ return -2;
+ }
+ s16 eventIdx;
+ if (0xC8 < mEventException.mEventInfoIdx && mEventException.mEventInfoIdx < 0xD7) {
+ eventIdx = this->getEventIdx(mEventException.getEventName(), -1, -1);
+ success = fopAcM_orderOtherEventId(NULL, eventIdx, 0xFF, 0xFFFF, 5, 1);
+ } else if (mEventException.mEventInfoIdx != -1 && mEventException.mEventInfoIdx != 0xFF) {
+ u8 eventInfoIdx = mEventException.mEventInfoIdx;
+ eventIdx = this->getEventIdx(NULL, eventInfoIdx, -1);
+ success = fopAcM_orderMapToolAutoNextEvent(NULL, eventInfoIdx, eventIdx, 0xFFFF, 1, 5);
+ } else if (dComIfGp_getStartStagePoint() == -2 || dComIfGp_getStartStagePoint() == -3) {
+ eventIdx = this->getEventIdx(
+ daPy_py_c::checkNowWolf() ? "WOLF_WORLD_CHANGE_OUT" : "WORLD_CHANGE_OUT", 0xFF, -1);
+ success = fopAcM_orderOtherEventId(NULL, eventIdx, 0xFF, 0xFFFF, 5, 1);
+ }
+ if (success == FALSE) {
+ eventIdx = this->getEventIdx("DEFAULT_START", 0xFF, -1);
+ fopAcM_orderOtherEventId(NULL, eventIdx, 0xFF, 0xFFFF, 5, 1);
+ }
+ return eventIdx;
}
-#pragma pop
void dEvent_manager_c::remove() {
for (int i = 0; i < 11; i++) {
@@ -423,74 +409,184 @@ void dEvent_manager_c::closeProc(dEvDtEvent_c* p_evnt) {
p_evnt->mEventState = 2;
}
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A0AB = "ALL";
-#pragma pop
-
/* 80046DAC-80046E64 0416EC 00B8+00 0/0 2/2 0/0 .text endProc__16dEvent_manager_cFsi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::endProc(s16 param_0, int param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/endProc__16dEvent_manager_cFsi.s"
+void dEvent_manager_c::endProc(s16 param_0, int param_1) {
+ dEvDtEvent_c* event = this->getEventData(param_0);
+ if (event != NULL) {
+ if (param_1 != 0) {
+ this->closeProc(event);
+ }
+ if (event->mEventState == 2) {
+ char* param = "ALL";
+ fopAcM_Search((fopAcIt_JudgeFunc)allOffObjectCallBack, (void*)param);
+ mCameraPlay = 2;
+ event->mEventState = 0;
+ mCurrentEventType = 0;
+ mCurrentEventCompositId = -1;
+ dComIfGp_getEvent().setPtD(NULL);
+ dComIfGp_getEvent().setPtI(NULL);
+ }
+ }
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 80451F00-80451F08 000500 0004+04 1/1 0/0 0/0 .sdata2 @4398 */
-SECTION_SDATA2 static f32 lit_4398[1 + 1 /* padding */] = {
- 0.0f,
- /* padding */
- 0.0f,
-};
-
-/* 80451F08-80451F10 000508 0008+00 1/1 0/0 0/0 .sdata2 @4399 */
-SECTION_SDATA2 static f64 lit_4399 = 0.5;
-
-/* 80451F10-80451F18 000510 0008+00 1/1 0/0 0/0 .sdata2 @4400 */
-SECTION_SDATA2 static f64 lit_4400 = 3.0;
-
-/* 80451F18-80451F20 000518 0008+00 1/1 0/0 0/0 .sdata2 @4401 */
-SECTION_SDATA2 static u8 lit_4401[8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-/* 80451F20-80451F24 000520 0004+00 1/1 0/0 0/0 .sdata2 @4402 */
-SECTION_SDATA2 static f32 lit_4402 = 180.0f;
-
-/* 80451F24-80451F28 000524 0004+00 1/1 0/0 0/0 .sdata2 @4403 */
-SECTION_SDATA2 static f32 lit_4403 = 1.0f;
-
-/* 80451F28-80451F2C 000528 0004+00 1/1 0/0 0/0 .sdata2 @4404 */
-SECTION_SDATA2 static f32 lit_4404 = -1.0f;
/* 80046E64-800473FC 0417A4 0598+00 0/0 1/1 0/0 .text Sequencer__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::Sequencer() {
- nofralloc
-#include "asm/d/event/d_event_manager/Sequencer__16dEvent_manager_cFv.s"
+void dEvent_manager_c::Sequencer() {
+ dEvt_control_c& evtControl = dComIfGp_getEvent();
+ dEvDtEvent_c* event = this->getEventData(mCurrentEventCompositId);
+ dStage_MapEvent_dt_c* mapEvent = evtControl.getStageEventDt();
+ if (event != NULL) {
+ if (evtControl.chkEventFlag(0x100)) {
+ char* name = NULL;
+ if (mapEvent != NULL) {
+ switch (mapEvent->mType) {
+ case 0:
+ default:
+ break;
+ case 1:
+ case 2:
+ name = mapEvent->mName;
+ break;
+ }
+ if (dStage_MapEvent_dt_c_getEventSCutSW(mapEvent) != 0 && !evtControl.chkFlag2(2)) {
+ if (dStage_MapEvent_dt_c_getEventSCutType(mapEvent) == 2) {
+ evtControl.onSkipFade();
+ }
+ void* actor = evtControl.getPt1();
+ if (actor == NULL) {
+ actor = evtControl.getPt2();
+ }
+ if (actor == NULL) {
+ actor = dComIfGp_getPlayer(0);
+ }
+ if (actor != NULL) {
+ switch (mapEvent->mType) {
+ case 2:
+ evtControl.setSkipProc(actor, dEv_defaultSkipStb, 0);
+ break;
+ case 1:
+ evtControl.setSkipProc(actor, dEv_defaultSkipZev, 0);
+ break;
+ case 0:
+ evtControl.setSkipProc(actor, dEv_defaultSkipProc, 0);
+ break;
+ }
+ }
+ }
+ }
+ Z2GetAudioMgr()->mStatusMgr.setDemoName(name);
+ }
+ if (event->finishCheck() != 0) {
+ bool bVar1 = false;
+ if (evtControl.chkFlag2(1)) {
+ bVar1 = true;
+ }
+ int exit = -1;
+ bool iVar5;
+ if (evtControl.chkFlag2(2)) {
+ iVar5 = true;
+ } else {
+ iVar5 = false;
+ }
+ if (mapEvent != NULL) {
+ int cutType = dStage_MapEvent_dt_c_getEventSCutType(mapEvent);
+ if (iVar5 && cutType != 1) {
+ bVar1 = true;
+ cXyz attentionPos(
+ ((fopAc_ac_c*)dComIfGp_getPlayer(0))->mAttentionInfo.mPosition);
+ cXyz camCenter = dCam_getBody()->Center();
+ f32 distance = cXyz((attentionPos - camCenter)).abs();
+ if (cutType == 0) {
+ if (distance > 180) {
+ dCam_getBody()->EventRecoverNotime();
+ }
+ } else {
+ switch (mapEvent->field_0x3) {
+ case 1:
+ case 2:
+ if (distance > 180) {
+ dCam_getBody()->EventRecoverNotime();
+ }
+ break;
+ case 3:
+ dCam_getBody()->EventRecoverNotime();
+ break;
+ }
+ }
+ }
+ switch (mapEvent->mType) {
+ case 0:
+ switch (mapEvent->field_0x18) {
+ case 1:
+ mDoAud_seStart(0xC, NULL, 0, 0);
+ break;
+ case 2:
+ mDoAud_seStart(0xD, NULL, 0, 0);
+ break;
+ }
+ if (!bVar1) {
+ if (iVar5 && mapEvent->field_0x9 != 0xFF) {
+ exit = mapEvent->field_0x9;
+ evtControl.sceneChange(exit);
+ } else if (mapEvent->field_0x17 != 0xFF) {
+ exit = mapEvent->field_0x17;
+ evtControl.sceneChange(exit);
+ }
+ }
+ break;
+ case 2:
+ if (!bVar1) {
+ if (iVar5 && mapEvent->field_0x9 != 0xFF) {
+ exit = mapEvent->field_0x9;
+ evtControl.sceneChange(exit);
+ } else if (mapEvent->field_0x7 != 0xFF) {
+ exit = mapEvent->field_0x7;
+ evtControl.sceneChange(exit);
+ }
+ }
+ break;
+ case 1:
+ if (!bVar1) {
+ if (iVar5 && mapEvent->field_0x9 != 0xFF) {
+ exit = mapEvent->field_0x9;
+ evtControl.sceneChange(exit);
+ } else if (mapEvent->field_0x7 != 0xFF) {
+ exit = mapEvent->field_0x7;
+ evtControl.sceneChange(exit);
+ }
+ }
+ break;
+ }
+ }
+ if (exit == -1) {
+ getBase().advanceCut(event);
+ closeProc(event);
+ evtControl.reset();
+ }
+ } else {
+ if (event->mEventState == 1) {
+ getBase().advanceCut(event);
+ }
+ }
+ if (field_0x1b8 != 0) {
+ field_0x1b8--;
+ }
+ } else {
+ if (evtControl.chkEventFlag(0x100)) {
+ Z2GetAudioMgr()->mStatusMgr.setDemoName(NULL);
+ }
+ }
}
-#pragma pop
/* 800473FC-80047454 041D3C 0058+00 0/0 1/1 0/0 .text Experts__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::Experts() {
- nofralloc
-#include "asm/d/event/d_event_manager/Experts__16dEvent_manager_cFv.s"
+void dEvent_manager_c::Experts() {
+ dEvDtEvent_c* event = this->getEventData(mCurrentEventCompositId);
+ if (event != NULL && event->mEventState == 1) {
+ event->specialStaffProc(this->getBase().getStaffP(0));
+ }
}
-#pragma pop
/* 80047454-800474BC 041D94 0068+00 1/1 0/0 0/0 .text getEventData__16dEvent_manager_cFsi
*/
-#ifdef NONMATCHING
dEvDtEvent_c* dEvent_manager_c::getEventData(s16 param_0, int idx) {
if (idx <= 0 || idx > 11) {
return NULL;
@@ -502,218 +598,369 @@ dEvDtEvent_c* dEvent_manager_c::getEventData(s16 param_0, int idx) {
} else if (param_0 < 0 || param_0 >= base->getEventNum()) {
return NULL;
} else {
- return base->getEventP(idx);
+ return base->getEventP(param_0);
}
}
return NULL;
}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm dEvDtEvent_c* dEvent_manager_c::getEventData(s16 param_0, int param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/getEventData__16dEvent_manager_cFsi.s"
-}
-#pragma pop
-#endif
/* 800474BC-80047514 041DFC 0058+00 9/9 3/3 4/4 .text getEventData__16dEvent_manager_cFs
*/
+#ifdef NONMATCHING
+dEvDtEvent_c* dEvent_manager_c::getEventData(s16 eventCompositId) {
+ if (param_0 == -1) {
+ return NULL;
+ } else {
+ // extsh instead of mr here
+ return this->getEventData(getIndexCompositId(param_0), getTypeCompositId(param_0));
+ }
+}
+#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm dEvDtEvent_c* dEvent_manager_c::getEventData(s16 param_0) {
+asm dEvDtEvent_c* dEvent_manager_c::getEventData(s16 eventCompositId) {
nofralloc
#include "asm/d/event/d_event_manager/getEventData__16dEvent_manager_cFs.s"
}
#pragma pop
-
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A0AF = "MapToolCamera%d";
-#pragma pop
-
-/* 804246A0-804246B4 0513C0 0011+03 1/1 0/0 0/0 .bss map_tool_name$4449 */
-static u8 map_tool_name_4449[17 + 3 /* padding */];
+#endif
/* 80047514-80047698 041E54 0184+00 3/3 8/8 3/3 .text getEventIdx__16dEvent_manager_cFPCcUcl */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm int dEvent_manager_c::getEventIdx(char const* param_0, u8 param_1, s32 param_2) {
- nofralloc
-#include "asm/d/event/d_event_manager/getEventIdx__16dEvent_manager_cFPCcUcl.s"
+s16 dEvent_manager_c::getEventIdx(char const* eventName, u8 param_1, s32 roomNo) {
+ if (roomNo == -1) {
+ roomNo = dComIfGp_roomControl_getStayNo();
+ }
+ if (param_1 != 0xFF) {
+ dStage_MapEvent_dt_c* data = dEvt_control_c::searchMapEventData(param_1, roomNo);
+ if (data != NULL) {
+ switch (data->mType) {
+ case 1:
+ case 2:
+ return getEventIdx(data->mName, 0xFF, roomNo);
+ case 0:
+ static char map_tool_name[17];
+ sprintf(map_tool_name, "MapToolCamera%d", param_1);
+ return getEventIdx(map_tool_name, 0xFF, roomNo);
+ }
+ }
+ }
+ if (eventName == NULL) {
+ return -1;
+ }
+ dEvDtBase_c* event;
+ int j;
+ int i;
+ for (i = ARRAY_SIZE(mEventList) - 1; i >= 1; i--) {
+ if (i < 4 || 9 < i || roomNo == mEventList[i].roomNo()) {
+ event = &mEventList[i];
+ if (event->getHeaderP() != NULL) {
+ for (j = 0; j < event->getHeaderP()->eventNum; j++) {
+ if (strcmp(eventName, event->getEventName(j)) == 0) {
+ return makeCompositId(j, i);
+ }
+ }
+ }
+ }
+ }
+ return -1;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 804246B4-804246C8 0513D4 0011+03 1/1 0/0 0/0 .bss map_tool_name$4498 */
-static u8 map_tool_name_4498[17 + 3 /* padding */];
/* 80047698-80047758 041FD8 00C0+00 0/0 3/3 25/25 .text
* getEventIdx__16dEvent_manager_cFP10fopAc_ac_cUc */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getEventIdx(fopAc_ac_c* param_0, u8 param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/getEventIdx__16dEvent_manager_cFP10fopAc_ac_cUc.s"
+s16 dEvent_manager_c::getEventIdx(fopAc_ac_c* pActor, u8 param_1) {
+ dStage_MapEvent_dt_c* data = dEvt_control_c::searchMapEventData(param_1, pActor->getRoomNo());
+ if (data != NULL) {
+ switch (data->mType) {
+ case 1:
+ case 2:
+ return getEventIdx(pActor, data->mName, 0xFF);
+ case 0:
+ static char map_tool_name[17];
+ sprintf(map_tool_name, "MapToolCamera%d", param_1);
+ return getEventIdx(pActor, map_tool_name, 0xFF);
+ }
+ }
+ return -1;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 804246C8-804246E0 0513E8 0011+07 1/1 0/0 0/0 .bss map_tool_name$4511 */
-static u8 map_tool_name_4511[17 + 7 /* padding */];
/* 80047758-80047930 042098 01D8+00 1/1 10/10 92/92 .text
* getEventIdx__16dEvent_manager_cFP10fopAc_ac_cPCcUc */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getEventIdx(fopAc_ac_c* param_0, char const* param_1, u8 param_2) {
- nofralloc
-#include "asm/d/event/d_event_manager/getEventIdx__16dEvent_manager_cFP10fopAc_ac_cPCcUc.s"
+s16 dEvent_manager_c::getEventIdx(fopAc_ac_c* pActor, char const* eventName, u8 param_2) {
+ s8 actorRoomNo = pActor->getRoomNo();
+ if (param_2 != 0xFF) {
+ dStage_MapEvent_dt_c* data = dEvt_control_c::searchMapEventData(param_2, actorRoomNo);
+ if (data != NULL) {
+ switch (data->mType) {
+ case 1:
+ case 2:
+ return getEventIdx(pActor, data->mName, 0xFF);
+ case 0:
+ static char map_tool_name[17];
+ sprintf(map_tool_name, "MapToolCamera%d", param_2);
+ return getEventIdx(pActor, map_tool_name, 0xFF);
+ }
+ }
+ }
+ if (eventName == NULL) {
+ return -1;
+ }
+ dEvDtBase_c* event;
+ int j;
+ int type;
+ for (type = ARRAY_SIZE(mEventList) - 1; type >= 1; type--) {
+ dEvDtBase_c* eventP = &mEventList[type];
+ dEvDtBase_c event;
+ if (type < 4 || 9 < type || actorRoomNo == mEventList[type].roomNo()) {
+ if (pActor != NULL && type == 2 && pActor->mEvtInfo.getArchiveName() != NULL) {
+ event.init(
+ (char*)dComIfG_getObjectRes(pActor->mEvtInfo.getArchiveName(), DataFileName),
+ -1);
+ eventP = &event;
+ }
+ if (eventP->getHeaderP() != NULL) {
+ for (j = 0; j < eventP->getHeaderP()->eventNum; j++) {
+ if (strcmp(eventName, eventP->getEventName(j)) == 0) {
+ return makeCompositId(j, type);
+ }
+ }
+ }
+ }
+ }
+ return -1;
}
-#pragma pop
/* 80047930-80047984 042270 0054+00 0/0 0/0 1/1 .text isMapToolCamera__16dEvent_manager_cFUcl */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::isMapToolCamera(u8 param_0, s32 param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/isMapToolCamera__16dEvent_manager_cFUcl.s"
+int dEvent_manager_c::isMapToolCamera(u8 param_0, s32 roomNo) {
+ if (roomNo == -1) {
+ roomNo = dComIfGp_roomControl_getStayNo();
+ }
+ dStage_MapEvent_dt_c* data = dEvt_control_c::searchMapEventData(param_0, roomNo);
+ if (data != NULL) {
+ return data->mType == 0;
+ } else {
+ return 0;
+ }
}
-#pragma pop
/* 80047984-800479F8 0422C4 0074+00 0/0 6/6 0/0 .text order__16dEvent_manager_cFs */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::order(s16 param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/order__16dEvent_manager_cFs.s"
+int dEvent_manager_c::order(s16 eventCompositId) {
+ dEvDtEvent_c* event = this->getEventData(eventCompositId);
+ if (event == NULL) {
+ return 0;
+ } else {
+ mCurrentEventType = getTypeCompositId(eventCompositId);
+ mCurrentEventCompositId = eventCompositId;
+ this->startProc(event);
+ return 1;
+ }
}
-#pragma pop
/* 800479F8-80047A38 042338 0040+00 1/1 0/0 9/9 .text startCheck__16dEvent_manager_cFs */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::startCheck(s16 param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/startCheck__16dEvent_manager_cFs.s"
+int dEvent_manager_c::startCheck(s16 eventCompositId) {
+ dEvDtEvent_c* event = this->getEventData(eventCompositId);
+ if (event == NULL) {
+ return 0;
+ } else {
+ if (event->mEventState == 1) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
}
-#pragma pop
/* 80047A38-80047A78 042378 0040+00 0/0 2/2 0/0 .text startCheckOld__16dEvent_manager_cFPCc */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::startCheckOld(char const* param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/startCheckOld__16dEvent_manager_cFPCc.s"
+int dEvent_manager_c::startCheckOld(char const* pName) {
+ return this->startCheck(this->getEventIdx(pName, 0xFF, -1));
}
-#pragma pop
/* 80047A78-80047ADC 0423B8 0064+00 1/1 2/2 122/122 .text endCheck__16dEvent_manager_cFs
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::endCheck(s16 param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/endCheck__16dEvent_manager_cFs.s"
+int dEvent_manager_c::endCheck(s16 param_0) {
+ dEvDtEvent_c* event = this->getEventData(dComIfGp_getEvent().runningEventID(param_0));
+ if (event == NULL) {
+ return 0;
+ } else {
+ if (event->mEventState == 2) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
}
-#pragma pop
/* 80047ADC-80047B1C 04241C 0040+00 0/0 2/2 10/10 .text endCheckOld__16dEvent_manager_cFPCc */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::endCheckOld(char const* param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/endCheckOld__16dEvent_manager_cFPCc.s"
+int dEvent_manager_c::endCheckOld(char const* pName) {
+ return this->endCheck(this->getEventIdx(pName, 0xFF, -1));
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A0BF = "Alink";
-SECTION_DEAD static char const* const stringBase_8037A0C5 = "Link";
-#pragma pop
/* 80047B1C-80047D4C 04245C 0230+00 1/1 10/10 210/210 .text
* getMyStaffId__16dEvent_manager_cFPCcP10fopAc_ac_ci */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm s32 dEvent_manager_c::getMyStaffId(char const* param_0, fopAc_ac_c* param_1, int param_2) {
- nofralloc
-#include "asm/d/event/d_event_manager/getMyStaffId__16dEvent_manager_cFPCcP10fopAc_ac_ci.s"
+s32 dEvent_manager_c::getMyStaffId(char const* pStaffName, fopAc_ac_c* pActor, int tagId) {
+ int staffNum;
+ int i;
+ int evtIdx = -1;
+ if (dComIfGp_getEvent().getMode() == 0) {
+ return -1;
+ } else {
+ if (pActor != NULL) {
+ evtIdx = pActor->mEvtInfo.getIdx();
+ }
+ if (mCurrentEventCompositId == -1) {
+ return -1;
+ } else {
+ dEvDtEvent_c* event = this->getEventData(mCurrentEventCompositId);
+ if (event != NULL && (event->mEventState == 1 || event->mEventState == 2)) {
+ int staffCount = event->getNStaff();
+ bool hasDp = false;
+ if (strchr(pStaffName, ':') != NULL) {
+ hasDp = true;
+ }
+ for (i = 0; i < staffCount; i++) {
+ staffNum = event->getStaff(i);
+ dEvDtStaff_c* staff = getBase().getStaffP(staffNum);
+ if (staff->mType != 1) {
+ char buf[0x18];
+ strcpy(buf, staff->mName);
+ char* ptr = NULL;
+ if (!hasDp) {
+ char* tmpPtr = strchr(buf, ':');
+ ptr = tmpPtr;
+ if (tmpPtr != NULL) {
+ *tmpPtr = '\0';
+ ptr++;
+ }
+ }
+ if (strcmp(pStaffName, buf) == 0 && (tagId < 0 || tagId == staff->mTagID)) {
+ s16 num = 0;
+ if (ptr != NULL) {
+ char c;
+ while ((c = *ptr) != '\0') {
+ if (c < '0' || '9' < c) {
+ num = 0;
+ break;
+ }
+ num = c - '0' + num * 10;
+ ptr++;
+ }
+ if (evtIdx < 0 || num == evtIdx) {
+ return staffNum;
+ }
+ } else {
+ return staffNum;
+ }
+ }
+ if (strcmp(pStaffName, "Alink") == 0 && strcmp("Link", buf) == 0 &&
+ tagId == staff->mTagID) {
+ return staffNum;
+ }
+ }
+ }
+ }
+ }
+ }
+ return -1;
}
-#pragma pop
/* 80047D4C-80047DAC 04268C 0060+00 0/0 9/9 417/417 .text getIsAddvance__16dEvent_manager_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getIsAddvance(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/getIsAddvance__16dEvent_manager_cFi.s"
+int dEvent_manager_c::getIsAddvance(int param_0) {
+ if (dComIfGp_getEvent().getMode() == 0) {
+ return 0;
+ } else if (param_0 == -1) {
+ return 0;
+ } else if (mCurrentEventCompositId == -1) {
+ return 0;
+ } else {
+ return this->getBase().getStaffP(param_0)->field_0x40;
+ }
}
-#pragma pop
/* 80047DAC-80047E10 0426EC 0064+00 1/1 0/0 0/0 .text dEvmng_strcmp__FPCcPc */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void dEvmng_strcmp(char const* param_0, char* param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/dEvmng_strcmp__FPCcPc.s"
+static int dEvmng_strcmp(char const* param_0, char* param_1) {
+ u32 len = 0;
+ while (*param_0 != '\0') {
+ if (*param_1 == '\0') {
+ return 1;
+ }
+ if (len >= 100) {
+ return -1;
+ }
+ if (*param_0 != *param_1) {
+ return 1;
+ }
+ len++;
+ param_0++;
+ param_1++;
+ }
+ return 0;
}
-#pragma pop
/* 80047E10-80047F5C 042750 014C+00 1/1 1/1 118/118 .text
* getMyActIdx__16dEvent_manager_cFiPCPCciii */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getMyActIdx(int param_0, char const* const* param_1, int param_2,
- int param_3, int param_4) {
- nofralloc
-#include "asm/d/event/d_event_manager/getMyActIdx__16dEvent_manager_cFiPCPCciii.s"
-}
-#pragma pop
+int dEvent_manager_c::getMyActIdx(int param_0, char const* const* param_1, int param_2, int param_3,
+ int param_4) {
+ if (dComIfGp_getEvent().getMode() == 0) {
+ return 0;
+ } else if (param_0 == -1) {
+ return -1;
+ } else if (mCurrentEventCompositId == -1) {
+ return -1;
+ }
+ dEvDtStaff_c* staff = getBase().getStaffP(param_0);
+ if (staff) {
+ if (staff->field_0x41 != false && param_3 == 0) {
+ return staff->field_0x3c;
+ }
+ } else {
+ return -1;
+ }
-/* 80047F5C-80047FC8 04289C 006C+00 1/1 9/9 62/62 .text getMyNowCutName__16dEvent_manager_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getMyNowCutName(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/getMyNowCutName__16dEvent_manager_cFi.s"
+ int i;
+ char* nowCutName = this->getMyNowCutName(param_0);
+ if (nowCutName == NULL) {
+ staff->field_0x3c = -1;
+ return -1;
+ } else {
+ staff->field_0x41 = true;
+ for (i = 0; i < param_2; i++) {
+ if (param_4 != 0) {
+ if (dEvmng_strcmp(param_1[i], nowCutName) == 0) {
+ staff->field_0x3c = i;
+ return i;
+ }
+ } else {
+ if (strcmp(param_1[i], nowCutName) == 0) {
+ staff->field_0x3c = i;
+ return i;
+ }
+ }
+ }
+ staff->field_0x3c = -1;
+ }
+ return 0;
}
-#pragma pop
-inline dEvt_control_c& dComIfGp_getEvent() {
- return g_dComIfG_gameInfo.play.getEvent();
+/* 80047F5C-80047FC8 04289C 006C+00 1/1 9/9 62/62 .text getMyNowCutName__16dEvent_manager_cFi */
+char* dEvent_manager_c::getMyNowCutName(int index) {
+ if (dComIfGp_getEvent().getMode() == 0) {
+ return NULL;
+ } else if (index == -1) {
+ return NULL;
+ } else if (mCurrentEventCompositId == -1) {
+ return NULL;
+ } else {
+ return getBase().getCutStaffCurrentCutP(index)->getName();
+ }
}
/* 80047FC8-800480EC 042908 0124+00 2/2 0/0 0/0 .text getMyDataP__16dEvent_manager_cFiPCci */
-// instruction in wrong place
-#ifdef NONMATCHING
dEvDtData_c* dEvent_manager_c::getMyDataP(int index, char const* name, int type) {
if (dComIfGp_getEvent().getMode() == 0) {
return NULL;
} else if (index == -1) {
return NULL;
- } else if (field_0x1aa == -1) {
+ } else if (mCurrentEventCompositId == -1) {
return NULL;
} else {
dEvDtCut_c* cut;
@@ -725,7 +972,7 @@ dEvDtData_c* dEvent_manager_c::getMyDataP(int index, char const* name, int type)
int top = cut->getDataTop();
while (top != -1) {
- dEvDtData_c* data = getBase().getDataP(index);
+ dEvDtData_c* data = getBase().getDataP(top);
if (!strcmp(name, data->getName())) {
return data;
}
@@ -735,16 +982,6 @@ dEvDtData_c* dEvent_manager_c::getMyDataP(int index, char const* name, int type)
return NULL;
}
}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm dEvDtData_c* dEvent_manager_c::getMyDataP(int param_0, char const* param_1, int param_2) {
- nofralloc
-#include "asm/d/event/d_event_manager/getMyDataP__16dEvent_manager_cFiPCci.s"
-}
-#pragma pop
-#endif
/* 800480EC-80048144 042A2C 0058+00 0/0 22/22 355/355 .text
* getMySubstanceP__16dEvent_manager_cFiPCci */
@@ -758,17 +995,31 @@ void* dEvent_manager_c::getMySubstanceP(int index, char const* name, int type) {
/* 80048144-8004817C 042A84 0038+00 0/0 12/12 0/0 .text getMySubstanceNum__16dEvent_manager_cFiPCc
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getMySubstanceNum(int param_0, char const* param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/getMySubstanceNum__16dEvent_manager_cFiPCc.s"
+int dEvent_manager_c::getMySubstanceNum(int index, char const* name) {
+ dEvDtData_c* data = getMyDataP(index, name, 0);
+ if (data == NULL) {
+ return NULL;
+ } else {
+ return data->getNumber();
+ }
}
-#pragma pop
/* 8004817C-800481F4 042ABC 0078+00 1/1 78/78 182/182 .text cutEnd__16dEvent_manager_cFi
*/
+#ifdef NONMATCHING
+void dEvent_manager_c::cutEnd(int index) {
+ if (dComIfGp_getEvent().getMode() == 0) {
+ return;
+ } else if (index == -1) {
+ return;
+ } else if (field_0x1aa == -1) {
+ return;
+ } else {
+ // instruction swap
+ mFlags.flagSet(getBase().getCutStaffCurrentCutP(index)->getFlagId());
+ }
+}
+#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -777,176 +1028,189 @@ asm void dEvent_manager_c::cutEnd(int param_0) {
#include "asm/d/event/d_event_manager/cutEnd__16dEvent_manager_cFi.s"
}
#pragma pop
+#endif
/* 800481F4-800482CC 042B34 00D8+00 0/0 4/4 0/0 .text
* getEventPrio__16dEvent_manager_cFP10fopAc_ac_cs */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getEventPrio(fopAc_ac_c* param_0, s16 param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/getEventPrio__16dEvent_manager_cFP10fopAc_ac_cs.s"
+int dEvent_manager_c::getEventPrio(fopAc_ac_c* pActor, s16 eventCompositId) {
+ dEvDtEvent_c* event = NULL;
+ dEvDtBase_c eventBase;
+ if (getTypeCompositId(eventCompositId) == 2 && pActor != NULL &&
+ pActor->mEvtInfo.getArchiveName() != NULL) {
+ char* data = (char*)dComIfG_getObjectRes(pActor->mEvtInfo.getArchiveName(), DataFileName);
+ eventBase.init(data, -1);
+ event = eventBase.mEventP;
+ }
+ if (event == NULL) {
+ event = getEventData(eventCompositId);
+ }
+ if (event == NULL) {
+ return 0;
+ } else {
+ return event->getPriority();
+ }
}
-#pragma pop
/* 800482CC-80048348 042C0C 007C+00 1/1 1/1 0/0 .text issueStaff__16dEvent_manager_cFPCc
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::issueStaff(char const* param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/issueStaff__16dEvent_manager_cFPCc.s"
+void dEvent_manager_c::issueStaff(char const* pName) {
+ if (!strcmp(pName, "ALL")) {
+ fopAcM_Search((fopAcIt_JudgeFunc)extraOnObjectCallBack, NULL);
+ } else {
+ char nameBuf[0x20];
+ strcpy(nameBuf, pName);
+ fopAcM_OnStatus(fopAcM_searchFromName4Event(nameBuf, -1), 0x800);
+ }
}
-#pragma pop
/* 80048348-800483C4 042C88 007C+00 0/0 1/1 0/0 .text cancelStaff__16dEvent_manager_cFPCc
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::cancelStaff(char const* param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/cancelStaff__16dEvent_manager_cFPCc.s"
+void dEvent_manager_c::cancelStaff(char const* pName) {
+ if (!strcmp(pName, "ALL")) {
+ fopAcM_Search((fopAcIt_JudgeFunc)extraOffObjectCallBack, NULL);
+ } else {
+ char nameBuf[0x20];
+ strcpy(nameBuf, pName);
+ fopAcM_OffStatus(fopAcM_searchFromName4Event(nameBuf, -1), 0x800);
+ }
}
-#pragma pop
/* 800483C4-800483E0 042D04 001C+00 1/1 2/2 38/38 .text setGoal__16dEvent_manager_cFP4cXyz */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::setGoal(cXyz* param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/setGoal__16dEvent_manager_cFP4cXyz.s"
+void dEvent_manager_c::setGoal(cXyz* pGoal) {
+ mGoal = *pGoal;
}
-#pragma pop
/* 800483E0-800483E8 042D20 0008+00 0/0 1/1 1/1 .text getGoal__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getGoal() {
- nofralloc
-#include "asm/d/event/d_event_manager/getGoal__16dEvent_manager_cFv.s"
+cXyz* dEvent_manager_c::getGoal() {
+ return &mGoal;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A0CA = "NO DATA";
-SECTION_DEAD static char const* const stringBase_8037A0D2 = "NOT RUNNING";
-#pragma pop
/* 800483E8-8004846C 042D28 0084+00 0/0 5/5 27/27 .text getRunEventName__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::getRunEventName() {
- nofralloc
-#include "asm/d/event/d_event_manager/getRunEventName__16dEvent_manager_cFv.s"
+const char* dEvent_manager_c::getRunEventName() {
+ if (mCurrentEventCompositId == -1) {
+ return "NO DATA";
+ }
+ if (getBase().getHeaderP() == NULL) {
+ return "NO DATA";
+ }
+ dEvDtEvent_c* event = getEventData(mCurrentEventCompositId);
+ if (event != NULL && event->mEventState == 1) {
+ return event->getName();
+ } else {
+ return "NOT RUNNING";
+ }
}
-#pragma pop
-/* ############################################################################################## */
-/* 80451F2C-80451F30 00052C 0004+00 1/1 0/0 0/0 .sdata2 @5025 */
-SECTION_SDATA2 static f32 lit_5025 = 10.0f;
-
-/* 80451F30-80451F34 000530 0004+00 1/1 0/0 0/0 .sdata2 @5026 */
-SECTION_SDATA2 static f32 lit_5026 = -10.0f;
+struct FindShtrCbPrms {
+ s16 mBsTypeId;
+ fopAc_ac_c* mActor;
+};
/* 8004846C-80048520 042DAC 00B4+00 1/1 0/0 0/0 .text findShutterCallBack__FP10fopAc_ac_cPv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void findShutterCallBack(fopAc_ac_c* param_0, void* param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/findShutterCallBack__FP10fopAc_ac_cPv.s"
+static fopAc_ac_c* findShutterCallBack(fopAc_ac_c* pActor, void* param_1) {
+ FindShtrCbPrms* prms = (FindShtrCbPrms*)param_1;
+ if (prms->mBsTypeId != fpcAcM_GetProfName(pActor)) {
+ return NULL;
+ }
+ cXyz diff = pActor->mOrig.mPosition - prms->mActor->mOrig.mPosition;
+ if (diff.x < 10 && diff.x > -10 && diff.y < 10 && diff.y > -10 && diff.z < 10 && diff.z > -10) {
+ return pActor;
+ }
+ return NULL;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 80451F34-80451F38 000534 0004+00 1/1 0/0 0/0 .sdata2 @5055 */
-SECTION_SDATA2 static f32 lit_5055 = 100.0f;
/* 80048520-80048618 042E60 00F8+00 1/1 0/0 0/0 .text specialCast_Shutter__16dEvent_manager_cFsi
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::specialCast_Shutter(s16 param_0, int param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/specialCast_Shutter__16dEvent_manager_cFsi.s"
+fopAc_ac_c* dEvent_manager_c::specialCast_Shutter(s16 bsTypeId, int param_1) {
+ FindShtrCbPrms prms;
+ prms.mBsTypeId = bsTypeId;
+ prms.mActor = (fopAc_ac_c*)dComIfGp_getPlayer(0);
+ fopAc_ac_c* shutterActor =
+ (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)findShutterCallBack, &prms);
+ if (shutterActor != NULL && param_1 != 0) {
+ cXyz goal(shutterActor->mOrig.mPosition);
+ s16 angle = prms.mActor->mOrig.mAngle.y + 0x8000;
+ goal.x += cM_ssin(angle) * 100;
+ goal.z += cM_scos(angle) * 100;
+ this->setGoal(&goal);
+ dComIfGp_getEvent().setPt2(shutterActor);
+ dComIfGp_getEvent().setPtD(shutterActor);
+ }
+ return shutterActor;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A0DE = "SHUTTER_DOOR";
-#pragma pop
/* 80048618-80048748 042F58 0130+00 1/1 0/0 0/0 .text specialCast__16dEvent_manager_cFPCci */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm fopAc_ac_c* dEvent_manager_c::specialCast(char const* param_0, int param_1) {
- nofralloc
-#include "asm/d/event/d_event_manager/specialCast__16dEvent_manager_cFPCci.s"
+fopAc_ac_c* dEvent_manager_c::specialCast(char const* pName, int param_1) {
+ fopAc_ac_c* shutterActor = NULL;
+ if (pName == NULL) {
+ return NULL;
+ }
+ if (!strcmp(pName, "SHUTTER_DOOR")) {
+ shutterActor = specialCast_Shutter(0x226, param_1);
+ if (shutterActor == NULL) {
+ shutterActor = specialCast_Shutter(0x228, param_1);
+ }
+ if (shutterActor == NULL) {
+ shutterActor = specialCast_Shutter(0x229, param_1);
+ }
+ if (shutterActor == NULL) {
+ shutterActor = specialCast_Shutter(0x22A, param_1);
+ }
+ if (shutterActor == NULL) {
+ shutterActor = specialCast_Shutter(0x22B, param_1);
+ }
+ if (shutterActor != NULL) {
+ dComIfGp_getEvent().onEventFlag(0x10);
+ }
+ }
+ if (shutterActor != NULL) {
+ if (param_1 != 0) {
+ fopAcM_OnStatus(shutterActor, 0x1000);
+ } else {
+ fopAcM_OffStatus(shutterActor, 0x1000);
+ }
+ }
+ return shutterActor;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_8037A0EB = "WAIT";
-SECTION_DEAD static char const* const stringBase_8037A0F0 = "TALK0";
-SECTION_DEAD static char const* const stringBase_8037A0F6 = "TALK1";
-SECTION_DEAD static char const* const stringBase_8037A0FC = "TALKMAN";
-/* @stringBase0 padding */
-SECTION_DEAD static char const* const pad_8037A104 = "\0\0\0";
-#pragma pop
-
-/* 803A82A8-803A82B8 -00001 000C+04 1/1 0/0 0/0 .data action_table$5100 */
-SECTION_DATA static void* action_table[3 + 1 /* padding */] = {
- (void*)(((char*)&d_event_d_event_manager__stringBase0) + 0x18B),
- (void*)(((char*)&d_event_d_event_manager__stringBase0) + 0x190),
- (void*)(((char*)&d_event_d_event_manager__stringBase0) + 0x196),
- /* padding */
- NULL,
-};
/* 80048748-800487F0 043088 00A8+00 1/1 0/0 0/0 .text dEv_talkman_get_action__Fi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-static asm void dEv_talkman_get_action(int param_0) {
- nofralloc
-#include "asm/d/event/d_event_manager/dEv_talkman_get_action__Fi.s"
+static int dEv_talkman_get_action(int param_0) {
+ int staffId = dComIfGp_getEventManager().getMyStaffId("TALKMAN", NULL, -1);
+ if (staffId == -1) {
+ return -1;
+ } else {
+ /* 803A82A8-803A82B8 -00001 000C+04 1/1 0/0 0/0 .data action_table$5100 */
+ static char* action_table[] = {
+ "WAIT",
+ "TALK0",
+ "TALK1",
+ };
+ int actIdx = dComIfGp_getEventManager().getMyActIdx(staffId, action_table,
+ ARRAY_SIZE(action_table), 0, 0);
+ if (actIdx == param_0) {
+ dComIfGp_getEventManager().cutEnd(staffId);
+ }
+ return actIdx;
+ }
}
-#pragma pop
/* 800487F0-8004882C 043130 003C+00 0/0 0/0 108/108 .text ChkPresentEnd__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::ChkPresentEnd() {
- nofralloc
-#include "asm/d/event/d_event_manager/ChkPresentEnd__16dEvent_manager_cFv.s"
+int dEvent_manager_c::ChkPresentEnd() {
+ return dEv_talkman_get_action(0) >= 1;
}
-#pragma pop
/* 8004882C-8004886C 04316C 0040+00 0/0 2/2 2/2 .text checkStartDemo__16dEvent_manager_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dEvent_manager_c::checkStartDemo() {
- nofralloc
-#include "asm/d/event/d_event_manager/checkStartDemo__16dEvent_manager_cFv.s"
+int dEvent_manager_c::checkStartDemo() {
+ if (!dComIfGp_getEvent().runCheck()) {
+ return 0;
+ }
+ if (mEventException.mEventInfoIdx == -1) {
+ return 0;
+ }
+ if (mEventException.mEventInfoIdx == -2) {
+ return 0;
+ }
+ return 1;
}
-#pragma pop
/* 80379F60-80379F60 0065C0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */