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

905 lines
38 KiB
C
Raw Normal View History

2021-12-27 19:23:03 +00:00
#pragma once
/*
#define POINTER_ADD(a, b) ((uintptr_t)a + (uintptr_t)b)
#define POINTER_SUB(a, b) ((uintptr_t)a - (uintptr_t)b)
2020-03-17 04:31:30 +00:00
2020-03-24 17:29:59 +00:00
#include "z64.h"
2021-12-27 19:23:03 +00:00
#include <math.h>
2020-03-17 04:31:30 +00:00
2021-12-27 19:23:03 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2020-03-17 04:31:30 +00:00
void Main_ThreadEntry(void* arg);
void Idle_ThreadEntry(void* arg);
void ViConfig_UpdateVi(u32 mode);
void ViConfig_UpdateBlack(void);
2020-03-17 04:31:30 +00:00
s32 DmaMgr_CompareName(const char* name1, const char* name2);
2021-12-27 19:23:03 +00:00
s32 DmaMgr_DmaRomToRam(void* rom, void* ram, uintptr_t size);
s32 DmaMgr_DmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction);
2020-03-17 04:31:30 +00:00
void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorName, const char* errorDesc);
2021-12-27 19:23:03 +00:00
const char* DmaMgr_GetFileNameImpl(void* vrom);
const char* DmaMgr_GetFileName(void* vrom);
2020-03-17 04:31:30 +00:00
void DmaMgr_ProcessMsg(DmaRequest* req);
void DmaMgr_ThreadEntry(void* arg0);
2021-12-27 19:23:03 +00:00
s32 DmaMgr_SendRequestImpl(DmaRequest* req, void* ram, void* vrom, uintptr_t size, u32 unk, OSMesgQueue* queue, OSMesg msg);
s32 DmaMgr_SendRequest0(void* ram, void* vrom, uintptr_t size);
void DmaMgr_Init(void);
2021-12-27 19:23:03 +00:00
s32 DmaMgr_SendRequest2(DmaRequest* req, void* ram, void* vrom, uintptr_t size, u32 unk5, OSMesgQueue* queue, OSMesg msg,
2020-03-22 21:50:11 +00:00
const char* file, s32 line);
2021-12-27 19:23:03 +00:00
s32 DmaMgr_SendRequest1(void* ram0, void* vrom, uintptr_t size, const char* file, s32 line);
void* Yaz0_FirstDMA(void);
2020-03-17 04:31:30 +00:00
void* Yaz0_NextDMA(void* curSrcPos);
void Yaz0_DecompressImpl(Yaz0Header* hdr, u8* dst);
2021-12-27 19:23:03 +00:00
void Yaz0_Decompress(uintptr_t romStart, void* dst, u32 size);
void Locale_Init(void);
void Locale_ResetRegion(void);
u32 func_80001F48(void);
u32 func_80001F8C(void);
u32 Locale_IsRegionNative(void);
2021-12-27 19:23:03 +00:00
void isPrintfInit(void);
2021-12-27 19:23:03 +00:00
#if defined(_IS_DEBUG) || 1
2020-03-17 04:31:30 +00:00
void osSyncPrintf(const char* fmt, ...);
2021-12-27 19:23:03 +00:00
#else
#define osSyncPrintf(a, ...) (0)
#endif
2020-03-17 04:31:30 +00:00
void rmonPrintf(const char* fmt, ...);
void* is_proutSyncPrintf(void* arg, const char* str, u32 count);
2020-03-17 04:31:30 +00:00
void func_80002384(const char* exp, const char* file, u32 line);
OSPiHandle* osDriveRomInit(void);
void Mio0_Decompress(Yaz0Header* hdr, u8* dst);
2020-03-22 21:50:11 +00:00
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
const char* name);
2020-03-17 04:31:30 +00:00
void StackCheck_Cleanup(StackEntry* entry);
StackStatus StackCheck_GetState(StackEntry* entry);
u32 StackCheck_CheckAll(void);
2020-03-17 04:31:30 +00:00
u32 StackCheck_Check(StackEntry* entry);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
s32 vsprintf(char* dst, const char* fmt, va_list args);
s32 sprintf(char* dst, const char* fmt, ...);
void __osPiCreateAccessQueue(void);
void __osPiGetAccess(void);
void __osPiRelAccess(void);
void osStopThread(OSThread* thread);
void osViExtendVStart(u32 arg0);
s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag);
void __osInitialize_common(void);
void __osInitialize_autodetect(void);
2020-03-17 04:31:30 +00:00
void __osExceptionPreamble();
// ? __osException(?);
void __osEnqueueAndYield(OSThread**);
void __osEnqueueThread(OSThread**, OSThread*);
2020-03-22 21:50:11 +00:00
OSThread* __osPopThread(OSThread**);
2020-03-17 04:31:30 +00:00
// ? __osNop(?);
void __osDispatchThread();
void __osCleanupThread(void);
2020-03-22 21:50:11 +00:00
void __osDequeueThread(OSThread** queue, OSThread* thread);
void osDestroyThread(OSThread* thread);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri);
void __osSetSR(u32);
u32 __osGetSR();
2020-03-22 21:50:11 +00:00
void osWritebackDCache(void* vaddr, s32 nbytes);
void* osViGetNextFramebuffer(void);
2020-03-22 21:50:11 +00:00
void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt);
2020-03-17 04:31:30 +00:00
void __osDevMgrMain(void* arg);
2021-12-27 19:23:03 +00:00
s32 __osPiRawStartDma(s32 dir, uintptr_t cartAddr, void* dramAddr, size_t size);
uintptr_t osVirtualToPhysical(void* vaddr);
2020-03-17 04:31:30 +00:00
void osViBlack(u8 active);
s32 __osSiRawReadIo(void* devAddr, u32* dst);
2020-03-17 04:31:30 +00:00
OSId osGetThreadId(OSThread* thread);
2020-03-22 21:50:11 +00:00
void osViSetMode(OSViMode* mode);
u32 __osProbeTLB(void*);
2020-03-17 04:31:30 +00:00
u32 osGetMemSize(void);
2020-03-22 21:50:11 +00:00
void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg msg);
s32 _Printf(PrintCallback, void* arg, const char* fmt, va_list ap);
2020-03-17 04:31:30 +00:00
void osUnmapTLBAll(void);
s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction);
void osInvalICache(void* vaddr, s32 nbytes);
void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count);
void osInvalDCache(void* vaddr, s32 nbytes);
2021-12-27 19:23:03 +00:00
s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flag);
s32 __osSiDeviceBusy(void);
s32 osJamMesg(OSMesgQueue* mq, OSMesg mesg, s32 flag);
2020-03-17 04:31:30 +00:00
void osSetThreadPri(OSThread* thread, OSPri pri);
OSPri osGetThreadPri(OSThread* thread);
2021-12-27 19:23:03 +00:00
s32 __osEPiRawReadIo(OSPiHandle* handle, uintptr_t devAddr, u32* data);
2020-03-22 21:50:11 +00:00
void osViSwapBuffer(void* vaddr);
2021-12-27 19:23:03 +00:00
s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, uintptr_t cartAddr, void* dramAddr, size_t size);
2020-03-22 21:50:11 +00:00
u32 bcmp(void* __sl, void* __s2, u32 __n);
2020-03-17 04:31:30 +00:00
OSTime osGetTime(void);
void __osTimerServicesInit(void);
void __osTimerInterrupt(void);
void __osSetTimerIntr(OSTime time);
OSTime __osInsertTimer(OSTimer* timer);
2020-03-17 04:31:30 +00:00
u32 osGetCount(void);
void __osSetGlobalIntMask(OSHWIntr mask);
2020-03-17 04:31:30 +00:00
void __osSetCompare(u32);
void __osResetGlobalIntMask(OSHWIntr mask);
2020-03-17 04:31:30 +00:00
s32 __osDisableInt(void);
void __osRestoreInt(s32);
void __osViInit(void);
void __osViSwapContext(void);
OSMesgQueue* osPiGetCmdQueue(void);
2021-12-27 19:23:03 +00:00
s32 osEPiReadIo(OSPiHandle* handle, uintptr_t devAddr, u32* data);
2020-03-17 04:31:30 +00:00
void osViSetSpecialFeatures(u32 func);
OSPiHandle* osCartRomInit(void);
2020-03-17 04:31:30 +00:00
void __osSetFpcCsr(u32);
u32 __osGetFpcCsr();
2021-12-27 19:23:03 +00:00
s32 osEPiWriteIo(OSPiHandle* handle, uintptr_t devAddr, u32 data);
2020-03-17 04:31:30 +00:00
void osMapTLBRdb(void);
void osYieldThread(void);
2020-03-17 04:31:30 +00:00
u32 __osGetCause();
2021-12-27 19:23:03 +00:00
s32 __osEPiRawWriteIo(OSPiHandle* handle, uintptr_t devAddr, u32 data);
void _Litob(_Pft* args, u8 type);
void _Ldtob(_Pft* args, u8 type);
s32 __osSiRawWriteIo(void* devAddr, u32 val);
2020-03-17 04:31:30 +00:00
void osCreateViManager(OSPri pri);
OSViContext* __osViGetCurrentContext(void);
2020-03-17 04:31:30 +00:00
void osStartThread(OSThread* thread);
void osViSetYScale(f32 scale);
2020-03-17 04:31:30 +00:00
void osViSetXScale(f32 value);
void __osSetWatchLo(u32);
Decompiled ovl_Shot_Sun (#236) * match ShotSun_Init * match ShotSun_Destroy * match func_80BADDCC * break up unk_19C to add spawnTimer * ShotSun_Update * func_80BADE74 * work on func_80BAE05C * make func_80BAE05C closer * use proper macros for osSyncPrintf * format if statement better and add temp player pointer func_80BAE05C * Reorder spawnPos to match stack args later * match func_80BAE05C * almost match func_80BADF0C * Remove temporary and add parenthesis * change part of comment and move last unk_1A4 assignment to be similar to decompiler * Change do while(false) to if (1) * func_80BADF0C * change comment * update spec * fix vt macro * cleanup and name * remove asm * remove data * remove extern Co-authored-by: Random <28494085+Random06457@users.noreply.github.com> * remove & for function pointers * rename and retype D_02007020 * format * remove tiny whitespace * reorder if statement * finish renaming * replace cast with bitwise operation * move globally used functions to functions.h * reorder description * move headers for EnItem00 and EnAObj to z64actor.h * retype Item_DropCollectible and Item_DropCollectible2 to return EnItem00* * rename ShotSun_StartFairyCountdown to ShotSun_TriggerFairy * rename ShotSun_FairyCountdown to ShotSun_SpawnFairy * add unk_E3EC field to MessageContext * rename to ShotSun_UpdateHyliaSun for now * remove != 0 on flag check * remove unsigned suffix and use enum constant for Item_DropCollectible call * add unk_95C field to Player * add ub comment * retype unk_1A4 and remove explicit struct padding * Update src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: Random <28494085+Random06457@users.noreply.github.com> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
2020-07-12 23:03:38 +00:00
EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params);
EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params);
2020-03-17 04:31:30 +00:00
void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params);
2021-12-27 19:23:03 +00:00
void FlagSet_Update(GlobalContext* globalCtx);
2020-03-17 04:31:30 +00:00
void Overlay_LoadGameState(GameStateOverlay* overlayEntry);
void Overlay_FreeGameState(GameStateOverlay* overlayEntry);
2021-12-27 19:23:03 +00:00
z_collision_check.c (#73) * func_8005B280 ok * func_8005B65C OK * split out func_8005BD50 * func_8005B7C0 OK * func_8005B7F4 OK * func_8005B824 OK * func_8005B860 ok * improve sanity * func_8005B6B0 ok, ColliderInit_Actor structs added * func_8005B884 ok * func_8005BBF8 ok, split out func_8005BF50 * split more stuff out of func_8005C050.s * func_8005C050 OK * func_8005BA30 fakish OK, func_8005BAD8 real OK * func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues * func_8005BB10 Ok * func_8005BF50 OK * func_8005BE50 OK * func_8005BD50 OK * func_8005BCC8 Ok * func_8005BC28 * func_8005BB8C func_8005BBB0 func_8005BBD4 Ok * save my work commit * func_8005C2BC fake OK * func_8005C5B0 ok * func_8005C608 ok * func_8005C6C0 ok * func_8005C6F8 ok * func_8005C730 ok * func_8005C774 func_8005C798 func_8005C7BC OK * func_8005C7E0 ok, func_8005C810 split * func_8005C810 OK * func_8005C8C8 ok * func_8005C964 OK * func_8005CA88 ok * func_8005CBAC ok * func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK * func_8005CD34 func_8005CDD0 Ok * func_8005CE6C ok * func_8005CEC4 ok * func_8005CEDC ok * func_8005CF90 Ok * standardize type names/vars more * func_8005D3BC ok * func_8005D40C OK, z64.h CollisionCheckContext * func_8005D4B4 func_8005D4C8 ok * partial data section migration * improve function documentation, OT->OC * Actor_CollisionCheck_SetOC ok * Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok * func_8005BA84 ok * func_800611A0 ok * func_80061274 ok * clean up func_80061274 * func_8006139C ok * func_8005E9C0 and dependencies OK * minor cleanup to func_8005E9C0 * func_8005EC6C OK! * func_8005E81C ok * func_8005E604 ok * func_8005E2EC func_8005E4F8 OK * func_8005DE9C OK func_8005D8AC disassembled * func_8006146C func_8006268C ok * func_8005EEE0 ok * func_8005F17C * func_8005F39C ok * func_8005F5B0 decompiled, not matching * func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK * func_8005FA30 ok, split more functions * func_8005FC04 ok * func_8005FDCC k * func_8005FF90 OK OK OK * func_80060204 dead * func_800604B0 ok * func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish * func_800635D0 ok, func_80062ECC not so much * OcLine oks * D_8011DF28 functions disassembled * D_8011DF5C functions OK * setAT_SAC. setAC_SAC, setOC_SAC OK * func_80061C98 decompiled, func_80061BF4, func_80061C18 OK * func_800617D4 ok, func_800614A4 disassembled * CollisionCheck_OC D_8011DFAC functions OK * func_80062530 ok * CollisionCheck_generalLineOcCheck subfunctions OK * func_800622E4 ok * after a long fought battle, func_80061F64 has fallen. * func_800628A4 disassembled * func_800627A0 func_8006285C OK * ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok * func_80062CD4 decompiled, import EffShield/EffSpark types from MM * various SubActor98 struct functions OK * func_8005D4DC func_8005D62C ok * .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs * func_80060C2C ok * minor code tweaks * func_80061C98 ok somehow * Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types * Apply changes * formatting * tweak a couple function names * krim changes, func naming * missed some things * function renames * Implement GenColliderInit.py utility * Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching * func_800614A4 ok * Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE * collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
DamageTable* DamageTable_Get(s32 index);
void DamageTable_Clear(DamageTable* table);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
void SaveContext_Init(void);
s32 func_800635D0(s32);
void func_800636C0(void);
void func_8006375C(s32 arg0, s32 arg1, const char* text);
decompile z_camera (#398) * cleanup * name camera action functions * decompile a few small functions, name a few Camera struct members * decompile camera data, decompile a few camera functions * Split ASM for code_800BB0A0 * removing code_800BB0A0.s * PR Requests, Camera WIP * remove #define NON_MATCHING from db_camera * rename code_8007BF90.c to z_olib.c, rename functions in z_olib.c * camera wip * rename some struct memebers, some decomp wip * pr updates * camera wip * name some fields in Camera Struct, being making sense of Camera_Update * Camera WIP * wip * wip * add z64camera.h header, begin creating CameraSetting macros * wip * wip * wip * wip * migrate camera bss to c * match a couple functions in db_camera * match some small db_camera functions * wip * migrate db_camera rodata, match a few functions * remote db_camera.rodata.s * match some of db_camera * identify types of some unknown data pieces * some small wip * Match Camera_Init, some function changes, some struct name changes. Change unk_C0 and unk_CC to floats from Vec3fs * add naming for a few more Camera struct members * wip * match func_80043F94 * Match Camera_Jump1 * document some of Camera_Jump1 * wip * match Camera_Jump3 * Match Camera_Update, FeelsAmazing * wip * wip * match Camera_SetParam * minor cleanup * wip * wip * match Camera_KeepOn0 * some documentation, modify some matching functions to match style of others. * match Camera_Demo1 * match camera_demo9 * document Camera_Demo1 and Camera_Demo9 * wip * Match camera_battle4 * match camera_unique2 * Match Camera_Unique3 * match camera_special6 * match Camera_Special5 * wip * document camera_special6 * naming updates * match camera_Unique1 * match Camera_Unique0 * wip * Match Camera_CalcUpFromPitchYawRoll * match func_80045508 * document Camera_Battle4 * document several camera functions, move camera data to separate file * rename phi/theta to pitch/yaw * wip * uniq9 wip * Camera_Unqiue9 OK * document Camera_Unique9 * name unk_160 in camera struct * wip * wip * minor updates * fix conflicts * wip * wip * Olib updates * wip * wip * rename most Math3D functions, few matches, documentation * wip * document most of math3d * wip * wip * wip * pr updates * Match Camera_Fixed4 * match func_80058E8C * pr updates * add missing comment block finalizer * Merge math3dupdates * match Camera_ChangeSetting * Match Camera_ChangeMode * match func_80058148 * Match Camera_Special9 * decompile the rest of camera data * match Camera_Demo5 * name a few camera functions in z_play * match func_80046CB4, some work on other fucntions * wip * impove some non matchings * fix function rename * match func_800588B4 * match Camera_Subj4 * wip * Camera_Demo3 matching, Camera_Battle1 big progress * Camera_Normal2 OK * wip * match Camera_Parallel1 * normalize some things across functions * match Camera_Normal1 * Match Camera_Normal3 * some cleanup * more cleanup * more cleanup , match Camera_CalcDefaultPitch * data formatting * Match Camera_Jump2 * document Camera_Jump2 * Match Camera_KeepOn3 * document some of Camera_KeepOn3 * improve some non_matchings * match func_80045C74 and func_800460A8 * code cleanup, documentation * match Camera_KeepOn1 * Match Camera_Subj3 * Match Camera_Battle1 * remove non_matching from func_80044adc and func_80046e20 * name several members of Battle1 * more documentation on Battle1 * cleanup * renaming Camera_Vec3fScaleXYZFactor to Camera_Vec3fTranslateByUnitVector * reorganize update structs, remove final references to params, remove CameraParams union * implement camera enums into player * Renaming Camera_GetDir to Camera_GetInputDir, Camera_GetRealDir to Camera_GetCamDir, etc, implement camera enum's into player * remove non-global camera variables from variables.h * clean up some variable declarations * finish pr comment updates * fix some warnings * data formatting * finish commenting on data * delete unused asm * remove asm Co-authored-by: fig <fig02srl@gmail.com>
2020-12-06 22:39:47 +00:00
void func_8006376C(u8 x, u8 y, u8 colorId, const char* text);
2020-03-17 04:31:30 +00:00
// ? func_80063828(?);
void func_8006390C(Input* input);
2020-03-17 04:31:30 +00:00
// ? func_80063C04(?);
void func_80063D7C(GraphicsContext* gfxCtx);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
void* MemCopy(void* dest, void* src, s32 size);
void GetItem_Draw(GlobalContext* globalCtx, s16 drawId);
void func_8006BA00(GlobalContext* globalCtx);
void func_8006BA30(GlobalContext* globalCtx);
void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos, s32 duration, u16 sfxId);
u16 ElfMessage_GetSariaText(GlobalContext* globalCtx);
u16 ElfMessage_GetCUpText(GlobalContext* globalCtx);
u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet);
void Flags_UnsetAllEnv(GlobalContext* globalCtx);
void Flags_SetEnv(GlobalContext* globalCtx, s16 flag);
void Flags_UnsetEnv(GlobalContext* globalCtx, s16 flag);
s32 Flags_GetEnv(GlobalContext* globalCtx, s16 flag);
f32 func_8006C5A8(f32 target, TransformData* transData, s32 refIdx);
void SkelCurve_Clear(SkelAnimeCurve* skelCurve);
s32 SkelCurve_Init(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve, SkelCurveLimbList* limbListSeg,
ovl_demo_effect 100% OK (#466) * Fully decompiles demo_effect actor. * Formats z_demo_effect.c * GET_ACTOR_TYPE is renamed to GET_EFFECT_TYPE * Implements OPEN_DISPS macros for all draw functions. * Fixes ugly float values * Removes unnecessary union structs in the DemoEffect actor struct * Renames DemoEffect SkelAnimeCurve member to skelCurve * Names initObjectBankIndex DemoEffect struct member * Renames jewel display list holders * Renames initialization function pointers to initUpdateFunc and initDrawFunc * Renames primitive and environment color DemoEffect struct members. * Fixes a couple missed floats. * Renames most draw and update functions. * Finishes naming all update functions. * Adds additional SFX defines. * Renames the rest of the functions * Renames all external object display lists and vertex references * Renames DemoEffect global data variables * Renames DemoEffect Medal function to GetItem because it's used by LightArrows too * Fixes DemoEffect Timewarp_Timeblock documentation. * DemoEffect_TimewarpTimeblock updates shrink functions to use decimal * Converts DemoEffect hex to decimal where appopriate * Names the rest of DemoEffect struct members. * Names DemoEffect triforceSpot crystalLightOpacity * Adds DemoEffect enums for light effect color and god lgt types. * Renames DemoEffect_UpdateBlueOrb to DemoEffect_UpdateBlueOrbGrow * Fixes compiler warning in DemoEffect_JewelSparkle * Renames DemoEffect_MedalSparkle argument * Reformatting DemoEffect struct offset comments. * Formats z_demo_effect * Updates DemoEffect oGfxCtx to use the new macros. * Adds comments detailing what each function in the DemoEffect system does. * Removes z_demo_effect.data.s * Renames DemoEffect global variables and sets them to static * Removes pointer from DemoEffect function references * Removes unncecessary default: break; statements in DemoEffect * Converts rotation values to hex in DemoEffect * DemoEffect effectFlags now uses ~1 rather than 65534 * DemoEffect_DrawGodLgt now uses a cleaner conditional statement * eventChkInf in DemoEffect now uses 1 << 9 and 1 << 11 * DemoEffect now uses VT macros. * Converts DemoEffect colors to hex. * Changes M_PI / 32768.0f to M_PI / 0x8000 * Updates demo_effect enums to be all caps * ovl_demo_effect reloc info is now included via build process rather than included from original asm * Adds param packing macro * DemoEffect struct unions are now typedef'd outside of the main struct * Reformats DemoEffect sJewelSparkleColors * Removes an if(globalCtx){} in DemoEffect_Init * Removes ActorFunc cast in DemoEffect_Wait * Removes unncessary comment in DemoEffect_MedalSparkle * Timer check in DemoEffect_UpdateLightRingShrinking now uses <= 255 rather than < 256 * Removes unnecessary comment in DemoEffect_SetJewelColor * Removes unncessary comment in DemoEffect_MoveJewelActivateDoorOfTime * Converts an angle to hex in DemoEffect_MoveJewelActivateDoorOfTime * Converts a while to for loop in DemoEffect_JewelSparkle * Moves stack variables in DemoEffect_UpdateDust to a new line for each one * Removes globalCtx2 assignment to the beginning of the function in DemoEffect_DrawJewel * Removes unnecessary comment in DemoEffect_DrawCrystalLight * No longer wrapping rotation reset in if(1){} in DemoEffect_DrawGodLgt * Converts DemoEffect if statements to use != 0 and == 0 when non-boolean ints are checked. * DemoEffect initDrawFunc now uses type ActorFunc rather than DemoEffectFunc * review 2 Co-authored-by: fig <fig02srl@gmail.com>
2020-12-07 17:48:29 +00:00
TransformUpdateIndex* transUpdIdx);
void SkelCurve_Destroy(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve);
void SkelCurve_SetAnim(SkelAnimeCurve* skelCurve, TransformUpdateIndex* transUpdIdx, f32 arg2, f32 animFinalFrame,
f32 animCurFrame, f32 animSpeed);
s32 SkelCurve_Update(GlobalContext* globalCtx, SkelAnimeCurve* skelCurve);
void SkelCurve_Draw(Actor* actor, GlobalContext* globalCtx, SkelAnimeCurve* skelCurve,
OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, void* data);
s32 func_8006CFC0(s32 scene);
void func_8006D074(GlobalContext* globalCtx);
void func_8006D0AC(GlobalContext* globalCtx);
void func_8006D0EC(GlobalContext* globalCtx, Player* player);
void func_8006D684(GlobalContext* globalCtx, Player* player);
void func_8006DC68(GlobalContext* globalCtx, Player* player);
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2);
2021-06-01 19:27:07 +00:00
s32 Jpeg_Decode(void* data, void* zbuffer, void* workBuff, u32 workSize);
void KaleidoSetup_Update(GlobalContext* globalCtx);
void KaleidoSetup_Init(GlobalContext* globalCtx);
void KaleidoSetup_Destroy(GlobalContext* globalCtx);
z_message_PAL, message_data_static and surrounding doc (#996) * Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
void func_8006EE50(Font* font, u16 arg1, u16 arg2);
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex);
z_message_PAL, message_data_static and surrounding doc (#996) * Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
void Font_LoadMessageBoxIcon(Font* font, u16 icon);
void Font_LoadOrderedFont(Font* font);
2021-12-27 19:23:03 +00:00
2020-03-20 00:25:53 +00:00
void Lib_MemSet(u8* dest, size_t size, u8 val);
2021-12-27 19:23:03 +00:00
void func_80077D10(f32* arg0, s16* arg1, Input* input);
s16 Rand_S16Offset(s16 base, s16 range);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
void Actor_ProcessInitChain(Actor* actor, InitChainEntry* initChain);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src);
void Common_PlaySfx(u16 sfxId);
void Common_PlaySfx2(u16 sfxId);
void Common_PlaySfxAtPos(Vec3f* arg0, u16 sfxId);
void HealthMeter_Init(GlobalContext* globalCtx);
void HealthMeter_Update(GlobalContext* globalCtx);
void HealthMeter_Draw(GlobalContext* globalCtx);
2021-12-27 19:23:03 +00:00
void HealthMeter_UpdateBeatingHeart(GlobalContext* globalCtx);
u32 HealthMeter_IsCritical(void);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
void* ZeldaArena_Malloc(u32 size);
void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line);
void* ZeldaArena_MallocR(u32 size);
void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line);
void* ZeldaArena_Realloc(void* ptr, u32 newSize);
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line);
void ZeldaArena_Free(void* ptr);
void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line);
void* ZeldaArena_Calloc(u32 num, u32 size);
void ZeldaArena_Display();
void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc);
void ZeldaArena_Check();
void ZeldaArena_Init(void* start, u32 size);
void ZeldaArena_Cleanup();
u8 ZeldaArena_IsInitalized();
void MapMark_Init(GlobalContext* globalCtx);
void MapMark_ClearPointers(GlobalContext* globalCtx);
void MapMark_Draw(GlobalContext* globalCtx);
2021-12-27 19:23:03 +00:00
void PreNmiBuff_Init(PreNmiBuff* thiss);
void PreNmiBuff_SetReset(PreNmiBuff* thiss);
u32 PreNmiBuff_IsResetting(PreNmiBuff* thiss);
void MsgEvent_SendNullTask(void);
f32 OLib_Vec3fDist(Vec3f* a, Vec3f* b);
f32 OLib_Vec3fDistXZ(Vec3f* a, Vec3f* b);
f32 OLib_ClampMinDist(f32 val, f32 min);
f32 OLib_ClampMaxDist(f32 val, f32 max);
Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b);
Vec3f* OLib_VecSphGeoToVec3f(Vec3f* dest, VecSph* sph);
VecSph* OLib_Vec3fToVecSph(VecSph* dest, Vec3f* vec);
VecSph* OLib_Vec3fToVecSphGeo(VecSph* arg0, Vec3f* arg1);
VecSph* OLib_Vec3fDiffToVecSphGeo(VecSph* arg0, Vec3f* a, Vec3f* b);
Vec3f* OLib_Vec3fDiffRad(Vec3f* dest, Vec3f* a, Vec3f* b);
2021-12-27 19:23:03 +00:00
Path* Path_GetByIndex(GlobalContext* globalCtx, s16 index, s16 max);
f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
void Path_CopyLastPoint(Path* path, Vec3f* dest);
2021-12-27 19:23:03 +00:00
void func_80095AA0(GlobalContext* globalCtx, Room* room, Input* arg2, UNK_TYPE arg3); // z_play
void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0,
u16 tlutCount, f32 frameX, f32 frameY);
2020-03-17 04:31:30 +00:00
void func_80096FD4(GlobalContext* globalCtx, Room* room);
s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum);
s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx);
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags);
void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx);
2021-12-27 19:23:03 +00:00
void Sample_Destroy(GameState* thissx);
void Sample_Init(GameState* thissx);
2020-03-17 04:31:30 +00:00
void Inventory_ChangeEquipment(s16 equipment, u16 value);
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment);
void Inventory_ChangeUpgrade(s16 upgrade, s16 value);
void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx);
void Object_UpdateBank(ObjectContext* objectCtx);
s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId);
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex);
void func_800981B8(ObjectContext* objectCtx);
s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd);
void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx);
2020-03-17 04:31:30 +00:00
void func_800994A0(GlobalContext* globalCtx);
void Scene_Draw(GlobalContext* globalCtx);
2021-12-27 19:23:03 +00:00
void func_800A57C0(MtxF* mtx, Struct_800A57C0* arg1, Struct_800A598C* arg2, Vtx* arg3, Vec3f* arg4);
void func_800A598C(GraphicsContext* gfxCtx, PSkinAwb* skin, s32 limbIndex, s32 arg3);
void func_800A5E28(GraphicsContext* gfxCtx, PSkinAwb* skin, s32 limbIndex, s32 arg3, s32 arg4);
void func_800A5F60(GraphicsContext* gfxCtx, PSkinAwb* skin, s32 limbIndex, Gfx* arg3, s32 arg4);
void func_800A60D8(Actor* actor, GlobalContext* globalCtx, PSkinAwb* skin, SkinCallback callback, SkinCallback2 arg4,
s32 arg5, s32 arg6, s32 arg7);
void func_800A6330(Actor* actor, GlobalContext* globalCtx, PSkinAwb* skin, SkinCallback callback, s32 arg4);
2021-12-27 19:23:03 +00:00
void func_800A6360(Actor* thiss, GlobalContext* globalCtx, PSkinAwb* skin, SkinCallback callback, SkinCallback2 arg4,
Fix most actor compiler warnings (#656) * functions.h * Bg_Hidan_Kowarerukabe * Demo_Geff * Arrow_Fire * Demo_Sa * Arms_Hook * En_Okarina_Effect * Demo_Im * Bg_Menkuri_Kaiten * Bg_Spot09_Obj (minus CollisionHeader) * Obj_Hsblock * Obj_Elevator * En_Anubice_Tag * Bg_Ydan_Hasi (minus BgYdanHasi_MoveWater return shenanigans) * En_Heishi4 * Demo_Go * Bg_Spot00_Break * Bg_Hidan_Kousi * Bg_Spot17_Bakudankabe * Bg_Spot18_Basket * En_Dha * Bg_Jya_Goroiwa * En_Js * Bg_Mori_Hineri * Bg_Spot18_Shutter * Bg_Jya_Bombchuiwa * Bg_Bdan_Objects * Bg_Jya_Amishutter * Bg_Toki_Swd * En_Heishi2 * En_Fu * Bg_Jya_Kanaami * Bg_Pushbox * Bg_Spot12_Saku * En_Ani * En_Zl1 * En_Vase * Bg_Spot05_Soko * En_Crow (and a rename in En_Firefly) * Bg_Hidan_Fslift * En_Dog * Bg_Heavy_Block * En_Boom * Bg_Ddan_Kd * Bg_Spot16_Bombstone * Demo_Effect * Bg_Hidan_Syoku * En_Firefly * En_Fw * Bg_Jya_Bombiwa * En_Fd * ovl_Bg_Spot15_Saku * En_Mb * Bg_Spot18_Obj * Bg_Zg * Bg_Bdan_Switch * En_Md * En_Box * En_Bw * En_Viewer * En_Hs2 * Bg_Ydan_Maruta * En_St * En_Ru1 * Bg_Ddan_Jd * En_Sb * Bg_Jya_Cobra * Bg_Spot12_Gate * Bg_Haka_Trap * En_Ms * En_Kakasi2 * En_Horse_Link_Child * Obj_Bombiwa * En_Ds * En_Kz * Bg_Umajump * Bg_Spot03_Taki * Door_Toki * Item_Etcetera * En_Ru2 * En_Niw * Bg_Spot15_Rrbox * Demo_Tre_Lgt * Obj_Oshihiki * Bg_Mjin * Bg_Spot18_Futa * Bg_Spot01_Idosoko * En_Arow_Trap * Bg_Mizu_Uzu * En_Horse_Zelda * Player * fix func_800358DC to work in functions.h * fix fix to functions.h * enum fixes * Some review comments addressed * DynaPoly_GetActor standardisation * ovl_Daiku_Kakariko * ovl_En_Vase * ovl_En_Mk * ovl_Bg_Spot00_Hanebasi * ovl_Bg_Spot06_Objects * ovl_En_Go * ovl_En_Go2 * ovl_Bg_Jya_Bombiwa * ovl_En_Cs * ovl_En_Dodojr * ovl_En_Ny * ovl_En_Mm2 * Apply review suggestion
2021-02-02 23:44:24 +00:00
s32 arg5);
void func_800A63CC(Actor* actor, GlobalContext* globalCtx, PSkinAwb* skin, SkinCallback callback, SkinCallback2 arg4,
s32 arg5, s32 arg6, s32 arg7);
void func_800A6408(PSkinAwb* skin, s32 joint, Vec3f* arg2, Vec3f* arg3);
void func_800A6460(GlobalContext* globalCtx, PSkinAwb* skin, s32 arg2);
void func_800A663C(GlobalContext* globalCtx, PSkinAwb* skin, SkeletonHeader* skeletonHeader,
AnimationHeader* animationHeader);
void func_800A6888(GlobalContext* globalCtx, PSkinAwb* skin);
s32 func_800A698C(PSkinAwb* skin, SkinLimb** limbs, MtxF* arg2, u8 arg3, u8 arg4);
s32 func_800A6AC4(PSkinAwb* skin, MtxF* arg1, Actor* actor, s32 arg3);
2021-12-27 19:23:03 +00:00
void func_800A7EC0(MtxF* mf, s16 a, f32 x, f32 y, f32 z);
void Sram_InitNewSave(void);
void Sram_InitDebugSave(void);
void Sram_OpenSave(SramContext* sramCtx);
void Sram_WriteSave(SramContext* sramCtx);
void Sram_VerifyAndLoadAllSaves(FileChooseContext* fileChoose, SramContext* sramCtx);
void Sram_InitSave(FileChooseContext* fileChoose, SramContext* sramCtx);
void Sram_EraseSave(FileChooseContext* fileChoose, SramContext* sramCtx);
void Sram_CopySave(FileChooseContext* fileChoose, SramContext* sramCtx);
File Select (z_file_choose) OK (#1012) * matching split * migrate progress * split done and rodata migrated * all data migrated to c * start init * progress * progress * progress * progress * progress * progress * copy done * progress * erase and settings done * progress * progress * progress * start keyboard * progress * progress * progress * progress * Minor progress * fix z_magic_dark issue * func_80806F34 decomp'd * verified equivalence * one fix * format * merge petries work * reorganizing * lots of reorganizing and wraning fixing * rename file * remove language enum * unwanted changes * some symbol replacement, organization, and some names * all symbols replaced, some organization * some more cleanup * continue docs * Match the remaining functions in file_choose * merge master * select mode documented, all functions in file_choose.c named * nameset functions named, some other cleaning * some more general cleanup * stub comments for cm, name a few things * fix data and sizeof * copy/erase functions and modes named * rename assets, format * change some struct members * fixes * review1 * fix maching error * extract VTX data * re add werror to ZAPD * review 2 * fix * remove file boundary padding * remove zeroes * review3 * change skybox stuff * changes to vs etc Co-authored-by: KrimtonZ <krimtonz@gmail.com> Co-authored-by: Thar0 <17233964+Thar0@users.noreply.github.com> Co-authored-by: mzxrules <mzxrules@gmail.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com> Co-authored-by: Louis <louist103@gmail.com>
2021-11-15 21:33:44 +00:00
void Sram_WriteSramHeader(SramContext* sramCtx);
void Sram_InitSram(GameState* gameState, SramContext* sramCtx);
void Sram_Alloc(GameState* gameState, SramContext* sramCtx);
void Sram_Init(GlobalContext* globalCtx, SramContext* sramCtx);
2021-12-27 19:23:03 +00:00
void SsSram_Init(uintptr_t addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize,
u8 handleRelDuration,
u8 handlePulse, u32 handleSpeed);
void SsSram_Dma(void* dramAddr, size_t size, s32 direction);
2021-12-27 19:23:03 +00:00
void SsSram_ReadWrite(uintptr_t addr, void* dramAddr, size_t size, s32 direction);
void Rumble_Init(PadMgr*, s32);
void Rumble_Shake2(f32, u8, u8, u8);
void Rumble_Shake(f32, u8, u8, u8);
void Rumble_Reset();
void Rumble_Destroy(void);
u32 Rumble_IsEnabled();
void Rumble_Stop();
void Rumble_Clear();
void Rumble_Enable(u32);
2021-12-27 19:23:03 +00:00
void ViMode_LogPrint(OSViMode* viMode);
void ViMode_Configure(ViMode* viMode, s32 mode, s32 type, s32 unk_70, s32 unk_74, s32 unk_78, s32 unk_7C, s32 width,
s32 height, s32 unk_left, s32 unk_right, s32 unk_top, s32 unk_bottom);
void ViMode_Save(ViMode* viMode);
void ViMode_Load(ViMode* viMode);
void ViMode_Init(ViMode* viMode);
void ViMode_Destroy(ViMode* viMode);
void ViMode_ConfigureFeatures(ViMode* viMode, s32 viFeatures);*/
void ViMode_Update(ViMode* viMode, Input* input);
/*void func_800ACE70(struct_801664F0* thiss);
2021-12-27 19:23:03 +00:00
void func_800ACE90(struct_801664F0* thiss);
void func_800ACE98(struct_801664F0* thiss, Gfx** gfxp);
void VisMono_Init(VisMono* thiss);
void VisMono_Destroy(VisMono* thiss);
2022-04-01 20:10:56 +00:00
void VisMono_DesaturateTLUT(VisMono* thiss, u16* tex);
Gfx* VisMono_DesaturateDList(VisMono* thiss, Gfx* gfx);
2021-12-27 19:23:03 +00:00
void VisMono_Draw(VisMono* thiss, Gfx** gfxp);
void VisMono_DrawOld(VisMono* thiss);
void func_800AD920(struct_80166500* thiss);
void func_800AD950(struct_80166500* thiss);
void func_800AD958(struct_80166500* thiss, Gfx** gfxp);
File Select (z_file_choose) OK (#1012) * matching split * migrate progress * split done and rodata migrated * all data migrated to c * start init * progress * progress * progress * progress * progress * progress * copy done * progress * erase and settings done * progress * progress * progress * start keyboard * progress * progress * progress * progress * Minor progress * fix z_magic_dark issue * func_80806F34 decomp'd * verified equivalence * one fix * format * merge petries work * reorganizing * lots of reorganizing and wraning fixing * rename file * remove language enum * unwanted changes * some symbol replacement, organization, and some names * all symbols replaced, some organization * some more cleanup * continue docs * Match the remaining functions in file_choose * merge master * select mode documented, all functions in file_choose.c named * nameset functions named, some other cleaning * some more general cleanup * stub comments for cm, name a few things * fix data and sizeof * copy/erase functions and modes named * rename assets, format * change some struct members * fixes * review1 * fix maching error * extract VTX data * re add werror to ZAPD * review 2 * fix * remove file boundary padding * remove zeroes * review3 * change skybox stuff * changes to vs etc Co-authored-by: KrimtonZ <krimtonz@gmail.com> Co-authored-by: Thar0 <17233964+Thar0@users.noreply.github.com> Co-authored-by: mzxrules <mzxrules@gmail.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com> Co-authored-by: Louis <louist103@gmail.com>
2021-11-15 21:33:44 +00:00
void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId);
Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z);
void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z);
void SkyboxDraw_Update(SkyboxContext* skyboxCtx);
void PlayerCall_InitFuncPtrs(void);
2021-12-27 19:23:03 +00:00
void TransitionUnk_InitGraphics(TransitionUnk* thiss);
void TransitionUnk_InitData(TransitionUnk* thiss);
void TransitionUnk_Destroy(TransitionUnk* thiss);
TransitionUnk* TransitionUnk_Init(TransitionUnk* thiss, s32 row, s32 col);
void TransitionUnk_SetData(TransitionUnk* thiss);
void TransitionUnk_Draw(TransitionUnk* thiss, Gfx**);
void func_800B23E8(TransitionUnk* thiss);
// ? DbCamera_AddVecSph(?);
// ? DbCamera_CalcUpFromPitchYawRoll(?);
// ? DbCamera_SetTextValue(?);
// ? DbCamera_Vec3SToF(?);
// ? DbCamera_Vec3FToS(?);
// ? DbCamera_CopyVec3f(?);
// ? DbCamera_Vec3SToF2(?);
2020-03-17 04:31:30 +00:00
// ? func_800B3F94(?);
// ? func_800B3FF4(?);
// ? func_800B404C(?);
// ? func_800B4088(?);
// ? func_800B41DC(?);
// ? func_800B42C0(?);
// ? func_800B4370(?);
// ? func_800B44E0(?);
// ? DbCamera_PrintPoints(?);
// ? DbCamera_PrintF32Bytes(?);
// ? DbCamera_PrintU16Bytes(?);
// ? DbCamera_PrintS16Bytes(?);
// ? DbCamera_PrintCutBytes(?);
void DbCamera_Init(DbCamera* dbCamera, Camera* cameraPtr);
void DbgCamera_Enable(DbCamera* dbCamera, Camera* cam);
void DbCamera_Update(DbCamera* dbCamera, Camera* cam);
// ? DbCamera_GetFirstAvailableLetter(?);
// ? DbCamera_InitCut(?);
// ? DbCamera_ResetCut(?);
// ? DbCamera_CalcMempakAllocSize(?);
// ? DbCamera_GetMempakAllocSize(?);
// ? DbCamera_DrawSlotLetters(?);
// ? DbCamera_PrintAllCuts(?);
2020-03-17 04:31:30 +00:00
// ? func_800B91B0(?);
void DbCamera_Reset(Camera* cam, DbCamera* dbCam);
// ? DbCamera_UpdateDemoControl(?);
void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3);
decompile z_camera (#398) * cleanup * name camera action functions * decompile a few small functions, name a few Camera struct members * decompile camera data, decompile a few camera functions * Split ASM for code_800BB0A0 * removing code_800BB0A0.s * PR Requests, Camera WIP * remove #define NON_MATCHING from db_camera * rename code_8007BF90.c to z_olib.c, rename functions in z_olib.c * camera wip * rename some struct memebers, some decomp wip * pr updates * camera wip * name some fields in Camera Struct, being making sense of Camera_Update * Camera WIP * wip * wip * add z64camera.h header, begin creating CameraSetting macros * wip * wip * wip * wip * migrate camera bss to c * match a couple functions in db_camera * match some small db_camera functions * wip * migrate db_camera rodata, match a few functions * remote db_camera.rodata.s * match some of db_camera * identify types of some unknown data pieces * some small wip * Match Camera_Init, some function changes, some struct name changes. Change unk_C0 and unk_CC to floats from Vec3fs * add naming for a few more Camera struct members * wip * match func_80043F94 * Match Camera_Jump1 * document some of Camera_Jump1 * wip * match Camera_Jump3 * Match Camera_Update, FeelsAmazing * wip * wip * match Camera_SetParam * minor cleanup * wip * wip * match Camera_KeepOn0 * some documentation, modify some matching functions to match style of others. * match Camera_Demo1 * match camera_demo9 * document Camera_Demo1 and Camera_Demo9 * wip * Match camera_battle4 * match camera_unique2 * Match Camera_Unique3 * match camera_special6 * match Camera_Special5 * wip * document camera_special6 * naming updates * match camera_Unique1 * match Camera_Unique0 * wip * Match Camera_CalcUpFromPitchYawRoll * match func_80045508 * document Camera_Battle4 * document several camera functions, move camera data to separate file * rename phi/theta to pitch/yaw * wip * uniq9 wip * Camera_Unqiue9 OK * document Camera_Unique9 * name unk_160 in camera struct * wip * wip * minor updates * fix conflicts * wip * wip * Olib updates * wip * wip * rename most Math3D functions, few matches, documentation * wip * document most of math3d * wip * wip * wip * pr updates * Match Camera_Fixed4 * match func_80058E8C * pr updates * add missing comment block finalizer * Merge math3dupdates * match Camera_ChangeSetting * Match Camera_ChangeMode * match func_80058148 * Match Camera_Special9 * decompile the rest of camera data * match Camera_Demo5 * name a few camera functions in z_play * match func_80046CB4, some work on other fucntions * wip * impove some non matchings * fix function rename * match func_800588B4 * match Camera_Subj4 * wip * Camera_Demo3 matching, Camera_Battle1 big progress * Camera_Normal2 OK * wip * match Camera_Parallel1 * normalize some things across functions * match Camera_Normal1 * Match Camera_Normal3 * some cleanup * more cleanup * more cleanup , match Camera_CalcDefaultPitch * data formatting * Match Camera_Jump2 * document Camera_Jump2 * Match Camera_KeepOn3 * document some of Camera_KeepOn3 * improve some non_matchings * match func_80045C74 and func_800460A8 * code cleanup, documentation * match Camera_KeepOn1 * Match Camera_Subj3 * Match Camera_Battle1 * remove non_matching from func_80044adc and func_80046e20 * name several members of Battle1 * more documentation on Battle1 * cleanup * renaming Camera_Vec3fScaleXYZFactor to Camera_Vec3fTranslateByUnitVector * reorganize update structs, remove final references to params, remove CameraParams union * implement camera enums into player * Renaming Camera_GetDir to Camera_GetInputDir, Camera_GetRealDir to Camera_GetCamDir, etc, implement camera enum's into player * remove non-global camera variables from variables.h * clean up some variable declarations * finish pr comment updates * fix some warnings * data formatting * finish commenting on data * delete unused asm * remove asm Co-authored-by: fig <fig02srl@gmail.com>
2020-12-06 22:39:47 +00:00
s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s16* keyframe, f32* curFrame);
2020-06-07 23:38:33 +00:00
s32 Mempak_Init(s32 controllerNb);
s32 Mempak_GetFreeBytes(s32 controllerNb);
s32 Mempak_FindFile(s32 controllerNb, char start, char end);
s32 Mempak_Write(s32 controllerNb, char idx, void* buffer, s32 offset, s32 size);
s32 Mempak_Read(s32 controllerNb, char idx, void* buffer, s32 offset, s32 size);
s32 Mempak_Alloc(s32 controllerNb, char* idx, s32 size);
s32 Mempak_DeleteFile(s32 controllerNb, char idx);
s32 Mempak_GetFileSize(s32 controllerNb, char idx);
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl);
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl);
2020-03-17 04:31:30 +00:00
void KaleidoManager_Init(GlobalContext* globalCtx);
void KaleidoManager_Destroy();
void* KaleidoManager_GetRamAddr(void* vram);
void KaleidoScopeCall_LoadPlayer();
void KaleidoScopeCall_Init(GlobalContext* globalCtx);
void KaleidoScopeCall_Destroy(GlobalContext* globalCtx);
void KaleidoScopeCall_Update(GlobalContext* globalCtx);
2020-03-22 21:50:11 +00:00
void KaleidoScopeCall_Draw(GlobalContext* globalCtx);
void func_800BC490(GlobalContext* globalCtx, s16 point);
s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1);
void func_800BC590(GlobalContext* globalCtx);
void func_800BC5E0(GlobalContext* globalCtx, s32 arg1);
2021-12-27 19:23:03 +00:00
s32 func_800C0CB8(GlobalContext* globalCtx);
s32 FrameAdvance_IsEnabled(GlobalContext* globalCtx);
s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw);
EnDivingGame OK (#745) * update * EnDivingGame_Draw OK * dont feel like working on this function today * fixed build errors * fixing some merge conflicts Signed-off-by: Angie <angheloalf95@gmail.com> * more conflict fixing Signed-off-by: Angie <angheloalf95@gmail.com> * all merge conflicts fixed Signed-off-by: Angie <angheloalf95@gmail.com> * EnDivingGame_Update OK Signed-off-by: Angie <angheloalf95@gmail.com> * remove DECR Signed-off-by: Angie <angheloalf95@gmail.com> * format and unused_asm Signed-off-by: Angie <angheloalf95@gmail.com> * change reloc in spec Signed-off-by: Angie <angheloalf95@gmail.com> * damn reloc Signed-off-by: Angie <angheloalf95@gmail.com> * Apply suggestions from code review Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> * use OPEN_DISPS macro Signed-off-by: Angie <angheloalf95@gmail.com> * batch of suggestions Signed-off-by: Angie <angheloalf95@gmail.com> * more suggestions Signed-off-by: Angie <angheloalf95@gmail.com> * more changes, but this isn't ready yet Signed-off-by: Angie <angheloalf95@gmail.com> * rename two timers Signed-off-by: angie <angheloalf95@gmail.com> * Update src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> * grabbedRuppiesCounter Signed-off-by: angie <angheloalf95@gmail.com> * a lot of vec Signed-off-by: angie <angheloalf95@gmail.com> * Apply suggestions from code review Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com> * fix some typos Signed-off-by: angie <angheloalf95@gmail.com> * allRupeesThrowed Signed-off-by: angie <angheloalf95@gmail.com> * rupeesLeftToThrow Signed-off-by: Angie <angheloalf95@gmail.com> * boolean changes and minor comments Signed-off-by: Angie <angheloalf95@gmail.com> * and more renaming Signed-off-by: Angie <angheloalf95@gmail.com> * renaiming and chained assign Signed-off-by: Angie <angheloalf95@gmail.com> * rename 3 functions Signed-off-by: Angie <angheloalf95@gmail.com> * final rename and add two enums Signed-off-by: angie <angheloalf95@gmail.com> * format Signed-off-by: angie <angheloalf95@gmail.com> * enum naming Signed-off-by: angie <angheloalf95@gmail.com> Co-authored-by: Lucas Shaw <lgs84@cornell.edu> Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>
2021-04-03 16:15:16 +00:00
s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos);
2021-12-27 19:23:03 +00:00
void PreRender_SetValuesSave(PreRender* thiss, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
void PreRender_Init(PreRender* thiss);
void PreRender_SetValues(PreRender* thiss, u32 width, u32 height, void* fbuf, void* zbuf);
void PreRender_Destroy(PreRender* thiss);
void func_800C0F28(PreRender* thiss, Gfx** gfxp, void* buf, void* bufSave);
void func_800C1258(PreRender* thiss, Gfx** gfxp);
void func_800C170C(PreRender* thiss, Gfx** gfxp, void* fbuf, void* fbufSave, u32 r, u32 g, u32 b, u32 a);
void func_800C1AE8(PreRender* thiss, Gfx** gfxp, void* fbuf, void* fbufSave);
void func_800C1B24(PreRender* thiss, Gfx** gfxp, void* fbuf, void* cvgSave);
void func_800C1E9C(PreRender* thiss, Gfx** gfxp);
void func_800C1F20(PreRender* thiss, Gfx** gfxp);
void func_800C1FA4(PreRender* thiss, Gfx** gfxp);
void func_800C20B4(PreRender* thiss, Gfx** gfxp);
void func_800C2118(PreRender* thiss, Gfx** gfxp);
void func_800C213C(PreRender* thiss, Gfx** gfxp);
void func_800C24BC(PreRender* thiss, Gfx** gfxp);
void func_800C24E0(PreRender* thiss, Gfx** gfxp);
void func_800C2500(PreRender* thiss, s32 x, s32 y);
void func_800C2FE4(PreRender* thiss);
void PreRender_Calc(PreRender* thiss);
2020-03-17 04:31:30 +00:00
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size);
void THGA_Dt(TwoHeadGfxArena* thga);
u32 THGA_IsCrash(TwoHeadGfxArena* thga);
void THGA_Init(TwoHeadGfxArena* thga);
s32 THGA_GetSize(TwoHeadGfxArena* thga);
Gfx* THGA_GetHead(TwoHeadGfxArena* thga);
void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start);
Gfx* THGA_GetTail(TwoHeadGfxArena* thga);
Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count);
Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga);
Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga);
Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size);
Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count);
Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga);
Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count);
Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga);
2021-12-27 19:23:03 +00:00
2022-02-16 20:11:03 +00:00
void Audio_StopAllBanks(void);
void func_800C3C80(AudioMgr* audioMgr);
void AudioMgr_HandleRetrace(AudioMgr* audioMgr);
void AudioMgr_HandlePRENMI(AudioMgr* audioMgr);
void AudioMgr_ThreadEntry(void* arg0);
void AudioMgr_Unlock(AudioMgr* audioMgr);
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr);
2020-03-17 04:31:30 +00:00
void TitleSetup_InitImpl(GameState* gameState);
void TitleSetup_Destroy(GameState* gameState);
void TitleSetup_Init(GameState* gameState);
2021-12-27 19:23:03 +00:00
ListAlloc* ListAlloc_Init(ListAlloc* thiss);
void* ListAlloc_Alloc(ListAlloc* thiss, u32 size);
void ListAlloc_Free(ListAlloc* thiss, void* data);
void ListAlloc_FreeAll(ListAlloc* thiss);
void Main_LogSystemHeap(void);
void Main(void* arg);
OSMesgQueue* PadMgr_LockSerialMesgQueue(PadMgr* padmgr);
void PadMgr_UnlockSerialMesgQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue);
void PadMgr_LockPadData(PadMgr* padmgr);
void PadMgr_UnlockPadData(PadMgr* padmgr);
void PadMgr_RumbleControl(PadMgr* padmgr);
void PadMgr_RumbleStop(PadMgr* padmgr);
void PadMgr_RumbleReset(PadMgr* padmgr);
void PadMgr_RumbleSet(PadMgr* padmgr, u8* ctrlrRumbles);
void PadMgr_ProcessInputs(PadMgr* padmgr);
void PadMgr_HandleRetraceMsg(PadMgr* padmgr);
void PadMgr_HandlePreNMI(PadMgr* padmgr);
// This function must remain commented out, because it is called incorrectly in
// fault.c (actual bug in game), and the compiler notices and won't compile it
// void PadMgr_RequestPadData(PadMgr* padmgr, Input* inputs, s32 mode);
void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* siIntMsgQ, IrqMgr* irqMgr, OSId id, OSPri priority, void* stack);
void Sched_SwapFrameBuffer(CfbInfo* cfbInfo);
void func_800C84E4(SchedContext* sc, CfbInfo* cfbInfo);
void Sched_HandleReset(SchedContext* sc);
void Sched_HandleStart(SchedContext* sc);
void Sched_QueueTask(SchedContext* sc, OSScTask* task);
void Sched_Yield(SchedContext* sc);
OSScTask* func_800C89D4(SchedContext* sc, OSScTask* task);
s32 Sched_Schedule(SchedContext* sc, OSScTask** sp, OSScTask** dp, s32 state);
void func_800C8BC4(SchedContext* sc, OSScTask* task);
u32 Sched_IsComplete(SchedContext* sc, OSScTask* task);
void Sched_RunTask(SchedContext* sc, OSScTask* spTask, OSScTask* dpTask);
void Sched_HandleEntry(SchedContext* sc);
void Sched_HandleRetrace(SchedContext* sc);
void Sched_HandleRSPDone(SchedContext* sc);
void Sched_HandleRDPDone(SchedContext* sc);
void Sched_SendEntryMsg(SchedContext* sc);
void Sched_ThreadEntry(void* arg);
void Sched_Init(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, IrqMgr* irqMgr);
2021-12-27 19:23:03 +00:00
void SpeedMeter_InitImpl(SpeedMeter* thiss, u32 arg1, u32 y);
void SpeedMeter_Init(SpeedMeter* thiss);
void SpeedMeter_Destroy(SpeedMeter* thiss);
void SpeedMeter_DrawTimeEntries(SpeedMeter* thiss, GraphicsContext* gfxCtx);
void SpeedMeter_InitAllocEntry(SpeedMeterAllocEntry* entry, u32 maxval, u32 val, u16 backColor, u16 foreColor, u32 ulx,
u32 lrx, u32 uly, u32 lry);
2021-12-27 19:23:03 +00:00
void SpeedMeter_DrawAllocEntry(SpeedMeterAllocEntry* thiss, GraphicsContext* gfxCtx);
void SpeedMeter_DrawAllocEntries(SpeedMeter* meter, GraphicsContext* gfxCtx, GameState* state);
2021-12-27 19:23:03 +00:00
void Matrix_ScaleTrans(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 posX, f32 posY, f32 posZ) ;
2021-12-27 19:23:03 +00:00
u64* SysUcode_GetUCodeBoot(void);
u64 SysUcode_GetUCodeBootSize(void);
u64* SysUcode_GetUCode(void);
u64* SysUcode_GetUCodeData(void);
void Rumble_Update(RumbleStruct* arg0);
void func_800D3140(RumbleStruct* arg0);
void func_800D3178(RumbleStruct* arg0);
void func_800D31A0(void);
void func_800D31F0(void);
void func_800D3210(void);
2021-12-27 19:23:03 +00:00
void IrqMgr_AddClient(IrqMgr* thiss, IrqMgrClient* c, OSMesgQueue* msgQ);
void IrqMgr_RemoveClient(IrqMgr* thiss, IrqMgrClient* c);
void IrqMgr_SendMesgForClient(IrqMgr* thiss, OSMesg msg);
void IrqMgr_JamMesgForClient(IrqMgr* thiss, OSMesg msg);
void IrqMgr_HandlePreNMI(IrqMgr* thiss);
2020-03-17 04:31:30 +00:00
void IrqMgr_CheckStack();
2021-12-27 19:23:03 +00:00
void IrqMgr_HandlePRENMI450(IrqMgr* thiss);
void IrqMgr_HandlePRENMI480(IrqMgr* thiss);
void IrqMgr_HandlePRENMI500(IrqMgr* thiss);
void IrqMgr_HandleRetrace(IrqMgr* thiss);
2020-03-17 04:31:30 +00:00
void IrqMgr_ThreadEntry(void* arg0);
2021-12-27 19:23:03 +00:00
void IrqMgr_Init(IrqMgr* thiss, void* stack, OSPri pri, u8 retraceCount);
2020-03-17 04:31:30 +00:00
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
void* DebugArena_Malloc(u32 size);
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line);
void* DebugArena_MallocR(u32 size);
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line);
void* DebugArena_Realloc(void* ptr, u32 newSize);
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line);
void DebugArena_Free(void* ptr);
void DebugArena_FreeDebug(void* ptr, const char* file, s32 line);
void* DebugArena_Calloc(u32 num, u32 size);
void DebugArena_Display(void);
2020-03-17 04:31:30 +00:00
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc);
void DebugArena_Check(void);
2020-03-17 04:31:30 +00:00
void DebugArena_Init(void* start, u32 size);
void DebugArena_Cleanup(void);
u8 DebugArena_IsInitalized(void);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
void Fault_SleepImpl(u32);
void Fault_ClientProcessThread(void* arg);
2020-03-17 04:31:30 +00:00
void Fault_ProcessClientContext(FaultClientContext*);
u32 Fault_ProcessClient(u32, u32, u32);
void Fault_AddClient(FaultClient*, void*, void*, void*);
void Fault_RemoveClient(FaultClient*);
void Fault_AddAddrConvClient(FaultAddrConvClient*, void*, void*);
void Fault_RemoveAddrConvClient(FaultAddrConvClient*);
u32 Fault_ConvertAddress(FaultAddrConvClient*);
void Fault_Sleep(u32);
void Fault_PadCallback(Input*);
void Fault_UpdatePadImpl();
u32 Fault_WaitForInputImpl();
2020-03-17 04:31:30 +00:00
void Fault_WaitForInput();
void Fault_DrawRec(s32, s32, s32, s32, u16);
void Fault_FillScreenBlack();
void Fault_FillScreenRed();
void Fault_DrawCornerRec(u16);
void Fault_PrintFReg(s32, f32*);
void Fault_LogFReg(s32, f32*);
void Fault_PrintFPCR(u32);
void Fault_LogFPCR(u32);
void Fault_PrintThreadContext(OSThread*);
void Fault_LogThreadContext(OSThread*);
OSThread* Fault_FindFaultedThread();
void Fault_Wait5Seconds();
void Fault_WaitForButtonCombo();
void Fault_DrawMemDumpPage(const char*, u32*, u32);
void Fault_DrawMemDump(u32, u32, u32, u32);
void Fault_WalkStack(u32* spPtr, u32* pcPtr, u32* raPtr);
void Fault_DrawStackTrace(OSThread* thread, s32 x, s32 y, s32 height);
void Fault_LogStackTrace(OSThread* thread, s32 height);
2020-03-17 04:31:30 +00:00
void Fault_ResumeThread(OSThread*);
void Fault_CommitFB();
void Fault_ProcessClients();
void Fault_UpdatePad();
void Fault_ThreadEntry(void*);
void Fault_SetFB(void*, u16, u16);
void Fault_Init(void);
2020-03-17 04:31:30 +00:00
void Fault_HangupFaultClient(const char*, const char*);
void Fault_AddHungupAndCrashImpl(const char*, const char*);
void Fault_AddHungupAndCrash(const char*, u32);
void FaultDrawer_SetOsSyncPrintfEnabled(u32);
void FaultDrawer_DrawRecImpl(s32, s32, s32, s32, u16);
void FaultDrawer_DrawChar(char);
s32 FaultDrawer_ColorToPrintColor(u16);
void FaultDrawer_UpdatePrintColor();
void FaultDrawer_SetForeColor(u16);
void FaultDrawer_SetBackColor(u16);
void FaultDrawer_SetFontColor(u16);
void FaultDrawer_SetCharPad(s8, s8);
void FaultDrawer_SetCursor(s32, s32);
void FaultDrawer_FillScreen();
void* FaultDrawer_FormatStringFunc(void*, const char*, u32);
2020-03-17 04:31:30 +00:00
void FaultDrawer_VPrintf(const char*, char*);
void FaultDrawer_Printf(const char*, ...);
void FaultDrawer_DrawText(s32, s32, const char*, ...);
void FaultDrawer_SetDrawerFB(void*, u16, u16);
2020-03-22 21:50:11 +00:00
void FaultDrawer_SetInputCallback(void (*)());
2020-03-17 04:31:30 +00:00
void FaultDrawer_SetDefault();
2021-12-27 19:23:03 +00:00
void GfxPrint_SetColor(GfxPrint* thiss, u32 r, u32 g, u32 b, u32 a);
void GfxPrint_SetPosPx(GfxPrint* thiss, s32 x, s32 y);
void GfxPrint_SetPos(GfxPrint* thiss, s32 x, s32 y);
void GfxPrint_SetBasePosPx(GfxPrint* thiss, s32 x, s32 y);
void GfxPrint_Init(GfxPrint* thiss);
void GfxPrint_Destroy(GfxPrint* thiss);
void GfxPrint_Open(GfxPrint* thiss, Gfx* dList);
Gfx* GfxPrint_Close(GfxPrint* thiss);
s32 GfxPrint_Printf(GfxPrint* thiss, const char* fmt, ...);
2020-03-17 04:31:30 +00:00
void func_800FBCE0();
void func_800FBFD8(void);
2021-12-27 19:23:03 +00:00
void* Overlay_AllocateAndLoad(void* vRomStart, void* vRomEnd, void* vRamStart, void* vRamEnd);
void MtxConv_F2L(Mtx* m1, MtxF* m2);
void MtxConv_L2F(MtxF* m1, Mtx* m2);
void Overlay_Relocate(void* allocatedVRamAddress, OverlayRelocationSection* overlayInfo, void* vRamAddress);
2021-12-27 19:23:03 +00:00
s32 Overlay_Load(void* vRomStart, void* vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddress);
2020-03-17 04:31:30 +00:00
// ? func_800FC800(?);
// ? func_800FC83C(?);
// ? func_800FCAB4(?);
2020-03-22 21:50:11 +00:00
void SystemHeap_Init(void* start, u32 size);
void PadUtils_Init(Input* input);
void func_800FCB70(void);
void PadUtils_ResetPressRel(Input* input);
u32 PadUtils_CheckCurExact(Input* input, u16 value);
u32 PadUtils_CheckCur(Input* input, u16 key);
u32 PadUtils_CheckPressed(Input* input, u16 key);
u32 PadUtils_CheckReleased(Input* input, u16 key);
u16 PadUtils_GetCurButton(Input* input);
u16 PadUtils_GetPressButton(Input* input);
s8 PadUtils_GetCurX(Input* input);
s8 PadUtils_GetCurY(Input* input);
void PadUtils_SetRelXY(Input* input, s32 x, s32 y);
s8 PadUtils_GetRelXImpl(Input* input);
s8 PadUtils_GetRelYImpl(Input* input);
s8 PadUtils_GetRelX(Input* input);
s8 PadUtils_GetRelY(Input* input);
void PadUtils_UpdateRelXY(Input* input);
s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status);
2021-12-27 19:23:03 +00:00
2020-03-21 02:09:42 +00:00
f32 ceilf(f32 x);
f32 truncf(f32 x);
f32 roundf(f32 x);
f32 nearbyintf(f32 x);
2021-12-27 19:23:03 +00:00
u32 Rand_Next(void);
void Rand_Seed(u32 seed);
f32 Rand_ZeroOne(void);
f32 Rand_Centered(void);
u32 Rand_Next_Variable(u32* rndNum);
f32 Rand_ZeroOne_Variable(u32* rndNum);
f32 Rand_Centered_Variable(u32* rndNum);
2021-12-27 19:23:03 +00:00
#ifndef USE_NATIVE_MALLOC
u32 ArenaImpl_GetFillAllocBlock(Arena* arena);
u32 ArenaImpl_GetFillFreeBlock(Arena* arena);
u32 ArenaImpl_GetCheckFreeBlock(Arena* arena);
2020-03-17 04:31:30 +00:00
void ArenaImpl_SetFillAllocBlock(Arena* arena);
void ArenaImpl_SetFillFreeBlock(Arena* arena);
void ArenaImpl_SetCheckFreeBlock(Arena* arena);
void ArenaImpl_UnsetFillAllocBlock(Arena* arena);
void ArenaImpl_UnsetFillFreeBlock(Arena* arena);
void ArenaImpl_UnsetCheckFreeBlock(Arena* arena);
void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena* arena);
void ArenaImpl_LockInit(Arena* arena);
void ArenaImpl_Lock(Arena* arena);
void ArenaImpl_Unlock(Arena* arena);
ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node);
ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node);
ArenaNode* ArenaImpl_GetLastBlock(Arena* arena);
void __osMallocInit(Arena* arena, void* start, u32 size);
void __osMallocAddBlock(Arena* arena, void* start, s32 size);
void ArenaImpl_RemoveAllBlocks(Arena* arena);
void __osMallocCleanup(Arena* arena);
u8 __osMallocIsInitalized(Arena* arena);
void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node);
void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line);
void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line);
2020-03-22 21:50:11 +00:00
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line);
void* __osMalloc_NoLock(Arena* arena, u32 size);
2020-03-17 04:31:30 +00:00
void* __osMalloc(Arena* arena, u32 size);
2020-03-22 21:50:11 +00:00
void* __osMallocR(Arena* arena, u32 size);
2020-03-17 04:31:30 +00:00
void __osFree_NoLock(Arena* arena, void* ptr);
void __osFree(Arena* arena, void* ptr);
void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line);
void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line);
void* __osRealloc(Arena* arena, void* ptr, u32 newSize);
void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, s32 line);
void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc);
void __osDisplayArena(Arena* arena);
void ArenaImpl_FaultClient(Arena* arena);
u32 __osCheckArena(Arena* arena);
u8 func_800FF334(Arena* arena);
2021-12-27 19:23:03 +00:00
#endif
s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args);
s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...);
void Sleep_Cycles(OSTime cycles);
void Sleep_Nsec(u32 nsec);
void Sleep_Usec(u32 usec);
void Sleep_Msec(u32 ms);
void Sleep_Sec(u32 sec);
2021-12-27 19:23:03 +00:00
s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
s16 sins(u16);
OSTask* _VirtualToPhysicalTask(OSTask* intp);
void osSpTaskLoad(OSTask* task);
void osSpTaskStartGo(OSTask* task);
void __osSiCreateAccessQueue(void);
void __osSiGetAccess(void);
void __osSiRelAccess(void);
s32 osContInit(OSMesgQueue* mq, u8* ctl_present_bitfield, OSContStatus* status);
void __osContGetInitData(u8* ctl_present_bitfield, OSContStatus* status);
void __osPackRequestData(u8 poll);
s32 osContStartReadData(OSMesgQueue* mq);
void osContGetReadData(OSContPad* pad);
void __osPackReadData(void);
2021-12-27 19:23:03 +00:00
s32 __osSpRawStartDma(s32 direction, void* devAddr, void* dramAddr, u32 size);
s32 __osSiRawStartDma(s32 dir, void* addr);
void osSpTaskYield(void);
s32 __osPfsGetNextPage(OSPfs* pfs, u8* bank, __OSInode* inode, __OSInodeUnit* page);
s32 osPfsReadWriteFile(OSPfs* pfs, s32 fileNo, u8 flag, s32 offset, s32 size, u8* data);
s32 __osPfsGetStatus(OSMesgQueue* queue, s32 channel);
void __osPfsRequestOneChannel(s32 channel, u8 poll);
void __osPfsGetOneChannelData(s32 channel, OSContStatus* contData);
2021-12-27 19:23:03 +00:00
s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 length, s32* fileNo);
s32 __osPfsDeclearPage(OSPfs* pfs, __OSInode* inode, s32 fileSizeInPages, s32* startPage, u8 bank, s32* decleared,
s32* finalPage);
2021-12-27 19:23:03 +00:00
u16 __osSumcalc(u8* ptr, s32 length);
s32 __osIdCheckSum(u16* ptr, u16* csum, u16* icsum);
s32 __osRepairPackId(OSPfs* pfs, __OSPackId* badid, __OSPackId* newid);
s32 __osCheckPackId(OSPfs* pfs, __OSPackId* check);
s32 __osGetId(OSPfs* pfs);
s32 __osCheckId(OSPfs* pfs);
s32 __osPfsRWInode(OSPfs* pfs, __OSInode* inode, u8 flag, u8 bank);
s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo);
s32 osAfterPreNMI(void);
s32 osContStartQuery(OSMesgQueue* mq);
void osContGetQuery(OSContStatus* data);
2021-12-27 19:23:03 +00:00
OSYieldResult osSpTaskYielded(OSTask* task);
2021-12-27 19:23:03 +00:00
u32 __osSpDeviceBusy(void);
s32 osAiSetFrequency(u32 frequency);
OSThread* __osGetActiveQueue(void);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
u32 osDpGetStatus(void);
void osDpSetStatus(u32 status);
s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName);
s32 __osPfsReleasePages(OSPfs* pfs, __OSInode* inode, u8 initialPage, u8 bank, __OSInodeUnit* finalPage);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
f32 cosf(f32);
s16 coss(u16);
void osViSetEvent(OSMesgQueue* mq, OSMesg m, u32 retraceCount);
s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern);
void __osPfsRequestData(u8 poll);
void __osPfsGetInitData(u8* pattern, OSContStatus* contData);
void guS2DInitBg(uObjBg* bg);
s32 __osPfsSelectBank(OSPfs* pfs, u8 bank);
s32 osContSetCh(u8 ch);
s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state);
s32 osPfsInitPak(OSMesgQueue* mq, OSPfs* pfs, s32 channel);
s32 __osPfsCheckRamArea(OSPfs* pfs);
s32 osPfsChecker(OSPfs* pfs);
s32 func_80105788(OSPfs* pfs, __OSInodeCache* cache);
s32 func_80105A60(OSPfs* pfs, __OSInodeUnit fpage, __OSInodeCache* cache);
u32 osAiGetLength(void);
2021-12-27 19:23:03 +00:00
s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force);
s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data);
u8 __osContAddressCrc(u16 addr);
u8 __osContDataCrc(u8* data);
s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg);
u32 __osSpGetStatus(void);
2020-03-17 04:31:30 +00:00
void __osSpSetStatus(u32 status);
void osWritebackDCacheAll(void);
OSThread* __osGetCurrFaultedThread(void);
2021-12-27 19:23:03 +00:00
2020-03-17 04:31:30 +00:00
// ? __d_to_ll(?);
// ? __f_to_ll(?);
// ? __d_to_ull(?);
// ? __f_to_ull(?);
// ? __ll_to_d(?);
// ? __ll_to_f(?);
// ? __ull_to_d(?);
// ? __ull_to_f(?);
u32* osViGetCurrentFramebuffer(void);
s32 __osSpSetPc(void* pc);
2020-03-17 04:31:30 +00:00
f32 absf(f32);
void* func_80106860(void* ptr, s32 val, size_t size);
void* func_801068B0(void* dst, void* src, size_t size);
z_message_PAL, message_data_static and surrounding doc (#996) * Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
void Message_UpdateOcarinaGame(GlobalContext* globalCtx);
u8 Message_ShouldAdvance(GlobalContext* globalCtx);
void Message_CloseTextbox(GlobalContext*);
void Message_StartTextbox(GlobalContext* globalCtx, u16 textId, Actor* actor);
void Message_ContinueTextbox(GlobalContext* globalCtx, u16 textId);
void func_8010BD58(GlobalContext* globalCtx, u16 arg1);
void func_8010BD88(GlobalContext* globalCtx, u16 arg1);
z_message_PAL, message_data_static and surrounding doc (#996) * Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
u8 Message_GetState(MessageContext* msgCtx);
void Message_Draw(GlobalContext* globalCtx);
void Message_Update(GlobalContext* globalCtx);
void Message_SetTables(void);
void GameOver_Init(GlobalContext* globalCtx);
void GameOver_FadeInLights(GlobalContext* globalCtx);
void GameOver_Update(GlobalContext* globalCtx);
2020-03-17 04:31:30 +00:00
void func_80110990(GlobalContext* globalCtx);
void func_801109B0(GlobalContext* globalCtx);
z_message_PAL, message_data_static and surrounding doc (#996) * Initial progress on z_message_PAL, very messy * Fix merge * Some more progress * Fix merge * More z_message_PAL * Small progress * More small progress * message_data_static files OK * Prepare z_message_tables * Matched another function, small updates * Attempt to use asm-processor static-symbols branch * Refactor text id declarations * Begin large text codes parser function * Fix merge * Refactor done * Build OK, add color and highscore names * Remove encoded text headers and automatically encode during build * Fix kanfont * Various cleanups * DISP macros * Another match aside data * Further progress * Small improvements * Deduplicate magic values for text control codes, small improvements * Tiny progress * Minor cleanups * Clean up z_message_PAL comment * Progress on large functions * Further progress on large functions * Changes to mkldscript to link .data in the .rodata section * data OK * Few improvements * Use gDPLoadTextureBlock macros where appropriate * rm z_message_tables, progress on large functions * 2 more matches * Improvements * Small progress * More progress on big function * progress * match func_80107980 * match Message_Update * match func_8010BED8 * done * Progress on remaining large functions * Small progress on largest function * Another match, extract text and move to assets, improve text build system * Small nonmatchings improvements * docs wip * Largest function maybe equivalent * Fix merge * Document do_action values, largest function is almost instruction-matching * Rename NAVI do_action to NONE, as that appears to be how that value is used in practice * Fix merge * one match * Last function is instruction-matching * Fix * Improvements thanks to engineer124 * Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup * More variables labeled, use text state enum everywhere * More labels and names * Fix * Actor_IsTalking -> Actor_TalkRequested * Match func_8010C39C and remove unused asm * More docs * Mostly ocarina related docs * All msgModes named * Fix assetclean * Cleanup * Extraction fixes and headers * Suggestions * Review suggestions * Change text extraction again, only extract if the headers do not already exist * Fix * Use ast for charmap, fix assetclean for real this time * Review suggestions * BGM ids and ran formatter * Review comments * rename include_readonly to include_data_with_rodata * Remove leading 0s in number directives * Review suggestions for message_data_static * textbox pos enum comments, rename several enum names from Message to TextBox Co-authored-by: Thar0 <maximilianc64@gmail.com> Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
void Message_Init(GlobalContext* globalCtx);
2020-03-17 04:31:30 +00:00
void func_80112098(GlobalContext* globalCtx);
2021-12-27 19:23:03 +00:00
void Title_Init(GameState* thissx);
void Title_Destroy(GameState* thissx);
void Select_Init(GameState* thissx);
void Select_Destroy(GameState* thissx);
2021-12-27 19:23:03 +00:00
#ifdef __cplusplus
}
2020-03-17 04:31:30 +00:00
#endif
2021-12-27 19:23:03 +00:00
*/