mirror of
https://github.com/zeldaret/st
synced 2026-08-09 18:57:59 -04:00
Vector improvements (#67)
* clean up math.h and attempt to improve existing vector maths * fix broken matches and match new stuff
This commit is contained in:
@@ -22,9 +22,9 @@ ARM Actor::Actor() {
|
||||
this->mRef.Reset();
|
||||
this->mpProfile = NULL;
|
||||
_MI_CpuCopy(&data_ov000_020b539c_eur.mUnk_00, &this->mUnk_5C, sizeof(ActorParams));
|
||||
this->mPos = this->mUnk_5C.mInitialPos;
|
||||
this->mPrevPos = this->mUnk_5C.mInitialPos;
|
||||
this->mAngle = this->mUnk_5C.mInitialAngle;
|
||||
Vec3p_Copy(&this->mUnk_5C.mInitialPos, &this->mPos);
|
||||
Vec3p_Copy(&this->mUnk_5C.mInitialPos, &this->mPrevPos);
|
||||
this->mAngle = this->mUnk_5C.mInitialAngle;
|
||||
SET_FLAGS(this->mFlags, ActorFlag_Alive, ActorFlag_Visible, ActorFlag_Active, ActorFlag_14);
|
||||
this->mUnk_44 = 0xFF;
|
||||
this->mUnk_46 = 0;
|
||||
|
||||
@@ -29,7 +29,6 @@ ARM MapObjectProfileMiniBlocks::MapObjectProfileMiniBlocks() :
|
||||
this->mUnk_1E &= ~0x01;
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/euvAz
|
||||
ARM MapObjectMiniBlocks::MapObjectMiniBlocks() {
|
||||
this->mUnk_48 = 1;
|
||||
}
|
||||
@@ -45,7 +44,10 @@ ARM bool MapObjectMiniBlocks::vfunc_00(void) {
|
||||
this->mPos.y = pUnkStruct_027e0cd8_0c->func_01ffedf4(&vec);
|
||||
}
|
||||
|
||||
Vec3p vec(FLOAT_TO_Q20(0.0f), FLOAT_TO_Q20(0.0f), FLOAT_TO_Q20(0.0f));
|
||||
Vec3p vec;
|
||||
vec.x = FLOAT_TO_Q20(0.0f);
|
||||
vec.y = FLOAT_TO_Q20(0.0f);
|
||||
vec.z = FLOAT_TO_Q20(0.0f);
|
||||
uVar6 = 0;
|
||||
|
||||
switch (this->mUnk_20.mUnk_00[0]) {
|
||||
|
||||
@@ -237,7 +237,7 @@ ARM void FileSelectMain::func_ov019_020c6d10() {
|
||||
|
||||
ARM void FileSelectMain::func_ov019_020c6d48() {
|
||||
Vec2us auStack_2c;
|
||||
volatile Vec2p local_34;
|
||||
volatile Vec2pCpp local_34;
|
||||
int value;
|
||||
|
||||
this->func_ov019_020c6c14();
|
||||
@@ -255,7 +255,7 @@ ARM void FileSelectMain::func_ov019_020c6d48() {
|
||||
value = 0;
|
||||
}
|
||||
|
||||
this->mUnk_03E8[i].func_ov000_02064080(&auStack_2c, (Vec3p *) &local_34,
|
||||
this->mUnk_03E8[i].func_ov000_02064080(&auStack_2c, (Vec2p *) &local_34,
|
||||
UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_02, value);
|
||||
}
|
||||
|
||||
@@ -277,52 +277,62 @@ ARM void FileSelectMain::func_ov019_020c6e14() {
|
||||
|
||||
// non-matching
|
||||
ARM void FileSelectMain::func_ov019_020c6e3c() {
|
||||
Vec2s local_40;
|
||||
Vec2s local_58;
|
||||
Vec2p auStack_50[2];
|
||||
Vec2s local_44;
|
||||
Vec2us auStack_60[2]; // c e
|
||||
Vec2us local_64; // 4 6
|
||||
int fileIndex;
|
||||
u16 var_r4;
|
||||
int var_r5;
|
||||
s32 var_r7;
|
||||
s32 var_r8;
|
||||
s32 var_r9;
|
||||
|
||||
fileIndex = this->mSaveSlotIndex == 0;
|
||||
|
||||
int unaff_r9;
|
||||
u16 unaff_r4;
|
||||
int unaff_r7;
|
||||
|
||||
if (this->mState == FileSelectState_SlotSelectToFileManager) {
|
||||
unaff_r4 = 0;
|
||||
UnkStruct_ov019_020d24c8_28_258 local_3c(0x8A, 0x05);
|
||||
|
||||
local_40.x = local_3c.mPosU.x;
|
||||
local_40.y = local_3c.mPosU.y;
|
||||
|
||||
unaff_r9 = 10;
|
||||
func_ov000_02062e44(auStack_50, &this->GetUnk03E0(fileIndex).mUnk_004);
|
||||
func_ov000_02062e44(&local_58, &this->GetUnk03E0(fileIndex).mUnk_004);
|
||||
local_44.x = local_58.x + data_ov019_020d24c0.mUnk_00.x;
|
||||
local_44.y = local_58.y + data_ov019_020d24c0.mUnk_00.y;
|
||||
unaff_r7 = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_0C;
|
||||
} else if (this->mState == FileSelectState_SlotSelectFromFileManager) {
|
||||
func_ov000_02062e44(auStack_60 + 1, &this->GetUnk03E0(mSaveSlotIndex).mUnk_004);
|
||||
local_40.x = auStack_60[1].x;
|
||||
local_40.y = auStack_60[1].y;
|
||||
|
||||
func_ov000_02062e44(auStack_60, &this->GetUnk03E0(fileIndex).mUnk_004);
|
||||
func_ov000_02062e44(&local_64, &this->GetUnk03E0(fileIndex).mUnk_004);
|
||||
local_44.x = local_64.x;
|
||||
local_44.y = local_64.y;
|
||||
|
||||
unaff_r9 = 0;
|
||||
unaff_r4 = 10;
|
||||
unaff_r7 = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_20;
|
||||
var_r5 = 1;
|
||||
if (this->mSaveSlotIndex != 0) {
|
||||
var_r5 = 0;
|
||||
}
|
||||
|
||||
this->mUnk_03E8[this->mSaveSlotIndex].func_ov000_0206415c(&local_40, 0, 0xf, unaff_r9);
|
||||
auStack_50[1].x = unaff_r7;
|
||||
this->mUnk_03E8[fileIndex].func_ov000_02064080(&local_44, auStack_50 + 1,
|
||||
UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_02, unaff_r4);
|
||||
Vec2s sp28;
|
||||
Vec2s sp24;
|
||||
unk32 sp1C[2];
|
||||
Vec2s sp18;
|
||||
Vec2s temp; // sp14
|
||||
Vec2s sp10;
|
||||
Vec2s spC;
|
||||
Vec2s sp8;
|
||||
Vec2s sp4;
|
||||
|
||||
if (this->mState == FileSelectState_SlotSelectToFileManager) {
|
||||
UnkStruct_ov019_020d24c8_28_258 sp2C(0x8A, 0x05);
|
||||
|
||||
sp28.coords = sp2C.mPos.coords;
|
||||
var_r9 = 0x0A;
|
||||
|
||||
func_ov000_02062e44(&sp18, &this->GetUnk03E0(var_r5).mUnk_004);
|
||||
func_ov000_02062e44(&sp10, &this->GetUnk03E0(var_r5).mUnk_004);
|
||||
|
||||
//! TODO: use Vec2s_CopyAdd
|
||||
temp.x = (&sp10)->x + (&data_ov019_020d24c0.mUnk_00)->x;
|
||||
temp.y = (&sp10)->y + (&data_ov019_020d24c0.mUnk_00)->y;
|
||||
var_r7 = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_18;
|
||||
(&sp24)->coords = temp.coords;
|
||||
var_r8 = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_14;
|
||||
var_r4 = 0;
|
||||
} else if (this->mState == FileSelectState_SlotSelectFromFileManager) {
|
||||
func_ov000_02062e44(&spC, &this->GetUnk03E0(this->mSaveSlotIndex).mUnk_004);
|
||||
|
||||
sp28.coords = spC.coords;
|
||||
var_r9 = 0x00;
|
||||
|
||||
func_ov000_02062e44(&sp8, &this->GetUnk03E0(var_r5).mUnk_004);
|
||||
func_ov000_02062e44(&sp4, &this->GetUnk03E0(var_r5).mUnk_004);
|
||||
sp4.coords = sp24.coords;
|
||||
|
||||
var_r7 = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_20;
|
||||
var_r8 = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_0C;
|
||||
var_r4 = 0x0A;
|
||||
}
|
||||
|
||||
this->mUnk_03E8[this->mSaveSlotIndex].func_ov000_0206415c(&sp28, 0, 0x0F, var_r9);
|
||||
sp1C[0] = var_r7;
|
||||
sp1C[1] = var_r8;
|
||||
this->mUnk_03E8[var_r5].func_ov000_02064080(&sp24, &sp1C, UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_02, var_r4);
|
||||
}
|
||||
|
||||
ARM void FileSelectMain::func_ov019_020c7000() {
|
||||
@@ -834,30 +844,29 @@ ARM void FileSelectMain::func_ov019_020c7a44() {
|
||||
Vec2s local_50;
|
||||
Vec2s local_44;
|
||||
Vec2s local_4c;
|
||||
Vec2us local_28;
|
||||
Vec2us local_2c;
|
||||
Vec2s local_28;
|
||||
Vec2s local_2c;
|
||||
Vec2p local_3c;
|
||||
Vec2p local_34;
|
||||
Vec2p unaff_r5;
|
||||
Vec2p unaff_r11;
|
||||
// Vec2p local_34;
|
||||
int fileIndex = this->mSaveSlotIndex == 0;
|
||||
u16 value1;
|
||||
u16 value2;
|
||||
|
||||
if (this->mState == FileSelectState_SlotSelectToNewFile) {
|
||||
func_ov000_02062e44(&local_44, &this->GetUnk03E0().mUnk_004);
|
||||
unaff_r11.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_0C;
|
||||
unaff_r11.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_20;
|
||||
local_28.x = local_44.x + data_ov019_020d1e70.mUnk_20.x;
|
||||
local_28.y = local_44.y + data_ov019_020d1e70.mUnk_20.y;
|
||||
Vec2s_CopyAdd(&local_44, &data_ov019_020d1e70.mUnk_20, &local_28);
|
||||
|
||||
unaff_r11.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_14;
|
||||
unaff_r11.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_18;
|
||||
value1 = 0x0F;
|
||||
|
||||
func_ov000_02062e44(&local_4c, &this->GetUnk03E0(fileIndex).mUnk_004);
|
||||
unaff_r5.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_0C;
|
||||
unaff_r5.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_20;
|
||||
local_2c.x = local_4c.x + data_ov019_020d24c0.mUnk_04.x;
|
||||
local_2c.y = local_4c.y + data_ov019_020d24c0.mUnk_04.y;
|
||||
Vec2s_CopyAdd(&local_4c, &data_ov019_020d1e70.mUnk_04, &local_2c);
|
||||
|
||||
unaff_r5.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_14;
|
||||
unaff_r5.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_18;
|
||||
value2 = 0;
|
||||
|
||||
this->mUnk_039C.mUnk_0A = 1;
|
||||
@@ -870,17 +879,17 @@ ARM void FileSelectMain::func_ov019_020c7a44() {
|
||||
}
|
||||
} else if (this->mState == FileSelectState_NewFileToSlotSelect) {
|
||||
func_ov000_02062e44(&local_50, &this->GetUnk03E0().mUnk_004);
|
||||
unaff_r11.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_0C;
|
||||
unaff_r11.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_20;
|
||||
local_28.x = local_50.x;
|
||||
local_28.y = local_50.y;
|
||||
local_28.coords = local_50.coords;
|
||||
|
||||
unaff_r11.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_14;
|
||||
unaff_r11.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_18;
|
||||
value1 = 0;
|
||||
|
||||
func_ov000_02062e44(&local_54, &this->GetUnk03E0(fileIndex).mUnk_004);
|
||||
unaff_r5.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_0C;
|
||||
unaff_r5.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_20;
|
||||
local_2c.x = local_54.x;
|
||||
local_2c.y = local_54.y;
|
||||
local_2c.coords = local_54.coords;
|
||||
|
||||
unaff_r5.x = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_14;
|
||||
unaff_r5.y = UnkStruct_ov019_020d1e70::data_ov019_020d1e4c.mUnk_18;
|
||||
value2 = 0x0F;
|
||||
|
||||
this->mUnk_039C.mUnk_0A = 1;
|
||||
@@ -1263,24 +1272,34 @@ ARM void FileSelectMain::func_ov019_020c92dc() {
|
||||
}
|
||||
|
||||
this->mUnk_00BC.Update(&this->mUnk_005C.mPos);
|
||||
|
||||
this->mUnk_1078.Update(&this->mUnk_0DA4.mPos);
|
||||
|
||||
UnkStruct_ov019_020d24c8_28_258 local_30(0x8B, 0x06);
|
||||
Vec2s local_5c;
|
||||
Vec2s local_58;
|
||||
func_ov000_02062e44(&local_5c, &this->mUnk_0DA4);
|
||||
func_0201e8d4(&local_58, &this->mUnk_1100);
|
||||
this->mUnk_1144.mUnk_5C.x = local_58.x + local_30.mPos.x - local_5c.x;
|
||||
this->mUnk_1144.mUnk_5C.y = local_58.y + local_30.mPos.y - local_5c.y;
|
||||
func_0201e8d4(&local_58, &this->mUnk_1078);
|
||||
|
||||
{
|
||||
s16 temp_x = local_58.x + local_30.mPos.x;
|
||||
s16 temp_y = local_58.y + local_30.mPos.y;
|
||||
this->mUnk_1144.mUnk_5C.x = temp_x - local_5c.x;
|
||||
this->mUnk_1144.mUnk_5C.y = temp_y - local_5c.y;
|
||||
}
|
||||
|
||||
this->mUnk_1490.Update(&this->mUnk_11BC.mPos);
|
||||
UnkStruct_ov019_020d24c8_28_258 local_48(0x8B, 0x06);
|
||||
Vec2s local_60;
|
||||
Vec2s local_64;
|
||||
func_ov000_02062e44(&local_60, &this->mUnk_0DA4);
|
||||
func_0201e8d4(&local_64, &this->mUnk_1100);
|
||||
this->mUnk_1144.mUnk_5C.x = local_64.x + local_48.mPos.x - local_60.x;
|
||||
this->mUnk_1144.mUnk_5C.y = local_64.y + local_48.mPos.y - local_60.y;
|
||||
func_0201e8d4(&local_64, &this->mUnk_1490);
|
||||
|
||||
{
|
||||
s16 temp_x = local_64.x + local_48.mPos.x;
|
||||
s16 temp_y = local_64.y + local_48.mPos.y;
|
||||
this->mUnk_1144.mUnk_5C.x = temp_x - local_60.x;
|
||||
this->mUnk_1144.mUnk_5C.y = temp_y - local_60.y;
|
||||
}
|
||||
|
||||
this->mUnk_18A8.Update(&this->mUnk_15D4.mPos);
|
||||
this->mUnk_1BC0.Update(&this->mUnk_18EC.mPos);
|
||||
@@ -1558,8 +1577,8 @@ ARM void FileSelectMain::func_ov019_020cb324() {
|
||||
Vec2s local_34;
|
||||
Vec2s local_30;
|
||||
stack_struct auStack_24;
|
||||
volatile Vec2s sStack_1c;
|
||||
volatile Vec2s sStack_18;
|
||||
Vec2s sStack_1c;
|
||||
Vec2s sStack_18;
|
||||
|
||||
this->mUnk_0160.func_ov000_02062f30();
|
||||
this->GetUnk03E0().func_ov019_020cbc0c();
|
||||
@@ -1571,15 +1590,13 @@ ARM void FileSelectMain::func_ov019_020cb324() {
|
||||
sStack_18.x = 0;
|
||||
sStack_18.y = 0;
|
||||
if (this->mUnk_0DA4.mUnk_28) {
|
||||
sStack_18.x = this->mUnk_0DA4.mPosOffset.x;
|
||||
sStack_18.y = this->mUnk_0DA4.mPosOffset.y;
|
||||
sStack_18.coords = this->mUnk_0DA4.mPosOffset.coords;
|
||||
}
|
||||
|
||||
sStack_1c.x = 0;
|
||||
sStack_1c.y = 0;
|
||||
if (this->mUnk_11BC.mUnk_28) {
|
||||
sStack_1c.x = this->mUnk_11BC.mPosOffset.x;
|
||||
sStack_1c.y = this->mUnk_11BC.mPosOffset.y;
|
||||
sStack_1c.coords = this->mUnk_11BC.mPosOffset.coords;
|
||||
}
|
||||
|
||||
auStack_24.mUnk_06 = 0;
|
||||
@@ -1587,15 +1604,17 @@ ARM void FileSelectMain::func_ov019_020cb324() {
|
||||
auStack_24.mUnk_05 = -1;
|
||||
auStack_24.mUnk_06 |= 0x04;
|
||||
|
||||
local_30.x = this->mUnk_1144.mUnk_5C.x + sStack_18.x;
|
||||
local_30.y = this->mUnk_1144.mUnk_5C.y + sStack_18.y;
|
||||
s16 temp_x1 = this->mUnk_1144.mUnk_5C.x + sStack_18.x;
|
||||
s16 temp_y1 = this->mUnk_1144.mUnk_5C.y + sStack_18.y;
|
||||
local_30.x = temp_x1;
|
||||
local_30.y = temp_y1;
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_1144, (void *) &local_30, 0, &auStack_24);
|
||||
// data_0204af1c.func_0201aad0(&this->mUnk_1144,&local_30,0, 0);
|
||||
|
||||
local_34.x = this->mUnk_155C.mUnk_5C.x + sStack_1c.x;
|
||||
local_34.y = this->mUnk_155C.mUnk_5C.y + sStack_1c.y;
|
||||
s16 temp_x2 = this->mUnk_155C.mUnk_5C.x + sStack_1c.x;
|
||||
s16 temp_y2 = this->mUnk_155C.mUnk_5C.y + sStack_1c.y;
|
||||
local_34.x = temp_x2;
|
||||
local_34.y = temp_y2;
|
||||
data_0204af1c.func_0201aad0(&this->mUnk_155C, (void *) &local_34, 0, &auStack_24);
|
||||
// data_0204af1c.func_0201aad0(&this->mUnk_155C,&local_34,0, 0);
|
||||
}
|
||||
|
||||
ARM void FileSelectMain::func_ov019_020cb4bc() {
|
||||
|
||||
@@ -60,17 +60,13 @@ ARM FileSelectMicTest::FileSelectMicTest() :
|
||||
this->mUnk_3F8.mUnk_14E = 1;
|
||||
this->mUnk_3F8.func_0201f730(BMG_ID(BMGGroup_select, 0x43));
|
||||
|
||||
volatile Vec2us result;
|
||||
Vec2s temp;
|
||||
Vec2s fetch;
|
||||
Vec2s *pFetch = (Vec2s *) &fetch; // yes the cast is required because why not after all...
|
||||
|
||||
func_ov000_02062e44(pFetch, &this->mUnk_304.mUnk_044);
|
||||
|
||||
result.x = pFetch->x + data_ov019_020d2248.mUnk_02.x;
|
||||
result.y = pFetch->y + data_ov019_020d2248.mUnk_02.y;
|
||||
|
||||
this->mUnk_304.mUnk_044.mPos.x = result.x;
|
||||
this->mUnk_304.mUnk_044.mPos.y = result.y;
|
||||
func_ov000_02062e44(&fetch, &this->mUnk_304.mUnk_044);
|
||||
Vec2s *pFetch = (Vec2s *) &fetch; // yes the cast is required because why not after all...
|
||||
temp.x = (pFetch)->x + (&data_ov019_020d2248.mUnk_02)->x;
|
||||
temp.y = (pFetch)->y + (&data_ov019_020d2248.mUnk_02)->y;
|
||||
this->mUnk_304.mUnk_044.mPos.coords = temp.coords;
|
||||
|
||||
this->func_ov019_020cea74();
|
||||
}
|
||||
@@ -94,9 +90,9 @@ ARM void FileSelectMicTest::func_ov019_020ceaac() {
|
||||
Vec2s local_38;
|
||||
|
||||
local_34.x = data_ov019_020d2248.mUnk_10.x;
|
||||
local_38.x = 0;
|
||||
|
||||
local_34.y = data_ov019_020d2248.mUnk_10.y;
|
||||
|
||||
local_38.x = 0;
|
||||
local_38.y = 0;
|
||||
|
||||
this->mUnk_304.func_0201e874(0x0C, (void *) &local_34, (void *) &local_38, 0);
|
||||
@@ -113,7 +109,7 @@ ARM void FileSelectMicTest::func_ov019_020ceaac() {
|
||||
{
|
||||
UnkStruct_ov019_020d24c8_28_258 local_30(0x8D, 0x01);
|
||||
|
||||
volatile Vec2us result;
|
||||
Vec2s result;
|
||||
Vec2s fetch;
|
||||
|
||||
func_0201e8d4(&fetch, &this->mUnk_304);
|
||||
@@ -121,8 +117,7 @@ ARM void FileSelectMicTest::func_ov019_020ceaac() {
|
||||
result.x = local_30.mPos.x + fetch.x;
|
||||
result.y = local_30.mPos.y + fetch.y;
|
||||
|
||||
this->mUnk_270.mUnk_8E.x = result.x;
|
||||
this->mUnk_270.mUnk_8E.y = result.y;
|
||||
this->mUnk_270.mUnk_8E.coords = result.coords;
|
||||
}
|
||||
|
||||
Vec2s local_44;
|
||||
@@ -142,14 +137,12 @@ ARM void FileSelectMicTest::func_ov019_020cebcc() {
|
||||
|
||||
this->mUnk_270.func_ov019_020cf130();
|
||||
|
||||
volatile Vec2s result; // not necessary, here for consistency
|
||||
Vec2s result;
|
||||
Vec2s fetch;
|
||||
Vec2s *pFetch = (Vec2s *) &fetch;
|
||||
|
||||
func_ov000_02062e44(pFetch, &this->mUnk_304.mUnk_044);
|
||||
|
||||
result.y = pFetch->y + data_ov019_020d2248.mUnk_02.y;
|
||||
result.x = pFetch->x + data_ov019_020d2248.mUnk_02.x;
|
||||
Vec2s_Add(pFetch, &data_ov019_020d2248.mUnk_02, &result);
|
||||
|
||||
this->mUnk_304.mUnk_0A4.func_ov000_0206415c((void *) &result, 7, data_ov019_020d2248.mUnk_00, 0);
|
||||
}
|
||||
@@ -183,15 +176,12 @@ ARM void FileSelectMicTest::vfunc_08(Input *pButtons, TouchControl *pTouchContro
|
||||
this->mUnk_304.mUnk_000.UpdateLogic();
|
||||
UnkStruct_ov019_020d24c8_28_258 local_2c(0x8D, 0x01);
|
||||
|
||||
volatile Vec2us result;
|
||||
Vec2s result;
|
||||
Vec2s fetch;
|
||||
func_0201e8d4(&fetch, &this->mUnk_304);
|
||||
|
||||
result.x = local_2c.mPos.x + fetch.x;
|
||||
result.y = local_2c.mPos.y + fetch.y;
|
||||
|
||||
this->mUnk_270.mUnk_8E.x = result.x;
|
||||
this->mUnk_270.mUnk_8E.y = result.y;
|
||||
Vec2s_Add(&local_2c.mPos, &fetch, &result);
|
||||
Vec2s_Copy(&result, &this->mUnk_270.mUnk_8E);
|
||||
|
||||
this->mUnk_304.mUnk_0A4.func_ov000_02063f64();
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ void func_ov000_020623d8(void *param1, unk32 param2);
|
||||
|
||||
class UnkStruct_ov019_020d215c {
|
||||
public:
|
||||
/* 00 */ VEC2S mUnk_00;
|
||||
/* 04 */ VEC2S mUnk_04;
|
||||
/* 08 */ VEC2S mUnk_08;
|
||||
/* 0C */ VEC2S mUnk_0C;
|
||||
/* 10 */ VEC2S mUnk_10;
|
||||
/* 00 */ Vec2sC mUnk_00;
|
||||
/* 04 */ Vec2sC mUnk_04;
|
||||
/* 08 */ Vec2sC mUnk_08;
|
||||
/* 0C */ Vec2sC mUnk_0C;
|
||||
/* 10 */ Vec2sC mUnk_10;
|
||||
/* 14 */
|
||||
};
|
||||
|
||||
|
||||
@@ -177,7 +177,8 @@ ARM FileSelect_UnkClass7::FileSelect_UnkClass7() {
|
||||
pos.y = pRandom->Next32(0, SUBSCREEN_HEIGHT);
|
||||
|
||||
Vec2us *pVec = &this->mUnk_004.mUnk_E10[i];
|
||||
*pVec = pos;
|
||||
pVec->x = pos.x;
|
||||
pVec->y = pos.y;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +194,8 @@ ARM void FileSelect_UnkClass7::vfunc_00() {
|
||||
pos.y = gRandom.Next32(0, SUBSCREEN_HEIGHT);
|
||||
|
||||
Vec2us *pVec = &this->mUnk_004.mUnk_E10[i];
|
||||
*pVec = pos;
|
||||
pVec->x = pos.x;
|
||||
pVec->y = pos.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,10 +100,12 @@ ARM bool ActorRupee::vfunc_18(unk32 param1) {
|
||||
this->mUnk_94 = 0;
|
||||
{
|
||||
Vec3p vel;
|
||||
vel.x = 0;
|
||||
vel.y = 0;
|
||||
vel.z = 0;
|
||||
this->mVel = vel;
|
||||
vel.x = 0;
|
||||
vel.y = 0;
|
||||
vel.z = 0;
|
||||
this->mVel.x = vel.x;
|
||||
this->mVel.y = vel.y;
|
||||
this->mVel.z = vel.z;
|
||||
}
|
||||
this->func_ov031_020e9904(0);
|
||||
break;
|
||||
@@ -123,7 +125,9 @@ ARM bool ActorRupee::vfunc_18(unk32 param1) {
|
||||
q20 vz = gRandom.Next32(0, 0x223) - 0x111;
|
||||
vel.z = vz;
|
||||
|
||||
this->mVel = vel;
|
||||
this->mVel.x = vel.x;
|
||||
this->mVel.y = vel.y;
|
||||
this->mVel.z = vel.z;
|
||||
}
|
||||
this->func_ov031_020e9904(0);
|
||||
break;
|
||||
@@ -133,10 +137,12 @@ ARM bool ActorRupee::vfunc_18(unk32 param1) {
|
||||
this->mUnk_94 = 0;
|
||||
{
|
||||
Vec3p vel;
|
||||
vel.x = 0;
|
||||
vel.y = 0x800;
|
||||
vel.z = 0;
|
||||
this->mVel = vel;
|
||||
vel.x = 0;
|
||||
vel.y = 0x800;
|
||||
vel.z = 0;
|
||||
this->mVel.x = vel.x;
|
||||
this->mVel.y = vel.y;
|
||||
this->mVel.z = vel.z;
|
||||
}
|
||||
this->func_ov031_020e9904(0);
|
||||
break;
|
||||
@@ -337,7 +343,7 @@ ARM void ActorRupee::func_ov031_020e9438() {
|
||||
|
||||
ARM void ActorRupee::func_ov031_020e9450() {
|
||||
this->func_ov017_020bf9c8(gpActorManager->func_01fff3b4(this->mUnk_BC));
|
||||
this->mPrevPos = this->mPos;
|
||||
Vec3p_Copy(&this->mPos, &this->mPrevPos);
|
||||
Vec3p_Add(&this->mPos, &this->mVel, &this->mPos);
|
||||
|
||||
if (!GET_FLAG(this->mFlags, ActorFlag_5)) {
|
||||
|
||||
@@ -11,7 +11,16 @@ extern "C" void func_0200b58c(void *);
|
||||
extern "C" void func_01ffb714(Vec3p *, Vec3p *, void *);
|
||||
extern "C" void func_01ffcfcc(Vec3p *, Vec3p *, Vec3p *);
|
||||
|
||||
static const Vec2p data_ov031_02115830(0x800, 0x800);
|
||||
struct UnkStruct_ov031_02117c84 {
|
||||
u16 mUnk_00;
|
||||
|
||||
UnkStruct_ov031_02117c84(u16 x) {
|
||||
this->mUnk_00 = x;
|
||||
}
|
||||
};
|
||||
|
||||
static const Vec2pCpp data_ov031_02115830(0x800, 0x800);
|
||||
static const UnkStruct_ov031_02117c84 data_ov031_02117c84(0x3C);
|
||||
static const UnkSubStruct19 data_ov031_02115c84;
|
||||
|
||||
ARM MapObjectTreasureSpawned_74::MapObjectTreasureSpawned_74(unk32 param1) :
|
||||
@@ -242,7 +251,8 @@ ARM bool MapObjectChestBase::vfunc_44() {
|
||||
}
|
||||
|
||||
ARM void MapObjectChestBase::func_ov031_02103f48() {
|
||||
Vec3p local_10(this->mPos.x, this->mPos.y + 0x800, this->mPos.z);
|
||||
Vec3p local_10;
|
||||
Vec3p_Init(this->mPos.x, this->mPos.y + 0x800, this->mPos.z, &local_10);
|
||||
data_027e0cec->func_ov000_0209feac(0x81f, &local_10, 4, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -739,8 +739,11 @@ ARM void MapObjectDoorDangerSpawn::func_ov031_020fe5fc(Vec3p *param1, MapObjectD
|
||||
Vec3p *piVar2 = data_027e0ce0->func_01fff148(1);
|
||||
Vec3p *piVar3 = data_027e0ce0->func_01fff148(0);
|
||||
|
||||
Vec3p temp(piVar3->x, piVar3->y, piVar3->z);
|
||||
Vec3p pos(temp.x + piVar2->x, temp.y + piVar2->y, temp.z + piVar2->z);
|
||||
Vec3p temp;
|
||||
Vec3p_Init(piVar3->x, piVar3->y, piVar3->z, &temp);
|
||||
|
||||
Vec3p pos;
|
||||
Vec3p_Init(temp.x + piVar2->x, temp.y + piVar2->y, temp.z + piVar2->z, &pos);
|
||||
|
||||
func_01ff93c0(&pos, FLOAT_TO_Q20(0.5f));
|
||||
param1->coords = pos.coords;
|
||||
|
||||
@@ -128,8 +128,10 @@ ARM void MapObjectDoorSwitch::vfunc_18(s8 *param1, s8 param2) {
|
||||
}
|
||||
|
||||
ARM void MapObjectDoorSwitch::vfunc_74(void) {
|
||||
Vec3p local_20(this->mPos);
|
||||
Vec3p local_2c(0, 0, 0x666);
|
||||
Vec3p local_20 = this->mPos;
|
||||
Vec3p local_2c;
|
||||
Vec3p_Init(0, 0, 0x666, &local_2c);
|
||||
|
||||
Mat4x3p m;
|
||||
u16 angle = this->mUnk_14;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Unknown/Common.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
|
||||
static const Vec2p data_ov031_021157b0(0x96B, 0x99A);
|
||||
static const Vec2pCpp data_ov031_021157b0(0x96B, 0x99A);
|
||||
|
||||
ARM DECL_PROFILE(MapObjectProfileTreasureSpawned);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "Unknown/UnkStruct_ov000_020b51c0.hpp"
|
||||
#include "versions.h"
|
||||
|
||||
#include <nitro/math.h>
|
||||
#include "math.hpp"
|
||||
|
||||
struct UnkStruct_02186240 {
|
||||
/* 0000 */ unk8 mUnk_0000[0x3F68];
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cdc.hpp"
|
||||
|
||||
#include <nitro/math.h>
|
||||
#include "math.hpp"
|
||||
|
||||
extern "C" void func_ov000_0205ca74(unk32);
|
||||
extern "C" void func_ov000_0205d65c(void *, Vec3p *, Vec3p *, u32);
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
#include "Unknown/UnkMemFuncs.h"
|
||||
|
||||
// non-matching
|
||||
ARM void TouchControl::UpdateState(TouchState *state, TouchStateFlags *stateFlags) {
|
||||
ARM void TouchControl::UpdateState(TouchState *state, const TouchStateFlags *stateFlags) {
|
||||
if (stateFlags->touch == 1) {
|
||||
if (stateFlags->flags == 0) {
|
||||
Vec2us pos;
|
||||
pos.y = stateFlags->touchPos.y;
|
||||
pos.x = stateFlags->touchPos.x;
|
||||
state->touch = true;
|
||||
|
||||
state->touch = true;
|
||||
state->touchPos.x = pos.x;
|
||||
state->touchPos.y = pos.y;
|
||||
u16 x = stateFlags->touchPos.x;
|
||||
u16 y = stateFlags->touchPos.y;
|
||||
state->touchPos.x = x;
|
||||
state->touchPos.y = y;
|
||||
} else {
|
||||
if ((stateFlags->flags & 1) == 0) {
|
||||
state->touchPos.x = stateFlags->touchPos.x;
|
||||
@@ -125,27 +124,14 @@ ARM void TouchControl::UpdateFlags(u16 speed) {
|
||||
}
|
||||
|
||||
ARM void TouchControl::UpdateWithStateFlags(TouchStateFlags *state, u16 speed) {
|
||||
*(TouchStateU *) &this->mPrevState = *(TouchStateU *) &this->mState;
|
||||
this->mPrevState = this->mState;
|
||||
this->UpdateState(&this->mState, state);
|
||||
this->UpdateFlags(speed);
|
||||
}
|
||||
|
||||
ARM void TouchControl::Update(TouchState *state, u16 speed) {
|
||||
TouchStateU curState = *(TouchStateU *) &this->mState;
|
||||
TouchStateU newState = *(TouchStateU *) &*state;
|
||||
|
||||
this->mPrevState.touch = curState.touch;
|
||||
|
||||
this->mPrevState.touch = curState.touch;
|
||||
this->mPrevState.unk_01 = curState.unk_01;
|
||||
this->mPrevState.touchPos.x = curState.touchPos.x;
|
||||
this->mPrevState.touchPos.y = curState.touchPos.y;
|
||||
|
||||
this->mState.touch = newState.touch;
|
||||
this->mState.unk_01 = newState.unk_01;
|
||||
this->mState.touchPos.x = newState.touchPos.x;
|
||||
this->mState.touchPos.y = newState.touchPos.y;
|
||||
|
||||
ARM void TouchControl::Update(const TouchState *state, u16 speed) {
|
||||
this->mPrevState = this->mState;
|
||||
this->mState = *state;
|
||||
this->UpdateFlags(speed);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user