diff --git a/include/JSystem/JUtility/JUTXfb/JUTXfb.h b/include/JSystem/JUtility/JUTXfb/JUTXfb.h index e2129ae9643..f9dfd336e81 100644 --- a/include/JSystem/JUtility/JUTXfb/JUTXfb.h +++ b/include/JSystem/JUtility/JUTXfb/JUTXfb.h @@ -18,7 +18,7 @@ public: void clearIndex(); void common_init(int xfb_number); - void delXfb(s32 index); + void delXfb(int index); static JUTXfb* createManager(JKRHeap* heap, EXfbNumber xfb_number); static void destroyManager(); void initiate(u16 width, u16 height, JKRHeap* heap, JUTXfb::EXfbNumber xfb_number); diff --git a/include/d/d_com/d_com_inf_game/asm/func_8002D9B0.s b/include/d/d_com/d_com_inf_game/asm/func_8002D9B0.s deleted file mode 100644 index c6b059aff73..00000000000 --- a/include/d/d_com/d_com_inf_game/asm/func_8002D9B0.s +++ /dev/null @@ -1,7 +0,0 @@ -/* 8002D9B0 0002A8F0 3C 80 80 3F */ lis r4, lbl_803F6094@ha -/* 8002D9B4 0002A8F4 38 84 60 94 */ addi r4, r4, lbl_803F6094@l -/* 8002D9B8 0002A8F8 1C 03 04 04 */ mulli r0, r3, 0x404 -/* 8002D9BC 0002A8FC 7C 64 02 14 */ add r3, r4, r0 -/* 8002D9C0 0002A900 88 63 03 F7 */ lbz r3, 0x3f7(r3) -/* 8002D9C4 0002A904 7C 63 07 74 */ extsb r3, r3 -/* 8002D9C8 0002A908 4E 80 00 20 */ blr diff --git a/include/d/d_stage/d_stage.h b/include/d/d_stage/d_stage.h index a8e85b52a6b..372a51df621 100644 --- a/include/d/d_stage/d_stage.h +++ b/include/d/d_stage/d_stage.h @@ -333,12 +333,13 @@ private: u16 field_0x62; int mVrboxNumInfo; int mVrboxcolNumInfo; -}; +}; // Size: 0x6C #pragma pack(push, 1) class dStage_roomControl_c { public: void init(void); + static int getZoneNo(int room); private: u8 field_0x0[164]; @@ -386,6 +387,17 @@ private: }; #pragma pack(pop) +class dStage_roomStatus_c : dStage_roomDt_c { +private: + /* 0x06C */ u8 mJ3DLightInfo[0xA0 - 0x6C]; + /* 0x0A0 */ u8 unk_A0[0x3F7 - 0xA0]; + /* 0x3F7 */ s8 mZoneNo; + /* 0x3F8 */ u8 unk_3F8[0x404 - 0x3F8]; + +public: + int getZoneNo() const { return mZoneNo; } +}; // Size: 0x404 + // unknown name struct objectNameInfo { char mName[8]; diff --git a/include/f/f_pc/asm/80020A40.s b/include/f/f_pc/asm/80020A40.s deleted file mode 100644 index ca2845d7d11..00000000000 --- a/include/f/f_pc/asm/80020A40.s +++ /dev/null @@ -1,23 +0,0 @@ -/* 80020A40 0001D980 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80020A44 0001D984 7C 08 02 A6 */ mflr r0 -/* 80020A48 0001D988 90 01 00 14 */ stw r0, 0x14(r1) -/* 80020A4C 0001D98C 7C 85 23 78 */ mr r5, r4 -/* 80020A50 0001D990 80 83 00 0C */ lwz r4, 0xc(r3) -/* 80020A54 0001D994 80 64 00 44 */ lwz r3, 0x44(r4) -/* 80020A58 0001D998 80 63 00 0C */ lwz r3, 0xc(r3) -/* 80020A5C 0001D99C 80 05 00 00 */ lwz r0, 0(r5) -/* 80020A60 0001D9A0 7C 03 00 40 */ cmplw r3, r0 -/* 80020A64 0001D9A4 40 82 00 1C */ bne lbl_80020A80 -/* 80020A68 0001D9A8 80 64 00 40 */ lwz r3, 0x40(r4) -/* 80020A6C 0001D9AC 80 85 00 08 */ lwz r4, 8(r5) -/* 80020A70 0001D9B0 81 85 00 04 */ lwz r12, 4(r5) -/* 80020A74 0001D9B4 7D 89 03 A6 */ mtctr r12 -/* 80020A78 0001D9B8 4E 80 04 21 */ bctrl -/* 80020A7C 0001D9BC 48 00 00 08 */ b lbl_80020A84 -lbl_80020A80: -/* 80020A80 0001D9C0 38 60 00 00 */ li r3, 0 -lbl_80020A84: -/* 80020A84 0001D9C4 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80020A88 0001D9C8 7C 08 03 A6 */ mtlr r0 -/* 80020A8C 0001D9CC 38 21 00 10 */ addi r1, r1, 0x10 -/* 80020A90 0001D9D0 4E 80 00 20 */ blr diff --git a/include/f/f_pc/f_pc_create_iter.h b/include/f/f_pc/f_pc_create_iter.h index 16fea99b62b..9b36e258246 100644 --- a/include/f/f_pc/f_pc_create_iter.h +++ b/include/f/f_pc/f_pc_create_iter.h @@ -21,7 +21,7 @@ typedef struct node_judge_data { } node_judge_data; typedef struct fpcCtIt_jilprm_c { - u32 mUnk0; + u32 mLayerID; fpcCtIt_JudgeFunc mFunc; void* mpUserData; } fpcCtIt_jilprm_c; diff --git a/include/f/f_pc/f_pc_draw.h b/include/f/f_pc/f_pc_draw.h index b91c6da5a83..1e9d9ecea12 100644 --- a/include/f/f_pc/f_pc_draw.h +++ b/include/f/f_pc/f_pc_draw.h @@ -5,9 +5,10 @@ #include "f/f_pc/f_pc_base.h" #include "global.h" -typedef s32 (*cNdIt_MethodFuncFunc)(cNdIt_MethodFunc); +typedef int (*fpcDw_HandlerFunc)(void*, void*); +typedef int (*fpcDw_HandlerFuncFunc)(fpcDw_HandlerFunc); s32 fpcDw_Execute(base_process_class* pProc); -s32 fpcDw_Handler(cNdIt_MethodFuncFunc param_1, cNdIt_MethodFunc param_2); +s32 fpcDw_Handler(fpcDw_HandlerFuncFunc param_1, fpcDw_HandlerFunc param_2); #endif \ No newline at end of file diff --git a/include/f/f_pc/f_pc_executor.h b/include/f/f_pc/f_pc_executor.h index 40575964737..860befaeffa 100644 --- a/include/f/f_pc/f_pc_executor.h +++ b/include/f/f_pc/f_pc_executor.h @@ -5,6 +5,7 @@ #include "SComponent/c_node_iter.h" #include "f/f_pc/f_pc_base.h" #include "f/f_pc/f_pc_layer_iter.h" +#include "f/f_pc/f_pc_line_iter.h" base_process_class* fpcEx_Search(fpcLyIt_JudgeFunc pFunc, void* pUserData); base_process_class* fpcEx_SearchByID(unsigned int id); @@ -13,7 +14,7 @@ s32 fpcEx_ToLineQ(base_process_class* pProc); s32 fpcEx_ExecuteQTo(base_process_class* pProc); s32 fpcEx_Execute(base_process_class* pProc); s32 fpcEx_ToExecuteQ(base_process_class* pProc); -void fpcEx_Handler(cNdIt_MethodFunc pFunc); +void fpcEx_Handler(fpcLnIt_QueueFunc pFunc); extern "C" { void fpcEx_IsExist__FUi(void); diff --git a/include/f/f_pc/f_pc_layer.h b/include/f/f_pc/f_pc_layer.h index 3e841b495c7..8459bf84d2e 100644 --- a/include/f/f_pc/f_pc_layer.h +++ b/include/f/f_pc/f_pc_layer.h @@ -25,8 +25,8 @@ typedef struct layer_class { void fpcLy_SetCurrentLayer(layer_class* pLayer); layer_class* fpcLy_CurrentLayer(void); layer_class* fpcLy_RootLayer(void); -layer_class* fpcLy_Layer(u32 id); -layer_class* fpcLy_Search(u32 id); +layer_class* fpcLy_Layer(unsigned int id); +layer_class* fpcLy_Search(unsigned int id); void fpcLy_Regist(layer_class* pLayer); void fpcLy_CreatedMesg(layer_class* pLayer); @@ -46,8 +46,7 @@ BOOL fpcLy_CancelMethod(struct process_method_tag_class* pLayer); void fpcLy_CancelQTo(struct process_method_tag_class* pMthd); s32 fpcLy_ToCancelQ(layer_class* pLayer, struct process_method_tag_class* pMthd); -void fpcLy_Create(layer_class* pLayer, struct process_node_class* pPcNode, node_list_class* pLists, - s32 listNum); +void fpcLy_Create(layer_class* pLayer, void* pPcNode, node_list_class* pLists, int listNum); s32 fpcLy_Delete(layer_class* pLayer); diff --git a/include/f/f_pc/f_pc_layer_iter.h b/include/f/f_pc/f_pc_layer_iter.h index 12f2095501c..9caf3bc70a8 100644 --- a/include/f/f_pc/f_pc_layer_iter.h +++ b/include/f/f_pc/f_pc_layer_iter.h @@ -10,10 +10,11 @@ typedef struct layer_iter { void* mpUserData; } layer_iter; +typedef int (*fpcLyIt_OnlyHereFunc)(void*, void*); typedef void* (*fpcLyIt_JudgeFunc)(void*, void*); -s32 fpcLyIt_OnlyHere(layer_class* pLayer, cNdIt_MethodFunc pFunc, void* pUserData); -s32 fpcLyIt_OnlyHereLY(layer_class* pLayer, cNdIt_MethodFunc pFunc, void* pUserData); +s32 fpcLyIt_OnlyHere(layer_class* pLayer, fpcLyIt_OnlyHereFunc pFunc, void* pUserData); +s32 fpcLyIt_OnlyHereLY(layer_class* pLayer, fpcLyIt_OnlyHereFunc pFunc, void* pUserData); void* fpcLyIt_Judge(layer_class* pLayer, fpcLyIt_JudgeFunc pFunc, void* pUserData); void* fpcLyIt_AllJudge(fpcLyIt_JudgeFunc pFunc, void* pUserData); diff --git a/include/f/f_pc/f_pc_layer_tag.h b/include/f/f_pc/f_pc_layer_tag.h index d20042321ff..da9fee5d6c4 100644 --- a/include/f/f_pc/f_pc_layer_tag.h +++ b/include/f/f_pc/f_pc_layer_tag.h @@ -14,8 +14,9 @@ typedef struct layer_management_tag_class { } layer_management_tag_class; s32 fpcLyTg_QueueTo(layer_management_tag_class* pTag); -s32 fpcLyTg_ToQueue(layer_management_tag_class* pTag, u32 layerID, u16 listID, u16 listPrio); -s32 fpcLyTg_Move(layer_management_tag_class*, u32, u16, u16); -s32 fpcLyTg_Init(layer_management_tag_class*, u32, void*); +s32 fpcLyTg_ToQueue(layer_management_tag_class* pTag, unsigned int layerID, u16 listID, + u16 listPrio); +s32 fpcLyTg_Move(layer_management_tag_class*, unsigned int, u16, u16); +s32 fpcLyTg_Init(layer_management_tag_class*, unsigned int, void*); #endif diff --git a/include/f/f_pc/f_pc_line_iter.h b/include/f/f_pc/f_pc_line_iter.h index aa241064ffe..21277751ee0 100644 --- a/include/f/f_pc/f_pc_line_iter.h +++ b/include/f/f_pc/f_pc_line_iter.h @@ -4,6 +4,8 @@ #include "SComponent/c_node_iter.h" -void fpcLnIt_Queue(cNdIt_MethodFunc pFunc); +typedef int (*fpcLnIt_QueueFunc)(void*, void*); + +void fpcLnIt_Queue(fpcLnIt_QueueFunc pFunc); #endif diff --git a/include/f/f_pc/f_pc_line_tag.h b/include/f/f_pc/f_pc_line_tag.h index a2cfbd3b888..caf9ee268cc 100644 --- a/include/f/f_pc/f_pc_line_tag.h +++ b/include/f/f_pc/f_pc_line_tag.h @@ -10,9 +10,9 @@ typedef struct line_tag { s32 mLineListID; } line_tag; -s32 fpcLnTg_Move(line_tag* pLineTag, s32 newLineListID); +s32 fpcLnTg_Move(line_tag* pLineTag, int newLineListID); void fpcLnTg_QueueTo(line_tag* pLineTag); -s32 fpcLnTg_ToQueue(line_tag* pLineTag, s32 lineListID); +s32 fpcLnTg_ToQueue(line_tag* pLineTag, int lineListID); void fpcLnTg_Init(line_tag* pLineTag, void* pData); #endif diff --git a/include/f/f_pc/f_pc_manager.h b/include/f/f_pc/f_pc_manager.h index 5dcccc0bb8d..1b37f822178 100644 --- a/include/f/f_pc/f_pc_manager.h +++ b/include/f/f_pc/f_pc_manager.h @@ -20,7 +20,7 @@ void fpcM_Draw(void* pProc); s32 fpcM_DrawIterater(fpcM_DrawIteraterFunc pFunc); void fpcM_Execute(void* pProc); s32 fpcM_Delete(void* pProc); -BOOL fpcM_IsCreating(u32 pID); +BOOL fpcM_IsCreating(unsigned int pID); void fpcM_Management(fpcM_ManagementFunc pFunc1, fpcM_ManagementFunc pFunc2); void fpcM_Init(void); base_process_class* fpcM_FastCreate(s16 pProcTypeID, FastCreateReqFunc param_2, void* param_3, @@ -28,7 +28,7 @@ base_process_class* fpcM_FastCreate(s16 pProcTypeID, FastCreateReqFunc param_2, s32 fpcM_IsPause(void* pProc, u8 param_2); void fpcM_PauseEnable(void* pProc, u8 param_2); void fpcM_PauseDisable(void* pProc, u8 param_2); -void* fpcM_JudgeInLayer(u32 pLayerID, fpcCtIt_JudgeFunc pFunc, void* pUserData); +void* fpcM_JudgeInLayer(unsigned int pLayerID, fpcCtIt_JudgeFunc pFunc, void* pUserData); extern "C" { void fpcM_Delete__FPv(void); diff --git a/include/f/f_pc/f_pc_method.h b/include/f/f_pc/f_pc_method.h index 6cbe3124825..1220130dfaa 100644 --- a/include/f/f_pc/f_pc_method.h +++ b/include/f/f_pc/f_pc_method.h @@ -4,7 +4,7 @@ #include "global.h" -typedef s32 (*process_method_func)(void*); +typedef int (*process_method_func)(void*); typedef struct process_method_class { process_method_func mpCreateFunc; diff --git a/include/f/f_pc/f_pc_method_iter.h b/include/f/f_pc/f_pc_method_iter.h index c7e9a4eb9fa..5226b3f949a 100644 --- a/include/f/f_pc/f_pc_method_iter.h +++ b/include/f/f_pc/f_pc_method_iter.h @@ -5,6 +5,8 @@ #include "SComponent/c_list_iter.h" #include "global.h" -void fpcMtdIt_Method(node_list_class* pList, cNdIt_MethodFunc pMethod); +typedef int (*fpcMtdIt_MethodFunc)(void*); + +void fpcMtdIt_Method(node_list_class* pList, fpcMtdIt_MethodFunc pMethod); #endif diff --git a/include/f/f_pc/f_pc_method_tag.h b/include/f/f_pc/f_pc_method_tag.h index 5dd1b5cc45a..0993a6f94da 100644 --- a/include/f/f_pc/f_pc_method_tag.h +++ b/include/f/f_pc/f_pc_method_tag.h @@ -5,7 +5,7 @@ #include "SComponent/c_tag.h" #include "global.h" -typedef s32 (*process_method_tag_func)(void*); +typedef int (*process_method_tag_func)(void*); typedef struct process_method_tag_class { create_tag_class mCreateTag; diff --git a/include/f/f_pc/f_pc_priority.h b/include/f/f_pc/f_pc_priority.h index 1bcc150408f..890973f099d 100644 --- a/include/f/f_pc/f_pc_priority.h +++ b/include/f/f_pc/f_pc_priority.h @@ -23,9 +23,10 @@ s32 fpcPi_QueueTo(process_priority_class* pPi); s32 fpcPi_ToQueue(process_priority_class* pPi); process_priority_class* fpcPi_GetFromQueue(void); s32 fpcPi_Delete(process_priority_class* pPi); -s32 fpcPi_IsNormal(u32 layer, u16 listID, u16 priority); -s32 fpcPi_Change(process_priority_class* pPi, u32 layer, u16 listID, u16 priority); +s32 fpcPi_IsNormal(unsigned int layer, u16 listID, u16 priority); +s32 fpcPi_Change(process_priority_class* pPi, unsigned int layer, u16 listID, u16 priority); s32 fpcPi_Handler(void); -s32 fpcPi_Init(process_priority_class* pPi, void* pUserData, u32 layer, u16 listID, u16 priority); +s32 fpcPi_Init(process_priority_class* pPi, void* pUserData, unsigned int layer, u16 listID, + u16 priority); #endif diff --git a/libs/JSystem/JUtility/JUTXfb.cpp b/libs/JSystem/JUtility/JUTXfb.cpp index 2f59daa39b7..aa72835d5fa 100644 --- a/libs/JSystem/JUtility/JUTXfb.cpp +++ b/libs/JSystem/JUtility/JUTXfb.cpp @@ -48,7 +48,7 @@ JUTXfb::~JUTXfb() { /* sManager */ lbl_80451550 = NULL; } -void JUTXfb::delXfb(s32 index) { +void JUTXfb::delXfb(int index) { if ((this->is_xfb_allocated[index] != false) && (this->xfb_buffer[index] != NULL)) { delete this->xfb_buffer[index]; } diff --git a/src/d/d_com/d_com_inf_game.cpp b/src/d/d_com/d_com_inf_game.cpp index 0a4015bce4a..93ab937088b 100644 --- a/src/d/d_com/d_com_inf_game.cpp +++ b/src/d/d_com/d_com_inf_game.cpp @@ -5,6 +5,7 @@ #include "d/d_item/d_item/d_item.h" #include "d/d_kankyo/d_kankyo.h" #include "d/d_meter2/d_meter2_info/d_meter2_info.h" +#include "d/d_stage/d_stage.h" #include "f/f_op/f_op_scene_mng.h" #include "global.h" #include "m_Do/m_Do_Reset/m_Do_Reset.h" @@ -297,7 +298,7 @@ extern u8 lbl_803A71C4; extern u8 lbl_80451D00; extern u8 lbl_803A37C0; extern u8 lbl_80451D04; -extern u8 lbl_803F6094; +extern dStage_roomStatus_c lbl_803F6094[0x40]; extern u8 lbl_80451D10; extern u8 lbl_80451D08; extern u8 lbl_803A71D0; @@ -733,10 +734,8 @@ asm void dComIfGs_onZoneSwitch__Fii(void) { } // getZoneNo__20dStage_roomControl_cFi -// dStage_roomControl_c::getZoneNo(int) -asm int getZoneNo__20dStage_roomControl_cFi(int) { - nofralloc -#include "d/d_com/d_com_inf_game/asm/func_8002D9B0.s" +int dStage_roomControl_c::getZoneNo(int room) { + return lbl_803F6094[room].getZoneNo(); } // dComIfGs_offZoneSwitch__Fii diff --git a/src/d/d_save/d_save.cpp b/src/d/d_save/d_save.cpp index 391d412063e..a8986df6ca1 100644 --- a/src/d/d_save/d_save.cpp +++ b/src/d/d_save/d_save.cpp @@ -1391,7 +1391,7 @@ void dSv_info_c::onSwitch(int i_no, int i_roomNo) { } else if (i_no < 0xc0) { dungeon_bit.onSwitch(i_no - 0x80); } else { - int zoneId = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneId = dStage_roomControl_c::getZoneNo(i_roomNo); if (i_no < 0xE0) { zones[zoneId].getZoneBit().onSwitch(i_no - 0xC0); } else { @@ -1410,7 +1410,7 @@ void dSv_info_c::offSwitch(int i_no, int i_roomNo) { } else if (i_no < 0xc0) { dungeon_bit.offSwitch(i_no - 0x80); } else { - int zoneId = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneId = dStage_roomControl_c::getZoneNo(i_roomNo); if (i_no < 0xE0) { zones[zoneId].getZoneBit().offSwitch(i_no - 0xC0); } else { @@ -1430,7 +1430,7 @@ BOOL dSv_info_c::isSwitch(int i_no, int i_roomNo) const { } else if (i_no < 0xc0) { value = dungeon_bit.isSwitch(i_no - 0x80); } else { - int zoneId = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneId = dStage_roomControl_c::getZoneNo(i_roomNo); if ((zoneId < 0) || (zoneId >= 0x20)) { value = FALSE; } else { @@ -1455,7 +1455,7 @@ BOOL dSv_info_c::revSwitch(int i_no, int i_roomNo) { } else if (i_no < 0xC0) { value = dungeon_bit.revSwitch(i_no - 0x80); } else { - int zoneNo = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo); if (i_no < 0xE0) { value = zones[zoneNo].getZoneBit().revSwitch(i_no - 0xC0); } else { @@ -1476,7 +1476,7 @@ void dSv_info_c::onItem(int i_no, int i_roomNo) { } else if (i_no < 0xA0) { memory.getTempFlags().onItem(i_no - 0x80); } else { - int zoneNo = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo); if (i_no < 0xC0) { zones[zoneNo].getZoneBit().onItem(i_no - 0xA0); } else { @@ -1496,7 +1496,7 @@ BOOL dSv_info_c::isItem(int i_no, int i_roomNo) const { } else if (i_no < 0xA0) { value = memory.getTempFlagsConst().isItem(i_no - 0x80); } else { - int zoneNo = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo); if (i_no < 0xC0) { value = zones[zoneNo].getZoneBitConst().isItem(i_no - 0xA0); } else { @@ -1512,7 +1512,7 @@ void dSv_info_c::onActor(int i_id, int i_roomNo) { return; } - int zoneNo = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo); zones[zoneNo].getZoneActor().on(i_id); } @@ -1521,7 +1521,7 @@ void dSv_info_c::offActor(int i_id, int i_roomNo) { return; } - int zoneNo = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int zoneNo = dStage_roomControl_c::getZoneNo(i_roomNo); zones[zoneNo].getZoneActor().off(i_id); } @@ -1530,7 +1530,7 @@ BOOL dSv_info_c::isActor(int i_id, int i_roomNo) const { return FALSE; } - int ActorZoneNo = getZoneNo__20dStage_roomControl_cFi(i_roomNo); + int ActorZoneNo = dStage_roomControl_c::getZoneNo(i_roomNo); return zones[ActorZoneNo].getZoneActorConst().is(i_id); } diff --git a/src/f/f_pc/f_pc_create_iter.cpp b/src/f/f_pc/f_pc_create_iter.cpp index 746ec80b30d..784ee667212 100644 --- a/src/f/f_pc/f_pc_create_iter.cpp +++ b/src/f/f_pc/f_pc_create_iter.cpp @@ -1,4 +1,5 @@ #include "f/f_pc/f_pc_create_iter.h" +#include "f/f_pc/f_pc_create_req.h" // g_fpcCtTg_Queue extern node_list_class lbl_803A3990; @@ -16,13 +17,19 @@ void* fpcCtIt_Judge(fpcCtIt_JudgeFunc pJudge, void* pUserData) { iter.mpUserData = pUserData; return cLsIt_Judge(&lbl_803A3990, (cNdIt_JudgeFunc)cTgIt_JudgeFilter, &iter); } -asm void* fpcCtIt_filter_JudgeInLayer(create_tag*, fpcCtIt_jilprm_c*) { - nofralloc -#include "f/f_pc/asm/80020A40.s" + +void* fpcCtIt_filter_JudgeInLayer(create_tag* pCreateTag, fpcCtIt_jilprm_c* pIterData) { + create_request* create_req = static_cast(pCreateTag->mBase.mpTagData); + if (create_req->mpLayer->mLayerID == pIterData->mLayerID) { + return pIterData->mFunc((node_class*)create_req->mpRes, pIterData->mpUserData); + } else { + return NULL; + } } -void* fpcCtIt_JudgeInLayer(unsigned int pUnk0, fpcCtIt_JudgeFunc pFunc, void* pUserData) { + +void* fpcCtIt_JudgeInLayer(unsigned int pLayerID, fpcCtIt_JudgeFunc pFunc, void* pUserData) { fpcCtIt_jilprm_c data; - data.mUnk0 = pUnk0; + data.mLayerID = pLayerID; data.mFunc = pFunc; data.mpUserData = pUserData; return fpcCtIt_Judge((fpcCtIt_JudgeFunc)fpcCtIt_filter_JudgeInLayer, &data); diff --git a/src/f/f_pc/f_pc_deletor.cpp b/src/f/f_pc/f_pc_deletor.cpp index 6fae0313e4d..3ce60aade4e 100644 --- a/src/f/f_pc/f_pc_deletor.cpp +++ b/src/f/f_pc/f_pc_deletor.cpp @@ -69,7 +69,8 @@ s32 fpcDt_ToDeleteQ(base_process_class* pProc) { } else { layer_class* layer = &procNode->mLayer; fpcLy_Cancel(layer); - if (fpcLyIt_OnlyHereLY(layer, (cNdIt_MethodFunc)fpcDt_ToDeleteQ, NULL) == 0) { + if (fpcLyIt_OnlyHereLY(layer, (fpcLyIt_OnlyHereFunc)fpcDt_ToDeleteQ, NULL) == + 0) { return 0; } } diff --git a/src/f/f_pc/f_pc_draw.cpp b/src/f/f_pc/f_pc_draw.cpp index 613aeeb8ba9..a46929d9953 100644 --- a/src/f/f_pc/f_pc_draw.cpp +++ b/src/f/f_pc/f_pc_draw.cpp @@ -6,8 +6,6 @@ // f_pc_leaf::g_fpcLf_type extern s32 lbl_80450D30; -typedef s32 (*cNdIt_MethodFuncFunc)(cNdIt_MethodFunc); - s32 fpcDw_Execute(base_process_class* pProc) { if (!fpcPause_IsEnable(pProc, 2)) { layer_class* curLay; @@ -28,7 +26,7 @@ s32 fpcDw_Execute(base_process_class* pProc) { } } -s32 fpcDw_Handler(cNdIt_MethodFuncFunc param_1, cNdIt_MethodFunc param_2) { +s32 fpcDw_Handler(fpcDw_HandlerFuncFunc param_1, fpcDw_HandlerFunc param_2) { s32 ret; cAPIGph_BeforeOfDraw(); ret = param_1(param_2); diff --git a/src/f/f_pc/f_pc_executor.cpp b/src/f/f_pc/f_pc_executor.cpp index 7f768c2cd84..cb943fd6ee1 100644 --- a/src/f/f_pc/f_pc_executor.cpp +++ b/src/f/f_pc/f_pc_executor.cpp @@ -46,7 +46,7 @@ s32 fpcEx_ToLineQ(base_process_class* pProc) { pProc->mInitState = 2; if (fpcBs_Is_JustOfType(g_fpcNd_type, pProc->mSubType)) { process_node_class* pNode = (process_node_class*)pProc; - fpcLyIt_OnlyHere(&pNode->mLayer, (cNdIt_MethodFunc)fpcEx_ToLineQ, pNode); + fpcLyIt_OnlyHere(&pNode->mLayer, (fpcLyIt_OnlyHereFunc)fpcEx_ToLineQ, pNode); } return 1; @@ -76,6 +76,6 @@ s32 fpcEx_ToExecuteQ(base_process_class* pProc) { } } -void fpcEx_Handler(cNdIt_MethodFunc pFunc) { +void fpcEx_Handler(fpcLnIt_QueueFunc pFunc) { fpcLnIt_Queue(pFunc); } \ No newline at end of file diff --git a/src/f/f_pc/f_pc_layer.cpp b/src/f/f_pc/f_pc_layer.cpp index 581a0ae6618..13f5513e208 100644 --- a/src/f/f_pc/f_pc_layer.cpp +++ b/src/f/f_pc/f_pc_layer.cpp @@ -80,7 +80,7 @@ layer_class* fpcLy_CurrentLayer(void) { return lbl_80450D18; } -layer_class* fpcLy_Search(u32 id) { +layer_class* fpcLy_Search(unsigned int id) { layer_class* iVar1 = fpcLy_RootLayer(); while (iVar1 != NULL) { if (iVar1->mLayerID == id) { @@ -91,7 +91,7 @@ layer_class* fpcLy_Search(u32 id) { return NULL; } -layer_class* fpcLy_Layer(u32 id) { +layer_class* fpcLy_Layer(unsigned int id) { if (id == 0 || fpcLy_RootLayer()->mLayerID == id) { return fpcLy_RootLayer(); } else if (id == ~2 || fpcLy_CurrentLayer()->mLayerID == id) { @@ -116,11 +116,10 @@ s32 fpcLy_Delete(layer_class* pLayer) { } void fpcLy_Cancel(layer_class* pLayer) { - fpcMtdIt_Method(&pLayer->mCancelList, (cNdIt_MethodFunc)fpcLy_CancelMethod); + fpcMtdIt_Method(&pLayer->mCancelList, (fpcMtdIt_MethodFunc)fpcLy_CancelMethod); } -void fpcLy_Create(layer_class* pLayer, process_node_class* pPcNode, node_list_class* pLists, - s32 listNum) { +void fpcLy_Create(layer_class* pLayer, void* pPcNode, node_list_class* pLists, int listNum) { void* pvVar1; s32 iVar2; @@ -135,7 +134,7 @@ void fpcLy_Create(layer_class* pLayer, process_node_class* pPcNode, node_list_cl *pLayer = lbl_803A39B0; cNd_Create((node_class*)pLayer, NULL); pLayer->mLayerID = lbl_80450D24++; - pLayer->mpPcNode = pPcNode; + pLayer->mpPcNode = static_cast(pPcNode); if (lbl_80450D1C == 0x1) { lbl_80450D1C = 0x0; cLs_Create(&lbl_803A39DC); diff --git a/src/f/f_pc/f_pc_layer_iter.cpp b/src/f/f_pc/f_pc_layer_iter.cpp index b1f21a69ce8..0438a46f2dd 100644 --- a/src/f/f_pc/f_pc_layer_iter.cpp +++ b/src/f/f_pc/f_pc_layer_iter.cpp @@ -2,14 +2,14 @@ #include "SComponent/c_tag_iter.h" #include "SComponent/c_tree_iter.h" -s32 fpcLyIt_OnlyHere(layer_class* pLayer, cNdIt_MethodFunc pFunc, void* pUserData) { +s32 fpcLyIt_OnlyHere(layer_class* pLayer, fpcLyIt_OnlyHereFunc pFunc, void* pUserData) { layer_iter lIter; lIter.mpFunc = pFunc; lIter.mpUserData = pUserData; return cTrIt_Method(&pLayer->mNodeListTree, (cNdIt_MethodFunc)cTgIt_MethodCall, &lIter); } -s32 fpcLyIt_OnlyHereLY(layer_class* pLayer, cNdIt_MethodFunc pFunc, void* pUserData) { +s32 fpcLyIt_OnlyHereLY(layer_class* pLayer, fpcLyIt_OnlyHereFunc pFunc, void* pUserData) { s32 result; layer_class* currentLayer = fpcLy_CurrentLayer(); fpcLy_SetCurrentLayer(pLayer); diff --git a/src/f/f_pc/f_pc_layer_tag.cpp b/src/f/f_pc/f_pc_layer_tag.cpp index 7e8eb98e15c..518c03f202c 100644 --- a/src/f/f_pc/f_pc_layer_tag.cpp +++ b/src/f/f_pc/f_pc_layer_tag.cpp @@ -5,7 +5,8 @@ // f_pc_layer_tag::crear extern layer_management_tag_class lbl_803A3A00; -s32 fpcLyTg_ToQueue(layer_management_tag_class* pTag, u32 layerID, u16 listID, u16 listPrio) { +s32 fpcLyTg_ToQueue(layer_management_tag_class* pTag, unsigned int layerID, u16 listID, + u16 listPrio) { if (pTag->mpLayer == NULL && layerID == -1) { return 0; } else { @@ -40,7 +41,7 @@ s32 fpcLyTg_QueueTo(layer_management_tag_class* pTag) { } } -s32 fpcLyTg_Move(layer_management_tag_class* pTag, u32 layerID, u16 listID, u16 listPrio) { +s32 fpcLyTg_Move(layer_management_tag_class* pTag, unsigned int layerID, u16 listID, u16 listPrio) { layer_class* layer = fpcLy_Layer(layerID); if (layer == NULL) { return 0; @@ -52,7 +53,7 @@ s32 fpcLyTg_Move(layer_management_tag_class* pTag, u32 layerID, u16 listID, u16 } } -s32 fpcLyTg_Init(layer_management_tag_class* pTag, u32 param2, void* param3) { +s32 fpcLyTg_Init(layer_management_tag_class* pTag, unsigned int param2, void* param3) { layer_class* layer; *pTag = lbl_803A3A00; cTg_Create(&pTag->mCreateTag, param3); diff --git a/src/f/f_pc/f_pc_line_iter.cpp b/src/f/f_pc/f_pc_line_iter.cpp index 3eebf2f4058..73ed8b45d48 100644 --- a/src/f/f_pc/f_pc_line_iter.cpp +++ b/src/f/f_pc/f_pc_line_iter.cpp @@ -1,4 +1,5 @@ +#include "f/f_pc/f_pc_line_iter.h" #include "SComponent/c_tag_iter.h" #include "SComponent/c_tree_iter.h" #include "f/f_pc/f_pc_base.h" @@ -8,7 +9,7 @@ extern node_lists_tree_class lbl_804505D8; static s32 fpcLnIt_MethodCall(create_tag_class* pTag, method_filter* pFilter) { - layer_class* pLayer = ((base_process_class*)pTag->mpTagData)->mLyTg.mpLayer; + layer_class* pLayer = static_cast(pTag->mpTagData)->mLyTg.mpLayer; layer_class* pCurLayer = fpcLy_CurrentLayer(); s32 ret; @@ -19,9 +20,9 @@ static s32 fpcLnIt_MethodCall(create_tag_class* pTag, method_filter* pFilter) { return ret; } -void fpcLnIt_Queue(cNdIt_MethodFunc pFunc) { +void fpcLnIt_Queue(fpcLnIt_QueueFunc pFunc) { method_filter filter; - filter.mpMethodFunc = pFunc; + filter.mpMethodFunc = (cNdIt_MethodFunc)pFunc; filter.mpUserData = NULL; cTrIt_Method(&lbl_804505D8, (cNdIt_MethodFunc)fpcLnIt_MethodCall, &filter); } \ No newline at end of file diff --git a/src/f/f_pc/f_pc_line_tag.cpp b/src/f/f_pc/f_pc_line_tag.cpp index 22d17bf1a81..f446a9ad194 100644 --- a/src/f/f_pc/f_pc_line_tag.cpp +++ b/src/f/f_pc/f_pc_line_tag.cpp @@ -4,7 +4,7 @@ // g_fpcLn_Queue extern node_lists_tree_class lbl_804505D8; -s32 fpcLnTg_Move(line_tag* pLineTag, s32 newLineListID) { +s32 fpcLnTg_Move(line_tag* pLineTag, int newLineListID) { if (pLineTag->mLineListID != newLineListID) { fpcLnTg_QueueTo(pLineTag); return fpcLnTg_ToQueue(pLineTag, newLineListID); @@ -18,7 +18,7 @@ void fpcLnTg_QueueTo(line_tag* pLineTag) { pLineTag->mLineListID = -1; } -s32 fpcLnTg_ToQueue(line_tag* pLineTag, s32 lineListID) { +s32 fpcLnTg_ToQueue(line_tag* pLineTag, int lineListID) { s32 ret = cTg_AdditionToTree(&lbl_804505D8, lineListID, &pLineTag->mBase); if (ret) { diff --git a/src/f/f_pc/f_pc_manager.cpp b/src/f/f_pc/f_pc_manager.cpp index 6abd434f819..daaec9c9ba3 100644 --- a/src/f/f_pc/f_pc_manager.cpp +++ b/src/f/f_pc/f_pc_manager.cpp @@ -45,7 +45,7 @@ void fpcM_Draw(void* pProc) { } s32 fpcM_DrawIterater(fpcM_DrawIteraterFunc pFunc) { - return fpcLyIt_OnlyHere(fpcLy_RootLayer(), (cNdIt_MethodFunc)pFunc, NULL); + return fpcLyIt_OnlyHere(fpcLy_RootLayer(), (fpcLyIt_OnlyHereFunc)pFunc, NULL); } void fpcM_Execute(void* pProc) { @@ -56,7 +56,7 @@ s32 fpcM_Delete(void* pProc) { return fpcDt_Delete((base_process_class*)pProc); } -BOOL fpcM_IsCreating(u32 pID) { +BOOL fpcM_IsCreating(unsigned int pID) { return fpcCt_IsCreatingByID(pID); } @@ -85,8 +85,8 @@ void fpcM_Management(fpcM_ManagementFunc pFunc1, fpcM_ManagementFunc pFunc2) { if (pFunc1) { pFunc1(); } - fpcEx_Handler((cNdIt_MethodFunc)fpcM_Execute); - fpcDw_Handler((cNdIt_MethodFuncFunc)fpcM_DrawIterater, (cNdIt_MethodFunc)fpcM_Draw); + fpcEx_Handler((fpcLnIt_QueueFunc)fpcM_Execute); + fpcDw_Handler((fpcDw_HandlerFuncFunc)fpcM_DrawIterater, (fpcDw_HandlerFunc)fpcM_Draw); if (pFunc2) { pFunc2(); } @@ -123,7 +123,7 @@ void fpcM_PauseDisable(void* pProc, u8 param_2) { fpcPause_Disable((process_node_class*)pProc, param_2 & 0xFF); } -void* fpcM_JudgeInLayer(u32 pLayerID, fpcCtIt_JudgeFunc pFunc, void* pUserData) { +void* fpcM_JudgeInLayer(unsigned int pLayerID, fpcCtIt_JudgeFunc pFunc, void* pUserData) { layer_class* layer = fpcLy_Layer(pLayerID); if (layer != NULL) { void* ret = fpcCtIt_JudgeInLayer(pLayerID, pFunc, pUserData); diff --git a/src/f/f_pc/f_pc_method_iter.cpp b/src/f/f_pc/f_pc_method_iter.cpp index 1dc868490ed..443ec15a11f 100644 --- a/src/f/f_pc/f_pc_method_iter.cpp +++ b/src/f/f_pc/f_pc_method_iter.cpp @@ -1,6 +1,6 @@ #include "f/f_pc/f_pc_method_iter.h" #include "dolphin/types.h" -void fpcMtdIt_Method(node_list_class* pList, cNdIt_MethodFunc pMethod) { - cLsIt_Method(pList, pMethod, NULL); +void fpcMtdIt_Method(node_list_class* pList, fpcMtdIt_MethodFunc pMethod) { + cLsIt_Method(pList, (cNdIt_MethodFunc)pMethod, NULL); } diff --git a/src/f/f_pc/f_pc_pause.cpp b/src/f/f_pc/f_pc_pause.cpp index 025a5b81576..15c2407266e 100644 --- a/src/f/f_pc/f_pc_pause.cpp +++ b/src/f/f_pc/f_pc_pause.cpp @@ -26,7 +26,8 @@ s32 fpcPause_Enable(void* pProcess, u8 flag) { if (fpcBs_Is_JustOfType(g_fpcNd_type, pProc->mSubType)) { process_node_class* pNode = (process_node_class*)pProc; - fpcLyIt_OnlyHere(&pNode->mLayer, (cNdIt_MethodFunc)fpcPause_Enable, (void*)(flag & 0xFF)); + fpcLyIt_OnlyHere(&pNode->mLayer, (fpcLyIt_OnlyHereFunc)fpcPause_Enable, + (void*)(flag & 0xFF)); } return 1; } @@ -37,7 +38,7 @@ s32 fpcPause_Disable(void* pProcess, u8 flag) { if (fpcBs_Is_JustOfType(g_fpcNd_type, pProc->mSubType)) { process_node_class* pNode = (process_node_class*)pProc; - fpcLyIt_OnlyHere(&pNode->mLayer, (cNdIt_MethodFunc)fpcPause_Disable, (void*)flag); + fpcLyIt_OnlyHere(&pNode->mLayer, (fpcLyIt_OnlyHereFunc)fpcPause_Disable, (void*)flag); } return 1; diff --git a/src/f/f_pc/f_pc_priority.cpp b/src/f/f_pc/f_pc_priority.cpp index 0a62a3cbf8e..9f6042bfd90 100644 --- a/src/f/f_pc/f_pc_priority.cpp +++ b/src/f/f_pc/f_pc_priority.cpp @@ -60,14 +60,14 @@ s32 fpcPi_Delete(process_priority_class* pPi) { return 1; } -s32 fpcPi_IsNormal(u32 layer, u16 listID, u16 priority) { +s32 fpcPi_IsNormal(unsigned int layer, u16 listID, u16 priority) { if ((layer < 0xFFFFFFFE) && (listID < 0xFFFE) && (priority < 0xFFFE)) return 1; return 0; } -s32 fpcPi_Change(process_priority_class* pPi, u32 layer, u16 listID, u16 priority) { +s32 fpcPi_Change(process_priority_class* pPi, unsigned int layer, u16 listID, u16 priority) { base_process_class* pProc = (base_process_class*)pPi->mBase.mpTagData; BOOL changed = 0; @@ -129,7 +129,8 @@ s32 fpcPi_Handler(void) { return 1; } -s32 fpcPi_Init(process_priority_class* pPi, void* pUserData, u32 layer, u16 listID, u16 priority) { +s32 fpcPi_Init(process_priority_class* pPi, void* pUserData, unsigned int layer, u16 listID, + u16 priority) { if (!fpcPi_IsNormal(layer, listID, priority)) return 0; diff --git a/tools/clang-format-all.sh b/tools/clang-format-all.sh index 65606bb5e38..000a3b605af 100755 --- a/tools/clang-format-all.sh +++ b/tools/clang-format-all.sh @@ -6,9 +6,9 @@ else fi echo "formatting src/*" -find ./src -iname *.h -o -iname *.cpp | xargs $CF -i +find ./src -iname "*.h" -o -iname "*.cpp" | xargs $CF -i echo "formatting libs/*" -find ./libs -iname *.h -o -iname *.cpp | xargs $CF -i +find ./libs -iname "*.h" -o -iname "*.cpp" | xargs $CF -i echo "formatting include/*" -find ./include -iname *.h -o -iname *.cpp | xargs $CF -i +find ./include -iname "*.h" -o -iname "*.cpp" | xargs $CF -i echo "done"