1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 07:07:09 +00:00

[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
This commit is contained in:
Dragorn421 2024-09-27 20:51:00 +02:00 committed by GitHub
parent d80e538370
commit fbf797f1e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 212 additions and 185 deletions

View file

@ -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);

View file

@ -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);

10
include/gfxalloc.h Normal file
View file

@ -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

View file

@ -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)

79
include/map.h Normal file
View file

@ -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

View file

@ -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;

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -27,7 +27,7 @@
#endif
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:98"
"ntsc-1.2:96"
StackEntry sDmaMgrStackInfo;
OSMesgQueue sDmaMgrMsgQueue;

View file

@ -23,7 +23,7 @@ extern struct IrqMgr gIrqMgr;
#endif
#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \
"ntsc-1.2:158"
"ntsc-1.2:156"
extern u8 _buffersSegmentEnd[];

View file

@ -3638,7 +3638,7 @@ s32 Camera_KeepOn3(Camera* camera) {
}
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:100"
"ntsc-1.2:98"
s32 Camera_KeepOn4(Camera* camera) {
static Vec3f D_8015BD50;

View file

@ -5,7 +5,7 @@
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:216"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:208"
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*);

View file

@ -3,8 +3,8 @@
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
#pragma increment_block_number \
"gc-eu:0 gc-eu-mq:0 gc-eu-mq-dbg:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-eu-mq-dbg:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128" \
"gc-us-mq:128 ntsc-1.2:128"
#define FLAGS 0

View file

@ -1,4 +1,5 @@
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0"
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \
"ntsc-1.2:0"
#include "global.h"
#include "terminal.h"

View file

@ -16,7 +16,7 @@
#include "cic6105.h"
#endif
#pragma increment_block_number "gc-eu:121 gc-eu-mq:121 gc-jp:123 gc-jp-ce:123 gc-jp-mq:123 gc-us:123 gc-us-mq:123"
#pragma increment_block_number "gc-eu:119 gc-eu-mq:119 gc-jp:121 gc-jp-ce:121 gc-jp-mq:121 gc-us:121 gc-us-mq:121"
#define FLAGS ACTOR_FLAG_4