mirror of https://github.com/zeldaret/mm.git
sys_ucode OK (#432)
* sys_ucode OK * Update file split of data * Format * Name symbols, sizes -> u32 * Correct undefined_syms * Format
This commit is contained in:
parent
9b1fe6e91b
commit
1274b81c5e
|
|
@ -3371,7 +3371,7 @@ void Matrix_InsertRotationAroundUnitVector_f(f32 rotation, Vec3f* vector, s32 ap
|
|||
void Matrix_InsertRotationAroundUnitVector_s(s16 rotation, Vec3f* vector, s32 appendToState);
|
||||
|
||||
u64* SysUcode_GetUCodeBoot(void);
|
||||
u32 SysUcode_GetUCodeBootSize(void);
|
||||
size_t SysUcode_GetUCodeBootSize(void);
|
||||
u64* SysUcode_GetUCode(void);
|
||||
u64* SysUcode_GetUCodeData(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define _SPTASK_H_
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "libc/stddef.h"
|
||||
|
||||
/* Task Types */
|
||||
#define M_NULTASK 0
|
||||
|
|
@ -80,7 +81,7 @@ typedef struct {
|
|||
/* 0x04 */ u32 flags;
|
||||
|
||||
/* 0x08 */ u64* ucodeBoot;
|
||||
/* 0x0C */ u32 ucodeBootSize;
|
||||
/* 0x0C */ u32 ucodeBootSize; // ucode will load these sizes with lw, so need to be 32-bit
|
||||
|
||||
/* 0x10 */ u64* ucode;
|
||||
/* 0x14 */ u32 ucodeSize;
|
||||
|
|
@ -101,8 +102,7 @@ typedef struct {
|
|||
/* 0x3C */ u32 yieldDataSize;
|
||||
} OSTask_t; // size = 0x40
|
||||
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
OSTask_t t;
|
||||
long long int force_structure_alignment;
|
||||
} OSTask;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ extern u16 gFramebuffer1[SCREEN_HEIGHT][SCREEN_WIDTH]; // at 0x80000500
|
|||
extern u8 D_80025D00[];
|
||||
|
||||
// data
|
||||
extern UNK_TYPE1 D_800969C0;
|
||||
extern u64 rspbootTextStart[];
|
||||
extern u8 D_80096B20;
|
||||
extern vu8 gViConfigUseDefault;
|
||||
extern u8 gViConfigAdditionalScanLines;
|
||||
|
|
@ -1636,8 +1636,8 @@ extern Vec3f D_801D15B0;
|
|||
extern Vec3s D_801D15BC;
|
||||
extern Mtx D_801D1DE0;
|
||||
extern MtxF D_801D1E20;
|
||||
extern UNK_PTR D_801D1E60;
|
||||
extern UNK_PTR D_801D1E64;
|
||||
// extern u64* initialgspUcodeText;
|
||||
// extern u64* initialgspUcodeData;
|
||||
// extern UNK_TYPE1 D_801D1E70;
|
||||
// extern UNK_TYPE1 D_801D2E80;
|
||||
// extern UNK_TYPE1 D_801D2F80;
|
||||
|
|
@ -3099,8 +3099,8 @@ extern const AudioContextInitSizes gAudioContextInitSizes;
|
|||
// extern UNK_TYPE2 D_801E1630;
|
||||
// extern UNK_TYPE1 D_801E1E40;
|
||||
// extern UNK_TYPE1 D_801E1E80;
|
||||
// extern UNK_TYPE1 D_801E2160;
|
||||
// extern UNK_TYPE1 D_801E3790;
|
||||
extern u64 gspF3DEX2_NoN_fifoTextStart[];
|
||||
extern u64 gspF3DEX2_NoN_fifoDataStart[];
|
||||
extern u64 gJpegUCodeData[];
|
||||
// extern UNK_TYPE1 D_801E3FA0;
|
||||
|
||||
|
|
@ -3413,7 +3413,7 @@ extern OSViMode* D_801FBB88;
|
|||
extern u16* gZBufferPtr;
|
||||
extern void* D_801FBB90;
|
||||
extern u64* gGfxSPTaskOutputBufferPtr;
|
||||
extern u32 gGfxSPTaskOutputBufferSize;
|
||||
extern size_t gGfxSPTaskOutputBufferSize;
|
||||
// extern UNK_TYPE1 D_801FBB9C;
|
||||
// extern UNK_TYPE1 D_801FBBA0;
|
||||
extern u16 (*gZBuffer)[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
|
|
|
|||
|
|
@ -1,9 +1,27 @@
|
|||
/*
|
||||
* File: sys_ucode.c
|
||||
* Description: Functions for obtaining locations and sizes of microcode
|
||||
*/
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBoot.s")
|
||||
extern u64 rspbootTextStart[];
|
||||
extern u64 rspbootTextEnd[];
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeBootSize.s")
|
||||
u64* initialgspUcodeText = gspF3DEX2_NoN_fifoTextStart;
|
||||
u64* initialgspUcodeData = gspF3DEX2_NoN_fifoDataStart;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCode.s")
|
||||
u64* SysUcode_GetUCodeBoot(void) {
|
||||
return rspbootTextStart;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_ucode/SysUcode_GetUCodeData.s")
|
||||
size_t SysUcode_GetUCodeBootSize(void) {
|
||||
return (uintptr_t)rspbootTextEnd - (uintptr_t)rspbootTextStart;
|
||||
}
|
||||
|
||||
u64* SysUcode_GetUCode(void) {
|
||||
return initialgspUcodeText;
|
||||
}
|
||||
|
||||
u64* SysUcode_GetUCodeData(void) {
|
||||
return initialgspUcodeData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,29 +32,23 @@ void osSpTaskLoad(OSTask* intp) {
|
|||
intp->t.flags &= ~OS_TASK_YIELDED;
|
||||
|
||||
if (tp->t.flags & OS_TASK_LOADABLE) {
|
||||
tp->t.ucode = HW_REG((u32)intp->t.yieldDataPtr + OS_YIELD_DATA_SIZE - 4, u32);
|
||||
tp->t.ucode = HW_REG((uintptr_t)intp->t.yieldDataPtr + OS_YIELD_DATA_SIZE - 4, u32);
|
||||
}
|
||||
}
|
||||
osWritebackDCache(tp, sizeof(OSTask));
|
||||
__osSpSetStatus(SP_CLR_SIG0 | SP_CLR_SIG1 | SP_CLR_SIG2 | SP_SET_INTR_BREAK);
|
||||
|
||||
while (__osSpSetPc((void*)SP_IMEM_START) == -1) {
|
||||
;
|
||||
}
|
||||
while (__osSpRawStartDma(1, (void*)(SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {
|
||||
;
|
||||
}
|
||||
while (__osSpDeviceBusy()) {
|
||||
;
|
||||
}
|
||||
while (__osSpRawStartDma(1, (void*)SP_IMEM_START, tp->t.ucodeBoot, tp->t.ucodeBootSize) == -1) {
|
||||
;
|
||||
}
|
||||
while (__osSpSetPc((void*)SP_IMEM_START) == -1) {}
|
||||
|
||||
while (__osSpRawStartDma(1, (void*)(SP_IMEM_START - sizeof(*tp)), tp, sizeof(OSTask)) == -1) {}
|
||||
|
||||
while (__osSpDeviceBusy()) {}
|
||||
|
||||
while (__osSpRawStartDma(1, (void*)SP_IMEM_START, tp->t.ucodeBoot, tp->t.ucodeBootSize) == -1) {}
|
||||
}
|
||||
|
||||
void osSpTaskStartGo(OSTask* tp) {
|
||||
while (__osSpDeviceBusy()) {
|
||||
;
|
||||
}
|
||||
while (__osSpDeviceBusy()) {}
|
||||
|
||||
__osSpSetStatus(SP_SET_INTR_BREAK | SP_CLR_SSTEP | SP_CLR_BROKE | SP_CLR_HALT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -575,6 +575,7 @@
|
|||
0x801D15B0 : "",
|
||||
0x801D15D0 : "sys_math_atan",
|
||||
0x801D1DE0 : "sys_matrix",
|
||||
0x801D1E60 : "sys_ucode",
|
||||
0x801D1E70 : "",
|
||||
0x801D2E80 : "audio_data",
|
||||
0x801D5FB0 : "audio_synthesis",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
0x8000031C:("osAppNmiBuffer","s32","[0x10]",0x40),
|
||||
0x80000500:("gFramebuffer1","u16","[SCREEN_HEIGHT][SCREEN_WIDTH]",0x25800),
|
||||
0x80025D00:("D_80025D00","u8","[]",0x1), # TODO size
|
||||
0x800969C0:("D_800969C0","UNK_TYPE1","",0x1),
|
||||
0x800969C0:("rspbootTextStart","u64","[]",0x160),
|
||||
0x80096B20:("D_80096B20","u8","",0x1),
|
||||
0x80096B24:("gViConfigUseDefault","vu8","",0x1),
|
||||
0x80096B28:("gViConfigAdditionalScanLines","u8","",0x1),
|
||||
|
|
@ -2250,8 +2250,8 @@
|
|||
0x801D15D0:("sATan2Tbl","s16","[1025]",0x802),
|
||||
0x801D1DE0:("D_801D1DE0","Mtx","",0x40),
|
||||
0x801D1E20:("D_801D1E20","MtxF","",0x40),
|
||||
0x801D1E60:("D_801D1E60","UNK_PTR","",0x4),
|
||||
0x801D1E64:("D_801D1E64","UNK_PTR","",0x4),
|
||||
0x801D1E60:("initialgspUcodeText","UNK_PTR","",0x4),
|
||||
0x801D1E64:("initialgspUcodeData","UNK_PTR","",0x4),
|
||||
0x801D1E70:("D_801D1E70","UNK_TYPE1","",0x1),
|
||||
0x801D2E80:("D_801D2E80","UNK_TYPE1","",0x1),
|
||||
0x801D2F80:("D_801D2F80","UNK_TYPE1","",0x1),
|
||||
|
|
@ -3882,8 +3882,8 @@
|
|||
0x801E1630:("D_801E1630","UNK_TYPE2","",0x2),
|
||||
0x801E1E40:("D_801E1E40","UNK_TYPE1","",0x1),
|
||||
0x801E1E80:("D_801E1E80","UNK_TYPE1","",0x1),
|
||||
0x801E2160:("D_801E2160","UNK_TYPE1","",0x1),
|
||||
0x801E3790:("D_801E3790","UNK_TYPE1","",0x1),
|
||||
0x801E2160:("gspF3DEX2_NoN_fifoTextStart","UNK_TYPE1","",0x1),
|
||||
0x801E3790:("gspF3DEX2_NoN_fifoDataStart","UNK_TYPE1","",0x1),
|
||||
0x801E3BB0:("D_801E3BB0","UNK_TYPE1","",0x1),
|
||||
0x801E3F40:("gJpegUCodeData","UNK_TYPE1","",0x1),
|
||||
0x801E3FA0:("D_801E3FA0","UNK_TYPE1","",0x1),
|
||||
|
|
|
|||
|
|
@ -127,6 +127,11 @@ D_A4800018 = 0xA4800018; // SI_STATUS_REG
|
|||
gFramebuffer1 = 0x80000500;
|
||||
D_80025D00 = 0x80025D00;
|
||||
|
||||
// Ucode symbols
|
||||
|
||||
rspbootTextSize = 0x160;
|
||||
rspbootTextEnd = rspbootTextStart + rspbootTextSize;
|
||||
|
||||
// Segmented Addresses
|
||||
|
||||
// segment 0x01
|
||||
|
|
|
|||
Loading…
Reference in New Issue