2023-11-12 19:47:38 +00:00
|
|
|
#ifndef __PATCHES_H__
|
|
|
|
#define __PATCHES_H__
|
|
|
|
|
2024-01-13 06:39:08 +00:00
|
|
|
// TODO fix renaming symbols in patch recompilation
|
2024-03-21 06:46:08 +00:00
|
|
|
#define osCreateMesgQueue osCreateMesgQueue_recomp
|
2024-01-13 06:39:08 +00:00
|
|
|
#define osRecvMesg osRecvMesg_recomp
|
|
|
|
#define osSendMesg osSendMesg_recomp
|
2024-04-02 22:21:05 +00:00
|
|
|
#define osViGetCurrentFramebuffer osViGetCurrentFramebuffer_recomp
|
2024-04-03 02:16:31 +00:00
|
|
|
#define osFlashWriteArray osFlashWriteArray_recomp
|
|
|
|
#define osFlashWriteBuffer osFlashWriteBuffer_recomp
|
|
|
|
#define osWritebackDCache osWritebackDCache_recomp
|
2024-05-01 08:06:53 +00:00
|
|
|
#define osGetTime osGetTime_recomp
|
2024-04-15 15:15:45 +00:00
|
|
|
|
|
|
|
#define osContStartReadData osContStartReadData_recomp
|
|
|
|
#define osContGetReadData osContGetReadData_recomp
|
|
|
|
#define osContStartQuery osContStartQuery_recomp
|
|
|
|
#define osContGetQuery osContGetQuery_recomp
|
|
|
|
|
2024-03-11 04:13:32 +00:00
|
|
|
#define sinf __sinf_recomp
|
|
|
|
#define cosf __cosf_recomp
|
2024-04-03 02:16:31 +00:00
|
|
|
#define bzero bzero_recomp
|
2024-03-12 22:01:58 +00:00
|
|
|
#define gRandFloat sRandFloat
|
2023-11-12 19:47:38 +00:00
|
|
|
#include "global.h"
|
2023-12-01 15:56:20 +00:00
|
|
|
#include "rt64_extended_gbi.h"
|
2023-11-12 19:47:38 +00:00
|
|
|
|
2024-04-16 00:05:31 +00:00
|
|
|
#define gEXMatrixGroupNoInterpolation(cmd, push, proj, edit) \
|
|
|
|
gEXMatrixGroup(cmd, G_EX_ID_IGNORE, G_EX_INTERPOLATE_SIMPLE, push, proj, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_ORDER_LINEAR, edit)
|
|
|
|
|
2024-03-29 00:36:16 +00:00
|
|
|
#define gEXMatrixGroupInterpolateOnlyTiles(cmd, push, proj, edit) \
|
|
|
|
gEXMatrixGroup(cmd, G_EX_ID_IGNORE, G_EX_INTERPOLATE_SIMPLE, push, proj, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_LINEAR, edit)
|
|
|
|
|
|
|
|
#define gEXMatrixGroupDecomposedNormal(cmd, id, push, proj, edit) \
|
|
|
|
gEXMatrixGroupDecomposed(cmd, id, push, proj, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_LINEAR, edit)
|
|
|
|
|
2024-04-01 07:40:54 +00:00
|
|
|
#define gEXMatrixGroupDecomposedSkipRot(cmd, id, push, proj, edit) \
|
|
|
|
gEXMatrixGroupDecomposed(cmd, id, push, proj, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_LINEAR, edit)
|
|
|
|
|
2024-04-01 03:12:22 +00:00
|
|
|
#define gEXMatrixGroupDecomposedSkipPosRot(cmd, id, push, proj, edit) \
|
|
|
|
gEXMatrixGroupDecomposed(cmd, id, push, proj, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_LINEAR, edit)
|
|
|
|
|
|
|
|
#define gEXMatrixGroupDecomposedSkipAll(cmd, id, push, proj, edit) \
|
2024-03-29 00:36:16 +00:00
|
|
|
gEXMatrixGroupDecomposed(cmd, id, push, proj, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_SKIP, G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_LINEAR, edit)
|
|
|
|
|
|
|
|
#define gEXMatrixGroupDecomposedVerts(cmd, id, push, proj, edit) \
|
|
|
|
gEXMatrixGroupDecomposed(cmd, id, push, proj, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_LINEAR, edit)
|
2024-03-02 18:33:09 +00:00
|
|
|
|
2024-04-04 06:11:48 +00:00
|
|
|
#define gEXMatrixGroupDecomposedVertsOrderAuto(cmd, id, push, proj, edit) \
|
|
|
|
gEXMatrixGroupDecomposed(cmd, id, push, proj, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_COMPONENT_INTERPOLATE, G_EX_ORDER_AUTO, edit)
|
|
|
|
|
2024-03-02 18:33:09 +00:00
|
|
|
|
2023-11-24 22:10:21 +00:00
|
|
|
int recomp_printf(const char* fmt, ...);
|
2024-03-03 07:36:14 +00:00
|
|
|
float recomp_powf(float, float);
|
2023-11-24 22:10:21 +00:00
|
|
|
|
2024-02-24 21:14:48 +00:00
|
|
|
static inline void* actor_relocate(Actor* actor, void* addr) {
|
2024-04-24 18:56:23 +00:00
|
|
|
if ((uintptr_t)addr >= 0x80800000) {
|
|
|
|
return (void*)((uintptr_t)addr -
|
|
|
|
(intptr_t)((uintptr_t)actor->overlayEntry->vramStart - (uintptr_t)actor->overlayEntry->loadedRamAddr));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
recomp_printf("Not an overlay address!: 0x%08X 0x%08X 0x%08X\n", (u32)addr, (u32)actor->overlayEntry->vramStart, (u32)actor->overlayEntry->loadedRamAddr);
|
|
|
|
return addr;
|
|
|
|
}
|
2024-02-24 21:14:48 +00:00
|
|
|
}
|
|
|
|
|
2024-03-05 07:55:05 +00:00
|
|
|
typedef enum {
|
|
|
|
/* 0 */ PICTO_BOX_STATE_OFF, // Not using the pictograph
|
|
|
|
/* 1 */ PICTO_BOX_STATE_LENS, // Looking through the lens of the pictograph
|
|
|
|
/* 2 */ PICTO_BOX_STATE_SETUP_PHOTO, // Looking at the photo currently taken
|
|
|
|
/* 3 */ PICTO_BOX_STATE_PHOTO
|
|
|
|
} PictoBoxState;
|
|
|
|
|
|
|
|
|
|
|
|
#define INCBIN(identifier, filename) \
|
|
|
|
asm(".pushsection .rodata\n" \
|
|
|
|
"\t.local " #identifier "\n" \
|
|
|
|
"\t.type " #identifier ", @object\n" \
|
|
|
|
"\t.balign 8\n" \
|
|
|
|
#identifier ":\n" \
|
|
|
|
"\t.incbin \"" filename "\"\n\n" \
|
|
|
|
\
|
|
|
|
"\t.balign 8\n" \
|
|
|
|
"\t.popsection\n"); \
|
|
|
|
extern u8 identifier[]
|
|
|
|
|
|
|
|
void draw_dpad(PlayState* play);
|
|
|
|
void draw_dpad_icons(PlayState* play);
|
|
|
|
|
2024-03-12 22:01:58 +00:00
|
|
|
void View_ApplyInterpolate(View* view, s32 mask, bool reset_interpolation_state);
|
|
|
|
|
2024-03-27 22:47:15 +00:00
|
|
|
void set_camera_skipped(bool skipped);
|
|
|
|
void clear_camera_skipped();
|
2024-04-01 03:12:22 +00:00
|
|
|
void edit_billboard_groups(PlayState* play);
|
2024-03-27 22:47:15 +00:00
|
|
|
bool camera_was_skipped();
|
2024-03-28 04:35:10 +00:00
|
|
|
void room_load_hook(PlayState* play, Room* room);
|
2024-05-01 08:06:53 +00:00
|
|
|
void draw_autosave_icon(PlayState* play);
|
2024-03-27 22:47:15 +00:00
|
|
|
|
|
|
|
void recomp_crash(const char* err);
|
|
|
|
|
2023-11-12 19:47:38 +00:00
|
|
|
#endif
|