summaryrefslogtreecommitdiff
path: root/src/d/d_spline_path.cpp
diff options
context:
space:
mode:
authorPheenoh <pheenoh@gmail.com>2023-03-09 01:26:11 -0700
committerGitHub <noreply@github.com>2023-03-09 01:26:11 -0700
commit500d079c40b17e52abf40ec32ad9457d384ce921 (patch)
treeee3f19edf83501d4cde46dafa386227c9437b05c /src/d/d_spline_path.cpp
parentf31ab5ae0be3de6e0910b2d5942e33458be043ac (diff)
d_eye_hl OK, d_spline_path and JASSeqReader work (#307)
Diffstat (limited to 'src/d/d_spline_path.cpp')
-rw-r--r--src/d/d_spline_path.cpp79
1 files changed, 34 insertions, 45 deletions
diff --git a/src/d/d_spline_path.cpp b/src/d/d_spline_path.cpp
index 3cbb089cfe..edd9ccbd9d 100644
--- a/src/d/d_spline_path.cpp
+++ b/src/d/d_spline_path.cpp
@@ -1,34 +1,13 @@
-//
-// Generated By: dol2asm
-// Translation Unit: d/d_spline_path
-//
+/**
+ * d_spline_path.cpp
+ * dolzel2 - Spline Path Management
+ */
#include "d/d_spline_path.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
-// Types:
-//
-
-struct dPath {};
-
-struct dPathCurve {
- /* 80097C5C */ void Init(dPath*);
- /* 80097C74 */ void bSpline2(f32);
-};
-
-struct cXyz {};
-
-struct d2DBSplinePath {
- /* 80097878 */ void Init(s32, s32);
- /* 80097904 */ void Step();
- /* 80097B20 */ void Calc(f32*);
- /* 80097A6C */ void Calc(cXyz*);
- /* 80097B68 */ void Spot(f32*, f32);
-};
-
-//
// Forward References:
//
@@ -41,12 +20,6 @@ extern "C" void Init__10dPathCurveFP5dPath();
extern "C" void bSpline2__10dPathCurveFf();
//
-// External References:
-//
-
-extern "C" void PSVECAdd();
-
-//
// Declarations:
//
@@ -55,6 +28,27 @@ extern "C" void PSVECAdd();
SECTION_SDATA2 static f64 lit_3632 = 4503601774854144.0 /* cast s32 to float */;
/* 80097878-80097904 0921B8 008C+00 0/0 7/7 0/0 .text Init__14d2DBSplinePathFll */
+#ifdef NONMATCHING
+// regalloc
+void d2DBSplinePath::Init(s32 param_0, s32 param_1) {
+ s32 tmp;
+ s32 tmp2;
+
+ field_0x00 = 0;
+ field_0x04 = param_0;
+ field_0x08 = 1;
+ field_0x0c = param_1;
+
+ if (field_0x0c != 0) {
+ tmp2 = field_0x0c - 1;
+ }
+
+ field_0x04 < 2 ? tmp = 1 : tmp = field_0x04 - 2;
+ field_0x10 = (f32)tmp / (f32)tmp2;
+
+ field_0x2c = 0;
+}
+#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@@ -63,6 +57,7 @@ asm void d2DBSplinePath::Init(s32 param_0, s32 param_1) {
#include "asm/d/d_spline_path/Init__14d2DBSplinePathFll.s"
}
#pragma pop
+#endif
/* ############################################################################################## */
/* 80452BD0-80452BD4 0011D0 0004+00 3/3 0/0 0/0 .sdata2 @3684 */
@@ -92,14 +87,11 @@ asm void d2DBSplinePath::Calc(cXyz* param_0) {
#pragma pop
/* 80097B20-80097B68 092460 0048+00 0/0 5/5 0/0 .text Calc__14d2DBSplinePathFPf */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void d2DBSplinePath::Calc(f32* param_0) {
- nofralloc
-#include "asm/d/d_spline_path/Calc__14d2DBSplinePathFPf.s"
+f32 d2DBSplinePath::Calc(f32* param_0) {
+ return field_0x14 * param_0[field_0x20] +
+ field_0x18 * param_0[field_0x24] +
+ field_0x1c * param_0[field_0x28];
}
-#pragma pop
/* 80097B68-80097C5C 0924A8 00F4+00 0/0 1/1 0/0 .text Spot__14d2DBSplinePathFPff */
#pragma push
@@ -112,14 +104,11 @@ asm void d2DBSplinePath::Spot(f32* param_0, f32 param_1) {
#pragma pop
/* 80097C5C-80097C74 09259C 0018+00 0/0 0/0 1/1 .text Init__10dPathCurveFP5dPath */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dPathCurve::Init(dPath* param_0) {
- nofralloc
-#include "asm/d/d_spline_path/Init__10dPathCurveFP5dPath.s"
+void dPathCurve::Init(dPath* i_path) {
+ mpPath = i_path;
+ field_0x00 = 1;
+ field_0x04 = 0;
}
-#pragma pop
/* 80097C74-80097E8C 0925B4 0218+00 0/0 0/0 1/1 .text bSpline2__10dPathCurveFf */
#pragma push