diff --git a/configure.py b/configure.py index c0c7bcb7c..c79ee7c01 100644 --- a/configure.py +++ b/configure.py @@ -245,7 +245,7 @@ def NonMatching(obj_path, **kwargs): Matching ("f_op/f_op_actor_tag.cpp"), NonMatching("f_op/f_op_actor_mng.cpp"), NonMatching("f_op/f_op_camera.cpp"), - NonMatching("f_op/f_op_camera_mng.cpp"), + Matching ("f_op/f_op_camera_mng.cpp"), Matching ("f_op/f_op_overlap.cpp"), NonMatching("f_op/f_op_overlap_mng.cpp"), Matching ("f_op/f_op_overlap_req.cpp"), @@ -259,45 +259,45 @@ def NonMatching(obj_path, **kwargs): Matching ("f_op/f_op_msg.cpp"), NonMatching("f_op/f_op_kankyo_mng.cpp"), NonMatching("f_op/f_op_msg_mng.cpp"), - NonMatching("f_op/f_op_draw_iter.cpp"), + Matching ("f_op/f_op_draw_iter.cpp"), Matching ("f_op/f_op_draw_tag.cpp"), Matching ("f_op/f_op_scene_pause.cpp"), Matching ("f_pc/f_pc_base.cpp"), Matching ("f_pc/f_pc_create_iter.cpp"), - NonMatching("f_pc/f_pc_create_req.cpp"), + Matching ("f_pc/f_pc_create_req.cpp"), Matching ("f_pc/f_pc_create_tag.cpp"), Matching ("f_pc/f_pc_creator.cpp"), Matching ("f_pc/f_pc_delete_tag.cpp"), - NonMatching("f_pc/f_pc_deletor.cpp"), - NonMatching("f_pc/f_pc_draw_priority.cpp"), - NonMatching("f_pc/f_pc_executor.cpp"), - NonMatching("f_pc/f_pc_layer.cpp"), + Matching ("f_pc/f_pc_deletor.cpp"), + Matching ("f_pc/f_pc_draw_priority.cpp"), + Matching ("f_pc/f_pc_executor.cpp"), + Matching ("f_pc/f_pc_layer.cpp"), Matching ("f_pc/f_pc_leaf.cpp"), - NonMatching("f_pc/f_pc_layer_iter.cpp"), - NonMatching("f_pc/f_pc_layer_tag.cpp"), + Matching ("f_pc/f_pc_layer_iter.cpp"), + Matching ("f_pc/f_pc_layer_tag.cpp"), Matching ("f_pc/f_pc_line.cpp"), Matching ("f_pc/f_pc_load.cpp"), NonMatching("f_pc/f_pc_manager.cpp"), Matching ("f_pc/f_pc_method.cpp"), - NonMatching("f_pc/f_pc_node.cpp"), - NonMatching("f_pc/f_pc_node_req.cpp"), + Matching ("f_pc/f_pc_node.cpp"), + Matching ("f_pc/f_pc_node_req.cpp"), Matching ("f_pc/f_pc_priority.cpp"), Matching ("f_pc/f_pc_profile.cpp"), Matching ("f_pc/f_pc_searcher.cpp"), Matching ("f_pc/f_pc_line_tag.cpp"), - NonMatching("f_pc/f_pc_line_iter.cpp"), + Matching ("f_pc/f_pc_line_iter.cpp"), Matching ("f_pc/f_pc_method_iter.cpp"), - NonMatching("f_pc/f_pc_method_tag.cpp"), - NonMatching("f_pc/f_pc_pause.cpp"), - NonMatching("f_pc/f_pc_draw.cpp"), - NonMatching("f_pc/f_pc_fstcreate_req.cpp"), - NonMatching("f_pc/f_pc_stdcreate_req.cpp"), + Matching ("f_pc/f_pc_method_tag.cpp"), + Matching ("f_pc/f_pc_pause.cpp"), + Matching ("f_pc/f_pc_draw.cpp"), + Matching ("f_pc/f_pc_fstcreate_req.cpp"), + Matching ("f_pc/f_pc_stdcreate_req.cpp"), # machine NonMatching("m_Do/m_Do_controller_pad.cpp"), # dolzel - NonMatching("d/d_com_lib_game.cpp"), + Matching ("d/d_com_lib_game.cpp"), Matching ("d/d_particle_name.cpp"), NonMatching("d/d_s_title.cpp"), diff --git a/include/f_pc/f_pc_base.h b/include/f_pc/f_pc_base.h index 155360ca3..8a8ec19d6 100644 --- a/include/f_pc/f_pc_base.h +++ b/include/f_pc/f_pc_base.h @@ -33,7 +33,7 @@ typedef struct base_process_class { /* 0xB4 */ u32 mSubType; } base_process_class; // Size: 0xB8 -bool fpcBs_Is_JustOfType(int pType1, int pType2); +BOOL fpcBs_Is_JustOfType(int pType1, int pType2); s32 fpcBs_MakeOfType(int* pType); s32 fpcBs_MakeOfId(void); s32 fpcBs_Execute(base_process_class* pProc); diff --git a/include/f_pc/f_pc_delete_tag.h b/include/f_pc/f_pc_delete_tag.h index 81a910513..1c90e6f1d 100644 --- a/include/f_pc/f_pc_delete_tag.h +++ b/include/f_pc/f_pc_delete_tag.h @@ -14,7 +14,7 @@ typedef struct delete_tag_class { s16 mTimer; } delete_tag_class; -bool fpcDtTg_IsEmpty(void); +BOOL fpcDtTg_IsEmpty(void); void fpcDtTg_ToDeleteQ(delete_tag_class* pTag); void fpcDtTg_DeleteQTo(delete_tag_class* pTag); s32 fpcDtTg_Do(delete_tag_class* pTag, delete_tag_func pFunc); diff --git a/include/f_pc/f_pc_deletor.h b/include/f_pc/f_pc_deletor.h index e712c4abb..ebe81a41a 100644 --- a/include/f_pc/f_pc_deletor.h +++ b/include/f_pc/f_pc_deletor.h @@ -6,7 +6,7 @@ typedef struct base_process_class base_process_class; -bool fpcDt_IsComplete(void); +BOOL fpcDt_IsComplete(void); s32 fpcDt_ToDeleteQ(base_process_class* pProc); s32 fpcDt_ToQueue(base_process_class* pProc); void fpcDt_Handler(void); diff --git a/src/f_pc/f_pc_base.cpp b/src/f_pc/f_pc_base.cpp index 9a5e9e1f5..5d79c72f4 100644 --- a/src/f_pc/f_pc_base.cpp +++ b/src/f_pc/f_pc_base.cpp @@ -13,9 +13,15 @@ #include "f_pc/f_pc_profile.h" #include "dolphin/types.h" +// hack to make functions that return comparisons as int match +extern int __cntlzw(unsigned int); +inline BOOL checkEqual(s32 a, s32 b) { + return (u32)__cntlzw(a - b) >> 5; +} + /* 8003C88C-8003C89C .text fpcBs_Is_JustOfType__Fii */ -bool fpcBs_Is_JustOfType(int i_typeA, int i_typeB) { - return i_typeB == i_typeA; +BOOL fpcBs_Is_JustOfType(int i_typeA, int i_typeB) { + return checkEqual(i_typeA, i_typeB); } static int g_fpcBs_type; diff --git a/src/f_pc/f_pc_delete_tag.cpp b/src/f_pc/f_pc_delete_tag.cpp index cbf87878c..2789c0f36 100644 --- a/src/f_pc/f_pc_delete_tag.cpp +++ b/src/f_pc/f_pc_delete_tag.cpp @@ -9,9 +9,15 @@ node_list_class g_fpcDtTg_Queue = {NULL, NULL, 0}; +// hack to make functions that return comparisons as int match +extern int __cntlzw(unsigned int); +inline BOOL checkEqual(s32 a, s32 b) { + return (u32)__cntlzw(a - b) >> 5; +} + /* 8003D170-8003D188 .text fpcDtTg_IsEmpty__Fv */ -bool fpcDtTg_IsEmpty() { - return g_fpcDtTg_Queue.mSize == 0; +BOOL fpcDtTg_IsEmpty() { + return checkEqual(g_fpcDtTg_Queue.mSize, 0); } /* 8003D188-8003D1BC .text fpcDtTg_ToDeleteQ__FP16delete_tag_class */ diff --git a/src/f_pc/f_pc_deletor.cpp b/src/f_pc/f_pc_deletor.cpp index d6c06d8c2..ab9752fc7 100644 --- a/src/f_pc/f_pc_deletor.cpp +++ b/src/f_pc/f_pc_deletor.cpp @@ -12,7 +12,7 @@ #include "f_pc/f_pc_node.h" /* 8003D280-8003D2A0 .text fpcDt_IsComplete__Fv */ -bool fpcDt_IsComplete() { +BOOL fpcDt_IsComplete() { return fpcDtTg_IsEmpty(); } diff --git a/src/f_pc/f_pc_manager.cpp b/src/f_pc/f_pc_manager.cpp index 4f66d61fc..6e0aa08d3 100644 --- a/src/f_pc/f_pc_manager.cpp +++ b/src/f_pc/f_pc_manager.cpp @@ -4,7 +4,13 @@ // #include "f_pc/f_pc_manager.h" -#include "dolphin/types.h" +#include "f_pc/f_pc_creator.h" +#include "f_pc/f_pc_draw.h" +#include "f_pc/f_pc_deletor.h" +#include "f_pc/f_pc_fstcreate_req.h" +#include "f_pc/f_pc_layer_iter.h" +#include "f_pc/f_pc_line.h" +#include "f_pc/f_pc_pause.h" /* 8003E318-8003E338 .text fpcM_Draw__FPv */ void fpcM_Draw(void* i_proc) { @@ -53,30 +59,46 @@ void fpcM_Management(void (*)(void), void (*)(void)) { /* 8003ED90-8003EDCC .text fpcM_Init__Fv */ void fpcM_Init() { - /* Nonmatching */ + static layer_class rootlayer; + static node_list_class queue[10]; + + fpcLy_Create(&rootlayer, NULL, queue, 10); + fpcLn_Create(); } /* 8003EDCC-8003EE20 .text fpcM_FastCreate__FsPFPv_iPvPv */ -void fpcM_FastCreate(short, int (*)(void*), void*, void*) { - /* Nonmatching */ +base_process_class* fpcM_FastCreate(s16 i_procTypeID, FastCreateReqFunc i_createReqFunc, + void* i_createData, void* i_data) { + return fpcFCtRq_Request(fpcLy_CurrentLayer(), i_procTypeID, (fstCreateFunc)i_createReqFunc, + i_createData, i_data); } + /* 8003EE20-8003EE44 .text fpcM_IsPause__FPvUc */ -void fpcM_IsPause(void*, unsigned char) { - /* Nonmatching */ +s32 fpcM_IsPause(void* i_proc, u8 i_flag) { + return fpcPause_IsEnable((base_process_class*)i_proc, i_flag & 0xFF); } /* 8003EE44-8003EE68 .text fpcM_PauseEnable__FPvUc */ -void fpcM_PauseEnable(void*, unsigned char) { - /* Nonmatching */ +void fpcM_PauseEnable(void* i_proc, u8 i_flag) { + fpcPause_Enable((process_node_class*)i_proc, i_flag & 0xFF); } /* 8003EE68-8003EE8C .text fpcM_PauseDisable__FPvUc */ -void fpcM_PauseDisable(void*, unsigned char) { - /* Nonmatching */ +void fpcM_PauseDisable(void* i_proc, u8 i_flag) { + fpcPause_Disable((process_node_class*)i_proc, i_flag & 0xFF); } /* 8003EE8C-8003EF00 .text fpcM_JudgeInLayer__FUiPFPvPv_PvPv */ -void fpcM_JudgeInLayer(unsigned int, void* (*)(void*, void*), void*) { - /* Nonmatching */ +void* fpcM_JudgeInLayer(unsigned int i_layerID, fpcCtIt_JudgeFunc i_judgeFunc, void* i_data) { + layer_class* layer = fpcLy_Layer(i_layerID); + if (layer != NULL) { + void* ret = fpcCtIt_JudgeInLayer(i_layerID, i_judgeFunc, i_data); + if (ret == NULL) { + ret = fpcLyIt_Judge(layer, i_judgeFunc, i_data); + } + return ret; + } else { + return NULL; + } }