1
0
mirror of https://github.com/blawar/ooot.git synced 2024-07-04 18:13:37 +00:00

remove skelanime data files, few extra namings, add non_matching for func_800A2E70

This commit is contained in:
KrimtonZ 2020-03-25 14:38:16 -05:00
parent 582b32d39c
commit 864cb28e27
8 changed files with 120 additions and 123 deletions

View File

@ -139,7 +139,7 @@ glabel func_800BCA64
/* B33D88 800BCBE8 3C010001 */ lui $at, (0x00010B20 >> 16) # lui $at, 1
/* B33D8C 800BCBEC 34210B20 */ ori $at, (0x00010B20 & 0xFFFF) # ori $at, $at, 0xb20
/* B33D90 800BCBF0 02212021 */ addu $a0, $s1, $at
/* B33D94 800BCBF4 0C028CBB */ jal func_800A32EC
/* B33D94 800BCBF4 0C028CBB */ jal SkelAnime_AnimationCtxReset
/* B33D98 800BCBF8 AFA4003C */ sw $a0, 0x3c($sp)
/* B33D9C 800BCBFC 02202025 */ move $a0, $s1
/* B33DA0 800BCC00 0C019143 */ jal func_8006450C

View File

@ -1449,7 +1449,7 @@ glabel L800BE148
/* B3541C 800BE27C 34210B20 */ ori $at, (0x00010B20 & 0xFFFF) # ori $at, $at, 0xb20
/* B35420 800BE280 02012021 */ addu $a0, $s0, $at
/* B35424 800BE284 AFA40034 */ sw $a0, 0x34($sp)
/* B35428 800BE288 0C028CBB */ jal func_800A32EC
/* B35428 800BE288 0C028CBB */ jal SkelAnime_AnimationCtxReset
/* B3542C 800BE28C AFA30050 */ sw $v1, 0x50($sp)
/* B35430 800BE290 3C0F8016 */ lui $t7, %hi(gGameInfo) # $t7, 0x8016
/* B35434 800BE294 8DEFFA90 */ lw $t7, %lo(gGameInfo)($t7)

View File

@ -1,11 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purposee registers
.section .bss
glabel D_801600B0
.space 0x10

View File

@ -1,14 +0,0 @@
.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purposee registers
.section .data
glabel D_8012A480
.incbin "baserom.z64", 0xBA1620, 0x4
glabel D_8012A484
.incbin "baserom.z64", 0xBA1624, 0x1C

View File

