summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2024-09-27 20:51:00 +0200
committerGitHub <noreply@github.com>2024-09-27 14:51:00 -0400
commitfbf797f1e26a163c75ff0785b5cf74598b43d516 (patch)
tree62ebfb9501115edcb46a2c999af778c72f8828ce /include
parentd80e5383709ce77ac94eb7dbb40f906ad44af8a2 (diff)
[headers] Create `gfxalloc.h`, `map.h`, move protos to `gfx.h`, `z64{player,view}.h` (#2233)
* [headers] Create gfxalloc.h, map.h, move protos to z64{actor,player,view}.h * oops * bss * comment on player_lib protos & format * format map.h * Move SCREEN_{WIDTH,HEIGHT} and SET_FULLSCREEN_VIEWPORT to z64view.h * bss * revert move screen_width/height * bss
Diffstat (limited to 'include')
-rw-r--r--include/functions.h105
-rw-r--r--include/gfx.h15
-rw-r--r--include/gfxalloc.h10
-rw-r--r--include/macros.h11
-rw-r--r--include/map.h79
-rw-r--r--include/z64.h64
-rw-r--r--include/z64actor.h2
-rw-r--r--include/z64player.h54
-rw-r--r--include/z64view.h40
9 files changed, 203 insertions, 177 deletions
diff --git a/include/functions.h b/include/functions.h
index 7b437bfdb..d50f966a2 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -307,86 +307,13 @@ void OnePointCutscene_EnableAttention(void);
void OnePointCutscene_DisableAttention(void);
s32 OnePointCutscene_CheckForCategory(PlayState* play, s32 actorCategory);
void OnePointCutscene_Noop(PlayState* play, s32 arg1);
-void Map_SavePlayerInitialInfo(PlayState* play);
-void Map_SetFloorPalettesData(PlayState* play, s16 floor);
-void Map_InitData(PlayState* play, s16 room);
-void Map_InitRoomData(PlayState* play, s16 room);
-void Map_Destroy(PlayState* play);
-void Map_Init(PlayState* play);
-void Minimap_Draw(PlayState* play);
-void Map_Update(PlayState* play);
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
void Path_CopyLastPoint(Path* path, Vec3f* dest);
-void Player_SetBootData(PlayState* play, Player* this);
-int Player_InBlockingCsMode(PlayState* play, Player* this);
-int Player_InCsMode(PlayState* play);
-s32 Player_CheckHostileLockOn(Player* this);
-int Player_IsChildWithHylianShield(Player* this);
-s32 Player_ActionToModelGroup(Player* this, s32 itemAction);
-void Player_SetModelsForHoldingShield(Player* this);
-void Player_SetModels(Player* this, s32 modelGroup);
-void Player_SetModelGroup(Player* this, s32 modelGroup);
-void func_8008EC70(Player* this);
-void Player_SetEquipmentData(PlayState* play, Player* this);
-void Player_UpdateBottleHeld(PlayState* play, Player* this, s32 item, s32 itemAction);
-void Player_ReleaseLockOn(Player* this);
-void Player_ClearZTargeting(Player* this);
-void Player_SetAutoLockOnActor(PlayState* play, Actor* actor);
-s32 func_8008EF44(PlayState* play, s32 ammo);
-int Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange);
-s32 Player_GetStrength(void);
-u8 Player_GetMask(PlayState* play);
-Player* Player_UnsetMask(PlayState* play);
-s32 Player_HasMirrorShieldEquipped(PlayState* play);
-int Player_HasMirrorShieldSetToDraw(PlayState* play);
-s32 Player_ActionToMagicSpell(Player* this, s32 itemAction);
-int Player_HoldsHookshot(Player* this);
-int func_8008F128(Player* this);
-s32 Player_ActionToMeleeWeapon(s32 itemAction);
-s32 Player_GetMeleeWeaponHeld(Player* this);
-s32 Player_HoldsTwoHandedWeapon(Player* this);
-int Player_HoldsBrokenKnife(Player* this);
-s32 Player_ActionToBottle(Player* this, s32 itemAction);
-s32 Player_GetBottleHeld(Player* this);
-s32 Player_ActionToExplosive(Player* this, s32 itemAction);
-s32 Player_GetExplosiveHeld(Player* this);
-s32 func_8008F2BC(Player* this, s32 itemAction);
-s32 Player_GetEnvironmentalHazard(PlayState* play);
-void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
- s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
- void* data);
-s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- void* thisx);
-s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- void* thisx);
-s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- void* thisx);
-s32 Player_OverrideLimbDrawGameplayCrawling(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- void* thisx);
-u8 func_80090480(PlayState* play, ColliderQuad* collider, WeaponInfo* weaponInfo, Vec3f* newTip, Vec3f* newBase);
-void Player_DrawGetItem(PlayState* play, Player* this);
-void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx);
-u32 Player_InitPauseDrawData(PlayState* play, u8* segment, SkelAnime* skelAnime);
-void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale,
- s32 sword, s32 tunic, s32 shield, s32 boots);
void PreNMI_Init(GameState* thisx);
-Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
-Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
-Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
-Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height);
-Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y);
-Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height);
-Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
- u32 y2, s32 width2, s32 height2);
-Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
- u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a);
-Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a);
-void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b);
-void func_80095974(GraphicsContext* gfxCtx);
void func_80095AA0(PlayState* play, Room* room, Input* input, s32 arg3);
void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
u16 tlutCount, f32 offsetX, f32 offsetY);
@@ -440,34 +367,7 @@ void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8
u8 handlePulse, u32 handleSpeed);
void SsSram_Dma(void* dramAddr, size_t size, s32 direction);
void SsSram_ReadWrite(s32 addr, void* dramAddr, size_t size, s32 direction);
-View* View_New(GraphicsContext* gfxCtx);
-void View_Free(View* view);
-void View_Init(View*, GraphicsContext*);
-void View_LookAt(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
-void View_LookAtUnsafe(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
-void View_SetScale(View* view, f32 scale);
-void View_GetScale(View* view, f32* scale);
-void View_SetPerspective(View* view, f32 fovy, f32 zNear, f32 zFar);
-void View_GetPerspective(View* view, f32* fovy, f32* zNear, f32* zFar);
-void View_SetOrtho(View* view, f32 fovy, f32 zNear, f32 zFar);
-void View_GetOrtho(View* view, f32* fovy, f32* zNear, f32* zFar);
-void View_SetViewport(View* view, Viewport* viewport);
-void View_GetViewport(View* view, Viewport* viewport);
-void View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ);
-void View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ);
-s32 View_SetDistortionSpeed(View* view, f32 speed);
-void View_InitDistortion(View* view);
-void View_ClearDistortion(View* view);
-void View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed);
-s32 View_StepDistortion(View* view, Mtx* projectionMtx);
-s32 View_Apply(View* view, s32 mask);
-s32 View_ApplyOrthoToOverlay(View* view);
-s32 View_ApplyPerspectiveToOverlay(View* view);
-s32 View_UpdateViewingMatrix(View* view);
-s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP);
-#if OOT_DEBUG
-s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ);
-#endif
+
void ViMode_LogPrint(OSViMode* osViMode);
void ViMode_Configure(ViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 antialiasOff, s32 modeN, s32 fb16Bit,
s32 width, s32 height, s32 leftAdjust, s32 rightAdjust, s32 upperAdjust, s32 lowerAdjust);
@@ -566,9 +466,6 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx);
void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState);
void Graph_ThreadEntry(void*);
-Gfx* Gfx_Open(Gfx* gfx);
-Gfx* Gfx_Close(Gfx* gfx, Gfx* dst);
-void* Gfx_Alloc(Gfx** gfxP, u32 size);
ListAlloc* ListAlloc_Init(ListAlloc* this);
void* ListAlloc_Alloc(ListAlloc* this, u32 size);
void ListAlloc_Free(ListAlloc* this, void* data);
diff --git a/include/gfx.h b/include/gfx.h
index c50f6c133..edc6217a3 100644
--- a/include/gfx.h
+++ b/include/gfx.h
@@ -51,6 +51,21 @@ typedef struct GraphicsContext {
/* 0x02FC */ char unk_2FC[0x04];
} GraphicsContext; // size = 0x300
+Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
+Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
+Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
+
+Gfx* Gfx_BranchTexScroll(Gfx** gfxP, u32 x, u32 y, s32 width, s32 height);
+Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y);
+Gfx* Gfx_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height);
+Gfx* Gfx_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
+ u32 y2, s32 width2, s32 height2);
+Gfx* Gfx_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
+ u32 x2, u32 y2, s32 width2, s32 height2, s32 r, s32 g, s32 b, s32 a);
+Gfx* Gfx_EnvColor(GraphicsContext* gfxCtx, s32 r, s32 g, s32 b, s32 a);
+void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b);
+void func_80095974(GraphicsContext* gfxCtx);
+
void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size);
void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size);
diff --git a/include/gfxalloc.h b/include/gfxalloc.h
new file mode 100644
index 000000000..158a2a9f5
--- /dev/null
+++ b/include/gfxalloc.h
@@ -0,0 +1,10 @@
+#ifndef GFXALLOC_H
+#define GFXALLOC_H
+
+#include "ultra64.h"
+
+Gfx* Gfx_Open(Gfx* gfx);
+Gfx* Gfx_Close(Gfx* gfx, Gfx* dst);
+void* Gfx_Alloc(Gfx** gfxP, u32 size);
+
+#endif
diff --git a/include/macros.h b/include/macros.h
index 609a902b1..c2df87845 100644
--- a/include/macros.h
+++ b/include/macros.h
@@ -82,17 +82,6 @@
(state)->size = sizeof(newStruct); \
} while (0)
-#define SET_FULLSCREEN_VIEWPORT(view) \
- { \
- Viewport viewport; \
- viewport.bottomY = SCREEN_HEIGHT; \
- viewport.rightX = SCREEN_WIDTH; \
- viewport.topY = 0; \
- viewport.leftX = 0; \
- View_SetViewport(view, &viewport); \
- } \
- (void)0
-
#if OOT_DEBUG
#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line)
diff --git a/include/map.h b/include/map.h
new file mode 100644
index 000000000..23d3eb3c8
--- /dev/null
+++ b/include/map.h
@@ -0,0 +1,79 @@
+#ifndef MAP_H
+#define MAP_H
+
+#include "ultra64.h"
+
+struct PlayState;
+
+typedef enum FloorID {
+ /* 1 */ F_8F = 1,
+ /* 2 */ F_7F,
+ /* 3 */ F_6F,
+ /* 4 */ F_5F,
+ /* 5 */ F_4F,
+ /* 6 */ F_3F,
+ /* 7 */ F_2F,
+ /* 8 */ F_1F,
+ /* 9 */ F_B1,
+ /* 10 */ F_B2,
+ /* 11 */ F_B3,
+ /* 12 */ F_B4,
+ /* 13 */ F_B5,
+ /* 14 */ F_B6,
+ /* 15 */ F_B7,
+ /* 16 */ F_B8
+} FloorID;
+
+// All arrays pointed in this struct are indexed by "map indices"
+// In dungeons, the map index corresponds to the dungeon index (which also indexes keys, items, etc)
+// In overworld areas, the map index corresponds to the overworld area index (spot 00, 01, etc)
+typedef struct MapData {
+ /* 0x00 */ s16 (*floorTexIndexOffset)[8]; // dungeon texture index offset by floor
+ /* 0x04 */ s16* bossFloor; // floor the boss is on
+ /* 0x08 */ s16 (*roomPalette)[32]; // map palette by room
+ /* 0x0C */ s16* maxPaletteCount; // max number of palettes in a same floor
+ /* 0x10 */ s16 (*paletteRoom)[8][14]; // room by palette by floor
+ /* 0x14 */ s16 (*roomCompassOffsetX)[44]; // dungeon compass icon X offset by room
+ /* 0x18 */ s16 (*roomCompassOffsetY)[44]; // dungeon compass icon Y offset by room
+ /* 0x1C */ u8* dgnMinimapCount; // number of room minimaps
+ /* 0x20 */ u16* dgnMinimapTexIndexOffset; // dungeon minimap texture index offset
+ /* 0x24 */ u16* owMinimapTexSize;
+ /* 0x28 */ u16* owMinimapTexOffset;
+ /* 0x2C */ s16* owMinimapPosX;
+ /* 0x30 */ s16* owMinimapPosY;
+ /* 0x34 */ s16 (*owCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset]
+ /* 0x38 */ s16* dgnTexIndexBase; // dungeon texture index base
+ /* 0x3C */ s16 (*dgnCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset]
+ /* 0x40 */ s16* owMinimapWidth;
+ /* 0x44 */ s16* owMinimapHeight;
+ /* 0x48 */ s16* owEntranceIconPosX; // "dungeon entrance" icon X pos
+ /* 0x4C */ s16* owEntranceIconPosY; // "dungeon entrance" icon Y pos
+ /* 0x50 */ u16* owEntranceFlag; // flag in inf_table[26] based on which entrance icons are shown (0xFFFF = always shown)
+ /* 0x54 */ f32 (*floorCoordY)[8]; // Y coordinate of each floor
+ /* 0x58 */ u16* switchEntryCount; // number of "room switch" entries, which correspond to the next 3 arrays
+ /* 0x5C */ u8 (*switchFromRoom)[51]; // room to come from
+ /* 0x60 */ u8 (*switchFromFloor)[51]; // floor to come from
+ /* 0x64 */ u8 (*switchToRoom)[51]; // room to go to
+ /* 0x68 */ u8 (*floorID)[8];
+ /* 0x6C */ s16* skullFloorIconY; // dungeon big skull icon Y pos
+} MapData; // size = 0x70
+
+// TODO get these properties from the textures themselves
+#define MAP_I_TEX_WIDTH 96
+#define MAP_I_TEX_HEIGHT 85
+#define MAP_I_TEX_SIZE ((MAP_I_TEX_WIDTH * MAP_I_TEX_HEIGHT) / 2) // 96x85 I4 texture
+
+#define MAP_48x85_TEX_WIDTH 48
+#define MAP_48x85_TEX_HEIGHT 85
+#define MAP_48x85_TEX_SIZE ((MAP_48x85_TEX_WIDTH * MAP_48x85_TEX_HEIGHT) / 2) // 48x85 CI4 texture
+
+void Map_SavePlayerInitialInfo(struct PlayState* play);
+void Map_SetFloorPalettesData(struct PlayState* play, s16 floor);
+void Map_InitData(struct PlayState* play, s16 room);
+void Map_InitRoomData(struct PlayState* play, s16 room);
+void Map_Destroy(struct PlayState* play);
+void Map_Init(struct PlayState* play);
+void Minimap_Draw(struct PlayState* play);
+void Map_Update(struct PlayState* play);
+
+#endif
diff --git a/include/z64.h b/include/z64.h
index 0271864e9..27efb344c 100644
--- a/include/z64.h
+++ b/include/z64.h
@@ -59,12 +59,14 @@
#include "padmgr.h"
#include "sched.h"
#include "rumble.h"
+#include "map.h"
#include "mempak.h"
#include "tha.h"
#include "thga.h"
#include "speedmeter.h"
#include "gfx.h"
#include "gfx_setupdl.h"
+#include "gfxalloc.h"
#include "jpeg.h"
#include "prerender.h"
#include "rand.h"
@@ -323,68 +325,6 @@ typedef struct PreNMIState {
/* 0xA8 */ UNK_TYPE4 unk_A8;
} PreNMIState; // size = 0xAC
-typedef enum FloorID {
- /* 1 */ F_8F = 1,
- /* 2 */ F_7F,
- /* 3 */ F_6F,
- /* 4 */ F_5F,
- /* 5 */ F_4F,
- /* 6 */ F_3F,
- /* 7 */ F_2F,
- /* 8 */ F_1F,
- /* 9 */ F_B1,
- /* 10 */ F_B2,
- /* 11 */ F_B3,
- /* 12 */ F_B4,
- /* 13 */ F_B5,
- /* 14 */ F_B6,
- /* 15 */ F_B7,
- /* 16 */ F_B8
-} FloorID;
-
-// All arrays pointed in this struct are indexed by "map indices"
-// In dungeons, the map index corresponds to the dungeon index (which also indexes keys, items, etc)
-// In overworld areas, the map index corresponds to the overworld area index (spot 00, 01, etc)
-typedef struct MapData {
- /* 0x00 */ s16 (*floorTexIndexOffset)[8]; // dungeon texture index offset by floor
- /* 0x04 */ s16* bossFloor; // floor the boss is on
- /* 0x08 */ s16 (*roomPalette)[32]; // map palette by room
- /* 0x0C */ s16* maxPaletteCount; // max number of palettes in a same floor
- /* 0x10 */ s16 (*paletteRoom)[8][14]; // room by palette by floor
- /* 0x14 */ s16 (*roomCompassOffsetX)[44]; // dungeon compass icon X offset by room
- /* 0x18 */ s16 (*roomCompassOffsetY)[44]; // dungeon compass icon Y offset by room
- /* 0x1C */ u8* dgnMinimapCount; // number of room minimaps
- /* 0x20 */ u16* dgnMinimapTexIndexOffset; // dungeon minimap texture index offset
- /* 0x24 */ u16* owMinimapTexSize;
- /* 0x28 */ u16* owMinimapTexOffset;
- /* 0x2C */ s16* owMinimapPosX;
- /* 0x30 */ s16* owMinimapPosY;
- /* 0x34 */ s16 (*owCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset]
- /* 0x38 */ s16* dgnTexIndexBase; // dungeon texture index base
- /* 0x3C */ s16 (*dgnCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset]
- /* 0x40 */ s16* owMinimapWidth;
- /* 0x44 */ s16* owMinimapHeight;
- /* 0x48 */ s16* owEntranceIconPosX; // "dungeon entrance" icon X pos
- /* 0x4C */ s16* owEntranceIconPosY; // "dungeon entrance" icon Y pos
- /* 0x50 */ u16* owEntranceFlag; // flag in inf_table[26] based on which entrance icons are shown (0xFFFF = always shown)
- /* 0x54 */ f32 (*floorCoordY)[8]; // Y coordinate of each floor
- /* 0x58 */ u16* switchEntryCount; // number of "room switch" entries, which correspond to the next 3 arrays
- /* 0x5C */ u8 (*switchFromRoom)[51]; // room to come from
- /* 0x60 */ u8 (*switchFromFloor)[51]; // floor to come from
- /* 0x64 */ u8 (*switchToRoom)[51]; // room to go to
- /* 0x68 */ u8 (*floorID)[8];
- /* 0x6C */ s16* skullFloorIconY; // dungeon big skull icon Y pos
-} MapData; // size = 0x70
-
-// TODO get these properties from the textures themselves
-#define MAP_I_TEX_WIDTH 96
-#define MAP_I_TEX_HEIGHT 85
-#define MAP_I_TEX_SIZE ((MAP_I_TEX_WIDTH * MAP_I_TEX_HEIGHT) / 2) // 96x85 I4 texture
-
-#define MAP_48x85_TEX_WIDTH 48
-#define MAP_48x85_TEX_HEIGHT 85
-#define MAP_48x85_TEX_SIZE ((MAP_48x85_TEX_WIDTH * MAP_48x85_TEX_HEIGHT) / 2) // 48x85 CI4 texture
-
typedef struct DebugDispObject {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3s rot;
diff --git a/include/z64actor.h b/include/z64actor.h
index c83316af7..e05a9d618 100644
--- a/include/z64actor.h
+++ b/include/z64actor.h
@@ -908,8 +908,10 @@ void func_80034CC4(struct PlayState* play, SkelAnime* skelAnime, OverrideLimbDra
s16 func_80034DD4(Actor* actor, struct PlayState* play, s16 arg2, f32 arg3);
void func_80034F54(struct PlayState* play, s16* arg1, s16* arg2, s32 arg3);
void Actor_Noop(Actor* actor, struct PlayState* play);
+
void Gfx_DrawDListOpa(struct PlayState* play, Gfx* dlist);
void Gfx_DrawDListXlu(struct PlayState* play, Gfx* dlist);
+
Actor* Actor_FindNearby(struct PlayState* play, Actor* refActor, s16 actorId, u8 actorCategory, f32 range);
s32 func_800354B4(struct PlayState* play, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5);
void func_8003555C(struct PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel);
diff --git a/include/z64player.h b/include/z64player.h
index 79c38271c..2441941d2 100644
--- a/include/z64player.h
+++ b/include/z64player.h
@@ -930,4 +930,58 @@ typedef struct Player {
/* 0x0A88 */ Vec3f unk_A88; // previous body part 0 position
} Player; // size = 0xA94
+// z_player_lib public functions
+void Player_SetBootData(struct PlayState* play, Player* this);
+int Player_InBlockingCsMode(struct PlayState* play, Player* this);
+int Player_InCsMode(struct PlayState* play);
+s32 Player_CheckHostileLockOn(Player* this);
+int Player_IsChildWithHylianShield(Player* this);
+s32 Player_ActionToModelGroup(Player* this, s32 itemAction);
+void Player_SetModelsForHoldingShield(Player* this);
+void Player_SetModels(Player* this, s32 modelGroup);
+void Player_SetModelGroup(Player* this, s32 modelGroup);
+void func_8008EC70(Player* this);
+void Player_SetEquipmentData(struct PlayState* play, Player* this);
+void Player_UpdateBottleHeld(struct PlayState* play, Player* this, s32 item, s32 itemAction);
+void Player_ReleaseLockOn(Player* this);
+void Player_ClearZTargeting(Player* this);
+void Player_SetAutoLockOnActor(struct PlayState* play, Actor* actor);
+s32 func_8008EF44(struct PlayState* play, s32 ammo);
+int Player_IsBurningStickInRange(struct PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange);
+s32 Player_GetStrength(void);
+u8 Player_GetMask(struct PlayState* play);
+Player* Player_UnsetMask(struct PlayState* play);
+s32 Player_HasMirrorShieldEquipped(struct PlayState* play);
+int Player_HasMirrorShieldSetToDraw(struct PlayState* play);
+s32 Player_ActionToMagicSpell(Player* this, s32 itemAction);
+int Player_HoldsHookshot(Player* this);
+int func_8008F128(Player* this);
+s32 Player_ActionToMeleeWeapon(s32 itemAction);
+s32 Player_GetMeleeWeaponHeld(Player* this);
+s32 Player_HoldsTwoHandedWeapon(Player* this);
+int Player_HoldsBrokenKnife(Player* this);
+s32 Player_ActionToBottle(Player* this, s32 itemAction);
+s32 Player_GetBottleHeld(Player* this);
+s32 Player_ActionToExplosive(Player* this, s32 itemAction);
+s32 Player_GetExplosiveHeld(Player* this);
+s32 func_8008F2BC(Player* this, s32 itemAction);
+s32 Player_GetEnvironmentalHazard(struct PlayState* play);
+void Player_DrawImpl(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
+ s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
+ void* data);
+s32 Player_OverrideLimbDrawGameplayCommon(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ void* thisx);
+s32 Player_OverrideLimbDrawGameplayDefault(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ void* thisx);
+s32 Player_OverrideLimbDrawGameplayFirstPerson(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos,
+ Vec3s* rot, void* thisx);
+s32 Player_OverrideLimbDrawGameplayCrawling(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ void* thisx);
+u8 func_80090480(struct PlayState* play, ColliderQuad* collider, WeaponInfo* weaponInfo, Vec3f* newTip, Vec3f* newBase);
+void Player_DrawGetItem(struct PlayState* play, Player* this);
+void Player_PostLimbDrawGameplay(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx);
+u32 Player_InitPauseDrawData(struct PlayState* play, u8* segment, SkelAnime* skelAnime);
+void Player_DrawPause(struct PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale,
+ s32 sword, s32 tunic, s32 shield, s32 boots);
+
#endif
diff --git a/include/z64view.h b/include/z64view.h
index 935b6f79a..d8de11422 100644
--- a/include/z64view.h
+++ b/include/z64view.h
@@ -12,6 +12,17 @@ typedef struct Viewport {
/* 0xC */ s32 rightX; // lrx (lower right x)
} Viewport; // size = 0x10
+#define SET_FULLSCREEN_VIEWPORT(view) \
+ { \
+ Viewport viewport; \
+ viewport.bottomY = SCREEN_HEIGHT; \
+ viewport.rightX = SCREEN_WIDTH; \
+ viewport.topY = 0; \
+ viewport.leftX = 0; \
+ View_SetViewport(view, &viewport); \
+ } \
+ (void)0
+
typedef struct View {
/* 0x000 */ s32 magic; // string literal "VIEW" / 0x56494557
/* 0x004 */ struct GraphicsContext* gfxCtx;
@@ -55,4 +66,33 @@ typedef struct View {
#define VIEW_ERROR_CHECK_EYE_POS(x, y, z) (void)0
#endif
+View* View_New(struct GraphicsContext* gfxCtx);
+void View_Free(View* view);
+void View_Init(View*, struct GraphicsContext*);
+void View_LookAt(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
+void View_LookAtUnsafe(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
+void View_SetScale(View* view, f32 scale);
+void View_GetScale(View* view, f32* scale);
+void View_SetPerspective(View* view, f32 fovy, f32 zNear, f32 zFar);
+void View_GetPerspective(View* view, f32* fovy, f32* zNear, f32* zFar);
+void View_SetOrtho(View* view, f32 fovy, f32 zNear, f32 zFar);
+void View_GetOrtho(View* view, f32* fovy, f32* zNear, f32* zFar);
+void View_SetViewport(View* view, Viewport* viewport);
+void View_GetViewport(View* view, Viewport* viewport);
+void View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ);
+void View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ);
+s32 View_SetDistortionSpeed(View* view, f32 speed);
+void View_InitDistortion(View* view);
+void View_ClearDistortion(View* view);
+void View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed);
+s32 View_StepDistortion(View* view, Mtx* projectionMtx);
+s32 View_Apply(View* view, s32 mask);
+s32 View_ApplyOrthoToOverlay(View* view);
+s32 View_ApplyPerspectiveToOverlay(View* view);
+s32 View_UpdateViewingMatrix(View* view);
+s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP);
+#if OOT_DEBUG
+s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ);
+#endif
+
#endif