Fix daE_VA_c::mRopeCutStatus and va_tag_* array sizes (#3152)

This commit is contained in:
Howard Luck
2026-04-11 13:53:51 -06:00
committed by GitHub
parent 63d68e9b1d
commit c57a7cf98f
2 changed files with 26 additions and 2 deletions
+1 -2
View File
@@ -159,8 +159,7 @@ private:
/* 0x00958 */ mDoExt_3DlineMat1_c mRope;
/* 0x00994 */ cXyz field_0x994[100];
/* 0x00E44 */ csXyz field_0xe44[100];
/* 0x0109C */ u8 mRopeCutStatus[10];
/* 0x010A6 */ u8 field_0x10A6[0x01100 - 0x010A6];
/* 0x0109C */ u8 mRopeCutStatus[100];
/* 0x01100 */ u8 mDrawRopes;
/* 0x01101 */ u8 field_0x1101[0x01104 - 0x01101];
/* 0x01104 */ f32 field_0x1104[10];
+25
View File
@@ -167,6 +167,30 @@ static dCcD_SrcSph cc_vt_magic_src = {
} // mSphAttr
};
// !@bug The i<40 loops that index these arrays read one element past the end; on
// GC/Wii the OOB reads land on adjacent rodata instead of a defined value.
#if AVOID_UB
static u8 va_tag_set_size[40] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02,
0x00,
};
static u8 va_tag_set_num[40] = {
0x01, 0x0C, 0x16, 0x1F, 0x21, 0x2A, 0x2B, 0x02, 0x04, 0x0D, 0x0F, 0x15, 0x18,
0x20, 0x2C, 0x03, 0x05, 0x06, 0x0B, 0x10, 0x17, 0x19, 0x1A, 0x22, 0x24, 0x29,
0x2D, 0x34, 0x49, 0x52, 0x36, 0x3E, 0x54, 0x5C, 0x39, 0x41, 0x4C, 0x56, 0x5E,
0x00,
};
static f32 va_tag_offset[40] = {
20.0f, 20.0f, 20.0f, 20.0f, 20.0f, 0.0f, 40.0f, 0.0f, 30.0f, 10.0f, 0.0f, 0.0f, 20.0f,
0.0f, 10.0f, 20.0f, 40.0f, 0.0f, 20.0f, 0.0f, 0.0f, 20.0f, 0.0f, 10.0f, 0.0f, 0.0f,
20.0f, 10.0f, 20.0f, 30.0f, 0.0f, 10.0f, 20.0f, 0.0f, 0.0f, 10.0f, 20.0f, 30.0f, 0.0f,
0.0f,
};
#else
static u8 va_tag_set_size[39] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
@@ -184,6 +208,7 @@ static f32 va_tag_offset[39] = {
0.0f, 10.0f, 20.0f, 40.0f, 0.0f, 20.0f, 0.0f, 0.0f, 20.0f, 0.0f, 10.0f, 0.0f, 0.0f,
20.0f, 10.0f, 20.0f, 30.0f, 0.0f, 10.0f, 20.0f, 0.0f, 0.0f, 10.0f, 20.0f, 30.0f, 0.0f,
};
#endif
} // namespace