mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 06:54:33 +00:00
Add GCC compiler option. (#1056)
* GCC support. * Add note about gcc-mips-linux-gnu requirement to README.md. * changes * changes based on Tharo's suggestion * Cant reproduce file_choose.h error. Removing unnecessary -I * changes * wording based on Fig's suggestion * add AVOID_UB for eyes/mouth reordering issue. * remove unneeded flags and deprecate ZAPDFLAGS. * some changes, waiting on prs for the rest * fixes * discard header sections * change section handling in mkldscript * avoid_ub in DmaMgr_GetFileNameImpl * move asm to inline asm (consolidate gcc functions) * change prefix back * remove space * fix warnings * Revert "remove space" This reverts commit94af6977b3
. * Revert "fix warnings" This reverts commitd729ddf457
. * finish up missing_gcc_functions * revert unwanted mkldscript change * temporary workaround. TODO: Stop the asm processor from choking * fix ido build * Revert "temporary workaround. TODO: Stop the asm processor from choking" This reverts commit9df892b7ac
. * review * remove unused line in mkldscript * remove tabs * clarify zf comment * review2 * review * remove duplicate cc_check * vanilla code always come first * std_dma avoid ub * add compiler_gcc to cflags * only use two blocks when necessary * clarify zf comment Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
parent
67f294774b
commit
c3533052ca
11 changed files with 420 additions and 42 deletions
|
@ -1019,9 +1019,12 @@ void* AudioHeap_AllocPermanent(s32 tableType, s32 id, u32 size) {
|
|||
gAudioContext.permanentCache[index].tableType = tableType;
|
||||
gAudioContext.permanentCache[index].id = id;
|
||||
gAudioContext.permanentCache[index].size = size;
|
||||
|
||||
//! @bug UB: missing return. "ret" is in v0 at this point, but doing an
|
||||
// explicit return uses an additional register.
|
||||
// return ret;
|
||||
#ifdef AVOID_UB
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
void* AudioHeap_AllocSampleCache(u32 size, s32 fontId, void* sampleAddr, s8 medium, s32 cache) {
|
||||
|
|
|
@ -655,6 +655,7 @@ u8 sEyeMouthIndexes[][2] = {
|
|||
* shiftability, and changes will need to be made in the code to account for this in a modding scenario. The symbols
|
||||
* from adult Link's object are used here.
|
||||
*/
|
||||
#ifndef AVOID_UB
|
||||
void* sEyeTextures[] = {
|
||||
gLinkAdultEyesOpenTex, gLinkAdultEyesHalfTex, gLinkAdultEyesClosedfTex, gLinkAdultEyesRollLeftTex,
|
||||
gLinkAdultEyesRollRightTex, gLinkAdultEyesShockTex, gLinkAdultEyesUnk1Tex, gLinkAdultEyesUnk2Tex,
|
||||
|
@ -666,6 +667,20 @@ void* sMouthTextures[] = {
|
|||
gLinkAdultMouth3Tex,
|
||||
gLinkAdultMouth4Tex,
|
||||
};
|
||||
#else
|
||||
// Defining `AVOID_UB` will use a 2D array instead and properly use the child link pointers to allow for shifting.
|
||||
void* sEyeTextures[][8] = {
|
||||
{ gLinkAdultEyesOpenTex, gLinkAdultEyesHalfTex, gLinkAdultEyesClosedfTex, gLinkAdultEyesRollLeftTex,
|
||||
gLinkAdultEyesRollRightTex, gLinkAdultEyesShockTex, gLinkAdultEyesUnk1Tex, gLinkAdultEyesUnk2Tex },
|
||||
{ gLinkChildEyesOpenTex, gLinkChildEyesHalfTex, gLinkChildEyesClosedfTex, gLinkChildEyesRollLeftTex,
|
||||
gLinkChildEyesRollRightTex, gLinkChildEyesShockTex, gLinkChildEyesUnk1Tex, gLinkChildEyesUnk2Tex },
|
||||
};
|
||||
|
||||
void* sMouthTextures[][4] = {
|
||||
{ gLinkAdultMouth1Tex, gLinkAdultMouth2Tex, gLinkAdultMouth3Tex, gLinkAdultMouth4Tex },
|
||||
{ gLinkChildMouth1Tex, gLinkChildMouth2Tex, gLinkChildMouth3Tex, gLinkChildMouth4Tex },
|
||||
};
|
||||
#endif
|
||||
|
||||
Color_RGB8 sTunicColors[] = {
|
||||
{ 30, 105, 27 },
|
||||
|
@ -696,13 +711,21 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
|
|||
eyeIndex = sEyeMouthIndexes[face][0];
|
||||
}
|
||||
|
||||
#ifndef AVOID_UB
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[eyeIndex]));
|
||||
#else
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[gSaveContext.linkAge][eyeIndex]));
|
||||
#endif
|
||||
|
||||
if (mouthIndex < 0) {
|
||||
mouthIndex = sEyeMouthIndexes[face][1];
|
||||
}
|
||||
|
||||
#ifndef AVOID_UB
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[mouthIndex]));
|
||||
#else
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[gSaveContext.linkAge][mouthIndex]));
|
||||
#endif
|
||||
|
||||
color = &sTunicColors[tunic];
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue