Use horrible hack to fakematch weak order of f_op_actor_mng

This commit is contained in:
LagoLunatic
2024-01-24 17:22:44 -05:00
parent 26ebeb5396
commit 30ded8678e
3 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -285,7 +285,7 @@ config.libs = [
Object(Matching, "f_op/f_op_actor.cpp", extra_cflags=['-pragma "nosyminline on"']),
Object(Matching, "f_op/f_op_actor_iter.cpp"),
Object(Matching, "f_op/f_op_actor_tag.cpp"),
Object(NonMatching, "f_op/f_op_actor_mng.cpp", extra_cflags=['-pragma "nosyminline on"']),
Object(Matching, "f_op/f_op_actor_mng.cpp", extra_cflags=['-pragma "nosyminline on"']),
Object(Matching, "f_op/f_op_camera.cpp"),
Object(Matching, "f_op/f_op_camera_mng.cpp"),
Object(Matching, "f_op/f_op_overlap.cpp"),
+6 -3
View File
@@ -467,6 +467,9 @@ public:
void getRopeJumpLand() const {}
void checkRopeForceEnd() const {}
// This class's weak virtual functions tend to cause weak function ordering issues in TUs that use them.
// The proper way to match this is still unknown, so some of the definitions have been temporarily commented out
// here so that they can be fakematched instead.
virtual MtxP getLeftHandMatrix() = 0;
virtual MtxP getRightHandMatrix() = 0;
virtual f32 getGroundY() = 0;
@@ -478,7 +481,7 @@ public:
virtual BOOL checkFrontRoll() const { return FALSE; }
virtual BOOL checkBottleSwing() const { return FALSE; }
virtual BOOL checkCutCharge() const { return FALSE; }
virtual BOOL getBokoFlamePos(cXyz*) { return FALSE; }
virtual BOOL getBokoFlamePos(cXyz*);// { return FALSE; }
virtual BOOL checkTactWait() const { return FALSE; }
virtual void setTactZev(unsigned int, int, char*) {}
virtual void onDekuSpReturnFlg(u8) {}
@@ -487,14 +490,14 @@ public:
virtual f32 getBaseAnimeFrame() = 0;
virtual u32 getItemID() const { return -1; }
virtual u32 getThrowBoomerangID() const { return -1; }
virtual u32 getGrabActorID() const { return -1; }
virtual u32 getGrabActorID() const;// { return -1; }
virtual BOOL checkGrabBarrel() { return FALSE; }
virtual u32 checkPlayerNoDraw() { return FALSE; }
virtual BOOL checkRopeTag() { return FALSE; }
virtual BOOL checkRopeReadyAnime() const { return FALSE; }
virtual void voiceStart(u32) {}
virtual void setOutPower(f32, s16, int) {}
virtual void onFrollCrashFlg(u32) {}
virtual void onFrollCrashFlg(u32);// {}
virtual MtxP getModelJointMtx(u16) { return NULL; }
virtual f32 getOldSpeedY() { return 0.0f; }
virtual BOOL setHookshotCarryOffset(unsigned int, const cXyz*) { return FALSE; }
+8
View File
@@ -3,6 +3,14 @@
// Translation Unit: f_op_camera.cpp
//
// Fakematch: These are supposed to be weak functions declared in d_a_player.h that wind up at the end of the
// f_op_actor_mng TU. But weak function ordering is currently broken, so to get f_op_actor_mng to match, we define them
// here (at the start of the *next* TU after f_op_actor_mng) so that they get placed into the correct spot in
// the DOL, even though this is an ugly hack and they're now in the wrong translation unit instead.
#include "d/actor/d_a_player.h"
void daPy_py_c::onFrollCrashFlg(u32) {}
u32 daPy_py_c::getGrabActorID() const { return -1; }
#include "f_op/f_op_camera.h"
#include "f_op/f_op_draw_tag.h"
#include "dolphin/types.h"