diff options
| author | Rozelette <Rozelette@users.noreply.github.com> | 2021-04-19 16:44:12 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-19 17:44:12 -0400 |
| commit | e97f10a6fa573e8b817ed03a4674d52b1818dafa (patch) | |
| tree | 25821c9094c4aea2f1ad167c6227d2d2afbcd3f2 /include | |
| parent | 768ca0839b862f1eff09661d9b20af51f70a738e (diff) | |
sys_slowly OK (#101)
* sys_slowly OK
* Feedback
* rename type member
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 8 | ||||
| -rw-r--r-- | include/variables.h | 2 | ||||
| -rw-r--r-- | include/z64.h | 39 |
3 files changed, 35 insertions, 14 deletions
diff --git a/include/functions.h b/include/functions.h index 1f91e1cf9..0ade16d9d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -3456,10 +3456,10 @@ void func_80183070(void); // void func_801850A0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); // void func_801853C8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void func_80185460(void); -void Slowly_Main(s8018571C* iParm1); -void Slowly_ThreadEntry(s8018571C* param_1); -// void Slowly_Start(s8018571C* param_1, s32* stack, UNK_TYPE4 param_3, s32 param_4, s32 param_5); -// void func_801857A0(void); +//void Slowly_Main(SlowlyTask* slowly); +//void Slowly_ThreadEntry(SlowlyTask* slowly); +void Slowly_Start(SlowlyTask* slowly, void* stack, void (*callback)(), void* callbackArg0, void* callbackArg1); +void Slowly_Stop(SlowlyTask* slowly); // void func_801857C0(void); // char* func_801857D0(void); // void func_80185864(void); diff --git a/include/variables.h b/include/variables.h index 3c04b85c3..acd23dfa3 100644 --- a/include/variables.h +++ b/include/variables.h @@ -4096,7 +4096,7 @@ extern Color_RGBA8 D_801F6D30; // extern UNK_TYPE1 D_801F6D50; extern u8 D_801F6DFC; // extern UNK_TYPE1 D_801F6DFD; -extern s8018571C D_801F6E00; +extern SlowlyTask D_801F6E00; // extern UNK_TYPE1 D_801F6FC0; extern StackEntry slowlyStackEntry; extern u8 slowlyStack[4096]; diff --git a/include/z64.h b/include/z64.h index 80d182faa..67c05b115 100644 --- a/include/z64.h +++ b/include/z64.h @@ -38,6 +38,19 @@ #define SCREEN_WIDTH_HIGH_RES 576 #define SCREEN_HEIGHT_HIGH_RES 454 +#define Z_THREAD_ID_IDLE 1 +#define Z_THREAD_ID_SLOWLY 2 +#define Z_THREAD_ID_MAIN 3 +#define Z_THREAD_ID_DMAMGR 18 +#define Z_THREAD_ID_IRQMGR 19 + +#define Z_PRIORITY_SLOWLY 5 +#define Z_PRIORITY_GRAPH 9 +#define Z_PRIORITY_IDLE 12 +#define Z_PRIORITY_MAIN 12 +#define Z_PRIORITY_DMAMGR 17 +#define Z_PRIORITY_IRQMGR 18 + typedef struct { /* 0x0 */ s16 priority; // Lower means higher priority. -1 means it ignores priority /* 0x2 */ s16 length; @@ -456,16 +469,24 @@ typedef void(*osCreateThread_func)(void*); typedef void*(*printf_func)(void*, char*, size_t); +typedef enum { + SLOWLY_CALLBACK_NO_ARGS, + SLOWLY_CALLBACK_ONE_ARG, + SLOWLY_CALLBACK_TWO_ARGS +} SlowlyCallbackArgCount; + typedef struct { - /* 0x000 */ OSThread unk0; - /* 0x1B0 */ s8 argCount; - /* 0x1B1 */ s8 unk1B1; - /* 0x1B2 */ UNK_TYPE1 pad1B2[0x2]; - /* 0x1B4 */ UNK_TYPE1 func; - /* 0x1B5 */ UNK_TYPE1 pad1B5[0x3]; - /* 0x1B8 */ s32 arg0; - /* 0x1BC */ s32 arg1; -} s8018571C; // size = 0x1C0 + /* 0x000 */ OSThread thread; + /* 0x1B0 */ u8 callbackArgCount; + /* 0x1B1 */ u8 status; + /* 0x1B4 */ union { + void (*callback0)(void); + void (*callback1)(void*); + void (*callback2)(void*, void*); + }; + /* 0x1B8 */ void* callbackArg0; + /* 0x1BC */ void* callbackArg1; +} SlowlyTask; // size = 0x1C0 typedef struct { /* 0x00 */ int unk0; |
