More function matching in code_80057C60 (#149)

This commit is contained in:
ChiefFruitcake
2022-01-24 22:22:43 -05:00
committed by GitHub
parent 78681aa5ba
commit f0e40cb746
25 changed files with 603 additions and 1921 deletions
+2 -2
View File
@@ -204,7 +204,7 @@ typedef struct {
// On flat ground this value should be cornerY - gKartBoundingBoxTable[characterId]
/* 0x10 */ f32 cornerGroundY;
/* 0x14 */ s32 unk_14;
} kartBoundingBoxCorner; // size = 0x18
} KartBoundingBoxCorner; // size = 0x18
#define FRONT_LEFT_TYRE 0
#define FRONT_RIGHT_TYRE 1
@@ -315,7 +315,7 @@ typedef struct {
/* 0x014C */ char unk_14C[0x4];
/* 0x0150 */ f32 unk_150[9];
/* 0x0174 */ f32 unk_174[9];
/* 0x0198 */ kartBoundingBoxCorner boundingBoxCorners[4];
/* 0x0198 */ KartBoundingBoxCorner boundingBoxCorners[4];
/* 0x01F8 */ f32 unk_1F8;
/* 0x01FC */ f32 unk_1FC;
/* 0x0200 */ s32 unk_200;
+25 -25
View File
@@ -1,25 +1,25 @@
#ifndef TRIG_TABLES_H
#define TRIG_TABLES_H
/*
* The sine and cosine tables overlap, but "#define gCosineTable (gSineTable +
* 0x400)" doesn't give expected codegen; gSineTable and gCosineTable need to
* be different symbols for code to match. Most likely the tables were placed
* adjacent to each other, and gSineTable cut short, such that reads overflow
* into gCosineTable.
*
* These kinds of out of bounds reads are undefined behavior, and break on
* e.g. GCC (which doesn't place the tables next to each other, and probably
* exploits array sizes for range analysis-based optimizations as well).
* Thus, for non-IDO compilers we use the standard-compliant version.
*/
extern f32 gSineTable[];
#ifdef AVOID_UB
#define gCosineTable (gSineTable + 0x400)
#else
extern f32 gCosineTable[];
#endif
extern s16 gArctanTable[];
#endif
#ifndef TRIG_TABLES_H
#define TRIG_TABLES_H
/*
* The sine and cosine tables overlap, but "#define gCosineTable (gSineTable +
* 0x400)" doesn't give expected codegen; gSineTable and gCosineTable need to
* be different symbols for code to match. Most likely the tables were placed
* adjacent to each other, and gSineTable cut short, such that reads overflow
* into gCosineTable.
*
* These kinds of out of bounds reads are undefined behavior, and break on
* e.g. GCC (which doesn't place the tables next to each other, and probably
* exploits array sizes for range analysis-based optimizations as well).
* Thus, for non-IDO compilers we use the standard-compliant version.
*/
extern f32 gSineTable[];
#ifdef AVOID_UB
#define gCosineTable (gSineTable + 0x400)
#else
extern f32 gCosineTable[];
#endif
extern s16 gArctanTable[];
#endif