mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-12 10:54:44 +00:00
[ntsc-1.2] Decompile cic6105.c, main.c (#2068)
* decompile-OK Main, cic6105.c * names cleanup / minimal doc * match versions * fix bad disasm metadata format * bss * bss * review 1 * review 2 * review 3 * review 4 * cleanup * bss * add some sizes to disasm metadata symbols
This commit is contained in:
parent
22a00b46fb
commit
7056423e5b
19 changed files with 186 additions and 14 deletions
|
@ -1,6 +1,8 @@
|
|||
#include "global.h"
|
||||
#include "terminal.h"
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
|
||||
|
||||
SpeedMeter D_801664D0;
|
||||
VisCvg sVisCvg;
|
||||
VisZBuf sVisZBuf;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#define GFXPOOL_HEAD_MAGIC 0x1234
|
||||
#define GFXPOOL_TAIL_MAGIC 0x5678
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
|
||||
|
||||
/**
|
||||
* The time at which the previous `Graph_Update` ended.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
#include "global.h"
|
||||
#include "terminal.h"
|
||||
#include "versions.h"
|
||||
#if PLATFORM_N64
|
||||
#include "cic6105.h"
|
||||
#include "n64dd.h"
|
||||
#endif
|
||||
|
||||
extern u8 _buffersSegmentEnd[];
|
||||
|
||||
|
@ -52,8 +57,20 @@ void Main(void* arg) {
|
|||
gAppNmiBufferPtr = (PreNmiBuff*)osAppNMIBuffer;
|
||||
PreNmiBuff_Init(gAppNmiBufferPtr);
|
||||
Fault_Init();
|
||||
#if PLATFORM_N64
|
||||
func_800ADA80();
|
||||
if ((u8)B_80121AE1 != 0) {
|
||||
systemHeapStart = (uintptr_t)&D_801E8090;
|
||||
SysCfb_Init(1);
|
||||
} else {
|
||||
func_800ADAF8();
|
||||
systemHeapStart = (uintptr_t)_buffersSegmentEnd;
|
||||
SysCfb_Init(0);
|
||||
}
|
||||
#else
|
||||
SysCfb_Init(0);
|
||||
systemHeapStart = (uintptr_t)_buffersSegmentEnd;
|
||||
#endif
|
||||
fb = (uintptr_t)SysCfb_GetFbPtr(0);
|
||||
gSystemHeapSize = fb - systemHeapStart;
|
||||
PRINTF(T("システムヒープ初期化 %08x-%08x %08x\n", "System heap initalization %08x-%08x %08x\n"), systemHeapStart,
|
||||
|
@ -97,6 +114,11 @@ void Main(void* arg) {
|
|||
StackCheck_Init(&sSchedStackInfo, sSchedStack, STACK_TOP(sSchedStack), 0, 0x100, "sched");
|
||||
Sched_Init(&gScheduler, STACK_TOP(sSchedStack), THREAD_PRI_SCHED, gViConfigModeType, 1, &gIrqMgr);
|
||||
|
||||
#if PLATFORM_N64
|
||||
CIC6105_AddFaultClient();
|
||||
func_80001640();
|
||||
#endif
|
||||
|
||||
IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQueue);
|
||||
|
||||
StackCheck_Init(&sAudioStackInfo, sAudioStack, STACK_TOP(sAudioStack), 0, 0x100, "audio");
|
||||
|
@ -119,14 +141,19 @@ void Main(void* arg) {
|
|||
if (msg == NULL) {
|
||||
break;
|
||||
}
|
||||
if (*msg == OS_SC_PRE_NMI_MSG) {
|
||||
PRINTF(T("main.c: リセットされたみたいだよ\n", "main.c: Looks like it's been reset\n"));
|
||||
PreNmiBuff_SetReset(gAppNmiBufferPtr);
|
||||
switch (*msg) {
|
||||
case OS_SC_PRE_NMI_MSG:
|
||||
PRINTF(T("main.c: リセットされたみたいだよ\n", "main.c: Looks like it's been reset\n"));
|
||||
PreNmiBuff_SetReset(gAppNmiBufferPtr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PRINTF(T("mainproc 後始末\n", "mainproc Cleanup\n"));
|
||||
osDestroyThread(&sGraphThread);
|
||||
RcpUtils_Reset();
|
||||
#if PLATFORM_N64
|
||||
CIC6105_RemoveFaultClient();
|
||||
#endif
|
||||
PRINTF(T("mainproc 実行終了\n", "mainproc End of execution\n"));
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
#define RDP_DONE_MSG 668
|
||||
#define NOTIFY_MSG 670 // original name: ENTRY_MSG
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
|
||||
|
||||
OSTime sRSPGfxTimeStart;
|
||||
OSTime sRSPAudioTimeStart;
|
||||
OSTime sRSPOtherTimeStart;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
|
||||
|
||||
#include "global.h"
|
||||
#include "terminal.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "global.h"
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
|
||||
|
||||
uintptr_t sSysCfbFbPtr[2];
|
||||
uintptr_t sSysCfbEnd;
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@ MtxF gMtxFClear = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
|
||||
|
||||
MtxF* sMatrixStack; // "Matrix_stack"
|
||||
MtxF* sCurrentMatrix; // "Matrix_now"
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ typedef struct InputCombo {
|
|||
/* 0x2 */ u16 press;
|
||||
} InputCombo; // size = 0x4
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
|
||||
|
||||
RegEditor* gRegEditor;
|
||||
|
||||
DebugCamTextBufferEntry sDebugCamTextBuffer[22];
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_26)
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
|
||||
|
||||
void (*sPlayerCallInitFunc)(Actor* thisx, PlayState* play);
|
||||
void (*sPlayerCallDestroyFunc)(Actor* thisx, PlayState* play);
|
||||
void (*sPlayerCallUpdateFunc)(Actor* thisx, PlayState* play);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "global.h"
|
||||
|
||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128"
|
||||
|
||||
MtxF gSkinLimbMatrices[60]; // holds matrices for each limb of the skeleton currently being drawn
|
||||
|
||||
static s32 sUnused;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue