Change a couple functions which are now identified as coming from `nuSystem`

This commit is contained in:
gijs 2023-10-20 10:35:17 +02:00
parent 52f66d3290
commit 60f66d3b43
6 changed files with 94 additions and 83 deletions

View File

@ -193,7 +193,7 @@ extern void __calls_romCopy_8009DA50(void* src, void* dst, u32 len);
extern void Stack__dma_load_loop_new(Stack__dma_load_loop* arg0, OSMesgQueue* arg1, s16 flags);
extern void Stack__dma_load_loop_delete(Stack__dma_load_loop* arg0);
extern void obInitializePi();
extern void nuPiInit();
extern void __set_black();
extern void __calls_osViBlack(bool black);
@ -356,7 +356,7 @@ extern void AddHeap(void* start, u32 length);
extern void __some_logging(const char* format, ...);
extern void __idle_start_4_threads(s32, s32);
extern void nuScCreateScheduler(u8 videoMode, u8 numFields);
extern void (*D_800E7A18)();
extern void boot(void);

View File

@ -684,7 +684,10 @@ __MAIN_START_BUT_CHECK = 0x800E79B0; // size:0x14
__MAIN_START_BUT_STATE = 0x800E8214;
__thread_80089358 = 0x80089358;
__idle_start_4_threads = 0x80088C50;
nusched = 0x800E917C; // size:0x67A
nuScCreateScheduler = 0x80088C50; // rom:0x19050
nuPiInit = 0x80089F40;
__CONTROLLER_0_BUTTON = 0x800E8700;
__menu_handle_input = 0x8019B8AC; // type:func
@ -978,8 +981,6 @@ obMain = 0x80071EB0;
obThreadMain = 0x800AF5F0;
obStackMain = 0x800C6D60;
obInitializePi = 0x80089F40;
boot = 0x8007F880;
entry = 0x80070C00;

View File