@ -1149,10 +1149,10 @@ Gfx* SkelAnime_Draw2(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* actorD
Gfx* SkelAnime_DrawSV2(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* actorDrawTable, s32 dListCount,
SkelAnime_LimbUpdateMatrix2 updateMtxFunc, SkelAnime_LimbAppendDlist2 appendDlistFunc,
Actor* actor, Gfx* gfx);
void func_800A2E70(u8, Vec3s*, Vec3s*, Vec3s*, f32);
void func_800A32EC(u16* arg0);
void func_800A32F4(s32 arg0);
void func_800A3310(void* arg0);
void func_800A2E70(s32, Vec3s*, Vec3s*, Vec3s*, f32);
void SkelAnime_AnimationCtxReset(AnimationContext* animationCtx);
void func_800A32F4(GlobalContext* globalCtx);
void func_800A3310(GlobalContext* globalCtx);
void SkelAnime_LoadLinkAnimetion(GlobalContext* globalCtx, LinkAnimetionEntry* linkAnimetionSeg, s32 frame,
s32 limbCount, void* ram);
void SkelAnime_LoadAnimationType1(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src);

View File

@ -544,8 +544,6 @@ extern u32 gObjectTableSize;
extern RomFile gObjectTable[402];
extern EntranceInfo gEntranceTable[1556];
extern Scene gSceneTable[110];
//extern ? D_8012A480;
//extern ? D_8012A484;
//extern ? D_8012A4A0;
//extern ? D_8012A4E0;
//extern ? D_8012A4EC;
@ -3506,7 +3504,6 @@ extern u8 D_8015FD70;
//extern ? D_80160014;
//extern ? D_80160018;
//extern ? D_80160020;
//extern ? D_801600B0;
//extern ? D_801600C0;
extern u8 D_80161010;
extern u8 D_801610D4;

View File

@ -7,7 +7,7 @@
#define LINK_ANIMETION_OFFSET(addr,offset) (((u32)&_link_animetionSegmentRomStart)+((u32)addr)-((u32)&link_animetion_segment)+((u32)offset))
#define LIMB_DONE 0xFF
#define ANIMATION_ENTRY_MAX 0x32
#define ANIMATION_ENTRY_MAX 50
struct GlobalContext;
struct Actor;

View File

@ -18,7 +18,7 @@ void SkelAnime_AnimationType5Loaded(GlobalContext* globalCtx, AnimationEntryType
//.data
u32 D_8012A480 = 0;
static AnimationEntryCallback D_8012A484[] = {
static AnimationEntryCallback AnimationLoadDone[] = {
&SkelAnime_LinkAnimetionLoaded, &SkelAnime_AnimationType1Loaded, &SkelAnime_AnimationType2Loaded,
&SkelAnime_AnimationType3Loaded, &SkelAnime_AnimationType4Loaded, &SkelAnime_AnimationType5Loaded,
};
@ -131,7 +131,6 @@ void SkelAnime_LodDraw(GlobalContext* globalCtx, Skeleton* skeleton, Vec3s* acto
func_800C6B54(gfx, globalCtx->state.gfxCtx, "../z_skelanime.c", 894);
}
//#define NON_MATCHING
#ifdef NON_MATCHING
// regalloc
void SkelAnime_LodDrawLimbSV(GlobalContext* globalCtx, s32 limbIndex, Skeleton* skeleton, Vec3s* actorDrawTable,
@ -776,18 +775,44 @@ s16 func_800A2E2C(GenericAnimationHeader* animationSeg) {
return animation->frameCount - 1;
}
// Very large update function
#ifdef NON_MATCHING
// Functionally equal, but loop unrolling is way off.
void func_800A2E70(s32 limbCount, Vec3s* vec1, Vec3s* vec2, Vec3s* vec3, f32 unkf) {
Vec3s* pvec1;
Vec3s* pvec2;
Vec3s* pvec3;
s32 iVar3;
if (unkf < 1.0f) {
for (iVar3 = 0, pvec1 = vec1, pvec2 = vec2, pvec3 = vec3; iVar3 < limbCount;
iVar3++, pvec1++, pvec2++, pvec3++) {
pvec1->x = pvec2->x + ((s16)(pvec3->x - pvec2->x) * unkf);
pvec1->y = pvec2->y + ((s16)(pvec3->y - pvec2->y) * unkf);
pvec1->z = pvec2->z + ((s16)(pvec3->z - pvec2->z) * unkf);
}
} else {
for (iVar3 = 0; iVar3 < limbCount; iVar3++) {
pvec1 = &vec1[iVar3];
pvec3 = &vec3[iVar3];
pvec1->x = pvec3->x;
pvec1->y = pvec3->y;
pvec1->z = pvec3->z;
}
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skelanime/func_800A2E70.s")
#endif
void func_800A32EC(u16* arg0) {
*arg0 = 0;
void SkelAnime_AnimationCtxReset(AnimationContext* animationCtx) {
animationCtx->animationCount = 0;
}
void func_800A32F4(s32 arg0) {
D_801600B0 *= 2;
void func_800A32F4(GlobalContext* globalCtx) {
D_801600B0 <<= 1;
}
void func_800A3310(void* arg0) {
void func_800A3310(GlobalContext* globalCtx) {
u32* D_8012A480Ptr = &D_8012A480;
*D_8012A480Ptr |= D_801600B0;
@ -954,7 +979,7 @@ void func_800A390C(GlobalContext* globalCtx, AnimationContext* animationCtx) {
AnimationEntry* entry;
for (entry = animationCtx->entries; animationCtx->animationCount != 0; entry++, animationCtx->animationCount--) {
D_8012A484[entry->type](globalCtx, &entry->types);
AnimationLoadDone[entry->type](globalCtx, &entry->types);
}
D_801600B0 = 1;