started copying code over to new disasm

This commit is contained in:
lepelog
2021-03-30 02:45:32 +02:00
parent a868b6ae56
commit e756e1760e
35 changed files with 687 additions and 793 deletions
+14
View File
@@ -2,5 +2,19 @@
#define C_LIST_H
#include "dolphin/types.h"
#include "SSystem/SComponent/c_node.h"
typedef struct node_list_class {
node_class* mpHead;
node_class* mpTail;
int mSize;
} node_list_class;
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 /* C_LIST_H */
+5
View File
@@ -2,5 +2,10 @@
#define C_LIST_ITER_H
#include "dolphin/types.h"
#include "SSystem/SComponent/c_list.h"
#include "SSystem/SComponent/c_node_iter.h"
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 /* C_LIST_ITER_H */
+13
View File
@@ -3,4 +3,17 @@
#include "dolphin/types.h"
// TODO: move to correct include
struct JKRHeap {
/* 802CE4D4 */ void *alloc(u32, int);
/* 802CE548 */ void free(void*);
};
struct cMl {
static JKRHeap *Heap;
/* 80263220 */ static void init(JKRHeap*);
/* 80263228 */ static void *memalignB(int, u32);
/* 80263260 */ static void free(void*);
};
#endif /* C_MALLOC_H */
+13
View File
@@ -3,4 +3,17 @@
#include "dolphin/types.h"
s16 cM_rad2s(float);
u16 U_GetAtanTable(float, float);
s16 cM_atan2s(float, float);
float cM_atan2f(float, float);
void cM_initRnd(int, int, int);
float cM_rnd(void);
float cM_rndF(float);
float cM_rndFX(float);
void cM_initRnd2(int, int, int);
float cM_rnd2(void);
float cM_rndF2(float);
float cM_rndFX2(float);
#endif /* C_MATH_H */
+23
View File
@@ -3,4 +3,27 @@
#include "dolphin/types.h"
typedef struct node_class {
struct node_class* mpPrevNode;
void* mpData;
struct node_class* mpNextNode;
} node_class;
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);
#define NODE_GET_PREV(pNode) (pNode ? pNode->mpPrevNode : NULL)
#define NODE_GET_NEXT(pNode) (pNode ? pNode->mpNextNode : NULL)
#endif /* C_NODE_H */
+7
View File
@@ -2,5 +2,12 @@
#define C_NODE_ITER_H
#include "dolphin/types.h"
#include "SSystem/SComponent/c_node.h"
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 /* C_NODE_ITER_H */
+24
View File
@@ -3,4 +3,28 @@
#include "dolphin/types.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,
};
typedef struct request_of_phase_process_class {
cPhs__Handler* mpHandlerTable;
int mPhaseStep;
} request_of_phase_process_class;
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 /* C_PHASE_H */
+18
View File
@@ -2,5 +2,23 @@
#define C_TAG_H
#include "dolphin/types.h"
#include "SSystem/SComponent/c_list.h"
#include "SSystem/SComponent/c_node.h"
#include "SSystem/SComponent/c_tree.h"
typedef struct create_tag_class {
node_class mpNode;
void* mpTagData;
s8 mbIsUse;
} create_tag_class;
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 /* C_TAG_H */
+16
View File
@@ -2,5 +2,21 @@
#define C_TAG_ITER_H
#include "dolphin/types.h"
#include "SSystem/SComponent/c_node_iter.h"
#include "SSystem/SComponent/c_tag.h"
typedef struct method_filter {
cNdIt_MethodFunc mpMethodFunc;
void* mpUserData;
} method_filter;
typedef struct judge_filter {
cNdIt_JudgeFunc mpJudgeFunc;
void* mpUserData;
} judge_filter;
int cTgIt_MethodCall(create_tag_class* pTag, method_filter* pMethodFilter);
void* cTgIt_JudgeFilter(create_tag_class* pTag, judge_filter* pJudgeFilter);
#endif /* C_TAG_ITER_H */
+12
View File
@@ -2,5 +2,17 @@
#define C_TREE_H
#include "dolphin/types.h"
#include "SSystem/SComponent/c_list.h"
#include "SSystem/SComponent/c_node.h"
typedef struct node_lists_tree_class {
node_list_class* mpLists;
int mNumLists;
} node_lists_tree_class;
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 /* C_TREE_H */
+6
View File
@@ -2,5 +2,11 @@
#define C_TREE_ITER_H
#include "dolphin/types.h"
#include "SSystem/SComponent/c_node_iter.h"
#include "SSystem/SComponent/c_tree.h"
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 /* C_TREE_ITER_H */