mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-03 00:36:35 -04:00
Animation system updated, some more boot files decompiled (+6%), z_fcurve_data_skelanime decompiled (1 non-matching), some asm files split, etc (#89)
* Progress on various files * gfxprint stuff * split some rodata, add iconv for rodata string parsing * z_std_dma rodata * 2 nonmatchings in gfxprint * mtxuty-cvt ok * more * match a function in idle.c * progress * Cleanup * Rename BgPolygon to CollisionPoly * progress * some effect stuff * more effect progress * updates * made suggested changes * z_effect_soft_sprite_old_init mostly ok * remove old effects enum * gamealloc.c OK * added more files * motor.c almost done * motor.c OK * updates * migration of two files * listalloc.c oK * z_fcurve_data_skelanime split * z_fcurve_data_skelanime.c decompiled * more files split * z_malloc.c OK * contpfs.c OK * fault.c rodata migrated * migrated fault_drawer rodata * update * update preprocess.py * renamed functions in z_skelanime * started z_skelanime cleanup * like halfway through fixing z_skelanime * animation system updated to meet oot standards * remove unused animation structs * rename matrix structs to fit oot * Add -woff 712 * fix diff_settings.py because i accidentally broke it before * fixed merge conflict, doesn't match though * It matches now * Updates * Fixed warnings...added gcc code syntax checking * Remove gcc check, added in Tharo's PR * warnings fixed (i think) * fixed all warnings i think * ok * not sure what to do * Fix all warnings i think (z_en_a_keep needs some file cleanup thouguh) * it matches if i do this * remove comment * accidentally put osPfsFreeBlocks in epilinkhandle.c * memcmp -> bcmp * change u32 size to size_t size, delete string.h because it caused unnecessary confusion with defining size_t twice * format.sh * MTXMODE_NEW and MTXMODE_APPLY to matrix functions * Made suggested changes * pragma sFaultDrawerFont instead of including in repo * add some functions to functions.h * Bss reordering fixed in z_collision_check...added hack to disasm.py * Updated z_en_a_keep.c * Missed suggestion in EnAObj_Destroy * . * update z_fcurve_Data_skelanime and z_skelanime with suggestions * devmgr.c ok * minor changes * Addressed comments * remove redundant file * gfxp -> dlist in game.c * updated actorfixer.py * fixed warnings in z_malloc * Change void* back to Actor* * format * Add the soft_sprit comments back * Rename SV->Flex * remove .common * run format * Update src/code/z_skelanime.c * u32 channel Co-authored-by: Lucas Shaw <lucas.shaw1123@gmail.com> Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
void osViExtendVStart(u32 a0) {
|
||||
__additional_scanline = a0;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) {
|
||||
return last;
|
||||
}
|
||||
|
||||
void __osMallocInit(Arena* arena, void* start, u32 size) {
|
||||
void __osMallocInit(Arena* arena, void* start, size_t size) {
|
||||
bzero(arena, sizeof(*arena));
|
||||
ArenaImpl_LockInit(arena);
|
||||
__osMallocAddBlock(arena, start, size);
|
||||
@@ -91,7 +91,7 @@ u8 __osMallocIsInitalized(Arena* arena) {
|
||||
return arena->isInit;
|
||||
}
|
||||
|
||||
void* __osMalloc(Arena* arena, u32 size) {
|
||||
void* __osMalloc(Arena* arena, size_t size) {
|
||||
ArenaNode* iter;
|
||||
ArenaNode* newNode;
|
||||
void* alloc;
|
||||
@@ -134,7 +134,7 @@ void* __osMalloc(Arena* arena, u32 size) {
|
||||
return alloc;
|
||||
}
|
||||
|
||||
void* __osMallocR(Arena* arena, u32 size) {
|
||||
void* __osMallocR(Arena* arena, size_t size) {
|
||||
ArenaNode* iter;
|
||||
ArenaNode* newNode;
|
||||
u32 blockSize;
|
||||
@@ -219,7 +219,7 @@ end:
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/__osMalloc/__osRealloc.s")
|
||||
|
||||
void __osAnalyzeArena(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
||||
void __osAnalyzeArena(Arena* arena, size_t* outMaxFree, size_t* outFree, size_t* outAlloc) {
|
||||
ArenaNode* iter;
|
||||
|
||||
ArenaImpl_Lock(arena);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
void* __osMemset(void* ptr, s32 val, u32 size) {
|
||||
void* __osMemset(void* ptr, s32 val, size_t size) {
|
||||
u8* dst = ptr;
|
||||
register s32 rem;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ void Load2_Relocate(u32 allocatedVRamAddr, OverlayRelocationSection* overlayInfo
|
||||
s32 Load2_LoadOverlay(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd, u32 allocatedVRamAddr) {
|
||||
int nbytes;
|
||||
u32 pad;
|
||||
u32 size;
|
||||
size_t size;
|
||||
void* end;
|
||||
OverlayRelocationSection* overlayInfo;
|
||||
|
||||
@@ -106,9 +106,9 @@ s32 Load2_LoadOverlay(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd, u3
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/loadfragment2/Load2_LoadOverlay.s")
|
||||
#endif
|
||||
|
||||
void* Load2_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd) {
|
||||
void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd) {
|
||||
void* allocatedVRamAddr;
|
||||
u32 size;
|
||||
size_t size;
|
||||
|
||||
size = vRamEnd - vRamStart;
|
||||
allocatedVRamAddr = SystemArena_MallocR(size);
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
Arena gSystemArena;
|
||||
|
||||
void* SystemArena_Malloc(u32 size) {
|
||||
void* SystemArena_Malloc(size_t size) {
|
||||
return __osMalloc(&gSystemArena, size);
|
||||
}
|
||||
|
||||
void* SystemArena_MallocR(u32 size) {
|
||||
void* SystemArena_MallocR(size_t size) {
|
||||
return __osMallocR(&gSystemArena, size);
|
||||
}
|
||||
|
||||
void* SystemArena_Realloc(void* oldPtr, u32 newSize) {
|
||||
void* SystemArena_Realloc(void* oldPtr, size_t newSize) {
|
||||
return __osRealloc(&gSystemArena, oldPtr, newSize);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ void SystemArena_Free(void* ptr) {
|
||||
__osFree(&gSystemArena, ptr);
|
||||
}
|
||||
|
||||
void* SystemArena_Calloc(u32 elements, u32 size) {
|
||||
void* SystemArena_Calloc(u32 elements, size_t size) {
|
||||
void* ptr;
|
||||
u32 totalSize = elements * size;
|
||||
size_t totalSize = elements * size;
|
||||
|
||||
ptr = __osMalloc(&gSystemArena, totalSize);
|
||||
if (ptr != NULL) {
|
||||
@@ -29,7 +29,7 @@ void* SystemArena_Calloc(u32 elements, u32 size) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void SystemArena_AnalyzeArena(u32* maxFreeBlock, u32* bytesFree, u32* bytesAllocated) {
|
||||
void SystemArena_AnalyzeArena(size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated) {
|
||||
__osAnalyzeArena(&gSystemArena, maxFreeBlock, bytesFree, bytesAllocated);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ u32 SystemArena_CheckArena(void) {
|
||||
return __osCheckArena(&gSystemArena);
|
||||
}
|
||||
|
||||
void SystemArena_InitArena(void* start, u32 size) {
|
||||
void SystemArena_InitArena(void* start, size_t size) {
|
||||
__osMallocInit(&gSystemArena, start, size);
|
||||
}
|
||||
|
||||
|
||||
+37
-12
@@ -1,7 +1,32 @@
|
||||
#include "ultra64.h"
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault/D_800982B0.s")
|
||||
// data
|
||||
const char* sCpuExceptions[] = {
|
||||
"Interrupt",
|
||||
"TLB modification",
|
||||
"TLB exception on load",
|
||||
"TLB exception on store",
|
||||
"Address error on load",
|
||||
"Address error on store",
|
||||
"Bus error on inst.",
|
||||
"Bus error on data",
|
||||
"System call exception",
|
||||
"Breakpoint exception",
|
||||
"Reserved instruction",
|
||||
"Coprocessor unusable",
|
||||
"Arithmetic overflow",
|
||||
"Trap exception",
|
||||
"Virtual coherency on inst.",
|
||||
"Floating point exception",
|
||||
"Watchpoint exception",
|
||||
"Virtual coherency on data",
|
||||
};
|
||||
|
||||
const char* sFpuExceptions[] = {
|
||||
"Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", "Inexact operation",
|
||||
};
|
||||
|
||||
void Fault_SleepImpl(u32 duration) {
|
||||
u64 value = (duration * OS_CPU_COUNTER) / 1000ull;
|
||||
@@ -79,7 +104,7 @@ void Fault_RemoveClient(FaultClient* client) {
|
||||
}
|
||||
}
|
||||
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, fault_address_converter_func callback, void* param) {
|
||||
void Fault_AddAddrConvClient(FaultAddrConvClient* client, FaultAddrConvFunc callback, void* param) {
|
||||
OSIntMask mask;
|
||||
u32 alreadyExists = 0;
|
||||
|
||||
@@ -269,9 +294,9 @@ void Fault_PrintFPCR(u32 value) {
|
||||
u32 flag = 0x20000;
|
||||
|
||||
FaultDrawer_Printf("FPCSR:%08xH ", value);
|
||||
for (i = 0; i < ARRAY_COUNT(sExceptionNames); i++) {
|
||||
for (i = 0; i < ARRAY_COUNT(sFpuExceptions); i++) {
|
||||
if (value & flag) {
|
||||
FaultDrawer_Printf("(%s)", sExceptionNames[i]);
|
||||
FaultDrawer_Printf("(%s)", sFpuExceptions[i]);
|
||||
break;
|
||||
}
|
||||
flag >>= 1;
|
||||
@@ -284,9 +309,9 @@ void osSyncPrintfFPCR(u32 value) {
|
||||
u32 flag = 0x20000;
|
||||
|
||||
osSyncPrintf("FPCSR:%08xH ", value);
|
||||
for (i = 0; i < ARRAY_COUNT(sExceptionNames); i++) {
|
||||
for (i = 0; i < ARRAY_COUNT(sFpuExceptions); i++) {
|
||||
if (value & flag) {
|
||||
osSyncPrintf("(%s)\n", sExceptionNames[i]);
|
||||
osSyncPrintf("(%s)\n", sFpuExceptions[i]);
|
||||
break;
|
||||
}
|
||||
flag >>= 1;
|
||||
@@ -308,7 +333,7 @@ void Fault_PrintThreadContext(OSThread* t) {
|
||||
FaultDrawer_SetCursor(0x16, 0x14);
|
||||
|
||||
ctx = &t->context;
|
||||
FaultDrawer_Printf("THREAD:%d (%d:%s)\n", t->id, causeStrIdx, D_80096B80[causeStrIdx]);
|
||||
FaultDrawer_Printf("THREAD:%d (%d:%s)\n", t->id, causeStrIdx, sCpuExceptions[causeStrIdx]);
|
||||
FaultDrawer_SetCharPad(-1, 0);
|
||||
|
||||
FaultDrawer_Printf("PC:%08xH SR:%08xH VA:%08xH\n", (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr);
|
||||
@@ -368,7 +393,7 @@ void osSyncPrintfThreadContext(OSThread* t) {
|
||||
|
||||
ctx = &t->context;
|
||||
osSyncPrintf("\n");
|
||||
osSyncPrintf("THREAD ID:%d (%d:%s)\n", t->id, causeStrIdx, D_80096B80[causeStrIdx]);
|
||||
osSyncPrintf("THREAD ID:%d (%d:%s)\n", t->id, causeStrIdx, sCpuExceptions[causeStrIdx]);
|
||||
|
||||
osSyncPrintf("PC:%08xH SR:%08xH VA:%08xH\n", (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr);
|
||||
osSyncPrintf("AT:%08xH V0:%08xH V1:%08xH\n", (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1);
|
||||
@@ -444,7 +469,7 @@ void Fault_WaitForButtonCombo(void) {
|
||||
} while (!CHECK_BTN_ALL(input->cur.button, BTN_DLEFT | BTN_L | BTN_R | BTN_CRIGHT));
|
||||
}
|
||||
|
||||
void Fault_DrawMemDumpPage(char* title, u32* addr, u32 param_3) {
|
||||
void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
|
||||
u32* alignedAddr;
|
||||
u32* writeAddr;
|
||||
s32 y;
|
||||
@@ -741,9 +766,9 @@ void Fault_SetOptionsFromController3(void) {
|
||||
}
|
||||
|
||||
if (faultCustomOptions) {
|
||||
graphPC = graphOSThread.context.pc;
|
||||
graphRA = graphOSThread.context.ra;
|
||||
graphSP = graphOSThread.context.sp;
|
||||
graphPC = sGraphThread.context.pc;
|
||||
graphRA = sGraphThread.context.ra;
|
||||
graphSP = sGraphThread.context.sp;
|
||||
if (CHECK_BTN_ALL(input3->press.button, BTN_R)) {
|
||||
faultCopyToLog = !faultCopyToLog;
|
||||
FaultDrawer_SetOsSyncPrintfEnabled(faultCopyToLog);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
extern const u32 sFaultDrawerFont[];
|
||||
|
||||
FaultDrawer* sFaultDrawContext = &sFaultDrawerStruct;
|
||||
FaultDrawer sFaultDrawerDefault = {
|
||||
(u16*)0x803DA800, // fb - TODO map out buffers in this region and avoid hard-coded pointer
|
||||
@@ -14,7 +16,7 @@ FaultDrawer sFaultDrawerDefault = {
|
||||
GPACK_RGBA5551(0, 0, 0, 0), // backColor
|
||||
22, // cursorX
|
||||
16, // cursorY
|
||||
(u32*)&sFaultDrawerFont, // font
|
||||
(u32*)sFaultDrawerFont, // font
|
||||
8, // charW
|
||||
8, // charH
|
||||
0, // charWPad
|
||||
@@ -142,7 +144,7 @@ void FaultDrawer_FillScreen() {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/FaultDrawer_FormatStringFunc.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/D_80099080.s")
|
||||
const char D_80099080[] = "(null)";
|
||||
|
||||
void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
|
||||
_Printf((PrintCallback)FaultDrawer_FormatStringFunc, sFaultDrawContext, str, args);
|
||||
|
||||
@@ -122,7 +122,7 @@ s32 Yaz0_DecompressImpl(u8* src, u8* dst) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Yaz0_Decompress(u32 romStart, void* dst, u32 size) {
|
||||
void Yaz0_Decompress(u32 romStart, void* dst, size_t size) {
|
||||
s32 status;
|
||||
u32 pad;
|
||||
char sp80[0x50];
|
||||
|
||||
@@ -9,7 +9,7 @@ OSMesg sDmaMgrMsgs[32];
|
||||
OSThread sDmaMgrThread;
|
||||
u8 sDmaMgrStack[0x500];
|
||||
|
||||
s32 DmaMgr_DMARomToRam(u32 rom, void* ram, u32 size) {
|
||||
s32 DmaMgr_DMARomToRam(u32 rom, void* ram, size_t size) {
|
||||
OSIoMesg ioMsg;
|
||||
OSMesgQueue queue;
|
||||
OSMesg msg[1];
|
||||
@@ -111,7 +111,7 @@ const char* func_800809F4(u32 a0) {
|
||||
void DmaMgr_ProcessMsg(DmaRequest* req) {
|
||||
u32 vrom;
|
||||
void* ram;
|
||||
u32 size;
|
||||
size_t size;
|
||||
u32 romStart;
|
||||
u32 romSize;
|
||||
DmaEntry* dmaEntry;
|
||||
@@ -172,7 +172,7 @@ void DmaMgr_ThreadEntry(void* a0) {
|
||||
}
|
||||
}
|
||||
|
||||
s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, u32 vromStart, u32 size, UNK_TYPE4 unused,
|
||||
s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, u32 vromStart, size_t size, UNK_TYPE4 unused,
|
||||
OSMesgQueue* queue, OSMesg msg) {
|
||||
if (gIrqMgrResetStatus >= 2) {
|
||||
return -2;
|
||||
@@ -190,7 +190,7 @@ s32 DmaMgr_SendRequestImpl(DmaRequest* request, void* vramStart, u32 vromStart,
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 DmaMgr_SendRequest0(void* vramStart, u32 vromStart, u32 size) {
|
||||
s32 DmaMgr_SendRequest0(void* vramStart, u32 vromStart, size_t size) {
|
||||
DmaRequest req;
|
||||
OSMesgQueue queue;
|
||||
OSMesg msg[1];
|
||||
|
||||
@@ -17,7 +17,7 @@ void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf,
|
||||
|
||||
void PreRender_Init(PreRender* this) {
|
||||
bzero(this, sizeof(PreRender));
|
||||
func_80174AA0(&this->alloc);
|
||||
ListAlloc_Init(&this->alloc);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, voi
|
||||
}
|
||||
|
||||
void PreRender_Destroy(PreRender* this) {
|
||||
func_80174BA0(&this->alloc);
|
||||
ListAlloc_FreeAll(&this->alloc);
|
||||
}
|
||||
|
||||
void func_8016FDB8(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, u32 arg4) {
|
||||
|
||||
@@ -12,7 +12,7 @@ void* THA_GetTail(TwoHeadArena* tha) {
|
||||
return tha->tail;
|
||||
}
|
||||
|
||||
void* THA_AllocStart(TwoHeadArena* tha, u32 size) {
|
||||
void* THA_AllocStart(TwoHeadArena* tha, size_t size) {
|
||||
void* start = tha->head;
|
||||
|
||||
tha->head = (u32)tha->head + size;
|
||||
@@ -23,7 +23,7 @@ void* THA_AllocStart1(TwoHeadArena* tha) {
|
||||
return THA_AllocStart(tha, 1);
|
||||
}
|
||||
|
||||
void* THA_AllocEnd(TwoHeadArena* tha, u32 size) {
|
||||
void* THA_AllocEnd(TwoHeadArena* tha, size_t size) {
|
||||
u32 mask;
|
||||
|
||||
if (size >= 0x10) {
|
||||
@@ -42,14 +42,14 @@ void* THA_AllocEnd(TwoHeadArena* tha, u32 size) {
|
||||
return tha->tail;
|
||||
}
|
||||
|
||||
void* THA_AllocEndAlign16(TwoHeadArena* tha, u32 size) {
|
||||
void* THA_AllocEndAlign16(TwoHeadArena* tha, size_t size) {
|
||||
u32 mask = ~0xF;
|
||||
|
||||
tha->tail = (((u32)tha->tail & mask) - size) & mask;
|
||||
return tha->tail;
|
||||
}
|
||||
|
||||
void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask) {
|
||||
void* THA_AllocEndAlign(TwoHeadArena* tha, size_t size, u32 mask) {
|
||||
tha->tail = (((u32)tha->tail & mask) - size) & mask;
|
||||
return tha->tail;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ void THA_Init(TwoHeadArena* tha) {
|
||||
tha->tail = (u32)tha->bufp + tha->size;
|
||||
}
|
||||
|
||||
void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size) {
|
||||
void THA_Ct(TwoHeadArena* tha, void* ptr, size_t size) {
|
||||
bzero(tha, sizeof(TwoHeadArena));
|
||||
tha->bufp = ptr;
|
||||
tha->size = size;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) {
|
||||
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, size_t size) {
|
||||
THA_Ct((TwoHeadArena*)thga, start, size);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga) {
|
||||
return THGA_AllocStart8(thga);
|
||||
}
|
||||
|
||||
Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size) {
|
||||
Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, size_t size) {
|
||||
return THA_AllocEnd((TwoHeadArena*)thga, size);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800F23E0/func_800F23E0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800F23E0/func_800F2478.s")
|
||||
@@ -1,5 +0,0 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80122660/func_80122660.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80122660/func_80122670.s")
|
||||
+91
-90
@@ -22,7 +22,7 @@ void Game_SetFramerateDivisor(GameState* gameState, s32 divisor) {
|
||||
}
|
||||
|
||||
void GameState_SetFBFilter(Gfx** gfx, u32 arg1) {
|
||||
Gfx* _gfx = *gfx;
|
||||
Gfx* dlist = *gfx;
|
||||
|
||||
if ((R_FB_FILTER_TYPE > 0) && (R_FB_FILTER_TYPE < 5)) {
|
||||
D_801F8010.type = R_FB_FILTER_TYPE;
|
||||
@@ -30,7 +30,7 @@ void GameState_SetFBFilter(Gfx** gfx, u32 arg1) {
|
||||
D_801F8010.color.g = R_FB_FILTER_PRIM_COLOR(1);
|
||||
D_801F8010.color.b = R_FB_FILTER_PRIM_COLOR(2);
|
||||
D_801F8010.color.a = R_FB_FILTER_A;
|
||||
func_80140D10(&D_801F8010, &_gfx, arg1);
|
||||
func_80140D10(&D_801F8010, &dlist, arg1);
|
||||
} else {
|
||||
if ((R_FB_FILTER_TYPE == 5) || (R_FB_FILTER_TYPE == 6)) {
|
||||
D_801F8020.useRgba = (R_FB_FILTER_TYPE == 6);
|
||||
@@ -42,7 +42,7 @@ void GameState_SetFBFilter(Gfx** gfx, u32 arg1) {
|
||||
D_801F8020.envColor.g = R_FB_FILTER_ENV_COLOR(1);
|
||||
D_801F8020.envColor.b = R_FB_FILTER_ENV_COLOR(2);
|
||||
D_801F8020.envColor.a = R_FB_FILTER_A;
|
||||
func_80142100(&D_801F8020, &_gfx, arg1);
|
||||
func_80142100(&D_801F8020, &dlist, arg1);
|
||||
} else {
|
||||
if (R_FB_FILTER_TYPE == 7) {
|
||||
sMonoColors.unk_00 = 0;
|
||||
@@ -54,27 +54,24 @@ void GameState_SetFBFilter(Gfx** gfx, u32 arg1) {
|
||||
sMonoColors.envColor.g = R_FB_FILTER_ENV_COLOR(1);
|
||||
sMonoColors.envColor.b = R_FB_FILTER_ENV_COLOR(2);
|
||||
sMonoColors.envColor.a = R_FB_FILTER_A;
|
||||
VisMono_Draw(&sMonoColors, &_gfx, arg1);
|
||||
VisMono_Draw(&sMonoColors, &dlist, arg1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*gfx = _gfx;
|
||||
*gfx = dlist;
|
||||
}
|
||||
|
||||
void Game_Nop80173534(GameState* gamestate) {
|
||||
;
|
||||
void Game_Nop80173534(GameState* gameState) {
|
||||
}
|
||||
|
||||
void GameState_Draw(GameState* gamestate, GraphicsContext* gfxCtx) {
|
||||
void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
|
||||
Gfx* nextDisplayList;
|
||||
Gfx* polyOpa;
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
polyOpa = POLY_OPA_DISP;
|
||||
nextDisplayList = Graph_GfxPlusOne(POLY_OPA_DISP);
|
||||
|
||||
nextDisplayList = Graph_GfxPlusOne(polyOpa = POLY_OPA_DISP);
|
||||
gSPDisplayList(OVERLAY_DISP++, nextDisplayList);
|
||||
|
||||
if (R_FB_FILTER_TYPE && R_FB_FILTER_ENV_COLOR(3) == 0) {
|
||||
@@ -98,119 +95,123 @@ void GameState_Draw(GameState* gamestate, GraphicsContext* gfxCtx) {
|
||||
|
||||
if (R_ENABLE_ARENA_DBG != 0) {
|
||||
SpeedMeter_DrawTimeEntries(&D_801F7FF0, gfxCtx);
|
||||
SpeedMeter_DrawAllocEntries(&D_801F7FF0, gfxCtx, gamestate);
|
||||
SpeedMeter_DrawAllocEntries(&D_801F7FF0, gfxCtx, gameState);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
void Game_ResetSegments(GraphicsContext* gfxCtx) {
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0, 0);
|
||||
gSPSegment(gfxCtx->polyOpa.p++, 0xF, gfxCtx->framebuffer);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0, 0);
|
||||
gSPSegment(gfxCtx->polyXlu.p++, 0xF, gfxCtx->framebuffer);
|
||||
gSPSegment(gfxCtx->overlay.p++, 0, 0);
|
||||
gSPSegment(gfxCtx->overlay.p++, 0xF, gfxCtx->framebuffer);
|
||||
void GameState_SetFrameBuffer(GraphicsContext* gfxCtx) {
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0, NULL);
|
||||
gSPSegment(POLY_OPA_DISP++, 0xF, gfxCtx->framebuffer);
|
||||
gSPSegment(POLY_XLU_DISP++, 0, NULL);
|
||||
gSPSegment(POLY_XLU_DISP++, 0xF, gfxCtx->framebuffer);
|
||||
gSPSegment(OVERLAY_DISP++, 0, NULL);
|
||||
gSPSegment(OVERLAY_DISP++, 0xF, gfxCtx->framebuffer);
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
void func_801736DC(GraphicsContext* gfxCtx) {
|
||||
Gfx* nextDisplayList;
|
||||
Gfx* _polyOpa;
|
||||
Gfx* polyOpa;
|
||||
|
||||
nextDisplayList = Graph_GfxPlusOne(_polyOpa = gfxCtx->polyOpa.p);
|
||||
gSPDisplayList(gfxCtx->overlay.p++, nextDisplayList);
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
nextDisplayList = Graph_GfxPlusOne(polyOpa = gfxCtx->polyOpa.p);
|
||||
gSPDisplayList(OVERLAY_DISP++, nextDisplayList);
|
||||
gSPEndDisplayList(nextDisplayList++);
|
||||
Graph_BranchDlist(_polyOpa, nextDisplayList);
|
||||
Graph_BranchDlist(polyOpa, nextDisplayList);
|
||||
|
||||
gfxCtx->polyOpa.p = nextDisplayList;
|
||||
POLY_OPA_DISP = nextDisplayList;
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
void Game_UpdateInput(GameState* gamestate) {
|
||||
Padmgr_GetInput(gamestate->input, 1);
|
||||
void Game_UpdateInput(GameState* gameState) {
|
||||
Padmgr_GetInput(gameState->input, 1);
|
||||
}
|
||||
|
||||
void Game_Update(GameState* gamestate) {
|
||||
GraphicsContext* _gCtx;
|
||||
_gCtx = gamestate->gfxCtx;
|
||||
void Game_Update(GameState* gameState) {
|
||||
GraphicsContext* gfxCtx = gameState->gfxCtx;
|
||||
|
||||
Game_ResetSegments(gamestate->gfxCtx);
|
||||
GameState_SetFrameBuffer(gameState->gfxCtx);
|
||||
|
||||
gamestate->main(gamestate);
|
||||
gameState->main(gameState);
|
||||
|
||||
if (R_PAUSE_MENU_MODE != 2) {
|
||||
GameState_Draw(gamestate, _gCtx);
|
||||
func_801736DC(_gCtx);
|
||||
GameState_Draw(gameState, gfxCtx);
|
||||
func_801736DC(gfxCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void Game_IncrementFrameCount(GameState* gamestate) {
|
||||
Game_Nop80173534(gamestate);
|
||||
gamestate->frames++;
|
||||
void Game_IncrementFrameCount(GameState* gameState) {
|
||||
Game_Nop80173534(gameState);
|
||||
gameState->frames++;
|
||||
}
|
||||
|
||||
void Game_InitHeap(GameState* gamestate, u32 size) {
|
||||
GameState* _ctx;
|
||||
void* buf;
|
||||
|
||||
_ctx = gamestate;
|
||||
buf = Gamealloc_Alloc(&_ctx->alloc, size);
|
||||
void GameState_InitArena(GameState* gameState, size_t size) {
|
||||
GameAlloc* alloc = &gameState->alloc;
|
||||
void* buf = GameAlloc_Malloc(alloc, size);
|
||||
|
||||
if (buf) {
|
||||
THA_Ct(&gamestate->heap, buf, size);
|
||||
THA_Ct(&gameState->heap, buf, size);
|
||||
return;
|
||||
}
|
||||
|
||||
THA_Ct(&gamestate->heap, NULL, 0);
|
||||
__assert("../game.c", 0x40B);
|
||||
THA_Ct(&gameState->heap, NULL, 0);
|
||||
__assert("../game.c", 1035);
|
||||
}
|
||||
|
||||
void Game_ResizeHeap(GameState* gamestate, u32 size) {
|
||||
void GameState_Realloc(GameState* gameState, size_t size) {
|
||||
GameAlloc* alloc;
|
||||
void* buf;
|
||||
u32 systemMaxFree;
|
||||
u32 bytesFree;
|
||||
u32 bytesAllocated;
|
||||
void* gameArena;
|
||||
size_t systemMaxFree;
|
||||
size_t bytesFree;
|
||||
size_t bytesAllocated;
|
||||
void* heapStart;
|
||||
|
||||
heapStart = gamestate->heap.bufp;
|
||||
alloc = &gamestate->alloc;
|
||||
THA_Dt(&gamestate->heap);
|
||||
Gamealloc_Free(alloc, heapStart);
|
||||
heapStart = gameState->heap.bufp;
|
||||
alloc = &gameState->alloc;
|
||||
THA_Dt(&gameState->heap);
|
||||
GameAlloc_Free(alloc, heapStart);
|
||||
SystemArena_AnalyzeArena(&systemMaxFree, &bytesFree, &bytesAllocated);
|
||||
size = ((systemMaxFree - (sizeof(ArenaNode))) < size) ? (0) : (size);
|
||||
if (!size) {
|
||||
if (size == 0) {
|
||||
size = systemMaxFree - (sizeof(ArenaNode));
|
||||
}
|
||||
|
||||
if ((buf = Gamealloc_Alloc(alloc, size)) != NULL) {
|
||||
THA_Ct(&gamestate->heap, buf, size);
|
||||
if ((gameArena = GameAlloc_Malloc(alloc, size)) != NULL) {
|
||||
THA_Ct(&gameState->heap, gameArena, size);
|
||||
} else {
|
||||
THA_Ct(&gamestate->heap, 0, 0);
|
||||
__assert("../game.c", 0x432);
|
||||
THA_Ct(&gameState->heap, 0, 0);
|
||||
__assert("../game.c", 1074);
|
||||
}
|
||||
}
|
||||
|
||||
void Game_StateInit(GameState* gamestate, GameStateFunc gameStateInit, GraphicsContext* gfxCtx) {
|
||||
gamestate->gfxCtx = gfxCtx;
|
||||
gamestate->frames = 0U;
|
||||
gamestate->main = NULL;
|
||||
gamestate->destroy = NULL;
|
||||
gamestate->running = 1;
|
||||
gfxCtx->unk274 = D_801FBB88;
|
||||
void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* gfxCtx) {
|
||||
gameState->gfxCtx = gfxCtx;
|
||||
gameState->frames = 0U;
|
||||
gameState->main = NULL;
|
||||
gameState->destroy = NULL;
|
||||
gameState->running = 1;
|
||||
gfxCtx->viMode = D_801FBB88;
|
||||
gfxCtx->viConfigFeatures = gViConfigFeatures;
|
||||
gfxCtx->viConfigXScale = gViConfigXScale;
|
||||
gfxCtx->viConfigYScale = gViConfigYScale;
|
||||
gamestate->nextGameStateInit = NULL;
|
||||
gamestate->nextGameStateSize = 0U;
|
||||
gameState->nextGameStateInit = NULL;
|
||||
gameState->nextGameStateSize = 0U;
|
||||
|
||||
{
|
||||
s32 requiredScopeTemp;
|
||||
|
||||
Gamealloc_Init(&gamestate->alloc);
|
||||
Game_InitHeap(gamestate, 0x100000);
|
||||
Game_SetFramerateDivisor(gamestate, 3);
|
||||
GameAlloc_Init(&gameState->alloc);
|
||||
GameState_InitArena(gameState, 0x100000);
|
||||
Game_SetFramerateDivisor(gameState, 3);
|
||||
|
||||
gameStateInit(gamestate);
|
||||
init(gameState);
|
||||
|
||||
func_80140CE0(&D_801F8010);
|
||||
func_801420C0(&D_801F8020);
|
||||
@@ -219,17 +220,17 @@ void Game_StateInit(GameState* gamestate, GameStateFunc gameStateInit, GraphicsC
|
||||
func_801773A0(&D_801F7FF0);
|
||||
func_8013ED9C();
|
||||
|
||||
osSendMesg(&gamestate->gfxCtx->unk5C, NULL, 1);
|
||||
osSendMesg(&gameState->gfxCtx->unk5C, NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void Game_StateFini(GameState* gamestate) {
|
||||
void GameState_Destroy(GameState* gameState) {
|
||||
func_80172BC0();
|
||||
func_8019E014();
|
||||
osRecvMesg(&gamestate->gfxCtx->unk5C, 0, 1);
|
||||
osRecvMesg(&gameState->gfxCtx->unk5C, NULL, OS_MESG_BLOCK);
|
||||
|
||||
if (gamestate->destroy != 0) {
|
||||
gamestate->destroy(gamestate);
|
||||
if (gameState->destroy != NULL) {
|
||||
gameState->destroy(gameState);
|
||||
}
|
||||
|
||||
func_8013EDD0();
|
||||
@@ -238,28 +239,28 @@ void Game_StateFini(GameState* gamestate) {
|
||||
func_801420F4(&D_801F8020);
|
||||
func_80141900(&sMonoColors);
|
||||
func_80140900(&D_801F8048);
|
||||
THA_Dt(&gamestate->heap);
|
||||
Gamealloc_FreeAll(&gamestate->alloc);
|
||||
THA_Dt(&gameState->heap);
|
||||
GameAlloc_Cleanup(&gameState->alloc);
|
||||
}
|
||||
|
||||
GameStateFunc Game_GetNextStateInit(GameState* gamestate) {
|
||||
return gamestate->nextGameStateInit;
|
||||
GameStateFunc GameState_GetNextStateInit(GameState* gameState) {
|
||||
return gameState->nextGameStateInit;
|
||||
}
|
||||
|
||||
u32 Game_GetNextStateSize(GameState* gamestate) {
|
||||
return gamestate->nextGameStateSize;
|
||||
size_t Game_GetNextStateSize(GameState* gameState) {
|
||||
return gameState->nextGameStateSize;
|
||||
}
|
||||
|
||||
u32 Game_GetShouldContinue(GameState* gamestate) {
|
||||
return gamestate->running;
|
||||
u32 GameState_IsRunning(GameState* gameState) {
|
||||
return gameState->running;
|
||||
}
|
||||
|
||||
s32 Game_GetHeapFreeSize(GameState* gamestate) {
|
||||
return THA_GetSize(&gamestate->heap);
|
||||
s32 GameState_GetArenaSize(GameState* gameState) {
|
||||
return THA_GetSize(&gameState->heap);
|
||||
}
|
||||
|
||||
s32 func_80173B48(GameState* gamestate) {
|
||||
s32 result;
|
||||
result = OS_CYCLES_TO_NSEC(gamestate->framerateDivisor * sIrqMgrRetraceTime) - OS_CYCLES_TO_NSEC(D_801FBAF0);
|
||||
s32 func_80173B48(GameState* gameState) {
|
||||
s32 result = OS_CYCLES_TO_NSEC(gameState->framerateDivisor * sIrqMgrRetraceTime) - OS_CYCLES_TO_NSEC(D_801FBAF0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+53
-5
@@ -1,11 +1,59 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gamealloc/func_80173BF0.s")
|
||||
void GameAlloc_Log(GameAlloc* this) {
|
||||
GameAllocEntry* iter;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gamealloc/Gamealloc_Alloc.s")
|
||||
iter = this->base.next;
|
||||
while (iter != &this->base) {
|
||||
iter = iter->next;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gamealloc/Gamealloc_Free.s")
|
||||
void* GameAlloc_Malloc(GameAlloc* this, size_t size) {
|
||||
GameAllocEntry* ptr = SystemArena_Malloc(size + sizeof(GameAllocEntry));
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gamealloc/Gamealloc_FreeAll.s")
|
||||
if (ptr != NULL) {
|
||||
ptr->size = size;
|
||||
ptr->prev = this->head;
|
||||
this->head->next = ptr;
|
||||
this->head = ptr;
|
||||
ptr->next = &this->base;
|
||||
this->base.prev = this->head;
|
||||
return ptr + 1;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/gamealloc/Gamealloc_Init.s")
|
||||
void GameAlloc_Free(GameAlloc* this, void* data) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
if (data != NULL) {
|
||||
ptr = &((GameAllocEntry*)data)[-1];
|
||||
ptr->prev->next = ptr->next;
|
||||
ptr->next->prev = ptr->prev;
|
||||
this->head = this->base.prev;
|
||||
SystemArena_Free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void GameAlloc_Cleanup(GameAlloc* this) {
|
||||
GameAllocEntry* next = this->base.next;
|
||||
GameAllocEntry* cur;
|
||||
|
||||
while (&this->base != next) {
|
||||
cur = next;
|
||||
next = next->next;
|
||||
SystemArena_Free(cur);
|
||||
}
|
||||
|
||||
this->head = &this->base;
|
||||
this->base.next = &this->base;
|
||||
this->base.prev = &this->base;
|
||||
}
|
||||
|
||||
void GameAlloc_Init(GameAlloc* this) {
|
||||
this->head = &this->base;
|
||||
this->base.next = &this->base;
|
||||
this->base.prev = &this->base;
|
||||
}
|
||||
|
||||
+57
-4
@@ -1,9 +1,62 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/listalloc/func_80174AA0.s")
|
||||
ListAlloc* ListAlloc_Init(ListAlloc* this) {
|
||||
this->prev = NULL;
|
||||
this->next = NULL;
|
||||
return this;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/listalloc/func_80174AB4.s")
|
||||
void* ListAlloc_Alloc(ListAlloc* this, size_t size) {
|
||||
ListAlloc* ptr = SystemArena_Malloc(size + sizeof(ListAlloc));
|
||||
ListAlloc* next;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/listalloc/func_80174B20.s")
|
||||
if (ptr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/listalloc/func_80174BA0.s")
|
||||
next = this->next;
|
||||
if (next != NULL) {
|
||||
next->next = ptr;
|
||||
}
|
||||
|
||||
ptr->prev = next;
|
||||
ptr->next = NULL;
|
||||
this->next = ptr;
|
||||
|
||||
if (this->prev == NULL) {
|
||||
this->prev = ptr;
|
||||
}
|
||||
|
||||
return (u8*)ptr + sizeof(ListAlloc);
|
||||
}
|
||||
|
||||
void ListAlloc_Free(ListAlloc* this, void* data) {
|
||||
ListAlloc* ptr = &((ListAlloc*)data)[-1];
|
||||
|
||||
if (ptr->prev != NULL) {
|
||||
ptr->prev->next = ptr->next;
|
||||
}
|
||||
|
||||
if (ptr->next != NULL) {
|
||||
ptr->next->prev = ptr->prev;
|
||||
}
|
||||
|
||||
if (this->prev == ptr) {
|
||||
this->prev = ptr->next;
|
||||
}
|
||||
|
||||
if (this->next == ptr) {
|
||||
this->next = ptr->prev;
|
||||
}
|
||||
|
||||
SystemArena_Free(ptr);
|
||||
}
|
||||
|
||||
void ListAlloc_FreeAll(ListAlloc* this) {
|
||||
ListAlloc* iter = this->prev;
|
||||
|
||||
while (iter != NULL) {
|
||||
ListAlloc_Free(this, (u8*)iter + sizeof(ListAlloc));
|
||||
iter = this->prev;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -28,36 +28,36 @@ void Main(void* arg) {
|
||||
|
||||
R_ENABLE_ARENA_DBG = 0;
|
||||
|
||||
osCreateMesgQueue(&siEventCallbackQueue, siEventCallbackBuffer, ARRAY_COUNT(siEventCallbackBuffer));
|
||||
osSetEventMesg(OS_EVENT_SI, &siEventCallbackQueue, NULL);
|
||||
osCreateMesgQueue(&sSiIntMsgQ, sSiIntMsgBuf, ARRAY_COUNT(sSiIntMsgBuf));
|
||||
osSetEventMesg(OS_EVENT_SI, &sSiIntMsgQ, NULL);
|
||||
|
||||
osCreateMesgQueue(&mainIrqmgrCallbackQueue, mainIrqCallbackBuffer, ARRAY_COUNT(mainIrqCallbackBuffer));
|
||||
osCreateMesgQueue(&irqMgrMsgQ, irqMgrMsgBuf, ARRAY_COUNT(irqMgrMsgBuf));
|
||||
|
||||
StackCheck_Init(&schedStackEntry, schedStack, schedStack + sizeof(schedStack), 0, 0x100, "sched");
|
||||
Sched_Init(&gSchedContext, schedStack + sizeof(schedStack), Z_PRIORITY_SCHED, D_8009B290, 1, &gIrqMgr);
|
||||
|
||||
CIC6105_AddRomInfoFaultPage();
|
||||
|
||||
IrqMgr_AddClient(&gIrqMgr, &mainIrqmgrCallbackNode, &mainIrqmgrCallbackQueue);
|
||||
IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQ);
|
||||
|
||||
StackCheck_Init(&audioStackEntry, audioStack, audioStack + sizeof(audioStack), 0, 0x100, "audio");
|
||||
AudioMgr_Init(&audioContext, audioStack + sizeof(audioStack), Z_PRIORITY_AUDIOMGR, 0xA, &gSchedContext, &gIrqMgr);
|
||||
|
||||
StackCheck_Init(&padmgrStackEntry, padmgrStack, padmgrStack + sizeof(padmgrStack), 0, 0x100, "padmgr");
|
||||
Padmgr_Start(&siEventCallbackQueue, &gIrqMgr, 7, Z_PRIORITY_PADMGR, padmgrStack + sizeof(padmgrStack));
|
||||
PadMgr_Init(&sSiIntMsgQ, &gIrqMgr, 7, Z_PRIORITY_PADMGR, padmgrStack + sizeof(padmgrStack));
|
||||
|
||||
AudioMgr_Unlock(&audioContext);
|
||||
|
||||
StackCheck_Init(&graphStackEntry, graphStack, graphStack + sizeof(graphStack), 0, 0x100, "graph");
|
||||
osCreateThread(&graphOSThread, Z_THREAD_ID_GRAPH, Graph_ThreadEntry, arg, graphStack + sizeof(graphStack),
|
||||
StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph");
|
||||
osCreateThread(&sGraphThread, Z_THREAD_ID_GRAPH, Graph_ThreadEntry, arg, sGraphStack + sizeof(sGraphStack),
|
||||
Z_PRIORITY_GRAPH);
|
||||
osStartThread(&graphOSThread);
|
||||
osStartThread(&sGraphThread);
|
||||
|
||||
exit = false;
|
||||
|
||||
while (!exit) {
|
||||
msg = NULL;
|
||||
osRecvMesg(&mainIrqmgrCallbackQueue, (OSMesg)&msg, OS_MESG_BLOCK);
|
||||
osRecvMesg(&irqMgrMsgQ, (OSMesg)&msg, OS_MESG_BLOCK);
|
||||
if (msg == NULL) {
|
||||
break;
|
||||
}
|
||||
@@ -72,6 +72,6 @@ void Main(void* arg) {
|
||||
}
|
||||
}
|
||||
|
||||
IrqMgr_RemoveClient(&gIrqMgr, &mainIrqmgrCallbackNode);
|
||||
osDestroyThread(&graphOSThread);
|
||||
IrqMgr_RemoveClient(&gIrqMgr, &irqClient);
|
||||
osDestroyThread(&sGraphThread);
|
||||
}
|
||||
|
||||
+1
-1
@@ -54,4 +54,4 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/Padmgr_ThreadEntry.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/Padmgr_Start.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/PadMgr_Init.s")
|
||||
|
||||
+34
-34
@@ -1,92 +1,92 @@
|
||||
#include "global.h"
|
||||
|
||||
void SysMatrix_StateAlloc(GameState* gamestate) {
|
||||
sMatrixStack = (MtxF*)THA_AllocEndAlign16(&gamestate->heap, 0x500);
|
||||
void Matrix_StateAlloc(GameState* gameState) {
|
||||
sMatrixStack = (MtxF*)THA_AllocEndAlign16(&gameState->heap, 0x500);
|
||||
sCurrentMatrix = sMatrixStack;
|
||||
}
|
||||
|
||||
void SysMatrix_StatePush(void) {
|
||||
void Matrix_StatePush(void) {
|
||||
MtxF* prev = sCurrentMatrix;
|
||||
|
||||
sCurrentMatrix++;
|
||||
Matrix_MtxFCopy(sCurrentMatrix, prev);
|
||||
}
|
||||
|
||||
void SysMatrix_StatePop(void) {
|
||||
void Matrix_StatePop(void) {
|
||||
sCurrentMatrix--;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_CopyCurrentState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_CopyCurrentState.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_SetCurrentState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_SetCurrentState.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_GetCurrentState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_GetCurrentState.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertMatrix.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertMatrix.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertTranslation.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertTranslation.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_Scale.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertXRotation_s.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertXRotation_s.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertXRotation_f.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertXRotation_f.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_RotateStateAroundXAxis.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_RotateStateAroundXAxis.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_SetStateXRotation.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_SetStateXRotation.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_RotateY.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertYRotation_f.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertYRotation_f.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertZRotation_s.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertZRotation_s.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertZRotation_f.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertZRotation_f.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertRotation.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertRotation.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_RotateAndTranslateState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_JointPosition.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_SetStateRotationAndTranslation.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_SetStateRotationAndTranslation.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_ToRSPMatrix.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_ToRSPMatrix.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_GetStateAsRSPMatrix.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_ToMtx.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_NewMtx.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_AppendToPolyOpaDisp.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_AppendToPolyOpaDisp.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_MultiplyVector3fByState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MultiplyVector3fByState.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_GetStateTranslation.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_GetStateTranslation.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_GetStateTranslationAndScaledX.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_GetStateTranslationAndScaledX.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_GetStateTranslationAndScaledY.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_GetStateTranslationAndScaledY.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_GetStateTranslationAndScaledZ.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_GetStateTranslationAndScaledZ.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_MultiplyVector3fXZByCurrentState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MultiplyVector3fXZByCurrentState.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MtxFCopy.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_FromRSPMatrix.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_FromRSPMatrix.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_MultiplyVector3fByMatrix.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MultiplyVector3fByMatrix.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_TransposeXYZ.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_TransposeXYZ.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_NormalizeXYZ.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_NormalizeXYZ.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_8018219C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_801822C4.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertRotationAroundUnitVector_f.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_f.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/SysMatrix_InsertRotationAroundUnitVector_s.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_InsertRotationAroundUnitVector_s.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_80182C90.s")
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_DLF/DLF_LoadGameState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_DLF/Overlay_LoadGameState.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_DLF/DLF_FreeGameState.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_DLF/Overlay_FreeGameState.s")
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gf
|
||||
}
|
||||
|
||||
func_800C0094(actor->floorPoly, actor->world.pos.x, actor->floorHeight, actor->world.pos.z, &mtx);
|
||||
SysMatrix_SetCurrentState(&mtx);
|
||||
Matrix_SetCurrentState(&mtx);
|
||||
|
||||
if (dlist != D_04076BC0) {
|
||||
Matrix_RotateY((f32)actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY);
|
||||
@@ -117,7 +117,7 @@ void func_800B40E0(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3,
|
||||
sp58 = Math_FAtan2F(light->l.dir[0], light->l.dir[2]);
|
||||
arg6 *= (4.5f - (light->l.dir[1] * 0.035f));
|
||||
arg6 = (arg6 < 1.0f) ? 1.0f : arg6;
|
||||
SysMatrix_SetCurrentState(arg2);
|
||||
Matrix_SetCurrentState(arg2);
|
||||
Matrix_RotateY(sp58, MTXMODE_APPLY);
|
||||
Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY);
|
||||
|
||||
@@ -744,7 +744,7 @@ void Actor_FreeOverlay(ActorOverlay* entry) {
|
||||
if ((entry->allocType & 1) != 0) {
|
||||
entry->loadedRamAddr = NULL;
|
||||
} else {
|
||||
zelda_free(ramAddr);
|
||||
ZeldaArena_Free(ramAddr);
|
||||
entry->loadedRamAddr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -736,7 +736,7 @@ void* ActorOverlayTable_FaultAddrConv(void* arg0, void* arg1) {
|
||||
s32 i;
|
||||
u8* ramStart;
|
||||
u8* ramEnd;
|
||||
u32 size;
|
||||
size_t size;
|
||||
u32 offset;
|
||||
|
||||
for (i = 0; i < gMaxActorId; i++, overlayEntry++) {
|
||||
|
||||
@@ -327,7 +327,7 @@ s32 Collider_FreeJntSph(GlobalContext* globalCtx, ColliderJntSph* collider) {
|
||||
|
||||
collider->count = 0;
|
||||
if (collider->elements != NULL) {
|
||||
zelda_free(collider->elements);
|
||||
ZeldaArena_Free(collider->elements);
|
||||
}
|
||||
collider->elements = NULL;
|
||||
return 1;
|
||||
@@ -359,7 +359,7 @@ s32 Collider_SetJntSphToActor(GlobalContext* globalCtx, ColliderJntSph* collider
|
||||
|
||||
Collider_SetBaseToActor(globalCtx, &collider->base, &src->base);
|
||||
collider->count = src->count;
|
||||
collider->elements = zelda_malloc(src->count * sizeof(ColliderJntSphElement));
|
||||
collider->elements = ZeldaArena_Malloc(src->count * sizeof(ColliderJntSphElement));
|
||||
|
||||
if (collider->elements == NULL) {
|
||||
collider->count = 0;
|
||||
@@ -385,7 +385,7 @@ s32 Collider_SetJntSphAllocType1(GlobalContext* globalCtx, ColliderJntSph* spher
|
||||
|
||||
Collider_SetBaseType1(globalCtx, &sphereGroup->base, actor, &src->base);
|
||||
sphereGroup->count = src->count;
|
||||
sphereGroup->elements = zelda_malloc(src->count * sizeof(ColliderJntSphElement));
|
||||
sphereGroup->elements = ZeldaArena_Malloc(src->count * sizeof(ColliderJntSphElement));
|
||||
|
||||
if (sphereGroup->elements == NULL) {
|
||||
sphereGroup->count = 0;
|
||||
@@ -681,7 +681,7 @@ s32 Collider_FreeTris(GlobalContext* globalCtx, ColliderTris* tris) {
|
||||
|
||||
tris->count = 0;
|
||||
if (tris->elements != NULL) {
|
||||
zelda_free(tris->elements);
|
||||
ZeldaArena_Free(tris->elements);
|
||||
}
|
||||
tris->elements = NULL;
|
||||
|
||||
@@ -714,7 +714,7 @@ s32 Collider_SetTrisAllocType1(GlobalContext* globalCtx, ColliderTris* tris, Act
|
||||
|
||||
Collider_SetBaseType1(globalCtx, &tris->base, actor, &src->base);
|
||||
tris->count = src->count;
|
||||
tris->elements = zelda_malloc(tris->count * sizeof(ColliderTrisElement));
|
||||
tris->elements = ZeldaArena_Malloc(tris->count * sizeof(ColliderTrisElement));
|
||||
|
||||
if (tris->elements == NULL) {
|
||||
tris->count = 0;
|
||||
@@ -3691,7 +3691,7 @@ void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider) {
|
||||
D_801EE1C0.x = collider->elements[i].dim.modelSphere.center.x;
|
||||
D_801EE1C0.y = collider->elements[i].dim.modelSphere.center.y;
|
||||
D_801EE1C0.z = collider->elements[i].dim.modelSphere.center.z;
|
||||
SysMatrix_MultiplyVector3fByState(&D_801EE1C0, &D_801EE1D0);
|
||||
Matrix_MultiplyVector3fByState(&D_801EE1C0, &D_801EE1D0);
|
||||
collider->elements[i].dim.worldSphere.center.x = D_801EE1D0.x;
|
||||
collider->elements[i].dim.worldSphere.center.y = D_801EE1D0.y;
|
||||
collider->elements[i].dim.worldSphere.center.z = D_801EE1D0.z;
|
||||
@@ -3733,7 +3733,7 @@ void Collider_UpdateSphere(s32 limb, ColliderSphere* collider) {
|
||||
D_801EE1E0.x = collider->dim.modelSphere.center.x;
|
||||
D_801EE1E0.y = collider->dim.modelSphere.center.y;
|
||||
D_801EE1E0.z = collider->dim.modelSphere.center.z;
|
||||
SysMatrix_MultiplyVector3fByState(&D_801EE1E0, &D_801EE1F0);
|
||||
Matrix_MultiplyVector3fByState(&D_801EE1E0, &D_801EE1F0);
|
||||
collider->dim.worldSphere.center.x = D_801EE1F0.x;
|
||||
collider->dim.worldSphere.center.y = D_801EE1F0.y;
|
||||
collider->dim.worldSphere.center.z = D_801EE1F0.z;
|
||||
|
||||
@@ -106,8 +106,8 @@ void EffFootmark_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
for (footmark = globalCtx->footprintInfo, i = 0; i < 100; i++, footmark++) {
|
||||
if (footmark->actor != NULL) {
|
||||
SysMatrix_SetCurrentState(&footmark->displayMatrix);
|
||||
Matrix_Scale(footmark->size * 0.00390625f * 0.7f, 1, footmark->size * 0.00390625f, 1);
|
||||
Matrix_SetCurrentState(&footmark->displayMatrix);
|
||||
Matrix_Scale(footmark->size * (1.0f / 0x100) * 0.7f, 1, footmark->size * (1.0f / 0x100), MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void EffectSS_Clear(GlobalContext* globalCtx) {
|
||||
for (i = 0; i < EFFECT_SS_MAX; i++) {
|
||||
addr = overlay->loadedRamAddr;
|
||||
if (addr != NULL) {
|
||||
zelda_free(addr);
|
||||
ZeldaArena_Free(addr);
|
||||
}
|
||||
|
||||
overlay->loadedRamAddr = 0;
|
||||
@@ -175,7 +175,7 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init
|
||||
initInfo = entry->initInfo;
|
||||
} else {
|
||||
if (entry->loadedRamAddr == NULL) {
|
||||
entry->loadedRamAddr = zelda_mallocR(overlaySize);
|
||||
entry->loadedRamAddr = ZeldaArena_MallocR(overlaySize);
|
||||
|
||||
if (entry->loadedRamAddr == NULL) {
|
||||
return;
|
||||
|
||||
@@ -403,7 +403,7 @@ void EffectSsGSpk_SpawnSmall(GlobalContext* globalCtx, Actor* actor, Vec3f* pos,
|
||||
|
||||
// EffectSsDFire Spawn Functions
|
||||
void EffectSsDFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep,
|
||||
s16 alpha, s16 fadeDelay, s16 life, s32 arg9) {
|
||||
s16 alpha, s16 fadeDelay, s16 arg8, s32 life) {
|
||||
EffectSsDFireInitParams initParams;
|
||||
|
||||
Math_Vec3f_Copy(&initParams.pos, pos);
|
||||
@@ -413,8 +413,8 @@ void EffectSsDFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity,
|
||||
initParams.scaleStep = scaleStep;
|
||||
initParams.alpha = alpha;
|
||||
initParams.fadeDelay = fadeDelay;
|
||||
initParams.unk_2C = arg8;
|
||||
initParams.life = life;
|
||||
initParams.unk_30 = arg9;
|
||||
|
||||
EffectSs_Spawn(globalCtx, EFFECT_SS_D_FIRE, 128, &initParams);
|
||||
}
|
||||
@@ -535,8 +535,8 @@ void EffectSsDtBubble_SpawnCustomColor(GlobalContext* globalCtx, Vec3f* pos, Vec
|
||||
/**
|
||||
* Spawn a single fragment
|
||||
*
|
||||
* Notes:
|
||||
* - if a display list is not provided, D_0400C0D0 (wilted deku fragment) will be used as default
|
||||
* * Notes:
|
||||
* - if a display list is not provided, an unknown default will be used as default
|
||||
* - the unused arg does not do anything, any value can be passed here
|
||||
* - due to how life is implemented it is capped at 200. Any value over 200 is accepted, but the fragment will
|
||||
* only live for 200 frames
|
||||
@@ -960,6 +960,7 @@ void EffectSsExtra_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity,
|
||||
}
|
||||
|
||||
// EffectSsDeadDb Spawn Functions
|
||||
|
||||
void EffectSsDeadDb_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* prim,
|
||||
Color_RGBA8* env, s16 scale, s16 scaleStep, s32 unk) {
|
||||
EffectSsDeadDbInitParams initParams;
|
||||
|
||||
+40
-31
@@ -1,48 +1,57 @@
|
||||
#include "global.h"
|
||||
|
||||
void EnAObj_Init(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ActorEnAObj* s0 = (ActorEnAObj*)this;
|
||||
s0->base.textId = ((s0->base.params >> 8) & 0xFF) | 0x300;
|
||||
s0->base.params = (s0->base.params & 0xFF) - 9;
|
||||
Actor_ProcessInitChain((Actor*)s0, &enAObjInitVar);
|
||||
ActorShape_Init(&s0->base.shape, 0, (ActorShadowFunc)func_800B3FC0, 12);
|
||||
Collider_InitAndSetCylinder(globalCtx, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
|
||||
Collider_UpdateCylinder((Actor*)s0, &s0->collision);
|
||||
s0->base.colChkInfo.mass = 255;
|
||||
s0->update = (ActorFunc)EnAObj_Update1;
|
||||
#define THIS ((EnAObj*)thisx)
|
||||
|
||||
void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_Update2(EnAObj* this, GlobalContext* globalCtx);
|
||||
|
||||
void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAObj* this = THIS;
|
||||
|
||||
this->actor.textId = ((this->actor.params >> 8) & 0xFF) | 0x300;
|
||||
this->actor.params = (this->actor.params & 0xFF) - 9;
|
||||
Actor_ProcessInitChain(&this->actor, &enAObjInitVar);
|
||||
ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 12);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collision, &this->actor, &enAObjCylinderInit);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collision);
|
||||
this->actor.colChkInfo.mass = 255;
|
||||
this->actionFunc = EnAObj_Update1;
|
||||
}
|
||||
|
||||
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinder* a2 = &this->collision;
|
||||
Collider_DestroyCylinder(globalCtx, a2);
|
||||
void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAObj* this = THIS;
|
||||
|
||||
Collider_DestroyCylinder(globalCtx, &this->collision);
|
||||
}
|
||||
|
||||
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
s16 v0;
|
||||
s32 v1;
|
||||
if (func_800B84D0((Actor*)this, globalCtx) != 0) {
|
||||
this->update = (ActorFunc)EnAObj_Update2;
|
||||
void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx) {
|
||||
s32 yawDiff;
|
||||
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnAObj_Update2;
|
||||
} else {
|
||||
v0 = this->base.yawTowardsPlayer - this->base.shape.rot.y;
|
||||
v1 = (v0 < 0) ? -v0 : v0;
|
||||
if ((v1 < 10240) || ((this->base.params == 1) && (v1 > 22528))) {
|
||||
func_800B863C((Actor*)this, globalCtx);
|
||||
yawDiff = ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y));
|
||||
|
||||
if ((yawDiff < 0x2800) || ((this->actor.params == 1) && (yawDiff > 0x5800))) {
|
||||
func_800B863C(&this->actor, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Update2(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
if (func_800B867C((Actor*)this, globalCtx) != 0) {
|
||||
this->update = (ActorFunc)EnAObj_Update1;
|
||||
void EnAObj_Update2(EnAObj* this, GlobalContext* globalCtx) {
|
||||
if (func_800B867C(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnAObj_Update1;
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
(this->update)((Actor*)this, (GlobalContext*)globalCtx);
|
||||
Actor_SetHeight((Actor*)this, 45.0f);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, (Collider*)&this->collision);
|
||||
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAObj* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Actor_SetHeight(&this->actor, 45.0f);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collision.base);
|
||||
}
|
||||
|
||||
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
func_800BDFC0(globalCtx, enAObjDisplayLists[this->base.params]);
|
||||
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_800BDFC0(globalCtx, enAObjDisplayLists[thisx->params]);
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->unk152 = -2;
|
||||
}
|
||||
} else {
|
||||
Matrix_Scale(16.0f, 16.0f, 16.0f, 1);
|
||||
Matrix_Scale(16.0f, 16.0f, 16.0f, MTXMODE_APPLY);
|
||||
GetItem_Draw(globalCtx, 8);
|
||||
}
|
||||
break;
|
||||
@@ -785,7 +785,7 @@ void EnItem00_DrawHeartContainer(EnItem00* actor, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
Matrix_Scale(20.0f, 20.0f, 20.0f, 1);
|
||||
Matrix_Scale(20.0f, 20.0f, 20.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data/func_800F23E0.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data/func_800F2478.s")
|
||||
@@ -1,15 +1,181 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_800F2620.s")
|
||||
void SkelCurve_Clear(SkelAnimeCurve* skelCurve) {
|
||||
skelCurve->limbCount = 0;
|
||||
skelCurve->limbList = NULL;
|
||||
skelCurve->transUpdIdx = NULL;
|
||||
skelCurve->animCurFrame = 0.0f;
|
||||
skelCurve->animSpeed = 0.0f;
|
||||
skelCurve->animFinalFrame = 0.0f;
|
||||
skelCurve->unk0C = 0.0f;
|
||||
skelCurve->transforms = NULL;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_800F2650.s")
|
||||
s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurveLimbList* limbListSeg,
|
||||
TransformUpdateIndex* transUpdIdx) {
|
||||
SkelCurveLimb** limbs;
|
||||
SkelCurveLimbList* limbList = (SkelCurveLimbList*)Lib_SegmentedToVirtual(limbListSeg);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_800F26C0.s")
|
||||
skelCurve->limbCount = limbList->limbCount;
|
||||
skelCurve->limbList = (SkelCurveLimb**)Lib_SegmentedToVirtual(limbList->limbs);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_800F26F0.s")
|
||||
skelCurve->transforms = ZeldaArena_Malloc(sizeof(*skelCurve->transforms) * skelCurve->limbCount);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_800F2728.s")
|
||||
do {
|
||||
skelCurve->animCurFrame = 0.0f;
|
||||
} while (0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_800F29A0.s")
|
||||
void SkelCurve_Destroy(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve) {
|
||||
if (skelCurve->transforms != NULL) {
|
||||
ZeldaArena_Free(skelCurve->transforms);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_800F2CD8.s")
|
||||
void SkelCurve_SetAnim(SkelAnimeCurve* skelCurve, TransformUpdateIndex* transUpdIdx, f32 arg2, f32 animFinalFrame,
|
||||
f32 animCurFrame, f32 animSpeed) {
|
||||
skelCurve->unk0C = arg2 - skelCurve->animSpeed;
|
||||
skelCurve->animFinalFrame = animFinalFrame;
|
||||
skelCurve->animCurFrame = animCurFrame;
|
||||
skelCurve->animSpeed = animSpeed;
|
||||
skelCurve->transUpdIdx = transUpdIdx;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
/* Should be functionally equivalent, also migrating rodata makes it a lot cleaner */
|
||||
s32 SkelCurve_Update(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve) {
|
||||
s16* transforms;
|
||||
u8* transformRefIdx;
|
||||
TransformUpdateIndex* transformIndex;
|
||||
u16* transformCopyValues;
|
||||
s32 i;
|
||||
s32 ret = 0;
|
||||
s32 k;
|
||||
TransformData* transData;
|
||||
f32 transformValue;
|
||||
s32 j;
|
||||
|
||||
transformIndex = Lib_SegmentedToVirtual(skelCurve->transUpdIdx);
|
||||
transformRefIdx = Lib_SegmentedToVirtual(transformIndex->refIndex);
|
||||
transData = Lib_SegmentedToVirtual(transformIndex->transformData);
|
||||
transformCopyValues = Lib_SegmentedToVirtual(transformIndex->copyValues);
|
||||
transforms = (s16*)skelCurve->transforms;
|
||||
|
||||
skelCurve->animCurFrame += skelCurve->animSpeed * (globalCtx->state.framerateDivisor * 0.5f);
|
||||
|
||||
if ((skelCurve->animSpeed >= 0.0f && skelCurve->animCurFrame > skelCurve->animFinalFrame) ||
|
||||
(skelCurve->animSpeed < 0.0f && skelCurve->animCurFrame < skelCurve->animFinalFrame)) {
|
||||
skelCurve->animCurFrame = skelCurve->animFinalFrame;
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < skelCurve->limbCount; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
for (k = 0; k < 3; k++, transformRefIdx++, transforms++) {
|
||||
if (*transformRefIdx == 0) {
|
||||
transformValue = *transformCopyValues;
|
||||
*transforms = transformValue;
|
||||
transformCopyValues++;
|
||||
} else {
|
||||
transformValue = func_800F2478(skelCurve->animCurFrame, transData, *transformRefIdx);
|
||||
transData += *transformRefIdx;
|
||||
if (j == 0) {
|
||||
*transforms = transformValue * 1024.0f;
|
||||
} else if (j == 1) {
|
||||
*transforms = transformValue * (32768.0f / 180.0f);
|
||||
} else {
|
||||
*transforms = transformValue * 100.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/SkelCurve_Update.s")
|
||||
#endif
|
||||
|
||||
void SkelCurve_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, SkelAnimeCurve* skelCurve,
|
||||
OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, Actor* thisx) {
|
||||
SkelCurveLimb* limb = (SkelCurveLimb*)Lib_SegmentedToVirtual(skelCurve->limbList[limbIndex]);
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
Matrix_StatePush();
|
||||
|
||||
if (overrideLimbDraw == NULL ||
|
||||
(overrideLimbDraw != NULL && overrideLimbDraw(globalCtx, skelCurve, limbIndex, thisx))) {
|
||||
Vec3f scale;
|
||||
Vec3s rot;
|
||||
Vec3f pos;
|
||||
Gfx* dList;
|
||||
Vec3s* transform = (Vec3s*)&skelCurve->transforms[limbIndex];
|
||||
|
||||
scale.x = transform->x / 1024.0f;
|
||||
scale.y = transform->y / 1024.0f;
|
||||
scale.z = transform->z / 1024.0f;
|
||||
transform++;
|
||||
rot.x = transform->x;
|
||||
rot.y = transform->y;
|
||||
rot.z = transform->z;
|
||||
transform++;
|
||||
pos.x = transform->x;
|
||||
pos.y = transform->y;
|
||||
pos.z = transform->z;
|
||||
|
||||
Matrix_JointPosition(&pos, &rot);
|
||||
Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY);
|
||||
|
||||
if (lod == 0) {
|
||||
s32 pad1;
|
||||
|
||||
dList = limb->dList[0];
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
} else if (lod == 1) {
|
||||
s32 pad2;
|
||||
|
||||
dList = limb->dList[0];
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, dList);
|
||||
}
|
||||
dList = limb->dList[1];
|
||||
if (dList != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, dList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (postLimbDraw != NULL) {
|
||||
postLimbDraw(globalCtx, skelCurve, limbIndex, thisx);
|
||||
}
|
||||
|
||||
if (limb->firstChildIdx != LIMB_DONE) {
|
||||
SkelCurve_DrawLimb(globalCtx, limb->firstChildIdx, skelCurve, overrideLimbDraw, postLimbDraw, lod, thisx);
|
||||
}
|
||||
|
||||
Matrix_StatePop();
|
||||
|
||||
if (limb->nextLimbIdx != LIMB_DONE) {
|
||||
SkelCurve_DrawLimb(globalCtx, limb->nextLimbIdx, skelCurve, overrideLimbDraw, postLimbDraw, lod, thisx);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelAnimeCurve* skelCurve,
|
||||
OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, Actor* thisx) {
|
||||
if (skelCurve->transforms != NULL) {
|
||||
SkelCurve_DrawLimb(globalCtx, 0, skelCurve, overrideLimbDraw, postLimbDraw, lod, thisx);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -432,7 +432,7 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
|
||||
|
||||
gDPSetPrimColor(dl++, 0, 0, params->color[0], params->color[1], params->color[2], 50);
|
||||
|
||||
SysMatrix_InsertTranslation(params->x, params->y, params->z, 0);
|
||||
Matrix_InsertTranslation(params->x, params->y, params->z, MTXMODE_NEW);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(dl++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
|
||||
+43
-10
@@ -1,21 +1,54 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/zelda_malloc.s")
|
||||
void* ZeldaArena_Malloc(size_t size) {
|
||||
void* ptr = __osMalloc(&sZeldaArena, size);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/zelda_mallocR.s")
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/zelda_realloc.s")
|
||||
void* ZeldaArena_MallocR(size_t size) {
|
||||
void* ptr = __osMallocR(&sZeldaArena, size);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/zelda_free.s")
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/zelda_calloc.s")
|
||||
void* ZeldaArena_Realloc(void* ptr, size_t newSize) {
|
||||
ptr = __osRealloc(&sZeldaArena, ptr, newSize);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/MainHeap_AnalyzeArena.s")
|
||||
void ZeldaArena_Free(void* ptr) {
|
||||
__osFree(&sZeldaArena, ptr);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/MainHeap_Check.s")
|
||||
void* ZeldaArena_Calloc(u32 num, size_t size) {
|
||||
void* ret;
|
||||
u32 n = num * size;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/MainHeap_Init.s")
|
||||
ret = __osMalloc(&sZeldaArena, n);
|
||||
if (ret != NULL) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/MainHeap_Cleanup.s")
|
||||
return ret;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_malloc/MainHeap_IsInitialized.s")
|
||||
void ZeldaArena_GetSizes(size_t* outMaxFree, size_t* outFree, size_t* outAlloc) {
|
||||
__osAnalyzeArena(&sZeldaArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void ZeldaArena_Check() {
|
||||
__osCheckArena(&sZeldaArena);
|
||||
}
|
||||
|
||||
void ZeldaArena_Init(void* start, size_t size) {
|
||||
__osMallocInit(&sZeldaArena, start, size);
|
||||
}
|
||||
|
||||
void ZeldaArena_Cleanup() {
|
||||
__osMallocCleanup(&sZeldaArena);
|
||||
}
|
||||
|
||||
u8 ZeldaArena_IsInitialized() {
|
||||
return __osMallocIsInitalized(&sZeldaArena);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_pause/func_80122660.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_pause/func_80122670.s")
|
||||
+1
-1
@@ -77,7 +77,7 @@ void Room_Init(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtx, s32 index) {
|
||||
u32 size;
|
||||
size_t size;
|
||||
|
||||
// XXX: this should use a branch-likely
|
||||
if (roomCtx->unk31 == 0) {
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
|
||||
s32 Object_Spawn(ObjectContext* objectCtx, s16 id) {
|
||||
u32 size;
|
||||
size_t size;
|
||||
|
||||
objectCtx->status[objectCtx->num].id = id;
|
||||
size = objectFileTable[id].vromEnd - objectFileTable[id].vromStart;
|
||||
@@ -23,8 +23,8 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 id) {
|
||||
return objectCtx->num - 1;
|
||||
}
|
||||
|
||||
void Object_InitBank(GameState* gamestate, ObjectContext* objectCtx) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)gamestate;
|
||||
void Object_InitBank(GameState* gameState, ObjectContext* objectCtx) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)gameState;
|
||||
s32 pad;
|
||||
u32 spaceSize;
|
||||
s32 i;
|
||||
@@ -49,7 +49,7 @@ void Object_InitBank(GameState* gamestate, ObjectContext* objectCtx) {
|
||||
for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) { objectCtx->status[i].id = 0; }
|
||||
// clang-format on
|
||||
|
||||
objectCtx->spaceStart = objectCtx->status[0].segment = THA_AllocEndAlign16(&gamestate->heap, spaceSize);
|
||||
objectCtx->spaceStart = objectCtx->status[0].segment = THA_AllocEndAlign16(&gameState->heap, spaceSize);
|
||||
objectCtx->spaceEnd = (void*)((u32)objectCtx->spaceStart + spaceSize);
|
||||
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, GAMEPLAY_KEEP);
|
||||
|
||||
@@ -60,7 +60,7 @@ void Object_UpdateBank(ObjectContext* objectCtx) {
|
||||
s32 i;
|
||||
ObjectStatus* status = &objectCtx->status[0];
|
||||
RomFile* objectFile;
|
||||
u32 size;
|
||||
size_t size;
|
||||
|
||||
for (i = 0; i < objectCtx->num; i++) {
|
||||
if (status->id < 0) {
|
||||
@@ -354,7 +354,7 @@ s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
|
||||
{ SEGMENT_ROM_START(scene_texture_08), SEGMENT_ROM_END(scene_texture_08) },
|
||||
};
|
||||
u32 vromStart = sceneTextureFiles[fileIndex].vromStart;
|
||||
u32 size = sceneTextureFiles[fileIndex].vromEnd - vromStart;
|
||||
size_t size = sceneTextureFiles[fileIndex].vromEnd - vromStart;
|
||||
|
||||
if (size != 0) {
|
||||
globalCtx->roomCtx.unk74 = THA_AllocEndAlign16(&globalCtx->state.heap, size);
|
||||
|
||||
+1276
-996
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -237,7 +237,7 @@ s32 View_SetQuake(View* view, Vec3f rot, Vec3f scale, f32 speed) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 View_StepQuake(View* view, RSPMatrix* matrix) {
|
||||
s32 View_StepQuake(View* view, Mtx* matrix) {
|
||||
MtxF mf;
|
||||
|
||||
if (view->quakeSpeed == 0.0f) {
|
||||
@@ -256,16 +256,16 @@ s32 View_StepQuake(View* view, RSPMatrix* matrix) {
|
||||
view->currQuakeScale.z += ((view->quakeScale.z - view->currQuakeScale.z) * view->quakeSpeed);
|
||||
}
|
||||
|
||||
SysMatrix_FromRSPMatrix(matrix, &mf);
|
||||
SysMatrix_SetCurrentState(&mf);
|
||||
SysMatrix_RotateStateAroundXAxis(view->currQuakeRot.x);
|
||||
SysMatrix_InsertYRotation_f(view->currQuakeRot.y, 1);
|
||||
SysMatrix_InsertZRotation_f(view->currQuakeRot.z, 1);
|
||||
Matrix_Scale(view->currQuakeScale.x, view->currQuakeScale.y, view->currQuakeScale.z, 1);
|
||||
SysMatrix_InsertZRotation_f(-view->currQuakeRot.z, 1);
|
||||
SysMatrix_InsertYRotation_f(-view->currQuakeRot.y, 1);
|
||||
SysMatrix_RotateStateAroundXAxis(-view->currQuakeRot.x);
|
||||
SysMatrix_GetStateAsRSPMatrix(matrix);
|
||||
Matrix_FromRSPMatrix(matrix, &mf);
|
||||
Matrix_SetCurrentState(&mf);
|
||||
Matrix_RotateStateAroundXAxis(view->currQuakeRot.x);
|
||||
Matrix_InsertYRotation_f(view->currQuakeRot.y, 1);
|
||||
Matrix_InsertZRotation_f(view->currQuakeRot.z, 1);
|
||||
Matrix_Scale(view->currQuakeScale.x, view->currQuakeScale.y, view->currQuakeScale.z, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(-view->currQuakeRot.z, 1);
|
||||
Matrix_InsertYRotation_f(-view->currQuakeRot.y, 1);
|
||||
Matrix_RotateStateAroundXAxis(-view->currQuakeRot.x);
|
||||
Matrix_ToMtx(matrix);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ s32 View_RenderToPerspectiveMatrix(View* view) {
|
||||
guPerspective(projection, &view->normal, view->fovy, aspect, view->zNear, view->zFar, view->scale);
|
||||
view->projection = *projection;
|
||||
//! @bug: This cast of `projection` is invalid
|
||||
View_StepQuake(view, (RSPMatrix*)projection);
|
||||
View_StepQuake(view, (Mtx*)projection);
|
||||
|
||||
gSPPerspNormalize(POLY_OPA_DISP++, view->normal);
|
||||
gSPMatrix(POLY_OPA_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
+9
-9
@@ -35,9 +35,9 @@ void func_80143148(SkyboxContext* skyboxCtx, s32 arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_801431E8(GameState* gamestate, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)gamestate;
|
||||
u32 size;
|
||||
void func_801431E8(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
GlobalContext* globalCtx = (GlobalContext*)gameState;
|
||||
size_t size;
|
||||
void* offset;
|
||||
s32 pad;
|
||||
|
||||
@@ -82,7 +82,7 @@ void func_801431E8(GameState* gamestate, SkyboxContext* skyboxCtx, s16 skyType)
|
||||
}
|
||||
|
||||
void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
u32 size;
|
||||
size_t size;
|
||||
|
||||
if (1) {}
|
||||
|
||||
@@ -133,22 +133,22 @@ void func_80143324(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skyTy
|
||||
}
|
||||
}
|
||||
|
||||
void func_801434E4(GameState* gamestate, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
void func_801434E4(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyType) {
|
||||
skyboxCtx->skyboxShouldDraw = 0;
|
||||
skyboxCtx->rotX = skyboxCtx->rotY = skyboxCtx->rotZ = 0.0f;
|
||||
|
||||
func_801431E8(gamestate, skyboxCtx, skyType);
|
||||
func_801431E8(gameState, skyboxCtx, skyType);
|
||||
|
||||
if (skyType != 0) {
|
||||
skyboxCtx->unk17C = THA_AllocEndAlign16(&gamestate->heap, 0x3840);
|
||||
skyboxCtx->unk17C = THA_AllocEndAlign16(&gameState->heap, 0x3840);
|
||||
|
||||
if (skyType == 5) {
|
||||
// Allocate enough space for the vertices for a 6 sided skybox (cube)
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&gamestate->heap, sizeof(Vtx) * 32 * 6);
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&gameState->heap, sizeof(Vtx) * 32 * 6);
|
||||
func_80143148(skyboxCtx, 6);
|
||||
} else {
|
||||
// Allocate enough space for the vertices for a 5 sided skybox (bottom is missing)
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&gamestate->heap, sizeof(Vtx) * 32 * 5);
|
||||
skyboxCtx->roomVtx = THA_AllocEndAlign16(&gameState->heap, sizeof(Vtx) * 32 * 5);
|
||||
func_80143148(skyboxCtx, 5);
|
||||
}
|
||||
}
|
||||
|
||||
+300
-7
@@ -1,15 +1,308 @@
|
||||
#include "ultra64.h"
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osSumcalc.s")
|
||||
u16 __osSumcalc(u8* ptr, s32 length) {
|
||||
s32 i;
|
||||
u32 sum = 0;
|
||||
u8* temp = ptr;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osIdCheckSum.s")
|
||||
for (i = 0; i < length; i++) {
|
||||
sum += *temp++;
|
||||
}
|
||||
return sum & 0xFFFF;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osRepairPackId.s")
|
||||
s32 __osIdCheckSum(u16* ptr, u16* checkSum, u16* idSum) {
|
||||
u16 data = 0;
|
||||
u32 i;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osCheckPackId.s")
|
||||
*checkSum = *idSum = 0;
|
||||
for (i = 0; i < ((sizeof(__OSPackId) - sizeof(u32)) / sizeof(u8)); i += 2) {
|
||||
data = *((u16*)((u32)ptr + i));
|
||||
*checkSum += data;
|
||||
*idSum += ~data;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osGetId.s")
|
||||
s32 __osRepairPackId(OSPfs* pfs, __OSPackId* badid, __OSPackId* newid) {
|
||||
s32 ret = 0;
|
||||
u8 temp[BLOCKSIZE];
|
||||
u8 comp[BLOCKSIZE];
|
||||
u8 mask = 0;
|
||||
s32 i, j = 0;
|
||||
u16 index[4];
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osCheckId.s")
|
||||
newid->repaired = 0xFFFFFFFF;
|
||||
newid->random = osGetCount();
|
||||
newid->serialMid = badid->serialMid;
|
||||
newid->serialLow = badid->serialLow;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osPfsRWInode.s")
|
||||
if ((pfs->activebank != 0) && ((ret = __osPfsSelectBank(pfs, 0)) != 0)) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
do {
|
||||
if ((ret = __osPfsSelectBank(pfs, j)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, 0, temp)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
temp[0] = j | 0x80;
|
||||
for (i = 1; i < BLOCKSIZE; i++) {
|
||||
temp[i] = ~temp[i];
|
||||
}
|
||||
|
||||
if ((ret = __osContRamWrite(pfs->queue, pfs->channel, 0, temp, 0)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, 0, comp)) != 0) {
|
||||
return (ret);
|
||||
}
|
||||
for (i = 0; i < BLOCKSIZE; i++) {
|
||||
if (comp[i] != temp[i]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i != BLOCKSIZE) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (j > 0) {
|
||||
if ((ret = __osPfsSelectBank(pfs, 0)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, 0, temp)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
if (temp[0] != 0x80) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
j++;
|
||||
} while (j < PFS_MAX_BANKS);
|
||||
|
||||
if ((pfs->activebank != 0) && (ret = __osPfsSelectBank(pfs, 0)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
mask = (j > 0) ? 1 : 0;
|
||||
newid->deviceid = (badid->deviceid & 0xFFFE) | mask;
|
||||
newid->banks = j;
|
||||
newid->version = badid->version;
|
||||
__osIdCheckSum((u16*)newid, &newid->checksum, &newid->invertedChecksum);
|
||||
|
||||
index[0] = PFS_ID_0AREA;
|
||||
index[1] = PFS_ID_1AREA;
|
||||
index[2] = PFS_ID_2AREA;
|
||||
index[3] = PFS_ID_3AREA;
|
||||
for (i = 0; i < 4; i++) {
|
||||
if ((ret = __osContRamWrite(pfs->queue, pfs->channel, index[i], (u8*)newid, PFS_FORCE)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_ID_0AREA, temp)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
for (i = 0; i < BLOCKSIZE; i++) {
|
||||
if (temp[i] != *(u8*)((s32)newid + i)) {
|
||||
return PFS_ERR_DEVICE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 __osCheckPackId(OSPfs* pfs, __OSPackId* check) {
|
||||
u16 index[4];
|
||||
s32 ret = 0;
|
||||
u16 sum;
|
||||
u16 idSum;
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
if ((pfs->activebank != 0) && (ret = __osPfsSelectBank(pfs, 0)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
index[0] = PFS_ID_0AREA;
|
||||
index[1] = PFS_ID_1AREA;
|
||||
index[2] = PFS_ID_2AREA;
|
||||
index[3] = PFS_ID_3AREA;
|
||||
for (i = 1; i < 4; i++) {
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, index[i], (u8*)check)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
__osIdCheckSum((u16*)check, &sum, &idSum);
|
||||
if ((check->checksum == sum) && (check->invertedChecksum == idSum)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == 4) {
|
||||
return PFS_ERR_ID_FATAL;
|
||||
}
|
||||
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (j != i) {
|
||||
if ((ret = __osContRamWrite(pfs->queue, pfs->channel, index[j], (u8*)check, PFS_FORCE)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 __osGetId(OSPfs* pfs) {
|
||||
u16 sum;
|
||||
u16 isum;
|
||||
u8 temp[BLOCKSIZE];
|
||||
__OSPackId* id;
|
||||
__OSPackId newid;
|
||||
s32 ret;
|
||||
|
||||
if (pfs->activebank != 0) {
|
||||
if ((ret = __osPfsSelectBank(pfs, 0)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_ID_0AREA, temp)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
__osIdCheckSum((u16*)temp, &sum, &isum);
|
||||
id = (__OSPackId*)temp;
|
||||
if ((id->checksum != sum) || (id->invertedChecksum != isum)) {
|
||||
if ((ret = __osCheckPackId(pfs, id)) == PFS_ERR_ID_FATAL) {
|
||||
ret = __osRepairPackId(pfs, id, &newid);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
id = &newid;
|
||||
} else if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ((id->deviceid & 0x01) == 0) {
|
||||
ret = __osRepairPackId(pfs, id, &newid);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
id = &newid;
|
||||
if ((id->deviceid & 0x01) == 0) {
|
||||
return PFS_ERR_DEVICE;
|
||||
}
|
||||
}
|
||||
|
||||
bcopy(id, pfs->id, BLOCKSIZE);
|
||||
|
||||
if (0) {}
|
||||
|
||||
pfs->version = id->version;
|
||||
|
||||
pfs->banks = id->banks;
|
||||
pfs->inodeStartPage = 1 + DEF_DIR_PAGES + (2 * pfs->banks);
|
||||
pfs->dir_size = DEF_DIR_PAGES * PFS_ONE_PAGE;
|
||||
pfs->inode_table = 1 * PFS_ONE_PAGE;
|
||||
pfs->minode_table = (1 + pfs->banks) * PFS_ONE_PAGE;
|
||||
pfs->dir_table = pfs->minode_table + (pfs->banks * PFS_ONE_PAGE);
|
||||
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_LABEL_AREA, pfs->label)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 __osCheckId(OSPfs* pfs) {
|
||||
u8 temp[BLOCKSIZE];
|
||||
s32 ret;
|
||||
|
||||
if (pfs->activebank != 0) {
|
||||
ret = __osPfsSelectBank(pfs, 0);
|
||||
if (ret == PFS_ERR_NEW_PACK) {
|
||||
ret = __osPfsSelectBank(pfs, 0);
|
||||
}
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_ID_0AREA, temp)) != 0) {
|
||||
if (ret != PFS_ERR_NEW_PACK) {
|
||||
return ret;
|
||||
}
|
||||
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_ID_0AREA, temp)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (bcmp(pfs->id, temp, BLOCKSIZE) != 0) {
|
||||
return PFS_ERR_NEW_PACK;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 __osPfsRWInode(OSPfs* pfs, __OSInode* inode, u8 flag, u8 bank) {
|
||||
u8 sum;
|
||||
s32 j;
|
||||
s32 ret;
|
||||
s32 offset;
|
||||
u8* addr;
|
||||
|
||||
if (flag == PFS_READ && bank == __osPfsInodeCacheBank && (pfs->channel == __osPfsInodeCacheChannel)) {
|
||||
bcopy(&__osPfsInodeCache, inode, sizeof(__OSInode));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((pfs->activebank != 0) && (ret = __osPfsSelectBank(pfs, 0)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
offset = ((bank > 0) ? 1 : pfs->inodeStartPage);
|
||||
|
||||
if (flag == PFS_WRITE) {
|
||||
inode->inodePage[0].inode_t.page =
|
||||
__osSumcalc((u8*)(inode->inodePage + offset), (PFS_INODE_SIZE_PER_PAGE - offset) * 2);
|
||||
}
|
||||
|
||||
for (j = 0; j < PFS_ONE_PAGE; j++) {
|
||||
addr = (u8*)(((u8*)inode) + (j * BLOCKSIZE));
|
||||
if (flag == PFS_WRITE) {
|
||||
ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->inode_table + (bank * PFS_ONE_PAGE) + j, addr, 0);
|
||||
ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->minode_table + (bank * PFS_ONE_PAGE) + j, addr, 0);
|
||||
} else {
|
||||
ret = __osContRamRead(pfs->queue, pfs->channel, pfs->inode_table + (bank * PFS_ONE_PAGE) + j, addr);
|
||||
}
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag == PFS_READ) {
|
||||
sum = __osSumcalc((u8*)(inode->inodePage + offset), (PFS_INODE_SIZE_PER_PAGE - offset) * 2);
|
||||
if (sum != inode->inodePage[0].inode_t.page) {
|
||||
for (j = 0; j < PFS_ONE_PAGE; j++) {
|
||||
addr = (u8*)(((u8*)inode) + (j * BLOCKSIZE));
|
||||
ret = __osContRamRead(pfs->queue, pfs->channel, pfs->minode_table + (bank * PFS_ONE_PAGE) + j, addr);
|
||||
}
|
||||
sum = __osSumcalc((u8*)(inode->inodePage + offset), (PFS_INODE_SIZE_PER_PAGE - offset) * 2);
|
||||
if (sum != inode->inodePage[0].inode_t.page) {
|
||||
return PFS_ERR_INCONSISTENT;
|
||||
}
|
||||
for (j = 0; j < PFS_ONE_PAGE; j++) {
|
||||
addr = (u8*)(((u8*)inode) + (j * BLOCKSIZE));
|
||||
ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->inode_table + (bank * PFS_ONE_PAGE) + j, addr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
__osPfsInodeCacheBank = bank;
|
||||
bcopy(inode, &__osPfsInodeCache, sizeof(__OSInode));
|
||||
__osPfsInodeCacheChannel = pfs->channel;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+102
-1
@@ -1,3 +1,104 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/devmgr/__osDevMgrMain.s")
|
||||
void __osDevMgrMain(void* arg) {
|
||||
OSIoMesg* ioMesg;
|
||||
OSMesg sp70;
|
||||
OSMesg sp6C; // "dummy"
|
||||
s32 ret;
|
||||
OSDevMgr* devMgr;
|
||||
s32 msgVar = 0;
|
||||
|
||||
devMgr = (OSDevMgr*)arg;
|
||||
ioMesg = NULL;
|
||||
ret = 0;
|
||||
|
||||
while (true) {
|
||||
osRecvMesg(devMgr->cmdQueue, (OSMesg)&ioMesg, OS_MESG_BLOCK);
|
||||
if ((ioMesg->piHandle != NULL) && (ioMesg->piHandle->type == 2) &&
|
||||
((ioMesg->piHandle->transferInfo.cmdType == OS_READ) ||
|
||||
(ioMesg->piHandle->transferInfo.cmdType == OS_WRITE))) {
|
||||
__OSBlockInfo* block;
|
||||
__OSTranxInfo* transfer;
|
||||
|
||||
transfer = &ioMesg->piHandle->transferInfo;
|
||||
block = &transfer->block[transfer->blockNum];
|
||||
transfer->sectorNum = -1;
|
||||
if (transfer->transferMode != 3) {
|
||||
block->dramAddr = (void*)((u32)block->dramAddr - block->sectorSize);
|
||||
}
|
||||
|
||||
if ((transfer->transferMode == 2) && (ioMesg->piHandle->transferInfo.cmdType == OS_READ)) {
|
||||
msgVar = 1;
|
||||
} else {
|
||||
msgVar = 0;
|
||||
}
|
||||
|
||||
osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK);
|
||||
__osResetGlobalIntMask(0x00100401);
|
||||
__osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow | 0x80000000);
|
||||
|
||||
label:
|
||||
osRecvMesg(devMgr->evtQueue, &sp70, OS_MESG_BLOCK);
|
||||
transfer = &ioMesg->piHandle->transferInfo;
|
||||
block = &transfer->block[transfer->blockNum];
|
||||
if (block->errStatus == 0x1D) {
|
||||
u32 status;
|
||||
|
||||
__osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow | 0x10000000);
|
||||
__osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow);
|
||||
__osEPiRawReadIo(ioMesg->piHandle, 0x05000508, &status);
|
||||
if (status & 0x02000000) {
|
||||
__osEPiRawWriteIo(ioMesg->piHandle, 0x05000510, transfer->bmCtlShadow | 0x1000000);
|
||||
}
|
||||
block->errStatus = 4;
|
||||
HW_REG(PI_STATUS_REG, u32) = PI_STATUS_CLEAR_INTR;
|
||||
__osSetGlobalIntMask(0x00100C01);
|
||||
}
|
||||
osSendMesg(ioMesg->hdr.retQueue, (OSMesg)ioMesg, OS_MESG_NOBLOCK);
|
||||
|
||||
if ((msgVar == 1) && (ioMesg->piHandle->transferInfo.block[0].errStatus == 0)) {
|
||||
msgVar = 0;
|
||||
goto label;
|
||||
}
|
||||
|
||||
osSendMesg(devMgr->acsQueue, NULL, OS_MESG_NOBLOCK);
|
||||
if (ioMesg->piHandle->transferInfo.blockNum == 1) {
|
||||
osYieldThread();
|
||||
}
|
||||
} else {
|
||||
switch (ioMesg->hdr.type) {
|
||||
case 11:
|
||||
osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK);
|
||||
ret = devMgr->piDmaCallback(OS_READ, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size);
|
||||
break;
|
||||
case 12:
|
||||
osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK);
|
||||
ret = devMgr->piDmaCallback(OS_WRITE, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size);
|
||||
break;
|
||||
case 15:
|
||||
osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK);
|
||||
ret = devMgr->epiDmaCallback(ioMesg->piHandle, OS_READ, ioMesg->devAddr, ioMesg->dramAddr,
|
||||
ioMesg->size);
|
||||
break;
|
||||
case 16:
|
||||
osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK);
|
||||
ret = devMgr->epiDmaCallback(ioMesg->piHandle, OS_WRITE, ioMesg->devAddr, ioMesg->dramAddr,
|
||||
ioMesg->size);
|
||||
break;
|
||||
case 10:
|
||||
osSendMesg(ioMesg->hdr.retQueue, ioMesg, OS_MESG_NOBLOCK);
|
||||
ret = -1;
|
||||
break;
|
||||
default:
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
osRecvMesg(devMgr->evtQueue, &sp70, OS_MESG_BLOCK);
|
||||
osSendMesg(ioMesg->hdr.retQueue, ioMesg, OS_MESG_NOBLOCK);
|
||||
osSendMesg(devMgr->acsQueue, NULL, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/epilinkhandle/osEPiLinkHandle.s")
|
||||
s32 osEPiLinkHandle(OSPiHandle* handle) {
|
||||
u32 saveMask = __osDisableInt();
|
||||
|
||||
handle->next = __osPiTable;
|
||||
__osPiTable = handle;
|
||||
|
||||
__osRestoreInt(saveMask);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/epirawdma/osEPiRawStartDma.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/epirawdma/__osEPiRawStartDma.s")
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/epirawread/osEPiRawReadIo.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/boot/epirawread/__osEPiRawReadIo.s")
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
#include "ultra64.h"
|
||||
#include "global.h"
|
||||
|
||||
#define BANK_ADDR 0x400
|
||||
#define MOTOR_ID 0x80
|
||||
|
||||
s32 __osPfsSelectBank(OSPfs* pfs, u8 bank);
|
||||
|
||||
s32 osSetRumble(OSPfs* pfs, u32 vibrate) {
|
||||
s32 i;
|
||||
s32 ret;
|
||||
u8* buf = (u8*)&osPifBuffers[pfs->channel];
|
||||
|
||||
if (!(pfs->status & 8)) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
__osSiGetAccess();
|
||||
osPifBuffers[pfs->channel].pifstatus = 1;
|
||||
buf += pfs->channel;
|
||||
for (i = 0; i < BLOCKSIZE; i++) {
|
||||
((__OSContRamReadFormat*)buf)->data[i] = vibrate;
|
||||
}
|
||||
|
||||
__osContLastCmd = CONT_CMD_END;
|
||||
__osSiRawStartDma(OS_WRITE, &osPifBuffers[pfs->channel]);
|
||||
osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK);
|
||||
__osSiRawStartDma(OS_READ, &osPifBuffers[pfs->channel]);
|
||||
osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
ret = ((__OSContRamReadFormat*)buf)->rxsize & 0xC0;
|
||||
if (!ret) {
|
||||
if (!vibrate) {
|
||||
if (((__OSContRamReadFormat*)buf)->datacrc != 0) {
|
||||
ret = PFS_ERR_CONTRFAIL;
|
||||
}
|
||||
} else {
|
||||
if (((__OSContRamReadFormat*)buf)->datacrc != 0xEB) {
|
||||
ret = PFS_ERR_CONTRFAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__osSiRelAccess();
|
||||
|
||||
return ret;
|
||||
}
|
||||
void osSetUpMempakWrite(u32 channel, OSPifRam* buf) {
|
||||
u8* bufptr = (u8*)buf;
|
||||
__OSContRamReadFormat mempakwr;
|
||||
u32 i;
|
||||
|
||||
mempakwr.dummy = 0xFF;
|
||||
mempakwr.txsize = 0x23;
|
||||
mempakwr.rxsize = 1;
|
||||
mempakwr.cmd = 3; // write mempak
|
||||
mempakwr.hi = 0x600 >> 3;
|
||||
mempakwr.lo = (u8)(__osContAddressCrc(0x600) | (0x600 << 5));
|
||||
|
||||
if (channel != 0) {
|
||||
for (i = 0; i < channel; i++) {
|
||||
*bufptr++ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
*(__OSContRamReadFormat*)bufptr = mempakwr;
|
||||
bufptr += sizeof(mempakwr);
|
||||
*bufptr = 0xFE;
|
||||
}
|
||||
|
||||
s32 osProbeRumblePak(OSMesgQueue* ctrlrqueue, OSPfs* pfs, u32 channel) {
|
||||
s32 ret;
|
||||
u8 sp24[BLOCKSIZE];
|
||||
|
||||
pfs->queue = ctrlrqueue;
|
||||
pfs->channel = channel;
|
||||
pfs->activebank = 0xFF;
|
||||
pfs->status = 0;
|
||||
|
||||
ret = __osPfsSelectBank(pfs, 0xFE);
|
||||
if (ret == 2) {
|
||||
ret = __osPfsSelectBank(pfs, MOTOR_ID);
|
||||
}
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
ret = __osContRamRead(ctrlrqueue, channel, 0x400, sp24);
|
||||
if (ret == 2) {
|
||||
ret = 4; // "Controller pack communication error"
|
||||
}
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
if (sp24[BLOCKSIZE - 1] == 0xFE) {
|
||||
return 0xB;
|
||||
}
|
||||
ret = __osPfsSelectBank(pfs, MOTOR_ID);
|
||||
if (ret == 2) {
|
||||
ret = 4; // "Controller pack communication error"
|
||||
}
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
ret = __osContRamRead(ctrlrqueue, channel, BANK_ADDR, sp24);
|
||||
if (ret == 2) {
|
||||
ret = 4; // "Controller pack communication error"
|
||||
}
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
if (sp24[BLOCKSIZE - 1] != MOTOR_ID) {
|
||||
return 0xB;
|
||||
}
|
||||
if ((pfs->status & PFS_MOTOR_INITIALIZED) == 0) {
|
||||
osSetUpMempakWrite(channel, &osPifBuffers[channel]);
|
||||
}
|
||||
pfs->status = PFS_MOTOR_INITIALIZED;
|
||||
|
||||
return 0; // "Recognized rumble pak"
|
||||
}
|
||||
@@ -31,9 +31,9 @@ void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgC
|
||||
__osPiDevMgr.cmdQueue = cmdQ;
|
||||
__osPiDevMgr.evtQueue = &D_8009E3D0;
|
||||
__osPiDevMgr.acsQueue = &__osPiAccessQueue;
|
||||
__osPiDevMgr.piDmaCallback = osPiRawStartDma;
|
||||
__osPiDevMgr.epiDmaCallback = osEPiRawStartDma;
|
||||
osCreateThread(&D_8009D220, 0, __osDevMgrMain, &__osPiDevMgr, &piManagerStack[0x1000], pri);
|
||||
__osPiDevMgr.piDmaCallback = __osPiRawStartDma;
|
||||
__osPiDevMgr.epiDmaCallback = __osEPiRawStartDma;
|
||||
osCreateThread(&D_8009D220, 0, __osDevMgrMain, (void*)&__osPiDevMgr, &piManagerStack[4096], pri);
|
||||
osStartThread(&D_8009D220);
|
||||
__osRestoreInt(savedMask);
|
||||
if (oldPri != -1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
s32 osPiRawStartDma(s32 direction, u32 devAddr, void* dramAddr, u32 size) {
|
||||
s32 __osPiRawStartDma(s32 direction, u32 devAddr, void* dramAddr, size_t size) {
|
||||
register int stat;
|
||||
|
||||
stat = *(vu32*)0xA4600010;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, u32 size) {
|
||||
s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, size_t size) {
|
||||
if (__osSpDeviceBusy() != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "string.h"
|
||||
#include "global.h"
|
||||
|
||||
const char* strchr(const char* s, int c) {
|
||||
const unsigned char ch = c;
|
||||
|
||||
@@ -300,14 +300,14 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) {
|
||||
SysMatrix_MultiplyVector3fByState(&D_808C1C10, &this->unk1E0);
|
||||
SysMatrix_MultiplyVector3fByState(&D_808C1C28, &sp5C);
|
||||
SysMatrix_MultiplyVector3fByState(&D_808C1C34, &sp50);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C10, &this->unk1E0);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C28, &sp5C);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C34, &sp50);
|
||||
this->unk1C4 = 0;
|
||||
} else {
|
||||
SysMatrix_MultiplyVector3fByState(&D_808C1C1C, &this->unk1E0);
|
||||
SysMatrix_MultiplyVector3fByState(&D_808C1C40, &sp5C);
|
||||
SysMatrix_MultiplyVector3fByState(&D_808C1C4C, &sp50);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C1C, &this->unk1E0);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C40, &sp5C);
|
||||
Matrix_MultiplyVector3fByState(&D_808C1C4C, &sp50);
|
||||
}
|
||||
func_80126440(globalCtx, &this->collider.base, &this->unk1C4, &sp5C, &sp50);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
@@ -315,13 +315,13 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_0601D960);
|
||||
SysMatrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Math_Vec3f_Diff(&player->rightHandWorld.pos, &this->actor.world.pos, &sp68);
|
||||
sp48 = SQXZ(sp68);
|
||||
sp4C = sqrtf(SQXZ(sp68));
|
||||
Matrix_RotateY(Math_Atan2S(sp68.x, sp68.z), MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(Math_Atan2S(-sp68.y, sp4C), MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(Math_Atan2S(-sp68.y, sp4C), MTXMODE_APPLY);
|
||||
f0 = sqrtf(SQ(sp68.y) + sp48);
|
||||
Matrix_Scale(0.015f, 0.015f, f0 * 0.01f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -200,11 +200,10 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
SysMatrix_InsertTranslation(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(transform->world.pos.x, transform->world.pos.y, transform->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(transform->shape.rot.y, MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(transform->shape.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(transform->shape.rot.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
|
||||
// Draw blue effect over the screen when arrow hits
|
||||
@@ -222,14 +221,14 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 170, 255, 255, (s32)(this->alpha * 0.5f) & 0xFF);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 128);
|
||||
SysMatrix_InsertRotation(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
Matrix_InsertRotation(0x4000, 0, 0, MTXMODE_APPLY);
|
||||
if (this->timer != 0) {
|
||||
SysMatrix_InsertTranslation(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
} else {
|
||||
SysMatrix_InsertTranslation(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 1500.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
Matrix_Scale(this->radius * 0.2f, this->height * 3.0f, this->radius * 0.2f, MTXMODE_APPLY);
|
||||
SysMatrix_InsertTranslation(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, sIceArrowDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++,
|
||||
|
||||
@@ -90,14 +90,14 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
|
||||
rotZ = this->dyna.actor.shape.rot.z & 0x1FFF;
|
||||
if ((flags != 0) && (rotZ < 0x1B58) && (rotZ >= 0x1388)) {
|
||||
Matrix_RotateY(this->dyna.actor.home.rot.y, 0);
|
||||
SysMatrix_InsertXRotation_s(this->dyna.actor.home.rot.x, 1);
|
||||
SysMatrix_InsertZRotation_s(this->dyna.actor.home.rot.z, 1);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, 1);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, 1);
|
||||
for (i = 0; i < 4; i++) {
|
||||
if ((u32)Rand_Next() >= 0x40000000) {
|
||||
splashOffset.x = D_80AD3270[i].x - (Rand_ZeroOne() * 30.0f);
|
||||
splashOffset.y = D_80AD3270[i].y;
|
||||
splashOffset.z = D_80AD3270[i].z;
|
||||
SysMatrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
|
||||
Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
|
||||
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
splashSpawnPos.y += this->dyna.actor.world.pos.y;
|
||||
splashSpawnPos.z += this->dyna.actor.world.pos.z + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
@@ -108,14 +108,14 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
|
||||
if ((rotZ < 0x1F4) && (rotZ >= 0)) {
|
||||
if (flags != 0) {
|
||||
Matrix_RotateY(this->dyna.actor.home.rot.y, 0);
|
||||
SysMatrix_InsertXRotation_s(this->dyna.actor.home.rot.x, 1);
|
||||
SysMatrix_InsertZRotation_s(this->dyna.actor.home.rot.z, 1);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, 1);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, 1);
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
splashOffset.x = D_80AD32A0[i].x + (Rand_ZeroOne() * 10.0f);
|
||||
splashOffset.y = D_80AD32A0[i].y;
|
||||
splashOffset.z = D_80AD32A0[i].z;
|
||||
SysMatrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
|
||||
Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
|
||||
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
splashSpawnPos.y += this->dyna.actor.world.pos.y;
|
||||
splashSpawnPos.z += this->dyna.actor.world.pos.z + ((Rand_ZeroOne() * 20.0f) - 10.0f);
|
||||
|
||||
@@ -116,9 +116,9 @@ void BgHakaTomb_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_NEW);
|
||||
SysMatrix_InsertXRotation_s(this->dyna.actor.world.rot.x, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->dyna.actor.world.rot.z, MTXMODE_APPLY);
|
||||
SysMatrix_MultiplyVector3fByState(&D_80BD68A4, &vec);
|
||||
Matrix_InsertXRotation_s(this->dyna.actor.world.rot.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->dyna.actor.world.rot.z, MTXMODE_APPLY);
|
||||
Matrix_MultiplyVector3fByState(&D_80BD68A4, &vec);
|
||||
Math_Vec3f_Sum(&this->dyna.actor.world.pos, &vec, &this->dyna.actor.focus.pos);
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ BgHakuginPostUnkStruct1* func_80A9B32C(BgHakuginPostUnkStruct* unkStruct, BgHaku
|
||||
}
|
||||
|
||||
void func_80A9B384(Vec3f* arg0) {
|
||||
MtxF* matrix = SysMatrix_GetCurrentState();
|
||||
MtxF* matrix = Matrix_GetCurrentState();
|
||||
|
||||
matrix->mf[3][0] = arg0->x;
|
||||
matrix->mf[3][1] = arg0->y;
|
||||
@@ -1013,8 +1013,8 @@ void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
SysMatrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < D_80A9E028.count; i++) {
|
||||
@@ -1035,8 +1035,8 @@ void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx) {
|
||||
for (i = 0; i < ARRAY_COUNT(D_80A9E028.unk_02A4); i++) {
|
||||
unkStruct2 = &D_80A9E028.unk_02A4[i];
|
||||
if (unkStruct2->unk_2C > 0) {
|
||||
SysMatrix_SetStateRotationAndTranslation(unkStruct2->unk_04.x, unkStruct2->unk_04.y,
|
||||
unkStruct2->unk_04.z, &unkStruct2->unk_20);
|
||||
Matrix_SetStateRotationAndTranslation(unkStruct2->unk_04.x, unkStruct2->unk_04.y, unkStruct2->unk_04.z,
|
||||
&unkStruct2->unk_20);
|
||||
Matrix_Scale(unkStruct2->unk_00, unkStruct2->unk_00, unkStruct2->unk_00, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
|
||||
@@ -138,11 +138,11 @@ void BgKin2Fence_SpawnEyeSparkles(BgKin2Fence* this, GlobalContext* globalCtx, s
|
||||
Vec3f sp58;
|
||||
s32 pad[2];
|
||||
|
||||
SysMatrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
SysMatrix_MultiplyVector3fByState(&eyeSparkleSpawnPositions[mask][i], &sp58);
|
||||
Matrix_MultiplyVector3fByState(&eyeSparkleSpawnPositions[mask][i], &sp58);
|
||||
EffectSsKiraKira_SpawnDispersed(globalCtx, &sp58, &D_801D15B0, &D_801D15B0, &primColor, &envColor, 6000, -10);
|
||||
}
|
||||
}
|
||||
@@ -156,9 +156,9 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000908);
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
|
||||
SysMatrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, 1);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
|
||||
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
Collider_UpdateSpheres(i, &this->collider);
|
||||
|
||||
@@ -72,7 +72,7 @@ void DmNb_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DmNb* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008C40, NULL, this->limbDrawTable, this->transitionDrawTable, 8);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008C40, NULL, this->jointTable, this->morphTable, 8);
|
||||
this->unk1F0 = -1;
|
||||
func_80C1DED0(this, 0);
|
||||
this->actor.flags &= ~1;
|
||||
@@ -87,17 +87,17 @@ void DmNb_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DmNb* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 0x4);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
|
||||
}
|
||||
|
||||
void DmNb_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* actor) {
|
||||
void DmNb_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
|
||||
}
|
||||
|
||||
void DmNb_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DmNb* this = THIS;
|
||||
|
||||
func_8012C5B0(globalCtx->state.gfxCtx);
|
||||
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL,
|
||||
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
|
||||
NULL, DmNb_UnkActorDraw, &this->actor);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ typedef struct DmNb {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ DmNbActionFunc actionFunc;
|
||||
/* 0x18C */ Vec3s limbDrawTable[8];
|
||||
/* 0x1BC */ Vec3s transitionDrawTable[8];
|
||||
/* 0x18C */ Vec3s jointTable[8];
|
||||
/* 0x1BC */ Vec3s morphTable[8];
|
||||
/* 0x1EC */ u8 unk1EC;
|
||||
/* 0x1F0 */ s32 unk1F0;
|
||||
/* 0x1F4 */ s32 unk1F4;
|
||||
|
||||
@@ -33,12 +33,12 @@ void func_80A2E960(SkelAnime* arg0, ActorAnimationEntry* animations, u16 index)
|
||||
animations += index;
|
||||
|
||||
if (animations->frameCount < 0.0f) {
|
||||
frameCount = SkelAnime_GetFrameCount(&animations->animation->common);
|
||||
frameCount = Animation_GetLastFrame(animations->animation);
|
||||
} else {
|
||||
frameCount = animations->frameCount;
|
||||
}
|
||||
SkelAnime_ChangeAnim(arg0, animations->animation, animations->playSpeed, animations->startFrame, frameCount,
|
||||
animations->mode, animations->morphFrames);
|
||||
Animation_Change(arg0, animations->animation, animations->playSpeed, animations->startFrame, frameCount,
|
||||
animations->mode, animations->morphFrames);
|
||||
}
|
||||
|
||||
void DmSa_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -48,7 +48,7 @@ void DmSa_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->alpha = 0xFF;
|
||||
this->actor.targetArrowOffset = 3000.0f;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06013328, NULL, 0, 0, 0);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, 0, 0, 0);
|
||||
func_80A2E960(&this->skelAnime, D_80A2ED00, 0);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actionFunc = DmSa_DoNothing;
|
||||
@@ -63,7 +63,7 @@ void DmSa_DoNothing(DmSa* this, GlobalContext* globalCtx) {
|
||||
void DmSa_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
DmSa* this = THIS;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->alpha += 0;
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ void DmSa_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0C, func_80A2EBB0(globalCtx->state.gfxCtx, this->alpha));
|
||||
}
|
||||
|
||||
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
func_80A2EB10, func_80A2EB2C, func_80A2EB44, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -281,14 +281,14 @@ void func_80919768(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
for (i = 0; i < ARRAY_COUNT(this->distanceTraveled); i++) {
|
||||
if (*distanceTraveled < 1.0f) {
|
||||
aux = 1.0f - SQ(*distanceTraveled);
|
||||
SysMatrix_InsertTranslation(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(sp92, MTXMODE_APPLY);
|
||||
SysMatrix_InsertTranslation(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
initialPositions->y * ((this->dy * aux) + (1.0f - this->dy)),
|
||||
initialPositions->z * ((this->dz * aux) + (1.0f - this->dz)), MTXMODE_APPLY);
|
||||
Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, 1);
|
||||
Matrix_InsertTranslation(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
initialPositions->y * ((this->dy * aux) + (1.0f - this->dy)),
|
||||
initialPositions->z * ((this->dz * aux) + (1.0f - this->dz)), MTXMODE_APPLY);
|
||||
Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY);
|
||||
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -337,15 +337,15 @@ void func_809199FC(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (*distanceTraveled * 255.0f));
|
||||
|
||||
aux = 1.0f - SQ(*distanceTraveled);
|
||||
SysMatrix_InsertMatrix(&player->mf_CC4, MTXMODE_NEW);
|
||||
SysMatrix_InsertTranslation(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
(initialPositions->y * (1.0f - *distanceTraveled)) + 320.0f,
|
||||
(initialPositions->z * (1.0f - *distanceTraveled)) + -20.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertMatrix(&player->mf_CC4, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
(initialPositions->y * (1.0f - *distanceTraveled)) + 320.0f,
|
||||
(initialPositions->z * (1.0f - *distanceTraveled)) + -20.0f, MTXMODE_APPLY);
|
||||
|
||||
Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor,
|
||||
*distanceTraveled * this->scalingFactor, MTXMODE_APPLY);
|
||||
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
|
||||
|
||||
@@ -69,7 +69,7 @@ void EnBaisen_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBaisen* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20);
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
this->paramCopy = this->actor.params;
|
||||
if (this->actor.params == 0) {
|
||||
@@ -103,9 +103,9 @@ void EnBaisen_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
void EnBaisen_ChangeAnimation(EnBaisen* this, s32 animIndex) {
|
||||
this->animIndex = animIndex;
|
||||
this->frameCount = SkelAnime_GetFrameCount(&D_80BE8E4C[animIndex]->common);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, D_80BE8E4C[this->animIndex], 1.0f, 0.0f, this->frameCount,
|
||||
animModes[this->animIndex], -10.0f);
|
||||
this->frameCount = Animation_GetLastFrame(D_80BE8E4C[animIndex]);
|
||||
Animation_Change(&this->skelAnime, D_80BE8E4C[this->animIndex], 1.0f, 0.0f, this->frameCount,
|
||||
animModes[this->animIndex], -10.0f);
|
||||
}
|
||||
|
||||
void func_80BE871C(EnBaisen* this) {
|
||||
@@ -201,7 +201,7 @@ void func_80BE89D8(EnBaisen* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
if ((globalCtx->msgCtx.unk11F04 == 0x2AC6) || (globalCtx->msgCtx.unk11F04 == 0x2AC7) ||
|
||||
(globalCtx->msgCtx.unk11F04 == 0x2AC8)) {
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
this->unk29E = this->actor.yawTowardsPlayer;
|
||||
}
|
||||
if (this->unk2AC == 2) { // Note: This variable is only ever set to 1.
|
||||
@@ -244,7 +244,7 @@ void EnBaisen_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
EnBaisen* this = THIS;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->unusedCounter != 0) {
|
||||
this->unusedCounter--;
|
||||
}
|
||||
@@ -284,6 +284,6 @@ void EnBaisen_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBaisen* this = THIS;
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnBaisen_OverrideLimbDraw, NULL, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnBaisen_OverrideLimbDraw, NULL, &this->actor);
|
||||
}
|
||||
|
||||
@@ -74,8 +74,6 @@ void EnBigpo_WaitingForDampe(EnBigpo* this, GlobalContext* globalCtx);
|
||||
void EnBigpo_RevealedFireGrowing(EnBigpo* this, GlobalContext* globalCtx);
|
||||
|
||||
// draw funcs
|
||||
void EnBigpo_PostLimbDraw(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, struct Actor* actor,
|
||||
Gfx** gfx);
|
||||
void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx);
|
||||
@@ -404,7 +402,7 @@ void EnBigpo_SpawnCutsceneStage4(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
* big poe starts to visibly appear
|
||||
*/
|
||||
void EnBigpo_SpawnCutsceneStage5(EnBigpo* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_06001360);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_06001360);
|
||||
this->actor.draw = EnBigpo_DrawMainBigpo;
|
||||
Actor_SetScale(&this->actor, 0.014f);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR);
|
||||
@@ -419,7 +417,7 @@ void EnBigpo_SpawnCutsceneStage6(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
s32 alphaPlus; // color alpha + 10
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->actor.shape.rot.y += this->rotVelocity;
|
||||
alphaPlus = this->mainColor.a + 10; // decrease transparency
|
||||
func_80B61914(this);
|
||||
@@ -466,7 +464,7 @@ void EnBigpo_SpawnCutsceneStage8(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Actor* dampe;
|
||||
Camera* subCam;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->idleTimer--;
|
||||
if (this->idleTimer == 0) {
|
||||
subCam = Play_GetCamera(globalCtx, this->cutsceneSubCamId);
|
||||
@@ -518,7 +516,7 @@ void EnBigpo_SetupWarpIn(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
s16 randomYaw = (Rand_Next() >> 0x14) + this->actor.yawTowardsPlayer;
|
||||
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKIDS_APPEAR);
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_06001360);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_06001360);
|
||||
this->rotVelocity = 0x2000;
|
||||
this->actor.world.pos.x = (Math_SinS(randomYaw) * distance) + player->actor.world.pos.x;
|
||||
this->actor.world.pos.z = (Math_CosS(randomYaw) * distance) + player->actor.world.pos.z;
|
||||
@@ -545,7 +543,7 @@ void EnBigpo_WarpingIn(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnBigpo_SetupIdleFlying(EnBigpo* this) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06000924, -5.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06000924, -5.0f);
|
||||
// if poe missed attack, idle 4 seconds, otherwise its reappearing: attack immediately
|
||||
this->idleTimer = (this->actionFunc == EnBigpo_SpinningDown) ? 80 : 0;
|
||||
this->hoverHeightCycleTimer = 40;
|
||||
@@ -561,7 +559,7 @@ void EnBigpo_SetupIdleFlying(EnBigpo* this) {
|
||||
void EnBigpo_IdleFlying(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
DECR(this->idleTimer);
|
||||
|
||||
// flight position calculations
|
||||
@@ -596,7 +594,7 @@ void EnBigpo_SetupSpinUp(EnBigpo* this) {
|
||||
}
|
||||
|
||||
void EnBigpo_SpinningUp(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->rotVelocity += 0x200;
|
||||
EnBigpo_UpdateSpin(this);
|
||||
if (this->rotVelocity >= 0x3C00) {
|
||||
@@ -614,7 +612,7 @@ void EnBigpo_SpinAttack(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
s16 yawDiff;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_StepToF(&this->actor.speedXZ, 10.0f, 1.0f);
|
||||
Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 0.3f, 7.5f, 1.0f);
|
||||
EnBigpo_UpdateSpin(this);
|
||||
@@ -638,7 +636,7 @@ void EnBigpo_SetupSpinDown(EnBigpo* this) {
|
||||
void EnBigpo_SpinningDown(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y + 100.0f, 0.3f, 5.0f, 1.0f);
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
|
||||
if (Math_ScaledStepToS(&this->rotVelocity, 0, 0x200)) {
|
||||
@@ -656,7 +654,7 @@ void EnBigpo_SpinningDown(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
* called by EnBigpo_ApplyDamage
|
||||
*/
|
||||
void EnBigpo_HitStun(EnBigpo* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000454, -6.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06000454, -6.0f);
|
||||
func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 0x10);
|
||||
this->collider.base.acFlags &= ~AC_ON;
|
||||
func_800BE504(&this->actor, &this->collider);
|
||||
@@ -669,7 +667,7 @@ void EnBigpo_HitStun(EnBigpo* this) {
|
||||
*/
|
||||
void EnBigpo_CheckHealth(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
EnBigpo_SetupDeath(this);
|
||||
} else {
|
||||
@@ -1231,8 +1229,8 @@ void EnBigpo_UpdateFire(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
s32 EnBigpo_OverrideLimbDraw(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
struct Actor* actor, Gfx** gfx) {
|
||||
s32 EnBigpo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor,
|
||||
Gfx** gfx) {
|
||||
EnBigpo* this = (EnBigpo*)actor;
|
||||
// not fully invisible
|
||||
if (!(this->mainColor.a != 0 && limbIndex != 7) ||
|
||||
@@ -1259,36 +1257,37 @@ void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
|
||||
if (limbIndex == 7) {
|
||||
// we scale the vec3f... then do nothing with it?
|
||||
SysMatrix_GetStateTranslationAndScaledY(1400.0f, &unusedVec);
|
||||
Matrix_GetStateTranslationAndScaledY(1400.0f, &unusedVec);
|
||||
if ((this->actionFunc == EnBigpo_BurnAwayDeath) && (this->idleTimer > 18)) {
|
||||
if (actor->scale.x != 0.0f) {
|
||||
Matrix_Scale(0.014f / actor->scale.x, 0.014f / actor->scale.x, 0.014f / actor->scale.x, 1);
|
||||
if (this->actor.scale.x != 0.0f) {
|
||||
Matrix_Scale(0.014f / this->actor.scale.x, 0.014f / this->actor.scale.x, 0.014f / this->actor.scale.x,
|
||||
1);
|
||||
}
|
||||
}
|
||||
SysMatrix_CopyCurrentState(&this->drawMtxF);
|
||||
Matrix_CopyCurrentState(&this->drawMtxF);
|
||||
}
|
||||
|
||||
limbByte = D_80B65078[limbIndex];
|
||||
if (limbByte != -1) {
|
||||
if (limbByte < 3) {
|
||||
SysMatrix_GetStateTranslation(&this->limbPos[limbByte]);
|
||||
Matrix_GetStateTranslation(&this->limbPos[limbByte]);
|
||||
return;
|
||||
}
|
||||
if (limbByte == 3) {
|
||||
SysMatrix_GetStateTranslationAndScaledX(3000.0f, &this->limbPos[limbByte]);
|
||||
Matrix_GetStateTranslationAndScaledX(3000.0f, &this->limbPos[limbByte]);
|
||||
return;
|
||||
}
|
||||
if (limbByte == 4) {
|
||||
SysMatrix_GetStateTranslationAndScaledY(-2000.0f, &this->limbPos[limbByte]);
|
||||
Matrix_GetStateTranslationAndScaledY(-2000.0f, &this->limbPos[limbByte]);
|
||||
return;
|
||||
}
|
||||
|
||||
v2ptr = &this->limbPos[limbByte + 1];
|
||||
v1ptr = D_80B65084;
|
||||
SysMatrix_GetStateTranslationAndScaledX(-4000.0f, &this->limbPos[limbByte]);
|
||||
Matrix_GetStateTranslationAndScaledX(-4000.0f, &this->limbPos[limbByte]);
|
||||
|
||||
for (i = limbByte + 1; i < ARRAY_COUNT(this->limbPos); i++) {
|
||||
SysMatrix_MultiplyVector3fByState(v1ptr, v2ptr);
|
||||
Matrix_MultiplyVector3fByState(v1ptr, v2ptr);
|
||||
v2ptr++;
|
||||
v1ptr++;
|
||||
}
|
||||
@@ -1310,8 +1309,8 @@ void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(&dispHead[2], 0x08,
|
||||
Gfx_EnvColor(globalCtx->state.gfxCtx, this->mainColor.r, this->mainColor.g, this->mainColor.b,
|
||||
this->mainColor.a));
|
||||
POLY_OPA_DISP = SkelAnime_Draw2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
EnBigpo_OverrideLimbDraw, EnBigpo_PostLimbDraw, &this->actor, &dispHead[3]);
|
||||
POLY_OPA_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
EnBigpo_OverrideLimbDraw, EnBigpo_PostLimbDraw, &this->actor, &dispHead[3]);
|
||||
|
||||
} else {
|
||||
dispHead = POLY_XLU_DISP;
|
||||
@@ -1320,15 +1319,15 @@ void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(&dispHead[2], 0x08,
|
||||
Gfx_EnvColor(globalCtx->state.gfxCtx, this->mainColor.r, this->mainColor.g, this->mainColor.b,
|
||||
this->mainColor.a));
|
||||
POLY_XLU_DISP = SkelAnime_Draw2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
EnBigpo_OverrideLimbDraw, EnBigpo_PostLimbDraw, &this->actor, &dispHead[3]);
|
||||
POLY_XLU_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
EnBigpo_OverrideLimbDraw, EnBigpo_PostLimbDraw, &this->actor, &dispHead[3]);
|
||||
}
|
||||
|
||||
// 71.428566f might be 500/7 context unknown
|
||||
func_800BE680(globalCtx, &this->actor, this->limbPos, 9, this->actor.scale.x * 71.428566f * this->unk220, 0,
|
||||
this->unk21C, 0x14);
|
||||
|
||||
SysMatrix_SetCurrentState(&this->drawMtxF);
|
||||
Matrix_SetCurrentState(&this->drawMtxF);
|
||||
EnBigpo_DrawLantern(&this->actor, globalCtx);
|
||||
if (this->actionFunc == EnBigpo_SpawnCutsceneStage6) {
|
||||
EnBigpo_DrawCircleFlames(&this->actor, globalCtx);
|
||||
@@ -1404,7 +1403,7 @@ void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
gSPSegment(&dispHead[1], 0x0A, Gfx_EnvColor(globalCtx->state.gfxCtx, 160, 0, 255, this->mainColor.a));
|
||||
|
||||
SysMatrix_GetStateTranslationAndScaledY(1400.0f, &vec2);
|
||||
Matrix_GetStateTranslationAndScaledY(1400.0f, &vec2);
|
||||
Lights_PointGlowSetInfo(&this->fires[0].info, vec2.x + vec1.x, vec2.y + vec1.y, vec2.z + vec1.z,
|
||||
this->lanternColor.r, this->lanternColor.g, this->lanternColor.b, this->lanternColor.a);
|
||||
|
||||
@@ -1433,7 +1432,7 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {
|
||||
MtxF* mtfxPtr;
|
||||
s32 i;
|
||||
|
||||
mtfxPtr = SysMatrix_GetCurrentState();
|
||||
mtfxPtr = Matrix_GetCurrentState();
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -26,9 +26,8 @@ void func_809CD6C0(EnBji01* this, GlobalContext* globalCtx);
|
||||
void func_809CD70C(EnBji01* this, GlobalContext* globalCtx);
|
||||
void func_809CD77C(EnBji01* this, GlobalContext* globalCtx);
|
||||
|
||||
s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* actor);
|
||||
void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor);
|
||||
s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg);
|
||||
void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg);
|
||||
|
||||
extern AnimationHeader D_06000FDC;
|
||||
extern AnimationHeader D_06005B58;
|
||||
@@ -297,7 +296,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
|
||||
func_809CCE98(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
if ((this->animationIndex == 3) && (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount)) {
|
||||
if ((this->animationIndex == 3) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) {
|
||||
func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
|
||||
}
|
||||
}
|
||||
@@ -339,8 +338,8 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBji01* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600578C, &D_06000FDC, this->jointTable, this->morphTable,
|
||||
BJI_LIMB_MAX);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600578C, &D_06000FDC, this->jointTable, this->morphTable,
|
||||
BJI_LIMB_MAX);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
@@ -386,7 +385,7 @@ void EnBji01_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, (Actor*)this, 0.0f, 0.0f, 0.0f, 4U);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->blinkTimer-- <= 0) {
|
||||
if (--this->blinkSeqIndex < 0) {
|
||||
@@ -438,7 +437,7 @@ void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
sp20.x += temp_f4 * 0.1f;
|
||||
sp20.y += temp_f4 * 0.1f;
|
||||
sp20.z += temp_f4 * 0.1f;
|
||||
SysMatrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
Matrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +448,7 @@ void EnBji01_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex]));
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnBji01_OverrideLimbDraw, EnBji01_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnBji01_OverrideLimbDraw, EnBji01_PostLimbDraw, &this->actor);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ void EnBu_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
SysMatrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0);
|
||||
SysMatrix_InsertZRotation_s(this->actor.shape.rot.z, 1);
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_InsertZRotation_s(this->actor.shape.rot.z, 1);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, 1);
|
||||
SysMatrix_InsertXRotation_s(this->actor.shape.rot.x, 1);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, 1);
|
||||
Matrix_InsertXRotation_s(this->actor.shape.rot.x, 1);
|
||||
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, this->displayListPtr);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ void EnCha_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnCha* this = THIS;
|
||||
|
||||
func_800BDFC0(globalCtx, D_06000710);
|
||||
SysMatrix_InsertTranslation(-1094.0f, 4950.0f, 9.0f, 1);
|
||||
SysMatrix_InsertXRotation_s(this->actor.home.rot.x, 1);
|
||||
Matrix_InsertTranslation(-1094.0f, 4950.0f, 9.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->actor.home.rot.x, 1);
|
||||
func_800BDFC0(globalCtx, D_06000958);
|
||||
}
|
||||
|
||||
@@ -416,9 +416,9 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
for (i = 0; i < 54; i++) {
|
||||
lightRayMaxScale =
|
||||
sLightRayMaxScale[thisx->params] + Rand_ZeroFloat(sLightRayMaxScale[thisx->params]);
|
||||
SysMatrix_InsertYRotation_f(Rand_ZeroFloat(M_PI * 2), 0);
|
||||
SysMatrix_RotateStateAroundXAxis(Rand_ZeroFloat(M_PI * 2));
|
||||
SysMatrix_GetStateTranslationAndScaledZ(lightRayMaxScale, &vel);
|
||||
Matrix_InsertYRotation_f(Rand_ZeroFloat(M_PI * 2), 0);
|
||||
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(M_PI * 2));
|
||||
Matrix_GetStateTranslationAndScaledZ(lightRayMaxScale, &vel);
|
||||
accel.x = vel.x * -0.03f;
|
||||
accel.y = vel.y * -0.03f;
|
||||
accel.z = vel.z * -0.03f;
|
||||
@@ -489,9 +489,9 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
pos = this->actor.world.pos;
|
||||
for (i = 0; i < 44; i++) {
|
||||
lightRayMaxScale = sLightRayMaxScale[thisx->params] + Rand_ZeroFloat(sLightRayMaxScale[thisx->params]);
|
||||
SysMatrix_InsertYRotation_f(Rand_ZeroFloat(2 * M_PI), 0);
|
||||
SysMatrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI));
|
||||
SysMatrix_GetStateTranslationAndScaledZ(lightRayMaxScale, &vel);
|
||||
Matrix_InsertYRotation_f(Rand_ZeroFloat(2 * M_PI), 0);
|
||||
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI));
|
||||
Matrix_GetStateTranslationAndScaledZ(lightRayMaxScale, &vel);
|
||||
accel.x = vel.x * -0.03f;
|
||||
accel.y = vel.y * -0.03f;
|
||||
accel.z = vel.z * -0.03f;
|
||||
@@ -798,10 +798,10 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
// Draw the debris effect.
|
||||
SysMatrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
|
||||
SysMatrix_InsertYRotation_f(effect->rotationY, MTXMODE_APPLY);
|
||||
SysMatrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
Matrix_InsertYRotation_f(effect->rotationY, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gClearTagDebrisEffectDL);
|
||||
}
|
||||
@@ -817,7 +817,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, (s8)effect->primColor.a);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s8)effect->primColor.a);
|
||||
func_800C0094(this->actor.floorPoly, effect->position.x, effect->position.y, effect->position.z, &mtxF);
|
||||
SysMatrix_SetCurrentState(&mtxF);
|
||||
Matrix_SetCurrentState(&mtxF);
|
||||
Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_04030100);
|
||||
@@ -842,7 +842,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, (s8)(effect->primColor.a * 0.7f));
|
||||
func_800C0094(this->actor.floorPoly, effect->position.x, this->actor.floorHeight, effect->position.z,
|
||||
&mtxF);
|
||||
SysMatrix_SetCurrentState(&mtxF);
|
||||
Matrix_SetCurrentState(&mtxF);
|
||||
Matrix_Scale(effect->scale * 3.0f, 1.0f, effect->scale * 3.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFlashEffectGroundDL);
|
||||
@@ -870,10 +870,10 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(
|
||||
POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, -effect->actionTimer * 5, 32, 64, 1, 0, 0, 32, 32));
|
||||
SysMatrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(effect->smokeScaleX * effect->scale, effect->smokeScaleY * effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
SysMatrix_InsertTranslation(0.0f, 20.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, 20.0f, 0.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFireEffectDL);
|
||||
}
|
||||
@@ -896,8 +896,8 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(
|
||||
POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, -effect->actionTimer * 15, 32, 64, 1, 0, 0, 32, 32));
|
||||
SysMatrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(effect->scale, effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFireEffectDL);
|
||||
@@ -918,8 +918,8 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
// Draw the flash billboard effect.
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 200, (s8)effect->primColor.a);
|
||||
SysMatrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(2.0f * effect->scale, 2.0f * effect->scale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagFlashEffectDL);
|
||||
@@ -943,12 +943,12 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
// Draw the light ray effect.
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, (u8)effect->primColor.r, (u8)effect->primColor.g,
|
||||
(u8)effect->primColor.b, (u8)effect->primColor.a);
|
||||
SysMatrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
SysMatrix_InsertYRotation_f(effect->rotationY, MTXMODE_APPLY);
|
||||
SysMatrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
SysMatrix_InsertZRotation_f(effect->rotationZ, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(effect->position.x, effect->position.y, effect->position.z, MTXMODE_NEW);
|
||||
Matrix_InsertYRotation_f(effect->rotationY, MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
Matrix_InsertZRotation_f(effect->rotationZ, MTXMODE_APPLY);
|
||||
Matrix_Scale(effect->scale * 0.5f, effect->scale * 0.5f, effect->maxScale * effect->scale, MTXMODE_APPLY);
|
||||
SysMatrix_RotateStateAroundXAxis(M_PI / 2);
|
||||
Matrix_RotateStateAroundXAxis(M_PI / 2);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gClearTagLightRayEffectDL);
|
||||
}
|
||||
@@ -968,8 +968,8 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
// Apply material 16 times along a circle to give the appearance of a splash
|
||||
for (j = 0; j < 16; j++) {
|
||||
SysMatrix_InsertYRotation_f(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_NEW);
|
||||
SysMatrix_GetStateTranslationAndScaledZ(effect->maxScale, &vec);
|
||||
Matrix_InsertYRotation_f(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_NEW);
|
||||
Matrix_GetStateTranslationAndScaledZ(effect->maxScale, &vec);
|
||||
/**
|
||||
* Get the water surface at point (`x`, `ySurface`, `z`). `ySurface` doubles as position y input
|
||||
* returns true if point is within the xz boundaries of an active water box, else false
|
||||
@@ -980,10 +980,10 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
|
||||
&ySurface, &waterBox)) {
|
||||
if ((effect->position.y - ySurface) < 200.0f) {
|
||||
// Draw the splash effect.
|
||||
SysMatrix_InsertTranslation(effect->position.x + vec.x, ySurface, effect->position.z + vec.z,
|
||||
MTXMODE_NEW);
|
||||
SysMatrix_InsertYRotation_f(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_APPLY);
|
||||
SysMatrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
Matrix_InsertTranslation(effect->position.x + vec.x, ySurface, effect->position.z + vec.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertYRotation_f(2.0f * (j * M_PI) * (1.0f / 16.0f), MTXMODE_APPLY);
|
||||
Matrix_RotateStateAroundXAxis(effect->rotationX);
|
||||
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_0403A0F0);
|
||||
|
||||
@@ -91,7 +91,7 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) {
|
||||
isDisplayListSet = true;
|
||||
}
|
||||
|
||||
SysMatrix_StatePush();
|
||||
Matrix_StatePush();
|
||||
|
||||
alpha = (particle->unk_02 / (f32)particle->unk_01);
|
||||
alpha *= 255.0f;
|
||||
@@ -102,15 +102,15 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) {
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (particle->unk_02 + (i * 3)) * 3,
|
||||
(particle->unk_02 + (i * 3)) * 15, 0x20, 0x40, 1, 0, 0, 0x20, 0x20));
|
||||
|
||||
SysMatrix_InsertTranslation(particle->unk_10.x, particle->unk_10.y, particle->unk_10.z, MTXMODE_NEW);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_InsertTranslation(particle->unk_10.x, particle->unk_10.y, particle->unk_10.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(particle->unk_34, particle->unk_34, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_060002E8);
|
||||
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,8 +280,7 @@ s16 func_80B3E8BC(EnDai* this, s32 arg1) {
|
||||
}
|
||||
|
||||
while (i < end) {
|
||||
if ((D_80B3FCB4[i] <= this->skelAnime.animCurrentFrame) &&
|
||||
(D_80B3FCE4[i] >= this->skelAnime.animCurrentFrame)) {
|
||||
if ((D_80B3FCB4[i] <= this->skelAnime.curFrame) && (D_80B3FCE4[i] >= this->skelAnime.curFrame)) {
|
||||
return D_80B3FD14[i];
|
||||
}
|
||||
i++;
|
||||
@@ -297,7 +296,7 @@ s32 func_80B3E96C(EnDai* this, GlobalContext* globalCtx) {
|
||||
Vec3f sp50;
|
||||
|
||||
if ((DECR(this->unk_1DA) == 0) &&
|
||||
((this->unk_1DC == 0) || func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount))) {
|
||||
((this->unk_1DC == 0) || Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame))) {
|
||||
switch (this->unk_1DC) {
|
||||
case 0:
|
||||
func_80B3E5DC(this, 2);
|
||||
@@ -373,10 +372,10 @@ s32 func_80B3EC84(EnDai* this) {
|
||||
s32 ret = false;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_80B3FD6C); i++) {
|
||||
if ((this->unk_1DC == D_80B3FD6C[i]) && (D_80B3FD2C[i] < this->skelAnime.animCurrentFrame) &&
|
||||
(D_80B3FD4C[i] >= this->skelAnime.animCurrentFrame)) {
|
||||
func_80B3EC10(D_80B3FD2C[i], D_80B3FD7C[i], D_80B3FD4C[i], D_80B3FD7C[i + 1],
|
||||
this->skelAnime.animCurrentFrame, &this->unk_1F0);
|
||||
if ((this->unk_1DC == D_80B3FD6C[i]) && (D_80B3FD2C[i] < this->skelAnime.curFrame) &&
|
||||
(D_80B3FD4C[i] >= this->skelAnime.curFrame)) {
|
||||
func_80B3EC10(D_80B3FD2C[i], D_80B3FD7C[i], D_80B3FD4C[i], D_80B3FD7C[i + 1], this->skelAnime.curFrame,
|
||||
&this->unk_1F0);
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
@@ -400,10 +399,10 @@ s32 func_80B3ED88(EnDai* this) {
|
||||
s32 ret = false;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_80B3FE00); i++) {
|
||||
if ((this->unk_1DC == D_80B3FE00[i]) && (D_80B3FDE8[i] < this->skelAnime.animCurrentFrame) &&
|
||||
(D_80B3FDF4[i] >= this->skelAnime.animCurrentFrame)) {
|
||||
func_80B3EC10(D_80B3FDE8[i], D_80B3FE08[i], D_80B3FDF4[i], D_80B3FE08[i + 1],
|
||||
this->skelAnime.animCurrentFrame, &this->unk_1FC);
|
||||
if ((this->unk_1DC == D_80B3FE00[i]) && (D_80B3FDE8[i] < this->skelAnime.curFrame) &&
|
||||
(D_80B3FDF4[i] >= this->skelAnime.curFrame)) {
|
||||
func_80B3EC10(D_80B3FDE8[i], D_80B3FE08[i], D_80B3FDF4[i], D_80B3FE08[i + 1], this->skelAnime.curFrame,
|
||||
&this->unk_1FC);
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
@@ -496,24 +495,24 @@ void func_80B3F044(EnDai* this, GlobalContext* globalCtx) {
|
||||
if (globalCtx->csCtx.frames == 360) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIGOLON_SLEEP3 - SFX_FLAG);
|
||||
}
|
||||
if (func_801378B8(&this->skelAnime, 43.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 43.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_GORON_BOUND_1);
|
||||
}
|
||||
this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (func_801378B8(&this->skelAnime, 6.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 6.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIGOLON_SLEEP1);
|
||||
}
|
||||
this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (func_801378B8(&this->skelAnime, 30.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 30.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DAIGOLON_SLEEP2);
|
||||
}
|
||||
if (func_801378B8(&this->skelAnime, 35.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 35.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_GORON_BOUND_0);
|
||||
}
|
||||
this->unk_1D6 = func_80B3E8BC(this, this->unk_1CC);
|
||||
@@ -527,7 +526,7 @@ void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDai* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 0.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060130D0, NULL, this->jointTable, this->morphTable, 19);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060130D0, NULL, this->jointTable, this->morphTable, 19);
|
||||
this->unk_A70 = -1;
|
||||
func_80B3E5DC(this, 0);
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
@@ -567,13 +566,13 @@ void EnDai_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (!func_80B3E7C8(this, globalCtx) && func_80B3E69C(this, globalCtx)) {
|
||||
func_80B3F044(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80B3E834(this);
|
||||
func_80B3E460(this);
|
||||
} else {
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (!(player->stateFlags2 & 0x8000000)) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80B3E834(this);
|
||||
if (!(this->unk_1CE & 0x200)) {
|
||||
func_8013C964(&this->actor, globalCtx, 0.0f, 0.0f, 0, this->unk_1CE & 7);
|
||||
@@ -592,7 +591,7 @@ s32 func_80B3F598(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
}
|
||||
|
||||
if (limbIndex == 11) {
|
||||
SysMatrix_MultiplyVector3fByState(&D_801D15B0, &this->unk_1E4);
|
||||
Matrix_MultiplyVector3fByState(&D_801D15B0, &this->unk_1E4);
|
||||
}
|
||||
|
||||
if (limbIndex == 10) {
|
||||
@@ -614,15 +613,15 @@ void func_80B3F614(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
D_80B3FE4C.x = sREG(0);
|
||||
D_80B3FE4C.y = sREG(1);
|
||||
D_80B3FE4C.z = sREG(2);
|
||||
SysMatrix_MultiplyVector3fByState(&D_80B3FE4C, &this->actor.focus.pos);
|
||||
Matrix_MultiplyVector3fByState(&D_80B3FE4C, &this->actor.focus.pos);
|
||||
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
|
||||
SysMatrix_CopyCurrentState(&sp24);
|
||||
Matrix_CopyCurrentState(&sp24);
|
||||
func_8018219C(&sp24, &sp64, 0);
|
||||
this->unk_1D4 = BINANG_SUB(sp64.y, 0x4000);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
SysMatrix_CopyCurrentState(&this->unk_18C);
|
||||
Matrix_CopyCurrentState(&this->unk_18C);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -671,10 +670,10 @@ void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE58[this->unk_1D6]));
|
||||
|
||||
POLY_XLU_DISP =
|
||||
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_XLU_DISP);
|
||||
if (this->unk_1CE & 0x40) {
|
||||
SysMatrix_SetCurrentState(&this->unk_18C);
|
||||
Matrix_SetCurrentState(&this->unk_18C);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_0600C538);
|
||||
@@ -703,9 +702,9 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE70[this->unk_1D6]));
|
||||
|
||||
POLY_OPA_DISP =
|
||||
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_OPA_DISP);
|
||||
SysMatrix_SetCurrentState(&this->unk_18C);
|
||||
Matrix_SetCurrentState(&this->unk_18C);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_0600C538);
|
||||
@@ -722,9 +721,9 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE70[this->unk_1D6]));
|
||||
|
||||
POLY_XLU_DISP =
|
||||
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_XLU_DISP);
|
||||
SysMatrix_SetCurrentState(&this->unk_18C);
|
||||
Matrix_SetCurrentState(&this->unk_18C);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_0600C538);
|
||||
|
||||
@@ -108,18 +108,18 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->unk_27E = this->unk_278 * 4 + 4;
|
||||
|
||||
case ENDAIKU_PARAMS_FF_1:
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable,
|
||||
17);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable,
|
||||
this->morphTable, 17);
|
||||
break;
|
||||
|
||||
case ENDAIKU_PARAMS_FF_2:
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600A850, &D_0600B690, this->jointTable, this->morphTable,
|
||||
17);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_0600B690, this->jointTable,
|
||||
this->morphTable, 17);
|
||||
break;
|
||||
|
||||
case ENDAIKU_PARAMS_FF_3:
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600A850, &D_06001114, this->jointTable, this->morphTable,
|
||||
17);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06001114, this->jointTable,
|
||||
this->morphTable, 17);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -141,8 +141,8 @@ void func_8094373C(EnDaiku* this, s32 arg1) {
|
||||
0, 0, 0, 0, 2, 0, 0, 2, 2,
|
||||
};
|
||||
|
||||
this->unk_284 = SkelAnime_GetFrameCount(&D_809440A4[arg1]->common);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, D_809440A4[arg1], 1.0f, 0.0f, this->unk_284, D_809440C8[arg1], -4.0f);
|
||||
this->unk_284 = Animation_GetLastFrame(D_809440A4[arg1]);
|
||||
Animation_Change(&this->skelAnime, D_809440A4[arg1], 1.0f, 0.0f, this->unk_284, D_809440C8[arg1], -4.0f);
|
||||
}
|
||||
|
||||
void func_809437C8(EnDaiku* this) {
|
||||
@@ -179,7 +179,7 @@ void func_80943820(EnDaiku* this) {
|
||||
}
|
||||
|
||||
void func_809438F8(EnDaiku* this, GlobalContext* globalCtx) {
|
||||
f32 currentFrame = this->skelAnime.animCurrentFrame;
|
||||
f32 currentFrame = this->skelAnime.curFrame;
|
||||
s32 pad;
|
||||
s32 day = gSaveContext.day - 1;
|
||||
s32 pad2;
|
||||
@@ -245,7 +245,7 @@ void func_80943BC0(EnDaiku* this) {
|
||||
}
|
||||
|
||||
void func_80943BDC(EnDaiku* this, GlobalContext* globalCtx) {
|
||||
f32 currentFrame = this->skelAnime.animCurrentFrame;
|
||||
f32 currentFrame = this->skelAnime.curFrame;
|
||||
|
||||
if ((this->unk_278 == ENDAIKU_PARAMS_FF_2) && (this->unk_284 <= currentFrame)) {
|
||||
if (Rand_ZeroOne() < 0.5f) {
|
||||
@@ -266,7 +266,7 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
if (this->unk_27E == 0) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
if ((this->unk_278 == ENDAIKU_PARAMS_FF_0) && (gSaveContext.day == 3) && (gSaveContext.isNight)) {
|
||||
@@ -353,8 +353,8 @@ void EnDaiku_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
func_80943E18, func_80943E60, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
func_80943E18, func_80943E60, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void EnDaiku2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 40.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17);
|
||||
this->actor.targetMode = 0;
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->unk_278 = ENDAIKU2_GET_7F(&this->actor);
|
||||
@@ -144,12 +144,12 @@ void func_80BE6408(EnDaiku2* this, s32 arg1) {
|
||||
f32 sp34 = 1.0f;
|
||||
|
||||
this->unk_276 = arg1;
|
||||
this->unk_284 = SkelAnime_GetFrameCount(&sAnimations[this->unk_276]->common);
|
||||
this->unk_284 = Animation_GetLastFrame(sAnimations[this->unk_276]);
|
||||
if (this->unk_276 == 3) {
|
||||
sp34 = 2.0f;
|
||||
}
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, sAnimations[this->unk_276], sp34, 0.0f, this->unk_284,
|
||||
D_80BE7958[this->unk_276], -4.0f);
|
||||
Animation_Change(&this->skelAnime, sAnimations[this->unk_276], sp34, 0.0f, this->unk_284, D_80BE7958[this->unk_276],
|
||||
-4.0f);
|
||||
}
|
||||
|
||||
s32 func_80BE64C0(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
@@ -212,7 +212,7 @@ void func_80BE65B4(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
f32 sp9C = this->skelAnime.animCurrentFrame;
|
||||
f32 sp9C = this->skelAnime.curFrame;
|
||||
s32 sp98 = gSaveContext.day - 1;
|
||||
s32 i;
|
||||
Vec3f sp88;
|
||||
@@ -244,7 +244,7 @@ void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
func_800B8614(&this->actor, globalCtx, 80.0f);
|
||||
if ((this->unk_276 == 8) && func_801378B8(&this->skelAnime, 6.0f)) {
|
||||
if ((this->unk_276 == 8) && Animation_OnFrame(&this->skelAnime, 6.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_ROCK_BROKEN);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
@@ -274,8 +274,8 @@ void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
if ((this->unk_276 == 5) || (this->unk_276 == 9)) {
|
||||
func_80BE6408(this, 10);
|
||||
} else if ((this->unk_276 == 10) && (this->unk_284 <= sp9C)) {
|
||||
this->unk_284 = SkelAnime_GetFrameCount(&D_06002134.common);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002134, -1.0f, this->unk_284, 0.0f, 2, -4.0f);
|
||||
this->unk_284 = Animation_GetLastFrame(&D_06002134);
|
||||
Animation_Change(&this->skelAnime, &D_06002134, -1.0f, this->unk_284, 0.0f, 2, -4.0f);
|
||||
this->unk_276 = 11;
|
||||
} else if ((this->unk_276 == 11) && (sp9C <= 0.0f)) {
|
||||
func_80BE6408(this, 8);
|
||||
@@ -371,7 +371,7 @@ void func_80BE6EB0(EnDaiku2* this) {
|
||||
}
|
||||
|
||||
void func_80BE6EF0(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
f32 sp5C = this->skelAnime.animCurrentFrame;
|
||||
f32 sp5C = this->skelAnime.curFrame;
|
||||
s32 pad[4];
|
||||
Vec3f sp40;
|
||||
s16 var;
|
||||
@@ -440,7 +440,7 @@ void func_80BE71A0(EnDaiku2* this) {
|
||||
}
|
||||
|
||||
void func_80BE71D8(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
f32 currentFrame = this->skelAnime.animCurrentFrame;
|
||||
f32 currentFrame = this->skelAnime.curFrame;
|
||||
|
||||
if (func_80BE64C0(this, globalCtx)) {
|
||||
func_80BE6CFC(this);
|
||||
@@ -457,7 +457,7 @@ void EnDaiku2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDaiku2* this = THIS;
|
||||
s32 pad;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
Actor_SetHeight(&this->actor, 65.0f);
|
||||
@@ -496,8 +496,8 @@ void EnDaiku2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 245, 155, 0, 255);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL,
|
||||
EnDaiku2_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
NULL, EnDaiku2_PostLimbDraw, &this->actor);
|
||||
func_80BE7718(this, globalCtx);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -561,17 +561,17 @@ void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx) {
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) {
|
||||
if (particle->isEnabled) {
|
||||
SysMatrix_StatePush();
|
||||
SysMatrix_InsertTranslation(particle->unk_04.x, particle->unk_04.y, particle->unk_04.z, MTXMODE_NEW);
|
||||
SysMatrix_InsertXRotation_s(particle->unk_28.x, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(particle->unk_04.x, particle->unk_04.y, particle->unk_04.z, MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(particle->unk_28.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(particle->unk_28.y, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(particle->unk_28.z, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(particle->unk_28.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(particle->unk_30, particle->unk_30, particle->unk_30, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_060009E0);
|
||||
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ void func_808BD3B4(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BD428(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_06003180, 0.0f);
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06003180, 0.0f);
|
||||
this->unk_190 = Rand_S16Offset(100, 50);
|
||||
this->collider.dim.height = 5;
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
|
||||
@@ -189,7 +189,7 @@ void func_808BD428(EnDekunuts* this) {
|
||||
void func_808BD49C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
s32 phi_v1 = false;
|
||||
|
||||
if (this->skelAnime.animPlaybackSpeed < 0.5f) {
|
||||
if (this->skelAnime.playSpeed < 0.5f) {
|
||||
phi_v1 = true;
|
||||
}
|
||||
|
||||
@@ -197,18 +197,18 @@ void func_808BD49C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
this->unk_190--;
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 9.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 9.0f)) {
|
||||
this->collider.base.acFlags |= AC_ON;
|
||||
} else if (func_801378B8(&this->skelAnime, 8.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 8.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_UP);
|
||||
}
|
||||
|
||||
this->collider.dim.height = (s32)((CLAMP(this->skelAnime.animCurrentFrame, 9.0f, 12.0f) - 9.0f) * 9.0f) + 5;
|
||||
this->collider.dim.height = (s32)((CLAMP(this->skelAnime.curFrame, 9.0f, 12.0f) - 9.0f) * 9.0f) + 5;
|
||||
|
||||
if (!phi_v1 && (this->actor.params == ENDEKUNUTS_GET_FF00_0) &&
|
||||
(Player_GetMask(globalCtx) != PLAYER_MASK_STONE_MASK) && (this->actor.xzDistToPlayer < 120.0f)) {
|
||||
func_808BDC9C(this);
|
||||
} else if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
} else if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (((this->unk_190 == 0) && (this->actor.xzDistToPlayer > 320.0f)) ||
|
||||
(Player_GetMask(globalCtx) == PLAYER_MASK_STONE_MASK)) {
|
||||
func_808BD78C(this);
|
||||
@@ -228,19 +228,19 @@ void func_808BD49C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
((this->actor.params == ENDEKUNUTS_GET_FF00_2) && (this->actor.yDistToPlayer > -60.0f)) ||
|
||||
(this->actor.params == ENDEKUNUTS_GET_FF00_1)) &&
|
||||
((this->unk_190 == 0) || (this->actor.xzDistToPlayer < 480.0f))) {
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void func_808BD78C(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_06002FA4);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_06002FA4);
|
||||
this->unk_190 = 2;
|
||||
this->actionFunc = func_808BD7D4;
|
||||
}
|
||||
|
||||
void func_808BD7D4(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_801378B8(&this->skelAnime, 0.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
|
||||
if (this->unk_190 != 0) {
|
||||
this->unk_190--;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ void func_808BD7D4(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BD870(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600326C, -3.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_0600326C, -3.0f);
|
||||
if (this->actionFunc == func_808BDA4C) {
|
||||
this->unk_190 = 4098;
|
||||
} else {
|
||||
@@ -263,8 +263,8 @@ void func_808BD870(EnDekunuts* this) {
|
||||
}
|
||||
|
||||
void func_808BD8D8(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_801378B8(&this->skelAnime, 0.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
|
||||
if (this->unk_190 != 0) {
|
||||
this->unk_190--;
|
||||
}
|
||||
@@ -292,7 +292,7 @@ void func_808BD8D8(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BDA08(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000168);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_06000168);
|
||||
this->unk_190 = this->unk_194;
|
||||
this->actionFunc = func_808BDA4C;
|
||||
}
|
||||
@@ -314,17 +314,17 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
sp58.y = player->actor.world.pos.y + 40.0f;
|
||||
pitch = Actor_PitchToPoint(&this->actor, &sp58);
|
||||
pitch = CLAMP(pitch, -0x3800, -0x2000);
|
||||
if (this->skelAnime.animCurrentFrame < 7.0f) {
|
||||
if (this->skelAnime.curFrame < 7.0f) {
|
||||
Math_ScaledStepToS(&this->actor.world.rot.x, pitch, 0x800);
|
||||
} else {
|
||||
Math_ScaledStepToS(&this->actor.world.rot.x, 0, 0x800);
|
||||
}
|
||||
}
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->actor.world.rot.x = 0;
|
||||
func_808BD870(this);
|
||||
} else if (func_801378B8(&this->skelAnime, 7.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 7.0f)) {
|
||||
val = Math_CosS(this->actor.world.rot.x) * 15.0f;
|
||||
pos.x = (Math_SinS(this->actor.shape.rot.y) * val) + this->actor.world.pos.x;
|
||||
pos.y = (this->actor.world.pos.y + 12.0f) - (Math_SinS(this->actor.world.rot.x) * 15.0f);
|
||||
@@ -335,8 +335,8 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
this->actor.world.rot.x, this->actor.shape.rot.y, 0, params) != NULL) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_THROW);
|
||||
}
|
||||
} else if ((this->unk_190 >= 2) && func_801378B8(&this->skelAnime, 12.0f)) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000168, -3.0f);
|
||||
} else if ((this->unk_190 >= 2) && Animation_OnFrame(&this->skelAnime, 12.0f)) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06000168, -3.0f);
|
||||
if (this->unk_190 != 0) {
|
||||
this->unk_190--;
|
||||
}
|
||||
@@ -344,14 +344,14 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BDC9C(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06002A5C, -5.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f);
|
||||
this->unk_190 = 0;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN);
|
||||
this->actionFunc = func_808BDD54;
|
||||
}
|
||||
|
||||
void func_808BDCF0(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06002A5C, -5.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f);
|
||||
this->collider.base.acFlags &= ~AC_ON;
|
||||
this->unk_190 = 80;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DOWN);
|
||||
@@ -359,7 +359,7 @@ void func_808BDCF0(EnDekunuts* this) {
|
||||
}
|
||||
|
||||
void func_808BDD54(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (this->unk_190 != 0) {
|
||||
this->unk_190--;
|
||||
}
|
||||
@@ -368,10 +368,10 @@ void func_808BDD54(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
func_808BD428(this);
|
||||
}
|
||||
} else {
|
||||
this->collider.dim.height = (s32)((3.0f - CLAMP(this->skelAnime.animCurrentFrame, 1.0f, 3.0f)) * 12.0f) + 5;
|
||||
this->collider.dim.height = (s32)((3.0f - CLAMP(this->skelAnime.curFrame, 1.0f, 3.0f)) * 12.0f) + 5;
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 4.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 4.0f)) {
|
||||
this->collider.base.acFlags &= ~AC_ON;
|
||||
}
|
||||
Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.5f, 3.0f);
|
||||
@@ -379,7 +379,7 @@ void func_808BDD54(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BDE7C(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06002DD4, -3.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06002DD4, -3.0f);
|
||||
this->collider.dim.height = 37;
|
||||
this->actor.colChkInfo.mass = 50;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE);
|
||||
@@ -390,7 +390,7 @@ void func_808BDE7C(EnDekunuts* this) {
|
||||
}
|
||||
|
||||
void func_808BDEF8(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer);
|
||||
this->unk_18D = 3;
|
||||
func_808BDF60(this);
|
||||
@@ -399,7 +399,7 @@ void func_808BDEF8(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BDF60(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_06003780);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_06003780);
|
||||
this->unk_190 = 2;
|
||||
this->unk_18C = 0;
|
||||
this->collider.base.acFlags |= AC_ON;
|
||||
@@ -410,8 +410,8 @@ void func_808BDFB8(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
s16 yaw;
|
||||
s16 yaw2;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_801378B8(&this->skelAnime, 0.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
|
||||
if (this->unk_190 != 0) {
|
||||
this->unk_190--;
|
||||
}
|
||||
@@ -456,7 +456,7 @@ void func_808BDFB8(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BE1CC(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060033E4);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_060033E4);
|
||||
this->unk_190 = 3;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
if (this->unk_18D != 0) {
|
||||
@@ -466,8 +466,8 @@ void func_808BE1CC(EnDekunuts* this) {
|
||||
}
|
||||
|
||||
void func_808BE22C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_801378B8(&this->skelAnime, 0.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
|
||||
if (this->unk_190 != 0) {
|
||||
this->unk_190--;
|
||||
}
|
||||
@@ -479,7 +479,7 @@ void func_808BE22C(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BE294(EnDekunuts* this, s32 arg1) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_0600259C, -3.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_0600259C, -3.0f);
|
||||
if (this->actor.params == ENDEKUNUTS_GET_FF00_0) {
|
||||
this->actor.speedXZ = 10.0f;
|
||||
if (arg1 != 0) {
|
||||
@@ -492,12 +492,12 @@ void func_808BE294(EnDekunuts* this, s32 arg1) {
|
||||
this->actionFunc = func_808BE358;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_CUTBODY);
|
||||
func_800BCB70(&this->actor, 0x4000, 255, 0, SkelAnime_GetFrameCount(&D_0600259C.common));
|
||||
func_800BCB70(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&D_0600259C));
|
||||
}
|
||||
|
||||
void func_808BE358(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_808BE484(this);
|
||||
}
|
||||
}
|
||||
@@ -531,7 +531,7 @@ void func_808BE3FC(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BE484(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06002BD4);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_06002BD4);
|
||||
this->actionFunc = func_808BE4D4;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DEAD);
|
||||
@@ -543,7 +543,7 @@ void func_808BE4D4(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
Vec3f sp40;
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
sp40.x = this->actor.world.pos.x;
|
||||
sp40.y = this->actor.world.pos.y + 18.0f;
|
||||
sp40.z = this->actor.world.pos.z;
|
||||
@@ -560,12 +560,12 @@ void func_808BE4D4(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BE680(EnDekunuts* this) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_0600326C, -3.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_0600326C, -3.0f);
|
||||
this->actionFunc = func_808BE6C4;
|
||||
}
|
||||
|
||||
void func_808BE6C4(EnDekunuts* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Player_GetMask(globalCtx) != PLAYER_MASK_STONE_MASK) {
|
||||
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38);
|
||||
}
|
||||
@@ -678,7 +678,7 @@ s32 func_808BEBD0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
|
||||
|
||||
if (this->actionFunc == func_808BDA4C) {
|
||||
if (limbIndex == 5) {
|
||||
currentFrame = this->skelAnime.animCurrentFrame;
|
||||
currentFrame = this->skelAnime.curFrame;
|
||||
if (currentFrame <= 6.0f) {
|
||||
arg2 = 1.0f - (currentFrame * 0.0833f);
|
||||
arg1 = (currentFrame * 0.1167f) + 1.0f;
|
||||
@@ -719,30 +719,30 @@ void func_808BED30(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
|
||||
if (value != -1) {
|
||||
if (value < 3) {
|
||||
SysMatrix_GetStateTranslationAndScaledX(1000.0f, &this->unk_21C[value]);
|
||||
Matrix_GetStateTranslationAndScaledX(1000.0f, &this->unk_21C[value]);
|
||||
} else {
|
||||
SysMatrix_GetStateTranslation(&this->unk_21C[value]);
|
||||
Matrix_GetStateTranslation(&this->unk_21C[value]);
|
||||
ptr1 = &D_808BEFA4[0];
|
||||
ptr2 = &this->unk_21C[value + 1];
|
||||
for (i = value + 1; i < ARRAY_COUNT(this->unk_21C); i++) {
|
||||
SysMatrix_MultiplyVector3fByState(ptr1, ptr2);
|
||||
Matrix_MultiplyVector3fByState(ptr1, ptr2);
|
||||
ptr1++, ptr2++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (limbIndex == 2) {
|
||||
SysMatrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
Matrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
void EnDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDekunuts* this = THIS;
|
||||
|
||||
SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, func_808BEBD0, func_808BED30,
|
||||
&this->actor);
|
||||
SysMatrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, func_808BEBD0, func_808BED30,
|
||||
&this->actor);
|
||||
Matrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
if (this->actor.colorFilterTimer != 0) {
|
||||
func_800AE5A0(globalCtx);
|
||||
|
||||
@@ -157,13 +157,13 @@ void func_80989140(SkelAnime* skelAnime, ActorAnimationEntryS arg1[], s32 arg2)
|
||||
|
||||
arg1 += arg2;
|
||||
if (arg1->frameCount < 0) {
|
||||
frameCount = SkelAnime_GetFrameCount(&arg1->animationSeg->common);
|
||||
frameCount = Animation_GetLastFrame(arg1->animationSeg);
|
||||
} else {
|
||||
frameCount = arg1->frameCount;
|
||||
}
|
||||
|
||||
SkelAnime_ChangeAnim(skelAnime, arg1->animationSeg, arg1->playbackSpeed + (BREG(88) * 0.1f), arg1->frame,
|
||||
frameCount, arg1->mode, arg1->transitionRate);
|
||||
Animation_Change(skelAnime, arg1->animationSeg, arg1->playbackSpeed + (BREG(88) * 0.1f), arg1->frame, frameCount,
|
||||
arg1->mode, arg1->transitionRate);
|
||||
}
|
||||
|
||||
void func_80989204(EnDg* this, GlobalContext* globalCtx) {
|
||||
@@ -294,7 +294,7 @@ void func_80989674(EnDg* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80989864(EnDg* this, GlobalContext* globalCtx) {
|
||||
s16 frame = this->skelAnime.animCurrentFrame;
|
||||
s16 frame = this->skelAnime.curFrame;
|
||||
s16 mod = (this->actor.speedXZ > 6.0f) ? 2 : 3;
|
||||
Vec3f sp38;
|
||||
|
||||
@@ -307,31 +307,31 @@ void func_80989864(EnDg* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80989974(EnDg* this) {
|
||||
if (func_801378B8(&this->skelAnime, 1.0f) || func_801378B8(&this->skelAnime, 7.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_MONKEY_WALK);
|
||||
}
|
||||
}
|
||||
|
||||
void func_809899C8(EnDg* this, f32 arg1) {
|
||||
if (func_801378B8(&this->skelAnime, arg1)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, arg1)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_BARK);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80989A08(EnDg* this, f32 arg1) {
|
||||
if (func_801378B8(&this->skelAnime, arg1)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, arg1)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80989A48(EnDg* this) {
|
||||
if (func_801378B8(&this->skelAnime, 23.0f) || func_801378B8(&this->skelAnime, 28.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 23.0f) || Animation_OnFrame(&this->skelAnime, 28.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_WHINE);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80989A9C(EnDg* this, f32 arg1) {
|
||||
if (func_801378B8(&this->skelAnime, arg1)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, arg1)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_GROAN);
|
||||
}
|
||||
}
|
||||
@@ -657,9 +657,9 @@ void func_8098A70C(EnDg* this, GlobalContext* globalCtx) {
|
||||
|
||||
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
|
||||
func_80989974(this);
|
||||
if (func_801378B8(&this->skelAnime, 3.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 3.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_CRY);
|
||||
} else if (func_801378B8(&this->skelAnime, 6.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 6.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_MONKEY_WALK);
|
||||
}
|
||||
}
|
||||
@@ -689,7 +689,7 @@ void func_8098A938(EnDg* this, GlobalContext* globalCtx) {
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
if (this->actor.xzDistToPlayer < 70.0f) {
|
||||
Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 1.0f);
|
||||
if (func_801378B8(&this->skelAnime, 7.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 7.0f)) {
|
||||
s16 y = ABS_ALT(player->actor.shape.rot.y - this->actor.shape.rot.y);
|
||||
|
||||
this->unk_28E = 20;
|
||||
@@ -751,7 +751,7 @@ void func_8098AB48(EnDg* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8098AC34(EnDg* this, GlobalContext* globalCtx) {
|
||||
s16 sp26 = this->skelAnime.animCurrentFrame;
|
||||
s16 sp26 = this->skelAnime.curFrame;
|
||||
|
||||
if ((this->actor.xyzDistToPlayerSq < 800.0f) && (this->collider.base.atFlags & AT_BOUNCED)) {
|
||||
this->unk_28E = 60;
|
||||
@@ -772,13 +772,13 @@ void func_8098AC34(EnDg* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (sp26 < 9) {
|
||||
if (func_801378B8(&this->skelAnime, 0.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
|
||||
sAnimations[14].playbackSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f;
|
||||
}
|
||||
func_80989864(this, globalCtx);
|
||||
} else {
|
||||
this->unk_280 |= 2;
|
||||
if (func_801378B8(&this->skelAnime, 9.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 9.0f)) {
|
||||
f32 rand = randPlusMinusPoint5Scaled(1.5f);
|
||||
|
||||
sAnimations[14].playbackSpeed = 1.2f;
|
||||
@@ -1116,7 +1116,7 @@ void EnDg_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 24.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060080F0, NULL, this->jointTable, this->morphTable, 13);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060080F0, NULL, this->jointTable, this->morphTable, 13);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
@@ -1170,7 +1170,7 @@ void EnDg_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8098933C(this, &sp28);
|
||||
Math_ApproachF(&this->unk_294.x, sp28.x, 0.2f, 0.1f);
|
||||
Math_ApproachF(&this->unk_294.z, sp28.z, 0.2f, 0.1f);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1185,9 +1185,9 @@ void func_8098BFD4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
if (limbIndex == 5) {
|
||||
if (this->actionFunc == func_8098BBEC) {
|
||||
sp20.x = 5000.0f;
|
||||
SysMatrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
Matrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
} else if (this->actionFunc != func_8098BC54) {
|
||||
SysMatrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
Matrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1225,13 +1225,13 @@ void EnDg_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
|
||||
SysMatrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
SysMatrix_RotateStateAroundXAxis(this->unk_294.x);
|
||||
SysMatrix_InsertZRotation_f(this->unk_294.z, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_RotateStateAroundXAxis(this->unk_294.x);
|
||||
Matrix_InsertZRotation_f(this->unk_294.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
func_8098BFB8, func_8098BFD4, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
func_8098BFB8, func_8098BFD4, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ void EnDinofos_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->colliderJntSphElement);
|
||||
Collider_InitAndSetQuad(globalCtx, &this->colliderQuad, &this->actor, &sQuadInit);
|
||||
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06009570, &D_06002E40, this->jointTable, this->morphTable, 21);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009570, &D_06002E40, this->jointTable, this->morphTable, 21);
|
||||
|
||||
if (D_8089E364 == 0) {
|
||||
for (i = 0; i < ARRAY_COUNT(D_8089E33C); i++) {
|
||||
@@ -483,8 +483,8 @@ void func_8089B100(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f sp3C;
|
||||
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06001CCC, 1.0f, SkelAnime_GetFrameCount(&D_06001CCC.common),
|
||||
SkelAnime_GetFrameCount(&D_06001CCC.common), 2, 0.0f);
|
||||
Animation_Change(&this->skelAnime, &D_06001CCC, 1.0f, Animation_GetLastFrame(&D_06001CCC),
|
||||
Animation_GetLastFrame(&D_06001CCC), 2, 0.0f);
|
||||
func_800BE33C(&camera->eye, &camera->at, &this->unk_29A, 1);
|
||||
Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &sp3C);
|
||||
this->unk_2BC.x = player->actor.world.pos.x + (0.4f * sp3C.x);
|
||||
@@ -549,7 +549,7 @@ void func_8089B4A4(EnDinofos* this) {
|
||||
if (this->unk_290 < 10) {
|
||||
func_801A2E54(0x38);
|
||||
}
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600C974);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_0600C974);
|
||||
this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.x;
|
||||
this->unk_2BC.y = this->actor.floorHeight + 11.0f;
|
||||
this->unk_2BC.z = (Math_CosS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.z;
|
||||
@@ -567,38 +567,38 @@ void func_8089B580(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.focus.pos, &camera->eye);
|
||||
}
|
||||
|
||||
if (this->skelAnime.animCurrentFrame > 35.0f) {
|
||||
if ((globalCtx->sceneNum == SCENE_MITURIN) && func_801378B8(&this->skelAnime, 38.0f)) {
|
||||
if (this->skelAnime.curFrame > 35.0f) {
|
||||
if ((globalCtx->sceneNum == SCENE_MITURIN) && Animation_OnFrame(&this->skelAnime, 38.0f)) {
|
||||
globalCtx->envCtx.unk_C3 = 11;
|
||||
}
|
||||
|
||||
Math_Vec3f_StepTo(&camera->eye, &this->unk_2BC, 10.0f);
|
||||
Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.focus.pos, &camera->eye);
|
||||
if (this->skelAnime.animCurrentFrame <= 55.0f) {
|
||||
if (this->skelAnime.curFrame <= 55.0f) {
|
||||
func_800B9010(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG);
|
||||
}
|
||||
}
|
||||
|
||||
if ((globalCtx->sceneNum == SCENE_MITURIN) && func_801378B8(&this->skelAnime, 55.0f)) {
|
||||
if ((globalCtx->sceneNum == SCENE_MITURIN) && Animation_OnFrame(&this->skelAnime, 55.0f)) {
|
||||
globalCtx->envCtx.unk_C3 = 0xFF;
|
||||
}
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_8089B6E8(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8089B6E8(EnDinofos* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06009B70, -3.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06009B70, -3.0f);
|
||||
this->actionFunc = func_8089B72C;
|
||||
}
|
||||
|
||||
void func_8089B72C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
if (func_801378B8(&this->skelAnime, 2.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 2.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_ATTACK);
|
||||
}
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_8089ABF4(this, globalCtx);
|
||||
this->actor.flags &= ~0x00100000;
|
||||
this->actor.cutscene = -1;
|
||||
@@ -607,7 +607,7 @@ void func_8089B72C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8089B7B0(EnDinofos* this) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06002E40, -4.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06002E40, -4.0f);
|
||||
this->unk_290 = (s32)Rand_ZeroFloat(20.0f) + 40;
|
||||
this->unk_292 = 30;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
@@ -617,7 +617,7 @@ void func_8089B7B0(EnDinofos* this) {
|
||||
}
|
||||
|
||||
void func_8089B834(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->unk_292 != 0) {
|
||||
this->unk_292--;
|
||||
} else if (func_8089A968(this)) {
|
||||
@@ -635,7 +635,7 @@ void func_8089B8B0(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
f32 phi_f0;
|
||||
|
||||
if (this->actionFunc != func_8089B98C) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06000580, -4.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06000580, -4.0f);
|
||||
if (func_800BC5EC(globalCtx, &this->actor)) {
|
||||
phi_f0 = 170.0f;
|
||||
} else {
|
||||
@@ -656,7 +656,7 @@ void func_8089B8B0(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
void func_8089B98C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
f32 phi_f0;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (!func_8089AE00(this, globalCtx)) {
|
||||
if (func_800BC5EC(globalCtx, &this->actor)) {
|
||||
phi_f0 = 170.0f;
|
||||
@@ -682,7 +682,7 @@ void func_8089B98C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
func_8089A9B0(this, globalCtx);
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 6.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK);
|
||||
}
|
||||
}
|
||||
@@ -690,7 +690,7 @@ void func_8089B98C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_8089BAC0(EnDinofos* this) {
|
||||
if (this->actionFunc != func_8089BB60) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06000580, -4.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06000580, -4.0f);
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) > 0) {
|
||||
@@ -704,7 +704,7 @@ void func_8089BAC0(EnDinofos* this) {
|
||||
}
|
||||
|
||||
void func_8089BB60(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->unk_28C, 0x400)) {
|
||||
func_8089A9B0(this, globalCtx);
|
||||
}
|
||||
@@ -729,10 +729,10 @@ void func_8089BBB4(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (this->actionFunc == func_8089D1E0) {
|
||||
this->skelAnime.animPlaybackSpeed = this->actor.speedXZ * 0.166666671634f;
|
||||
this->skelAnime.playSpeed = this->actor.speedXZ * 0.166666671634f;
|
||||
} else {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * 0.166666671634f, 0.0f, 0.0f, 0,
|
||||
-4.0f);
|
||||
Animation_Change(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * 0.166666671634f, 0.0f, 0.0f, 0,
|
||||
-4.0f);
|
||||
}
|
||||
|
||||
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
|
||||
@@ -776,9 +776,9 @@ void func_8089BD28(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (this->actor.speedXZ > 0.0f) {
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
} else {
|
||||
this->skelAnime.animPlaybackSpeed = -1.0f;
|
||||
this->skelAnime.playSpeed = -1.0f;
|
||||
}
|
||||
|
||||
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
|
||||
@@ -796,14 +796,14 @@ void func_8089BD28(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
|
||||
this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->unk_2A4;
|
||||
this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->unk_2A4;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->unk_292 != 0) {
|
||||
this->unk_292--;
|
||||
} else {
|
||||
func_8089A9B0(this, globalCtx);
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 5.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK);
|
||||
}
|
||||
}
|
||||
@@ -811,10 +811,10 @@ void func_8089BD28(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_8089C024(EnDinofos* this, s32 arg1) {
|
||||
if (arg1 == 0) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001CCC, 2.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001CCC, 2.0f);
|
||||
func_8089AD70(this);
|
||||
} else {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001CCC, -1.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001CCC, -1.0f);
|
||||
if ((arg1 == 2) || (arg1 == 3)) {
|
||||
this->colliderJntSph.base.acFlags &= ~AC_ON;
|
||||
func_8089AD70(this);
|
||||
@@ -830,8 +830,8 @@ void func_8089C024(EnDinofos* this, s32 arg1) {
|
||||
void func_8089C0DC(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x1000);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_801378B8(&this->skelAnime, 1.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 1.0f)) {
|
||||
if (this->unk_290 == 3) {
|
||||
func_8089C244(this);
|
||||
} else {
|
||||
@@ -858,7 +858,7 @@ void func_8089C164(EnDinofos* this) {
|
||||
}
|
||||
|
||||
void func_8089C1F8(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
func_8089C398(this);
|
||||
}
|
||||
@@ -875,13 +875,13 @@ void func_8089C244(EnDinofos* this) {
|
||||
}
|
||||
|
||||
void func_8089C2A8(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->unk_290++;
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x1800);
|
||||
if ((this->actor.velocity.y < 0.0f) && (this->skelAnime.animCurrentSeg == &D_06001CCC)) {
|
||||
if ((this->actor.velocity.y < 0.0f) && (this->skelAnime.animation == &D_06001CCC)) {
|
||||
this->colliderQuad.base.atFlags |= AT_ON;
|
||||
this->colliderJntSph.base.acFlags |= AC_ON;
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_060025B4, 1.0f, 7.0f, 13.0f, 2, -2.0f);
|
||||
Animation_Change(&this->skelAnime, &D_060025B4, 1.0f, 7.0f, 13.0f, 2, -2.0f);
|
||||
}
|
||||
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
@@ -892,9 +892,9 @@ void func_8089C2A8(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
|
||||
void func_8089C398(EnDinofos* this) {
|
||||
if (this->actionFunc != func_8089C2A8) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000AF0);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_06000AF0);
|
||||
} else {
|
||||
this->skelAnime.animFrameCount = SkelAnime_GetFrameCount(&D_060025B4.common);
|
||||
this->skelAnime.endFrame = Animation_GetLastFrame(&D_060025B4);
|
||||
}
|
||||
|
||||
if (this->actor.speedXZ < 0.0f) {
|
||||
@@ -910,7 +910,7 @@ void func_8089C398(EnDinofos* this) {
|
||||
}
|
||||
|
||||
void func_8089C44C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if ((this->unk_290 == 1) && (this->actor.xzDistToPlayer < 280.0f) && func_8089A968(this) &&
|
||||
(Rand_ZeroOne() < 0.6f)) {
|
||||
func_8089CA14(this);
|
||||
@@ -921,7 +921,7 @@ void func_8089C44C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8089C4F8(EnDinofos* this) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060025B4);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_060025B4);
|
||||
this->colliderQuad.base.atFlags &= ~AT_BOUNCED;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_CRY);
|
||||
this->unk_290 = 0;
|
||||
@@ -935,24 +935,24 @@ void func_8089C56C(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
this->unk_290++;
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x800);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_800A8514(Effect_GetParams(this->unk_2A0));
|
||||
this->colliderQuad.base.atFlags &= ~AT_ON;
|
||||
func_8089A9B0(this, globalCtx);
|
||||
} else if (func_801378B8(&this->skelAnime, 7.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 7.0f)) {
|
||||
this->colliderQuad.base.atFlags |= AT_ON;
|
||||
func_8089AD70(this);
|
||||
} else if (func_801378B8(&this->skelAnime, 13.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 13.0f)) {
|
||||
this->colliderQuad.base.atFlags &= ~AT_ON;
|
||||
} else if (func_801378B8(&this->skelAnime, 11.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 11.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_ATTACK);
|
||||
} else if (this->skelAnime.animCurrentFrame < 7.0f) {
|
||||
} else if (this->skelAnime.curFrame < 7.0f) {
|
||||
func_8089AE00(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8089C690(EnDinofos* this) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_060025B4, -1.0f, this->skelAnime.animCurrentFrame, 0.0f, 2, 0.0f);
|
||||
Animation_Change(&this->skelAnime, &D_060025B4, -1.0f, this->skelAnime.curFrame, 0.0f, 2, 0.0f);
|
||||
this->colliderQuad.base.atFlags &= ~(AT_ON | AT_BOUNCED);
|
||||
if (this->actionFunc != func_8089C2A8) {
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
@@ -967,7 +967,7 @@ void func_8089C724(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_8089A9B0(this, globalCtx);
|
||||
}
|
||||
}
|
||||
@@ -1002,7 +1002,7 @@ void func_8089C7B8(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8089C87C(EnDinofos* this, s32 arg1) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600D21C);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_0600D21C);
|
||||
func_800BE5CC(&this->actor, &this->colliderJntSph, arg1);
|
||||
this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y);
|
||||
this->actor.speedXZ = 10.0f;
|
||||
@@ -1018,7 +1018,7 @@ void func_8089C87C(EnDinofos* this, s32 arg1) {
|
||||
|
||||
void func_8089C938(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
|
||||
if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) {
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
if (this->actor.cutscene == -1) {
|
||||
func_8089CFAC(this);
|
||||
@@ -1035,7 +1035,7 @@ void func_8089C938(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8089CA14(EnDinofos* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001040, -5.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001040, -5.0f);
|
||||
this->colliderJntSph.base.acFlags |= AC_ON;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
@@ -1045,9 +1045,9 @@ void func_8089CA14(EnDinofos* this) {
|
||||
void func_8089CA74(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x800);
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_8089CB10(this, globalCtx);
|
||||
} else if (!func_8089AE00(this, globalCtx) && func_801378B8(&this->skelAnime, 12.0f)) {
|
||||
} else if (!func_8089AE00(this, globalCtx) && Animation_OnFrame(&this->skelAnime, 12.0f)) {
|
||||
this->actor.speedXZ = 8.0f;
|
||||
}
|
||||
}
|
||||
@@ -1056,7 +1056,7 @@ void func_8089CB10(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
Sphere16* worldSphere;
|
||||
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_060013C0);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_060013C0);
|
||||
this->unk_290 = 20;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->colliderJntSph.base.atFlags |= AT_ON;
|
||||
@@ -1087,7 +1087,7 @@ void func_8089CBEC(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
f32 temp_f22;
|
||||
s32 temp_s0;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x800);
|
||||
temp_f20 = Math_SinS(temp_s3);
|
||||
temp_f22 = Math_CosS(temp_s3);
|
||||
@@ -1128,7 +1128,7 @@ void func_8089CBEC(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8089CF00(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060017B8);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_060017B8);
|
||||
this->colliderJntSph.base.atFlags &= ~AT_ON;
|
||||
if (globalCtx->sceneNum == SCENE_MITURIN) {
|
||||
globalCtx->envCtx.unk_C3 = 255;
|
||||
@@ -1137,13 +1137,13 @@ void func_8089CF00(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8089CF70(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_8089A9B0(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void func_8089CFAC(EnDinofos* this) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600ABD0);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_0600ABD0);
|
||||
this->actor.flags &= ~1;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DEAD);
|
||||
this->actor.speedXZ = 0.0f;
|
||||
@@ -1152,7 +1152,7 @@ void func_8089CFAC(EnDinofos* this) {
|
||||
}
|
||||
|
||||
void func_8089D018(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
s32 temp_v0 = this->unk_288 - 10;
|
||||
|
||||
if (this->actor.category == ACTORCAT_ENEMY) {
|
||||
@@ -1172,7 +1172,7 @@ void func_8089D018(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
this->actor.shape.shadowAlpha = this->unk_288;
|
||||
} else if (func_801378B8(&this->skelAnime, 26.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 26.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DOWN);
|
||||
}
|
||||
}
|
||||
@@ -1183,7 +1183,7 @@ void func_8089D11C(EnDinofos* this, s16 arg1) {
|
||||
} else {
|
||||
this->actor.speedXZ = 15.0f;
|
||||
}
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f, 0, -4.0f);
|
||||
Animation_Change(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f, 0, -4.0f);
|
||||
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
|
||||
this->unk_292 = 10;
|
||||
this->unk_2A4 = 0.0f;
|
||||
@@ -1195,17 +1195,17 @@ void func_8089D1E0(EnDinofos* this, GlobalContext* globalCtx) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xBB8);
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f);
|
||||
|
||||
this->skelAnime.animPlaybackSpeed =
|
||||
this->skelAnime.playSpeed =
|
||||
(1.0f + fabsf(this->actor.speedXZ * (1.0f / 15.0f))) * ((this->actor.speedXZ >= 0.0f) ? 1.0f : -1.0f);
|
||||
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->unk_292 != 0) {
|
||||
this->unk_292--;
|
||||
} else {
|
||||
func_8089A9B0(this, globalCtx);
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 5.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 5.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_WALK);
|
||||
}
|
||||
}
|
||||
@@ -1443,15 +1443,15 @@ void func_8089DC84(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
|
||||
Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
|
||||
if (D_8089E3B0[limbIndex] != -1) {
|
||||
SysMatrix_GetStateTranslation(&this->unk_2D4[D_8089E3B0[limbIndex]]);
|
||||
Matrix_GetStateTranslation(&this->unk_2D4[D_8089E3B0[limbIndex]]);
|
||||
}
|
||||
|
||||
if ((limbIndex == 14) && (this->unk_292 != this->unk_290) &&
|
||||
((this->actionFunc == func_8089C56C) || (this->actionFunc == func_8089C2A8))) {
|
||||
Math_Vec3f_Copy(&sp74, &this->colliderQuad.dim.quad[0]);
|
||||
Math_Vec3f_Copy(&sp80, &this->colliderQuad.dim.quad[1]);
|
||||
SysMatrix_MultiplyVector3fByState(&D_8089E38C, &sp68);
|
||||
SysMatrix_MultiplyVector3fByState(&D_8089E398, &sp5C);
|
||||
Matrix_MultiplyVector3fByState(&D_8089E38C, &sp68);
|
||||
Matrix_MultiplyVector3fByState(&D_8089E398, &sp5C);
|
||||
Collider_SetQuadVertices(&this->colliderQuad, &sp5C, &sp68, &sp74, &sp80);
|
||||
if (this->colliderQuad.base.atFlags & AT_ON) {
|
||||
func_800A81F0(Effect_GetParams(this->unk_2A0), &sp68, &sp5C);
|
||||
@@ -1460,18 +1460,18 @@ void func_8089DC84(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
}
|
||||
|
||||
if (limbIndex == 4) {
|
||||
SysMatrix_GetStateTranslationAndScaledX(300.0f, &this->actor.shape.feetPos[0]);
|
||||
Matrix_GetStateTranslationAndScaledX(300.0f, &this->actor.shape.feetPos[0]);
|
||||
} else if (limbIndex == 7) {
|
||||
SysMatrix_GetStateTranslationAndScaledX(300.0f, &this->actor.shape.feetPos[1]);
|
||||
Matrix_GetStateTranslationAndScaledX(300.0f, &this->actor.shape.feetPos[1]);
|
||||
}
|
||||
|
||||
if ((limbIndex == 16) && (this->actionFunc == func_8089B580)) {
|
||||
if ((this->skelAnime.animCurrentFrame > 38.0f) && (this->skelAnime.animCurrentFrame <= 55.0f) &&
|
||||
if ((this->skelAnime.curFrame > 38.0f) && (this->skelAnime.curFrame <= 55.0f) &&
|
||||
(this->unk_292 != this->unk_290)) {
|
||||
sp48 = SysMatrix_GetCurrentState();
|
||||
sp58 = 48 - (s32)this->skelAnime.animCurrentFrame;
|
||||
sp48 = Matrix_GetCurrentState();
|
||||
sp58 = 48 - (s32)this->skelAnime.curFrame;
|
||||
sp58 = CLAMP_MIN(sp58, 0);
|
||||
SysMatrix_MultiplyVector3fByState(&D_8089E3A4, &sp4C);
|
||||
Matrix_MultiplyVector3fByState(&D_8089E3A4, &sp4C);
|
||||
sp4C.x -= sp48->mf[3][0];
|
||||
sp4C.y -= sp48->mf[3][1];
|
||||
sp4C.z -= sp48->mf[3][2];
|
||||
@@ -1495,8 +1495,8 @@ void EnDinofos_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Scene_SetRenderModeXlu(globalCtx, 0, 1);
|
||||
POLY_OPA_DISP =
|
||||
SkelAnime_DrawSV2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
this->skelAnime.dListCount, func_8089DC4C, func_8089DC84, &this->actor, POLY_OPA_DISP);
|
||||
SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, func_8089DC4C, func_8089DC84, &this->actor, POLY_OPA_DISP);
|
||||
} else {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
func_800B8118(&this->actor, globalCtx, 0);
|
||||
@@ -1506,8 +1506,8 @@ void EnDinofos_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Scene_SetRenderModeXlu(globalCtx, 1, 2);
|
||||
POLY_XLU_DISP =
|
||||
SkelAnime_DrawSV2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
this->skelAnime.dListCount, func_8089DC4C, func_8089DC84, &this->actor, POLY_XLU_DISP);
|
||||
SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, func_8089DC4C, func_8089DC84, &this->actor, POLY_XLU_DISP);
|
||||
}
|
||||
|
||||
func_800BE680(globalCtx, &this->actor, this->unk_2D4, 12, this->unk_2B4, this->unk_2B8, this->unk_2B0,
|
||||
|
||||
@@ -163,17 +163,17 @@ void func_80A50510(EnDnb* this, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++) {
|
||||
SysMatrix_StatePush();
|
||||
SysMatrix_InsertTranslation(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y,
|
||||
this->particles[i].unk_0C.z, MTXMODE_NEW);
|
||||
SysMatrix_InsertXRotation_s(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y, this->particles[i].unk_0C.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->particles[i].unk_18.y, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gfx[i]);
|
||||
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -188,17 +188,17 @@ void func_80A5063C(EnDnb* this, GlobalContext* globalCtx) {
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++) {
|
||||
SysMatrix_StatePush();
|
||||
SysMatrix_InsertTranslation(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y,
|
||||
this->particles[i].unk_0C.z, MTXMODE_NEW);
|
||||
SysMatrix_InsertXRotation_s(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(this->particles[i].unk_0C.x, this->particles[i].unk_0C.y, this->particles[i].unk_0C.z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_InsertXRotation_s(this->particles[i].unk_18.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->particles[i].unk_18.y, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->particles[i].unk_18.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gfx[i]);
|
||||
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -279,16 +279,16 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 0);
|
||||
isGfxSetup = true;
|
||||
}
|
||||
SysMatrix_StatePush();
|
||||
Matrix_StatePush();
|
||||
|
||||
if (1) {};
|
||||
arg0->unk_24 = (arg0->unk_01 / (f32)arg0->unk_02) * 255.0f;
|
||||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)arg0->unk_24);
|
||||
|
||||
SysMatrix_InsertTranslation(arg0->unk_0C.x, arg0->unk_0C.y, arg0->unk_0C.z, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(arg0->unk_0C.x, arg0->unk_0C.y, arg0->unk_0C.z, MTXMODE_NEW);
|
||||
Matrix_Scale(arg0->unk_04, arg0->unk_04, 1.0f, MTXMODE_APPLY);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -296,7 +296,7 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) {
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80A50CBC[idx]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_06000020);
|
||||
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
sp5C += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,14 +148,14 @@ s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) {
|
||||
sp30 = true;
|
||||
frameCount = sAnimations[animIndex].frameCount;
|
||||
if (frameCount < 0) {
|
||||
frameCount = SkelAnime_GetFrameCount(&(sAnimations[animIndex].animationSeg)->common);
|
||||
frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg);
|
||||
}
|
||||
frame = sAnimations[animIndex].frame;
|
||||
if (frame < 0) {
|
||||
frame = frameCount;
|
||||
}
|
||||
SkelAnime_ChangeAnim(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed,
|
||||
frame, frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].transitionRate);
|
||||
Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed,
|
||||
frame, frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].transitionRate);
|
||||
}
|
||||
}
|
||||
return sp30;
|
||||
@@ -263,7 +263,7 @@ void EnDnk_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80A515C4(this);
|
||||
Actor_SetHeight(&this->actor, 34.0f);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
@@ -288,10 +288,10 @@ void func_80A51AA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
Vec3s sp3C;
|
||||
|
||||
if (limbIndex == 2) {
|
||||
SysMatrix_MultiplyVector3fByState(&sp50, &sp44);
|
||||
SysMatrix_CopyCurrentState(&sp5C);
|
||||
Matrix_MultiplyVector3fByState(&sp50, &sp44);
|
||||
Matrix_CopyCurrentState(&sp5C);
|
||||
func_8018219C(&sp5C, &sp3C, 0);
|
||||
SysMatrix_InsertTranslation(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
if (this->unk_28C & 0x10) {
|
||||
if (this->unk_28C & 0x20) {
|
||||
@@ -315,8 +315,8 @@ void func_80A51AA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
}
|
||||
|
||||
Matrix_RotateY(this->unk_292, MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(this->unk_290, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->unk_294, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_290, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_294, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -342,8 +342,8 @@ void func_80A51CB8(EnDnk* this, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80A5245C[this->unk_2A0]));
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, func_80A51A78, func_80A51AA4,
|
||||
&this->actor);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, func_80A51A78, func_80A51AA4,
|
||||
&this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -364,10 +364,10 @@ void func_80A51DA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
Vec3s sp3C;
|
||||
|
||||
if (limbIndex == 2) {
|
||||
SysMatrix_MultiplyVector3fByState(&sp50, &sp44);
|
||||
SysMatrix_CopyCurrentState(&sp5C);
|
||||
Matrix_MultiplyVector3fByState(&sp50, &sp44);
|
||||
Matrix_CopyCurrentState(&sp5C);
|
||||
func_8018219C(&sp5C, &sp3C, 0);
|
||||
SysMatrix_InsertTranslation(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(sp44.x, sp44.y, sp44.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
if (this->unk_28C & 0x10) {
|
||||
@@ -392,8 +392,8 @@ void func_80A51DA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
}
|
||||
|
||||
Matrix_RotateY(this->unk_292, MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(this->unk_290, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->unk_294, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_290, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_294, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -406,8 +406,8 @@ void func_80A51DA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
||||
|
||||
void func_80A51FC0(EnDnk* this, GlobalContext* globalCtx) {
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, func_80A51D78, func_80A51DA4,
|
||||
&this->actor);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, func_80A51D78, func_80A51DA4,
|
||||
&this->actor);
|
||||
}
|
||||
|
||||
void func_80A52018(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -172,7 +172,7 @@ void func_80A715DC(EnDno* this, GlobalContext* globalCtx) {
|
||||
&this->actor.world.pos, &sp88)) {
|
||||
Math_Vec3f_Diff(&this->actor.world.pos, &crace->actor.home.pos, &sp7C);
|
||||
Matrix_RotateY(-crace->actor.home.rot.y, 0);
|
||||
SysMatrix_MultiplyVector3fByState(&sp7C, &sp70);
|
||||
Matrix_MultiplyVector3fByState(&sp7C, &sp70);
|
||||
if ((fabsf(sp70.x) < 100.0f) && (sp70.y >= -10.0f) && (sp70.y <= 180.0f) && (sp70.z < 0.0f)) {
|
||||
crace->unk_170 |= 1;
|
||||
}
|
||||
@@ -213,19 +213,19 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if (actor == NULL) {
|
||||
Actor_ProcessInitChain(thisx, sInitChain);
|
||||
ActorShape_Init(&thisx->shape, 0.0f, func_800B3FC0, 21.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600E1F8, &D_06007CA4, this->jointTable, this->morphTable,
|
||||
28);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E1F8, &D_06007CA4, this->jointTable,
|
||||
this->morphTable, 28);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, sAnimations[14].animationSeg, 1.0f, 0.0f,
|
||||
SkelAnime_GetFrameCount(&(sAnimations[14].animationSeg)->common), sAnimations[14].mode,
|
||||
sAnimations[14].transitionRate);
|
||||
Animation_Change(&this->skelAnime, sAnimations[14].animationSeg, 1.0f, 0.0f,
|
||||
Animation_GetLastFrame(sAnimations[14].animationSeg), sAnimations[14].mode,
|
||||
sAnimations[14].transitionRate);
|
||||
this->unk_3BE = 0x3E93;
|
||||
this->unk_3C0 = 60.0f;
|
||||
this->unk_3B0 = 0;
|
||||
this->unk_468 = 99;
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
|
||||
switch (ENDNO_GET_C000(thisx)) {
|
||||
case ENDNO_GET_C000_0:
|
||||
@@ -309,7 +309,7 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) {
|
||||
|
||||
case 3:
|
||||
case 10:
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
|
||||
}
|
||||
break;
|
||||
@@ -319,7 +319,7 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C);
|
||||
}
|
||||
|
||||
@@ -390,8 +390,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
|
||||
case 0x80F:
|
||||
if (this->unk_32C == 13) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 4, &this->unk_32C);
|
||||
} else if ((this->unk_32C == 4) &&
|
||||
(this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount)) {
|
||||
} else if ((this->unk_32C == 4) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 11, &this->unk_32C);
|
||||
func_801518B0(globalCtx, this->unk_464, &this->actor);
|
||||
}
|
||||
@@ -404,7 +403,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
|
||||
if (globalCtx->msgCtx.unk11F04 == 0x80B) {
|
||||
switch (this->unk_32C) {
|
||||
case 16:
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 9, &this->unk_32C);
|
||||
}
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y,
|
||||
@@ -412,7 +411,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
|
||||
case 10:
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_801477B4(globalCtx);
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 0xD, &this->unk_32C);
|
||||
func_80A71B68(this, globalCtx);
|
||||
@@ -429,7 +428,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
|
||||
case 0x80B:
|
||||
switch (this->unk_32C) {
|
||||
case 16:
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 9, &this->unk_32C);
|
||||
}
|
||||
break;
|
||||
@@ -442,7 +441,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
|
||||
case 10:
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_801477B4(globalCtx);
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
|
||||
func_80A71B68(this, globalCtx);
|
||||
@@ -467,7 +466,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_32C == 11) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 3, &this->unk_32C);
|
||||
} else if (this->unk_32C == 3) {
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
|
||||
}
|
||||
} else if ((this->unk_32C == 13) && func_80147624(globalCtx)) {
|
||||
@@ -496,7 +495,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
|
||||
case 15:
|
||||
if (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount) {
|
||||
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C);
|
||||
}
|
||||
break;
|
||||
@@ -564,8 +563,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
|
||||
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x2D8)) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 5, &this->unk_32C);
|
||||
}
|
||||
} else if ((this->unk_32C == 5) &&
|
||||
func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
} else if ((this->unk_32C == 5) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
if (Flags_GetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor))) {
|
||||
func_801518B0(globalCtx, 0x801, &this->actor);
|
||||
} else if (Player_GetMask(globalCtx) == PLAYER_MASK_MASK_OF_SCENTS) {
|
||||
@@ -596,18 +594,18 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
|
||||
if (((globalCtx->msgCtx.unk11F04 == 0x800) || (globalCtx->msgCtx.unk11F04 == 0x801)) &&
|
||||
(this->unk_32C == 8)) {
|
||||
Math_SmoothStepToF(&this->unk_454, 1.0f, 1.0f, 0.1f, 0.01f);
|
||||
if (this->skelAnime.animCurrentFrame <= 23.0f) {
|
||||
if (this->skelAnime.curFrame <= 23.0f) {
|
||||
this->unk_452 = 3;
|
||||
if (func_801378B8(&this->skelAnime, 23.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 23.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_OPEN_AMBRELLA);
|
||||
}
|
||||
} else if (this->skelAnime.animCurrentFrame <= 24.0f) {
|
||||
} else if (this->skelAnime.curFrame <= 24.0f) {
|
||||
this->unk_452 = 4;
|
||||
} else if (this->skelAnime.animCurrentFrame >= 25.0f) {
|
||||
} else if (this->skelAnime.curFrame >= 25.0f) {
|
||||
this->unk_452 = 2;
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 12, &this->unk_32C);
|
||||
func_801518B0(globalCtx, 0x803, &this->actor);
|
||||
}
|
||||
@@ -656,8 +654,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
|
||||
this->unk_3B0 |= 0x40;
|
||||
}
|
||||
}
|
||||
} else if ((this->unk_32C == 5) &&
|
||||
(this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount)) {
|
||||
} else if ((this->unk_32C == 5) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) {
|
||||
func_801477B4(globalCtx);
|
||||
func_80A72438(this, globalCtx);
|
||||
}
|
||||
@@ -684,7 +681,7 @@ void func_80A72AE4(EnDno* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80A72B3C(EnDno* this, GlobalContext* globalCtx) {
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
this->unk_44E = 0;
|
||||
func_80A72C04(this, globalCtx);
|
||||
}
|
||||
@@ -785,7 +782,7 @@ void func_80A730A0(EnDno* this, GlobalContext* globalCtx) {
|
||||
f32 temp_f10;
|
||||
s32 phi_a2;
|
||||
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
phi_a2 = -1;
|
||||
switch (this->unk_32C) {
|
||||
case 0:
|
||||
@@ -850,18 +847,18 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 7, &this->unk_32C);
|
||||
}
|
||||
} else if (this->unk_44E == 3) {
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C);
|
||||
func_80A72438(this, globalCtx);
|
||||
} else {
|
||||
if (this->skelAnime.animCurrentFrame >= 20.0f) {
|
||||
if (this->skelAnime.curFrame >= 20.0f) {
|
||||
Math_SmoothStepToF(&this->unk_454, 0.0f, 1.0f, 0.125f, 0.01f);
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 4.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 4.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOSE_AMBRELLA);
|
||||
this->unk_452 = 4;
|
||||
} else if (func_801378B8(&this->skelAnime, 5.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 5.0f)) {
|
||||
this->unk_452 = 3;
|
||||
}
|
||||
}
|
||||
@@ -899,7 +896,7 @@ void func_80A73408(EnDno* this, GlobalContext* globalCtx) {
|
||||
func_800EDF24(&this->actor, globalCtx, temp_v0);
|
||||
}
|
||||
|
||||
if ((func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) && (this->unk_32C == 17)) {
|
||||
if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && (this->unk_32C == 17)) {
|
||||
if (0) {};
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 18, &this->unk_32C);
|
||||
}
|
||||
@@ -909,7 +906,7 @@ void EnDno_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDno* this = THIS;
|
||||
s32 pad;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80A73408(this, globalCtx);
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (this->unk_3B0 & 4) {
|
||||
@@ -923,8 +920,8 @@ void EnDno_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnDno_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDno* this = THIS;
|
||||
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnDno_OverrideLimbDraw, EnDno_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnDno_OverrideLimbDraw, EnDno_PostLimbDraw, &this->actor);
|
||||
}
|
||||
|
||||
s32 EnDno_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
|
||||
@@ -987,8 +984,8 @@ void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
if (limbIndex == 13) {
|
||||
Matrix_Scale(this->unk_454, this->unk_454, this->unk_454, 1);
|
||||
SysMatrix_InsertXRotation_s(this->unk_45C, 1);
|
||||
Matrix_Scale(this->unk_454, this->unk_454, this->unk_454, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_45C, 1);
|
||||
}
|
||||
|
||||
gfxOpa = POLY_OPA_DISP;
|
||||
@@ -1004,13 +1001,13 @@ void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
SysMatrix_StatePush();
|
||||
Matrix_StatePush();
|
||||
frames = globalCtx->gameplayFrames;
|
||||
SysMatrix_MultiplyVector3fByState(&D_80A73B40, &sp84);
|
||||
Matrix_MultiplyVector3fByState(&D_80A73B40, &sp84);
|
||||
func_80A711D0(this, globalCtx, &sp84);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(0.15f, 0.15f, 1.0f, 1);
|
||||
SysMatrix_InsertTranslation(0.0f, -3200.0f, 0.0f, 1);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(0.15f, 0.15f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(0.0f, -3200.0f, 0.0f, MTXMODE_APPLY);
|
||||
gfxXlu = func_8012C2B4(POLY_XLU_DISP);
|
||||
|
||||
gSPMatrix(gfxXlu, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -1022,7 +1019,7 @@ void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
|
||||
POLY_XLU_DISP = gfxXlu + 5;
|
||||
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -102,38 +102,38 @@ static s32 D_80B3DE58[] = {
|
||||
|
||||
s32 func_80B3CA20(EnDnp* this) {
|
||||
if ((this->unk_340 == 2) || (this->unk_340 == 9)) {
|
||||
if (func_801378B8(&this->skelAnime, 1.0f) || func_801378B8(&this->skelAnime, 5.0f) ||
|
||||
func_801378B8(&this->skelAnime, 9.0f) || func_801378B8(&this->skelAnime, 13.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 5.0f) ||
|
||||
Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_TURN);
|
||||
}
|
||||
} else if ((this->unk_340 == 24) || (this->unk_340 == 7)) {
|
||||
if (func_801378B8(&this->skelAnime, 1.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 1.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_TURN);
|
||||
}
|
||||
} else if (this->unk_340 == 14) {
|
||||
if (func_801378B8(&this->skelAnime, 7.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 7.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET);
|
||||
}
|
||||
if (func_801378B8(&this->skelAnime, 22.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 22.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET2);
|
||||
}
|
||||
} else if (this->unk_340 == 8) {
|
||||
if (func_801378B8(&this->skelAnime, 9.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 9.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET);
|
||||
}
|
||||
if (func_801378B8(&this->skelAnime, 18.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 18.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_GREET2);
|
||||
}
|
||||
} else if ((this->unk_340 == 17) && (this->unk_340 == 18)) {
|
||||
if (func_801378B8(&this->skelAnime, 7.0f) || func_801378B8(&this->skelAnime, 15.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 7.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_WALK);
|
||||
}
|
||||
} else if (this->unk_340 == 21) {
|
||||
if (func_801378B8(&this->skelAnime, 17.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 17.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_WALK);
|
||||
}
|
||||
} else if (this->unk_340 == 23) {
|
||||
if (func_801378B8(&this->skelAnime, 3.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 3.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKUHIME_WALK);
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,7 @@ void func_80B3D11C(EnDnp* this, GlobalContext* globalCtx) {
|
||||
this->unk_324 = val;
|
||||
if (((this->unk_340 == 10) || (this->unk_340 == 12) || (this->unk_340 == 5) || (this->unk_340 == 19) ||
|
||||
(this->unk_340 == 22) || (this->unk_340 == 24)) &&
|
||||
func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
func_80B3CC38(this, this->unk_340 + 1);
|
||||
}
|
||||
func_800EDF24(&this->actor, globalCtx, temp_v0);
|
||||
@@ -358,7 +358,7 @@ void EnDnp_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDnp* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 16.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06010D60, NULL, this->jointTable, this->morphTable, 26);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D60, NULL, this->jointTable, this->morphTable, 26);
|
||||
this->unk_340 = -1;
|
||||
func_80B3CC38(this, 15);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
@@ -405,12 +405,12 @@ void EnDnp_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (!func_80B3CF60(this, globalCtx) && func_80B3D044(this, globalCtx)) {
|
||||
func_80B3D11C(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80B3CD1C(this);
|
||||
func_80B3CEC0(this, globalCtx);
|
||||
} else {
|
||||
this->actionFunc(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80B3CD1C(this);
|
||||
func_80B3CEC0(this, globalCtx);
|
||||
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
|
||||
@@ -435,8 +435,8 @@ s32 func_80B3D974(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 ar
|
||||
Vec3s sp6C;
|
||||
MtxF sp2C;
|
||||
|
||||
SysMatrix_MultiplyVector3fByState(&D_801D15B0, &sp74);
|
||||
SysMatrix_CopyCurrentState(&sp2C);
|
||||
Matrix_MultiplyVector3fByState(&D_801D15B0, &sp74);
|
||||
Matrix_CopyCurrentState(&sp2C);
|
||||
func_8018219C(&sp2C, &sp6C, 0);
|
||||
*arg2 = sp74;
|
||||
if (arg4 == 0) {
|
||||
@@ -478,13 +478,13 @@ void func_80B3DAA0(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
|
||||
if (limbIndex == 12) {
|
||||
func_80B3D974(this->unk_330 + 0x4000, this->unk_332 + this->actor.shape.rot.y + 0x4000, &this->unk_1D8,
|
||||
&this->unk_1E4, phi_v1, phi_v0);
|
||||
SysMatrix_StatePop();
|
||||
SysMatrix_InsertTranslation(this->unk_1D8.x, this->unk_1D8.y, this->unk_1D8.z, MTXMODE_NEW);
|
||||
Matrix_StatePop();
|
||||
Matrix_InsertTranslation(this->unk_1D8.x, this->unk_1D8.y, this->unk_1D8.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_1E4.y, MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(this->unk_1E4.x, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->unk_1E4.z, MTXMODE_APPLY);
|
||||
SysMatrix_StatePush();
|
||||
Matrix_InsertXRotation_s(this->unk_1E4.x, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_1E4.z, MTXMODE_APPLY);
|
||||
Matrix_StatePush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,8 +504,8 @@ void EnDnp_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3DEAC[this->unk_336]));
|
||||
|
||||
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
NULL, func_80B3DA88, func_80B3DAA0, &this->actor);
|
||||
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
|
||||
func_80B3DA88, func_80B3DAA0, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ s32 func_80A526F8(EnDnq* this) {
|
||||
this->unk_38C = ((s32)(Rand_ZeroOne() * 100.0f) % 4) + 3;
|
||||
this->unk_388 = 0;
|
||||
this->unk_386 = 1;
|
||||
} else if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
switch (this->unk_398) {
|
||||
case 8:
|
||||
if (DECR(this->unk_38C) == 0) {
|
||||
@@ -186,7 +186,7 @@ s32 func_80A526F8(EnDnq* this) {
|
||||
}
|
||||
|
||||
if (this->unk_386 != 0) {
|
||||
this->skelAnime.animCurrentFrame = 0.0f;
|
||||
this->skelAnime.curFrame = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ s32 func_80A52944(EnDnq* this) {
|
||||
this->unk_386 = 1;
|
||||
phi_v1 = this->unk_38C * 0x2000;
|
||||
this->actor.shape.rot.y += phi_v1;
|
||||
} else if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
this->unk_386++;
|
||||
if (this->unk_386 >= 6) {
|
||||
func_80A5257C(this, 12);
|
||||
@@ -212,11 +212,11 @@ s32 func_80A52944(EnDnq* this) {
|
||||
phi_v1 = this->unk_38C * 0x2000;
|
||||
} else if (this->unk_386 <= 3) {
|
||||
this->unk_38C = -this->unk_38C;
|
||||
this->skelAnime.animCurrentFrame = 0.0f;
|
||||
this->skelAnime.curFrame = 0.0f;
|
||||
phi_v1 = this->unk_38C * 0x2000;
|
||||
} else {
|
||||
func_80A5257C(this, 13);
|
||||
this->skelAnime.animCurrentFrame = 0.0f;
|
||||
this->skelAnime.curFrame = 0.0f;
|
||||
}
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
this->actor.shape.rot.y += phi_v1;
|
||||
@@ -242,14 +242,14 @@ s32 func_80A52A78(EnDnq* this, GlobalContext* globalCtx) {
|
||||
this->unk_38C--;
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
if (this->unk_38C == 0) {
|
||||
this->unk_38C = Rand_S16Offset(20, 20);
|
||||
this->unk_388 += 3;
|
||||
this->unk_388 %= 5;
|
||||
}
|
||||
func_80A5257C(this, D_80A535DC[this->unk_388]);
|
||||
this->skelAnime.animCurrentFrame = 0.0f;
|
||||
this->skelAnime.curFrame = 0.0f;
|
||||
}
|
||||
|
||||
this->unk_386 = 0;
|
||||
@@ -403,12 +403,12 @@ void func_80A53038(EnDnq* this, GlobalContext* globalCtx) {
|
||||
this->unk_1DC = temp_v1;
|
||||
}
|
||||
|
||||
if ((this->unk_398 == 4) && func_801378B8(&this->skelAnime, 2.0f)) {
|
||||
if ((this->unk_398 == 4) && Animation_OnFrame(&this->skelAnime, 2.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_KINGNUTS_DAMAGE);
|
||||
}
|
||||
|
||||
if (((this->unk_398 == 3) || (this->unk_398 == 6)) &&
|
||||
func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
func_80A5257C(this, this->unk_398 + 1);
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ void EnDnq_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDnq* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 14.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600EB48, NULL, this->jointTable, this->morphTable, 33);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600EB48, NULL, this->jointTable, this->morphTable, 33);
|
||||
this->unk_398 = -1;
|
||||
func_80A5257C(this, 0);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
@@ -450,11 +450,11 @@ void EnDnq_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (!func_80A52D44(this, globalCtx) && func_80A52648(this, globalCtx)) {
|
||||
func_80A53038(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
} else {
|
||||
this->actionFunc(this, globalCtx);
|
||||
func_80A52B68(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
|
||||
this->unk_394 = this->actor.xzDistToPlayer;
|
||||
func_80A52C6C(this, globalCtx);
|
||||
@@ -470,6 +470,6 @@ void EnDnq_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDnq* this = THIS;
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL,
|
||||
NULL, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
NULL, NULL, &this->actor);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void func_8092C5C0(EnDns* this) {
|
||||
s32 pad;
|
||||
|
||||
if (((this->unk_2F8 == 2) || (this->unk_2F8 == 3) || (this->unk_2F8 == 6) || (this->unk_2F8 == 7)) &&
|
||||
(func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 3.0f))) {
|
||||
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 3.0f))) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK);
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ s32 func_8092CAD0(EnDns* this, GlobalContext* globalCtx) {
|
||||
if (ENDNS_GET_4000(&this->actor)) {
|
||||
this->unk_2F0 = 0.0f;
|
||||
if (this->unk_2D2 != 0) {
|
||||
this->unk_2F0 = this->skelAnime.animCurrentFrame;
|
||||
this->unk_2F0 = this->skelAnime.curFrame;
|
||||
func_8092C63C(this, 2);
|
||||
}
|
||||
this->unk_2DA = this->actor.world.rot.y;
|
||||
@@ -303,10 +303,10 @@ s32 func_8092CE38(EnDns* this) {
|
||||
Vec3f sp2C;
|
||||
s32 ret = false;
|
||||
|
||||
if ((this->unk_2C6 & 0x200) || func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if ((this->unk_2C6 & 0x200) || Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
func_8092C63C(this, D_8092DE00[this->unk_2D2]);
|
||||
this->unk_2C6 &= ~0x200;
|
||||
this->skelAnime.animCurrentFrame = 0.0f;
|
||||
this->skelAnime.curFrame = 0.0f;
|
||||
if (this->unk_2D2 == 2) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_JUMP);
|
||||
}
|
||||
@@ -317,25 +317,25 @@ s32 func_8092CE38(EnDns* this) {
|
||||
ret = true;
|
||||
} else {
|
||||
if (this->unk_2D2 == 0) {
|
||||
if (func_801378B8(&this->skelAnime, 13.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 13.0f)) {
|
||||
this->actor.world.rot.y = BINANG_ROT180(this->actor.world.rot.y);
|
||||
this->unk_2E4 = 0.0f;
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_JUMP);
|
||||
} else if (this->skelAnime.animCurrentFrame < 13.0f) {
|
||||
frame = this->skelAnime.animCurrentFrame;
|
||||
} else if (this->skelAnime.curFrame < 13.0f) {
|
||||
frame = this->skelAnime.curFrame;
|
||||
this->actor.shape.rot.y = this->actor.world.rot.y;
|
||||
frame *= 2520;
|
||||
this->actor.shape.rot.y += frame;
|
||||
this->unk_2E4 -= -(40.0f / 13.0f);
|
||||
}
|
||||
} else {
|
||||
if (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 6.0f) ||
|
||||
func_801378B8(&this->skelAnime, 13.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f) ||
|
||||
Animation_OnFrame(&this->skelAnime, 13.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK);
|
||||
}
|
||||
|
||||
if (this->skelAnime.animCurrentFrame > 7.0f) {
|
||||
if (this->skelAnime.curFrame > 7.0f) {
|
||||
this->unk_2E4 += -(20.0f / 13.0f);
|
||||
}
|
||||
}
|
||||
@@ -371,8 +371,8 @@ void func_8092D108(EnDns* this, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
|
||||
SysMatrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
Matrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
|
||||
&this->actor.home.rot);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
@@ -450,7 +450,7 @@ void func_8092D4D8(EnDns* this, GlobalContext* globalCtx) {
|
||||
this->unk_2F4 = NULL;
|
||||
if (ENDNS_GET_4000(&this->actor)) {
|
||||
if (!(gSaveContext.eventInf[1] & 0x20)) {
|
||||
this->skelAnime.animCurrentFrame = this->unk_2F0;
|
||||
this->skelAnime.curFrame = this->unk_2F0;
|
||||
this->actor.world.rot.y = this->unk_2DA;
|
||||
func_8092C63C(this, 8);
|
||||
}
|
||||
@@ -478,7 +478,7 @@ void func_8092D5E8(EnDns* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if (((this->unk_2F8 == 4) || (this->unk_2F8 == 6)) &&
|
||||
func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
func_8092C63C(this, this->unk_2F8 + 1);
|
||||
}
|
||||
|
||||
@@ -529,11 +529,11 @@ void EnDns_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (!func_8092CAD0(this, globalCtx) && func_8092CB98(this, globalCtx)) {
|
||||
func_8092D5E8(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_8092C5C0(this);
|
||||
} else {
|
||||
this->actionFunc(this, globalCtx);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_8092C934(this);
|
||||
func_8092C86C(this, globalCtx);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
|
||||
@@ -549,8 +549,8 @@ s32 func_8092D954(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 ar
|
||||
Vec3s sp6C;
|
||||
MtxF sp2C;
|
||||
|
||||
SysMatrix_MultiplyVector3fByState(&D_801D15B0, &sp74);
|
||||
SysMatrix_CopyCurrentState(&sp2C);
|
||||
Matrix_MultiplyVector3fByState(&D_801D15B0, &sp74);
|
||||
Matrix_CopyCurrentState(&sp2C);
|
||||
func_8018219C(&sp2C, &sp6C, 0);
|
||||
*arg2 = sp74;
|
||||
|
||||
@@ -600,11 +600,11 @@ void EnDns_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
|
||||
if (limbIndex == 2) {
|
||||
func_8092D954(this->unk_2CC, this->unk_2CE + this->actor.shape.rot.y, &this->unk_218, &this->unk_224, phi_v1,
|
||||
phi_v0);
|
||||
SysMatrix_InsertTranslation(this->unk_218.x, this->unk_218.y, this->unk_218.z, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(this->unk_218.x, this->unk_218.y, this->unk_218.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_224.y, MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(this->unk_224.z, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->unk_224.x, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_224.z, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_224.x, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
@@ -626,8 +626,8 @@ void EnDns_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_8092DE1C[this->unk_2E0]));
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnDns_OverrideLimbDraw,
|
||||
EnDns_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDns_OverrideLimbDraw,
|
||||
EnDns_PostLimbDraw, &this->actor);
|
||||
func_8092D108(this, globalCtx);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -513,8 +513,8 @@ void func_80876DC4(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
s32 func_8087721C(EnDodongo* this) {
|
||||
if ((this->actionFunc == func_8087784C) && (this->skelAnime.animCurrentFrame >= 29.0f) &&
|
||||
(this->skelAnime.animCurrentFrame <= 43.0f)) {
|
||||
if ((this->actionFunc == func_8087784C) && (this->skelAnime.curFrame >= 29.0f) &&
|
||||
(this->skelAnime.curFrame <= 43.0f)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -544,27 +544,27 @@ s32 func_80877278(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808773C4(EnDodongo* this) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06004C20, -4.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06004C20, -4.0f);
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->timer = Rand_S16Offset(30, 50);
|
||||
this->actionFunc = func_80877424;
|
||||
}
|
||||
|
||||
void func_80877424(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
if (func_801378B8(&this->skelAnime, 0.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
|
||||
func_80877494(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_80877494(EnDodongo* this) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06008B1C, -4.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06008B1C, -4.0f);
|
||||
this->actor.speedXZ = this->unk_334 * 1.5f;
|
||||
this->timer = Rand_S16Offset(50, 70);
|
||||
this->actionFunc = func_80877500;
|
||||
@@ -575,14 +575,14 @@ void func_80877500(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
Vec3f sp30;
|
||||
s16 temp_v1;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_801378B8(&this->skelAnime, 19.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 19.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_WALK);
|
||||
sp30.x = this->collider1Elements[2].dim.worldSphere.center.x;
|
||||
sp30.y = this->collider1Elements[2].dim.worldSphere.center.y;
|
||||
sp30.z = this->collider1Elements[2].dim.worldSphere.center.z;
|
||||
func_80876930(this, globalCtx, &sp30);
|
||||
} else if (func_801378B8(&this->skelAnime, 39.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 39.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_WALK);
|
||||
sp30.x = this->collider1Elements[1].dim.worldSphere.center.x;
|
||||
sp30.y = this->collider1Elements[1].dim.worldSphere.center.y;
|
||||
@@ -623,7 +623,7 @@ void func_808777A8(EnDodongo* this) {
|
||||
s32 i;
|
||||
Sphere16* sph;
|
||||
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060028F0, -4.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_060028F0, -4.0f);
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(this->collider3Elements); i++) {
|
||||
@@ -648,13 +648,13 @@ void func_8087784C(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
f32 temp_f2;
|
||||
f32 temp_f12;
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 24.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 24.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_CRY);
|
||||
}
|
||||
|
||||
if (func_8087721C(this)) {
|
||||
func_800B9010(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG);
|
||||
frame = this->skelAnime.animCurrentFrame - 29.0f;
|
||||
frame = this->skelAnime.curFrame - 29.0f;
|
||||
end = frame >> 1;
|
||||
if (end > 3) {
|
||||
end = 3;
|
||||
@@ -678,29 +678,29 @@ void func_8087784C(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
D_80879348.z = 2.5f * temp_f12;
|
||||
EffectSsDFire_Spawn(globalCtx, &this->unk_348[0], &D_80879354, &D_80879348, this->unk_334 * 100.0f,
|
||||
this->unk_334 * 35.0f, 0xFF - (frame * 10), 5, 0, 8);
|
||||
} else if ((this->skelAnime.animCurrentFrame >= 2.0f) && (this->skelAnime.animCurrentFrame <= 20.0f)) {
|
||||
} else if ((this->skelAnime.curFrame >= 2.0f) && (this->skelAnime.curFrame <= 20.0f)) {
|
||||
func_800B9010(&this->actor, NA_SE_EN_DODO_J_BREATH - SFX_FLAG);
|
||||
}
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_80877D50(this);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80877D50(EnDodongo* this) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06003088);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_06003088);
|
||||
this->actionFunc = func_80877D90;
|
||||
}
|
||||
|
||||
void func_80877D90(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_808773C4(this);
|
||||
this->timer = Rand_S16Offset(10, 20);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80877DE0(EnDodongo* this) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_060028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f);
|
||||
Animation_Change(&this->skelAnime, &D_060028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f);
|
||||
this->actor.flags |= 0x10;
|
||||
this->timer = 25;
|
||||
this->actionFunc = func_80877E60;
|
||||
@@ -735,14 +735,14 @@ void func_80877E60(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
this->actor.child->freezeTimer = 30000; // 25 minutes
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 28.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 28.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_EAT);
|
||||
if (this->actor.child != NULL) {
|
||||
Actor_MarkForDeath(this->actor.child);
|
||||
this->actor.child = NULL;
|
||||
}
|
||||
this->actor.flags &= ~0x10;
|
||||
} else if (this->skelAnime.animPlaybackSpeed > -0.5f) {
|
||||
} else if (this->skelAnime.playSpeed > -0.5f) {
|
||||
this->timer--;
|
||||
if (this->timer == 10) {
|
||||
for (i = 10; i >= 0; i--) {
|
||||
@@ -768,13 +768,13 @@ void func_80877E60(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
func_800BCB70(&this->actor, 0x4000, 0x78, 0, 8);
|
||||
}
|
||||
} else if (func_801378B8(&this->skelAnime, 24.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 24.0f)) {
|
||||
this->timer--;
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
}
|
||||
|
||||
if (this->skelAnime.animCurrentFrame <= 27.0f) {
|
||||
if ((this->skelAnime.animCurrentFrame <= 25.0f) && (this->timer < 11)) {
|
||||
if (this->skelAnime.curFrame <= 27.0f) {
|
||||
if ((this->skelAnime.curFrame <= 25.0f) && (this->timer < 11)) {
|
||||
func_80876DC4(this, globalCtx);
|
||||
} else {
|
||||
sp5E = this->unk_334 * 50.0f;
|
||||
@@ -793,7 +793,7 @@ void func_80877E60(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
this->unk_314.z = Math_SinS((this->actor.colorFilterTimer * 0x1000) >> 1) + 1.0f;
|
||||
this->unk_314.x = Math_SinS(this->actor.colorFilterTimer * 0x1000) + 1.0f;
|
||||
this->unk_314.y = this->unk_314.z;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->timer == 0) {
|
||||
if (this->actor.colChkInfo.health == 0) {
|
||||
func_80878724(this);
|
||||
@@ -819,7 +819,7 @@ void func_80878354(EnDodongo* this) {
|
||||
}
|
||||
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_TAIL);
|
||||
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, sp18, 2.0f);
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, sp18, 2.0f);
|
||||
this->timer = 0;
|
||||
this->collider1.base.atFlags |= AT_ON;
|
||||
this->unk_304 = -1;
|
||||
@@ -831,7 +831,7 @@ void func_80878424(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
Vec3f sp20;
|
||||
|
||||
this->timer++;
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (!(player->stateFlags1 & 0x800000) && (Player_GetMask(globalCtx) != PLAYER_MASK_STONE_MASK)) {
|
||||
this->collider1.base.atFlags &= ~AT_ON;
|
||||
func_808777A8(this);
|
||||
@@ -878,7 +878,7 @@ void func_808785B0(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8087864C(EnDodongo* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001A44, -4.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001A44, -4.0f);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DAMAGE);
|
||||
this->timer = 0;
|
||||
this->unk_304 = 0;
|
||||
@@ -892,13 +892,13 @@ void func_808786C8(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
func_80876DC4(this, globalCtx);
|
||||
}
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
func_80876B08(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80878724(EnDodongo* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060013C4, -8.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_060013C4, -8.0f);
|
||||
this->timer = 0;
|
||||
this->unk_304 = 0;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DEAD);
|
||||
@@ -911,7 +911,7 @@ void func_80878724(EnDodongo* this) {
|
||||
void func_808787B0(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
if (this->skelAnime.animCurrentFrame < 35.0f) {
|
||||
if (this->skelAnime.curFrame < 35.0f) {
|
||||
if (this->unk_304 != 0) {
|
||||
func_80876DC4(this, globalCtx);
|
||||
}
|
||||
@@ -919,7 +919,7 @@ void func_808787B0(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
func_800BCB70(&this->actor, 0x4000, 0x78, 0, 4);
|
||||
}
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (this->timer == 0) {
|
||||
EnBom* bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
@@ -928,7 +928,7 @@ void func_808787B0(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
this->timer = 8;
|
||||
}
|
||||
} else if (func_801378B8(&this->skelAnime, 52.0f)) {
|
||||
} else if (Animation_OnFrame(&this->skelAnime, 52.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DOWN);
|
||||
}
|
||||
|
||||
@@ -1086,16 +1086,16 @@ void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
|
||||
Collider_UpdateSpheres(limbIndex, &this->collider1);
|
||||
Collider_UpdateSpheres(limbIndex, &this->collider2);
|
||||
if (D_80879388[limbIndex] != -1) {
|
||||
SysMatrix_GetStateTranslation(&this->unk_348[D_80879388[limbIndex]]);
|
||||
Matrix_GetStateTranslation(&this->unk_348[D_80879388[limbIndex]]);
|
||||
}
|
||||
|
||||
if (limbIndex == 7) {
|
||||
SysMatrix_MultiplyVector3fByState(&D_80879370, &this->unk_308);
|
||||
SysMatrix_MultiplyVector3fByState(&D_8087937C, &this->unk_348[0]);
|
||||
SysMatrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
SysMatrix_GetStateTranslationAndScaledY(-200.0f, &this->unk_348[1]);
|
||||
Matrix_MultiplyVector3fByState(&D_80879370, &this->unk_308);
|
||||
Matrix_MultiplyVector3fByState(&D_8087937C, &this->unk_348[0]);
|
||||
Matrix_GetStateTranslation(&this->actor.focus.pos);
|
||||
Matrix_GetStateTranslationAndScaledY(-200.0f, &this->unk_348[1]);
|
||||
} else if (limbIndex == 13) {
|
||||
SysMatrix_GetStateTranslationAndScaledX(1600.0f, &this->unk_320);
|
||||
Matrix_GetStateTranslationAndScaledX(1600.0f, &this->unk_320);
|
||||
}
|
||||
|
||||
if ((limbIndex == 30) && (this->actionFunc == func_80878424) && (this->timer != this->unk_304)) {
|
||||
@@ -1108,8 +1108,8 @@ void EnDodongo_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnDodongo* this = THIS;
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnDodongo_OverrideLimbDraw,
|
||||
EnDodongo_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDodongo_OverrideLimbDraw,
|
||||
EnDodongo_PostLimbDraw, &this->actor);
|
||||
func_800BE680(globalCtx, &this->actor, this->unk_348, ARRAY_COUNT(this->unk_348), this->unk_340 * this->unk_334,
|
||||
this->unk_344 * this->unk_334, this->unk_33C, this->unk_300);
|
||||
}
|
||||
|
||||
@@ -153,12 +153,12 @@ void EnElfbub_Draw(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
|
||||
SysMatrix_InsertTranslation(0.0f, 0.0f, 1.0f, 1);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_InsertTranslation(0.0f, 0.0f, 1.0f, 1);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(this->xyScale + 1.0f, this->xyScale + 1.0f, 1.0f, 1);
|
||||
SysMatrix_InsertZRotation_s(this->zRot, 1);
|
||||
Matrix_InsertZRotation_s(this->zRot, 1);
|
||||
Matrix_Scale(this->xScale + 1.0f, 1.0f, 1.0f, 1);
|
||||
SysMatrix_InsertZRotation_s(this->zRot * -1, 1);
|
||||
Matrix_InsertZRotation_s(this->zRot * -1, 1);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_06001000);
|
||||
|
||||
@@ -270,7 +270,7 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++, sPtr++) {
|
||||
if (sPtr->enabled) {
|
||||
SysMatrix_InsertTranslation(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW);
|
||||
Matrix_InsertTranslation(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(sPtr->scale, sPtr->scale, sPtr->scale, MTXMODE_APPLY);
|
||||
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 20);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(&D_04079B10));
|
||||
@@ -278,8 +278,8 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) {
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha);
|
||||
SysMatrix_InsertMatrix(&globalCtx->mf_187FC, MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_f(DEGTORAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
Matrix_InsertMatrix(&globalCtx->mf_187FC, MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_f(DEGTORAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_0407AB58);
|
||||
|
||||
@@ -42,8 +42,7 @@ void EnEndingHero_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600B0CC, &D_06000BE0, this->limbDrawTable,
|
||||
this->transitionDrawTable, 15);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B0CC, &D_06000BE0, this->jointTable, this->morphTable, 15);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
func_80C1E748(this);
|
||||
}
|
||||
@@ -57,7 +56,7 @@ void func_80C1E748(EnEndingHero* this) {
|
||||
}
|
||||
|
||||
void func_80C1E764(EnEndingHero* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnEndingHero_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -93,8 +92,8 @@ void EnEndingHero_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C1E984[index]));
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, 0, 0,
|
||||
&this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
0, 0, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ typedef void (*EnEndingHeroActionFunc)(struct EnEndingHero*, GlobalContext*);
|
||||
typedef struct EnEndingHero {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s limbDrawTable[15];
|
||||
/* 0x1E2 */ Vec3s transitionDrawTable[15];
|
||||
/* 0x188 */ Vec3s jointTable[15];
|
||||
/* 0x1E2 */ Vec3s morphTable[15];
|
||||
/* 0x23C */ EnEndingHeroActionFunc actionFunc;
|
||||
/* 0x240 */ s16 unk240;
|
||||
/* 0x242 */ s16 unk242;
|
||||
|
||||
@@ -34,8 +34,7 @@ void EnEndingHero2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->limbDrawTable,
|
||||
this->transitionDrawTable, 20);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
func_80C232E8(this);
|
||||
}
|
||||
@@ -49,7 +48,7 @@ void func_80C232E8(EnEndingHero2* this) {
|
||||
}
|
||||
|
||||
void func_80C23304(EnEndingHero2* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnEndingHero2_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -65,6 +64,6 @@ void EnEndingHero2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, 0, 0,
|
||||
&this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
0, 0, &this->actor);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ typedef void (*EnEndingHero2ActionFunc)(struct EnEndingHero2*, GlobalContext*);
|
||||
typedef struct EnEndingHero2 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s limbDrawTable[20];
|
||||
/* 0x200 */ Vec3s transitionDrawTable[20];
|
||||
/* 0x188 */ Vec3s jointTable[20];
|
||||
/* 0x200 */ Vec3s morphTable[20];
|
||||
/* 0x278 */ EnEndingHero2ActionFunc actionFunc;
|
||||
/* 0x27C */ u16 unk27C;
|
||||
} EnEndingHero2; // size = 0x280
|
||||
|
||||
@@ -34,8 +34,7 @@ void EnEndingHero3_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->limbDrawTable,
|
||||
this->transitionDrawTable, 17);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->jointTable, this->morphTable, 17);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
func_80C23518(this);
|
||||
}
|
||||
@@ -49,7 +48,7 @@ void func_80C23518(EnEndingHero3* this) {
|
||||
}
|
||||
|
||||
void func_80C23534(EnEndingHero3* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnEndingHero3_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -65,6 +64,6 @@ void EnEndingHero3_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, 0, 0,
|
||||
&this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
0, 0, &this->actor);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ typedef void (*EnEndingHero3ActionFunc)(struct EnEndingHero3*, GlobalContext*);
|
||||
typedef struct EnEndingHero3 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s limbDrawTable[17];
|
||||
/* 0x1EE */ Vec3s transitionDrawTable[17];
|
||||
/* 0x188 */ Vec3s jointTable[17];
|
||||
/* 0x1EE */ Vec3s morphTable[17];
|
||||
/* 0x254 */ EnEndingHero3ActionFunc actionFunc;
|
||||
/* 0x258 */ u16 unk258;
|
||||
} EnEndingHero3; // size = 0x25C
|
||||
|
||||
@@ -34,8 +34,7 @@ void EnEndingHero4_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600D640, &D_06002A84, this->limbDrawTable,
|
||||
this->transitionDrawTable, 17);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D640, &D_06002A84, this->jointTable, this->morphTable, 17);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
func_80C23748(this);
|
||||
}
|
||||
@@ -49,7 +48,7 @@ void func_80C23748(EnEndingHero4* this) {
|
||||
}
|
||||
|
||||
void func_80C23764(EnEndingHero4* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnEndingHero4_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -65,6 +64,6 @@ void EnEndingHero4_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, 0, 0,
|
||||
&this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
0, 0, &this->actor);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ typedef void (*EnEndingHero4ActionFunc)(struct EnEndingHero4*, GlobalContext*);
|
||||
typedef struct EnEndingHero4 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s limbDrawTable[17];
|
||||
/* 0x1EE */ Vec3s transitionDrawTable[17];
|
||||
/* 0x188 */ Vec3s jointTable[17];
|
||||
/* 0x1EE */ Vec3s morphTable[17];
|
||||
/* 0x254 */ EnEndingHero4ActionFunc actionFunc;
|
||||
/* 0x258 */ u16 unk258;
|
||||
} EnEndingHero4; // size = 0x25C
|
||||
|
||||
@@ -40,8 +40,7 @@ void EnEndingHero5_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->limbDrawTable,
|
||||
this->transitionDrawTable, 17);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
this->unk25C = this->actor.params;
|
||||
func_80C23980(this);
|
||||
@@ -56,7 +55,7 @@ void func_80C23980(EnEndingHero5* this) {
|
||||
}
|
||||
|
||||
void func_80C2399C(EnEndingHero5* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnEndingHero5_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -106,8 +105,8 @@ void EnEndingHero5_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL,
|
||||
func_80C23A30, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
NULL, func_80C23A30, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ typedef void (*EnEndingHero5ActionFunc)(struct EnEndingHero5*, GlobalContext*);
|
||||
typedef struct EnEndingHero5 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ Vec3s limbDrawTable[17];
|
||||
/* 0x1EE */ Vec3s transitionDrawTable[17];
|
||||
/* 0x188 */ Vec3s jointTable[17];
|
||||
/* 0x1EE */ Vec3s morphTable[17];
|
||||
/* 0x254 */ EnEndingHero5ActionFunc actionFunc;
|
||||
/* 0x258 */ u16 unk258;
|
||||
/* 0x25C */ s32 unk25C;
|
||||
|
||||
@@ -76,8 +76,8 @@ void EnEndingHero6_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.targetMode = 6;
|
||||
this->actor.gravity = -3.0f;
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, sSkeletons[this->npcIndex], sAnimations[this->npcIndex],
|
||||
this->jointTable, this->morphTable, sLimbCounts[this->npcIndex]);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, sSkeletons[this->npcIndex], sAnimations[this->npcIndex],
|
||||
this->jointTable, this->morphTable, sLimbCounts[this->npcIndex]);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
EnEndingHero6_SetupIdle(this);
|
||||
}
|
||||
@@ -87,8 +87,8 @@ void EnEndingHero6_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
void EnEndingHero6_InitSkelAnime(EnEndingHero6* this, s32 npcIndex) {
|
||||
this->animIndex = npcIndex;
|
||||
this->frameCount = SkelAnime_GetFrameCount(&sAnimations[npcIndex]->common);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.f, this->frameCount, 0, 0.0f);
|
||||
this->frameCount = Animation_GetLastFrame(sAnimations[npcIndex]);
|
||||
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.f, this->frameCount, 0, 0.0f);
|
||||
}
|
||||
|
||||
void EnEndingHero6_SetupIdle(EnEndingHero6* this) {
|
||||
@@ -98,7 +98,7 @@ void EnEndingHero6_SetupIdle(EnEndingHero6* this) {
|
||||
}
|
||||
|
||||
void EnEndingHero6_Idle(EnEndingHero6* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnEndingHero6_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -182,8 +182,8 @@ void EnEndingHero6_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C24294[index]));
|
||||
}
|
||||
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
this->skelAnime.dListCount, NULL, EnEndingHero6_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, NULL, EnEndingHero6_PostLimbDraw, &this->actor);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -117,11 +117,11 @@ s32 EnFg_UpdateAnimation(SkelAnime* skelAnime, s16 animIndex) {
|
||||
ret = true;
|
||||
frameCount = sAnimations[animIndex].frameCount;
|
||||
if (frameCount < 0) {
|
||||
frameCount = SkelAnime_GetFrameCount(&sAnimations[animIndex].animationSeg->common);
|
||||
frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg);
|
||||
}
|
||||
SkelAnime_ChangeAnim(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed,
|
||||
sAnimations[animIndex].frame, frameCount, sAnimations[animIndex].mode,
|
||||
sAnimations[animIndex].transitionRate);
|
||||
Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed,
|
||||
sAnimations[animIndex].frame, frameCount, sAnimations[animIndex].mode,
|
||||
sAnimations[animIndex].transitionRate);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ void func_80A2D348(EnFg* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80A2D3D4(EnFg* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
u8 EnFg_UpdateHealth(EnFg* this) {
|
||||
@@ -185,7 +185,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) {
|
||||
case FG_DMGEFFECT_DEKUSTICK:
|
||||
this->actor.flags &= ~1;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_CRY_1);
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
this->actor.scale.x *= 1.5f;
|
||||
this->actor.scale.z *= 1.5f;
|
||||
@@ -197,7 +197,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
case FG_DMGEFFECT_ARROW:
|
||||
this->actor.flags &= ~1;
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
rotY = this->collider.base.ac->world.rot.y;
|
||||
rotX = this->collider.base.ac->world.rot.x;
|
||||
this->actor.scale.x = fabsf(0.01f * Math_CosS(rotY));
|
||||
@@ -213,7 +213,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_CRY_0);
|
||||
if (1) {}
|
||||
this->actor.params = FG_BLACK;
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
ac = this->collider.base.ac;
|
||||
this->actor.world.rot.y = Math_Vec3f_Yaw(&ac->world.pos, &this->actor.world.pos);
|
||||
this->actor.shape.rot = this->actor.world.rot;
|
||||
@@ -245,7 +245,7 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) {
|
||||
switch (EnFg_GetDamageEffect(this)) {
|
||||
case FG_DMGEFFECT_ARROW:
|
||||
this->actor.flags &= ~1;
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
ac = this->collider.base.ac;
|
||||
rotY = ac->world.rot.y;
|
||||
rotX = ac->world.rot.x;
|
||||
@@ -264,7 +264,7 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_CRY_0);
|
||||
EnFg_UpdateAnimation(&this->skelAnime, 0);
|
||||
this->actor.params = FG_BLACK;
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
ac = this->collider.base.ac;
|
||||
this->actor.world.rot.y = Math_Vec3f_Yaw(&ac->world.pos, &this->actor.world.pos);
|
||||
this->actor.shape.rot = this->actor.world.rot;
|
||||
@@ -276,9 +276,9 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc = EnFg_Knockback;
|
||||
break;
|
||||
default:
|
||||
if (func_801378B8(&this->skelAnime, 8.0f)) {
|
||||
this->skelAnime.animCurrentFrame = 8.0f;
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
if (Animation_OnFrame(&this->skelAnime, 8.0f)) {
|
||||
this->skelAnime.curFrame = 8.0f;
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
}
|
||||
|
||||
if ((this->actor.velocity.y <= 0.0f) && (this->actor.bgCheckFlags & 1)) {
|
||||
@@ -321,7 +321,7 @@ void EnFg_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnFg* this = THIS;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 10.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600B538, NULL, this->limbDrawTbl, this->transitionDrawTbl, 24);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B538, NULL, this->jointTable, this->morphTable, 24);
|
||||
EnFg_UpdateAnimation(&this->skelAnime, 0);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
@@ -360,8 +360,8 @@ void EnFg_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_80A2D348(this, globalCtx);
|
||||
}
|
||||
|
||||
s32 EnFg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
|
||||
EnFg* this = THIS;
|
||||
s32 EnFg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg) {
|
||||
EnFg* this = (EnFg*)arg;
|
||||
|
||||
if ((limbIndex == 7) || (limbIndex == 8)) {
|
||||
*dList = NULL;
|
||||
@@ -375,23 +375,23 @@ s32 EnFg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EnFg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
EnFg* this = THIS;
|
||||
void EnFg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
|
||||
EnFg* this = (EnFg*)arg;
|
||||
s16 pad;
|
||||
Vec3f vec1 = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
if ((limbIndex == 7) || (limbIndex == 8)) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
SysMatrix_StatePush();
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_StatePush();
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, *dList);
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
if (limbIndex == 4) {
|
||||
SysMatrix_MultiplyVector3fByState(&vec1, &this->actor.focus.pos);
|
||||
Matrix_MultiplyVector3fByState(&vec1, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,9 +403,9 @@ void EnFg_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
{ 120, 130, 230, 255 }, { 190, 190, 190, 255 }, { 0, 0, 0, 255 },
|
||||
};
|
||||
|
||||
SysMatrix_StatePush();
|
||||
Matrix_StatePush();
|
||||
EnFg_DrawDust(globalCtx, &this->dustEffect[0]);
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
@@ -414,8 +414,8 @@ void EnFg_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
envColor[this->actor.params].b, envColor[this->actor.params].a);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_060059A0));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(&D_060059A0));
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnFg_OverrideLimbDraw, EnFg_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnFg_OverrideLimbDraw, EnFg_PostLimbDraw, &this->actor);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -476,8 +476,8 @@ void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) {
|
||||
alpha = (255.0f / 16.0f) * dustEffect->timer;
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, alpha);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
SysMatrix_InsertTranslation(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_InsertTranslation(dustEffect->pos.x, dustEffect->pos.y, dustEffect->pos.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(dustEffect->xyScale, dustEffect->xyScale, 1.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -42,8 +42,8 @@ typedef struct EnFg {
|
||||
/* 0x144 */ EnFgActionFunc actionFunc;
|
||||
/* 0x148 */ SkelAnime skelAnime;
|
||||
/* 0x18C */ ColliderCylinder collider;
|
||||
/* 0x1D8 */ Vec3s limbDrawTbl[24];
|
||||
/* 0x268 */ Vec3s transitionDrawTbl[24];
|
||||
/* 0x1D8 */ Vec3s jointTable[24];
|
||||
/* 0x268 */ Vec3s morphTable[24];
|
||||
/* 0x2F8 */ s16 timer;
|
||||
/* 0x2FA */ s16 bounceCounter;
|
||||
/* 0x2FC */ EnFgEffectDust dustEffect[10];
|
||||
|
||||
@@ -268,7 +268,7 @@ void EnFirefly_SetupFlyIdle(EnFirefly* this) {
|
||||
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f;
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x300);
|
||||
this->targetPitch = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554;
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
this->actionFunc = EnFirefly_FlyIdle;
|
||||
}
|
||||
|
||||
@@ -276,12 +276,12 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
s32 isSkelAnimeUpdated;
|
||||
f32 rand;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
}
|
||||
|
||||
isSkelAnimeUpdated = func_801378B8(&this->skelAnime, 0.0f);
|
||||
isSkelAnimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f);
|
||||
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f;
|
||||
|
||||
if (!EnFirefly_ReturnToPerch(this, globalCtx) && !EnFirefly_SeekTorch(this, globalCtx)) {
|
||||
@@ -331,7 +331,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
void EnFirefly_SetupFall(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
this->timer = 40;
|
||||
this->actor.velocity.y = 0.0f;
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600017C, 0.0f, 6.0f, 6.0f, 2, 0.0f);
|
||||
Animation_Change(&this->skelAnime, &D_0600017C, 0.0f, 6.0f, 6.0f, 2, 0.0f);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_DEAD);
|
||||
this->actor.flags |= 0x10;
|
||||
|
||||
@@ -411,7 +411,7 @@ void EnFirefly_Die(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnFirefly_SetupDiveAttack(EnFirefly* this) {
|
||||
this->timer = Rand_S16Offset(70, 100);
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
this->targetPitch = ((this->actor.yDistToPlayer > 0.0f) ? -0xC00 : 0xC00) + 0x1554;
|
||||
this->actionFunc = EnFirefly_DiveAttack;
|
||||
}
|
||||
@@ -420,7 +420,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f preyPos;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
@@ -432,9 +432,9 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300);
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100);
|
||||
} else if (Actor_IsActorFacingLink(&this->actor, 0x2800)) {
|
||||
if (func_801378B8(&this->skelAnime, 4.0f)) {
|
||||
this->skelAnime.animPlaybackSpeed = 0.0f;
|
||||
this->skelAnime.animCurrentFrame = 4.0f;
|
||||
if (Animation_OnFrame(&this->skelAnime, 4.0f)) {
|
||||
this->skelAnime.playSpeed = 0.0f;
|
||||
this->skelAnime.curFrame = 4.0f;
|
||||
}
|
||||
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300);
|
||||
@@ -444,7 +444,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &preyPos) + 0x1554, 2, 0x400,
|
||||
0x100);
|
||||
} else {
|
||||
this->skelAnime.animPlaybackSpeed = 1.5f;
|
||||
this->skelAnime.playSpeed = 1.5f;
|
||||
if (this->actor.xzDistToPlayer > 80.0f) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300);
|
||||
}
|
||||
@@ -471,14 +471,14 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
void EnFirefly_SetupRebound(EnFirefly* this) {
|
||||
this->actor.world.rot.x = 0x7000;
|
||||
this->timer = 18;
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
this->actor.speedXZ = 2.5f;
|
||||
this->actionFunc = EnFirefly_Rebound;
|
||||
}
|
||||
|
||||
// Knockback after hitting player
|
||||
void EnFirefly_Rebound(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100);
|
||||
Math_StepToF(&this->actor.velocity.y, 0.0f, 0.4f);
|
||||
if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.15f)) {
|
||||
@@ -496,11 +496,11 @@ void EnFirefly_SetupFlyAway(EnFirefly* this) {
|
||||
this->timer = 150;
|
||||
this->targetPitch = 0x954;
|
||||
this->actionFunc = EnFirefly_FlyAway;
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
}
|
||||
|
||||
void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
@@ -584,8 +584,8 @@ void EnFirefly_SetupPerch(EnFirefly* this) {
|
||||
void EnFirefly_Perch(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100);
|
||||
if (this->timer != 0) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_801378B8(&this->skelAnime, 6.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 6.0f)) {
|
||||
this->timer--;
|
||||
}
|
||||
} else if (Rand_ZeroOne() < 0.02f) {
|
||||
@@ -598,7 +598,7 @@ void EnFirefly_Perch(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) {
|
||||
this->skelAnime.animPlaybackSpeed = 3.0f;
|
||||
this->skelAnime.playSpeed = 3.0f;
|
||||
this->actor.shape.rot.x = 0x1554;
|
||||
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
|
||||
this->timer = 50;
|
||||
@@ -610,7 +610,7 @@ void EnFirefly_DisturbDiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f preyPos;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->timer != 0) {
|
||||
this->timer--;
|
||||
@@ -705,7 +705,7 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
|
||||
if (func_801378B8(&this->skelAnime, 5.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 5.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_FLY);
|
||||
}
|
||||
}
|
||||
@@ -762,7 +762,7 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
|
||||
((this->auraType == KEESE_AURA_FIRE) || (this->auraType == KEESE_AURA_ICE)) &&
|
||||
((limbIndex == 15) || (limbIndex == 21))) {
|
||||
if (this->actionFunc != EnFirefly_Die) {
|
||||
SysMatrix_GetStateTranslation(&auraPos);
|
||||
Matrix_GetStateTranslation(&auraPos);
|
||||
auraPos.x += Rand_ZeroFloat(5.0f);
|
||||
auraPos.y += Rand_ZeroFloat(5.0f);
|
||||
auraPos.z += Rand_ZeroFloat(5.0f);
|
||||
@@ -795,11 +795,11 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
|
||||
}
|
||||
|
||||
if (limbIndex == 15) {
|
||||
SysMatrix_GetStateTranslation(&this->unk_2F8);
|
||||
Matrix_GetStateTranslation(&this->unk_2F8);
|
||||
} else if (limbIndex == 21) {
|
||||
SysMatrix_GetStateTranslation(&this->unk_304);
|
||||
Matrix_GetStateTranslation(&this->unk_304);
|
||||
} else if (limbIndex == 10) {
|
||||
SysMatrix_GetStateTranslation(&this->unk_310);
|
||||
Matrix_GetStateTranslation(&this->unk_310);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,8 +824,8 @@ void EnFirefly_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPSetEnvColor(&gfx[1], 0, 0, 0, 255);
|
||||
}
|
||||
|
||||
gfx = SkelAnime_Draw2(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnFirefly_OverrideLimbDraw,
|
||||
EnFirefly_PostLimbDraw, &this->actor, &gfx[2]);
|
||||
gfx = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnFirefly_OverrideLimbDraw,
|
||||
EnFirefly_PostLimbDraw, &this->actor, &gfx[2]);
|
||||
if (this->isInvisible) {
|
||||
POLY_XLU_DISP = gfx;
|
||||
} else {
|
||||
|
||||
@@ -711,8 +711,8 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (this->animationIdx == 4) {
|
||||
s16 curFrame = this->skelAnime.animCurrentFrame;
|
||||
s16 frameCount = SkelAnime_GetFrameCount(&sAnimations[this->animationIdx].animationSeg->common);
|
||||
s16 curFrame = this->skelAnime.curFrame;
|
||||
s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animationSeg);
|
||||
if (curFrame == frameCount) {
|
||||
this->animationIdx = 5;
|
||||
func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
|
||||
@@ -745,15 +745,15 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) {
|
||||
s16 curFrame = this->skelAnime.animCurrentFrame;
|
||||
s16 frameCount = SkelAnime_GetFrameCount(&sAnimations[this->animationIdx].animationSeg->common);
|
||||
s16 curFrame = this->skelAnime.curFrame;
|
||||
s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animationSeg);
|
||||
|
||||
if (this->flags & ENFSN_ANGRY) {
|
||||
this->flags &= ~ENFSN_ANGRY;
|
||||
this->animationIdx = 11;
|
||||
func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
|
||||
} else {
|
||||
if (this->animationIdx == 11 && func_801378B8(&this->skelAnime, 18.0f)) {
|
||||
if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO);
|
||||
}
|
||||
if (this->flags & ENFSN_CALM_DOWN) {
|
||||
@@ -770,7 +770,7 @@ void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) {
|
||||
this->animationIdx = 5;
|
||||
func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
|
||||
} else {
|
||||
if (func_801378B8(&this->skelAnime, 28.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 28.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO);
|
||||
}
|
||||
return;
|
||||
@@ -1398,8 +1398,7 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 20.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06013320, &D_06012C34, this->limbDrawTable,
|
||||
this->transitionDrawTable, 19);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013320, &D_06012C34, this->jointTable, this->morphTable, 19);
|
||||
if (ENFSN_IS_SHOP(&this->actor)) {
|
||||
this->actor.shape.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
|
||||
this->actor.flags &= ~1;
|
||||
@@ -1442,7 +1441,7 @@ void EnFsn_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnFsn_UpdateStickDirectionPromptAnim(this);
|
||||
EnFsn_UpdateCursorAnim(this);
|
||||
}
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (ENFSN_IS_BACKROOM(&this->actor)) {
|
||||
EnFsn_UpdateCollider(this, globalCtx);
|
||||
}
|
||||
@@ -1559,7 +1558,7 @@ s32 EnFsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
s32 limbRotTableIdx;
|
||||
|
||||
if (limbIndex == 16) {
|
||||
SysMatrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY);
|
||||
}
|
||||
if (ENFSN_IS_BACKROOM(&this->actor)) {
|
||||
switch (limbIndex) {
|
||||
@@ -1614,8 +1613,8 @@ void EnFsn_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8012C5B0(globalCtx->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTextureIdx]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTextureIdx]));
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnFsn_OverrideLimbDraw, EnFsn_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnFsn_OverrideLimbDraw, EnFsn_PostLimbDraw, &this->actor);
|
||||
|
||||
for (i = 0; i < this->totalSellingItems; i++) {
|
||||
this->items[i]->actor.scale.x = 0.2f;
|
||||
|
||||
@@ -27,8 +27,8 @@ typedef struct EnFsn {
|
||||
/* 0x24E */ s16 limbRotZTable[19];
|
||||
/* 0x274 */ Vec3s headRot;
|
||||
/* 0x27A */ Vec3s unk27A; // Set but never used
|
||||
/* 0x280 */ Vec3s limbDrawTable[19];
|
||||
/* 0x2F2 */ Vec3s transitionDrawTable[19];
|
||||
/* 0x280 */ Vec3s jointTable[19];
|
||||
/* 0x2F2 */ Vec3s morphTable[19];
|
||||
/* 0x364 */ s16 eyeTextureIdx;
|
||||
/* 0x366 */ s16 blinkTimer;
|
||||
/* 0x368 */ s16 cutsceneState;
|
||||
|
||||
@@ -200,7 +200,8 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (fuKaiten != NULL) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 36.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600B2B0, &D_06001F74, this->jointTable, this->morphTable, 21);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B2B0, &D_06001F74, this->jointTable, this->morphTable,
|
||||
21);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
@@ -366,10 +367,10 @@ void func_8096209C(EnFu* this, GlobalContext* globalCtx) {
|
||||
sp34 = D_80964B24;
|
||||
}
|
||||
|
||||
SysMatrix_StatePush();
|
||||
Matrix_StatePush();
|
||||
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
|
||||
SysMatrix_MultiplyVector3fByState(&sp34, &this->actor.focus.pos);
|
||||
SysMatrix_StatePop();
|
||||
Matrix_MultiplyVector3fByState(&sp34, &this->actor.focus.pos);
|
||||
Matrix_StatePop();
|
||||
this->actor.focus.pos.x += this->actor.world.pos.x;
|
||||
this->actor.focus.pos.y += this->actor.world.pos.y;
|
||||
this->actor.focus.pos.z += this->actor.world.pos.z;
|
||||
@@ -1341,7 +1342,7 @@ void EnFu_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
|
||||
func_8096209C(this, globalCtx);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
func_80961D7C(globalCtx);
|
||||
func_809640D8(this, globalCtx);
|
||||
func_80964034(this, globalCtx);
|
||||
@@ -1351,17 +1352,17 @@ s32 EnFu_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
EnFu* this = THIS;
|
||||
|
||||
if (limbIndex == 9) {
|
||||
SysMatrix_InsertTranslation(1600.0f, 300.0f, 0.0f, MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(this->unk_524[1], MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->unk_524[0], MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(1600.0f, 300.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_524[1], MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_524[0], MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_524[2], MTXMODE_APPLY);
|
||||
SysMatrix_InsertTranslation(-1600.0f, -300.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(-1600.0f, -300.0f, 0.0f, MTXMODE_APPLY);
|
||||
} else if (limbIndex == 20) {
|
||||
SysMatrix_InsertTranslation(1800.0f, 200.0f, 0.0f, MTXMODE_APPLY);
|
||||
SysMatrix_InsertXRotation_s(this->unk_52A[1], MTXMODE_APPLY);
|
||||
SysMatrix_InsertZRotation_s(this->unk_52A[0], MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(1800.0f, 200.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->unk_52A[1], MTXMODE_APPLY);
|
||||
Matrix_InsertZRotation_s(this->unk_52A[0], MTXMODE_APPLY);
|
||||
Matrix_RotateY(this->unk_52A[2], MTXMODE_APPLY);
|
||||
SysMatrix_InsertTranslation(-1800.0f, -200.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertTranslation(-1800.0f, -200.0f, 0.0f, MTXMODE_APPLY);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1372,9 +1373,9 @@ void EnFu_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
|
||||
EnFu* this = THIS;
|
||||
|
||||
if (limbIndex == 9) {
|
||||
SysMatrix_MultiplyVector3fByState(&D_80964C28, &this->unk_508);
|
||||
Matrix_MultiplyVector3fByState(&D_80964C28, &this->unk_508);
|
||||
} else if (limbIndex == 20) {
|
||||
SysMatrix_MultiplyVector3fByState(&D_80964C34, &this->unk_514);
|
||||
Matrix_MultiplyVector3fByState(&D_80964C34, &this->unk_514);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1382,9 +1383,9 @@ void EnFu_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
EnFu* this = THIS;
|
||||
|
||||
SysMatrix_StatePush();
|
||||
Matrix_StatePush();
|
||||
func_80964950(globalCtx, this->unk_2D8, ARRAY_COUNT(this->unk_2D8));
|
||||
SysMatrix_StatePop();
|
||||
Matrix_StatePop();
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -1393,8 +1394,8 @@ void EnFu_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_EnvColor(globalCtx->state.gfxCtx, 0, 50, 160, 0));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 255, 255, 255, 0));
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnFu_OverrideLimbDraw, EnFu_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnFu_OverrideLimbDraw, EnFu_PostLimbDraw, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -1435,11 +1436,11 @@ void func_809647EC(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len) {
|
||||
ptr->unk_08.y += ptr->unk_20.y;
|
||||
ptr->unk_08.x += 2.0f * Math_SinS(ptr->unk_2C);
|
||||
ptr->unk_08.z += 2.0f * Math_CosS(ptr->unk_2C);
|
||||
SysMatrix_StatePush();
|
||||
SysMatrix_InsertTranslation(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW);
|
||||
Matrix_StatePush();
|
||||
Matrix_InsertTranslation(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW);
|
||||
Matrix_RotateY(activeCam, MTXMODE_APPLY);
|
||||
SysMatrix_MultiplyVector3fByState(&sp44, &ptr->unk_08);
|
||||
SysMatrix_StatePop();
|
||||
Matrix_MultiplyVector3fByState(&sp44, &ptr->unk_08);
|
||||
Matrix_StatePop();
|
||||
ptr->unk_2C += 6000;
|
||||
}
|
||||
}
|
||||
@@ -1460,8 +1461,8 @@ void func_80964950(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len) {
|
||||
gSPDisplayList(POLY_OPA_DISP++, D_0600B0A0);
|
||||
flag = true;
|
||||
}
|
||||
SysMatrix_InsertTranslation(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW);
|
||||
SysMatrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_InsertTranslation(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW);
|
||||
Matrix_NormalizeXYZ(&globalCtx->mf_187FC);
|
||||
Matrix_Scale(ptr->unk_00, ptr->unk_00, ptr->unk_00, MTXMODE_APPLY);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_0405E6F0));
|
||||
|
||||
@@ -63,8 +63,7 @@ void EnGinkoMan_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->isStampChecked = false;
|
||||
this->choiceDepositWithdrawl = GINKOMAN_CHOICE_RESET;
|
||||
this->serviceFee = 0;
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600C240, &D_060043F0, this->limbDrawTbl, this->transitionDrawTbl,
|
||||
16);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C240, &D_060043F0, this->jointTable, this->morphTable, 16);
|
||||
EnGinkoMan_SetupIdle(this);
|
||||
}
|
||||
|
||||
@@ -496,8 +495,7 @@ void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((this->skelAnime.animCurrentSeg == &D_060008C0) &&
|
||||
func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if ((this->skelAnime.animation == &D_060008C0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_BANK_MAN_HAND_HIT);
|
||||
}
|
||||
}
|
||||
@@ -566,11 +564,11 @@ void EnGinkoMan_SetupStamp(EnGinkoMan* this) {
|
||||
|
||||
void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
if ((this->curTextId == 0x464) // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt."
|
||||
&& (func_801378B8(&this->skelAnime, 10.0f))) {
|
||||
&& (Animation_OnFrame(&this->skelAnime, 10.0f))) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_HANKO); // "stamp"
|
||||
}
|
||||
|
||||
if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
switch (this->curTextId) {
|
||||
case 0x464: // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt."
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
|
||||
@@ -597,12 +595,12 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.xzDistToPlayer > 160.0f) {
|
||||
if (this->animTimer == 0) {
|
||||
if (this->skelAnime.animCurrentSeg != &D_06004A7C) {
|
||||
if (this->skelAnime.animation != &D_06004A7C) {
|
||||
this->animTimer = 40;
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_ADVERTISING);
|
||||
}
|
||||
}
|
||||
} else if ((this->animTimer == 0) && (this->skelAnime.animCurrentSeg != &D_06000AC4)) {
|
||||
} else if ((this->animTimer == 0) && (this->skelAnime.animation != &D_06000AC4)) {
|
||||
this->animTimer = 40;
|
||||
func_800BDC5C(&this->skelAnime, animations, GINKO_AMAZED);
|
||||
}
|
||||
@@ -611,8 +609,8 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnGinkoMan_FacePlayer(EnGinkoMan* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (this->skelAnime.animCurrentSeg != &D_06004A7C) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->skelAnime.animation != &D_06004A7C) {
|
||||
func_800E9250(globalCtx, &this->actor, &this->limb15Rot, &this->limb8Rot, this->actor.focus.pos);
|
||||
} else {
|
||||
func_800E8F08(&this->limb15Rot, &this->limb8Rot);
|
||||
@@ -629,27 +627,27 @@ void EnGinkoMan_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
s32 EnGinkoMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
EnGinkoMan* this = THIS;
|
||||
Actor* arg) {
|
||||
EnGinkoMan* this = (EnGinkoMan*)arg;
|
||||
|
||||
if (limbIndex == 15) {
|
||||
*dList = D_0600B1D8;
|
||||
}
|
||||
|
||||
if (limbIndex == 15) {
|
||||
SysMatrix_InsertTranslation(1500.0f, 0.0f, 0.0f, 1);
|
||||
SysMatrix_InsertXRotation_s(this->limb15Rot.y, 1);
|
||||
SysMatrix_InsertZRotation_s(this->limb15Rot.x, 1);
|
||||
SysMatrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, 1);
|
||||
Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_InsertXRotation_s(this->limb15Rot.y, 1);
|
||||
Matrix_InsertZRotation_s(this->limb15Rot.x, 1);
|
||||
Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
} else if (limbIndex == 8) {
|
||||
SysMatrix_InsertXRotation_s(-this->limb8Rot.y, 1);
|
||||
SysMatrix_InsertZRotation_s(-this->limb8Rot.x, 1);
|
||||
Matrix_InsertXRotation_s(-this->limb8Rot.y, 1);
|
||||
Matrix_InsertZRotation_s(-this->limb8Rot.x, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EnGinkoMan_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
void EnGinkoMan_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
|
||||
}
|
||||
|
||||
void EnGinkoMan_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
@@ -663,8 +661,8 @@ void EnGinkoMan_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 50, 80, 0, 0));
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
&EnGinkoMan_OverrideLimbDraw, &EnGinkoMan_PostLimbDraw, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnGinkoMan_OverrideLimbDraw, EnGinkoMan_PostLimbDraw, &this->actor);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ typedef struct EnGinkoMan {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ EnGinkoManActionFunc actionFunc;
|
||||
/* 0x18C */ Vec3s limbDrawTbl[0x10];
|
||||
/* 0x1EC */ Vec3s transitionDrawTbl[0x10];
|
||||
/* 0x18C */ Vec3s jointTable[0x10];
|
||||
/* 0x1EC */ Vec3s morphTable[0x10];
|
||||
/* 0x24C */ Vec3s limb15Rot;
|
||||
/* 0x252 */ Vec3s limb8Rot;
|
||||
/* 0x258 */ s16 curTextId;
|
||||
|
||||
@@ -80,7 +80,7 @@ void EnGuruguru_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 19.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06006C90, &D_06000B04, this->jointTable, this->morphTable, 16);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006C90, &D_06000B04, this->jointTable, this->morphTable, 16);
|
||||
this->actor.targetMode = 0;
|
||||
if (this->actor.params != 2) {
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
@@ -112,9 +112,9 @@ void EnGuruguru_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnGuruguru_ChangeAnimation(EnGuruguru* this, s32 arg1) {
|
||||
this->frameCount = SkelAnime_GetFrameCount(&D_80BC79CC[arg1]->common);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, D_80BC79CC[arg1], D_80BC79D8[arg1], 0.0f, this->frameCount, D_80BC79D4[arg1],
|
||||
-4.0f);
|
||||
this->frameCount = Animation_GetLastFrame(D_80BC79CC[arg1]);
|
||||
Animation_Change(&this->skelAnime, D_80BC79CC[arg1], D_80BC79D8[arg1], 0.0f, this->frameCount, D_80BC79D4[arg1],
|
||||
-4.0f);
|
||||
}
|
||||
|
||||
void EnGuruguru_DoNothing(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
@@ -152,7 +152,7 @@ void func_80BC6F14(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
s16 yaw;
|
||||
s16 yawTemp;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->unk270 != 0) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
@@ -194,7 +194,7 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (this->unk268 != 0) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
} else if (this->unusedTimer == 0) {
|
||||
this->unusedTimer = 6;
|
||||
if (func_80152498(&globalCtx->msgCtx) != 5) {
|
||||
@@ -262,11 +262,11 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
this->texIndex = 1;
|
||||
}
|
||||
if ((this->unk268 != 0) && (this->textIdIndex >= 7)) {
|
||||
this->skelAnime.animPlaybackSpeed = 2.0f;
|
||||
this->skelAnime.playSpeed = 2.0f;
|
||||
func_801A29D4(3, 1.18921f, 2);
|
||||
func_801A3B48(0);
|
||||
} else {
|
||||
if (this->skelAnime.animPlaybackSpeed == 2.0f) {
|
||||
if (this->skelAnime.playSpeed == 2.0f) {
|
||||
func_801A29D4(3, 1.0f, 2);
|
||||
}
|
||||
if (this->unk268 == 0) {
|
||||
@@ -274,7 +274,7 @@ void func_80BC7068(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
func_801A3B48(0);
|
||||
}
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
}
|
||||
this->unk266 = 1;
|
||||
func_80151938(globalCtx, textIDs[this->textIdIndex]);
|
||||
@@ -295,7 +295,7 @@ void func_80BC73F4(EnGuruguru* this) {
|
||||
}
|
||||
|
||||
void func_80BC7440(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Actor_HasParent(&this->actor, globalCtx)) {
|
||||
this->actor.parent = NULL;
|
||||
this->textIdIndex++;
|
||||
@@ -311,7 +311,7 @@ void func_80BC7440(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80BC7520(EnGuruguru* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
this->actionFunc = func_80BC7068;
|
||||
} else {
|
||||
@@ -394,7 +394,7 @@ void EnGuruguru_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_8012C2DC(globalCtx->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->texIndex]));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[this->texIndex]));
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnGuruguru_OverrideLimbDraw, NULL, &this->actor);
|
||||
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
|
||||
EnGuruguru_OverrideLimbDraw, NULL, &this->actor);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user