Apply macros and port mstoryDll to every version (#513)
* Apply MTXDegToRad macros * Port mstoryDll to every version
This commit is contained in:
parent
496c8544e5
commit
806ec24c4e
12 changed files with 1196 additions and 1083 deletions
|
|
@ -565,17 +565,17 @@ void fn_1_14CC(Mtx arg0, float arg8, float arg9, float argA)
|
|||
Mtx sp38;
|
||||
Mtx sp8;
|
||||
if (argA != 0.0f) {
|
||||
PSMTXRotRad(arg0, 0x5A, 0.017453292f * argA);
|
||||
PSMTXRotRad(arg0, 0x5A, MTXDegToRad(argA));
|
||||
}
|
||||
else {
|
||||
PSMTXIdentity(arg0);
|
||||
}
|
||||
if (arg8 != 0.0f) {
|
||||
PSMTXRotRad(sp38, 0x58, 0.017453292f * arg8);
|
||||
PSMTXRotRad(sp38, 0x58, MTXDegToRad(arg8));
|
||||
PSMTXConcat(sp38, arg0, arg0);
|
||||
}
|
||||
if (arg9 != 0.0f) {
|
||||
PSMTXRotRad(sp8, 0x59, 0.017453292f * arg9);
|
||||
PSMTXRotRad(sp8, 0x59, MTXDegToRad(arg9));
|
||||
PSMTXConcat(sp8, arg0, arg0);
|
||||
}
|
||||
}
|
||||
|
|
@ -613,23 +613,6 @@ void fn_1_16B0(Mtx var_r30, Vec *var_r31)
|
|||
var_r31->y = fn_1_15EC(var_f25, var_f29);
|
||||
}
|
||||
|
||||
static inline float fn_1_1B40_inline(omObjData *object, s32 arg1, s32 arg2, float arg8, float arg9)
|
||||
{
|
||||
float var_f31;
|
||||
float var_f30;
|
||||
|
||||
var_f30 = sqrtf(arg8);
|
||||
var_f31 = arg9 + arg8;
|
||||
if (var_f31 < 0.0f) {
|
||||
var_f31 += var_f30 + arg2 + arg1;
|
||||
}
|
||||
else if (var_f31 >= var_f30) {
|
||||
var_f31 -= var_f30 + object->group;
|
||||
}
|
||||
return var_f31;
|
||||
}
|
||||
|
||||
// TODO get a working stripped out inline https://decomp.me/scratch/2IbZG
|
||||
void fn_1_1B40(omObjData *object)
|
||||
{
|
||||
Mtx spCC;
|
||||
|
|
@ -698,8 +681,10 @@ void fn_1_1B40(omObjData *object)
|
|||
break;
|
||||
}
|
||||
if (0) {
|
||||
fn_1_1B40_inline(object, 1, 2, 0.0f, 0.0f);
|
||||
fn_1_1B40_inline(object, 1, 2, 0.0f, 0.0f);
|
||||
int x = 12;
|
||||
int y = 24;
|
||||
char *str = "%f";
|
||||
print8(x, y, 1.5f, str, sqrtf(fn_1_15EC(object->trans.x, object->trans.y)));
|
||||
}
|
||||
var_r31->unk_38 = var_r31->unk_04 * sind(var_r31->unk_18);
|
||||
var_r31->unk_40 = var_r31->unk_04 * cosd(var_r31->unk_18);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "game/data.h"
|
||||
#include "game/esprite.h"
|
||||
#include "game/flag.h"
|
||||
#include "game/gamework_data.h"
|
||||
#include "game/hsfman.h"
|
||||
#include "game/saveload.h"
|
||||
#include "game/sprite.h"
|
||||
|
|
@ -9,11 +10,12 @@
|
|||
#include "game/wipe.h"
|
||||
|
||||
s32 lbl_1_bss_8BC;
|
||||
Process* lbl_1_bss_8B8;
|
||||
Process *lbl_1_bss_8B8;
|
||||
|
||||
s32 fn_1_13B48(s32 arg0) {
|
||||
s32 fn_1_13B48(s32 arg0)
|
||||
{
|
||||
if (arg0 == 0 && _CheckFlag(FLAG_ID_MAKE(0, 2))) {
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
if (arg0 == 1 && _CheckFlag(FLAG_ID_MAKE(0, 3))) {
|
||||
return 1;
|
||||
|
|
@ -33,7 +35,8 @@ s32 fn_1_13B48(s32 arg0) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void fn_1_13C34(void) {
|
||||
void fn_1_13C34(void)
|
||||
{
|
||||
float sp8[2];
|
||||
s32 temp_r30;
|
||||
s32 var_r29;
|
||||
|
|
@ -71,6 +74,9 @@ void fn_1_13C34(void) {
|
|||
HuWinExAnimOut(var_r31);
|
||||
HuWinExCleanup(var_r31);
|
||||
if (SLSaveFlagGet() == 1 && temp_r30 == 0) {
|
||||
#if VERSION_REV1
|
||||
GWGameStat.story_continue = 1;
|
||||
#endif
|
||||
SLCommonSet();
|
||||
SLSaveBoardStory();
|
||||
SLSave();
|
||||
|
|
@ -87,17 +93,22 @@ void fn_1_13C34(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void fn_1_13E2C(void) {
|
||||
void fn_1_13E2C(void)
|
||||
{
|
||||
_SetFlag(9);
|
||||
if (_CheckFlag(FLAG_ID_MAKE(0, 2)) && _CheckFlag(FLAG_ID_MAKE(0, 3)) && _CheckFlag(FLAG_ID_MAKE(0, 4)) && _CheckFlag(FLAG_ID_MAKE(0, 5)) && _CheckFlag(FLAG_ID_MAKE(0, 6))) {
|
||||
OSReport("########## Next to MapSelect Event 11 -> MapNo:%d, MapFlg:%d, MgFlg:%d\n", GWSystem.board, fn_1_13B48(GWSystem.board), _CheckFlag(9));
|
||||
if (_CheckFlag(FLAG_ID_MAKE(0, 2)) && _CheckFlag(FLAG_ID_MAKE(0, 3)) && _CheckFlag(FLAG_ID_MAKE(0, 4)) && _CheckFlag(FLAG_ID_MAKE(0, 5))
|
||||
&& _CheckFlag(FLAG_ID_MAKE(0, 6))) {
|
||||
OSReport(
|
||||
"########## Next to MapSelect Event 11 -> MapNo:%d, MapFlg:%d, MgFlg:%d\n", GWSystem.board, fn_1_13B48(GWSystem.board), _CheckFlag(9));
|
||||
HuPrcChildCreate(fn_1_13C34, 100, 0x2000, 0, HuPrcCurrentGet());
|
||||
do {
|
||||
fn_1_B8C();
|
||||
} while (lbl_1_bss_8BC != 1);
|
||||
omOvlGotoEx(OVL_MSTORY2, 1, 0, 0);
|
||||
} else {
|
||||
OSReport("########## Next to MapSelect Event 11 -> MapNo:%d, MapFlg:%d, MgFlg:%d\n", GWSystem.board, fn_1_13B48(GWSystem.board), _CheckFlag(9));
|
||||
}
|
||||
else {
|
||||
OSReport(
|
||||
"########## Next to MapSelect Event 11 -> MapNo:%d, MapFlg:%d, MgFlg:%d\n", GWSystem.board, fn_1_13B48(GWSystem.board), _CheckFlag(9));
|
||||
HuPrcChildCreate(fn_1_13C34, 100, 0x2000, 0, HuPrcCurrentGet());
|
||||
do {
|
||||
fn_1_B8C();
|
||||
|
|
@ -110,7 +121,8 @@ void fn_1_13E2C(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void fn_1_14150(Process* arg0) {
|
||||
void fn_1_14150(Process *arg0)
|
||||
{
|
||||
lbl_1_bss_8B8 = arg0;
|
||||
HuPrcChildCreate(fn_1_13E2C, 100, 0x2000, 0, HuPrcCurrentGet());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue