From 8c4c08865b7f930e13a9cb31240f5458cd4289a2 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 5 Oct 2022 16:26:05 -0700 Subject: [PATCH] Almost forgot these Former-commit-id: 4ba459c8762b7f9ef0e40a34e0d5200d3ab4fba6 --- asm/Kyoto/Math/CloseEnough.s | 7 +++---- asm/MetroidPrime/BodyState/CBSHurled.s | 1 - asm/MetroidPrime/BodyState/CBSLocomotion.s | 1 - asm/MetroidPrime/BodyState/CBodyStateCmdMgr.s | 1 - asm/MetroidPrime/CGameArea.s | 1 - asm/MetroidPrime/CGameCollision.s | 1 - asm/MetroidPrime/PathFinding/CPathFindArea.s | 1 - asm/MetroidPrime/PathFinding/CPathFindSearch.s | 1 - asm/MetroidPrime/ScriptObjects/CScriptDistanceFog.s | 1 - configure.py | 1 + include/Kyoto/Math/CloseEnough.hpp | 4 ++-- obj_files.mk | 2 +- src/Kyoto/Math/CVector3f.cpp | 1 + 13 files changed, 8 insertions(+), 15 deletions(-) diff --git a/asm/Kyoto/Math/CloseEnough.s b/asm/Kyoto/Math/CloseEnough.s index 36f13092..77c04532 100644 --- a/asm/Kyoto/Math/CloseEnough.s +++ b/asm/Kyoto/Math/CloseEnough.s @@ -7,8 +7,8 @@ lbl_ctor: .section .sbss, "wa" .balign 8 -.global lbl_805A9440 -lbl_805A9440: +.global svector2_Identity +svector2_Identity: .skip 0x8 .section .text, "ax" @@ -69,7 +69,7 @@ __sinit_CloseEnough_cpp: /* 8030FFCC 0030CF2C 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8030FFD0 0030CF30 7C 08 02 A6 */ mflr r0 /* 8030FFD4 0030CF34 C0 22 C8 48 */ lfs f1, lbl_805AE568@sda21(r2) -/* 8030FFD8 0030CF38 38 6D A8 80 */ addi r3, r13, lbl_805A9440@sda21 +/* 8030FFD8 0030CF38 38 6D A8 80 */ addi r3, r13, svector2_Identity@sda21 /* 8030FFDC 0030CF3C 90 01 00 14 */ stw r0, 0x14(r1) /* 8030FFE0 0030CF40 FC 40 08 90 */ fmr f2, f1 /* 8030FFE4 0030CF44 48 00 42 1D */ bl __ct__9CVector2fFff @@ -85,4 +85,3 @@ lbl_805AE568: # ROM: 0x3FAE08 .4byte 0 .4byte 0 - diff --git a/asm/MetroidPrime/BodyState/CBSHurled.s b/asm/MetroidPrime/BodyState/CBSHurled.s index 3daa70fc..5bf5a3c0 100644 --- a/asm/MetroidPrime/BodyState/CBSHurled.s +++ b/asm/MetroidPrime/BodyState/CBSHurled.s @@ -1379,4 +1379,3 @@ lbl_805AB970: lbl_805AB978: # ROM: 0x3F8218 .double 4.503601774854144E15 - diff --git a/asm/MetroidPrime/BodyState/CBSLocomotion.s b/asm/MetroidPrime/BodyState/CBSLocomotion.s index 6349a1e8..85b07c2e 100644 --- a/asm/MetroidPrime/BodyState/CBSLocomotion.s +++ b/asm/MetroidPrime/BodyState/CBSLocomotion.s @@ -2812,4 +2812,3 @@ lbl_805AB770: lbl_805AB774: # ROM: 0x3F8014 .4byte 0x3E32B8C2 - diff --git a/asm/MetroidPrime/BodyState/CBodyStateCmdMgr.s b/asm/MetroidPrime/BodyState/CBodyStateCmdMgr.s index 63f53da1..e41d5b96 100644 --- a/asm/MetroidPrime/BodyState/CBodyStateCmdMgr.s +++ b/asm/MetroidPrime/BodyState/CBodyStateCmdMgr.s @@ -1171,4 +1171,3 @@ lbl_805AB6B0: lbl_805AB6B4: # ROM: 0x3F7F54 .float 1.0E-4 - diff --git a/asm/MetroidPrime/CGameArea.s b/asm/MetroidPrime/CGameArea.s index 39b09339..aee527d1 100644 --- a/asm/MetroidPrime/CGameArea.s +++ b/asm/MetroidPrime/CGameArea.s @@ -8036,4 +8036,3 @@ lbl_803CCFAC: .asciz "??(??)" .balign 4 .4byte 0 - diff --git a/asm/MetroidPrime/CGameCollision.s b/asm/MetroidPrime/CGameCollision.s index 56dadcb4..510310bc 100644 --- a/asm/MetroidPrime/CGameCollision.s +++ b/asm/MetroidPrime/CGameCollision.s @@ -6674,4 +6674,3 @@ lbl_803D0690: .asciz "ollidableAABox" .balign 4 .4byte 0 - diff --git a/asm/MetroidPrime/PathFinding/CPathFindArea.s b/asm/MetroidPrime/PathFinding/CPathFindArea.s index b3b8688c..872b46e2 100644 --- a/asm/MetroidPrime/PathFinding/CPathFindArea.s +++ b/asm/MetroidPrime/PathFinding/CPathFindArea.s @@ -2337,4 +2337,3 @@ lbl_803D1AA0: # ROM: 0x3CEAA0 .asciz "??(??)" .balign 4 - diff --git a/asm/MetroidPrime/PathFinding/CPathFindSearch.s b/asm/MetroidPrime/PathFinding/CPathFindSearch.s index d8b95c16..aec849b8 100644 --- a/asm/MetroidPrime/PathFinding/CPathFindSearch.s +++ b/asm/MetroidPrime/PathFinding/CPathFindSearch.s @@ -2588,4 +2588,3 @@ lbl_805AC858: # ROM: 0x3F90F8 .4byte 0x41200000 .4byte 0 - diff --git a/asm/MetroidPrime/ScriptObjects/CScriptDistanceFog.s b/asm/MetroidPrime/ScriptObjects/CScriptDistanceFog.s index 7399ce50..2fa8bce4 100644 --- a/asm/MetroidPrime/ScriptObjects/CScriptDistanceFog.s +++ b/asm/MetroidPrime/ScriptObjects/CScriptDistanceFog.s @@ -302,4 +302,3 @@ lbl_805ABA48: lbl_805ABA50: # ROM: 0x3F82F0 .double 9.999999747378752E-6 - diff --git a/configure.py b/configure.py index cea2eed7..cc5846d4 100755 --- a/configure.py +++ b/configure.py @@ -40,6 +40,7 @@ COMPLETE_OBJECTS = [ "Kyoto/Math/CVector2i", "Kyoto/Math/CVector3d", "Kyoto/Math/CVector3i", + "Kyoto/Math/CloseEnough", "Kyoto/CRandom16", "Kyoto/CCrc32", "Kyoto/Alloc/CCircularBuffer", diff --git a/include/Kyoto/Math/CloseEnough.hpp b/include/Kyoto/Math/CloseEnough.hpp index a6c9a1ec..22126b68 100644 --- a/include/Kyoto/Math/CloseEnough.hpp +++ b/include/Kyoto/Math/CloseEnough.hpp @@ -17,8 +17,8 @@ struct Double { static inline float vector3_epsilon() { return FLT_EPSILON; } static inline float vector2_epsilon() { return FLT_EPSILON; } -static bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = vector2_epsilon()); -static bool close_enough(const CVector3f& a, const CVector3f& b, float epsilon = vector3_epsilon()); +bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = vector2_epsilon()); +bool close_enough(const CVector3f& a, const CVector3f& b, float epsilon = vector3_epsilon()); inline bool close_enough(float a, float b, float epsilon = Real32::Epsilon()) { return fabs(a - b) < epsilon; } diff --git a/obj_files.mk b/obj_files.mk index 643040bc..e12aa592 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -513,7 +513,7 @@ KYOTO_1 :=\ $(BUILD_DIR)/asm/Kyoto/Graphics/DolphinCGraphics.o\ $(BUILD_DIR)/asm/Kyoto/Graphics/DolphinCPalette.o\ $(BUILD_DIR)/asm/Kyoto/Graphics/DolphinCTexture.o\ - $(BUILD_DIR)/asm/Kyoto/Math/CloseEnough.o\ + $(BUILD_DIR)/src/Kyoto/Math/CloseEnough.o\ $(BUILD_DIR)/asm/Kyoto/Math/CMatrix3f.o\ $(BUILD_DIR)/asm/Kyoto/Math/CMatrix4f.o\ $(BUILD_DIR)/asm/Kyoto/Math/CQuaternion.o\ diff --git a/src/Kyoto/Math/CVector3f.cpp b/src/Kyoto/Math/CVector3f.cpp index 35cb2ca9..7444329c 100644 --- a/src/Kyoto/Math/CVector3f.cpp +++ b/src/Kyoto/Math/CVector3f.cpp @@ -1,5 +1,6 @@ #include "Kyoto/Math/CVector3f.hpp" +#include "Kyoto/Math/CloseEnough.hpp" #include "Kyoto/Math/CMath.hpp" #include "Kyoto/Math/CRelAngle.hpp" #include "Kyoto/Streams/CInputStream.hpp"