diff --git a/src/main.c b/src/main.c index d623211f86..bc83beb56d 100644 --- a/src/main.c +++ b/src/main.c @@ -2,7 +2,7 @@ #include "nu/nusys.h" // TODO move these somewhere else... -u8 nuYieldBuf[NU_GFX_YIELD_BUF_SIZE]; +u8 nuYieldBuf[NU_GFX_YIELD_BUF_SIZE] ALIGNED(16); OSThread __osThreadSave; u8 nuBootStack[0x2000] ALIGNED(8); diff --git a/src/os/nusys/nugfxtaskmgr.c b/src/os/nusys/nugfxtaskmgr.c index 16e3284ed6..abb54781f3 100644 --- a/src/os/nusys/nugfxtaskmgr.c +++ b/src/os/nusys/nugfxtaskmgr.c @@ -14,8 +14,8 @@ static u64 GfxTaskMgrStack[NU_GFX_TASKMGR_STACK_SIZE / sizeof(u64)] ALIGNED(16); static OSMesg D_8009E6D0[NU_GFX_TASKMGR_MESGS]; NUScTask nuGfxTask[NU_GFX_TASK_NUM]; -u64 D_800DA040[0x400 / sizeof(u64)]; -s32 D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)]; +u64 D_800DA040[0x400 / sizeof(u64)] ALIGNED(16); +s32 D_800B91D0[NU_GFX_RDP_OUTPUTBUFF_SIZE / sizeof(u32)] ALIGNED(16); extern u8 rspbootUcodeBuffer[]; diff --git a/src/os/sptask.c b/src/os/sptask.c index ed900e721e..e83944c9cc 100644 --- a/src/os/sptask.c +++ b/src/os/sptask.c @@ -31,6 +31,25 @@ static OSTask* _VirtualToPhysicalTask(OSTask* intp) { void osSpTaskLoad(OSTask *intp) { OSTask *tp; +#ifdef _DEBUG + if ((intp->t.dram_stack != 0x0) && ((u32)intp->t.dram_stack & 0xf)) { + __osError(ERR_OSSPTASKLOAD_DRAM, 1, intp->t.dram_stack); + return; + } + if ((intp->t.output_buff != 0x0) && ((u32)intp->t.output_buff & 0xf)) { + __osError(ERR_OSSPTASKLOAD_OUT, 1, intp->t.output_buff); + return; + } + if ((intp->t.output_buff_size != 0x0) && ((u32)intp->t.output_buff_size & 0xf)) { + __osError(ERR_OSSPTASKLOAD_OUTSIZE, 1, intp->t.output_buff_size); + return; + } + if ((intp->t.yield_data_ptr != 0x0) && ((u32)intp->t.yield_data_ptr & 0xf)) { + __osError(ERR_OSSPTASKLOAD_YIELD, 1, intp->t.yield_data_ptr); + return; + } +#endif + #if VERSION_IQUE tp = _VirtualToPhysicalTask(intp); #else