Compare commits
13 Commits
901ff5dc63
...
6dde5925bc
| Author | SHA1 | Date |
|---|---|---|
|
|
6dde5925bc | |
|
|
c23bc3a884 | |
|
|
7c5ef2df8e | |
|
|
c711ee9ea7 | |
|
|
b41fadc833 | |
|
|
0f740013fc | |
|
|
05b93a6faa | |
|
|
ad4a954aab | |
|
|
edec5a8ec0 | |
|
|
a0e093a589 | |
|
|
19ad06ddec | |
|
|
34c7cfa70d | |
|
|
774f762631 |
|
|
@ -199,7 +199,6 @@ extern void __start_thread_800BE1C0();
|
||||||
|
|
||||||
extern void __something_display_list(Gfx*, s32, s32, s32);
|
extern void __something_display_list(Gfx*, s32, s32, s32);
|
||||||
extern void func_80089A10();
|
extern void func_80089A10();
|
||||||
extern void func_80089AB0(s32*, s32);
|
|
||||||
|
|
||||||
extern void __osViSwapBuffer_3(void** buffers);
|
extern void __osViSwapBuffer_3(void** buffers);
|
||||||
extern void set_swap_buffer_func(void (*arg0)(void**));
|
extern void set_swap_buffer_func(void (*arg0)(void**));
|
||||||
|
|
@ -223,7 +222,6 @@ extern void func_8008B1D0(u8*);
|
||||||
extern void __start_thread_800BE1C0(void);
|
extern void __start_thread_800BE1C0(void);
|
||||||
extern void __thread_8008AFE0(void*);
|
extern void __thread_8008AFE0(void*);
|
||||||
|
|
||||||
extern void func_8008949C(void** buffers);
|
|
||||||
extern void func_8008350C();
|
extern void func_8008350C();
|
||||||
extern void func_8008B1D0(u8*);
|
extern void func_8008B1D0(u8*);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@ nusched = 0x800E8B10; // size:0x680
|
||||||
nuScRetraceCounter = 0x800C4BCC;
|
nuScRetraceCounter = 0x800C4BCC;
|
||||||
nuScPreNMIFlag = 0x800C4800;
|
nuScPreNMIFlag = 0x800C4800;
|
||||||
nuScPreNMIFunc = 0x800A9E60;
|
nuScPreNMIFunc = 0x800A9E60;
|
||||||
|
nuGfxCfb = 0x800E8290;
|
||||||
|
nuGfxCfbNum = 0x800A9E80;
|
||||||
|
nuGfxCfbCounter = 0x800C4BC4;
|
||||||
|
nuGfxCfb_ptr = 0x800E8210;
|
||||||
|
|
||||||
nuBoot = 0x8007F880;
|
nuBoot = 0x8007F880;
|
||||||
nuScCreateScheduler = 0x80088C50; // rom:0x19050
|
nuScCreateScheduler = 0x80088C50; // rom:0x19050
|
||||||
|
|
@ -17,6 +21,9 @@ nuScAddClient = 0x80089054;
|
||||||
nuScRemoveClient = 0x80089124;
|
nuScRemoveClient = 0x80089124;
|
||||||
nuScSetFrameBufferNum = 0x80089528;
|
nuScSetFrameBufferNum = 0x80089528;
|
||||||
nuGfxRetraceWait = 0x80089A30;
|
nuGfxRetraceWait = 0x80089A30;
|
||||||
|
nuScResetClientMesgType = 0x800890E4;
|
||||||
|
nuScWaitTaskReady = 0x8008949C;
|
||||||
|
nuGfxSetCfb = 0x80089AB0;
|
||||||
|
|
||||||
obCurrentTime = 0x800C47D0;
|
obCurrentTime = 0x800C47D0;
|
||||||
obSetCurrentTime = 0x8009C7C0; // rom:0x2CBC0
|
obSetCurrentTime = 0x8009C7C0; // rom:0x2CBC0
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ segments:
|
||||||
- [0x19DD0, c, "_ob_questionable_glass"]
|
- [0x19DD0, c, "_ob_questionable_glass"]
|
||||||
- [0x19E10, asm]
|
- [0x19E10, asm]
|
||||||
- [0x19E30, c, "nu/nugfxretracewait"]
|
- [0x19E30, c, "nu/nugfxretracewait"]
|
||||||
- [0x19EB0, asm]
|
- [0x19EB0, c, "nu/nugfxsetcfb"]
|
||||||
- [0x19FC0, c, "black"]
|
- [0x19FC0, c, "black"]
|
||||||
- [0x1A050, c, "_ob_icy_coast"]
|
- [0x1A050, c, "_ob_icy_coast"]
|
||||||
- [0x1A4F0, c, "rom_copy"]
|
- [0x1A4F0, c, "rom_copy"]
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
#include "nu/nusys.h"
|
#include "nu/nusys.h"
|
||||||
|
|
||||||
|
void nuScEventBroadcast(NUScMsg* msg);
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", nuScCreateScheduler);
|
INCLUDE_ASM(const s32, "_ob_past_brick", nuScCreateScheduler);
|
||||||
|
|
||||||
/* 192F0 80088EF0*/
|
|
||||||
OSMesgQueue* nuScGetAudioMQ() {
|
OSMesgQueue* nuScGetAudioMQ() {
|
||||||
return &nusched.audioRequestMQ;
|
return &nusched.audioRequestMQ;
|
||||||
}
|
}
|
||||||
|
|
@ -13,34 +14,107 @@ OSMesgQueue* nuScGetGfxMQ() {
|
||||||
return &nusched.graphicsRequestMQ;
|
return &nusched.graphicsRequestMQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", nuScEventHandler);
|
void nuScEventHandler(void) {
|
||||||
|
OSMesg msg;
|
||||||
|
s32 beforeResetFrame;
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", nuScAddClient);
|
nuScRetraceCounter = 0;
|
||||||
|
|
||||||
/* 19454 80089054 */
|
while (TRUE) {
|
||||||
// void nuScAddClient(Stack__dma_load_loop* arg0, OSMesgQueue* mq, s16 flags)
|
osRecvMesg(&nusched.retraceMQ, &msg, OS_MESG_BLOCK);
|
||||||
// {
|
|
||||||
// s32 mask = osSetIntMask(OS_IM_NONE);
|
|
||||||
|
|
||||||
// arg0->mq = mq;
|
switch ((s32) msg) {
|
||||||
// arg0->next = D_800E9178[0];
|
case 666:
|
||||||
// arg0->flags = flags;
|
nuScRetraceCounter++;
|
||||||
|
|
||||||
// D_800E9178[0] = arg0;
|
|
||||||
|
|
||||||
// if ((flags & 2) && (nuScPreNMIFlag != 0)) {
|
|
||||||
// osSendMesg(mq, (u8*)(&D_800E9178) - 0x666, OS_MESG_NOBLOCK);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// osSetIntMask(mask);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
nuScEventBroadcast(&nusched.retraceMsg);
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", func_800890E4);
|
if (nuScPreNMIFlag){
|
||||||
|
if (beforeResetFrame){
|
||||||
|
beforeResetFrame--;
|
||||||
|
} else {
|
||||||
|
nuScPreNMIFlag |= NU_SC_BEFORE_RESET;
|
||||||
|
osAfterPreNMI();
|
||||||
|
osViSetYScale(1.0);
|
||||||
|
__calls_osViBlack(TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", nuScRemoveClient);
|
case 669:
|
||||||
|
nuScPreNMIFlag = NU_SC_PRENMI_GET;
|
||||||
|
nuScEventBroadcast(&nusched.prenmiMsg);
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", nuScEventBroadcast);
|
if (nuScPreNMIFunc != NULL){
|
||||||
|
(*nuScPreNMIFunc)();
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeResetFrame = (nusched.frameRate / 2) / nusched.retraceCount - 3;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void nuScAddClient(NUScClient* client, OSMesgQueue* queue, NUScMsg type) {
|
||||||
|
s32 mask;
|
||||||
|
|
||||||
|
mask = osSetIntMask(OS_IM_NONE);
|
||||||
|
|
||||||
|
client->msgQ = queue;
|
||||||
|
client->next = nusched.clientList;
|
||||||
|
client->msgType = type;
|
||||||
|
|
||||||
|
nusched.clientList = client;
|
||||||
|
|
||||||
|
if ((type & NU_SC_PRENMI_MSG) && nuScPreNMIFlag) {
|
||||||
|
osSendMesg(queue, &nusched.prenmiMsg, OS_MESG_NOBLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
osSetIntMask(mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nuScResetClientMesgType(NUScClient* client, NUScMsg msgType) {
|
||||||
|
s32 mask;
|
||||||
|
|
||||||
|
mask = osSetIntMask(OS_IM_NONE);
|
||||||
|
client->msgType = msgType;
|
||||||
|
osSetIntMask(mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nuScRemoveClient(NUScClient* client) {
|
||||||
|
s32 mask = osSetIntMask(OS_IM_NONE);
|
||||||
|
NUScClient* clientList = nusched.clientList;
|
||||||
|
NUScClient* prev = NULL;
|
||||||
|
|
||||||
|
while (clientList != NULL) {
|
||||||
|
if (clientList == client) {
|
||||||
|
if (prev != NULL) {
|
||||||
|
prev->next = clientList->next;
|
||||||
|
} else {
|
||||||
|
nusched.clientList = clientList->next;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
prev = clientList;
|
||||||
|
clientList = clientList->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
osSetIntMask(mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nuScEventBroadcast(NUScMsg* msg) {
|
||||||
|
NUScClient* clientList = nusched.clientList;
|
||||||
|
|
||||||
|
while (clientList != NULL) {
|
||||||
|
if (clientList->msgType & *msg) {
|
||||||
|
osSendMesg(clientList->msgQ, msg, OS_MESG_NOBLOCK);
|
||||||
|
}
|
||||||
|
clientList = clientList->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", nuScExecuteAudio);
|
INCLUDE_ASM(const s32, "_ob_past_brick", nuScExecuteAudio);
|
||||||
|
|
||||||
|
|
@ -63,7 +137,7 @@ INCLUDE_ASM(const s32, "_ob_past_brick", nuScExecuteGraphics);
|
||||||
// while(1) {
|
// while(1) {
|
||||||
// osRecvMesg(&MQ_800E8B4C.field_0x0, &sp10, 1);
|
// osRecvMesg(&MQ_800E8B4C.field_0x0, &sp10, 1);
|
||||||
// if (!(nuScPreNMIFlag & 2)) {
|
// if (!(nuScPreNMIFlag & 2)) {
|
||||||
// func_8008949C(sp10);
|
// nuScWaitTaskReady(sp10);
|
||||||
// osWritebackDCacheAll();
|
// osWritebackDCacheAll();
|
||||||
// osSendMesg(&MQ_800B9C40, sp10, OS_MESG_BLOCK);
|
// osSendMesg(&MQ_800B9C40, sp10, OS_MESG_BLOCK);
|
||||||
|
|
||||||
|
|
@ -77,30 +151,20 @@ INCLUDE_ASM(const s32, "_ob_past_brick", nuScExecuteGraphics);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// extern struct {
|
void nuScWaitTaskReady(NUScTask* task) {
|
||||||
// OSMesgQueue mq;
|
NUScClient client;
|
||||||
// u8 padding[0x549];
|
void* fb = task->framebuffer;
|
||||||
// u8 b;
|
|
||||||
// } D_800E8C2C;
|
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", func_8008949C);
|
if(nusched.frameBufferNum == 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* 1989C 8008949C */
|
while (osViGetNextFramebuffer() == fb || osViGetCurrentFramebuffer() == fb) {
|
||||||
// void func_8008949C(void** buffers)
|
nuScAddClient(&client, &nusched.waitMQ, NU_SC_RETRACE_MSG);
|
||||||
// {
|
osRecvMesg(&nusched.waitMQ, NULL, OS_MESG_BLOCK);
|
||||||
// Stack__dma_load_loop sp10;
|
nuScRemoveClient(&client);
|
||||||
// void* temp_s0 = buffers[3];
|
}
|
||||||
|
}
|
||||||
// if (D_800E8C2C.b != 1)
|
|
||||||
// {
|
|
||||||
// while(osViGetNextFramebuffer() == temp_s0 || osViGetCurrentFramebuffer() == temp_s0)
|
|
||||||
// {
|
|
||||||
// nuScAddClient(&sp10, &D_800E8C2C.mq, 1);
|
|
||||||
// osRecvMesg(&D_800E8C2C.mq, NULL, 1);
|
|
||||||
// nuScRemoveClient(&sp10);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
INCLUDE_ASM(const s32, "_ob_past_brick", nuScSetFrameBufferNum);
|
INCLUDE_ASM(const s32, "_ob_past_brick", nuScSetFrameBufferNum);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#include "nu/nusys.h"
|
||||||
|
|
||||||
/* 1A5B0 8008A1B0 */
|
/* 1A5B0 8008A1B0 */
|
||||||
void func_8008A1B0(void) {
|
void func_8008A1B0(void) {
|
||||||
Gfx list[257];
|
Gfx list[257];
|
||||||
Gfx* ptr = list;
|
Gfx* ptr = list;
|
||||||
|
|
||||||
__start_thread_800BE1C0();
|
__start_thread_800BE1C0();
|
||||||
func_80089AB0(&__SOMETHING_FRAMEBUFFERS, 3);
|
nuGfxSetCfb(&__SOMETHING_FRAMEBUFFERS, 3);
|
||||||
D_800C4B20 = BOOT_ADDRESS_ULTRA;
|
D_800C4B20 = BOOT_ADDRESS_ULTRA;
|
||||||
set_swap_buffer_func(__osViSwapBuffer_3);
|
set_swap_buffer_func(__osViSwapBuffer_3);
|
||||||
D_800C4CE0 = &D_800A9EB0;
|
D_800C4CE0 = &D_800A9EB0;
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ void func_8007382C(void) {
|
||||||
|
|
||||||
gDPPipeSync(obPtrDisplayList++);
|
gDPPipeSync(obPtrDisplayList++);
|
||||||
gDPSetRenderMode(obPtrDisplayList++, G_RM_NOOP, G_RM_NOOP2);
|
gDPSetRenderMode(obPtrDisplayList++, G_RM_NOOP, G_RM_NOOP2);
|
||||||
gDPSetColorImage(obPtrDisplayList++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(D_800E8210));
|
gDPSetColorImage(obPtrDisplayList++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, osVirtualToPhysical(nuGfxCfb_ptr));
|
||||||
gDPSetFillColor(obPtrDisplayList++, 0x00010001);
|
gDPSetFillColor(obPtrDisplayList++, 0x00010001);
|
||||||
|
|
||||||
gDPPipeSync(obPtrDisplayList++);
|
gDPPipeSync(obPtrDisplayList++);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
#include "nu/nusys.h"
|
||||||
|
|
||||||
|
void nuGfxSetCfb(u16** framebuf, u32 framebufnum) {
|
||||||
|
u32 i;
|
||||||
|
|
||||||
|
nuGfxCfb = framebuf;
|
||||||
|
nuGfxCfbNum = framebufnum;
|
||||||
|
nuGfxCfbCounter = 0;
|
||||||
|
nuGfxCfb_ptr = nuGfxCfb[0];
|
||||||
|
|
||||||
|
nuGfxRetraceWait(1);
|
||||||
|
nuScSetFrameBufferNum(framebufnum);
|
||||||
|
|
||||||
|
if (framebufnum > 1) {
|
||||||
|
s32 i;
|
||||||
|
|
||||||
|
for (i = 0; i < framebufnum - 1; i++) {
|
||||||
|
if (nuGfxCfb[i] != nuGfxCfb[i+1]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == framebufnum - 1) {
|
||||||
|
nuScSetFrameBufferNum(1);
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < framebufnum; i++) {
|
||||||
|
if (osViGetNextFramebuffer() != nuGfxCfb[i]) {
|
||||||
|
nuGfxCfbCounter = i;
|
||||||
|
nuGfxCfb_ptr = nuGfxCfb[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue