diff options
| author | unknown <pheenoh@gmail.com> | 2020-12-01 19:04:35 -0500 |
|---|---|---|
| committer | unknown <pheenoh@gmail.com> | 2020-12-01 19:04:35 -0500 |
| commit | 91fc5f6f532817dca0763a6e7841ce2a75ecb54d (patch) | |
| tree | db6b63a24336b6d767ec12a195cda6520e8d77e9 /include | |
| parent | 1ded84de460526448c0a2f5ffc5c651f4119d21b (diff) | |
| parent | ac6b191dc19ddd1f155b55890953b7564c6f7b74 (diff) | |
Merge branch 'master' of https://github.com/zeldaret/tp
Diffstat (limited to 'include')
39 files changed, 795 insertions, 29 deletions
diff --git a/include/JSystem/JKernel/JKRDisposer/JKRDisposer.h b/include/JSystem/JKernel/JKRDisposer/JKRDisposer.h index f272e75136..7d9576912f 100644 --- a/include/JSystem/JKernel/JKRDisposer/JKRDisposer.h +++ b/include/JSystem/JKernel/JKRDisposer/JKRDisposer.h @@ -8,10 +8,11 @@ class JKRHeap; class JKRDisposer { public: JKRDisposer(); - ~JKRDisposer(); + virtual ~JKRDisposer(); + + virtual void callAllDisposer() = 0; public: - void** __vt; JKRHeap* heap; JSUPtrLink ptr_link; }; diff --git a/include/JSystem/JKernel/JKRHeap/asm/func_802D147C.s b/include/JSystem/JKernel/JKRDisposer/asm/func_802D147C.s index 14f91edca6..14f91edca6 100644 --- a/include/JSystem/JKernel/JKRHeap/asm/func_802D147C.s +++ b/include/JSystem/JKernel/JKRDisposer/asm/func_802D147C.s diff --git a/include/JSystem/JKernel/JKRHeap/JKRHeap.h b/include/JSystem/JKernel/JKRHeap/JKRHeap.h index 3658a02c35..509bde938b 100644 --- a/include/JSystem/JKernel/JKRHeap/JKRHeap.h +++ b/include/JSystem/JKernel/JKRHeap/JKRHeap.h @@ -1,3 +1,5 @@ +#ifndef __JKRHEAP_H__ +#define __JKRHEAP_H__ #include "dolphin/types.h" #include "JSystem/JKernel/JKRDisposer/JKRDisposer.h" @@ -6,11 +8,11 @@ typedef void (*JKRErrorHandler)(void*, unsigned long, int); class JKRHeap : JKRDisposer { public: JKRHeap(void*, u32, JKRHeap*, bool); - ~JKRHeap(); + virtual ~JKRHeap(); static bool initArena(char**, u32*, int); - void becomeSystemHeap(); - void becomeCurrentHeap(); + JKRHeap* becomeSystemHeap(); + JKRHeap* becomeCurrentHeap(); void destroy(); static void* alloc(u32 size, int alignment, JKRHeap* heap); @@ -19,7 +21,6 @@ class JKRHeap : JKRDisposer { static void free(void* ptr, JKRHeap* heap); void free(void* ptr); - void callAllDisposer(); void freeAll(); void freeTail(); @@ -30,17 +31,17 @@ class JKRHeap : JKRDisposer { s32 getSize(void* ptr); s32 getFreeSize(); - u32 getMaxFreeBlock(); - u32 getTotalFreeSize(); + s32 getMaxFreeBlock(); + s32 getTotalFreeSize(); u8 changeGroupID(u8 param_1); - u32 getMaxAllocatableSize(int alignment); + s32 getMaxAllocatableSize(int alignment); static JKRHeap* findFromRoot(void* ptr); JKRHeap* find(void* ptr) const; JKRHeap* findAllHeap(void* ptr) const; void dispose_subroutine(u32 begin, u32 end); - void dispose(void* ptr, u32 size); + bool dispose(void* ptr, u32 size); void dispose(void* begin, void* end); void dispose(); @@ -52,6 +53,29 @@ class JKRHeap : JKRDisposer { bool isSubHeap(JKRHeap* heap) const; + protected: + void callAllDisposer(); + virtual void vt_func4() = 0; + virtual void vt_func5() = 0; + virtual void dump_sort(); + virtual void vt_func7() = 0; + virtual void do_destroy() = 0; + virtual void* do_alloc(u32 size, int alignment) = 0; + virtual void do_free(void* ptr) = 0; + virtual void do_freeAll() = 0; + virtual void do_freeTail() = 0; + virtual void vt_func13() = 0; + virtual s32 do_resize(void* ptr, u32 size) = 0; + virtual s32 do_getSize(void* ptr) = 0; + virtual s32 do_getFreeSize() = 0; + virtual s32 do_getMaxFreeBlock() = 0; + virtual s32 do_getTotalFreeSize() = 0; + virtual u8 do_changeGroupID(u8 param_1); + virtual void do_getCurrent(); + virtual void state_register(); + virtual void state_compare(); + virtual void state_dump(); + public: u8 mutex[24]; u32 begin; @@ -64,8 +88,9 @@ class JKRHeap : JKRDisposer { JSUPtrList child_list; JSUPtrLink heap_link; JSUPtrList disposable_list; - bool error_handler; + bool error_flag; u8 field_0x69; + u8 field_0x6a[2]; }; void* operator new(u32 size); @@ -77,4 +102,6 @@ void* operator new[](u32 size, int alignment); void* operator new[](u32 size, JKRHeap* heap, int alignment); void operator delete(void* ptr); -void operator delete[](void* ptr);
\ No newline at end of file +void operator delete[](void* ptr); + +#endif
\ No newline at end of file diff --git a/include/JSystem/JSupport/JSUList/JSUList.h b/include/JSystem/JSupport/JSUList/JSUList.h index c0b145f223..eb57f70984 100644 --- a/include/JSystem/JSupport/JSUList/JSUList.h +++ b/include/JSystem/JSupport/JSUList/JSUList.h @@ -6,11 +6,11 @@ class JSUPtrList; class JSUPtrLink { public: - JSUPtrLink(void*); + JSUPtrLink(void* owner); ~JSUPtrLink(); public: - void* unk0; + void* owner; JSUPtrList* list; JSUPtrLink* prev; JSUPtrLink* next; @@ -35,13 +35,24 @@ class JSUPtrList { u32 length; }; - template <typename T> class JSUList : JSUPtrList { public: - JSUList() : JSUPtrList(true) {} - ~JSUList() {}; + JSUList() : JSUPtrList(true) { + } + ~JSUList(){}; + + void append(T* value) { + list.append(&value->ptr_link); + } + + void prepend(T* value) { + list.prepend(&value->ptr_link); + } + void remove(T* value) { + list.remove(&value->ptr_link); + } }; #endif diff --git a/include/SComponent/c_list.h b/include/SComponent/c_list.h new file mode 100644 index 0000000000..7a7e6066c0 --- /dev/null +++ b/include/SComponent/c_list.h @@ -0,0 +1,24 @@ + +#ifndef SCOMPONENT_C_LIST_H +#define SCOMPONENT_C_LIST_H + +#include "SComponent/c_node.h" + +struct node_list_class { + node_class *mpHead; + node_class *mpTail; + int mSize; +}; + +extern "C" { + +void cLs_Init(node_list_class *pList); +int cLs_SingleCut(node_class *pNode); +int cLs_Addition(node_list_class *pList, node_class *pNode); +int cLs_Insert(node_list_class *pList, int idx, node_class *pNode); +node_class * cLs_GetFirst(node_list_class *pList); +void cLs_Create(node_list_class *pList); + +}; + +#endif diff --git a/include/SComponent/c_list_iter.h b/include/SComponent/c_list_iter.h new file mode 100644 index 0000000000..06c06590a9 --- /dev/null +++ b/include/SComponent/c_list_iter.h @@ -0,0 +1,15 @@ + +#ifndef SCOMPONENT_C_LIST_ITER_H +#define SCOMPONENT_C_LIST_ITER_H + +#include "SComponent/c_list.h" +#include "SComponent/c_node_iter.h" + +extern "C" { + +int cLsIt_Method(node_list_class *pList, cNdIt_MethodFunc pMethod, void *pUserData); +void * cLsIt_Judge(node_list_class *pList, cNdIt_JudgeFunc pJudge, void *pUserData); + +}; + +#endif diff --git a/include/SComponent/c_node.h b/include/SComponent/c_node.h new file mode 100644 index 0000000000..73573c0bae --- /dev/null +++ b/include/SComponent/c_node.h @@ -0,0 +1,29 @@ + +#ifndef SCOMPONENT_C_NODE_H +#define SCOMPONENT_C_NODE_H + +struct node_class { + node_class *mpPrevNode; + void *mpData; + node_class *mpNextNode; +}; + +extern "C" { + +void cNd_Join(node_class *pA, node_class *pB); +int cNd_LengthOf(node_class *pNode); +node_class * cNd_First(node_class *pNode); +node_class * cNd_Last(node_class *pNode); +node_class * cNd_Order(node_class *pNode, int idx); +void cNd_SingleCut(node_class *pNode); +void cNd_Cut(node_class *pNode); +void cNd_Addition(node_class *pA, node_class *pB); +void cNd_Insert(node_class *pA, node_class *pB); +void cNd_SetObject(node_class *pNode, void *pData); +void cNd_ClearObject(node_class *pNode); +void cNd_ForcedClear(node_class *pNode); +void cNd_Create(node_class *pNode, void *pData); + +}; + +#endif diff --git a/include/SComponent/c_node_iter.h b/include/SComponent/c_node_iter.h new file mode 100644 index 0000000000..8d76321c05 --- /dev/null +++ b/include/SComponent/c_node_iter.h @@ -0,0 +1,17 @@ + +#ifndef SCOMPONENT_C_NODE_ITER_H +#define SCOMPONENT_C_NODE_ITER_H + +#include "SComponent/c_node.h" + +extern "C" { + +typedef int (*cNdIt_MethodFunc)(node_class *pNode, void *pUserData); +int cNdIt_Method(node_class *pNode, cNdIt_MethodFunc pMethod, void *pUserData); + +typedef void * (*cNdIt_JudgeFunc)(node_class *pNode, void *pUserData); +void * cNdIt_Judge(node_class *pNode, cNdIt_JudgeFunc pJudge, void *pUserData); + +}; + +#endif diff --git a/include/SComponent/c_phase.h b/include/SComponent/c_phase.h new file mode 100644 index 0000000000..c923711dd4 --- /dev/null +++ b/include/SComponent/c_phase.h @@ -0,0 +1,32 @@ + +#ifndef SCOMPONENT_C_PHASE_H +#define SCOMPONENT_C_PHASE_H + +typedef int (*cPhs__Handler)(void *); + +enum cPhs__Step { + cPhs_ZERO_e = 0x00, + // names from Wind Waker debug strings + cPhs_COMPLEATE_e = 0x04, + cPhs_ERROR_e = 0x05, + cPhs_NEXT_e = 0x06, +}; + +struct request_of_phase_process_class { + cPhs__Handler *mpHandlerTable; + int mPhaseStep; +}; + +extern "C" { + +void cPhs_Reset(request_of_phase_process_class *pPhase); +void cPhs_Set(request_of_phase_process_class *pPhase, cPhs__Handler *pHandlerTable); +void cPhs_UnCompleate(request_of_phase_process_class *pPhase); +int cPhs_Compleate(request_of_phase_process_class *pPhase); +int cPhs_Next(request_of_phase_process_class *pPhase); +int cPhs_Do(request_of_phase_process_class *pPhase, void *pUserData); +int cPhs_Handler(request_of_phase_process_class *pPhase, cPhs__Handler *pHandlerTable, void *pUserData); + +}; + +#endif diff --git a/include/SComponent/c_tag.h b/include/SComponent/c_tag.h new file mode 100644 index 0000000000..2c73b3ab10 --- /dev/null +++ b/include/SComponent/c_tag.h @@ -0,0 +1,28 @@ + +#ifndef SCOMPONENT_C_TAG_H +#define SCOMPONENT_C_TAG_H + +#include "global.h" +#include "SComponent/c_node.h" +#include "SComponent/c_list.h" +#include "SComponent/c_tree.h" + +struct create_tag_class : public node_class { + void *mpTagData; + s8 mbIsUse; +}; + +extern "C" { + +int cTg_IsUse(create_tag_class *pTag); +int cTg_SingleCutFromTree(create_tag_class *pTag); +int cTg_AdditionToTree(node_lists_tree_class *pTree, int listIdx, create_tag_class *pTag); +int cTg_InsertToTree(node_lists_tree_class *pTree, int listIdx, create_tag_class *pTag, int idx); +node_class * cTg_GetFirst(node_list_class *pTag); +int cTg_SingleCut(create_tag_class *pTag); +int cTg_Addition(node_list_class *pList, create_tag_class *pTag); +void cTg_Create(create_tag_class *pTag, void *pData); + +}; + +#endif diff --git a/include/SComponent/c_tag_iter.h b/include/SComponent/c_tag_iter.h new file mode 100644 index 0000000000..b750ac9c76 --- /dev/null +++ b/include/SComponent/c_tag_iter.h @@ -0,0 +1,25 @@ + +#ifndef SCOMPONENT_C_TAG_ITER_H +#define SCOMPONENT_C_TAG_ITER_H + +#include "SComponent/c_tag.h" +#include "SComponent/c_node_iter.h" + +struct method_filter { + cNdIt_MethodFunc mpMethodFunc; + void *mpUserData; +}; + +struct judge_filter { + cNdIt_JudgeFunc mpJudgeFunc; + void *mpUserData; +}; + +extern "C" { + +int cTgIt_MethodCall(create_tag_class *pTag, method_filter *pMethodFilter); +void * cTgIt_JudgeFilter(create_tag_class *pTag, judge_filter *pJudgeFilter); + +}; + +#endif diff --git a/include/SComponent/c_tree.h b/include/SComponent/c_tree.h new file mode 100644 index 0000000000..215b5a58e4 --- /dev/null +++ b/include/SComponent/c_tree.h @@ -0,0 +1,23 @@ + +#ifndef SCOMPONENT_C_TREE_H +#define SCOMPONENT_C_TREE_H + +#include "global.h" +#include "SComponent/c_list.h" +#include "SComponent/c_node.h" + +struct node_lists_tree_class { + node_list_class *mpLists; + int mNumLists; +}; + +extern "C" { + +int cTr_SingleCut(node_class *pNode); +int cTr_Addition(node_lists_tree_class *pTree, int listIdx, node_class *pNode); +int cTr_Insert(node_lists_tree_class *pTree, int listIdx, node_class *pNode, int idx); +void cTr_Create(node_lists_tree_class *pTree, node_list_class *pLists, int numLists); + +}; + +#endif diff --git a/include/SComponent/c_tree_iter.h b/include/SComponent/c_tree_iter.h new file mode 100644 index 0000000000..0334500efe --- /dev/null +++ b/include/SComponent/c_tree_iter.h @@ -0,0 +1,15 @@ + +#ifndef SCOMPONENT_C_TREE_ITER_H +#define SCOMPONENT_C_TREE_ITER_H + +#include "SComponent/c_tree.h" +#include "SComponent/c_node_iter.h" + +extern "C" { + +int cTrIt_Method(node_lists_tree_class *pTree, cNdIt_MethodFunc pJudgeFunc, void *pUserData); +void * cTrIt_Judge(node_lists_tree_class *pTree, cNdIt_JudgeFunc pJudgeFunc, void *pUserData); + +}; + +#endif diff --git a/include/dolphin/types.h b/include/dolphin/types.h index c8b061e796..57efce338f 100644 --- a/include/dolphin/types.h +++ b/include/dolphin/types.h @@ -29,6 +29,6 @@ typedef int BOOL; #define TRUE 1 #define FALSE 0 -#define NULL ((void*)0) +#define NULL (0) #endif
\ No newline at end of file diff --git a/include/f/f_pc/f_pc_base.h b/include/f/f_pc/f_pc_base.h new file mode 100644 index 0000000000..8892d236f5 --- /dev/null +++ b/include/f/f_pc/f_pc_base.h @@ -0,0 +1,43 @@ + +#ifndef F_PC_BASE_H +#define F_PC_BASE_H + +#include "global.h" +#include "SComponent/c_tag.h" +#include "f/f_pc/f_pc_line_tag.h" +#include "f/f_pc/f_pc_layer_tag.h" +#include "f/f_pc/f_pc_delete_tag.h" +#include "f/f_pc/f_pc_priority.h" + +struct create_request; +struct profile_method_class; + +struct base_process_class { + u32 mBsType; + u32 mBsPcId; + s16 mProcName; + u8 mUnk0; + u8 mUnk1; + s8 mInitState; + u8 mUnk2; + s16 mBsTypeId; + void *mpProf; + create_request *mpCtRq; + layer_management_tag_class mLyTg; + line_tag mLnTg; + delete_tag_class mDtTg; + process_priority_class mPi; + profile_method_class *mpPcMtd; + void *mpUserData; + u32 mParameters; + u32 mSubType; +}; + +extern "C" { + +extern int fpcBs_Is_JustOfType(int a, int b); +extern int fpcBs_Execute(base_process_class *pProc); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_create_iter.h b/include/f/f_pc/f_pc_create_iter.h new file mode 100644 index 0000000000..58f3a998a8 --- /dev/null +++ b/include/f/f_pc/f_pc_create_iter.h @@ -0,0 +1,14 @@ + +#ifndef F_PC_CREATE_ITER_H +#define F_PC_CREATE_ITER_H + +#include "SComponent/c_node_iter.h" + +extern "C" { + +int fpcCtIt_Method(cNdIt_MethodFunc pJudge, void *pUserData); +void * fpcCtIt_Judge(cNdIt_JudgeFunc pJudge, void *pUserData); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_create_req.h b/include/f/f_pc/f_pc_create_req.h new file mode 100644 index 0000000000..289b10123f --- /dev/null +++ b/include/f/f_pc/f_pc_create_req.h @@ -0,0 +1,46 @@ + +#ifndef F_PC_CREATE_REQ_H +#define F_PC_CREATE_REQ_H + +#include "global.h" +#include "SComponent/c_phase.h" +#include "SComponent/c_tag.h" +#include "f/f_pc/f_pc_create_tag.h" +#include "f/f_pc/f_pc_method.h" +#include "f/f_pc/f_pc_method_tag.h" + +struct base_process_class; +struct layer_class; + +struct create_request_method_class { + cPhs__Handler mpHandler; + process_method_func mpCancel; + process_method_func mpDelete; +}; + +struct create_request : public create_tag { + s8 mbIsCreating; + s8 mbIsCancelling; + process_method_tag_class mMtdTg; + create_request_method_class *mpCtRqMtd; + void *mpUnk1; + int mBsPcId; + base_process_class *mpRes; + layer_class *mpLayer; +}; + +extern "C" { + +bool fpcCtRq_isCreatingByID(create_tag *pTag, int *pId); +bool fpcCtRq_IsCreatingByID(unsigned int id); +void fpcCtRq_CreateQTo(create_request *pReq); +void fpcCtRq_ToCreateQ(create_request *pReq); +bool fpcCtRq_Delete(create_request *pReq); +bool fpcCtRq_Cancel(create_request *pReq); +int fpcCtRq_IsDoing(create_request *pReq); +void fpcCtRq_Handler(void); +create_request * fpcCtRq_Create(layer_class *pLayer, unsigned long size, create_request_method_class *pCtRqMtd); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_create_tag.h b/include/f/f_pc/f_pc_create_tag.h new file mode 100644 index 0000000000..d851f02094 --- /dev/null +++ b/include/f/f_pc/f_pc_create_tag.h @@ -0,0 +1,19 @@ + +#ifndef F_PC_CREATE_TAG_H +#define F_PC_CREATE_TAG_H + +#include "global.h" +#include "SComponent/c_tag.h" + +struct create_tag : public create_tag_class { +}; + +extern "C" { + +void fpcCtTg_ToCreateQ(create_tag_class *pTag); +void fpcCtTg_CreateQTo(create_tag_class *pTag); +int fpcCtTg_Init(create_tag *pTag, void *pUserData); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_creator.h b/include/f/f_pc/f_pc_creator.h new file mode 100644 index 0000000000..8a0a171b85 --- /dev/null +++ b/include/f/f_pc/f_pc_creator.h @@ -0,0 +1,18 @@ + +#ifndef F_PC_CREATOR_H +#define F_PC_CREATOR_H + +#include "global.h" + +struct base_process_class; + +extern "C" { + +bool fpcCt_IsCreatingByID(unsigned int id); +int fpcCt_IsDoing(base_process_class *pProc); +void fpcCt_Abort(base_process_class *pProc); +void fpcCt_Handler(void); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_delete_tag.h b/include/f/f_pc/f_pc_delete_tag.h new file mode 100644 index 0000000000..767a8e5cb9 --- /dev/null +++ b/include/f/f_pc/f_pc_delete_tag.h @@ -0,0 +1,27 @@ + +#ifndef F_PC_DELETE_TAG_H +#define F_PC_DELETE_TAG_H + +#include "global.h" +#include "SComponent/c_tag.h" + +struct layer_class; + +typedef int (*delete_tag_func)(void*); + +struct delete_tag_class : public create_tag_class { + layer_class *mpLayer; + s16 mTimer; +}; + +extern "C" { + +bool fpcDtTg_IsEmpty(delete_tag_class *pTag); +void fpcDtTg_ToDeleteQ(delete_tag_class *pTag); +void fpcDtTg_DeleteQTo(delete_tag_class *pTag); +int fpcDtTg_Do(delete_tag_class *pTag, delete_tag_func pFunc); +int fpcDtTg_Init(delete_tag_class *pTag, void *pUserData); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_deletor.h b/include/f/f_pc/f_pc_deletor.h new file mode 100644 index 0000000000..90cf677220 --- /dev/null +++ b/include/f/f_pc/f_pc_deletor.h @@ -0,0 +1,19 @@ + +#ifndef F_PC_DELETOR_H +#define F_PC_DELETOR_H + +#include "global.h" + +struct base_process_class; + +extern "C" { + +bool fpcDt_IsComplete(void); +int fpcDt_ToDeleteQ(base_process_class *pProc); +int fpcDt_ToQueue(base_process_class *pProc); +void fpcDt_Handler(void); +int fpcDt_Delete(base_process_class *pProc); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_draw_priority.h b/include/f/f_pc/f_pc_draw_priority.h new file mode 100644 index 0000000000..fab5b3e711 --- /dev/null +++ b/include/f/f_pc/f_pc_draw_priority.h @@ -0,0 +1,17 @@ + +#ifndef F_PC_DRAW_PRIORITY_H +#define F_PC_DRAW_PRIORITY_H + +struct draw_priority_class { + short mPriority; +}; + +extern "C" { + +int fpcDwPi_Get(draw_priority_class *pDwPi); +void fpcDwPi_Set(draw_priority_class *pDwPi, int p); +void fpcDwPi_Init(draw_priority_class *pDwPi, int p); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_executor.h b/include/f/f_pc/f_pc_executor.h new file mode 100644 index 0000000000..ffffa1b3dd --- /dev/null +++ b/include/f/f_pc/f_pc_executor.h @@ -0,0 +1,18 @@ + +#ifndef F_PC_EXECUTOR_H +#define F_PC_EXECUTOR_H + +#include "SComponent/c_node_iter.h" + +struct base_process_class; + +extern "C" { + +int fpcEx_ToLineQ(base_process_class *pProc); +int fpcEx_ExecuteQTo(base_process_class *pProc); +int fpcEx_ToExecuteQ(base_process_class *pProc); +void fpcEx_Handler(cNdIt_MethodFunc pFunc); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_layer.h b/include/f/f_pc/f_pc_layer.h new file mode 100644 index 0000000000..b9076b441c --- /dev/null +++ b/include/f/f_pc/f_pc_layer.h @@ -0,0 +1,54 @@ + +#ifndef F_PC_LAYER_H +#define F_PC_LAYER_H + +#include "global.h" +#include "SComponent/c_node.h" +#include "SComponent/c_tree.h" +#include "SComponent/c_tag.h" + +struct process_method_tag_class; +struct process_node_class; + +struct layer_class : public node_class { + u32 mLayerID; + node_lists_tree_class mNodeListTree; + process_node_class *mpPcNode; + node_lists_tree_class mCancelListTree; + void *mpUnk0; + short mCreatingCount; + short mDeletingCount; +}; + +extern "C" { + +void fpcLy_SetCurrentLayer(layer_class *pLayer); +layer_class * fpcLy_CurrentLayer(void); +layer_class * fpcLy_RootLayer(void); +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); +void fpcLy_CreatingMesg(layer_class *pLayer); +void fpcLy_DeletedMesg(layer_class *pLayer); +void fpcLy_DeletingMesg(layer_class *pLayer); +int fpcLy_IsCreatingMesg(layer_class *pLayer); +int fpcLy_IsDeletingMesg(layer_class *pLayer); + +void fpcLy_IntoQueue(layer_class *pLayer, int treeListIdx, create_tag_class *pTag, int idx); +void fpcLy_ToQueue(layer_class *pLayer, int treeListIdx, create_tag_class *pTag); +void fpcLy_QueueTo(layer_class *pLayer, create_tag_class *pTag); + +void fpcLy_Cancel(layer_class *pLayer); +int fpcLy_CancelMethod(layer_class *pLayer); + +void fpcLy_CancelQTo(process_method_tag_class *pMthd); +void fpcLy_ToCancelQ(layer_class *pLayer, process_method_tag_class *pMthd); + +void fpcLy_Create(layer_class *pLayer, void *pPcNode, node_list_class *pLists, int listNum); +void fpcLy_Delete(layer_class *pLayer); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_layer_tag.h b/include/f/f_pc/f_pc_layer_tag.h new file mode 100644 index 0000000000..137deb040c --- /dev/null +++ b/include/f/f_pc/f_pc_layer_tag.h @@ -0,0 +1,16 @@ + +#ifndef F_PC_LAYER_TAG_H +#define F_PC_LAYER_TAG_H + +#include "global.h" +#include "SComponent/c_tag.h" + +struct layer_class; + +struct layer_management_tag_class : public create_tag_class { + layer_class *mpLayer; + s16 mNodeListID; + s16 mNodeListIdx; +}; + +#endif diff --git a/include/f/f_pc/f_pc_leaf.h b/include/f/f_pc/f_pc_leaf.h new file mode 100644 index 0000000000..5d31ecf2cb --- /dev/null +++ b/include/f/f_pc/f_pc_leaf.h @@ -0,0 +1,28 @@ + +#ifndef F_PC_LEAF_H +#define F_PC_LEAF_H + +#include "f/f_pc/f_pc_base.h" +#include "f/f_pc/f_pc_draw_priority.h" +#include "f/f_pc/f_pc_method.h" + +struct leafdraw_method_class : public process_method_class { + process_method_func mpDrawFunc; +}; + +struct leafdraw_class : public base_process_class { + leafdraw_method_class *mpDrawMtd; + u8 mbUnk0; + u8 mbUnk1; + draw_priority_class mDwPi; +}; + +extern "C" { + +int fpcLf_GetPriority(leafdraw_class *pLeaf); +int fpcLf_DrawMethod(leafdraw_method_class *pMthd, void *pUserData); +int fpcLf_Draw(leafdraw_class *pMthd); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_line_iter.h b/include/f/f_pc/f_pc_line_iter.h new file mode 100644 index 0000000000..1373bb3217 --- /dev/null +++ b/include/f/f_pc/f_pc_line_iter.h @@ -0,0 +1,13 @@ + +#ifndef F_PC_LINE_ITER_H +#define F_PC_LINE_ITER_H + +#include "SComponent/c_node_iter.h" + +extern "C" { + +void fpcLnIt_Queue(cNdIt_MethodFunc pFunc); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_line_tag.h b/include/f/f_pc/f_pc_line_tag.h new file mode 100644 index 0000000000..8ee5d49e85 --- /dev/null +++ b/include/f/f_pc/f_pc_line_tag.h @@ -0,0 +1,20 @@ + +#ifndef F_PC_LINE_TAG_H +#define F_PC_LINE_TAG_H + +#include "SComponent/c_tag.h" + +struct line_tag : public create_tag_class { + int mLineListID; +}; + +extern "C" { + +int fpcLnTg_Move(line_tag *pLineTag, int newLineListID); +void fpcLnTg_QueueTo(line_tag *pLineTag); +int 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_load.h b/include/f/f_pc/f_pc_load.h new file mode 100644 index 0000000000..8989ff6a01 --- /dev/null +++ b/include/f/f_pc/f_pc_load.h @@ -0,0 +1,16 @@ + +#ifndef F_PC_LOAD_H +#define F_PC_LOAD_H + +#include "global.h" + +extern "C" { + +bool fpcLd_Use(u16 procName); +int fpcLd_IsLoaded(u16 procName); +void fpcLd_Free(u16 procName); +int fpcLd_Load(u16 procName); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_method.h b/include/f/f_pc/f_pc_method.h new file mode 100644 index 0000000000..6ff4ab121c --- /dev/null +++ b/include/f/f_pc/f_pc_method.h @@ -0,0 +1,24 @@ + +#ifndef F_PC_METHOD_H +#define F_PC_METHOD_H + +typedef int (*process_method_func)(void *); + +struct process_method_class { + process_method_func mpCreateFunc; + process_method_func mpDeleteFunc; + process_method_func mpExecuteFunc; + process_method_func mpIsDeleteFunc; +}; + +extern "C" { + +int fpcMtd_Method(process_method_func pFunc, void *pUserData); +int fpcMtd_Execute(process_method_class *pMthd, void *pUserData); +int fpcMtd_IsDelete(process_method_class *pMthd, void *pUserData); +int fpcMtd_Delete(process_method_class *pMthd, void *pUserData); +int fpcMtd_Create(process_method_class *pMthd, void *pUserData); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_method_iter.h b/include/f/f_pc/f_pc_method_iter.h new file mode 100644 index 0000000000..4cabf574da --- /dev/null +++ b/include/f/f_pc/f_pc_method_iter.h @@ -0,0 +1,13 @@ + +#ifndef F_PC_METHOD_ITER_H +#define F_PC_METHOD_ITER_H + +#include "SComponent/c_list_iter.h" + +extern "C" { + +void fpcMtdIt_Method(node_list_class *pList, cNdIt_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 new file mode 100644 index 0000000000..dd979ab33f --- /dev/null +++ b/include/f/f_pc/f_pc_method_tag.h @@ -0,0 +1,21 @@ + +#ifndef F_PC_METHOD_TAG_H +#define F_PC_METHOD_TAG_H + +#include "SComponent/c_tag.h" + +typedef int (*process_method_tag_func)(void *); + +struct process_method_tag_class : public create_tag_class { + process_method_tag_func mpFunc; + void *mpMthdData; +}; + +extern "C" { + +void fpcMtdTg_MethodQTo(process_method_tag_class *pMthd); +int fpcMtdTg_Init(process_method_tag_class *pMthd, process_method_tag_func pFunc, void *pMthdData); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_node.h b/include/f/f_pc/f_pc_node.h new file mode 100644 index 0000000000..9c840127a5 --- /dev/null +++ b/include/f/f_pc/f_pc_node.h @@ -0,0 +1,23 @@ + +#ifndef F_PC_NODE_H +#define F_PC_NODE_H + +#include "f/f_pc/f_pc_base.h" +#include "f/f_pc/f_pc_method.h" +#include "f/f_pc/f_pc_layer.h" + +struct process_node_class : public base_process_class { + process_method_class *mpNodeMtd; + layer_class mLayer; + node_list_class mLayerNodeLists[16]; + u8 mUnk0; +}; + +extern "C" { + +int fpcNd_Create(process_node_class *pNode); +bool fpcNd_IsDeleteTiming(void); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_priority.h b/include/f/f_pc/f_pc_priority.h new file mode 100644 index 0000000000..ce6cf40799 --- /dev/null +++ b/include/f/f_pc/f_pc_priority.h @@ -0,0 +1,32 @@ + +#ifndef F_PC_PRIORITY_H +#define F_PC_PRIORITY_H + +#include "global.h" +#include "SComponent/c_tag.h" +#include "f/f_pc/f_pc_method_tag.h" + +struct process_priority_class : public create_tag_class { + process_method_tag_class mMtdTag; + struct { + u32 mLayer; + u16 mListID; + u16 mListPrio; + } a, b; +}; + +extern "C" { + +int fpcPi_IsInQueue(process_priority_class *pProc); +int fpcPi_QueueTo(process_priority_class *pProc); +int fpcPi_ToQueue(process_priority_class *pProc); +process_priority_class * fpcPi_GetFromQueue(void); +int fpcPi_Delete(process_priority_class *pProc); +int fpcPi_IsNormal(process_priority_class *pProc); +int fpcPi_Change(process_priority_class *pProc, unsigned int layer, unsigned short listID, unsigned short priority); +void fpcPi_Handler(void); +int fpcPi_Init(process_priority_class *pProc, void *pUserData, unsigned int layer, unsigned short listID, unsigned short priority); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_profile.h b/include/f/f_pc/f_pc_profile.h new file mode 100644 index 0000000000..da105bf003 --- /dev/null +++ b/include/f/f_pc/f_pc_profile.h @@ -0,0 +1,13 @@ + +#ifndef F_PC_PROFILE_H +#define F_PC_PROFILE_H + +#include "global.h" + +extern "C" { + +void * fpcPf_Get(s16 profileID); + +}; + +#endif diff --git a/include/f/f_pc/f_pc_searcher.h b/include/f/f_pc/f_pc_searcher.h new file mode 100644 index 0000000000..2362b90244 --- /dev/null +++ b/include/f/f_pc/f_pc_searcher.h @@ -0,0 +1,16 @@ + +#ifndef F_PC_SEARCHER_H +#define F_PC_SEARCHER_H + +#include "global.h" + +struct base_process_class; + +extern "C" { + +void * fpcSch_JudgeForPName(base_process_class *pProc, void *pUserData); +void * fpcSch_JudgeByID(base_process_class *pProc, void *pUserData); + +}; + +#endif diff --git a/include/functions.h b/include/functions.h index 9964ef5f92..31b0d05146 100644 --- a/include/functions.h +++ b/include/functions.h @@ -156,12 +156,7 @@ extern "C" { // OS extern "C" { - void OSInitMutex(void); - void OSGetArenaLo(void); - void OSGetArenaHi(void); - void OSInitAlloc(void); - void OSSetArenaLo(void); - void OSSetArenaHi(void); + void OSInitMutex(u8[24]); void OSEnableScheduler(void); void OSDisableScheduler(void); void OSCheckActiveThreads(void); @@ -178,6 +173,12 @@ extern "C" { void OSReportInit(void); void OSGetCurrentThread(void); void OSTicksToCalendarTime(void); + + u32 OSGetArenaLo(); + u32 OSGetArenaHi(); + u32 OSInitAlloc(u32 low, u32 high, int param_3); + void OSSetArenaLo(u32 param_1); + void OSSetArenaHi(u32 param_1); } // DVD diff --git a/include/global.h b/include/global.h index 3e1e96deb1..10e453b8d9 100644 --- a/include/global.h +++ b/include/global.h @@ -1,6 +1,8 @@ #ifndef _global_h_ #define _global_h_ +#define ARRAY_SIZE(o) (sizeof((o)) / sizeof(*(o))) + #include "dolphin/types.h" #include "functions.h" diff --git a/include/variables.h b/include/variables.h index 838f15c9a6..65082f66d2 100644 --- a/include/variables.h +++ b/include/variables.h @@ -81,11 +81,12 @@ extern u8 lbl_803BB498; #define _SDA2_BASE_(dummy) 0 // func_802CE138 -extern u32 lbl_803CBF70[24]; +extern void* lbl_803CBF70; // JKRHeap::__vt -extern void* lbl_80451370; // JKRHeap::sSystemHeap -extern void* lbl_80451378; // JKRHeap::sRootHeap -extern void* lbl_80451374; // JKRHeap::sCurrentHeap +class JKRHeap; +extern JKRHeap* lbl_80451370; // JKRHeap::sSystemHeap +extern JKRHeap* lbl_80451378; // JKRHeap::sRootHeap +extern JKRHeap* lbl_80451374; // JKRHeap::sCurrentHeap extern void* lbl_8045137C; // JKRHeap::mErrorHandler extern u8 lbl_804508B0[8]; // ::*fill* @@ -98,9 +99,14 @@ extern void* lbl_8045138C; // JKRHeap::mUserRamStart extern void* lbl_80451390; // JKRHeap::mUserRamEnd extern u32 lbl_80451394; // JKRHeap::mMemorySize +extern u8 lbl_80000000; +extern u32 lbl_80000028; + +#define OS_GLOBAL(T, ADDR) *((T*)((void*)ADDR)) +#define OS_GLOBAL_ADDR(T, ADDR) ((T*)((void*)ADDR)) // func_802CEB40 extern char lbl_8039CAD8[12]; // "JKRHeap.cpp" // func_802D147C -extern void* lbl_803CC0F0[4]; // JKRDisposer::__vt
\ No newline at end of file +extern void* lbl_803CC0F0; // JKRDisposer::__vt
\ No newline at end of file |
