Matched m463Dll (US); applying some ext_math macros (#506)

This commit is contained in:
mrshigure 2025-01-04 18:52:39 -08:00 committed by GitHub
parent 391f320aec
commit d95b1af697
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 1637 additions and 207 deletions

View file

@ -7,7 +7,7 @@
#include "game/hsfmotion.h"
#include "game/pad.h"
#include "game/sprite.h"
#include "math.h"
#include "ext_math.h"
// bss
omObjData *lbl_1_bss_3A0[4];
@ -254,8 +254,8 @@ void fn_1_7344(omObjData *arg0)
lbl_1_bss_104 = temp_r31->unk0 + 1;
}
if (temp_r31->unk60 == 0) {
temp_f29 = (180.0 * (atan2((temp_r30->unk0.x - temp_r31->unk24.x), (temp_r30->unk0.z - temp_r31->unk24.z)) / M_PI));
temp_f30 = (180.0 * (atan2((temp_r31->unk24.y - temp_r30->unk0.y), (temp_r31->unk24.z - temp_r30->unk0.z)) / M_PI));
temp_f29 = atan2d(temp_r30->unk0.x - temp_r31->unk24.x, temp_r30->unk0.z - temp_r31->unk24.z);
temp_f30 = atan2d(temp_r31->unk24.y - temp_r30->unk0.y, temp_r31->unk24.z - temp_r30->unk0.z);
temp_f30 *= (1.0f - (0.015f * ABS(temp_f30)));
temp_r31->unk3C.x = fn_1_AD40(temp_r31->unk3C.x, temp_f30, 0.5f);
temp_r31->unk3C.y = fn_1_AD40(temp_r31->unk3C.y, temp_f29, 0.5f);
@ -524,7 +524,7 @@ void fn_1_8838(unkStruct8 *arg0)
if (temp_r31->unk74 > 90.0f) {
temp_r31->unk74 = 90.0f;
}
temp_f31 = sin((M_PI * temp_r31->unk74) / 180.0);
temp_f31 = sind(temp_r31->unk74);
temp_f30 = cosd(temp_r31->unk74);
sp18.x = temp_r30->unk0.x - temp_r31->unk58.x;
sp18.y = temp_r30->unk0.y - temp_r31->unk58.y;
@ -558,7 +558,7 @@ void fn_1_8838(unkStruct8 *arg0)
if (temp_r31->unk74 > 90.0f) {
temp_r31->unk74 = 90.0f;
}
temp_f31 = sin((M_PI * temp_r31->unk74) / 180.0);
temp_f31 = sind(temp_r31->unk74);
sp18.x = temp_r29->unkC.x - temp_r31->unk58.x;
sp18.y = temp_r29->unkC.y - temp_r31->unk58.y;
sp18.z = temp_r29->unkC.z - temp_r31->unk58.z;
@ -925,10 +925,10 @@ void fn_1_962C(omObjData *arg0)
fn_1_A584(var_r31);
Hu3DModelPosSet(var_r31->unk0, var_r31->unkC.x, var_r31->unkC.y, var_r31->unkC.z);
var_f31 = sin((var_r31->unk4C * M_PI) / 180.0);
var_f31 = sind(var_r31->unk4C);
var_r31->unk4C += 3.0f;
Hu3DModelRotSet(
var_r31->unk0, 8.0 * sin((var_r31->unk4C * 0.3 * M_PI) / 180.0), var_r31->unk4C * 0.05f, (-var_r31->unk18.z * 0.25f) + (var_f31 * 8.0f));
var_r31->unk0, 8.0 * sind(var_r31->unk4C * 0.3), var_r31->unk4C * 0.05f, (-var_r31->unk18.z * 0.25f) + (var_f31 * 8.0f));
}
if (lbl_1_bss_108 == 2 && var_r27 >= arg0->work[0]) {
@ -977,7 +977,7 @@ s32 fn_1_A584(unkStruct10 *arg0)
arg0->unkC.x += sp14.x;
arg0->unkC.y += sp14.y;
arg0->unkC.z += sp14.z;
var_f31 = (180.0 * (atan2(sp14.x, sp14.y) / M_PI));
var_f31 = atan2d(sp14.x, sp14.y);
if (var_f31 > 180.0f) {
var_f31 -= 360.0f;
}
@ -1000,7 +1000,7 @@ s32 fn_1_A584(unkStruct10 *arg0)
var_r31->unkC.x += sp8.x * (temp_f29 - temp_f30);
var_r31->unkC.y += sp8.y * (temp_f29 - temp_f30);
var_r31->unkC.z += sp8.z * (temp_f29 - temp_f30);
var_f31 = (180.0 * (atan2(sp8.x, sp8.y) / M_PI));
var_f31 = atan2d(sp8.x, sp8.y);
if (var_f31 > 180.0f) {
var_f31 -= 360.0f;
}

1423
src/REL/m463Dll/main.c Executable file

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,8 @@
#include "game/data.h"
#include "game/wipe.h"
#include "ext_math.h"
static s16 stopWin = -1;
static s16 wheelMdl = -1;
s16 lbl_801D3854 = -1;
@ -1330,7 +1332,7 @@ static void UpdateLotteryTicket(omObjData *object)
switch(work->state) {
case 2:
if(work->angle < 540) {
float scale = 0.4f+(0.1f*sin(M_PI*(float)(work->angle%180)/180.0));
float scale = 0.4f+(0.1f*sind((float)(work->angle%180)));
HuSprGrpScaleSet(work->group, scale, scale);
work->angle += 9;
} else {
@ -1511,7 +1513,7 @@ static void StartHostMove(Vec *from, Vec *to, s16 time)
omSetTra(object, from->x, from->y, from->z);
omSetRot(object, (to->x-from->x)/duration, 0.0f, (to->z-from->z)/duration);
omSetSca(object, to->x, to->y, to->z);
angle = 180.0*(atan2(object->rot.x, object->rot.z)/M_PI);
angle = atan2d(object->rot.x, object->rot.z);
work->angle = 0;
OSf32tos16(&angle, &work->angle_end);
BoardModelMotionShiftSet(hostMdl, hostMot[0], 0, 8, HU3D_MOTATTR_LOOP);

View file

@ -18,7 +18,7 @@
#include "game/objsub.h"
#include "game/pad.h"
#include "math.h"
#include "ext_math.h"
#include "stdlib.h"
static void InitJunction(s32, s32, f32);
@ -1152,7 +1152,7 @@ static void InitJunction(s32 arg0, s32 arg1, f32 arg8)
VECSubtract(&sp50, &sp68, &sp44);
VECNormalize(&sp44, &sp44);
angle = (180.0 * (atan2(sp44.x, sp44.z) / M_PI));
angle = atan2d(sp44.x, sp44.z);
if (angle < 0.0f) {
angle += 360.0f;
}
@ -1174,7 +1174,7 @@ static void InitJunction(s32 arg0, s32 arg1, f32 arg8)
temp_r29->unk_06[var_r27] = BoardModelCreate(DATA_MAKE_NUM(DATADIR_BOARD, 0), NULL, 1);
BoardModelRotSet(temp_r29->unk_06[var_r27], 0.0f, angle, 0.0f);
BoardModelLayerSet(temp_r29->unk_06[var_r27], 6);
sp5C.x = sp68.x + (100.0 * sin((M_PI * angle) / 180.0));
sp5C.x = sp68.x + 100.0 * sind(angle);
sp5C.y = 300.0f + sp68.y;
sp5C.z = (var_f29 + (sp68.z + (100.0 * cosd(angle))));
BoardModelPosSetV(temp_r29->unk_06[var_r27], &sp5C);
@ -1219,7 +1219,7 @@ static void UpdateJunctionGfx(omObjData *arg0)
temp_r30->unk_02 -= 0xB4;
}
OSs16tof32(&temp_r30->unk_02, &arg0->scale.x);
arg0->scale.x = 3.0 + sin((M_PI * arg0->scale.x) / 180.0);
arg0->scale.x = 3.0 + sind(arg0->scale.x);
arg0->scale.y = arg0->scale.x;
arg0->scale.z = arg0->scale.x;
BoardModelScaleSet(temp_r30->unk_06[temp_r30->field00_bit5], arg0->scale.x, arg0->scale.y, arg0->scale.z);
@ -1355,7 +1355,7 @@ static s32 DoDebugMove(s32 arg0, s16 *arg1)
}
else {
VECSubtract(&sp5C->pos, &sp88, &sp94);
var_f30 = 90.0 - (180.0 * (atan2(sp94.z, sp94.x) / M_PI));
var_f30 = 90.0 - atan2d(sp94.z, sp94.x);
OSf32tos16(&var_f30, &var_r26);
if (var_r26 < 0) {
var_r26 += 0x168;
@ -1394,7 +1394,7 @@ static s32 DoDebugMove(s32 arg0, s16 *arg1)
goto loop_21;
}
if ((0.0f != spA0.x) || (0.0f != spA0.z)) {
var_f30 = (90.0 + (180.0 * (atan2(spA0.z, spA0.x) / M_PI)));
var_f30 = 90.0 + atan2d(spA0.z, spA0.x);
if (var_f30 < 0.0f) {
var_f30 += 360.0f;
}
@ -1404,7 +1404,7 @@ static s32 DoDebugMove(s32 arg0, s16 *arg1)
RestoreJunction(var_f30, 1);
sp50 = &boardCamera;
VECSubtract(&sp50->target, &sp50->pos, &sp7C);
var_f30 = (var_f30 + (90.0 - (180.0 * (atan2(-sp7C.z, -sp7C.x) / M_PI))));
var_f30 += 90.0 - atan2d(-sp7C.z, -sp7C.x);
if (var_f30 < 0.0f) {
var_f30 += 360.0f;
}
@ -1535,7 +1535,7 @@ static s32 ExecJunction(s32 arg0, s16 *arg1)
}
else {
VECSubtract(&sp88->pos, &spAC, &spB8);
var_f29 = (90.0 - (180.0 * (atan2(spB8.z, spB8.x) / M_PI)));
var_f29 = 90.0 - atan2d(spB8.z, spB8.x);
if (var_f29 < 0.0f) {
var_f29 += 360.0f;
}
@ -1611,7 +1611,7 @@ static s32 ExecJunction(s32 arg0, s16 *arg1)
}
else {
if ((0.0f != spC4.x) || (0.0f != spC4.z)) {
var_f29 = (90.0 + (180.0 * (atan2(spC4.z, spC4.x) / M_PI)));
var_f29 = 90.0 + atan2d(spC4.z, spC4.x);
if (var_f29 < 0.0f) {
var_f29 += 360.0f;
}
@ -1729,7 +1729,7 @@ void BoardPlayerPosLerpStart(s32 arg0, Vec *arg1, Vec *arg2, s16 arg3)
}
VECSubtract(arg2, arg1, &sp18);
VECNormalize(&sp18, &sp18);
var_f26 = 90.0 - (180.0 * (atan2(sp18.z, sp18.x) / M_PI));
var_f26 = 90.0 - atan2d(sp18.z, sp18.x);
var_f30 = var_f26;
if (var_f30 < 0.0f) {
var_f30 += 360.0f;
@ -2896,7 +2896,7 @@ static s32 MegaPlayerPassFunc(s32 player, s32 space)
VECSubtract(&spC4, &spB8, &spAC);
spAC.x /= 60.0f;
spAC.z /= 60.0f;
BoardPlayerRotYSet(player, 90.0 - (180.0 * (atan2(spAC.z, spAC.x) / M_PI)));
BoardPlayerRotYSet(player, 90.0 - atan2d(spAC.z, spAC.x));
sp98[1] = BoardVecDistXZCalc(&spC4, &spB8);
BoardPlayerMotionShiftSet(player, 4, 0, 8, HU3D_MOTATTR_NONE);
HuPrcSleep(8);
@ -2998,7 +2998,7 @@ static s32 MegaExecJump(s32 player, s32 space)
VECSubtract(&spC4, &spB8, &spAC);
spAC.x /= 60.0f;
spAC.z /= 60.0f;
BoardPlayerRotYSet(player, 90.0 - (180.0 * (atan2(spAC.z, spAC.x) / M_PI)));
BoardPlayerRotYSet(player, 90.0 - atan2d(spAC.z, spAC.x));
BoardPlayerIdleSet(player);
HuPrcSleep(10);
sp90[1] = BoardVecDistXZCalc(&spC4, &spB8);

View file

@ -14,7 +14,7 @@
#include "game/objsub.h"
#include "game/sprite.h"
#include "math.h"
#include "ext_math.h"
#include "string.h"
static BoardSpace spaceData[2][256];
@ -156,10 +156,10 @@ void BoardSpaceCornerPosGet(s32 index, s32 corner, Vec *pos)
corner_ofs.x = corner_pos[corner][0] * 80.0f;
corner_ofs.y = 0;
corner_ofs.z = corner_pos[corner][1] * 80.0f;
corner_ofs.x = (cos((M_PI * rot.z) / 180) * corner_ofs.x) + (sin((M_PI * rot.z) / 180) * corner_ofs.y);
corner_ofs.y = (cos((M_PI * rot.x) / 180) * cos((M_PI * rot.z) / 180) * corner_ofs.y) + (sin((M_PI * rot.z) / 180) * corner_ofs.x)
+ (sin((M_PI * -rot.x) / 180) * corner_ofs.z);
corner_ofs.z = (sin((M_PI * rot.x) / 180) * corner_ofs.y) + (cos((M_PI * rot.x) / 180) * corner_ofs.z);
corner_ofs.x = (cosd(rot.z) * corner_ofs.x) + (sind(rot.z) * corner_ofs.y);
corner_ofs.y = (cosd(rot.x) * cosd(rot.z) * corner_ofs.y) + (sind(rot.z) * corner_ofs.x)
+ (sind(-rot.x) * corner_ofs.z);
corner_ofs.z = (sind(rot.x) * corner_ofs.y) + (cosd(rot.x) * corner_ofs.z);
pos->x += corner_ofs.x;
pos->y += corner_ofs.y;
pos->z += corner_ofs.z;
@ -724,7 +724,7 @@ static s32 ExecPipeSpace(s32 player, s32 space)
BoardSpacePosGet(0, space_ptr->link[0], &pos_link);
VECSubtract(&pos_link, &pos, &dir);
VECNormalize(&dir, &dir);
BoardPlayerRotYSet(player, 90 - ((atan2(dir.z, dir.x) / M_PI) * 180));
BoardPlayerRotYSet(player, 90 - atan2d(dir.z, dir.x));
radius = 0.75f * BoardVecDistXZCalc(&pos_link, &pos);
BoardPlayerMotionStart(player, 4, 0);
y_vel = 0;

View file

@ -15,6 +15,8 @@
#include "game/board/space.h"
#include "game/board/ui.h"
#include "ext_math.h"
typedef struct {
struct {
u8 unk00_field0 : 1;
@ -247,9 +249,9 @@ static void ExecMapView(void) {
if (sp9 != 0 || sp8 != 0) {
OSs8tof32(&sp9, &spC.x);
OSs8tof32(&sp8, &spC.z);
temp_f28 = 180.0 * (atan2(spC.x, -spC.z) / M_PI);
spC.x = var_f29 * sin(temp_f28 * M_PI / 180.0);
spC.z = var_f29 * cos(temp_f28 * M_PI / 180.0);
temp_f28 = atan2d(spC.x, -spC.z);
spC.x = var_f29 * sind(temp_f28);
spC.z = var_f29 * cosd(temp_f28);
}
VECAdd(&spC, &focusPos, &focusPos);
if (focusPos.x < temp_f26) {
@ -563,7 +565,7 @@ static void UpdateOverheadView(omObjData *arg0) {
sp14.y -= 240.0f;
VECSubtract(&sp20, &sp14, &sp8);
sp8.z = 0.0f;
temp_f30 = BoardDAngleCalc(180.0 * (atan2(sp8.y, sp8.x) / M_PI) - 90.0);
temp_f30 = BoardDAngleCalc(atan2d(sp8.y, sp8.x) - 90.0);
temp_f31 = VECMag(&sp8) / 32;
if (i != 4) {
var_r28 = i + 4;

View file

@ -12,7 +12,7 @@
#include "game/minigame_seq.h"
#include "math.h"
#include "ext_math.h"
#include "stdarg.h"
#include "version.h"
@ -484,7 +484,7 @@ s32 MGSeqUpdateTimer(SeqWork *work)
switch (work->state) {
case 2: {
float scale_x, scale_y;
scale = fabs(((sin((work->angle * M_PI) / 180) * 5.0f) + 1.0f) - (sin((130 * M_PI) / 180) * 5.0f));
scale = fabs(((sind(work->angle) * 5.0f) + 1.0f) - (sind(130) * 5.0f));
scale_x = work->scale_x * scale;
scale_y = work->scale_y * scale;
work->angle += seqSpeed * 5.0f;
@ -496,8 +496,8 @@ s32 MGSeqUpdateTimer(SeqWork *work)
} break;
case 3: {
scale = sin((work->angle * M_PI) / 180) + 1.0;
tp_lvl = 1.0 - (sin((work->angle * M_PI) / 180) * 0.5);
scale = sind(work->angle) + 1.0;
tp_lvl = 1.0 - (sind(work->angle) * 0.5);
work->angle += seqSpeed * 18.0f;
if (work->angle > 180.0f) {
work->state = 0;
@ -1045,7 +1045,7 @@ s32 MGSeqUpdateMGBasic(SeqWork *work)
HuSprZRotSet(work->spr_grp[0], i, 0.0f);
}
else {
HuSprPosSet(work->spr_grp[0], i, pos_x - (((1.0 - sin(((time * 4.5f) * M_PI) / 180.0)) * (work->word_len * 56 * 2))),
HuSprPosSet(work->spr_grp[0], i, pos_x - (((1.0 - sind(time * 4.5f)) * (work->word_len * 56 * 2))),
work->y);
HuSprZRotSet(work->spr_grp[0], i, (time / 20.0f) * 390.0f);
}
@ -1053,11 +1053,11 @@ s32 MGSeqUpdateMGBasic(SeqWork *work)
}
else {
time = work->time - 40;
scale = work->scale_x + (0.5 * sin(((time * 9.0f) * M_PI) / 180.0));
scale = work->scale_x + (0.5 * sind(time * 9.0f));
for (i = 0; i < work->word_len; i++) {
pos_x = ((28.0f * scale) + (work->x - (0.5f * (scale * (work->word_len * 56))))) + (scale * (i * 56));
HuSprPosSet(work->spr_grp[0], i, pos_x, work->y);
HuSprScaleSet(work->spr_grp[0], i, scale, work->scale_y + sin(((time * 9.0f) * M_PI) / 180.0));
HuSprScaleSet(work->spr_grp[0], i, scale, work->scale_y + sind(time * 9.0f));
}
}
if (work->time == 40) {
@ -1085,13 +1085,13 @@ s32 MGSeqUpdateMGBasic(SeqWork *work)
}
if (work->time <= 20) {
time = work->time;
scale = work->scale_x + (0.5 * sin(((time * 9.0f) * M_PI) / 180.0));
scale = work->scale_x + (0.5 * sind(time * 9.0f));
for (i = 0; i < work->word_len; i++) {
HuSprAttrReset(work->spr_grp[0], i, HUSPR_ATTR_DISPOFF);
pos_x = ((28.0f * scale) + (work->x - (0.5f * (scale * (work->word_len * 56))))) + (scale * (i * 56));
HuSprPosSet(work->spr_grp[0], i, pos_x, work->y);
HuSprScaleSet(work->spr_grp[0], i, work->scale_x + sin(((time * 9.0f) * M_PI) / 180.0),
work->scale_y + sin(((time * 9.0f) * M_PI) / 180.0));
HuSprScaleSet(work->spr_grp[0], i, work->scale_x + sind(time * 9.0f),
work->scale_y + sind(time * 9.0f));
}
if (time == 20.0f) {
for (i = 0; i < work->word_len; i++) {
@ -1112,7 +1112,7 @@ s32 MGSeqUpdateMGBasic(SeqWork *work)
}
else {
HuSprPosSet(work->spr_grp[0], i,
pos_x + ((1.0 - cos(((time * 4.5f) * M_PI) / 180.0f)) * (work->word_len * 56 * 2)), work->y);
pos_x + ((1.0 - cosd(time * 4.5f)) * (work->word_len * 56 * 2)), work->y);
HuSprZRotSet(work->spr_grp[0], i, (time / 20.0f) * 390.0f);
}
}
@ -1337,7 +1337,7 @@ s32 MGSeqUpdateMGBattle(SeqWork *work)
y += ofs_y;
}
HuSprPosSet(work->spr_grp[i], j, x, y);
HuSprScaleSet(work->spr_grp[i], j, work->scale_x * cos((M_PI * scale_ang) / 180.0), work->scale_y);
HuSprScaleSet(work->spr_grp[i], j, work->scale_x * cosd(scale_ang), work->scale_y);
HuSprZRotSet(work->spr_grp[i], j, zrot);
}
}
@ -1346,7 +1346,7 @@ s32 MGSeqUpdateMGBattle(SeqWork *work)
else {
if (work->time > 60) {
time = work->time - 60;
scale = 0.5 * sin((M_PI * (time * 9.0f)) / 180.0);
scale = 0.5 * sind(time * 9.0f);
for (j = 0; j < work->word_len; j++) {
pos_x = (28.0f * (scale + work->scale_x)) + (work->x - (0.5f * ((work->word_len * 56) * (scale + work->scale_x))))
+ ((j * 56) * (scale + work->scale_x));
@ -1385,13 +1385,13 @@ s32 MGSeqUpdateMGBattle(SeqWork *work)
}
}
time = work->time;
scale = work->scale_x + (0.5 * sin((M_PI * (time * 9.0f)) / 180.0));
scale = work->scale_x + (0.5 * sind(time * 9.0f));
for (j = 0; j < work->word_len; j++) {
HuSprAttrReset(work->spr_grp[0], j, HUSPR_ATTR_DISPOFF);
pos_x = ((28.0f * scale) + (work->x - (0.5f * (scale * (work->word_len * 56))))) + (scale * (j * 56));
HuSprPosSet(work->spr_grp[0], j, pos_x, work->y);
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sin((M_PI * (time * 9.0f)) / 180.0)),
work->scale_y + (sin((M_PI * (time * 9.0f)) / 180.0)));
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sind(time * 9.0f)),
work->scale_y + (sind(time * 9.0f)));
}
if (time == 20.0f) {
for (j = 0; j < work->word_len; j++) {
@ -1405,7 +1405,7 @@ s32 MGSeqUpdateMGBattle(SeqWork *work)
for (j = 0; j < work->word_len; j++) {
pos_x = (28.0f + (work->x - (0.5f * (work->word_len * 56)))) + (j * 56);
HuSprPosSet(
work->spr_grp[0], j, pos_x + ((HU_DISP_CENTERX - pos_x) * (1.0 - cos((M_PI * (time * 6.0)) / 180.0))), work->y);
work->spr_grp[0], j, pos_x + ((HU_DISP_CENTERX - pos_x) * (1.0 - cosd(time * 6.0))), work->y);
}
if (time == 15.0f) {
for (j = 0; j < work->word_len; j++) {
@ -1530,9 +1530,9 @@ s32 MGSeqUpdateMG1vs3(SeqWork *work)
scale_x = 0.3 * work->scale_x;
scale_y = 0.3 * work->scale_y;
pos_x = ((28.0f * scale_x) + (work->x - (0.5f * (scale_x * (work->word_len * 56))))) + (scale_x * (idx * 56));
pos_y = work->y - (150.0 * sin((M_PI * (((16.0f / 3.0f) * time) + 20.0f)) / 180.0));
pos_y = work->y - 150.0 * sind((16.0f / 3.0f) * time + 20.0f);
HuSprPosSet(work->spr_grp[0], idx, pos_x, pos_y);
HuSprScaleSet(work->spr_grp[0], idx, scale_x, scale_y * cos(M_PI * (12.0f * time) / 180.0));
HuSprScaleSet(work->spr_grp[0], idx, scale_x, scale_y * cosd(12.0f * time));
HuSprTPLvlSet(work->spr_grp[0], idx, scale);
}
}
@ -1549,13 +1549,13 @@ s32 MGSeqUpdateMG1vs3(SeqWork *work)
continue;
}
}
scale = 0.3 + (0.7 * (1.0 - cos((M_PI * (time * 3.0f)) / 180.0)));
scale = 0.3 + 0.7 * (1.0 - cosd(time * 3.0f));
scale_x = work->scale_x * scale;
scale_y = work->scale_y * scale;
pos_x = ((28.0f * scale_x) + (work->x - (0.5f * (scale_x * (work->word_len * 56))))) + (scale_x * (idx * 56));
pos_y = work->y - (150.0 * sin((M_PI * (((16.0f / 3.0f) * time) + 20.0f)) / 180.0));
pos_y = work->y - 150.0 * sind((16.0f / 3.0f) * time + 20.0f);
HuSprPosSet(work->spr_grp[i], idx, pos_x, pos_y);
HuSprScaleSet(work->spr_grp[i], idx, scale_x, scale_y * cos(M_PI * (12.0f * time) / 180.0));
HuSprScaleSet(work->spr_grp[i], idx, scale_x, scale_y * cosd(12.0f * time));
}
}
if (work->time == 60) {
@ -1569,7 +1569,7 @@ s32 MGSeqUpdateMG1vs3(SeqWork *work)
else {
if (work->time > 70) {
time = work->time - 70;
scale = 0.5 * sin((M_PI * (time * 9.0f)) / 180.0);
scale = 0.5 * sind(time * 9.0f);
for (j = 0; j < work->word_len; j++) {
pos_x = (28.0f * (scale + work->scale_x)) + (work->x - (0.5f * ((work->word_len * 56) * (scale + work->scale_x))))
+ ((j * 56) * (scale + work->scale_x));
@ -1609,13 +1609,13 @@ s32 MGSeqUpdateMG1vs3(SeqWork *work)
}
}
time = work->time;
scale = work->scale_x + (0.5 * sin((M_PI * (time * 9.0f)) / 180.0));
scale = work->scale_x + (0.5 * sind(time * 9.0f));
for (j = 0; j < work->word_len; j++) {
HuSprAttrReset(work->spr_grp[0], j, HUSPR_ATTR_DISPOFF);
pos_x = ((28.0f * scale) + (work->x - (0.5f * (scale * (work->word_len * 56))))) + (scale * (j * 56));
HuSprPosSet(work->spr_grp[0], j, pos_x, work->y);
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sin((M_PI * (time * 9.0f)) / 180.0)),
work->scale_y + (sin((M_PI * (time * 9.0f)) / 180.0)));
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sind(time * 9.0f)),
work->scale_y + (sind(time * 9.0f)));
}
if (time == 20.0f) {
for (i = 1; i < 4; i++) {
@ -1767,7 +1767,7 @@ s32 MGSeqUpdateMGStory(SeqWork *work)
else {
if (work->time > 55) {
time = work->time - 55;
scale = 0.5 * sin(M_PI * (9.0f * time) / 180.0);
scale = 0.5 * sind(9.0f * time);
for (j = 0; j < work->word_len; j++) {
pos_x = (28.0f * (scale + work->scale_x)) + (work->x - (0.5f * ((work->word_len * 56) * (scale + work->scale_x))))
+ ((j * 56) * (scale + work->scale_x));
@ -1807,13 +1807,13 @@ s32 MGSeqUpdateMGStory(SeqWork *work)
}
}
time = work->time;
scale = work->scale_x + (0.5 * sin((M_PI * (time * 9.0f)) / 180.0));
scale = work->scale_x + (0.5 * sind(time * 9.0f));
for (j = 0; j < work->word_len; j++) {
HuSprAttrReset(work->spr_grp[0], j, HUSPR_ATTR_DISPOFF);
pos_x = ((28.0f * scale) + (work->x - (0.5f * (scale * (work->word_len * 56))))) + (scale * (j * 56));
HuSprPosSet(work->spr_grp[0], j, pos_x, work->y);
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sin((M_PI * (time * 9.0f)) / 180.0)),
work->scale_y + (sin((M_PI * (time * 9.0f)) / 180.0)));
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sind(time * 9.0f)),
work->scale_y + (sind(time * 9.0f)));
}
if (time == 20.0f) {
for (i = 1; i < 4; i++) {
@ -1960,7 +1960,7 @@ s32 MGSeqUpdateMG2vs2(SeqWork *work)
else {
if (work->time > 40 && work->time <= 60) {
time = work->time - 40;
scale = 0.5 * sin(((time * 9.0f) * M_PI) / 180.0);
scale = 0.5 * sind(time * 9.0f);
for (j = 0; j < work->word_len; j++) {
pos_x = (28.0f * (scale + work->scale_x)) + (work->x - (0.5f * ((work->word_len * 56) * (scale + work->scale_x))))
+ ((j * 56) * (scale + work->scale_x));
@ -1999,13 +1999,13 @@ s32 MGSeqUpdateMG2vs2(SeqWork *work)
}
}
time = work->time;
scale = work->scale_x + (0.5 * sin((M_PI * (time * 9.0f)) / 180.0));
scale = work->scale_x + (0.5 * sind(time * 9.0f));
for (j = 0; j < work->word_len; j++) {
HuSprAttrReset(work->spr_grp[0], j, HUSPR_ATTR_DISPOFF);
pos_x = ((28.0f * scale) + (work->x - (0.5f * (scale * (work->word_len * 56))))) + (scale * (j * 56));
HuSprPosSet(work->spr_grp[0], j, pos_x, work->y);
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sin((M_PI * (time * 9.0f)) / 180.0)),
work->scale_y + (sin((M_PI * (time * 9.0f)) / 180.0)));
HuSprScaleSet(work->spr_grp[0], j, work->scale_x + (sind(time * 9.0f)),
work->scale_y + (sind(time * 9.0f)));
}
if (time == 20.0f) {
for (i = 1; i < 4; i++) {
@ -2023,8 +2023,8 @@ s32 MGSeqUpdateMG2vs2(SeqWork *work)
float angle = (1.0f + (1.0f - (ABS(radius) / 320.0f))) * 720.0f;
float new_scale;
radius *= 1.0 - (time / 60.0f);
HuSprPosSet(work->spr_grp[0], idx, (radius * sin(M_PI * (((time / 60.0f) * angle) + 90.0f) / 180.0)) + work->x,
(radius * cos(M_PI * (((time / 60.0f) * angle) + 90.0f) / 180.0)) + work->y);
HuSprPosSet(work->spr_grp[0], idx, (radius * sind((time / 60.0f) * angle + 90.0f)) + work->x,
(radius * cosd((time / 60.0f) * angle + 90.0f)) + work->y);
HuSprZRotSet(work->spr_grp[0], idx, -(time / 60.0f) * 720.0f);
new_scale = 0.5 + (0.5 * (1.0f - (time / 60.0f)));
HuSprScaleSet(work->spr_grp[0], idx, new_scale, new_scale);
@ -2214,21 +2214,21 @@ s32 MGSeqUpdateFlip(SeqWork *work)
time = work->time - 10;
if (time <= 10) {
for (idx = 0; idx < work->alt_word_len; idx++) {
HuSprScaleSet(work->spr_grp[0], idx, cos(M_PI * ((time / 10.0f) * 90.0f) / 180.0), 1.0f);
HuSprScaleSet(work->spr_grp[0], idx, cosd((time / 10.0f) * 90.0f), 1.0f);
}
}
else {
time -= 10.0f;
for (idx = 0; idx < work->word_len; idx++) {
HuSprTPLvlSet(work->spr_grp[1], idx, 1.0f);
HuSprScaleSet(work->spr_grp[1], idx, sin(M_PI * ((time / 10.0f) * 90.0f) / 180.0), 1.0f);
HuSprScaleSet(work->spr_grp[1], idx, sind((time / 10.0f) * 90.0f), 1.0f);
}
}
}
else {
if (work->time > 35 && work->time <= 55) {
time = work->time - 35;
scale = 0.5 * sin(((time * 9.0f) * M_PI) / 180.0);
scale = 0.5 * sind(time * 9.0f);
for (i = 0; i < work->word_len; i++) {
pos_x = (28.0f * (scale + work->scale_x)) + (work->x - (0.5f * ((work->word_len * 56) * (scale + work->scale_x))))
+ ((i * 56) * (scale + work->scale_x));
@ -2263,7 +2263,7 @@ s32 MGSeqUpdateFlip(SeqWork *work)
}
if (work->time <= 20) {
time = work->time;
scale = 0.5 * sin(M_PI * (9.0f * time) / 180.0);
scale = 0.5 * sind(9.0f * time);
for (i = 0; i < work->word_len; i++) {
HuSprTPLvlSet(work->spr_grp[1], i, 1.0f);
pos_x = (28.0f * (scale + work->scale_x)) + (work->x - (0.5f * ((work->word_len * 56) * (scale + work->scale_x))))
@ -2280,7 +2280,7 @@ s32 MGSeqUpdateFlip(SeqWork *work)
if (scale < 0 || scale > 15.0f) {
continue;
}
HuSprScaleSet(work->spr_grp[1], idx, cos(M_PI * ((scale / 15.0f) * 90.0f) / 180.0), 1.0f);
HuSprScaleSet(work->spr_grp[1], idx, cosd((scale / 15.0f) * 90.0f), 1.0f);
}
for (idx = 0; idx < work->alt_word_len; idx++) {
scale = (time - 15.0f) - (idx * 2);
@ -2288,7 +2288,7 @@ s32 MGSeqUpdateFlip(SeqWork *work)
continue;
}
HuSprTPLvlSet(work->spr_grp[0], idx, 1.0f);
HuSprScaleSet(work->spr_grp[0], idx, sin(M_PI * ((scale / 30.0f) * 180.0f) / 180.0), 1.0f);
HuSprScaleSet(work->spr_grp[0], idx, sind((scale / 30.0f) * 180.0f), 1.0f);
}
}
}
@ -2400,13 +2400,13 @@ s32 MGSeqUpdateMGBowser(SeqWork *work)
}
time_angle = 540.0 * (1.0f - (time / 50.0f));
pos_x = (28.0f + (0.5f * -(work->word_len * 56))) + (idx * 56);
angle = 180.0 * (atan2(pos_x, center_x) / M_PI);
pos_x = work->x + (center_x * sin(M_PI * (angle + time_angle) / 180.0));
angle = atan2d(pos_x, center_x);
pos_x = work->x + (center_x * sind(angle + time_angle));
pos_y = work->y - (HU_DISP_CENTERY * (1.0 - (time / 50.0f)));
HuSprPosSet(work->spr_grp[0], idx, pos_x, pos_y);
temp_f25 = 0.9 + (0.1 * cos(M_PI * (angle + time_angle) / 180.0));
HuSprScaleSet(work->spr_grp[0], idx, temp_f25 * cos(M_PI * (angle + time_angle) / 180.0), temp_f25);
scale_arr[idx] = cos(M_PI * (angle + time_angle) / 180.0);
temp_f25 = 0.9 + (0.1 * cosd(angle + time_angle));
HuSprScaleSet(work->spr_grp[0], idx, temp_f25 * cosd(angle + time_angle), temp_f25);
scale_arr[idx] = cosd(angle + time_angle);
spr_idx[idx] = idx;
}
}
@ -2429,7 +2429,7 @@ s32 MGSeqUpdateMGBowser(SeqWork *work)
else {
if (work->time > 60 && work->time <= 80) {
time = work->time - 60;
scale = 0.5 * sin(((time * 9.0f) * M_PI) / 180.0);
scale = 0.5 * sind(time * 9.0f);
for (i = 0; i < work->word_len; i++) {
pos_x = (28.0f * (scale + work->scale_x)) + (work->x - (0.5f * ((work->word_len * 56) * (scale + work->scale_x))))
+ ((i * 56) * (scale + work->scale_x));
@ -2468,13 +2468,13 @@ s32 MGSeqUpdateMGBowser(SeqWork *work)
}
}
time = work->time;
scale = work->scale_x + (0.5 * sin(((time * 9.0f) * M_PI) / 180.0));
scale = work->scale_x + (0.5 * sind(time * 9.0f));
for (i = 0; i < work->word_len; i++) {
HuSprAttrReset(work->spr_grp[0], i, HUSPR_ATTR_DISPOFF);
pos_x = ((28.0f * scale) + (work->x - (0.5f * (scale * (work->word_len * 56))))) + (scale * (i * 56));
HuSprPosSet(work->spr_grp[0], i, pos_x, work->y);
HuSprScaleSet(work->spr_grp[0], i, work->scale_x + (sin((M_PI * (time * 9.0f)) / 180.0)),
work->scale_y + (sin((M_PI * (time * 9.0f)) / 180.0)));
HuSprScaleSet(work->spr_grp[0], i, work->scale_x + (sind(time * 9.0f)),
work->scale_y + sind(time * 9.0f));
}
if (time == 20.0f) {
for (j = 1; j < 4; j++) {
@ -2632,14 +2632,14 @@ s32 MGSeqUpdateDraw(SeqWork *work)
if (work->time <= 20) {
time = work->time;
zrot = 365.0f * (time / 20.0f);
scale = 1.3f * sin(M_PI * (90.0f * (time / 20.0f)) / 180.0);
scale = 1.3f * sind(90.0f * (time / 20.0f));
HuSprGrpScaleSet(group, scale, scale);
HuSprGrpZRotSet(group, zrot);
}
if (work->time > 20 && work->time <= 25) {
HuSprGrpZRotSet(group, 0.0f);
time = work->time - 20;
scale = 1.0 + (0.3 * cos(M_PI * (90.0f * (time / 5.0f)) / 180.0));
scale = 1.0 + (0.3 * cosd(90.0f * (time / 5.0f)));
HuSprGrpScaleSet(group, scale, scale);
}
if (work->time == 5) {
@ -2971,10 +2971,10 @@ s32 MGSeqUpdateWin(SeqWork *work)
if (work->time <= 20) {
time = work->time;
zrot = 365.0f * (time / 20.0f);
scale = sin(M_PI * (90.0f * (time / 20.0f)) / 180.0);
scale = sind(90.0f * (time / 20.0f));
HuSprGrpScaleSet(work->spr_grp[0], scale, scale);
HuSprGrpZRotSet(work->spr_grp[0], zrot);
scale = 1.0 + (5.0 * cos(M_PI * (90.0f * (time / 20.0f)) / 180.0));
scale = 1.0 + (5.0 * cosd(90.0f * (time / 20.0f)));
tp_lvl = time / 20.0f;
for (idx = 1; idx < work->word_len; idx++) {
HuSprGrpTPLvlSet(work->spr_grp[idx], tp_lvl);
@ -3300,7 +3300,7 @@ static void PauseProc(void)
mg = omMgIndexGet(omcurovl);
if (mgInfoTbl[mg].inst_mess[1] == 0 && mgInfoTbl[mg].inst_mess[2] == 0) {
for (i = 1; i <= 20; i++) {
ratio = sin(M_PI * (i * 4.5f) / 180.0);
ratio = sind(i * 4.5f);
HuSprGrpPosSet(work.spr_grp[0], HU_DISP_CENTERX, (ratio * 290) - 50.0f);
HuPrcVSleep();
}
@ -3334,7 +3334,7 @@ static void PauseProc(void)
}
}
for (i = 1; i <= 20; i++) {
ratio = sin(M_PI * (i * 4.5f) / 180.0);
ratio = sind(i * 4.5f);
HuSprGrpPosSet(work.spr_grp[0], HU_DISP_CENTERX, (ratio * 150) - 50.0f);
HuWinPosSet(window[0], (PAUSE_WIN_DIST + PAUSE_WIN_X) * ratio - PAUSE_WIN_DIST, HU_DISP_CENTERY - 100);
HuWinPosSet(window[1], -(PAUSE_WIN_DIST - PAUSE_WIN_X) * ratio + PAUSE_WIN_DIST, HU_DISP_CENTERY + 32);
@ -3351,7 +3351,7 @@ static void PauseProc(void)
HuWinMesSpeedSet(window[0], 0);
HuWinMesSet(window[0], mgInfoTbl[mg].inst_mess[1]);
for (i = 1; i <= 20; i++) {
ratio = sin(M_PI * (i * 4.5f) / 180.0);
ratio = sind(i * 4.5f);
HuSprGrpPosSet(work.spr_grp[0], HU_DISP_CENTERX, (ratio * 150) - 50.0f);
HuWinPosSet(window[0], (PAUSE_WIN_DIST + PAUSE_WIN_X) * ratio - PAUSE_WIN_DIST, HU_DISP_CENTERY - 70);
if (window[2] != -1) {
@ -3369,7 +3369,7 @@ static void PauseProc(void)
pauseWaitF = 0;
if (window[0] == -1 && window[1] == -1) {
for (i = 1; i <= 10; i++) {
ratio = cos(M_PI * (i * 9.0f) / 180.0);
ratio = cosd(i * 9.0f);
HuSprGrpPosSet(work.spr_grp[0], HU_DISP_CENTERX, (ratio * 290) - 50.0f);
HuPrcVSleep();
}
@ -3377,7 +3377,7 @@ static void PauseProc(void)
else {
if (window[1] != -1) {
for (i = 1; i <= 10; i++) {
ratio = cos(M_PI * (i * 9.0f) / 180.0);
ratio = cosd(i * 9.0f);
HuSprGrpPosSet(work.spr_grp[0], HU_DISP_CENTERX, (ratio * 150) - 50.0f);
HuWinPosSet(window[0], (PAUSE_WIN_DIST + PAUSE_WIN_X) * ratio - PAUSE_WIN_DIST, HU_DISP_CENTERY - 100);
HuWinPosSet(window[1], -(PAUSE_WIN_DIST - PAUSE_WIN_X) * ratio + PAUSE_WIN_DIST, HU_DISP_CENTERY + 32);
@ -3389,7 +3389,7 @@ static void PauseProc(void)
}
else {
for (i = 1; i <= 10; i++) {
ratio = cos(M_PI * (i * 9.0f) / 180.0);
ratio = cosd(i * 9.0f);
HuSprGrpPosSet(work.spr_grp[0], HU_DISP_CENTERX, (ratio * 150) - 50.0f);
HuWinPosSet(window[0], (PAUSE_WIN_DIST + PAUSE_WIN_X) * ratio - PAUSE_WIN_DIST, HU_DISP_CENTERY - 70);
if (window[2] != -1) {
@ -3582,7 +3582,7 @@ static void PracticeProc(void)
if (i != 4) {
break;
}
HuSprTPLvlSet(group, 0, fabs(sin(M_PI * time / 180.0)));
HuSprTPLvlSet(group, 0, fabs(sind(time)));
time += 2.0f;
HuPrcVSleep();
} while (1);