mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 13:34:52 -04:00
J3duclip, fop_actor_mng and related stuff (#131)
* J3DUClipper sinit * sincosTable_ etc * decompile JMATrigonometric sinit * f_op_actor_mng * move f_op_actor_mng and parts of mDo_ext * J3DSys sinit * f_op_scene_req * failed matching attempt for decodeSZS__9JKRDecompFPUcPUcUlUl * mX -> x * fix mCull and fopAcM_prm_class members * fix a few function parameters * move missing NON_MATCHING * remove some unneeded data * turns out that data was not unused * remove unused asm * readd asm deleted by accident
This commit is contained in:
+111
-172
@@ -3,65 +3,11 @@
|
||||
// Translation Unit: f_op/f_op_scene_req
|
||||
//
|
||||
|
||||
// #include "f_op/f_op_scene_req.h"
|
||||
#include "f_op/f_op_scene_req.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
//
|
||||
|
||||
struct scene_request_class {};
|
||||
|
||||
struct scene_class {};
|
||||
|
||||
struct request_of_phase_process_class {};
|
||||
|
||||
struct process_node_class {};
|
||||
|
||||
struct node_create_request_method_class {};
|
||||
|
||||
struct node_create_request {};
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" static void fopScnRq_phase_ClearOverlap__FP19scene_request_class();
|
||||
extern "C" static void fopScnRq_phase_Execute__FP19scene_request_class();
|
||||
extern "C" static void fopScnRq_phase_IsDoingOverlap__FP19scene_request_class();
|
||||
extern "C" static void fopScnRq_phase_IsDoneOverlap__FP19scene_request_class();
|
||||
extern "C" static void fopScnRq_phase_Done__FP19scene_request_class();
|
||||
extern "C" static void fopScnRq_Execute__FP19scene_request_class();
|
||||
extern "C" static void fopScnRq_PostMethod__FPvP19scene_request_class();
|
||||
extern "C" static void fopScnRq_Cancel__FP19scene_request_class();
|
||||
extern "C" static void fopScnRq_FadeRequest__FsUs();
|
||||
extern "C" void fopScnRq_Request__FiP11scene_classsPvsUs();
|
||||
extern "C" void fopScnRq_ReRequest__FUisPv();
|
||||
extern "C" void fopScnRq_Handler__Fv();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void fopOvlpM_ToldAboutID__FUi();
|
||||
extern "C" void fopOvlpM_IsDone__Fv();
|
||||
extern "C" void fopOvlpM_IsDoingReq__Fv();
|
||||
extern "C" void fopOvlpM_ClearOfReq__Fv();
|
||||
extern "C" void fopOvlpM_Request__FsUs();
|
||||
extern "C" void fopOvlpM_Cancel__Fv();
|
||||
extern "C" void fopScnPause_Enable__FP11scene_class();
|
||||
extern "C" void fopScnPause_Disable__FP11scene_class();
|
||||
extern "C" void fpcEx_SearchByID__FUi();
|
||||
extern "C" void fpcNdRq_Execute__FP19node_create_request();
|
||||
extern "C" void fpcNdRq_Delete__FP19node_create_request();
|
||||
extern "C" void fpcNdRq_Handler__Fv();
|
||||
extern "C" void fpcNdRq_Request__FUliP18process_node_classsPvP32node_create_request_method_class();
|
||||
extern "C" void fpcNdRq_ReRequest__FUisPv();
|
||||
extern "C" void cPhs_Set__FP30request_of_phase_process_classPPFPv_i();
|
||||
extern "C" void cPhs_Do__FP30request_of_phase_process_classPv();
|
||||
extern "C" void _savegpr_26();
|
||||
extern "C" void _restgpr_26();
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
#include "f_pc/f_pc_executor.h"
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -69,170 +15,163 @@ extern "C" void _restgpr_26();
|
||||
|
||||
/* 8001EE34-8001EE64 019774 0030+00 1/0 0/0 0/0 .text
|
||||
* fopScnRq_phase_ClearOverlap__FP19scene_request_class */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_phase_ClearOverlap(scene_request_class* param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_phase_ClearOverlap__FP19scene_request_class.s"
|
||||
static cPhs__Step fopScnRq_phase_ClearOverlap(scene_request_class* param_0) {
|
||||
if (fopOvlpM_ClearOfReq() == 1) {
|
||||
return cPhs_UNK_2;
|
||||
} else {
|
||||
return cPhs_ZERO_e;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001EE64-8001EE84 0197A4 0020+00 2/0 0/0 0/0 .text
|
||||
* fopScnRq_phase_Execute__FP19scene_request_class */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_phase_Execute(scene_request_class* param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_phase_Execute__FP19scene_request_class.s"
|
||||
static cPhs__Step fopScnRq_phase_Execute(scene_request_class* param_0) {
|
||||
return (cPhs__Step)fpcNdRq_Execute(¶m_0->mCrtReq);
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001EE84-8001EEB4 0197C4 0030+00 1/0 0/0 0/0 .text
|
||||
* fopScnRq_phase_IsDoingOverlap__FP19scene_request_class */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_phase_IsDoingOverlap(scene_request_class* param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_phase_IsDoingOverlap__FP19scene_request_class.s"
|
||||
static cPhs__Step fopScnRq_phase_IsDoingOverlap(scene_request_class* param_0) {
|
||||
if (fopOvlpM_IsDoingReq() == 1) {
|
||||
return cPhs_UNK_2;
|
||||
} else {
|
||||
return cPhs_ZERO_e;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001EEB4-8001EEE4 0197F4 0030+00 1/0 0/0 0/0 .text
|
||||
* fopScnRq_phase_IsDoneOverlap__FP19scene_request_class */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_phase_IsDoneOverlap(scene_request_class* param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_phase_IsDoneOverlap__FP19scene_request_class.s"
|
||||
static cPhs__Step fopScnRq_phase_IsDoneOverlap(scene_request_class* param_0) {
|
||||
if (fopOvlpM_IsDone() == 1) {
|
||||
return cPhs_UNK_2;
|
||||
} else {
|
||||
return cPhs_ZERO_e;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80450CE0-80450CE8 0001E0 0004+04 2/2 0/0 0/0 .sbss l_fopScnRq_IsUsingOfOverlap */
|
||||
static u8 l_fopScnRq_IsUsingOfOverlap[4 + 4 /* padding */];
|
||||
static s32 l_fopScnRq_IsUsingOfOverlap;
|
||||
|
||||
/* 8001EEE4-8001EF24 019824 0040+00 2/0 0/0 0/0 .text fopScnRq_phase_Done__FP19scene_request_class
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_phase_Done(scene_request_class* param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_phase_Done__FP19scene_request_class.s"
|
||||
static cPhs__Step fopScnRq_phase_Done(scene_request_class* pScnRq) {
|
||||
if (pScnRq->mCrtReq.mParameter != 1) {
|
||||
fopScnPause_Disable((scene_class*)fpcEx_SearchByID(pScnRq->mCrtReq.mCreatingID));
|
||||
}
|
||||
l_fopScnRq_IsUsingOfOverlap = 0;
|
||||
return cPhs_UNK_2;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001EF24-8001EF6C 019864 0048+00 1/0 0/0 0/0 .text fopScnRq_Execute__FP19scene_request_class */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_Execute(scene_request_class* param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_Execute__FP19scene_request_class.s"
|
||||
static void fopScnRq_Execute(scene_request_class* pScnRq) {
|
||||
int tmp = cPhs_Do(&pScnRq->mReqPhsProcCls, pScnRq);
|
||||
switch (tmp) {
|
||||
case 2: {
|
||||
fopScnRq_Execute(pScnRq);
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001EF6C-8001EFB0 0198AC 0044+00 1/0 0/0 0/0 .text
|
||||
* fopScnRq_PostMethod__FPvP19scene_request_class */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_PostMethod(void* param_0, scene_request_class* param_1) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_PostMethod__FPvP19scene_request_class.s"
|
||||
static int fopScnRq_PostMethod(void* param_1, scene_request_class* pScnRq) {
|
||||
if (pScnRq->mFadeRequest) {
|
||||
fopScnPause_Enable((scene_class*)param_1);
|
||||
fopOvlpM_ToldAboutID(((scene_class*)param_1)->field_0x04);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001EFB0-8001EFF0 0198F0 0040+00 1/0 0/0 0/0 .text fopScnRq_Cancel__FP19scene_request_class */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_Cancel(scene_request_class* param_0) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_Cancel__FP19scene_request_class.s"
|
||||
static int fopScnRq_Cancel(scene_request_class* pScnRq) {
|
||||
if (pScnRq->mFadeRequest && !fopOvlpM_Cancel()) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001EFF0-8001F034 019930 0044+00 1/1 0/0 0/0 .text fopScnRq_FadeRequest__FsUs */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void fopScnRq_FadeRequest(s16 param_0, u16 param_1) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_FadeRequest__FsUs.s"
|
||||
static scene_request_class* fopScnRq_FadeRequest(s16 param_1, u16 param_2) {
|
||||
request_base_class* tmp = NULL;
|
||||
|
||||
if (l_fopScnRq_IsUsingOfOverlap == 0 && (tmp = fopOvlpM_Request(param_1, param_2), tmp != 0)) {
|
||||
l_fopScnRq_IsUsingOfOverlap = 1;
|
||||
}
|
||||
|
||||
return (scene_request_class*)tmp;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803A38C8-803A38D8 -00001 0010+00 1/1 0/0 0/0 .data submethod$2274 */
|
||||
SECTION_DATA static void* submethod[4] = {
|
||||
(void*)fopScnRq_Execute__FP19scene_request_class,
|
||||
(void*)fopScnRq_Cancel__FP19scene_request_class,
|
||||
(void*)NULL,
|
||||
(void*)fopScnRq_PostMethod__FPvP19scene_request_class,
|
||||
static node_create_request_method_class submethod = {
|
||||
(process_method_func)fopScnRq_Execute,
|
||||
(process_method_func)fopScnRq_Cancel,
|
||||
NULL,
|
||||
(process_method_func)fopScnRq_PostMethod,
|
||||
};
|
||||
|
||||
/* 803A38D8-803A38F8 -00001 0020+00 0/1 0/0 0/0 .data noFadeFase$2275 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* noFadeFase[8] = {
|
||||
(void*)fopScnRq_phase_Execute__FP19scene_request_class,
|
||||
(void*)fopScnRq_phase_Done__FP19scene_request_class,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
static cPhs__Handler noFadeFase[8] = {
|
||||
(cPhs__Handler)fopScnRq_phase_Execute,
|
||||
(cPhs__Handler)fopScnRq_phase_Done,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 803A38F8-803A3918 -00001 0020+00 0/1 0/0 0/0 .data fadeFase$2276 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static void* fadeFase[8] = {
|
||||
(void*)fopScnRq_phase_IsDoingOverlap__FP19scene_request_class,
|
||||
(void*)fopScnRq_phase_IsDoneOverlap__FP19scene_request_class,
|
||||
(void*)fopScnRq_phase_Execute__FP19scene_request_class,
|
||||
(void*)fopScnRq_phase_ClearOverlap__FP19scene_request_class,
|
||||
(void*)fopScnRq_phase_IsDoneOverlap__FP19scene_request_class,
|
||||
(void*)fopScnRq_phase_Done__FP19scene_request_class,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
static cPhs__Handler fadeFase[8] = {
|
||||
(cPhs__Handler)fopScnRq_phase_IsDoingOverlap,
|
||||
(cPhs__Handler)fopScnRq_phase_IsDoneOverlap,
|
||||
(cPhs__Handler)fopScnRq_phase_Execute,
|
||||
(cPhs__Handler)fopScnRq_phase_ClearOverlap,
|
||||
(cPhs__Handler)fopScnRq_phase_IsDoneOverlap,
|
||||
(cPhs__Handler)fopScnRq_phase_Done,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 8001F034-8001F0FC 019974 00C8+00 0/0 3/3 0/0 .text fopScnRq_Request__FiP11scene_classsPvsUs */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fopScnRq_Request(int param_0, scene_class* param_1, s16 param_2, void* param_3,
|
||||
s16 param_4, u16 param_5) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_Request__FiP11scene_classsPvsUs.s"
|
||||
s32 fopScnRq_Request(int param_1, scene_class* param_2, s16 param_3, void* param_4, s16 param_5,
|
||||
u16 param_6) {
|
||||
s32 ret;
|
||||
int tmp = 0;
|
||||
cPhs__Handler* phase_handler_table;
|
||||
phase_handler_table = noFadeFase;
|
||||
scene_request_class* pScnReq = (scene_request_class*)fpcNdRq_Request(
|
||||
sizeof(scene_request_class), param_1, (process_node_class*)param_2, param_3, param_4,
|
||||
&submethod);
|
||||
|
||||
if (!pScnReq) {
|
||||
ret = -1;
|
||||
} else {
|
||||
if (param_5 != 0x7fff) {
|
||||
phase_handler_table = fadeFase;
|
||||
tmp = (int)fopScnRq_FadeRequest(param_5, param_6);
|
||||
if (!tmp) {
|
||||
fpcNdRq_Delete(&pScnReq->mCrtReq);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
pScnReq->mFadeRequest = tmp;
|
||||
cPhs_Set(&pScnReq->mReqPhsProcCls, phase_handler_table);
|
||||
ret = pScnReq->mCrtReq.mRequestId;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001F0FC-8001F11C 019A3C 0020+00 0/0 1/1 0/0 .text fopScnRq_ReRequest__FUisPv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fopScnRq_ReRequest(unsigned int param_0, s16 param_1, void* param_2) {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_ReRequest__FUisPv.s"
|
||||
s32 fopScnRq_ReRequest(unsigned int param_1, s16 param_2, void* param_3) {
|
||||
return fpcNdRq_ReRequest(param_1, param_2, param_3);
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8001F11C-8001F13C 019A5C 0020+00 0/0 1/1 0/0 .text fopScnRq_Handler__Fv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void fopScnRq_Handler() {
|
||||
nofralloc
|
||||
#include "asm/f_op/f_op_scene_req/fopScnRq_Handler__Fv.s"
|
||||
void fopScnRq_Handler(void) {
|
||||
fpcNdRq_Handler();
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
Reference in New Issue
Block a user