Skip to content

Commit

Permalink
m_Do_hostIO OK, m_Do_mtx work
Browse files Browse the repository at this point in the history
  • Loading branch information
TakaRikka committed Sep 11, 2023
1 parent b82520b commit 958c31e
Show file tree
Hide file tree
Showing 6 changed files with 534 additions and 99 deletions.
4 changes: 3 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"-maxerrors 1",
"-nosyspath",
"-RTTI off",
"-fp_contract on",
# "-fp_contract on",
"-str reuse",
"-multibyte",
"-i include",
Expand Down Expand Up @@ -315,6 +315,8 @@ def ActorRel(rel_name, status):
# machine
NonMatching("m_Do/m_Do_main.cpp"),
NonMatching("m_Do/m_Do_controller_pad.cpp"),
Matching ("m_Do/m_Do_hostIO.cpp"),
NonMatching("m_Do/m_Do_mtx.cpp"),

# dolzel
Matching ("d/d_com_lib_game.cpp"),
Expand Down
25 changes: 12 additions & 13 deletions include/MSL_C/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,19 @@ inline double sqrt_step(double tmpd, float mag) {
return tmpd * 0.5 * (3.0 - mag * (tmpd * tmpd));
}

inline float sqrtf(float mag) {
if (mag > 0.0f) {
double tmpd = __frsqrte(mag);
tmpd = sqrt_step(tmpd, mag);
tmpd = sqrt_step(tmpd, mag);
tmpd = sqrt_step(tmpd, mag);
return mag * tmpd;
} else if (mag < 0.0) {
return NAN;
} else if (fpclassify(mag) == 1) {
return NAN;
} else {
return mag;
extern inline float sqrtf(float x) {
static const double _half = .5;
static const double _three = 3.0;
volatile float y;
if (x > 0.0f) {
double guess = __frsqrte((double)x); // returns an approximation to
guess = _half * guess * (_three - guess * guess * x); // now have 12 sig bits
guess = _half * guess * (_three - guess * guess * x); // now have 24 sig bits
guess = _half * guess * (_three - guess * guess * x); // now have 32 sig bits
y = (float)(x * guess);
return y;
}
return x;
}

inline float atan2f(float y, float x) {
Expand Down
25 changes: 17 additions & 8 deletions include/m_Do/m_Do_hostIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,36 @@ struct JORReflexible;

class mDoHIO_child_c {
public:
char mName[24];
u8 field1_0x18;
u8 field2_0x19;
u8 field3_0x1a;
u8 field4_0x1b;
JORReflexible* mReflexible;
mDoHIO_child_c() {
field_0x18 = 0;
mReflexible = NULL;
}

~mDoHIO_child_c() {}

/* 0x00 */ char mName[24];
/* 0x18 */ u8 field_0x18;
/* 0x1C */ JORReflexible* mReflexible;
};

class mDoHIO_subRoot_c {
public:
virtual ~mDoHIO_subRoot_c() {}

s8 createChild(const char*, JORReflexible*);
void deleteChild(s8);

private:
mDoHIO_child_c mChild[64];
/* 0x4 */ mDoHIO_child_c mChild[64];
};

class mDoHIO_root_c : public mDoHIO_subRoot_c {
class mDoHIO_root_c {
public:
virtual ~mDoHIO_root_c() {}

void update();

/* 0x0 */ mDoHIO_subRoot_c m_subroot;
};

class mDoHIO_entry_c {
Expand Down
Loading

0 comments on commit 958c31e

Please sign in to comment.