diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2023-06-25 17:18:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-26 10:18:50 +1000 |
| commit | 22035890fa372f61dd9b907c2a0f9dc6bcd0ae19 (patch) | |
| tree | 82dffc7c8d27e07adecd11d3e1a481a5857c7393 /include | |
| parent | a2c2c45a0e2c35ec30cfac888a0deb92f86b8d96 (diff) | |
Idle + Main bss and cleanup (#1292)
* Idle bss and cleanup
* main bss and cleanup
* format
* Remove pad comment about sAudioMgr
* PR
* Missed a couple size_t changes
* unused pads
* static
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 7 | ||||
| -rw-r--r-- | include/idle.h | 21 | ||||
| -rw-r--r-- | include/macros.h | 1 | ||||
| -rw-r--r-- | include/main.h | 19 | ||||
| -rw-r--r-- | include/padmgr.h | 2 | ||||
| -rw-r--r-- | include/ultra64/thread.h | 2 | ||||
| -rw-r--r-- | include/variables.h | 23 | ||||
| -rw-r--r-- | include/z64audio.h | 1 | ||||
| -rw-r--r-- | include/z64thread.h | 2 |
9 files changed, 50 insertions, 28 deletions
diff --git a/include/functions.h b/include/functions.h index ac13a30f1..0e8e418b2 100644 --- a/include/functions.h +++ b/include/functions.h @@ -4,8 +4,7 @@ #include "z64.h" void bootproc(void); -void Idle_ThreadEntry(void* arg); -void ViConfig_UpdateVi(u32 mode); +void ViConfig_UpdateVi(u32 black); void ViConfig_UpdateBlack(void); s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size); s32 DmaMgr_DmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction); @@ -1514,7 +1513,7 @@ ListAlloc* ListAlloc_Init(ListAlloc* this); // void ListAlloc_Alloc(void); // void ListAlloc_Free(void); void ListAlloc_FreeAll(ListAlloc* this); -void Main(void* arg); + void Sched_SwapFramebuffer(CfbInfo* cfbInfo); void Sched_RetraceUpdateFramebuffer(SchedContext* sched, CfbInfo* cfbInfo); void Sched_HandleReset(SchedContext* sched); @@ -1536,7 +1535,7 @@ void Sched_SendAudioCancelMsg(SchedContext* sched); void Sched_SendGfxCancelMsg(SchedContext* sched); void Sched_FaultClient(void* param1, void* param2); void Sched_ThreadEntry(void* arg); -void Sched_Init(SchedContext* sched, void* stack, OSPri pri, UNK_TYPE arg3, UNK_TYPE arg4, IrqMgr* irqMgr); +void Sched_Init(SchedContext* sched, void* stack, OSPri pri, u8 viModeType, UNK_TYPE arg4, IrqMgr* irqMgr); // void func_80177390(void); void func_801773A0(void* arg0); void func_801773C4(void* arg0); diff --git a/include/idle.h b/include/idle.h new file mode 100644 index 000000000..86efabe90 --- /dev/null +++ b/include/idle.h @@ -0,0 +1,21 @@ +#ifndef IDLE_H +#define IDLE_H + +#include "ultra64.h" +#include "irqmgr.h" + +extern IrqMgr gIrqMgr; +extern OSMesgQueue gPiMgrCmdQueue; +extern OSViMode gViConfigMode; +extern u8 gViConfigModeType; + +extern u8 D_80096B20; +extern vu8 gViConfigUseBlack; +extern u8 gViConfigAdditionalScanLines; +extern u32 gViConfigFeatures; +extern f32 gViConfigXScale; +extern f32 gViConfigYScale; + +void Idle_ThreadEntry(void* arg); + +#endif diff --git a/include/macros.h b/include/macros.h index 1755a398c..f28315815 100644 --- a/include/macros.h +++ b/include/macros.h @@ -3,6 +3,7 @@ #include "libc/stdint.h" #include "ultra64/convert.h" +#include "main.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 diff --git a/include/main.h b/include/main.h new file mode 100644 index 000000000..ce794714f --- /dev/null +++ b/include/main.h @@ -0,0 +1,19 @@ +#ifndef MAIN_H +#define MAIN_H + +#include "ultra64.h" +#include "scheduler.h" +#include "padmgr.h" + +extern s32 gScreenWidth; +extern s32 gScreenHeight; +extern size_t gSystemHeapSize; + +extern u32 gSegments[NUM_SEGMENTS]; +extern SchedContext gSchedContext; +extern OSThread gGraphThread; +extern PadMgr gPadMgr; + +void Main(void* arg); + +#endif diff --git a/include/padmgr.h b/include/padmgr.h index 674c9bc4e..1a21e5052 100644 --- a/include/padmgr.h +++ b/include/padmgr.h @@ -56,8 +56,6 @@ typedef struct { /* 0x47E */ u8 isResetting; } PadMgr; // size = 0x480 -extern PadMgr gPadMgr; - // Initialization s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status); diff --git a/include/ultra64/thread.h b/include/ultra64/thread.h index 62cbdcd1b..f060ca34b 100644 --- a/include/ultra64/thread.h +++ b/include/ultra64/thread.h @@ -3,7 +3,7 @@ #include "PR/ultratypes.h" -#define OS_PRIORITY_IDLE 10 +#define OS_PRIORITY_IDLE 0 #define OS_PRIORITY_MAIN 10 #define OS_PRIORITY_GRAPH 11 #define OS_PRIORITY_AUDIOMGR 12 diff --git a/include/variables.h b/include/variables.h index 04e21ac0a..7faaf58d4 100644 --- a/include/variables.h +++ b/include/variables.h @@ -18,15 +18,8 @@ extern u16 gFramebuffer1[SCREEN_HEIGHT][SCREEN_WIDTH]; // at 0x80000500 extern u8 D_80025D00[]; // data -extern u64 rspbootTextStart[]; -extern u8 D_80096B20; -extern vu8 gViConfigUseDefault; -extern u8 gViConfigAdditionalScanLines; -extern u32 gViConfigFeatures; -extern f32 gViConfigXScale; -extern f32 gViConfigYScale; extern OSPiHandle* gCartHandle; -extern u32 sDmaMgrDmaBuffSize; +extern size_t gDmaMgrDmaBuffSize; extern vs32 gIrqMgrResetStatus; extern volatile OSTime sIrqMgrResetTime; extern volatile OSTime sIrqMgrRetraceTime; @@ -274,11 +267,6 @@ extern char gBuildTeam[]; extern char gBuildDate[]; extern char gBuildMakeOption[]; -extern IrqMgr gIrqMgr; - -extern OSViMode gViConfigMode; -extern u8 D_8009B290; - extern u8 sYaz0DataBuffer[0x400]; extern u8* sYaz0CurDataEnd; extern u32 sYaz0CurRomStart; @@ -658,9 +646,7 @@ extern Input* D_801D0D60; extern u32 retryCount; extern u32 cfbIdx[3]; -extern s32 gScreenWidth; -extern s32 gScreenHeight; -extern u32 startHeapSize; + extern UNK_PTR D_801D1540; extern Vec3f gZeroVec3f; extern Vec3s gZeroVec3s; @@ -2257,11 +2243,6 @@ extern GfxMasterList* gGfxMasterDL; extern CfbInfo sGraphCfbInfos[3]; extern OSTime sGraphTaskStartTime; -extern u32 gSegments[NUM_SEGMENTS]; -extern SchedContext gSchedContext; - -extern OSThread gGraphThread; - extern FaultClient sSchedFaultClient; extern OSTime sRSPGFXStartTime; extern OSTime sRSPAudioStartTime; diff --git a/include/z64audio.h b/include/z64audio.h index 13e3165b7..1a813409f 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -6,6 +6,7 @@ #include "audiothread_cmd.h" #include "libc/stddef.h" #include "audio/effects.h" +#include "sequence.h" #define NO_LAYER ((SequenceLayer*)(-1)) diff --git a/include/z64thread.h b/include/z64thread.h index c0baba84f..ce63cfb15 100644 --- a/include/z64thread.h +++ b/include/z64thread.h @@ -6,6 +6,8 @@ #define Z_THREAD_ID_MAIN 3 #define Z_THREAD_ID_GRAPH 4 #define Z_THREAD_ID_SCHED 5 +#define Z_THREAD_ID_PADMGR 7 +#define Z_THREAD_ID_AUDIOMGR 10 #define Z_THREAD_ID_FLASHROM 13 #define Z_THREAD_ID_DMAMGR 18 #define Z_THREAD_ID_IRQMGR 19 |
