1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 22:44:30 +00:00

Miscellaneous libultra header fixes (#2139)

* Miscellaneous libultra header fixes

* Fix bss?

* Reword RCP timeout
This commit is contained in:
cadmic 2024-09-06 05:46:44 -07:00 committed by GitHub
parent 53b2110373
commit 2ce648a7c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 69 additions and 64 deletions

View file

@ -144,7 +144,8 @@ void Fault_ClientRunTask(FaultClientTask* task) {
// Await done
while (true) {
osSetTimer(&timer, OS_SEC_TO_CYCLES(1), 0, &queue, (OSMesg)timerMsgVal);
// Wait for 1 second
osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)timerMsgVal);
osRecvMesg(&queue, &recMsg, OS_MESG_BLOCK);
if (recMsg != (OSMesg)666) {
@ -653,7 +654,7 @@ void Fault_Wait5Seconds(void) {
do {
Fault_Sleep(1000 / 60);
} while ((osGetTime() - start) < OS_SEC_TO_CYCLES(5) + 1);
} while ((osGetTime() - start) <= OS_USEC_TO_CYCLES(5000000)); // 5 seconds
sFaultInstance->autoScroll = true;
}

View file

@ -302,22 +302,22 @@ void GameState_Update(GameState* gameState) {
gfxCtx->xScale = gViConfigXScale;
gfxCtx->yScale = gViConfigYScale;
if (SREG(63) == 6 || (SREG(63) == 2u && osTvType == OS_TV_NTSC)) {
if (SREG(63) == 6 || (SREG(63) == 2u && (u32)osTvType == OS_TV_NTSC)) {
gfxCtx->viMode = &osViModeNtscLan1;
gfxCtx->yScale = 1.0f;
}
if (SREG(63) == 5 || (SREG(63) == 2u && osTvType == OS_TV_MPAL)) {
if (SREG(63) == 5 || (SREG(63) == 2u && (u32)osTvType == OS_TV_MPAL)) {
gfxCtx->viMode = &osViModeMpalLan1;
gfxCtx->yScale = 1.0f;
}
if (SREG(63) == 4 || (SREG(63) == 2u && osTvType == OS_TV_PAL)) {
if (SREG(63) == 4 || (SREG(63) == 2u && (u32)osTvType == OS_TV_PAL)) {
gfxCtx->viMode = &osViModePalLan1;
gfxCtx->yScale = 1.0f;
}
if (SREG(63) == 3 || (SREG(63) == 2u && osTvType == OS_TV_PAL)) {
if (SREG(63) == 3 || (SREG(63) == 2u && (u32)osTvType == OS_TV_PAL)) {
gfxCtx->viMode = &osViModeFpalLan1;
gfxCtx->yScale = 0.833f;
}

View file

@ -179,6 +179,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
{
CfbInfo* cfb;
// Schedule a message to be handled in 3 seconds, for RCP timeout
osSetTimer(&timer, OS_USEC_TO_CYCLES(3000000), 0, &gfxCtx->queue, (OSMesg)666);
osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_BLOCK);

View file

@ -164,7 +164,7 @@ void IrqMgr_HandlePreNMI(IrqMgr* irqMgr) {
sIrqMgrResetTime = irqMgr->resetTime = osGetTime();
// Schedule a PRENMI450 message to be handled in 450ms
osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(450), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG);
osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(450000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI450_MSG);
IrqMgr_JamMesgToClients(irqMgr, (OSMesg)&irqMgr->prenmiMsg);
}
@ -190,7 +190,7 @@ void IrqMgr_HandlePreNMI450(IrqMgr* irqMgr) {
irqMgr->resetStatus = IRQ_RESET_STATUS_NMI;
// Schedule a PRENMI480 message to be handled in 30ms
osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(30), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG);
osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(30000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG);
// Send the NMI event to clients
IrqMgr_SendMesgToClients(irqMgr, (OSMesg)&irqMgr->nmiMsg);
}
@ -199,7 +199,7 @@ void IrqMgr_HandlePreNMI480(IrqMgr* irqMgr) {
u32 result;
// Schedule a PRENMI500 message to be handled in 20ms
osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(20), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG);
osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(20000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI500_MSG);
result = osAfterPreNMI();
if (result != 0) {
@ -207,7 +207,7 @@ void IrqMgr_HandlePreNMI480(IrqMgr* irqMgr) {
// osAfterPreNMI failed, try again in 1ms
//! @bug setting the same timer for a second time without letting the first one complete breaks
//! the timer linked list
osSetTimer(&irqMgr->timer, OS_MSEC_TO_CYCLES(1), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG);
osSetTimer(&irqMgr->timer, OS_USEC_TO_CYCLES(1000), 0, &irqMgr->queue, (OSMesg)IRQ_PRENMI480_MSG);
}
}

View file

@ -42,6 +42,7 @@
* @note Original name: qrand.c
*/
#include "rand.h"
#include "z64math.h"
#define RAND_MULTIPLIER 1664525
#define RAND_INCREMENT 1013904223
@ -59,7 +60,7 @@ static u32 sRandInt = 1;
*
* @note Orignal name: __qrand_itemp
*/
static fu sRandFloat;
static FloatInt sRandFloat;
#endif
/**

View file

@ -5,7 +5,7 @@
#include "macros.h"
#include "sys_math3d.h"
#pragma increment_block_number "gc-eu:106 gc-eu-mq:106 gc-jp:106 gc-jp-ce:106 gc-jp-mq:106 gc-us:106 gc-us-mq:106"
#pragma increment_block_number "gc-eu:103 gc-eu-mq:103 gc-jp:103 gc-jp-ce:103 gc-jp-mq:103 gc-us:103 gc-us-mq:103"
s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB,
Vec3f* lineAClosestToB, Vec3f* lineBClosestToA);

View file

@ -4,7 +4,7 @@
#include "terminal.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0"
#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0"
s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags);
s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange);

View file

@ -85,7 +85,7 @@ void ViMode_Configure(ViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 antia
yScaleHiOddField = modeF ? (loResInterlaced ? (F210(0.75) << 16) : (F210(0.5) << 16)) : 0;
viMode->customViMode.type = type;
viMode->customViMode.comRegs.ctrl = VI_CTRL_PIXEL_ADV(3) | VI_CTRL_GAMMA_ON | VI_CTRL_GAMMA_DITHER_ON |
viMode->customViMode.comRegs.ctrl = VI_CTRL_PIXEL_ADV_3 | VI_CTRL_GAMMA_ON | VI_CTRL_GAMMA_DITHER_ON |
(!loResDeinterlaced ? VI_CTRL_SERRATE_ON : 0) |
(antialiasOn ? VI_CTRL_DIVOT_ON : 0) |
(fb32Bit ? VI_CTRL_TYPE_32 : VI_CTRL_TYPE_16);