@ -55,7 +55,7 @@ void __start_controller_thread(void) {
INCLUDE_ASM(const s32, "_ob_icy_coast", __controller_thread_80089D9C);
void obInitializePi(void) {
void nuPiInit(void) {
osCreatePiManager(OS_PRIORITY_PIMGR, &MQ_800BE030, OSMESG_800BE048, sizeof(OSMESG_800BE048) / sizeof(OSMesg));
PTR_CART_ROM_HANDLE = osCartRomInit();
}

View File

@ -1,6 +1,6 @@
#include "common.h"
INCLUDE_ASM(const s32, "_ob_past_brick", __idle_start_4_threads);
INCLUDE_ASM(const s32, "_ob_past_brick", nuScCreateScheduler);
/* 192F0 80088EF0*/
s32* func_80088EF0(void) {
@ -13,23 +13,25 @@ Unk0* func_80088EFC(void) {
INCLUDE_ASM(const s32, "_ob_past_brick", __thread_80088F08);
INCLUDE_ASM(const s32, "_ob_past_brick", Stack__dma_load_loop_new);
/* 19454 80089054 */
void Stack__dma_load_loop_new(Stack__dma_load_loop* arg0, OSMesgQueue* mq, s16 flags)
{
s32 mask = osSetIntMask(OS_IM_NONE);
// void Stack__dma_load_loop_new(Stack__dma_load_loop* arg0, OSMesgQueue* mq, s16 flags)
// {
// s32 mask = osSetIntMask(OS_IM_NONE);
arg0->mq = mq;
arg0->next = D_800E9178[0];
arg0->flags = flags;
// arg0->mq = mq;
// arg0->next = D_800E9178[0];
// arg0->flags = flags;
D_800E9178[0] = arg0;
// D_800E9178[0] = arg0;
if ((flags & 2) && (__MAIN_NOT_NULL_INF_LOOP != 0)) {
osSendMesg(mq, (u8*)(&D_800E9178) - 0x666, OS_MESG_NOBLOCK);
}
// if ((flags & 2) && (__MAIN_NOT_NULL_INF_LOOP != 0)) {
// osSendMesg(mq, (u8*)(&D_800E9178) - 0x666, OS_MESG_NOBLOCK);
// }
osSetIntMask(mask);
}
// osSetIntMask(mask);
// }
INCLUDE_ASM(const s32, "_ob_past_brick", func_800890E4);
@ -42,70 +44,76 @@ INCLUDE_ASM(const s32, "_ob_past_brick", __thread_80089200);
INCLUDE_ASM(const s32, "_ob_past_brick", __thread_80089358);
void __thread_800893C0(void) {
typedef struct {
/* 0x00 */ s32 field_0x0;
/* 0x04 */ s32 field_0x4;
/* 0x08 */ s32 field_0x8;
/* 0x1C */ u8 field_0x1c[0x42];
/* 0x50 */ OSMesgQueue* field_0x50;
} Stack0;
INCLUDE_ASM(const s32, "_ob_past_brick", __thread_800893C0);
Stack0* sp10;
void* sp14;
// void __thread_800893C0(void) {
// typedef struct {
// /* 0x00 */ s32 field_0x0;
// /* 0x04 */ s32 field_0x4;
// /* 0x08 */ s32 field_0x8;
// /* 0x1C */ u8 field_0x1c[0x42];
// /* 0x50 */ OSMesgQueue* field_0x50;
// } Stack0;
while(1) {
osRecvMesg(&MQ_800E8B4C.field_0x0, &sp10, 1);
if (!(__MAIN_NOT_NULL_INF_LOOP & 2)) {
func_8008949C(sp10);
osWritebackDCacheAll();
osSendMesg(&MQ_800B9C40, sp10, OS_MESG_BLOCK);
// Stack0* sp10;
// void* sp14;
osRecvMesg(&MQ_800E8B4C.field_0x70, &sp14, OS_MESG_BLOCK);
osSendMesg(&MQ_800B9C40, NULL, OS_MESG_BLOCK);
if (!(sp10->field_0x8 & 2)) {
osRecvMesg(&MQ_800E8B4C.field_0xa8, &sp14, OS_MESG_BLOCK);
}
}
osSendMesg(sp10->field_0x50, sp10, OS_MESG_BLOCK);
}
}
// while(1) {
// osRecvMesg(&MQ_800E8B4C.field_0x0, &sp10, 1);
// if (!(__MAIN_NOT_NULL_INF_LOOP & 2)) {
// func_8008949C(sp10);
// osWritebackDCacheAll();
// osSendMesg(&MQ_800B9C40, sp10, OS_MESG_BLOCK);
extern struct {
OSMesgQueue mq;
u8 padding[0x549];
u8 b;
} D_800E8C2C;
// osRecvMesg(&MQ_800E8B4C.field_0x70, &sp14, OS_MESG_BLOCK);
// osSendMesg(&MQ_800B9C40, NULL, OS_MESG_BLOCK);
// if (!(sp10->field_0x8 & 2)) {
// osRecvMesg(&MQ_800E8B4C.field_0xa8, &sp14, OS_MESG_BLOCK);
// }
// }
// osSendMesg(sp10->field_0x50, sp10, OS_MESG_BLOCK);
// }
// }
// extern struct {
// OSMesgQueue mq;
// u8 padding[0x549];
// u8 b;
// } D_800E8C2C;
INCLUDE_ASM(const s32, "_ob_past_brick", func_8008949C);
/* 1989C 8008949C */
void func_8008949C(void** buffers)
{
Stack__dma_load_loop sp10;
void* temp_s0 = buffers[3];
// void func_8008949C(void** buffers)
// {
// Stack__dma_load_loop sp10;
// void* temp_s0 = buffers[3];
if (D_800E8C2C.b != 1)
{
while(osViGetNextFramebuffer() == temp_s0 || osViGetCurrentFramebuffer() == temp_s0)
{
Stack__dma_load_loop_new(&sp10, &D_800E8C2C.mq, 1);
osRecvMesg(&D_800E8C2C.mq, NULL, 1);
Stack__dma_load_loop_delete(&sp10);
}
}
}
// if (D_800E8C2C.b != 1)
// {
// while(osViGetNextFramebuffer() == temp_s0 || osViGetCurrentFramebuffer() == temp_s0)
// {
// Stack__dma_load_loop_new(&sp10, &D_800E8C2C.mq, 1);
// osRecvMesg(&D_800E8C2C.mq, NULL, 1);
// Stack__dma_load_loop_delete(&sp10);
// }
// }
// }
void func_80089528(s8 arg0) {
D_800E918D = arg0;
}
INCLUDE_ASM(const s32, "_ob_past_brick", func_80089528);
// void func_80089528(s8 arg0) {
// D_800E918D = arg0;
// }
// INCLUDE_ASM(const s32, "_ob_past_brick", func_80089534);
extern u8 D_800E918C;
// extern u8 D_800E918C;
INCLUDE_ASM(const s32, "_ob_past_brick", func_80089534);
/* 19934 80089534 */
u8 func_80089534(void) {
return D_800E918C;
}
// u8 func_80089534(void) {
// return D_800E918C;
// }
INCLUDE_ASM(const s32, "_ob_past_brick", __thread_80089540);
@ -113,13 +121,15 @@ INCLUDE_ASM(const s32, "_ob_past_brick", __start_thread_800B9C88);
INCLUDE_ASM(const s32, "_ob_past_brick", __something_display_list);
INCLUDE_ASM(const s32, "_ob_past_brick", func_80089990);
/* 19D90 80089990 */
void func_80089990(void (*arg0)(s32)) {
s32 mask;
// void func_80089990(void (*arg0)(s32)) {
// s32 mask;
func_80089A10();
mask = osSetIntMask(OS_IM_NONE);
D_800AA090 = arg0;
osSetIntMask(mask);
}
// func_80089A10();
// mask = osSetIntMask(OS_IM_NONE);
// D_800AA090 = arg0;
// osSetIntMask(mask);
// }

View File

@ -11,8 +11,8 @@ void boot(void) {
void obIdle(void* arg) {
D_800E7A18 = NULL;
obInitializePi();
__idle_start_4_threads(2, 1);
nuPiInit();
nuScCreateScheduler(OS_VI_NTSC_LAN1, 1);
osViSetSpecialFeatures(OS_VI_DIVOT_ON | OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF | OS_VI_GAMMA_DITHER_OFF);

View File

@ -3,10 +3,10 @@
#include "PR/gbi.h"
#include "common.h"
extern u32 D_800E91D0;
extern u8 nusched;
/* 16FF40 8021EF00 */
void *D_overlay_165FC0_8021EF00_16FF40 = &D_800E91D0;
void *D_overlay_165FC0_8021EF00_16FF40 = &nusched + 0x54;
/* 16FF44 8021EF04 */
u8 D_overlay_165FC0_8021EF04_16FF44 = 0;