Clean up angle constants and conversions (#1135)

* Add angle conversion constants and macros

* Replace angle literals with hex instead of decimal
This commit is contained in:
LagoLunatic
2026-07-22 20:13:31 -04:00
committed by GitHub
parent bf372802ca
commit 96347ab502
85 changed files with 261 additions and 267 deletions
+21 -27
View File
@@ -3,6 +3,20 @@
#include "SSystem/SComponent/c_xyz.h"
#define RAD2DEG_CONSTANT (180.0f / M_PI) // 57.29577951f
#define DEG2RAD_CONSTANT (M_PI / 180.0f) // 0.017453292f
#define DEG2S_CONSTANT (0x8000 / 180.0f) // 182.04445f
#define S2DEG_CONSTANT (180.0f / 0x8000) // 0.005493164f
#define S2RAD_CONSTANT (M_PI / 0x8000) // 9.58738e-5f / 9.58738e-05f / 0.0000958738f
#define RAD2S_CONSTANT (0x8000 / M_PI) // 10430.378f
#define RAD2DEG(x) ((x) * RAD2DEG_CONSTANT)
#define DEG2RAD(x) ((x) * DEG2RAD_CONSTANT)
#define DEG2S(x) ((s16)((x) * DEG2S_CONSTANT))
#define S2DEG(x) ((x) * S2DEG_CONSTANT)
#define S2RAD(x) ((x) * S2RAD_CONSTANT)
#define RAD2S(x) ((x) * RAD2S_CONSTANT)
class cSAngle {
private:
s16 mAngle;
@@ -59,33 +73,13 @@ cSAngle operator+(short, const cSAngle&);
cSAngle operator-(short, const cSAngle&);
struct cAngle {
static f32 Radian_to_Degree(f32 rad) {
return rad * (180.0f / M_PI);
}
static f32 Degree_to_Radian(f32 deg) {
return deg * (M_PI / 180.0f);
}
static s16 Degree_to_SAngle(f32 deg) {
return deg * (65536.0f / 360.0f);
}
static f32 SAngle_to_Degree(s16 angle) {
return angle * (360.0f / 65536.0f);
}
static f32 SAngle_to_Radian(s16 angle) {
return angle * ((2.0f * M_PI) / 65536.0f);
}
static f32 SAngle_to_Normal(s16 angle) {
return angle * (2.0f / 65536.0f);
}
static s16 Radian_to_SAngle(f32 rad) {
return rad * (65536.0f / (2.0f * M_PI));
}
static f32 Radian_to_Degree(f32 rad) { return RAD2DEG(rad); }
static f32 Degree_to_Radian(f32 deg) { return DEG2RAD(deg); }
static s16 Degree_to_SAngle(f32 deg) { return DEG2S(deg); }
static f32 SAngle_to_Degree(s16 angle) { return S2DEG(angle); }
static f32 SAngle_to_Radian(s16 angle) { return S2RAD(angle); }
static s16 Radian_to_SAngle(f32 rad) { return RAD2S(rad); }
static f32 SAngle_to_Normal(s16 angle) { return angle * (1.0f / 0x8000); }
/* Converts Radian value into Degree value */
static f32 r2d(f32 r) { return Radian_to_Degree(r); }
+4 -3
View File
@@ -2,6 +2,7 @@
#define C_MATH_H
#include "JSystem/JMath/JMATrigonometric.h"
#include "SSystem/SComponent/c_angle.h"
s16 cM_rad2s(float rad);
u16 U_GetAtanTable(float, float);
@@ -40,7 +41,7 @@ inline f32 cM_ssin(s16 x) {
}
inline s16 cM_deg2s(f32 deg) {
return deg * 182.04445f;
return DEG2S(deg);
}
inline f32 cM_fcos(f32 x) {
@@ -52,11 +53,11 @@ inline f32 cM_fsin(f32 x) {
}
inline f32 cM_sht2d(f32 v) {
return v * 0.005493164f;
return S2DEG(v);
}
inline f32 cM_s2rad(s16 x) {
return x * 9.58738e-05f;
return S2RAD(x);
}
#endif /* C_MATH_H */
+1 -1
View File
@@ -12,7 +12,7 @@
#include "weak_bss_3569.h" // IWYU pragma: keep
static const f32 Deg2Rad = 0.017453292f;
static const f32 Deg2Rad = (M_PI / 180.0f); // 0.017453292f
/* 802566B8-802566CC .text init__11J3DUClipperFv */
void J3DUClipper::init() {
+2 -2
View File
@@ -199,14 +199,14 @@ f32 JASystem::TOscillator::calc(s16* i_table) {
field_0x5 = envMode;
if (envTime == 0) {
mTargetPhase = envValue / 32768.0f;
mTargetPhase = (f32)envValue / 0x8000;
field_0x6 += 1;
continue;
}
mReleaseRate = envTime * ((Kernel::getDacRate() / 80.0f) / 600.0f) / Driver::getUpdateInterval();
mInitialReleaseRate = mReleaseRate;
mTargetPhase = envValue / 32768.0f;
mTargetPhase = (f32)envValue / 0x8000;
if (field_0x5 == 0) {
mPhaseChangeRate = (mTargetPhase - mPhase) / mReleaseRate;
+3 -3
View File
@@ -581,7 +581,7 @@ int JASystem::TSeqParser::cmdIIRSet(TTrack* track, u32* args) {
for (u8 i = 0; i < 4; i++) {
u8 iirIndex = TTrack::TIMED_IIR_Unk0 + i;
TTrack::MoveParam_* iir = &track->mTimedParam.mMoveParams[iirIndex];
iir->mTargetValue = (s16)args[i] / 32768.0f;
iir->mTargetValue = (f32)(s16)args[i] / 0x8000;
iir->mCurrentValue = iir->mTargetValue;
iir->mMoveAmount = 0.0f;
iir->mMoveTime = 1.0f;
@@ -596,7 +596,7 @@ int JASystem::TSeqParser::cmdIIRCutOff(TTrack* track, u32* args) {
s16* table = &JASystem::Player::CUTOFF_TO_IIR_TABLE[iirTableIdx * 4];
u8 iirIndex = TTrack::TIMED_IIR_Unk0 + i;
TTrack::MoveParam_* iir = &track->mTimedParam.mMoveParams[iirIndex];
iir->mTargetValue = table[i] / (32768.0f - 1.0f);
iir->mTargetValue = table[i] / (0x8000 - 1.0f);
iir->mCurrentValue = iir->mTargetValue;
iir->mMoveAmount = 0.0f;
iir->mMoveTime = 1.0f;
@@ -789,7 +789,7 @@ int JASystem::TSeqParser::cmdSetParam(TTrack* track, u8 param_2) {
break;
}
track->setParam(flag, (int)data / 32767.0f, val);
track->setParam(flag, data / (f32)0x7FFF, val);
return 0;
}
+9 -9
View File
@@ -510,7 +510,7 @@ void JASystem::TTrack::updateTrackAll() {
f32 fx_vol;
f32 dolby;
f32 pan_weight = mRegisterParam.getPanPowerParent() / 32767.0f;
f32 pan_weight = (f32)mRegisterParam.getPanPowerParent() / 0x7FFF;
mChannelUpdater.field_0x68 = mRegisterParam.field_0x1a | 0x10000;
mChannelUpdater.field_0x6c = 0;
@@ -568,7 +568,7 @@ void JASystem::TTrack::updateTrackAll() {
mChannelUpdater.field_0x24 = fx_vol;
mChannelUpdater.field_0x28 = dolby;
} else {
pan_weight = mRegisterParam.getPanPowerTrack() / 32767.0f;
pan_weight = (f32)mRegisterParam.getPanPowerTrack() / 0x7FFF;
mChannelUpdater.field_0x18 = mParent->mChannelUpdater.field_0x18 * vol;
mChannelUpdater.field_0x1c = mParent->mChannelUpdater.field_0x1c * pitch;
@@ -590,11 +590,11 @@ void JASystem::TTrack::updateTrackAll() {
}
for (u8 i = 0; i < 4; i++) {
mChannelUpdater.field_0x3c[i] = mTimedParam.mMoveParams[TIMED_IIR_Unk0 + i].mCurrentValue * 32767.0f;
mChannelUpdater.field_0x3c[i] = mTimedParam.mMoveParams[TIMED_IIR_Unk0 + i].mCurrentValue * 0x7FFF;
}
mChannelUpdater.field_0x61 |= 0x20;
mChannelUpdater.field_0x4c = mTimedParam.mMoveParams[TIMED_Unk5].mCurrentValue * 32767.0f;
mChannelUpdater.field_0x4c = mTimedParam.mMoveParams[TIMED_Unk5].mCurrentValue * 0x7FFF;
}
}
@@ -610,7 +610,7 @@ void JASystem::TTrack::updateTrack(u32 flags) {
f32 fx_vol;
f32 dolby;
f32 pan_weight = mRegisterParam.getPanPowerParent() / 32767.0f;
f32 pan_weight = (f32)mRegisterParam.getPanPowerParent() / 0x7FFF;
if (flags & OUTERPARAM_Unk18) {
f32 unkF = mTimedParam.mMoveParams[TIMED_Unk17].mCurrentValue * 128.0f;
s8 unk = 0;
@@ -686,7 +686,7 @@ void JASystem::TTrack::updateTrack(u32 flags) {
if (flags & OUTERPARAM_IIRFilter) {
for (u8 i = 0; i < 4; i++) {
mChannelUpdater.field_0x3c[i] = mTimedParam.mMoveParams[TIMED_IIR_Unk0 + i].mCurrentValue * 32767.0f;
mChannelUpdater.field_0x3c[i] = mTimedParam.mMoveParams[TIMED_IIR_Unk0 + i].mCurrentValue * 0x7FFF;
}
mChannelUpdater.field_0x61 |= 0x20;
}
@@ -699,7 +699,7 @@ void JASystem::TTrack::updateTrack(u32 flags) {
}
if (flags & OUTERPARAM_Unk6) {
mChannelUpdater.field_0x4c = mTimedParam.mMoveParams[TIMED_Unk5].mCurrentValue * 32767.0f;
mChannelUpdater.field_0x4c = mTimedParam.mMoveParams[TIMED_Unk5].mCurrentValue * 0x7FFF;
}
if (mParent == NULL || (field_0x37b & 1)) {
@@ -719,7 +719,7 @@ void JASystem::TTrack::updateTrack(u32 flags) {
mChannelUpdater.field_0x28 = dolby;
}
} else {
pan_weight = mRegisterParam.getPanPowerTrack() / 32767.0f;
pan_weight = (f32)mRegisterParam.getPanPowerTrack() / 0x7FFF;
if (set_volume) {
mChannelUpdater.field_0x18 = mParent->mChannelUpdater.field_0x18 * vol;
}
@@ -750,7 +750,7 @@ void JASystem::TTrack::updateTempo() {
field_0x368 = (f32) field_0x378;
field_0x368 *= field_0x376;
field_0x368 /= Kernel::getDacRate();
field_0x368 *= 1.33333333f;
field_0x368 *= (4.0f / 3.0f);
if (mOuterParam != NULL && mOuterParam->checkOuterSwitch(OUTERPARAM_Tempo)) {
field_0x368 *= mOuterParam->getTempo();
}
+4 -4
View File
@@ -172,12 +172,12 @@ void JPADraw::initParticle(JPABaseParticle* ptcl) {
params->mLoopOffset = dc.pbe->getRandomF() * dc.pbsp->getLoopOffset();
if (dc.pesp != NULL) {
if (dc.pesp->isEnableRotate()) {
params->mRotateAngle = (dc.pesp->getRotateAngle() * 32768.0f) + (dc.pbe->getRandomSF() * dc.pesp->getRotateRandomAngle() * 65536.0f);
params->mRotateAngle = (dc.pesp->getRotateAngle() * 0x8000) + (dc.pbe->getRandomSF() * dc.pesp->getRotateRandomAngle() * 0x10000);
s16 rotateSpeed;
if (dc.pbe->getRandomRF() < dc.pesp->getRotateDirection()) {
rotateSpeed = dc.pesp->getRotateSpeed() * (dc.pesp->getRotateRandomSpeed() * dc.pbe->getRandomRF() + 1.0f) * 32768.0f;
rotateSpeed = dc.pesp->getRotateSpeed() * (dc.pesp->getRotateRandomSpeed() * dc.pbe->getRandomRF() + 1.0f) * 0x8000;
} else {
rotateSpeed = -dc.pesp->getRotateSpeed() * (dc.pesp->getRotateRandomSpeed() * dc.pbe->getRandomRF() + 1.0f) * 32768.0f;
rotateSpeed = -dc.pesp->getRotateSpeed() * (dc.pesp->getRotateRandomSpeed() * dc.pbe->getRandomRF() + 1.0f) * 0x8000;
}
params->mRotateSpeed = rotateSpeed;
} else {
@@ -245,7 +245,7 @@ void JPADraw::initChild(JPABaseParticle* ptcl, JPABaseParticle* chld) {
chld_params->mRotateAngle = params->mRotateAngle;
if (dc.pssp->isEnableRotate()) {
chld_params->mRotateSpeed = dc.pssp->getRotateSpeed() * 32768.0f;
chld_params->mRotateSpeed = dc.pssp->getRotateSpeed() * 0x8000;
} else {
chld_params->mRotateSpeed = 0;
}
+3 -3
View File
@@ -990,7 +990,7 @@ void JPADrawCalcAlpha::calc(const JPADrawContext* pDC, JPABaseParticle* ptcl) {
/* 80265C40-80265D54 .text calc__27JPADrawCalcAlphaFlickNrmSinFPC14JPADrawContextP15JPABaseParticle */
void JPADrawCalcAlphaFlickNrmSin::calc(const JPADrawContext* pDC, JPABaseParticle* ptcl) {
JPADrawParams* params = ptcl->getDrawParamPPtr();
f32 sin = JMASSin((ptcl->getAge() * 16384) * params->mAlphaWaveRandom * (1.0f - pDC->pesp->getAlphaWaveParam1()));
f32 sin = JMASSin((ptcl->getAge() * 0x4000) * params->mAlphaWaveRandom * (1.0f - pDC->pesp->getAlphaWaveParam1()));
params->mAlphaOut *= params->mAlphaWaveRandom * (((sin - 1.0f) * 0.5f) * pDC->pesp->getAlphaWaveParam3()) + 1.0f;
if (params->mAlphaOut < 0.0f)
params->mAlphaOut = 0.0f;
@@ -1000,7 +1000,7 @@ void JPADrawCalcAlphaFlickNrmSin::calc(const JPADrawContext* pDC, JPABaseParticl
void JPADrawCalcAlphaFlickAddSin::calc(const JPADrawContext* pDC, JPABaseParticle* ptcl) {
/* Nonmatching - operand swap */
JPADrawParams* params = ptcl->getDrawParamPPtr();
f32 theta = (ptcl->getAge() * 16384) * params->mAlphaWaveRandom;
f32 theta = (ptcl->getAge() * 0x4000) * params->mAlphaWaveRandom;
f32 sin2 = JMASSin(theta * (1.0f - pDC->pesp->getAlphaWaveParam2()));
f32 sin1 = JMASSin(theta * (1.0f - pDC->pesp->getAlphaWaveParam1()));
params->mAlphaOut *= (params->mAlphaWaveRandom * ((((sin1 + sin2) - 2.0f) * 0.5f) * pDC->pesp->getAlphaWaveParam3()) + 2.0f) * 0.5f;
@@ -1011,7 +1011,7 @@ void JPADrawCalcAlphaFlickAddSin::calc(const JPADrawContext* pDC, JPABaseParticl
/* 80265EC4-80266048 .text calc__28JPADrawCalcAlphaFlickMultSinFPC14JPADrawContextP15JPABaseParticle */
void JPADrawCalcAlphaFlickMultSin::calc(const JPADrawContext* pDC, JPABaseParticle* ptcl) {
JPADrawParams* params = ptcl->getDrawParamPPtr();
f32 theta = (ptcl->getAge() * 16384) * params->mAlphaWaveRandom;
f32 theta = (ptcl->getAge() * 0x4000) * params->mAlphaWaveRandom;
f32 mul3 = (pDC->pesp->getAlphaWaveParam3() * 0.5f) * params->mAlphaWaveRandom;
f32 sin2 = JMASSin(theta * (1.0f - pDC->pesp->getAlphaWaveParam2()));
f32 sin1 = JMASSin(theta * (1.0f - pDC->pesp->getAlphaWaveParam1()));
+1 -1
View File
@@ -71,7 +71,7 @@ void JPABaseEmitter::calcVolumeSphere() {
if (checkEmDataFlag(JPADynFlag_FixedInterval)) {
u16 angleNo = (emtrInfo.mVolumeEmitAngleCount * 0x10000) / emtrInfo.mVolumeEmitAngleMax;
x = (u16)((emtrInfo.mVolumeEmitXCount * 0x8000) / (emtrInfo.mDivNumber - 1) + 0x4000);
angle = (f32)angleNo * mVolumeSweep + 32768.0f;
angle = (f32)angleNo * mVolumeSweep + 0x8000;
emtrInfo.mVolumeEmitAngleCount++;
if (emtrInfo.mVolumeEmitAngleCount == emtrInfo.mVolumeEmitAngleMax) {
emtrInfo.mVolumeEmitAngleCount = 0;
@@ -240,9 +240,9 @@ void TAdaptor_particle::TJPACallback_::execute(JPABaseEmitter* emitter) {
}
emitter->setGlobalTranslation(pos[0]);
int angleX = 65536.0 * (pos[1].x / 360.0);
int angleY = 65536.0 * (pos[1].y / 360.0);
int angleZ = 65536.0 * (pos[1].z / 360.0);
int angleX = 0x10000 * (pos[1].x / 360.0);
int angleY = 0x10000 * (pos[1].y / 360.0);
int angleZ = 0x10000 * (pos[1].z / 360.0);
emitter->setGlobalRotation(JGeometry::TVec3<s16>(angleX, angleY, angleZ));
emitter->setGlobalScale(sp0C);
} else {
+1 -1
View File
@@ -161,7 +161,7 @@ s16 cM_atan2s(float f0, float f1) {
/* 80246270-802462B8 .text cM_atan2f__Fff */
float cM_atan2f(float f1, float f2) {
return 9.58738E-5f * cM_atan2s(f1, f2);
return S2RAD(cM_atan2s(f1, f2));
}
static s32 r0, r1, r2;
+10 -10
View File
@@ -1470,10 +1470,10 @@ void dr_damage_anime(damagereaction* dr) {
if(temp2 < -22000.0f) {
temp2 = -22000.0f;
}
dr->m010[8].y = 0.4f * temp2 + 8192.0f;
dr->m010[4].z = 0.4f * -temp2 - 8192.0f;
dr->m010[8].z = 0.4f * zero + 8192.0f;
dr->m010[4].y = 0.4f * zero + 8192.0f;
dr->m010[8].y = 0.4f * temp2 + 0x2000;
dr->m010[4].z = 0.4f * -temp2 - 0x2000;
dr->m010[8].z = 0.4f * zero + 0x2000;
dr->m010[4].y = 0.4f * zero + 0x2000;
f32 temp3 = temp;
if(temp3 > 22000.0f) {
@@ -1482,10 +1482,10 @@ void dr_damage_anime(damagereaction* dr) {
if(temp3 < -5000.0f) {
temp3 = -5000.0f;
}
dr->m010[9].y = 0.4f * temp3 - 8192.0f;
dr->m010[5].z = 0.4f * temp3 - 8192.0f;
dr->m010[9].z = 0.4f * zero + 8192.0f;
dr->m010[5].y = 0.4f * -zero - 8192.0f;
dr->m010[9].y = 0.4f * temp3 - 0x2000;
dr->m010[5].z = 0.4f * temp3 - 0x2000;
dr->m010[9].z = 0.4f * zero + 0x2000;
dr->m010[5].y = 0.4f * -zero - 0x2000;
f32 temp4 = temp;
if(temp4 > 20000.0f) {
@@ -1507,7 +1507,7 @@ void dr_damage_anime(damagereaction* dr) {
temp5 = -10000.0f;
}
dr->m010[6].x = (3000.0f - temp5) + REG0_S(0);
dr->m010[6].z = (-zero - 16384.0f) + REG0_S(1);
dr->m010[6].z = (-zero - 0x4000) + REG0_S(1);
f32 temp6 = temp;
if(temp6 > 10000.0f) {
@@ -1517,7 +1517,7 @@ void dr_damage_anime(damagereaction* dr) {
temp6 = -7000.0f;
}
dr->m010[7].x = (-temp6 - 3000.0f);
dr->m010[7].z = (-zero - 16384.0f);
dr->m010[7].z = (-zero - 0x4000);
}
else {
dr->m010[6].y += dr->m4B8;
+1 -1
View File
@@ -559,7 +559,7 @@ void daArrow_c::setStopActorMatrix() {
s16 xRot = 0;
if (cLib_calcTimer(&field_0x604) != 0) {
f32 temp = (field_0x604 / 40.0f);
xRot = 1024.0f * temp*temp * cM_ssin(field_0x604 * 0x52FB);
xRot = 0x400 * temp*temp * cM_ssin(field_0x604 * 0x52FB);
}
fopAc_ac_c* hitActor = fopAcM_SearchByID(mHitActorProcID);
if (!hitActor) {
+5 -5
View File
@@ -56,10 +56,10 @@ void daArrow_Iceeff_c::CreateInit() {
field_0x8B4[i].setall(cM_rndF(4.5f) + 6.2999997f);
f32 temp = 180.0f * i / 30.0f;
s16 angle = cM_rndF(65536.0f);
mDoMtx_stack_c::ZrotS(cM_rndF(65536.0f));
mDoMtx_stack_c::XrotM(cM_rndF(65536.0f));
mDoMtx_stack_c::YrotM(cM_rndF(65536.0f));
s16 angle = cM_rndF(0x10000);
mDoMtx_stack_c::ZrotS(cM_rndF(0x10000));
mDoMtx_stack_c::XrotM(cM_rndF(0x10000));
mDoMtx_stack_c::YrotM(cM_rndF(0x10000));
mDoMtx_stack_c::transM(temp * cM_ssin(angle), temp * cM_scos(angle), 0.0f);
mDoMtx_stack_c::ZrotM(current.angle.z);
mDoMtx_stack_c::XrotM(current.angle.x);
@@ -68,7 +68,7 @@ void daArrow_Iceeff_c::CreateInit() {
}
}
else {
current.angle.y = cM_rndF(65536.0f);
current.angle.y = cM_rndF(0x10000);
}
fopAcM_setCullSizeBox(this, -100.0f, -100.0f, -100.0f, 100.0f, 100.0f, 100.0f);
+2 -2
View File
@@ -174,7 +174,7 @@ static void eff_hane_set(bdk_class* i_this, cXyz* offset, int param_3, signed ch
eff->m004.z = offset->z;
eff->m024 = 0.0f;
eff->m03C = cM_rndF(65536.0f);
eff->m03C = cM_rndF(0x10000);
eff->m036.z = cM_rndFX(1200.0f + REG8_F(10));
eff->m036.x = cM_rndFX(800.0f + REG8_F(16));
iVar4++;
@@ -191,7 +191,7 @@ static void eff_hane_set(bdk_class* i_this, cXyz* offset, int param_3, signed ch
eff->m020 = REG8_F(8) + (cM_rndF(5.0f) + 5.0f);
}
eff->m01C = REG8_F(9) + (cM_rndF(5.0f) + 5.0f);
eff->m030.y = cM_rndF(65536.0f);
eff->m030.y = cM_rndF(0x10000);
}
}
}
+3 -3
View File
@@ -284,13 +284,13 @@ static void tower_kaidan_move(bdkobj_class* i_this) {
fopAcM_seStartCurrent(i_this, JA_SE_OBJ_MJ_WBOARD_BRK, 0);
for (s32 i = 0; i < 2; i++) {
i_this->mEffs[i].m000 = 2;
i_this->mEffs[i].m1AC = cM_rndF(65536.0f);
i_this->mEffs[i].m1AC = cM_rndF(0x10000);
i_this->mEffs[i].m028 = (0.7f + cM_rndFX(0.25f));
i_this->mEffs[i].m008.x = i_this->current.pos.x + cM_rndFX(500.0f);
i_this->mEffs[i].m008.y = i_this->current.pos.y;
i_this->mEffs[i].m008.z = i_this->current.pos.z + cM_rndFX(500.0f);
i_this->mEffs[i].m030.y = cM_rndF(65536.0f);
i_this->mEffs[i].m030.z = cM_rndF(65536.0f);
i_this->mEffs[i].m030.y = cM_rndF(0x10000);
i_this->mEffs[i].m030.z = cM_rndF(0x10000);
i_this->mEffs[i].m036.y = cM_rndFX(800.0f);
i_this->mEffs[i].m030.x = cM_rndFX(10000.0f);
i_this->mEffs[i].m036.z = cM_rndFX(800.0f);
+2 -2
View File
@@ -3686,8 +3686,8 @@ static cPhs_State daBgn_Create(fopAc_ac_c* a_this) {
#endif
}
for (s32 i = 0; i < 8; i++) {
i_this->mAAA8[i].m2FA = cM_rndF(32768.0f);
i_this->mAAA8[i].m2FC = cM_rndF(32768.0f);
i_this->mAAA8[i].m2FA = cM_rndF(0x8000);
i_this->mAAA8[i].m2FC = cM_rndF(0x8000);
}
if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_3F10)) {
i_this->m02B4 = 0xFF;
+3 -3
View File
@@ -472,7 +472,7 @@ static void damage(bgn3_class* i_this) {
if (checkGround(i_this)) {
actor->speed.y = 50.0f;
i_this->m0FD8C = 2;
actor->current.angle.y = cM_rndF(65536.0f);
actor->current.angle.y = cM_rndF(0x10000);
i_this->m0FDB8 = 1.0f;
dComIfGp_getVibration().StartShock(REG0_S(2) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f));
drop_eff_set(i_this);
@@ -527,13 +527,13 @@ static void end(bgn3_class* i_this) {
}
if (checkGround(i_this)) {
i_this->m0FD8C++;
actor->current.angle.y = cM_rndF(65536.0f);
actor->current.angle.y = cM_rndF(0x10000);
i_this->m0FDB8 = 1.0f;
dComIfGp_getVibration().StartShock(REG0_S(2) + 5, -0x21, cXyz(0.0f, 1.0f, 0.0f));
drop_eff_set(i_this);
actor->speed.y = REG0_F(11) + 130.0f;
actor->speedF = 0.0f;
actor->current.angle.y = cM_rndF(65536.0f);
actor->current.angle.y = cM_rndF(0x10000);
fopAcM_monsSeStart(actor, JA_SE_CV_BGN_HIT_1, 0);
}
if ((i_this->m0FD8C == 4) && (actor->speed.y <= -30.0f)) {
+1 -1
View File
@@ -987,7 +987,7 @@ void wait(bmd_class* i_this) {
move1(i_this);
if (i_this->m308[1] == 0) {
i_this->m308[1] = (s16)(int)(cM_rndF(200.0f) + 100.0f);
i_this->m336 = (s16)(int)cM_rndFX(32768.0f);
i_this->m336 = (s16)(int)cM_rndFX(0x8000);
i_this->m338 = 0.0f;
}
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->m336, 0x20, i_this->m338);
+2 -2
View File
@@ -139,7 +139,7 @@ void wait(bmdfoot_class* i_this) {
i_this->m2BC++;
anm_init(i_this, dRes_INDEX_BMDFOOT_BCK_ASI_WAIT_e, 50.0f, J3DFrameCtrl::EMode_LOOP, cM_rndF(0.2f) + 0.9f, -1);
i_this->m2C0[0] = cM_rndF(150.0f) + 100.0f;
i_this->m3EC = cM_rndFX(32768.0f);
i_this->m3EC = cM_rndFX(0x8000);
for (int i = 2; i <= ARRAY_SSIZE(i_this->m3A4); i++) {
i_this->m3A4[i] = REG14_F(13) + (0.2f + cM_rndFX(0.1f));
}
@@ -460,7 +460,7 @@ void damage(bmdfoot_class* i_this) {
anm_init(i_this, dRes_INDEX_BMDFOOT_BCK_ASI_NOBIKIRU_e, 40.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1);
i_this->m2BC++;
i_this->m2C0[0] = 0x1e;
i_this->m3EC = cM_rndFX(32768.0f);
i_this->m3EC = cM_rndFX(0x8000);
for (int i = 2; i <= ARRAY_SSIZE(i_this->m3A4); i++) {
i_this->m3A4[i] = (0.3f + cM_rndFX(0.2f));
}
+2 -2
View File
@@ -358,7 +358,7 @@ void daBoko_c::setThrowReverse(s16 arg1) {
fopAcM_SetGravity(this, -3.0f);
fopAcM_GetSpeed(this).y = 15.0f;
speedF *= 0.25f;
current.angle.y = arg1 + cM_rndFX(12288.0f);
current.angle.y = arg1 + cM_rndFX(0x3000);
int sVar1 = cLib_distanceAngleS(current.angle.y, shape_angle.y);
if (sVar1 >= 0x4000) {
@@ -603,7 +603,7 @@ BOOL daBoko_c::procThrow() {
}
if (mCps.ChkAtHit()) {
unaff_r28 = current.angle.y + cM_rndF(16384.0f);
unaff_r28 = current.angle.y + cM_rndF(0x4000);
} else if (mAcch.ChkWallHit()) {
unaff_r28 = mAcchCir.GetWallAngleY();
} else {
+2 -2
View File
@@ -248,7 +248,7 @@ void daBoomerang_sightPacket_c::setSight(cXyz* pPos, int n) {
mDoMtx_stack_c::transS(proj);
mDoMtx_stack_c::scaleM(scaleX, scaleY, scale);
mDoMtx_stack_c::ZrotM(cM_ssin(imageRot * 16384.0f) * 32768.0f);
mDoMtx_stack_c::ZrotM(cM_ssin(imageRot * 0x4000) * 0x8000);
MTXCopy(mDoMtx_stack_c::get(), mMtxArr[n]);
mSightOnFlg |= 1 << n;
@@ -646,7 +646,7 @@ BOOL daBoomerang_c::procMove() {
} else if (a > 18.0f) {
a = 20.0f + 40.0f * (a - 18.0f);
}
newAngle = a * 256.0f + 1024.0f;
newAngle = a * 0x100 + 0x400;
} else {
newAngle = 0x4000;
}
+9 -9
View File
@@ -953,7 +953,7 @@ void search_get_skull(bpw_class* i_this, u8 param_2) {
actor2->speed.y = 20.0f;
}
actor2->current.angle.y = fopAcM_searchActorAngleY(actor, actor2);
actor2->current.angle.y += (int)cM_rndFX(4096.0f);
actor2->current.angle.y += (int)cM_rndFX(0x1000);
actor2->shape_angle.x += -0x2000;
}
break;
@@ -2025,13 +2025,13 @@ void action_damage(bpw_class* i_this) {
csXyz pwAngle = actor->shape_angle;
local_58 = actor->current.pos;
int currRandomAngle;
int pwSpreadAmount = (int)(65536.0f / actor->health);
int pwSpreadAmount = (int)(0x10000 / (f32)actor->health);
local_58.y = i_this->mAcch.GetGroundH() + 20.0f;
i_this->m3E9 = 0;
for (i = 0; i < 15; i++) {
i_this->mChildPoeIds[i] = fpcM_ERROR_PROCESS_ID_e;
}
currRandomAngle = (int)cM_rndFX(32768.0f);
currRandomAngle = (int)cM_rndFX(0x8000);
uVar14 = (s16)cM_rndF(4.99f);
u32 uVar2 = uVar14 << 9 | 0xFF000003;
for (i = 0; i < actor->health; i++) {
@@ -2089,13 +2089,13 @@ void action_bunri_dousa(bpw_class* i_this) {
csXyz pwAngle = actor->shape_angle;
local_58 = actor->current.pos;
int currRandomAngle;
int pwSpreadAmount = (int)(65536.0f / actor->health);
int pwSpreadAmount = (int)(0x10000 / (f32)actor->health);
local_58.y = i_this->mAcch.GetGroundH() + 20.0f;
i_this->m3E9 = 0;
for (i = 0; i < 15; i++) {
i_this->mChildPoeIds[i] = fpcM_ERROR_PROCESS_ID_e;
}
currRandomAngle = (int)cM_rndFX(32768.0f);
currRandomAngle = (int)cM_rndFX(0x8000);
uVar14 = (s16)cM_rndF(4.99f);
u32 uVar2 = uVar14 << 9 | 0xFF000003;
for (i = 0; i < actor->health; i++) {
@@ -2739,7 +2739,7 @@ void action_bunri_dousa(bpw_class* i_this) {
i_this->mActionState++;
// fallthrough
case 0x83:
cLib_addCalcAngleS2(&actor->shape_angle.x, REG18_F(19) + 49152.0f, 1, 0x300);
cLib_addCalcAngleS2(&actor->shape_angle.x, REG18_F(19) + 0xC000, 1, 0x300);
if (i_this->mSomeCountdownTimers[0] != 0) {
break;
}
@@ -2768,7 +2768,7 @@ void action_bunri_dousa(bpw_class* i_this) {
#endif
// fallthrough
case 0x85:
cLib_addCalcAngleS2(&actor->shape_angle.x, REG18_F(19) + 49152.0f, 1, 0x300);
cLib_addCalcAngleS2(&actor->shape_angle.x, REG18_F(19) + 0xC000, 1, 0x300);
cLib_addCalcAngleS2(&actor->shape_angle.z, 0, 1, 0x300);
cLib_addCalc2(&i_this->m440, REG6_F(7) + 50.0f, 1.0f, 0.5f);
fVar2 = std::fabsf(i_this->m40C.x - (REG6_F(8) + -1352.0f));
@@ -4616,9 +4616,9 @@ static cPhs_State daBPW_Create(fopAc_ac_c* a_this) {
csXyz pwAngle = a_this->shape_angle;
local_58 = a_this->current.pos;
int currRandomAngle;
int pwSpreadAmount = (int)(65536.0f / a_this->health);
int pwSpreadAmount = (int)(0x10000 / (f32)a_this->health);
local_58.y = i_this->mAcch.GetGroundH() + 20.0f;
currRandomAngle = (int)cM_rndFX(32768.0f);
currRandomAngle = (int)cM_rndFX(0x8000);
uVar14 = (s16)cM_rndF(4.99f);
u32 uVar2 = uVar14 << 9 | 0xFF000004;
for (s32 i = 0; i < 15; i++) {
+1 -1
View File
@@ -3179,7 +3179,7 @@ static cPhs_State daBst_Create(fopAc_ac_c* a_this) {
actor->max_health = 4;
}
}
i_this->mUpdateLastFacingDirIfMultipleOf32 = cM_rndFX(32768.0f);
i_this->mUpdateLastFacingDirIfMultipleOf32 = cM_rndFX(0x8000);
#if VERSION > VERSION_DEMO
i_this->mEnvLight = actor->tevStr;
i_this->m2F20 = actor->tevStr;
+4 -4
View File
@@ -540,14 +540,14 @@ static void sibuki_set(btd_class* i_this) {
for (s32 i = 0; i < ARRAY_SSIZE(i_this->mBtdSibukiS); i++, sibuki++) {
if (sibuki->m00 == 0) {
sibuki->m00 = 1;
cMtx_YrotS(*calc_mtx, cM_rndFX(32768.0f));
cMtx_YrotS(*calc_mtx, cM_rndFX(0x8000));
local_38.z = REG0_F(13) + (cM_rndFX(200.0f) + 300.0f);
local_38.y = cM_rndF(50.0f);
MtxPosition(&local_38, &sibuki->m04);
local_38.z = l_HIO.m48 + cM_rndF(l_HIO.m48 * 0.5f);
local_38.y = l_HIO.m4C + cM_rndF(l_HIO.m4C * 0.5f);
MtxPosition(&local_38, &sibuki->m10);
cMtx_YrotS(*calc_mtx, cM_rndFX(32768.0f));
cMtx_YrotS(*calc_mtx, cM_rndFX(0x8000));
}
}
}
@@ -811,8 +811,8 @@ static s32 damage(btd_class* i_this)
local_58.y = REG0_F(1) + (cM_rndF(5.0f) + 20.0f);
local_58.z = REG0_F(0) + (cM_rndF(5.0f) + 20.0f);
MtxPosition(&local_58, &hahen->m14);
hahen->m22 = cM_rndF(65536.0f);
hahen->m20 = cM_rndF(65536.0f);
hahen->m22 = cM_rndF(0x10000);
hahen->m20 = cM_rndF(0x10000);
}
}
for (s32 i = 0, j = 0, k = 0; i < ARRAY_SSIZE(hahen_eff_name); i++, j++, k++) {
+2 -2
View File
@@ -1147,8 +1147,8 @@ static void end(bwd_class* i_this) {
local_c0.y = 2.0f;
local_c0.z = 2.0f;
csXyz local_d4(0, 0, 0);
local_d4.x = (s16)(int)cM_rndF(65536.0f);
local_d4.y = (s16)(int)cM_rndF(65536.0f);
local_d4.x = (s16)(int)cM_rndF(0x10000);
local_d4.y = (s16)(int)cM_rndF(0x10000);
dComIfGp_particle_set(dPa_name::ID_IT_SN_BWO_SIBOUBAKUEN00, i_this->m0418 + i_this->m3C24, &local_d4, &local_c0);
dComIfGp_particle_set(dPa_name::ID_IT_SN_BWO_SIBOUSUNA00, i_this->m0418 + i_this->m3C24, &local_d4, &local_c0);
mDoAud_seStart(JA_SE_CM_MONS_EXPLODE, &i_this->m0418[i_this->m3C24], 0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor)));
+4 -4
View File
@@ -230,7 +230,7 @@ static void ug_move(bwds_class* i_this) {
i_this->m030C = REG0_F(3) + 3000.0f;
actor->speedF = l_HIO.m010;
actor->speed.y = REG0_F(13) + 60.0f + cM_rndF(20.0f);
actor->current.angle.y = cM_rndFX(32768.0f);
actor->current.angle.y = cM_rndFX(0x8000);
local_34.x = 0.0f;
local_34.y = 0.0f;
local_34.z = 2000.0f;
@@ -409,7 +409,7 @@ static void hook_chance(bwds_class* i_this) {
i_this->m04FC = REG0_S(5) + 0x7f00;
}
i_this->m0500 = cM_rndFX(32768.0f);
i_this->m0500 = cM_rndFX(0x8000);
i_this->m0502 = cM_rndFX(REG0_F(5) + 2500.0f);
if (cM_rndF(1.0f) < 0.5f) {
if (cM_rndF(1.0f) < 0.5f) {
@@ -465,8 +465,8 @@ static void fail(bwds_class* i_this) {
local_34.z = 0.5f;
csXyz local_54(0, 0, 0);
local_54.x = cM_rndF(65536.0f);
local_54.y = cM_rndF(65536.0f);
local_54.x = cM_rndF(0x10000);
local_54.y = cM_rndF(0x10000);
dComIfGp_particle_set(dPa_name::ID_IT_SN_BWK_SIBOUBAKUEN00, &local_40, &local_54, &local_34);
dComIfGp_particle_set(dPa_name::ID_IT_SN_BWK_SIBOUFLASH00, &local_40, &local_54, &local_34);
i_this->m04F0++;
+4 -4
View File
@@ -127,7 +127,7 @@ cXyz daCanon_c::getGridPos(int arg1, int arg2) {
/* 00000448-00000554 .text getBulEndPos__9daCanon_cFss */
cXyz daCanon_c::getBulEndPos(short arg1, short arg2) {
cXyz sp08 = current.pos;
f32 fVar2 = (((home.angle.x + 0x1000) - arg2) / 4096.0f);
f32 fVar2 = (f32)((home.angle.x + 0x1000) - arg2) / 0x1000;
f32 fVar3 = fVar2 * 1500.0f * 7.0f + 10500.0f + REG10_F(10);
sp08.x += fVar3 * cM_ssin(arg1);
sp08.z += fVar3 * cM_scos(arg1);
@@ -327,7 +327,7 @@ void daCanon_c::game_proc() {
/* 00000FA0-00001074 .text fire_proc_init__9daCanon_cFv */
void daCanon_c::fire_proc_init() {
f32 tmp = (((home.angle.x + 0x1000) - shape_angle.x) / 4096.0f);
f32 tmp = (f32)((home.angle.x + 0x1000) - shape_angle.x) / 0x1000;
m652 = tmp * 8.0f * 7.0f + 64.0f;
m654 = m652;
m65E = 0;
@@ -454,13 +454,13 @@ void daCanon_c::PadMove() {
s16 target2 = shape_angle.x;
if (stickX > 0.5f) {
target1 += (s16)((0.5f - stickX) * 1024.0f);
target1 += (s16)((0.5f - stickX) * 0x400);
s16 sVar1 = home.angle.y + -0x1200;
if (shape_angle.y >= sVar1 && target1 < sVar1) {
target1 = sVar1;
}
} else if (stickX < -0.5f) {
target1 += (s16)((-0.5f - stickX) * 1024.0f);
target1 += (s16)((-0.5f - stickX) * 0x400);
s16 sVar1 = home.angle.y + 0x1200;
if (shape_angle.y <= sVar1 && target1 > sVar1) {
target1 = sVar1;
+2 -2
View File
@@ -750,7 +750,7 @@ BOOL search_angle_set(cc_class* i_this) {
} else if (std::sqrtf(SQUARE(fVar7) + SQUARE(fVar1)) < 100.0f && cM_rnd() < 0.1f &&
(s16)cLib_distanceAngleS(i_this->actor.shape_angle.y, i_this->actor.current.angle.y) < 0x100)
{
i_this->actor.current.angle.y += cM_rndFX(16384.0f);
i_this->actor.current.angle.y += cM_rndFX(0x4000);
}
}
return FALSE;
@@ -1632,7 +1632,7 @@ void action_noboru(cc_class* i_this) {
a_this->current.angle.x = 0;
a_this->current.angle.y = 0;
a_this->current.angle.z = 0;
a_this->current.angle.y = cM_rndFX(4096.0f) + 12288.0f;
a_this->current.angle.y = cM_rndFX(0x1000) + 0x3000;
a_this->shape_angle.x = a_this->current.angle.x;
a_this->shape_angle.y = a_this->current.angle.y;
a_this->shape_angle.z = a_this->current.angle.z;
+1 -1
View File
@@ -637,7 +637,7 @@ void daDaiocta_c::setAwaRandom(int i_awaIndex) {
f29_2 = f30 + cM_rndF(f29);
#endif
s16 random_theta = cM_rndF(65536.0f);
s16 random_theta = cM_rndF(0x10000);
mAwaTranslation[i_awaIndex].x = current.pos.x + f29_2 * cM_ssin(random_theta);
mAwaTranslation[i_awaIndex].y = mWaterY;
+2 -2
View File
@@ -559,8 +559,8 @@ void daEp_CreateInit(fopAc_ac_c* a_this) {
fopAcM_SetMtx(a_this, i_this->mAlphaModelMtx);
fopAcM_SetMin(a_this, -160.0f, -160.0f, -160.0f);
fopAcM_SetMax(a_this, 160.0f, 160.0f, 160.0f);
i_this->mAlphaModelRotX = cM_rndF(32768.0f);
i_this->mAlphaModelRotY = cM_rndF(32768.0f);
i_this->mAlphaModelRotX = cM_rndF(0x8000);
i_this->mAlphaModelRotY = cM_rndF(0x8000);
a_this->attention_info.position.x = a_this->current.pos.x;
a_this->attention_info.position.y = a_this->current.pos.y + 100.0f;
a_this->attention_info.position.z = a_this->current.pos.z;
+3 -3
View File
@@ -93,7 +93,7 @@ void esa_1_move(esa_class* i_this) {
switch(i_this->mActionState) {
case 0:
i_this->current.angle.y += (s16)cM_rndFX(4000.0f);
i_this->current.angle.z = cM_rndFX(32768.0f);
i_this->current.angle.z = cM_rndFX(0x8000);
sp24.x = 0.0f;
sp24.y = cM_rndF(8.0f) + 15.0f;
sp24.z = cM_rndF(5.0f) + 10.0f;
@@ -118,7 +118,7 @@ void esa_1_move(esa_class* i_this) {
else {
if(i_this->speed.y < 5.0f) {
i_this->speed.y *= -(cM_rndF(0.05f) + 0.15f);
i_this->current.angle.z = cM_rndFX(32768.0f);
i_this->current.angle.z = cM_rndFX(0x8000);
}
i_this->current.angle.y += (s16)cM_rndFX(8000.0f);
@@ -264,7 +264,7 @@ static cPhs_State daEsa_Create(fopAc_ac_c* i_actor) {
params->base.position = pos;
params->base.angle.x = 0;
params->base.angle.y = i_this->current.angle.y;
params->base.angle.z = cM_rndF(65536.0f);
params->base.angle.z = cM_rndF(0x10000);
params->base.parameters = 0x000000FF;
fpcM_Create(fpcNm_ESA_e, 0, params);
}
+1 -1
View File
@@ -312,7 +312,7 @@ static cPhs_State daFf_Create(fopAc_ac_c* i_this) {
a_this->cullMtx = a_this->mpModel[0]->getBaseTRMtx();
a_this->mHomePos = a_this->current.pos;
a_this->m2EC = a_this->mHomePos;
a_this->mLiveTimer = cM_rndF(32768.0f);
a_this->mLiveTimer = cM_rndF(0x8000);
a_this->mTimers[2] = cM_rndF(100.0f);
static dCcD_SrcSph cc_sph_src = {
// dCcD_SrcGObjInf
+1 -1
View File
@@ -67,7 +67,7 @@ static void move(fgmahou_class* i_this) {
case 0:
i_this->mState = 1;
i_this->field_0x2D4 = i_this->mOrbNumber * REG6_S(2) - REG6_S(3);
i_this->field_0x2D6 = cM_rndF(65536.0f);
i_this->field_0x2D6 = cM_rndF(0x10000);
i_this->speedF = REG0_F(0xD) + 50.0f;
i_this->speedF *= (0.2f + REG0_F(4)) * spdd[i_this->mOrbNumber] + 1.0f;
+4 -4
View File
@@ -636,9 +636,9 @@ void daFm_c::moveRndBack() {
if(!isGrabFoot()) {
if(cLib_calcTimer(&field_0x648) == 0 || field_0xAE4 == 0 || mObjAcch.ChkWallHit()) {
if(field_0xAE4 == 0 || mObjAcch.ChkWallHit()) {
field_0x680 += (s16)(0x5000 + field_0x680 + cM_rndF(3.0f) * 4096.0f);
field_0x680 += (s16)(0x5000 + field_0x680 + cM_rndF(3.0f) * 0x1000);
} else {
field_0x680 = shape_angle.y + 0x3000 + cM_rndF(5.0f) * 4096.0f;
field_0x680 = shape_angle.y + 0x3000 + cM_rndF(5.0f) * 0x1000;
}
field_0x394 = cM_rndF(9.0f) + 1.0f;
field_0x660.z += l_HIO.field_0x0AC * cM_scos(field_0x680);
@@ -661,9 +661,9 @@ void daFm_c::moveRndEscape() {
if(cLib_calcTimer(&field_0x648) == 0 || field_0xAE4 == 0 || mObjAcch.ChkWallHit()) {
if(dist < l_HIO.field_0x0B4) {
if(field_0xAE4 == 0 || mObjAcch.ChkWallHit()) {
field_0x680 += (s16)(0x5000 + field_0x680 + cM_rndF(3.0f) * 4096.0f);
field_0x680 += (s16)(0x5000 + field_0x680 + cM_rndF(3.0f) * 0x1000);
} else {
field_0x680 = shape_angle.y + 0x3000 + cM_rndF(5.0f) * 4096.0f;
field_0x680 = shape_angle.y + 0x3000 + cM_rndF(5.0f) * 0x1000;
}
field_0x660.set(field_0x690);
field_0x660.z += l_HIO.field_0x0B8 * cM_scos(field_0x680);
+4 -4
View File
@@ -416,11 +416,11 @@ static BOOL daHimo2_Draw(himo2_class* i_this) {
sp44 = i_this->m02EC[1] - i_this->m1F84;
MtxPosition(&sp44, &sp38);
sp38.z = sp38.z * (REG0_F(5) + 500.0f);
if (sp38.z > 16384.0f) {
sp38.z = 16384.0f;
if (sp38.z > 0x4000) {
sp38.z = 0x4000;
}
if (sp38.z < -16384.0f) {
sp38.z = -16384.0f;
if (sp38.z < -0x4000) {
sp38.z = -0x4000;
}
cLib_addCalcAngleS2(&i_this->m1F90, sp38.z, 2, REG0_S(2) + 0x800);
sp38.x *= REG0_F(6) + -200.0f;
+1 -1
View File
@@ -144,7 +144,7 @@ cPhs_State daIkari_c::_create() {
160.0f * scaleX, 100.0f * scaleX, 600.0f * scaleX);
fopAcM_setCullSizeFar(this, 10.0f);
mTimer = (s16)(int)cM_rndF(32768.0f);
mTimer = (s16)(int)cM_rndF(0x8000);
}
}
+4 -4
View File
@@ -637,7 +637,7 @@ void target_set(kb_class* i_this, u8 param_1) {
case 0:
temp = actor->shape_angle.y;
if(i_this->m426[3] == 0) {
temp = way_check(i_this, cM_rndFX(32768.0f), 0);
temp = way_check(i_this, cM_rndFX(0x8000), 0);
}
break;
@@ -1664,7 +1664,7 @@ void attack_move(kb_class* i_this) {
}
else {
if((s16)cLib_distanceAngleS(actor->current.angle.y, i_this->m442) < 0x100) {
i_this->m442 = fopAcM_searchPlayerAngleY(actor) + cM_rndFX(4096.0f);
i_this->m442 = fopAcM_searchPlayerAngleY(actor) + cM_rndFX(0x1000);
}
i_this->m5D4[0] = actor->current.pos;
@@ -1761,7 +1761,7 @@ void money_drop(kb_class* i_this) {
rnd *= 10.0f;
u32 temp2 = gold_rate_dt[(int)(0.3f * rnd)];
i_this->m407 = 1;
cMtx_YrotS(*calc_mtx, cM_rndFX(32768.0f));
cMtx_YrotS(*calc_mtx, cM_rndFX(0x8000));
temp3.set(0.0f, 0.0f, 20.0f);
MtxPosition(&temp3, &temp4);
temp4 += actor->current.pos;
@@ -1782,7 +1782,7 @@ void money_drop(kb_class* i_this) {
rnd *= 10.0f;
u32 temp2 = item_rate_dt[(int)(0.3f * rnd)];
i_this->m407 = 1;
cMtx_YrotS(*calc_mtx, cM_rndFX(32768.0f));
cMtx_YrotS(*calc_mtx, cM_rndFX(0x8000));
temp3.set(0.0f, 0.0f, 20.0f);
MtxPosition(&temp3, &temp4);
temp4 += actor->current.pos;
+1 -1
View File
@@ -629,7 +629,7 @@ void ki_atack_move(ki_class* i_this) {
cLib_addCalcAngleS2(&a_this->shape_angle.y, fopAcM_searchPlayerAngleY(a_this), 2, 0x1000);
if (i_this->mTimers[1] == 0) {
i_this->mTimers[1] = cM_rndF(50.0f) + 50.0f;
s32 rndFX = cM_rndFX(32768.0f);
s32 rndFX = cM_rndFX(0x8000);
cMtx_YrotS(*calc_mtx, player->current.angle.y + rndFX);
sp24.x = 0.0f;
sp24.y = (cM_rndFX(50.0f) + 200.0f) + REG0_F(12);
+4 -4
View File
@@ -723,7 +723,7 @@ void action_dead_move(ks_class* i_this) {
i_this->mMode++;
i_this->m2F0[1] = (s16)cM_rndFX(4096.0f);
i_this->m2F0[1] = (s16)cM_rndFX(0x1000);
i_this->mSph.OffAtSPrmBit(cCcD_AtSPrm_Set_e);
i_this->mSph.OffAtSPrmBit(cCcD_AtSPrm_Set_e);
@@ -1151,7 +1151,7 @@ void action_omoi(ks_class* i_this) {
}
actor->current.angle.y = fopAcM_searchPlayerAngleY(actor) + 0x8000;
actor->current.angle.y += (s16)cM_rndFX(16384.0f);
actor->current.angle.y += (s16)cM_rndFX(0x4000);
actor->speedF = 15.0f;
actor->gravity = -3.0f;
@@ -1290,7 +1290,7 @@ void action_kb_birth_check(ks_class* i_this) {
switch (i_this->mMode) {
case 60: {
actor->current.pos.y += REG8_F(13) + 30.0f;
actor->current.angle.y = cM_rndFX(32767.0f);
actor->current.angle.y = cM_rndFX(0x7FFF);
actor->speedF = REG8_F(8) + 4.0f + cM_rndF(REG8_F(9) + 4.0f);
actor->speed.y = REG8_F(10) + 20.0f + cM_rndF(REG8_F(11) + 5.0f);
@@ -1717,7 +1717,7 @@ static cPhs_State daKS_Create(fopAc_ac_c* i_this) {
fopAc_ac_c* gm_actor = fopAcM_SearchByID(a_this->mGmID);
if (gm_actor && fopAc_IsActor(gm_actor) && fopAcM_GetName(gm_actor) == fpcNm_GM_e && a_this->m2C8 == 5) {
i_this->current.angle.y += cM_rndFX(8192.0f);
i_this->current.angle.y += cM_rndFX(0x2000);
i_this->speedF = cM_rndF(6.0f) + 34.0f;
i_this->speed.y = cM_rndF(8.0f) + 22.0f;
}
+1 -1
View File
@@ -185,7 +185,7 @@ static cPhs_State daLamp_Create(fopAc_ac_c* i_ac) {
i_this->mSph.Set(sph_src);
i_this->mSph.SetStts(&i_this->mStts);
i_this->mCycleCtr = cM_rndFX(32768.0f);
i_this->mCycleCtr = cM_rndFX(0x8000);
for (int i = 0; i < 2; i++) {
daLamp_Execute(i_this);
+1 -1
View File
@@ -43,7 +43,7 @@ void daLwood_c::CreateInit() {
fopAcM_SetMtx(this, mModel->getBaseTRMtx());
fopAcM_setCullSizeBox(this, -600.0f, -0.0f, -600.0f, 600.0f, 900.0f, 600.0f);
fopAcM_setCullSizeFar(this, 2.37f);
mTimer = cM_rndF(32768.0f);
mTimer = cM_rndF(0x8000);
mScale = cM_rndF(0.4f) + 0.8f;
JUTNameTab* jointName = mModel->getModelData()->getJointName();
for (u16 i = 0; i < mModel->getModelData()->getJointNum(); i++) {
+2 -2
View File
@@ -2446,7 +2446,7 @@ static void yogan_fail(mo2_class* i_this) {
dComIfGp_particle_setSimple(dPa_name::ID_IT_SN_O_FIREK_KASU, &actor->current.pos);
dComIfGp_particle_setSimple(dPa_name::ID_IT_SN_O_MAGT_FCHIP, &actor->current.pos);
if ((i_this->m059C & 3U) == 0) {
i_this->m05E8.y = cM_rndF(65536.0f);
i_this->m05E8.y = cM_rndF(0x10000);
i_this->m05E8.x = -0x2000;
dComIfGp_particle_set(dPa_name::ID_AK_JN_TUBA00, &i_this->m28C8, &i_this->m05E8);
}
@@ -2624,7 +2624,7 @@ static void hip_damage(mo2_class* i_this) {
break;
case 2:
if ((i_this->m059C & 7) == 0) {
i_this->m05E8.y = cM_rndF(65536.0f);
i_this->m05E8.y = cM_rndF(0x10000);
i_this->m05E8.x = -0x2000;
dComIfGp_particle_set(dPa_name::ID_AK_JN_TUBA00, &i_this->m28C8, &i_this->m05E8);
}
+8 -8
View File
@@ -3279,18 +3279,18 @@ static void daMP_MixAudio(s16* destination, s16*, u32 sample) {
l_mix = 0.7f * (attenuation * curPtr[0] >> 15);
// clamp volume
if (l_mix < -32768)
l_mix = -32768;
if (l_mix > 32767)
l_mix = 32767;
if (l_mix < -0x8000)
l_mix = -0x8000;
if (l_mix > 0x7FFF)
l_mix = 0x7FFF;
dst[0] = l_mix;
r_mix = 0.7f * (attenuation * curPtr[1] >> 15);
if (r_mix < -32768)
r_mix = -32768;
if (r_mix > 32767)
r_mix = 32767;
if (r_mix < -0x8000)
r_mix = -0x8000;
if (r_mix > 0x7FFF)
r_mix = 0x7FFF;
dst[1] = r_mix;
+1 -1
View File
@@ -1468,7 +1468,7 @@ void daNpcPhoto_c::eventSetEyeInit() {
/* 000030F0-000031F0 .text eventSetEye__12daNpcPhoto_cFv */
bool daNpcPhoto_c::eventSetEye() {
daPy_lk_c* link = daPy_getPlayerLinkActorClass();
s16 temp = link->shape_angle.y + cM_ssin(field_0x9B0) * 12288.0f;
s16 temp = link->shape_angle.y + cM_ssin(field_0x9B0) * 0x3000;
field_0x9B0 += 0x400;
mEyePos.x = 0.0f;
mEyePos.y = 0.0f;
+1 -1
View File
@@ -73,7 +73,7 @@ void nzg_00_move(nzg_class* i_this) {
parameters |= 1;
csXyz child_angle = actor->current.angle;
child_angle.y += cM_rndFX(8192.0f);
child_angle.y += cM_rndFX(0x2000);
fpc_ProcID childProcID = fopAcM_createChild(fpcNm_NZ_e, fopAcM_GetID(actor), parameters, &actor->current.pos, fopAcM_GetRoomNo(actor), &child_angle, &actor->scale, NULL);
if (childProcID != fpcM_ERROR_PROCESS_ID_e) {
+1 -1
View File
@@ -48,7 +48,7 @@ BOOL daObjYboil_c::CreateHeap() {
void daObjYboil_c::pos_reset(int i) {
mMdlScale[i].setall(mScaleMin + cM_rndF(mScaleMax - mScaleMin));
f32 dist = 1300.0f + cM_rndF(1400.0f);
s16 angle = cM_rndF(65536.0f);
s16 angle = cM_rndF(0x10000);
mMdlPos[i].x = current.pos.x + dist * cM_ssin(angle);
mMdlPos[i].y = current.pos.y;
mMdlPos[i].z = current.pos.z + dist * cM_scos(angle);
+1 -1
View File
@@ -832,7 +832,7 @@ void daObjBarrel2::Act_c::buoy_jump(float speed) {
if (m460 != fpcM_ERROR_PROCESS_ID_e) {
daObjBuoyflag::Act_c* buoy = (daObjBuoyflag::Act_c*)fopAcM_SearchByID(m460);
if (buoy != NULL) {
s16 rnd = cM_rndFX(32768.0f);
s16 rnd = cM_rndFX(0x8000);
buoy->speed.y = speed;
buoy->speedF = 50.0f;
buoy->current.angle.y = rnd;
+1 -1
View File
@@ -417,7 +417,7 @@ bool daObjComing::Act_c::barrel2_get_param(daObjComing::PrmBarrel2_c* barrel2) {
barrel2->m14 = barrel2_get_buoy(uVar5);
s16 angle = cLib_targetAngleY(fopAcM_GetPosition_p(ship), (cXyz*)&sp08.m0C);
s16 rnd = cM_rndFX(8192.0f);
s16 rnd = cM_rndFX(0x2000);
barrel2->mAngleY = angle + rnd;
return true;
}
+3 -3
View File
@@ -11,7 +11,7 @@ namespace daObjHlift {
namespace {
int L_time_lag_num;
static const Attr_c L_attr = { 30.0f, 50.0f, 10.0f, 2.0f, 0.3f, 1.2f, 250.0f, 10, 16384, 2.5f, 0x00, 0x02, 0x0a, 0x08, 0x07, 0x00, 0x00, 0x00 };
static const Attr_c L_attr = { 30.0f, 50.0f, 10.0f, 2.0f, 0.3f, 1.2f, 250.0f, 10, 0x4000, 2.5f, 0x00, 0x02, 0x0a, 0x08, 0x07, 0x00, 0x00, 0x00 };
} // namespace
Mtx Act_c::M_tmp_mtx;
@@ -243,14 +243,14 @@ void daObjHlift::Act_c::init_mtx() {
/* 00000C40-00000C8C .text rot_set__Q210daObjHlift5Act_cFv */
void daObjHlift::Act_c::rot_set() {
f32 fVar1 = current.pos.y - home.pos.y;
f32 fVar2 = (65536.0f/L_attr.field_0x18);
f32 fVar2 = (0x10000 / L_attr.field_0x18);
shape_angle.y = -(s16)(int)(fVar1 * fVar2);
}
/* 00000C8C-00000CA8 .text vib_set__Q210daObjHlift5Act_cFv */
void daObjHlift::Act_c::vib_set() {
field_0x2E8 = L_attr.field_0x1C;
field_0x2EA = 16384;
field_0x2EA = 0x4000;
}
/* 00000CA8-00000D70 .text vib_proc__Q210daObjHlift5Act_cFv */
+1 -1
View File
@@ -596,7 +596,7 @@ BOOL Act_c::process_falldown_init() {
} else {
field_0x7D6 = 120;
}
field_0x7DC = cM_rndFX(3072.0f);
field_0x7DC = cM_rndFX(0xC00);
return TRUE;
}
+2 -2
View File
@@ -200,7 +200,7 @@ void daObjIce_c::tg_hitCallback(fopAc_ac_c* a_this, dCcD_GObjInf* arg1, fopAc_ac
if (i_this->m44C < 0.0f) {
i_this->m44C = 0.0f;
}
i_this->m450 = 1.0f - cM_scos(i_this->m44C * 16384.0f);
i_this->m450 = 1.0f - cM_scos(i_this->m44C * 0x4000);
if (i_this->m44C < 0.1f) {
i_this->m45C = 1;
}
@@ -377,7 +377,7 @@ void daObjIce_c::fade_out_retire_act_proc() {
m454 = 0.0f;
}
f32 tmp3 = 1.0f - cM_scos(tmp2 * 16384.0f);
f32 tmp3 = 1.0f - cM_scos(tmp2 * 0x4000);
m44C = tmp2;
m450 = tmp3;
+4 -4
View File
@@ -1317,8 +1317,8 @@ void daObj_Ikada_c::createInit() {
mSvId[3] = fopAcM_createChild("Sv3", fopAcM_GetID(this), 0xffffffff, &current.pos, tevStr.mRoomNo, 0, 0, 0);
}
mLightRotY = cM_rndF(32768.0f);
mLightRotX = cM_rndF(32768.0f);
mLightRotY = cM_rndF(0x8000);
mLightRotX = cM_rndF(0x8000);
current.pos.y = dLib_getWaterY(current.pos, mObjAcch);
mpBgW->SetGrpRoomInf(fopAcM_GetRoomNo(this));
@@ -1374,8 +1374,8 @@ void daObj_Ikada_c::createInit() {
mFlagScale = flag_scale[mType];
}
mWave.mAnimX = cM_rndF(32768.0f);
mWave.mAnimZ = cM_rndF(32768.0f);
mWave.mAnimX = cM_rndF(0x8000);
mWave.mAnimZ = cM_rndF(0x8000);
if (mType == 4) {
mpModel->calc();
+1 -1
View File
@@ -67,7 +67,7 @@ void daObjLpalm_c::CreateInit() {
mAnimDir[0] = 0;
mAnimDir[1] = 0;
mAnimWave[0] = 0;
mAnimWave[1] = cM_rndFX(32768.0f);
mAnimWave[1] = cM_rndFX(0x8000);
fopAcM_SetMtx(this, mModel->getBaseTRMtx());
fopAcM_setCullSizeBox(this, -350.0f, -50.0f, -350.0f, 350.0f, 1300.0f, 350.0f);
fopAcM_setCullSizeFar(this, 2.37f);
+1 -1
View File
@@ -238,7 +238,7 @@ void daObjMshokki_c::set_se() {
#else
if (abs(tmp) < (s32)HIO(m18)) {
#endif
s16 uVar4 = (shape_angle.x / l_data[m60C].m0C) * 16384.0f;
s16 uVar4 = (shape_angle.x / l_data[m60C].m0C) * 0x4000;
if (uVar4 > 0x4000) {
uVar4 = 0x4000;
}
+14 -14
View File
@@ -44,34 +44,34 @@ static daObjOhatch_HIO_c l_HIO;
daObjOhatch_HIO_c::daObjOhatch_HIO_c() {
mNo = -1;
m08 = -4096.0f;
m0C = -16384.0f;
m08 = -0x1000;
m0C = -0x4000;
m10 = 0.0f;
m14 = -25.0f;
m18 = 190.0f;
m1C = 1.0f;
m20 = 8192.0f;
m24 = 131072.0f;
m20 = 0x2000;
m24 = 0x20000;
m28 = 6.0f;
m2C = -64.0f;
m30 = 1024.0f;
m34 = 8192.0f;
m30 = 0x400;
m34 = 0x2000;
m38 = 0;
}
#else
namespace L_HIO {
static const f32 m08 = -4096.0f;
static const f32 m0C = -16384.0f;
static const f32 m08 = -0x1000;
static const f32 m0C = -0x4000;
static const f32 m10 = 0.0f;
static const f32 m14 = -25.0f;
static const f32 m18 = 190.0f;
static const f32 m1C = 1.0f;
static const f32 m20 = 8192.0f;
static const f32 m24 = 131072.0f;
static const f32 m20 = 0x2000;
static const f32 m24 = 0x20000;
static const f32 m28 = 6.0f;
static const f32 m2C = -64.0f;
static const f32 m30 = 1024.0f;
static const f32 m34 = 8192.0f;
static const f32 m30 = 0x400;
static const f32 m34 = 0x2000;
static const u8 m38 = 0;
} // namespace L_HIO
#endif
@@ -246,10 +246,10 @@ void daObjOhatch_c::tremor_act_proc() {
/* 000008A4-00000A00 .text open_act_proc__13daObjOhatch_cFv */
void daObjOhatch_c::open_act_proc() {
#if VERSION == VERSION_DEMO
f32 uVar3 = (cM_ssin(m2D8 / HIO(m0C) * 32768.0f) + HIO(m1C)) / (HIO(m1C) + 1.0f);
f32 uVar3 = (cM_ssin(m2D8 / HIO(m0C) * 0x8000) + HIO(m1C)) / (HIO(m1C) + 1.0f);
s32 uVar2 = HIO(m08) * uVar3;
#else
f32 sin = m2D8 / HIO(m0C) * 32768.0f;
f32 sin = m2D8 / HIO(m0C) * 0x8000;
s32 uVar2 = (cM_ssin(sin) + HIO(m1C)) / (HIO(m1C) + 1.0f) * HIO(m08);
#endif
m2D8 += uVar2;
+2 -2
View File
@@ -227,8 +227,8 @@ bool daObj_Stair_c::_execute() {
if(temp2.abs() > 8e-11f){
cXyz temp3 = temp2.normZP();
f32 temp4 = l_HIO.m10 * 0.5f * field_0x2C8.abs() * 0.01f * field_0x2EC;
sin = cM_ssin(temp4 * 182.04445f);
cos = cM_scos(temp4 * 182.04445f);
sin = cM_ssin(DEG2S(temp4));
cos = cM_scos(DEG2S(temp4));
// misses inline cM_deg2s?
field_0x4B0.x = sin * temp3.x;
+2 -2
View File
@@ -913,8 +913,8 @@ void daOship_c::createInit() {
mCyl[i].SetStts(&mStts);
}
mWave.mAnimX = cM_rndF(32768.0f);
mWave.mAnimZ = cM_rndF(32768.0f);
mWave.mAnimX = cM_rndF(0x8000);
mWave.mAnimZ = cM_rndF(0x8000);
setMtx();
mpModel->calc();
+3 -3
View File
@@ -85,9 +85,9 @@ int daPy_lk_c::setShapeFanLeaf() {
if (mpEquipItemModel != NULL) {
mtl = mpEquipItemModel->getModelData()->getJointNodePointer(FAN_JNT_CL_FAN_e)->getMesh()->getNext();
}
m355C = m355C + 0x82f;
m3558 = 1536.0f * cM_ssin(m355C);
m355A = 2048.0f * cM_ssin(m355C - 0xe00U);
m355C = m355C + 0x82F;
m3558 = 0x600 * cM_ssin(m355C);
m355A = 0x800 * cM_ssin(m355C - 0xE00);
if (dComIfGs_getMagic() >= 1) {
// Show material:
// * "leafAMat"
+3 -3
View File
@@ -7583,7 +7583,7 @@ BOOL daPy_lk_c::procDamage() {
dVar6 = (mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() - m_HIO->mDam.mDamage.m.field_0x28);
cLib_addCalcAngleS(&m3564.y, 0, 4, 0x800, 0x100);
if (dVar6 < 0.0f) {
uVar4 = ((16384.0f * mFrameCtrlUnder[UNDER_MOVE0_e].getFrame()) /
uVar4 = ((0x4000 * mFrameCtrlUnder[UNDER_MOVE0_e].getFrame()) /
m_HIO->mDam.mDamage.m.field_0x28);
fVar1 = cM_ssin(uVar4);
if (uVar4 < 0x2000) {
@@ -7593,7 +7593,7 @@ BOOL daPy_lk_c::procDamage() {
}
fVar2 = cM_ssin(uVar4);
} else {
uVar4 = (16384.0f * (1.0f - (dVar6 / (mFrameCtrlUnder[UNDER_MOVE0_e].getEnd() -
uVar4 = (0x4000 * (1.0f - (dVar6 / (mFrameCtrlUnder[UNDER_MOVE0_e].getEnd() -
m_HIO->mDam.mDamage.m.field_0x28))));
fVar1 = 1.0f - cM_scos(uVar4);
fVar2 = 1.0f - cM_scos(uVar4 < 0x2000 ? 0 : (s16)((uVar4 - 0x2000) * 2));
@@ -7689,7 +7689,7 @@ BOOL daPy_lk_c::procLargeDamage_init(int param_1, int param_2, s16 param_3, s16
current.angle.y = cM_atan2s(damage_vec->x, damage_vec->z);
}
sVar3 = current.angle.y - shape_angle.y;
if (std::abs(sVar3) < 8192.0f) {
if (std::abs(sVar3) < 0x2000) {
if (sVar3 >= 0) {
sVar3 = 0x2000;
} else {
+1 -1
View File
@@ -181,7 +181,7 @@ void daPy_sightPacket_c::setSight() {
f32 temp_f3 = 0.65f + (0.35f * var_f2);
mDoMtx_stack_c::scaleM(temp_f3 * mpImg->width, temp_f3 * mpImg->height, temp_f3);
mDoMtx_stack_c::ZrotM(32768.0f * cM_ssin(16384.0f * var_f31));
mDoMtx_stack_c::ZrotM(0x8000 * cM_ssin(0x4000 * var_f31));
} else {
mDoMtx_stack_c::scaleM(10.0f, 10.0f, 10.0f);
}
+2 -2
View File
@@ -1133,10 +1133,10 @@ BOOL daPy_lk_c::procRopeSwingStart() {
if (!cLib_addCalcAngleS(&shape_angle.x, mProcVar2.m34D4, 5, 0xa0, 0x40)) {
if (mProcVar2.m34D4 > 0) {
setSingleMoveAnime(ANM_ROPESWINGF, 1.0f, 0.0f, -1, 10.0f);
mProcVar2.m34D4 = -4096.0f * m35A4;
mProcVar2.m34D4 = -0x1000 * m35A4;
} else {
setSingleMoveAnime(ANM_ROPESWINGB, 1.0f, 0.0f, -1, 10.0f);
mProcVar2.m34D4 = 4096.0f * m35A4;
mProcVar2.m34D4 = 0x1000 * m35A4;
}
mProcVar0.m34D0 = 1;
if (DEMO_SELECT(!strcmp(dComIfGp_getStartStageName(), "GanonK"), checkSpecialRope())) {
+1 -1
View File
@@ -322,7 +322,7 @@ void action_dousa(pw_class* i_this) {
anm_init(i_this, dRes_INDEX_PW_BCK_IDOU2_e, 7.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1);
}
}
i_this->m38C += (s16)cM_rndFX(16384.0f);
i_this->m38C += (s16)cM_rndFX(0x4000);
if (i_this->mPathIndex != 0xFF && i_this->mpPath != NULL) {
i_this->mMode = 0x14;
} else {
+1 -1
View File
@@ -542,7 +542,7 @@ void daSea_packet_c::execute(cXyz& pos) {
aThetaXTable[i] = mWaveInfo.GetKm(i) * mWaveInfo.GetVx(i);
aThetaZTable[i] = mWaveInfo.GetKm(i) * mWaveInfo.GetVz(i);
aOffsAnimTable[i] = 65536.0f * (mWaveInfo.GetRatio(i) - 0.5f);
aOffsAnimTable[i] = 0x10000 * (mWaveInfo.GetRatio(i) - 0.5f);
aHeightTable[i] = mWaveInfo.GetBaseHeight(i) * scale;
}
+14 -15
View File
@@ -1219,9 +1219,9 @@ void daShip_c::setCrashData(short param1) {
iVar5 = param1 - shape_angle.y;
fVar1 = cM_ssin(iVar5);
fVar2 = cM_scos(iVar5);
m0370 += fVar2 * 3072.0f;
m0370 += fVar2 * 0xC00;
m0374 += fVar2 * 500.0f;
m0372 -= fVar1 * 3072.0f;
m0372 -= fVar1 * 0xC00;
m0376 -= fVar1 * 500.0f;
m03B6 = 30;
}
@@ -1393,7 +1393,7 @@ void daShip_c::setSelfMove(int param_1) {
float fVar6;
if (param_1) {
sVar2 = mStickMVal * 8192.0f * -cM_ssin(mStickMAng);
sVar2 = mStickMVal * 0x2000 * -cM_ssin(mStickMAng);
}
else {
sVar2 = 0;
@@ -1624,7 +1624,7 @@ BOOL daShip_c::procSteerMove() {
if (checkNextMode(MODE_STEER_MOVE_e)) {
return TRUE;
}
cLib_addCalcAngleS(&m0366, mStickMVal * 8192.0f * -cM_ssin(mStickMAng), 4, l_HIO.tiller_speed, 0x100);
cLib_addCalcAngleS(&m0366, mStickMVal * 0x2000 * -cM_ssin(mStickMAng), 4, l_HIO.tiller_speed, 0x100);
if (!checkStateFlg(daSFLG_FLY_e)) {
setMoveAngle(m0366);
}
@@ -2030,19 +2030,19 @@ BOOL daShip_c::procCraneUp() {
if (cLib_distanceAngleS(m036C, m03A6) < 0x400) {
if (mCraneBaseAngle > 0) {
if (m03A6 > 0x400) {
m03A6 = cM_rnd() * 256.0f;
m03A6 = cM_rnd() * 0x100;
}
else {
m03A6 = cM_rnd() * 1024.0f + 2048.0f;
m03A6 = cM_rnd() * 0x400 + 0x800;
seStart(JA_SE_LK_SHIP_CRANE_SALVAGE, &current.pos);
}
}
else {
if (m03A6 < -0x400) {
m03A6 = cM_rnd() * -256.0f;
m03A6 = cM_rnd() * -0x100;
}
else {
m03A6 = -2048.0f - cM_rnd() * 1024.0f;
m03A6 = -0x800 - cM_rnd() * 0x400;
seStart(JA_SE_LK_SHIP_CRANE_SALVAGE, &current.pos);
}
}
@@ -2876,7 +2876,7 @@ BOOL daShip_c::procWhirlDown_init() {
/* 00007A90-00007BEC .text procWhirlDown__8daShip_cFv */
BOOL daShip_c::procWhirlDown() {
shape_angle.y += (m0408 / (2*M_PI)) * 65536.0f;
shape_angle.y += (m0408 / (2*M_PI)) * 0x10000;
if (mWhirlActor) {
#if VERSION == VERSION_DEMO
if (cLib_addCalcPosXZ(&current.pos, mWhirlActor->current.pos, 1.0f, speedF, 10.0f) < 10.0f)
@@ -3706,20 +3706,19 @@ BOOL daShip_c::execute() {
if (mTornadoActor) {
s16 sVar16;
sVar16 = shape_angle.y;
cLib_addCalcAngleS(&shape_angle.y, m040C * 10430.378f + 20480.0f, 5, 0x2000, 0x200);
cLib_addCalcAngleS(&shape_angle.y, RAD2S(m040C) + 0x5000, 5, 0x2000, 0x200);
setControllAngle(getAimControllAngle(sVar16));
current.angle.y = shape_angle.y;
}
else {
if (mWhirlActor) {
s16 sVar16;
sVar16 = shape_angle.y;
s16 sVar16 = shape_angle.y;
s16 sVar5;
if (m0352) {
sVar5 = m040C * 10430.378f + 20480.0f;
sVar5 = RAD2S(m040C) + 0x5000;
}
else {
sVar5 = m040C * 10430.378f + 32768.0f;
sVar5 = RAD2S(m040C) + 0x8000;
}
cLib_addCalcAngleS(&shape_angle.y, sVar5, 5, 0x2000, 0x200);
setControllAngle(getAimControllAngle(sVar16));
@@ -4013,7 +4012,7 @@ BOOL daShip_c::execute() {
mDoMtx_multVecZero(mpCannonModel->getAnmMtx(VFNCN_JNT_CANON2_e), &m1038);
if (mProc != &daShip_c::procCannon) {
m0396 = getAnglePartRate() * 16384.0f;
m0396 = getAnglePartRate() * 0x4000;
m0394 *= getAnglePartRate();
}
+6 -6
View File
@@ -2049,7 +2049,7 @@ static void part_move(st_class* i_this, int jointIndex) {
}
}
if ((i_this->m0ED3 == 2) || (i_this->m0ED3 == 0xb)) {
this_part->m3E = cM_rndF(65536.0f);
this_part->m3E = cM_rndF(0x10000);
this_part->m44 = 0.0f;
if (jointIndex == ST_JNT_BUKI_e) {
if ((heldWeapon != NULL) && (!fopAcM_checkCarryNow(heldWeapon))) {
@@ -2083,7 +2083,7 @@ static void part_move(st_class* i_this, int jointIndex) {
case 6:
#if VERSION > VERSION_DEMO
if ((i_this->m1DDC == 0) && (this_part->mPartVelocity.y <= 0.0f)) {
this_part->m3E = cM_rndF(65536.0f);
this_part->m3E = cM_rndF(0x10000);
this_part->m44 = 0.0f;
this_part->mPartState = 1;
this_part->mWaitTimer = 0;
@@ -2123,7 +2123,7 @@ static void part_move(st_class* i_this, int jointIndex) {
cLib_addCalcAngleS2(&this_part->mPartRot.y, i_this->m1DDA, 2, 0xc00);
#if VERSION == VERSION_DEMO
if (i_this->m1DDC == 0) {
this_part->m3E = cM_rndF(65536.0f);
this_part->m3E = cM_rndF(0x10000);
this_part->m44 = 0.0f;
this_part->mPartState = 1;
this_part->mWaitTimer = 0;
@@ -2151,7 +2151,7 @@ static void part_move(st_class* i_this, int jointIndex) {
}
this_part->mPartVelocity.setall(0.0f);
if (i_this->m1DDC == 0) {
this_part->m3E = cM_rndF(65536.0f);
this_part->m3E = cM_rndF(0x10000);
this_part->m44 = 0.0f;
this_part->mPartState = 1;
this_part->mWaitTimer = 0;
@@ -2162,7 +2162,7 @@ static void part_move(st_class* i_this, int jointIndex) {
}
#else
if ((i_this->m1DDC == 0) && (this_part->mPartVelocity.y <= 0.0f)) {
this_part->m3E = cM_rndF(65536.0f);
this_part->m3E = cM_rndF(0x10000);
this_part->m44 = 0.0f;
this_part->mPartState = 1;
this_part->mWaitTimer = 0;
@@ -2246,7 +2246,7 @@ static void part_move(st_class* i_this, int jointIndex) {
this_part->mPartRotAdd = local_88;
this_part->mPartRot = this_part->mPartRotAdd;
}
this_part->m3E = cM_rndF(65536.0f);
this_part->m3E = cM_rndF(0x10000);
this_part->mWaitTimer = 0;
this_part->m44 = 0.5f;
this_part->m05 = 1;
+2 -2
View File
@@ -203,7 +203,7 @@ cPhs_State Act_c::_create() {
if (fopAcM_entrySolidHeap(this, CreateHeapCB, data().m78)) {
#endif
if (home.angle.y == 0 && !(data().m70 & 0x10)) {
home.angle.y = cM_rndFX(32768.0f);
home.angle.y = cM_rndFX(0x8000);
current.angle.y = home.angle.y;
shape_angle.y = home.angle.y;
}
@@ -667,7 +667,7 @@ void Act_c::init_mtx() {
void Act_c::init_rot_throw() {
m67C.Val(data().m28);
m67C *= cM_rnd();
m67E.Val((s16)cM_rndFX(32768.0f));
m67E.Val((s16)cM_rndFX(0x8000));
m680.Val(data().m2A);
m682.Val(cSAngle::_0);
m684.Val(data().m2C);
+1 -1
View File
@@ -357,7 +357,7 @@ void daTitle_proc_c::calc_2d_alpha() {
pos.set(pane[4].mPosTopLeftOrig.x - 320.0f, pane[4].mPosTopLeftOrig.y - 240.0f, 0.0f);
csXyz angle;
angle.x = (s16)cM_rndFX(32768.0f);
angle.x = (s16)cM_rndFX(0x8000);
angle.y = 0;
angle.z = (s16)cM_rndFX(4000.0f);
+1 -1
View File
@@ -2101,7 +2101,7 @@ static void yogan_fail(tn_class* i_this) {
dComIfGp_particle_setSimple(dPa_name::ID_IT_SN_O_FIREK_KASU, &actor->current.pos);
dComIfGp_particle_setSimple(dPa_name::ID_IT_SN_O_MAGT_FCHIP, &actor->current.pos);
if (!(i_this->m03D8 & 3)) {
i_this->m0428.y = cM_rndF(65536.0f);
i_this->m0428.y = cM_rndF(0x10000);
i_this->m0428.x = -0x2000;
dComIfGp_particle_set(dPa_name::ID_AK_JN_TUBA00, &i_this->m1384, &i_this->m0428);
}
+3 -3
View File
@@ -2069,8 +2069,8 @@ void Act_c::mode_afl_init() {
cLib_offBit<u32>(attention_info.flags, fopAc_Attn_ACTION_CARRY_e);
m804 = cM_rndFX(32768.0f);
m806 = cM_rndFX(32768.0f);
m804 = cM_rndFX(0x8000);
m806 = cM_rndFX(0x8000);
m678 = 7;
}
@@ -2930,7 +2930,7 @@ void Act_c::set_tensor(const cXyz* pos) {
void Act_c::init_rot_throw() {
m688.Val(data().m28);
m688 *= cM_rnd();
m68A.Val((s16)cM_rndFX(32768.0f));
m68A.Val((s16)cM_rndFX(0x8000));
m68C.Val(data().m2A);
m68E.Val(cSAngle::_0);
m690.Val(data().m2C);
+1 -1
View File
@@ -292,7 +292,7 @@ s32 check_flontofplayer(u32 checkMask, s16 angle1, s16 angle2) {
/* 8009DC28-8009DC74 .text distace_weight__Ffsf */
f32 distace_weight(f32 distance, s16 angle, f32 ratio) {
f32 turns = (f32)angle / 32768.0F;
f32 turns = (f32)angle / 0x8000;
return distance * (f32)((1.0F - ratio) + (f32)(ratio * (turns * turns)));
}
+1 -1
View File
@@ -84,5 +84,5 @@ void dMagma_ballBoss_c::setup(f32 param_1, u8 param_2, int param_3) {
}
field_0x7C = (cM_rndF(100.0f) + 400.0f);
mWave = (cM_rndF(8.0f) * 4096.0f);
mWave = (cM_rndF(8.0f) * 0x1000);
}
+1 -1
View File
@@ -147,7 +147,7 @@ dCamBGChk_c::dCamBGChk_c() {
}
static f32 dummy() {
return 182.04445f;
return DEG2S_CONSTANT;
}
/* 800AF8F4-800AF930 .text __ct__11dCamParam_cFl */
+2 -2
View File
@@ -239,7 +239,7 @@ void dCamera_c::initialize(camera_class* camera, fopAc_ac_c* playerActor, u32 ca
mEventFlags = 0;
m148 = cSAngle::_0;
m07C = 0;
m080 = cM_rndFX(32767.0f);
m080 = cM_rndFX(0x7FFF);
m064 = 1.0f;
m5F4 = 0.0f;
mTrimHeight = 0.0f;
@@ -4461,7 +4461,7 @@ bool dCamera_c::nonOwnerCamera(s32 param_1) {
if (m11C == 0) {
mViewCache.mCenter = relationalPos(mpLockonTarget, &local_90);
mViewCache.mDirection.Val(f27, f26 * 182.04445f, directionOf(mpLockonTarget).Inv());
mViewCache.mDirection.Val(f27, DEG2S(f26), directionOf(mpLockonTarget).Inv());
mViewCache.mEye = mViewCache.mCenter + mViewCache.mDirection.Xyz();
mViewCache.mFovy = f31;
m100 = 1;
+5 -5
View File
@@ -96,10 +96,10 @@ void dDlst_2DT_c::draw() {
f32 texH = mTexH;
f32 xo = ((mX1 - mX0) * 0.5f) / mScaleX;
f32 yo = ((mY1 - mY0) * 0.5f) / mScaleY;
u16 s0 = ((mCenterX - xo) / texW) * 32768.0f;
u16 t0 = ((mCenterY - yo) / texH) * 32768.0f;
u16 s1 = ((mCenterX + xo) / texW) * 32768.0f;
u16 t1 = ((mCenterY + yo) / texH) * 32768.0f;
u16 s0 = ((mCenterX - xo) / texW) * 0x8000;
u16 t0 = ((mCenterY - yo) / texH) * 0x8000;
u16 s1 = ((mCenterX + xo) / texW) * 0x8000;
u16 t1 = ((mCenterY + yo) / texH) * 0x8000;
GXTexObj texObj;
GXInitTexObj(&texObj, mpTexData, mTexW, mTexH, (GXTexFmt)mTexFmt, GX_CLAMP, GX_CLAMP, GX_FALSE);
@@ -723,7 +723,7 @@ void dDlst_effectLine_c::draw() {
for (s32 i = 0; i < numSegments; i++) {
cXyz pt0, pt1;
s16 angle = mRnd.getFX(32767.0f);
s16 angle = mRnd.getFX(0x7FFF);
f32 rad0 = mRnd.getValue(field_0x28, field_0x2C);
pt0.x = mPos.x + rad0 * cM_ssin(angle);
+3 -3
View File
@@ -590,9 +590,9 @@ void dScnKy_env_light_c::setSunpos() {
var_f1 = g_env_light.mCurTime + 345.0f;
}
sp8.x = std::sinf(DEG_TO_RAD(var_f1)) * 80000.0f;
sp8.y = std::cosf(DEG_TO_RAD(var_f1)) * 80000.0f;
sp8.z = std::cosf(DEG_TO_RAD(var_f1)) * -48000.0f;
sp8.x = std::sinf(DEG2RAD(var_f1)) * 80000.0f;
sp8.y = std::cosf(DEG2RAD(var_f1)) * 80000.0f;
sp8.z = std::cosf(DEG2RAD(var_f1)) * -48000.0f;
if (dComIfGp_event_runCheck() == FALSE || g_env_light.mInitAnimTimer != 0) {
mSunPos.x = camera_p->mLookat.mEye.x + sp8.x;
+10 -10
View File
@@ -133,8 +133,8 @@ void dKyr_kamome_move() {
case 0:
if (spawnBirds) {
if (pWind->mKamomeEff[i].mTimer == 0) {
pWind->mKamomeEff[i].mAngleY = cM_rndFX(65535.0f);
pWind->mKamomeEff[i].mAngleX = cM_rndFX(65535.0f);
pWind->mKamomeEff[i].mAngleY = cM_rndFX(0xFFFF);
pWind->mKamomeEff[i].mAngleX = cM_rndFX(0xFFFF);
newPos.x = pCamera->mLookat.mEye.x + cM_ssin(pWind->mKamomeEff[i].mAngleY) * 7000.0f;
newPos.y = 4500.0f;
newPos.z = pCamera->mLookat.mEye.z + cM_scos(pWind->mKamomeEff[i].mAngleY) * 7000.0f;
@@ -343,7 +343,7 @@ void dKyr_wind_move() {
windEff.mPos.y -= windVec.y * windScale;
windEff.mPos.z -= windVec.z * windScale;
windEff.field_0x2c = cM_rndF(65535.0f);
windEff.field_0x2c = cM_rndF(0xFFFF);
cXyz pos;
pos.x = windEff.mBasePos.x + windEff.mPos.x;
@@ -498,7 +498,7 @@ void dKyr_lenzflare_move() {
s16 angle = cM_atan2s(vectle.x, vectle.y);
pLenzPkt->mAngleDeg = angle;
pLenzPkt->mAngleDeg *= 0.005493164f;
pLenzPkt->mAngleDeg *= S2DEG_CONSTANT;
pLenzPkt->mAngleDeg += 180.0f;
dKyr_get_vectle_calc(&pCamera->mLookat.mEye, &pCamera->mLookat.mCenter, &camFwd);
@@ -1106,7 +1106,7 @@ void dKyr_housi_move() {
case 0:
effect->field_0x34 = cM_rndF(1.5f) + 0.2f;
effect->field_0x3c = 0;
effect->field_0x4c = cM_rndFX(65536.0f);
effect->field_0x4c = cM_rndFX(0x10000);
effect->mBasePos.x = sp84.x;
effect->mBasePos.y = sp84.y;
effect->mBasePos.z = sp84.z;
@@ -1399,9 +1399,9 @@ void wave_move() {
pPkt->mEff[i].mPos.x = cM_rndFX(g_env_light.mWaveChan.mWaveSpawnRadius);
pPkt->mEff[i].mPos.y = 0.0f;
pPkt->mEff[i].mPos.z = cM_rndFX(g_env_light.mWaveChan.mWaveSpawnRadius);
pPkt->mEff[i].mCounter = cM_rndF(65536.0f);
pPkt->mEff[i].mCounter = cM_rndF(0x10000);
pPkt->mEff[i].mAlpha = 0.0f;
pPkt->mEff[i].field_0x32 = cM_rndF(65536.0f);
pPkt->mEff[i].field_0x32 = cM_rndF(0x10000);
pPkt->mEff[i].mStrengthEnv = 1.0f;
pPkt->mEff[i].mScale = g_env_light.mWaveChan.mWaveScaleRand + cM_rndF(1.0f - g_env_light.mWaveChan.mWaveScaleRand);
pPkt->mEff[i].mSpeed = pPkt->mEff[i].mScale;
@@ -1562,7 +1562,7 @@ void cloud_shadow_move() {
pPkt->mEff[i].mPos.z = cM_rndFX(2000.0f);
pPkt->mEff[i].mWindSpeed = 0.7f + cM_rndF(0.3f);
pPkt->mEff[i].mAlpha = 0.0;
pPkt->mEff[i].mAnimCounter = cM_rndF(65535.0f);
pPkt->mEff[i].mAnimCounter = cM_rndF(0xFFFF);
pPkt->mEff[i].mVelRndm.x = cM_rndFX(360.0f);
pPkt->mEff[i].mVelRndm.y = cM_rndFX(360.0f);
pPkt->mEff[i].mVelRndm.z = cM_rndFX(360.0f);
@@ -2949,7 +2949,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** pImg) {
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
MTXRotRad(rotMtx, 'Z', DEG2RAD(rot));
MTXConcat(camMtx, rotMtx, camMtx);
GXLoadPosMtxImm(drawMtx, GX_PNMTX0);
@@ -3136,7 +3136,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** pImg) {
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
Mtx rotMtx;
MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot));
MTXRotRad(rotMtx, 'Z', DEG2RAD(rot));
MTXConcat(camMtx, rotMtx, camMtx);
GXLoadPosMtxImm(drawMtx, GX_PNMTX0);
+1 -1
View File
@@ -90,7 +90,7 @@ void dMagma_ballPath_c::setup(f32 offsY, u8 pathNo, int roomNo) {
mPos.z = pt->m_position.z + cM_rndFX(pt->mArg3 * 100.0f);
mScale = cM_rndF(1.0f) + 1.0f;
mBaseY = offsY - cM_rndF(20.0f);
mWave = cM_rndF(8.0f) * 4096.0f;
mWave = cM_rndF(8.0f) * 0x1000;
mPos.y = mBaseY + (cM_ssin(mWave) - 1.0f) * 100.0f;
mWaveTimer = 0;
mDoMtx_stack_c::transS(mPos);
+1 -1
View File
@@ -1830,7 +1830,7 @@ void dMap_c::drawPointAgbCursor(f32 param_1, f32 param_2) {
if (agbFlashCheck()) {
mMapAGBCursorFlashFrmCnt++;
mMapAGBCursorFlashFrmCnt = mMapAGBCursorFlashFrmCnt % 45;
f32 tmp = JMASSin(mMapAGBCursorFlashFrmCnt / 45.0f * 32768.0f) * JMASSin(mMapAGBCursorFlashFrmCnt / 45.0f * 32768.0f);
f32 tmp = JMASSin(mMapAGBCursorFlashFrmCnt / 45.0f * 0x8000) * JMASSin(mMapAGBCursorFlashFrmCnt / 45.0f * 0x8000);
color.r = 0;
color.g = tmp * 175.0f + 80.0f;
color.b = 0;
+2 -2
View File
@@ -4718,7 +4718,7 @@ void dMeter_menuPlusMove(sub_meter_class* i_Meter) {
cXyz* pcVar4 = dKyw_get_wind_vec();
iVar3 = cM_atan2s(pcVar4->x, pcVar4->z);
i_Meter->field_0x02f8.pane->rotate(
i_Meter->field_0x02f8.mSizeOrig.x, i_Meter->field_0x02f8.mSizeOrig.y / 2.0f, ROTATE_Z, (iVar3 * 180.0f) / 32768.0f - 180.0f
i_Meter->field_0x02f8.mSizeOrig.x, i_Meter->field_0x02f8.mSizeOrig.y / 2.0f, ROTATE_Z, (iVar3 * 180.0f) / 0x8000 - 180.0f
);
fopMsgM_paneTrans(&i_Meter->field_0x02c0, x, y);
fopMsgM_paneTrans(&i_Meter->field_0x02f8, (dVar13 - 7.0f) + g_meterHIO.field_0x64, (dVar12 + 9.0f) + g_meterHIO.field_0x66);
@@ -5223,7 +5223,7 @@ void dMeter_compassGetOnProc(sub_meter_class* i_Meter) {
dMeter_compassAnimeMove(i_Meter);
break;
}
f32 dVar3 = (-(s16)(fopAcM_SearchByName(fpcNm_SHIP_e)->shape_angle.y + 0x8000) * 180.0f) / 32768.0f;
f32 dVar3 = (-(s16)(fopAcM_SearchByName(fpcNm_SHIP_e)->shape_angle.y + 0x8000) * 180.0f) / 0x8000;
dMeter_compassRotate(&i_Meter->field_0x1670, &i_Meter->field_0x16a8, (-dComIfGs_getTime() - 90.0f));
dMeter_compassRotate(&i_Meter->field_0x1248, &i_Meter->field_0x12f0, dVar3);
dMeter_compassRotate(&i_Meter->field_0x1280, &i_Meter->field_0x12f0, dVar3);
+5 -5
View File
@@ -110,21 +110,21 @@ void dPa_J3DmodelEmitter_c::draw() {
sp44[2][1] = vel.z;
sp44[2][2] = tmp.z;
f32 f1 = params->mRotateAngle * 0.005493164f; // SAngle -> Degree conversion
f32 f1 = S2DEG(params->mRotateAngle);
if (f1) {
switch (field_0x26) {
case 0:
MTXRotRad(sp14, 'y', f1 * 0.017453292f); // Degree -> Radian conversion
MTXRotRad(sp14, 'y', DEG2RAD(f1));
break;
case 1:
MTXRotRad(sp14, 'x', f1 * 0.017453292f); // Degree -> Radian conversion
MTXRotRad(sp14, 'x', DEG2RAD(f1));
break;
case 2:
MTXRotRad(sp14, 'z', f1 * 0.017453292f); // Degree -> Radian conversion
MTXRotRad(sp14, 'z', DEG2RAD(f1));
break;
case 3:
Vec sp08 = {1.0f, 1.0f, 1.0f};
MTXRotAxisRad(sp14, &sp08, f1 * 0.017453292f); // Degree -> Radian conversion
MTXRotAxisRad(sp14, &sp08, DEG2RAD(f1));
break;
}
MTXConcat(sp44, sp14, sp44);
+1 -1
View File
@@ -401,7 +401,7 @@ void dJle_Pb_c::zoomScale() {
}
else {
f32 cameraZoomForcus = dComIfGp_getCameraZoomForcus(0);
mDoAud_seStart(JA_SE_TELESCOPE_ZOOM, NULL, cameraZoomForcus * 32768.0f + 0.5f);
mDoAud_seStart(JA_SE_TELESCOPE_ZOOM, NULL, cameraZoomForcus * 0x8000 + 0.5f);
}
}
}
+2 -2
View File
@@ -6367,10 +6367,10 @@ f32 fopMsgM_valueIncrease(int i_max, int i_value, u8 i_mode) {
ret = (v * 2.0f - 1.0f) * 2.0f - 1.0f;
break;
case 4:
ret = JMASSin(v * 32768.0f * 0.5f) * JMASSin(v * 32768.0f * 0.5f);
ret = JMASSin(v * 0x8000 * 0.5f) * JMASSin(v * 0x8000 * 0.5f);
break;
case 5:
ret = JMASSin(v * 65535.0f * 0.5f) * JMASSin(v * 65535.0f * 0.5f);
ret = JMASSin(v * 0xFFFF * 0.5f) * JMASSin(v * 0xFFFF * 0.5f);
break;
}
return ret;
+3 -3
View File
@@ -113,8 +113,8 @@ void mDoGaC_agbCom_c::mDoGaC_Initial(mDoGaC_DataManag_c* param_0, u8 param_1) {
field_0x114 = 0xFFFFFFFF;
field_0x118 = 0;
field_0x12c.U16._12e_1 = (u32)cM_rndF(32767.0f);
field_0x12c.U32bits._12c_2 = cM_rndF(32767.0f);
field_0x12c.U16._12e_1 = (u32)cM_rndF(0x7FFF);
field_0x12c.U32bits._12c_2 = cM_rndF(0x7FFF);
field_0x12c.U8._12c_0 = 1;
field_0x128 = 0;
}
@@ -153,7 +153,7 @@ void mDoGaC_agbCom_c::mDoGaC_GbaReboot() {
mDoGaC_ComStop();
u8 temp = field_0x0 = 0; // fakematch?
field_0x3 = 0;
field_0x12c.U32bits._12c_2 = cM_rndF(32767.0f);
field_0x12c.U32bits._12c_2 = cM_rndF(0x7FFF);
field_0x128 = temp;
}
+1 -1
View File
@@ -43,7 +43,7 @@ void mDoLib_clipper::setup(f32 fovY, f32 aspect, f32 n, f32 f) {
mSystemFar = f;
mClipper.calcViewFrustum();
s16 ang = (s16)(fovY * 182.04445f);
s16 ang = DEG2S(fovY);
mFovyRate = JMASCos(ang) / JMASSin(ang);
}