f_op_camera full match (#225)

This commit is contained in:
Pheenoh
2022-12-27 22:45:07 -07:00
committed by GitHub
parent 7cac806b68
commit 0b97dfb6e5
5 changed files with 41 additions and 120 deletions
+35 -58
View File
@@ -11,35 +11,6 @@
#include "f_op/f_op_draw_tag.h"
#include "f_pc/f_pc_leaf.h"
//
// Forward References:
//
extern "C" static void fopCam_Draw__FP12camera_class();
extern "C" static void fopCam_Execute__FP12camera_class();
extern "C" static void fopCam_IsDelete__FP12camera_class();
extern "C" static void fopCam_Delete__FP12camera_class();
extern "C" static void fopCam_Create__FPv();
extern "C" extern void* g_fopCam_Method[5 + 1 /* padding */];
//
// External References:
//
extern "C" void fopDwTg_ToDrawQ__FP16create_tag_classi();
extern "C" void fopDwTg_DrawQTo__FP16create_tag_class();
extern "C" void fopDwTg_Init__FP16create_tag_classPv();
extern "C" void fpcLf_GetPriority__FPC14leafdraw_class();
extern "C" void fpcLf_DrawMethod__FP21leafdraw_method_classPv();
extern "C" void fpcMtd_Execute__FP20process_method_classPv();
extern "C" void fpcMtd_IsDelete__FP20process_method_classPv();
extern "C" void fpcMtd_Delete__FP20process_method_classPv();
extern "C" void fpcMtd_Create__FP20process_method_classPv();
//
// Declarations:
//
/* 8001E140-8001E180 018A80 0040+00 1/0 0/0 0/0 .text fopCam_Draw__FP12camera_class */
static s32 fopCam_Draw(camera_class* pCamera) {
s32 cam_proc = 1;
@@ -51,23 +22,15 @@ static s32 fopCam_Draw(camera_class* pCamera) {
}
/* 8001E180-8001E1C8 018AC0 0048+00 1/0 0/0 0/0 .text fopCam_Execute__FP12camera_class */
// Matches, but wrong registers
#ifdef NONMATCHING
static void fopCam_Execute(camera_class* pCamera) {
static int fopCam_Execute(camera_class* pCamera) {
int ret;
if (!dComIfGp_isPauseFlag() && dScnPly_c::isPause()) {
fpcMtd_Execute((process_method_class*)pCamera->mpMtd, pCamera);
ret = fpcMtd_Execute((process_method_class*)pCamera->mpMtd, pCamera);
}
return ret;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void fopCam_Execute(camera_class* param_0) {
nofralloc
#include "asm/f_op/f_op_camera/fopCam_Execute__FP12camera_class.s"
}
#pragma pop
#endif
/* 8001E1C8-8001E21C 018B08 0054+00 1/0 0/0 0/0 .text fopCam_IsDelete__FP12camera_class
*/
@@ -91,23 +54,37 @@ int fopCam_Delete(camera_class* pCamera) {
}
/* 8001E270-8001E308 018BB0 0098+00 1/0 0/0 0/0 .text fopCam_Create__FPv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void fopCam_Create(void* param_0) {
nofralloc
#include "asm/f_op/f_op_camera/fopCam_Create__FPv.s"
static int fopCam_Create(void* i_actorP) {
camera_class* camera = (camera_class*)i_actorP;
if (fpcM_IsFirstCreating(i_actorP)) {
leaf_process_profile_definition* profile = fpcM_GetProfile(i_actorP);
camera->mpMtd = profile->mMethods;
fopDwTg_Init(&camera->mCreateTag, camera);
u32* append = (u32*)fpcM_GetAppend(camera);
if (append) {
fpcM_SetParam(camera, *append);
}
}
int ret = fpcMtd_Create(&camera->mpMtd->mBase, camera);
if (ret == 4) {
s16 prior = fpcLf_GetPriority(camera);
fopDwTg_ToDrawQ(&camera->mCreateTag, prior);
}
return ret;
}
#pragma pop
/* ############################################################################################## */
/* 803A3860-803A3878 -00001 0014+04 0/0 2/0 0/0 .data g_fopCam_Method */
SECTION_DATA extern void* g_fopCam_Method[5 + 1 /* padding */] = {
(void*)fopCam_Create,
(void*)fopCam_Delete,
(void*)fopCam_Execute,
(void*)fopCam_IsDelete,
(void*)fopCam_Draw,
/* padding */
NULL,
void* g_fopCam_Method[5] = {
fopCam_Create,
fopCam_Delete,
fopCam_Execute,
fopCam_IsDelete,
fopCam_Draw
};