1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-15 11:30:30 +00:00
oot/src/boot/idle.c
Random 174af7384d
libultra cleanup (#215)
* cleanup libultra

* fixes

- use quotes instead of <> for includes
- add macros for zelda specific thread priorities
- fix Makefile
- properly format the remaining pfs structs

* fix button macros + add CHECK_BTN_ANY/CHECK_BTN_ALL

* remove ULTRA_ABS

* fix includes

* update z_player.c/z_lib.c + run format.sh

* merge upstream/master

* fix include in En_Goroiwa

* fix includes
2020-10-03 11:22:44 -04:00

90 lines
3.2 KiB
C

#include "global.h"
#include "vt.h"
OSThread gMainThread;
u8 sMainStack[0x900];
StackEntry sMainStackInfo;
OSMesg sPiMgrCmdBuff[50];
OSMesgQueue gPiMgrCmdQ;
OSViMode gViConfigMode;
u8 D_80013960;
s8 D_80009430 = 1;
vu8 gViConfigUseDefault = 1;
u8 gViConfigAdditionalScanLines = 0;
u32 gViConfigFeatures = OS_VI_DITHER_FILTER_ON | OS_VI_GAMMA_OFF;
f32 gViConfigXScale = 1.0;
f32 gViConfigYScale = 1.0;
void Main_ThreadEntry(void* arg0) {
OSTime var1;
osSyncPrintf("mainx 実行開始\n");
DmaMgr_Init();
osSyncPrintf("codeセグメントロード中...");
var1 = osGetTime();
DmaMgr_SendRequest1(_codeSegmentStart, (u32)_codeSegmentRomStart, _codeSegmentRomEnd - _codeSegmentRomStart,
"../idle.c", 238);
var1 -= osGetTime();
osSyncPrintf("\rcodeセグメントロード中...完了\n");
osSyncPrintf("転送時間 %6.3f\n");
bzero(_codeSegmentBssStart, _codeSegmentBssEnd - _codeSegmentBssStart);
osSyncPrintf("codeセグメントBSSクリア完了\n");
Main(arg0);
osSyncPrintf("mainx 実行終了\n");
}
void Idle_ThreadEntry(void* a0) {
osSyncPrintf("アイドルスレッド(idleproc)実行開始\n");
osSyncPrintf("作製者 : %s\n", gBuildTeam);
osSyncPrintf("作成日時 : %s\n", gBuildDate);
osSyncPrintf("MAKEOPTION: %s\n", gBuildMakeOption);
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("RAMサイズは %d キロバイトです(osMemSize/osGetMemSize)\n", (s32)osMemSize / 1024);
osSyncPrintf("_bootSegmentEnd(%08x) 以降のRAM領域はクリアされました(boot)\n", _bootSegmentEnd);
osSyncPrintf("Zバッファのサイズは %d キロバイトです\n", 0x96);
osSyncPrintf("ダイナミックバッファのサイズは %d キロバイトです\n", 0x92);
osSyncPrintf("FIFOバッファのサイズは %d キロバイトです\n", 0x60);
osSyncPrintf("YIELDバッファのサイズは %d キロバイトです\n", 3);
osSyncPrintf("オーディオヒープのサイズは %d キロバイトです\n", ((s32)gSystemHeap - (s32)gAudioHeap) / 1024);
osSyncPrintf(VT_RST);
osCreateViManager(OS_PRIORITY_VIMGR);
gViConfigFeatures = 0x42;
gViConfigXScale = 1.0f;
gViConfigYScale = 1.0f;
switch (osTvType) {
case 1:
D_80013960 = 2;
gViConfigMode = osViModeNtscLan1;
break;
case 2:
D_80013960 = 0x1E;
gViConfigMode = osViModeMpalLan1;
break;
case 0:
D_80013960 = 0x2C;
gViConfigMode = osViModeFpalLan1;
gViConfigYScale = 0.833f;
break;
}
D_80009430 = 1;
osViSetMode(&gViConfigMode);
ViConfig_UpdateVi(1);
osViBlack(1);
osViSwapBuffer(0x803DA80); //! @bug Invalid vram address (probably intended to be 0x803DA800)
osCreatePiManager(OS_PRIORITY_PIMGR, &gPiMgrCmdQ, sPiMgrCmdBuff, 50);
StackCheck_Init(&sMainStackInfo, sMainStack, sMainStack + sizeof(sMainStack), 0, 0x400, "main");
osCreateThread(&gMainThread, 3, Main_ThreadEntry, a0, sMainStack + sizeof(sMainStack), Z_PRIORITY_MAIN);
osStartThread(&gMainThread);
osSetThreadPri(NULL, OS_PRIORITY_IDLE);
while (1) {
;
}
}