Merge branch 'master' into voice

This commit is contained in:
engineer124
2022-01-17 14:25:10 +11:00
119 changed files with 5020 additions and 1021 deletions
+7
View File
@@ -0,0 +1,7 @@
<Root>
<File Name="week_static">
<Texture Name="gClockDay1stTex" OutName="clock_day_1st_tex" Format="i8" Width="48" Height="27" Offset="0x0"/>
<Texture Name="gClockDay2ndTex" OutName="clock_day_2nd_tex" Format="i8" Width="48" Height="27" Offset="0x510"/>
<Texture Name="gClockDayFinalTex" OutName="clock_day_final_tex" Format="i8" Width="48" Height="27" Offset="0xA20"/>
</File>
</Root>
+8
View File
@@ -0,0 +1,8 @@
<Root>
<File Name="story_static">
<Texture Name="gStoryMaskFestivalTex" OutName="story_mask_festival" Format="ci8" Width="320" Height="240" TlutOffset="0x25800" Offset="0x0"/>
<Texture Name="gStoryGiantsLeavingTex" OutName="story_giants_leaving" Format="ci8" Width="320" Height="240" TlutOffset="0x25A00" Offset="0x12C00"/>
<Texture Name="gStoryMaskFestivalTLUT" OutName="story_mask_festival_tlut" Format="rgba16" Width="16" Height="16" Offset="0x25800"/>
<Texture Name="gStoryGiantsLeavingTLUT" OutName="story_giants_leaving_tlut" Format="rgba16" Width="16" Height="16" Offset="0x25A00"/>
</File>
</Root>
+1
View File
@@ -1,4 +1,5 @@
<Root>
<!-- Assets for Big Poes -->
<File Name="object_bigpo" Segment="6">
<Animation Name="gBigpoSwingLampAttackAnim" Offset="0x158" />
<Animation Name="gBigpoShockAnim" Offset="0x454" />
+1
View File
@@ -1,4 +1,5 @@
<Root>
<!-- Assets for the Gekko, Minislime, and Bigslime -->
<File Name="object_bigslime" Segment="6">
<Animation Name="gGekkoFullFistPumpAnim" Offset="0x994" />
<Animation Name="gGekkoSurpriseJumpAnim" Offset="0x10F4" />
+2 -1
View File
@@ -1,9 +1,10 @@
<Root>
<!-- Assets for Nejiron -->
<File Name="object_gmo" Segment="6">
<Animation Name="gNejironIdleAnim" Offset="0x18" /> <!-- Original name might be "gm_default" -->
<DList Name="gNejironBodyDL" Offset="0xB70" />
<DList Name="gNejironEyesDL" Offset="0xE38" />
<Texture Name="gNejironBodyTLUT" OutName="nejiron_body_palette" Format="rgba16" Width="16" Height="16" Offset="0xEC8" />
<Texture Name="gNejironBodyTLUT" OutName="nejiron_body_tlut" Format="rgba16" Width="16" Height="16" Offset="0xEC8" />
<Texture Name="gNejironBodyTex" OutName="nejiron_body" Format="ci8" Width="32" Height="32" Offset="0x10C8" />
<Texture Name="gNejironEyeOpenTex" OutName="nejiron_eye_open" Format="rgba16" Width="16" Height="32" Offset="0x14C8" />
<Texture Name="gNejironEyeHalfTex" OutName="nejiron_eye_half" Format="rgba16" Width="16" Height="32" Offset="0x18C8" />
+15 -12
View File
@@ -1,22 +1,25 @@
<Root>
<!-- Textures for the title screen -->
<File Name="object_mag" Segment="6">
<Texture Name="gTitleScreenZeldaLogoTex" OutName="title_screen_zelda_logo" Format="rgba32" Width="144" Height="64" Offset="0x0"/>
<Texture Name="gTitleScreenMajorasMaskSubtitleTex" OutName="title_screen_majoras_mask_subtitle" Format="i8" Width="104" Height="16" Offset="0x9000"/>
<Texture Name="gTitleScreenMajorasMaskSubtitleMaskTex" OutName="title_screen_majoras_mask_subtitle_mask" Format="i8" Width="104" Height="16" Offset="0x9680"/><!-- Masking the flame effect -->
<Texture Name="gTitleScreenTheLegendOfTextTex" OutName="title_screen_the_legend_of_text" Format="i8" Width="72" Height="8" Offset="0x9D00"/>
<Texture Name="gTitleScreenMaskGlowDim00Tex" OutName="title_screen_mask_glow_dim_0_0" Format="i4" Width="64" Height="64" Offset="0x9F40"/>
<Texture Name="gTitleScreenMaskGlowDim01Tex" OutName="title_screen_mask_glow_dim_0_1" Format="i4" Width="64" Height="64" Offset="0xA740"/>
<Texture Name="gTitleScreenMaskGlowDim10Tex" OutName="title_screen_mask_glow_dim_1_0" Format="i4" Width="64" Height="64" Offset="0xAF40"/>
<Texture Name="gTitleScreenMaskGlowDim11Tex" OutName="title_screen_mask_glow_dim_1_1" Format="i4" Width="64" Height="64" Offset="0xB740"/>
<Texture Name="gTitleScreenZeldaGlow0Tex" OutName="title_screen_zelda_glow_0" Format="i4" Width="64" Height="64" Offset="0xBF40"/>
<Texture Name="gTitleScreenZeldaGlow1Tex" OutName="title_screen_zelda_glow_1" Format="i4" Width="64" Height="64" Offset="0xC740"/>
<Texture Name="gTitleScreenMaskGlowBright00Tex" OutName="title_screen_mask_glow_bright_0_0" Format="i4" Width="64" Height="64" Offset="0xCF40"/>
<Texture Name="gTitleScreenMaskGlowBright01Tex" OutName="title_screen_mask_glow_bright_0_1" Format="i4" Width="64" Height="64" Offset="0xD740"/>
<Texture Name="gTitleScreenMaskGlowBright10Tex" OutName="title_screen_mask_glow_bright_1_0" Format="i4" Width="64" Height="64" Offset="0xDF40"/>
<Texture Name="gTitleScreenMaskGlowBright11Tex" OutName="title_screen_mask_glow_bright_1_1" Format="i4" Width="64" Height="64" Offset="0xE740"/>
<Texture Name="gTitleScreenGlowRight0Tex" OutName="title_screen_glow_right_0" Format="i4" Width="64" Height="64" Offset="0xEF40"/>
<Texture Name="gTitleScreenGlowRight1Tex" OutName="title_screen_glow_right_1" Format="i4" Width="64" Height="64" Offset="0xF740"/>
<Texture Name="gTitleScreenDisplayEffectMask00Tex" OutName="title_screen_display_effect_mask_0_0" Format="i4" Width="64" Height="64" Offset="0x9F40"/>
<Texture Name="gTitleScreenDisplayEffectMask01Tex" OutName="title_screen_display_effect_mask_0_1" Format="i4" Width="64" Height="64" Offset="0xA740"/>
<Texture Name="gTitleScreenDisplayEffectMask10Tex" OutName="title_screen_display_effect_mask_1_0" Format="i4" Width="64" Height="64" Offset="0xAF40"/>
<Texture Name="gTitleScreenDisplayEffectMask11Tex" OutName="title_screen_display_effect_mask_1_1" Format="i4" Width="64" Height="64" Offset="0xB740"/>
<Texture Name="gTitleScreenDisplayEffectMask02Tex" OutName="title_screen_display_effect_mask_0_2" Format="i4" Width="64" Height="64" Offset="0xBF40"/>
<Texture Name="gTitleScreenDisplayEffectMask12Tex" OutName="title_screen_display_effect_mask_1_2" Format="i4" Width="64" Height="64" Offset="0xC740"/>
<Texture Name="gTitleScreenAppearEffectMask00Tex" OutName="title_screen_appear_effect_mask_0_0" Format="i4" Width="64" Height="64" Offset="0xCF40"/>
<Texture Name="gTitleScreenAppearEffectMask01Tex" OutName="title_screen_appear_effect_mask_0_1" Format="i4" Width="64" Height="64" Offset="0xD740"/>
<Texture Name="gTitleScreenAppearEffectMask10Tex" OutName="title_screen_appear_effect_mask_1_0" Format="i4" Width="64" Height="64" Offset="0xDF40"/>
<Texture Name="gTitleScreenAppearEffectMask11Tex" OutName="title_screen_appear_effect_mask_1_1" Format="i4" Width="64" Height="64" Offset="0xE740"/>
<Texture Name="gTitleScreenAppearEffectMask02Tex" OutName="title_screen_appear_effect_mask_0_2" Format="i4" Width="64" Height="64" Offset="0xEF40"/>
<Texture Name="gTitleScreenAppearEffectMask12Tex" OutName="title_screen_appear_effect_mask_1_2" Format="i4" Width="64" Height="64" Offset="0xF740"/>
<Texture Name="gTitleScreenFlame0Tex" OutName="title_screen_flame_0" Format="i8" Width="32" Height="32" Offset="0xFF40"/>
<Texture Name="gTitleScreenFlame1Tex" OutName="title_screen_flame_1" Format="i8" Width="32" Height="32" Offset="0x10340"/>
<Texture Name="gTitleScreenFlame2Tex" OutName="title_screen_flame_2" Format="i8" Width="32" Height="32" Offset="0x10740"/>
+1
View File
@@ -1,4 +1,5 @@
<Root>
<!-- Assets for the Clock Tower steps -->
<File Name="object_tokei_step" Segment="6">
<DList Name="gClocktowerPanelEmptyDL" Offset="0x80" />
<DList Name="gClocktowerPanelDL" Offset="0x88" />
+9
View File
@@ -0,0 +1,9 @@
<Root>
<File Name="ovl_En_Kanban" BaseAddress="0x80954960" RangeStart="0x3440" RangeEnd="0x3500">
<Array Name="gEnKanban_D_80957DA0" Count="4" Offset="0x3440">
<Vtx/>
</Array>
<DList Name="gEnKanban_D_80957DE0" Offset="0x3480"/>
</File>
</Root>
+2 -2
View File
@@ -262,7 +262,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, D_80C106B0[this->unk_2AC]);
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -273,7 +273,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
(We can delete the `GLOBAL_ASM` lines now.)
The worst part of documentation is finding somewhere to start. We have a decent place to start here, though, in that we already know the function (or rather, the use) of a couple of the functions, namely the LimbDraws. So we can rename `func_80C10558` to `EnRecepgirl_OverrideLimbDraw` and `func_80C10590` to `EnRecepgirl_UnkLimbDraw`. Remember to do a global rename so that the functions in the assembly are renamed, use `rename_global_asm`,
The worst part of documentation is finding somewhere to start. We have a decent place to start here, though, in that we already know the function (or rather, the use) of a couple of the functions, namely the LimbDraws. So we can rename `func_80C10558` to `EnRecepgirl_OverrideLimbDraw` and `func_80C10590` to `EnRecepgirl_TransformLimbDraw`. Remember to do a global rename so that the functions in the assembly are renamed, use `rename_global_asm`,
```
$ ./tools/rename_global_asm.py
asm/non_matchings/overlays/ovl_En_Recepgirl/func_80C10558.s --> asm/non_matchings/overlays/ovl_En_Recepgirl/EnRecepgirl_OverrideLimbDraw.s
+12 -12
View File
@@ -34,7 +34,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
sp30->polyOpa.p = temp_v1 + 8;
temp_v1->words.w0 = 0xDB060020;
temp_v1->words.w1 = (u32) D_80C106B0[this->unk_2AC];
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32) this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, (Actor *) this);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32) this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, (Actor *) this);
}
```
@@ -107,7 +107,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, D_80C106B0[this->unk_2AC]);
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -115,28 +115,28 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
And this matches.
The last two functions in the actor are used as arguments in `func_801343C0`. This is a `SkelAnime` function, except unlike the OoT ones, it has three function callback arguments instead of two: in `functions.h` or `z_skelanime.c`, we find
The last two functions in the actor are used as arguments in `SkelAnime_DrawTransformFlexOpa`. This is a `SkelAnime` function, except unlike the OoT ones, it has three function callback arguments instead of two: in `functions.h` or `z_skelanime.c`, we find
```C
void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkDraw, Actor* actor)
void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor)
```
The typedefs of the callbacks it uses are in `z64animation.h`:
```C
typedef s32 (*OverrideLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor);
typedef s32 (*OverrideLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* thisx);
typedef void (*PostLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* actor);
typedef void (*PostLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* thisx);
[...]
typedef void (*UnkActorDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor);
typedef void (*TransformLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx);
```
which is where mips2c got them from.
In this case, only two of them are used, and it is these that are the last functions standing between us and a decompiled actor.
## OverrideLimbDraw, PostLimbDraw, UnkActorDraw
## OverrideLimbDraw, PostLimbDraw, TransformLimbDraw
Well, we don't have a PostLimbDraw here, but as we see from the prototype, it's much the same as the OverrideLimbDraw but without the `pos` argument and no return value.
```C
@@ -159,7 +159,7 @@ s32 func_80C10558(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *p
}
```
As for the UnkActorDraw, it has a much simpler prototype. mips2c gives
As for the TransformLimbDraw, it has a much simpler prototype. mips2c gives
```C
void func_80C10590(GlobalContext *globalCtx, s32 limbIndex, Actor *actor) {
if (limbIndex == 5) {
+15 -41
View File
@@ -194,16 +194,7 @@ s32 func_80086D40(f64 param_1);
f64 func_80086D6C(f64 param_1);
s32 func_80086D8C(f32 param_1);
s32 func_80086DAC(f64 param_1);
void* SystemArena_Malloc(size_t size);
void* SystemArena_MallocR(size_t size);
void* SystemArena_Realloc(void* oldPtr, size_t newSize);
void SystemArena_Free(void* ptr);
void* SystemArena_Calloc(u32 elements, size_t size);
void SystemArena_AnalyzeArena(size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated);
u32 SystemArena_CheckArena(void);
void SystemArena_InitArena(void* start, size_t size);
void SystemArena_Cleanup(void);
u8 SystemArena_IsInitialized(void);
s32 Rand_Next(void);
void Rand_Seed(u32 seed);
f32 Rand_ZeroOne(void);
@@ -212,20 +203,7 @@ void Rand_Seed_Variable(u32* rndNum, u32 seed);
u32 Rand_Next_Variable(u32* param_1);
f32 Rand_ZeroOne_Variable(u32* param_1);
f32 Rand_Centered_Variable(u32* param_1);
void ArenaImpl_LockInit(Arena* heap);
void ArenaImpl_Lock(Arena* heap);
void ArenaImpl_Unlock(Arena* heap);
ArenaNode* ArenaImpl_GetLastBlock(Arena* param_1);
void __osMallocInit(Arena* heap, void* heapBase, size_t heapSize);
void __osMallocAddBlock(Arena* heap, void* start, s32 size);
void __osMallocCleanup(Arena* heap);
u8 __osMallocIsInitalized(Arena* heap);
void* __osMalloc(Arena* heap, size_t size);
void* __osMallocR(Arena* heap, size_t size);
void __osFree(Arena* heap, void* ptr);
void* __osRealloc(Arena* heap, void* oldPtr, size_t newSize);
void __osAnalyzeArena(Arena* heap, size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated);
u32 __osCheckArena(Arena* heap);
void* proutSprintf(void* s, const char* buf, size_t n);
s32 vsprintf(char* dst, char* fmt, va_list args);
s32 sprintf(char* s, char* fmt, ...);
@@ -1769,7 +1747,7 @@ void* ZeldaArena_Realloc(void* oldPtr, size_t newSize);
void ZeldaArena_Free(void* param_1);
void* ZeldaArena_Calloc(u32 num, size_t size);
void ZeldaArena_GetSizes(size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated);
void ZeldaArena_Check();
s32 ZeldaArena_Check();
void ZeldaArena_Init(void* start, size_t size);
void ZeldaArena_Cleanup();
u8 ZeldaArena_IsInitialized();
@@ -2397,8 +2375,8 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, Mtx** limbMatricies);
void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor, Mtx** mtx);
void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor);
void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx);
void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor);
void SkelAnime_GetFrameData(AnimationHeader* animationSeg, s32 currentFrame, s32 limbCount, Vec3s* dst);
s16 Animation_GetLength(void* animation);
s16 Animation_GetLastFrame(void* animation);
@@ -2526,8 +2504,8 @@ u32 func_8013A4C4(s32 flag);
s16 func_8013A504(s16 val);
s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos, Vec3s* rot, f32 distanceMin, f32 distanceMax, s16 angleError);
struct EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5);
Gfx* func_8013A860(GlobalContext* globalCtx, s32 idx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkActorDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
Gfx* func_8013AB00(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkActorDraw, Actor* actor, Gfx* gfx);
Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 idx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx);
s32 func_8013AD6C(GlobalContext* globalCtx);
s32 func_8013AD9C(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 arg5);
void func_8013AED4(u16* arg0, u16 arg1, u16 arg2);
@@ -3584,16 +3562,12 @@ void Audio_WritebackDCache(void* buf, size_t size);
// void func_801964F8(void);
// void func_801965F0(void);
// void func_801968C4(void);
// void func_80196A00(void);
// void func_80196BC8(void);
// void func_80196D20(void);
// void func_80196D7C(void);
// void func_80196DB4(void);
// void func_80196FEC(void);
// void func_80197048(void);
// void func_80197138(void);
// void func_80197164(void);
// void func_80197188(void);
void AudioEffects_SequencePlayerProcessSound(SequencePlayer* seqPlayer);
void AudioEffects_NoteVibratoUpdate(Note* note);
void AudioEffects_NoteVibratoInit(Note* note);
void AudioEffects_NotePortamentoInit(Note* note);
void AudioEffects_AdsrInit(AdsrState* adsr, AdsrEnvelope* envelope, s16* volOut);
f32 AudioEffects_AdsrUpdate(AdsrState* adsr);
// void func_801974D0(void);
// void func_80197538(void);
// void func_80197714(void);
@@ -3605,7 +3579,7 @@ void Audio_WritebackDCache(void* buf, size_t size);
// void func_80197C0C(void);
// void func_80197C8C(void);
// void func_80197D24(void);
// void func_80197D4C(void);
void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer);
// void func_80197E08(void);
// void func_80197E48(void);
// void func_80197E88(void);
@@ -3790,7 +3764,7 @@ void func_801A3CD8(s8 param_1);
// void func_801A3D98(void);
// void func_801A3E38(void);
// void func_801A3EC0(void);
void func_801A3F54(s32 arg0);
void func_801A3F54(u8 flag);
// void func_801A3F6C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801A3FB4(void);
// void func_801A3FFC(UNK_TYPE1 param_1);
+17 -2
View File
@@ -2,7 +2,7 @@
#define _MACROS_H_
#include "libc/stdint.h"
#include "convert.h"
#include "ultra64/convert.h"
#include "z64.h"
#define SCREEN_WIDTH 320
@@ -45,7 +45,7 @@
// linkAge still exists in MM, but is always set to 0 (always adult)
// There are remnants of these macros from OOT, but they are essentially useless
//#define LINK_IS_CHILD (gSaveContext.linkAge != 0)
#define LINK_IS_CHILD (gSaveContext.linkAge == 1)
#define LINK_IS_ADULT (gSaveContext.linkAge == 0)
#define CURRENT_DAY (((void)0, gSaveContext.day) % 5)
@@ -127,6 +127,21 @@ extern GraphicsContext* __gfxCtx;
#define GRAPH_ALLOC(gfxCtx, size) ((void*)((gfxCtx)->polyOpa.d = (Gfx*)((u8*)(gfxCtx)->polyOpa.d - (size))))
// Custom gbi macro
#define gDPSetTileCustom(pkt, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
{ \
gDPPipeSync(pkt); \
gDPTileSync(pkt); \
gDPSetTile(pkt, fmt, siz, (((width)*siz##_TILE_BYTES) + 7) >> 3, 0, G_TX_LOADTILE, 0, cmt, maskt, shiftt, cms, \
masks, shifts); \
gDPTileSync(pkt); \
gDPSetTile(pkt, fmt, siz, (((width)*siz##_TILE_BYTES) + 7) >> 3, 0, G_TX_RENDERTILE, pal, cmt, maskt, shiftt, \
cms, masks, shifts); \
gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, ((width)-1) << G_TEXTURE_IMAGE_FRAC, \
((height)-1) << G_TEXTURE_IMAGE_FRAC); \
} \
(void)0
#define ALIGN8(val) (((val) + 7) & ~7)
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
#define ALIGN64(val) (((val) + 0x3F) & ~0x3F)
+35
View File
@@ -0,0 +1,35 @@
#ifndef OS_MALLOC
#define OS_MALLOC
#include "PR/ultratypes.h"
#include "ultra64/message.h"
#include "libc/stddef.h"
typedef struct ArenaNode {
/* 0x0 */ s16 magic; // Should always be 0x7373
/* 0x2 */ s16 isFree;
/* 0x4 */ size_t size;
/* 0x8 */ struct ArenaNode* next;
/* 0xC */ struct ArenaNode* prev;
} ArenaNode; // size = 0x10
typedef struct {
/* 0x00 */ ArenaNode* head;
/* 0x04 */ void* start;
/* 0x08 */ OSMesgQueue lock;
/* 0x20 */ u8 unk20;
/* 0x21 */ u8 isInit;
/* 0x22 */ u8 flag;
} Arena; // size = 0x24
void __osMallocInit(Arena* arena, void* heap, size_t size);
void __osMallocCleanup(Arena* arena);
u8 __osMallocIsInitalized(Arena* arena);
void* __osMalloc(Arena* arena, size_t size);
void* __osMallocR(Arena* arena, size_t size);
void __osFree(Arena* arena, void* ptr);
void* __osRealloc(Arena* arena, void* ptr, size_t newSize);
void __osGetSizes(Arena* arena, size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated);
s32 __osCheckArena(Arena* arena);
#endif
+20
View File
@@ -0,0 +1,20 @@
#ifndef SYSTEM_MALLOC
#define SYSTEM_MALLOC
#include "PR/ultratypes.h"
#include "os_malloc.h"
void* SystemArena_Malloc(size_t size);
void* SystemArena_MallocR(size_t size);
void* SystemArena_Realloc(void* oldPtr, size_t newSize);
void SystemArena_Free(void* ptr);
void* SystemArena_Calloc(u32 elements, size_t size);
void SystemArena_GetSizes(size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated);
u32 SystemArena_CheckArena(void);
void SystemArena_InitArena(void* start, size_t size);
void SystemArena_Cleanup(void);
u8 SystemArena_IsInitialized(void);
extern Arena gSystemArena;
#endif
@@ -1,5 +1,5 @@
#ifndef _ULTRA64_CONVERT_H_
#define _ULTRA64_CONVERT_H_
#ifndef ULTRA64_CONVERT_H
#define ULTRA64_CONVERT_H
#include "libc/stdint.h"
+3 -129
View File
@@ -322,7 +322,6 @@ extern StackEntry sFaultThreadInfo;
extern FaultThreadStruct gFaultStruct;
extern FaultDrawer sFaultDrawerStruct;
// extern UNK_TYPE4 D_8009CD10;
// extern Arena gSystemArena;
extern u32 sRandFloat;
// extern UNK_TYPE4 sArenaLockMsg;
extern OSTask tmp_task;
@@ -1643,10 +1642,10 @@ extern MtxF gIdentityMtxF;
// extern UNK_TYPE1 D_801D4790;
// extern UNK_TYPE1 D_801D4990;
// extern UNK_TYPE1 D_801D4B90;
extern UNK_PTR D_801D4D90;
extern s16* gWaveSamples[9];
extern UNK_PTR D_801D4D98;
extern UNK_PTR D_801D4DB0;
// extern UNK_TYPE1 D_801D4DB4;
extern f32 gBendPitchOneOctaveFrequencies[256];
// extern UNK_TYPE1 D_801D4FB4;
// extern UNK_TYPE4 D_801D51B4;
// extern UNK_TYPE4 D_801D53B4;
@@ -3271,7 +3270,6 @@ extern s16 D_801F4E7A;
// extern UNK_TYPE1 D_801F4F68;
// extern UNK_TYPE1 D_801F4F6A;
extern LightsBuffer sLightsBuffer;
extern Arena sZeldaArena;
// extern UNK_TYPE1 D_801F5130;
// extern UNK_TYPE1 D_801F5270;
// extern UNK_TYPE1 D_801F528E;
@@ -3625,131 +3623,7 @@ extern SoundRequest D_801FE7C0[1];
// extern UNK_TYPE1 D_80200BCC;
// extern UNK_TYPE1 D_80200BCE;
// extern UNK_TYPE1 D_80200BD0;
// extern UNK_TYPE1 D_80200C70;
// extern UNK_TYPE1 D_80200C71;
// extern UNK_TYPE1 D_80200C76;
// extern UNK_TYPE1 D_80200C78;
// extern UNK_TYPE1 D_80200C7C;
// extern UNK_TYPE1 D_80200C80;
// extern UNK_TYPE1 D_80200C92;
// extern UNK_TYPE1 D_80200C94;
// extern UNK_TYPE1 D_80200C98;
// extern UNK_TYPE1 D_80200C9A;
// extern UNK_TYPE1 D_80200C9E;
// extern UNK_TYPE1 D_80200CA0;
// extern UNK_TYPE1 D_80200CF0;
// extern UNK_TYPE1 D_80200D38;
// extern UNK_TYPE1 D_80200D70;
// extern UNK_TYPE1 D_802011F0;
// extern UNK_TYPE1 D_8020178C;
// extern UNK_TYPE1 D_802017B0;
// extern UNK_TYPE1 D_80201D68;
// extern UNK_TYPE1 D_80201D6C;
// extern UNK_TYPE1 D_802023FC;
// extern UNK_TYPE1 D_80202878;
// extern UNK_TYPE1 D_80202880;
// extern UNK_TYPE1 D_802028BC;
extern OSMesgQueue D_80202980;
// extern UNK_TYPE1 D_802029D8;
extern OSMesgQueue D_80202AB0;
extern OSMesg D_80202AC8[0x10];
extern OSMesgQueue D_80202B08;
extern OSMesg D_80202B20[0x10];
extern OSMesgQueue D_80202B60;
extern OSMesg D_80202B78[0x40];
extern OSMesgQueue D_80203278;
extern OSMesg D_80203290[1];
// extern UNK_TYPE1 D_80203294;
// extern UNK_TYPE1 D_802034C0;
// extern UNK_TYPE1 D_802034C4;
// extern UNK_TYPE1 D_802034C8;
// extern UNK_TYPE4 D_802034D0;
// extern UNK_TYPE1 D_802034D4;
// extern UNK_TYPE1 D_802034D8;
// extern UNK_TYPE1 D_802034DC;
// extern UNK_TYPE1 D_802034E8;
// extern UNK_TYPE2 D_802034F0;
// extern UNK_TYPE1 D_802034F8;
// extern UNK_TYPE1 D_802034FC;
// extern UNK_TYPE1 D_80203500;
// extern UNK_TYPE4 D_80203528;
// extern UNK_TYPE1 D_8020352C;
// extern UNK_TYPE1 D_8020352E;
// extern UNK_TYPE1 D_80203530;
// extern UNK_TYPE4 D_8020360C;
// extern UNK_TYPE1 D_80203618;
// extern UNK_TYPE1 D_8020361C;
// extern UNK_TYPE1 D_80203620;
// extern UNK_TYPE1 D_80203624;
// extern UNK_TYPE1 D_80203628;
// extern UNK_TYPE1 D_80203630;
// extern UNK_TYPE1 D_80203640;
// extern UNK_TYPE1 D_80203650;
// extern UNK_TYPE1 D_80203660;
// extern UNK_TYPE1 D_80203690;
// extern UNK_TYPE1 D_802036A0;
// extern UNK_TYPE1 D_802036B0;
// extern UNK_TYPE1 D_802036C0;
// extern UNK_TYPE1 D_802036C4;
// extern UNK_TYPE1 D_80203794;
// extern UNK_TYPE1 D_80203798;
// extern UNK_TYPE1 D_802037D0;
// extern UNK_TYPE1 D_802037D4;
// extern UNK_TYPE1 D_802038A4;
// extern UNK_TYPE1 D_802038A8;
// extern UNK_TYPE1 D_802038C2;
// extern UNK_TYPE1 D_802038CE;
// extern UNK_TYPE1 D_802038E0;
// extern UNK_TYPE1 D_802038E4;
// extern UNK_TYPE1 D_80203970;
// extern UNK_TYPE1 D_802039B4;
// extern UNK_TYPE1 D_802039B8;
// extern UNK_TYPE1 D_802039D2;
// extern UNK_TYPE1 D_802039DE;
// extern UNK_TYPE1 D_802039F0;
// extern UNK_TYPE1 D_802039FC;
// extern UNK_TYPE1 D_80203B80;
// extern UNK_TYPE1 D_80203B88;
// extern UNK_TYPE1 D_80203B90;
// extern UNK_TYPE1 D_80204590;
// extern UNK_TYPE1 D_80204594;
// extern UNK_TYPE1 D_80204598;
// extern UNK_TYPE1 D_802045A4;
// extern UNK_TYPE1 D_80204FA4;
// extern UNK_TYPE1 D_80204FA8;
// extern UNK_TYPE1 D_80204FB4;
// extern UNK_TYPE1 D_80204FB8;
// extern UNK_TYPE1 D_80204FC0;
// extern UNK_TYPE1 D_80204FCC;
// extern UNK_TYPE1 D_80204FD8;
// extern UNK_TYPE1 D_80205008;
// extern UNK_TYPE1 D_80205038;
// extern UNK_TYPE1 D_802050B9;
// extern UNK_TYPE1 D_802050C0;
// extern UNK_TYPE1 D_802050C4;
// extern UNK_TYPE4 D_802050CC;
// extern UNK_TYPE4 D_802050D0;
// extern UNK_TYPE1 D_80205228;
// extern UNK_TYPE1 D_8020522B;
// extern UNK_TYPE1 D_80205390;
// extern UNK_TYPE1 D_802053C8;
// extern UNK_TYPE1 D_802057B0;
// extern UNK_TYPE1 D_80205830;
// extern UNK_TYPE1 D_802084B0;
// extern UNK_TYPE1 D_80208530;
// extern UNK_TYPE1 D_80208598;
// extern UNK_TYPE1 D_802085A8;
// extern UNK_TYPE1 D_802085B8;
// extern UNK_TYPE1 D_802085C8;
// extern UNK_TYPE1 D_802085D8;
// extern UNK_TYPE1 D_802085F8;
// extern UNK_TYPE1 D_802085FC;
// extern UNK_TYPE1 D_80208604;
// extern UNK_TYPE1 D_8020861C;
// extern UNK_TYPE1 D_80208634;
// extern UNK_TYPE1 D_8020864C;
// extern UNK_TYPE1 D_80208650;
// extern UNK_TYPE1 D_80208654;
extern AudioContext gAudioContext; // at 0x80200C70
// extern UNK_TYPE4 D_80208E68;
// extern UNK_TYPE4 D_80208E6C;
// extern UNK_TYPE4 D_80208E70;
+4 -19
View File
@@ -167,8 +167,10 @@ typedef struct {
/* 0x5 */ Color_RGB8 envColor;
} FireObjLightParams; // size = 0x8
#define FONT_CHAR_TEX_WIDTH 16
#define FONT_CHAR_TEX_HEIGHT 16
//! @TODO: Make this use `sizeof(AnyFontTextureSymbol)`
#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2)
#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2) // 16x16 I4 texture
// Font textures are loaded into here
typedef struct {
@@ -884,23 +886,6 @@ typedef struct {
/* 0x120D8 */ UNK_TYPE1 pad120D8[0x8];
} MessageContext; // size = 0x120E0
typedef struct ArenaNode {
/* 0x0 */ s16 magic; // Should always be 0x7373
/* 0x2 */ s16 isFree;
/* 0x4 */ size_t size;
/* 0x8 */ struct ArenaNode* next;
/* 0xC */ struct ArenaNode* prev;
} ArenaNode; // size = 0x10
typedef struct {
/* 0x00 */ ArenaNode* head;
/* 0x04 */ void* start;
/* 0x08 */ OSMesgQueue lock;
/* 0x20 */ u8 unk20;
/* 0x21 */ u8 isInit;
/* 0x22 */ u8 flag;
} Arena; // size = 0x24
typedef struct FaultAddrConvClient {
/* 0x0 */ struct FaultAddrConvClient* next;
/* 0x4 */ void* (*callback)(void*, void*);
@@ -1412,7 +1397,7 @@ typedef struct EnHy {
typedef struct {
/* 0x0 */ u8 unk0;
/* 0x4 */ s32 unk4;
/* 0x8 */ s32 unk8;
/* 0x8 */ s32 unk8; // game script pointer?
} struct_80133038_arg2; // size = 0xC
typedef s32 (*func_8013E748_arg6)(struct GlobalContext*, Actor*, Vec3s*);
-1
View File
@@ -18,7 +18,6 @@ struct Lights;
struct CollisionPoly;
struct EnBox;
struct EnDoor;
typedef void(*ActorFunc)(struct Actor* this, struct GlobalContext* globalCtx);
+8 -8
View File
@@ -204,26 +204,26 @@ typedef struct SkelAnime {
} SkelAnime; // size = 0x44
typedef s32 (*OverrideLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef void (*PostLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef s32 (*OverrideLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor, Gfx** gfx);
struct Actor* thisx, Gfx** gfx);
typedef void (*PostLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* actor, Gfx** gfx);
struct Actor* thisx, Gfx** gfx);
typedef s32 (*OverrideLimbDrawFlex)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef void (*PostLimbDrawFlex)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList1, Gfx** dList2, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef void (*UnkActorDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor);
typedef void (*TransformLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx);
typedef void (*UnkActorDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor, Gfx** gfx);
typedef void (*TransformLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx, Gfx** gfx);
typedef void (*AnimationEntryCallback)(struct GlobalContext*, AnimationEntryData*);
+9 -18
View File
@@ -11,6 +11,8 @@
#define MAX_CHANNELS_PER_BANK 3
#define AUDIO_LERPIMP(v0, v1, t) (v0 + ((v1 - v0) * t))
#define ADSR_DISABLE 0
#define ADSR_HANG -1
#define ADSR_GOTO -2
@@ -154,10 +156,10 @@ typedef struct NotePool {
// extrapolates exponentially in the wrong direction in that case, but that
// doesn't prevent seqplayer from doing it, AFAICT.
typedef struct {
/* 0x00 */ u8 mode; // bit 0x80 denotes something; the rest are an index 0-5
/* 0x02 */ u16 cur;
/* 0x04 */ u16 speed;
/* 0x08 */ f32 extent;
/* 0x0 */ u8 mode; // bit 0x80 denotes something; the rest are an index 0-5
/* 0x2 */ u16 cur;
/* 0x4 */ u16 speed;
/* 0x8 */ f32 extent;
} Portamento; // size = 0xC
typedef struct {
@@ -298,7 +300,7 @@ typedef struct {
/* 0x000 */ u8 fontDmaInProgress : 1;
/* 0x000 */ u8 recalculateVolume : 1;
/* 0x000 */ u8 stopScript : 1;
/* 0x000 */ u8 unk_0b1 : 1;
/* 0x000 */ u8 applyBend : 1;
/* 0x001 */ u8 state;
/* 0x002 */ u8 noteAllocPolicy;
/* 0x003 */ u8 muteBehavior;
@@ -324,7 +326,7 @@ typedef struct {
/* 0x028 */ f32 muteVolumeScale;
/* 0x02C */ f32 fadeVolumeScale;
/* 0x030 */ f32 appliedFadeVolume;
/* 0x034 */ f32 unk_34;
/* 0x034 */ f32 bend;
/* 0x038 */ struct SequenceChannel* channels[16];
/* 0x078 */ SeqScriptState scriptState;
/* 0x094 */ u8* shortNoteVelocityTable;
@@ -402,17 +404,6 @@ typedef struct VibratoSubStruct {
/* 0xC */ u16 vibratoDelay;
} VibratoSubStruct; // size = 0xE
typedef struct SequenceChannelSubStruct {
/* 0x0 */ u8 enabled : 1;
/* 0x0 */ u8 finished : 1;
/* 0x0 */ u8 stopScript : 1;
/* 0x0 */ u8 stopSomething2 : 1; // sets SequenceLayer.stopSomething
/* 0x0 */ u8 hasInstrument : 1;
/* 0x0 */ u8 stereoHeadsetEffects : 1;
/* 0x0 */ u8 largeNotes : 1; // notes specify duration and velocity
/* 0x0 */ u8 unused : 1;
} SequenceChannelSubStruct; // size = 0x1
// Also known as a SubTrack, according to sm64 debug strings.
typedef struct SequenceChannel {
/* 0x00 */ u8 enabled : 1;
@@ -530,7 +521,7 @@ typedef struct SequenceLayer {
/* 0x30 */ Portamento portamento;
/* 0x3C */ struct Note* note;
/* 0x40 */ f32 freqScale;
/* 0x44 */ f32 unk_34;
/* 0x44 */ f32 bend;
/* 0x48 */ f32 velocitySquare2;
/* 0x4C */ f32 velocitySquare; // not sure which one of those corresponds to the sm64 original
/* 0x50 */ f32 noteVelocity;

Some files were not shown because too many files have changed in this diff Show More