summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/code/fault_gc.c5
-rw-r--r--src/code/game.c8
-rw-r--r--src/code/graph.c1
-rw-r--r--src/code/irqmgr.c8
-rw-r--r--src/code/rand.c3
-rw-r--r--src/code/sys_math3d.c2
-rw-r--r--src/code/z_camera.c2
-rw-r--r--src/code/z_vimode.c2
-rw-r--r--src/libultra/io/vimodefpallan1.c18
-rw-r--r--src/libultra/io/vimodempallan1.c18
-rw-r--r--src/libultra/io/vimodentsclan1.c18
-rw-r--r--src/libultra/io/vimodepallan1.c18
-rw-r--r--src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c4
-rw-r--r--src/overlays/actors/ovl_Fishing/z_fishing.c2
-rw-r--r--src/overlays/actors/ovl_player_actor/z_player.c6
15 files changed, 59 insertions, 56 deletions
diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c
index d3e16ac59..66bb0b0fa 100644
--- a/src/code/fault_gc.c
+++ b/src/code/fault_gc.c
@@ -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;
}
diff --git a/src/code/game.c b/src/code/game.c
index e00bc7406..6cf7a875d 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -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;
}
diff --git a/src/code/graph.c b/src/code/graph.c
index 1f9ba5e30..2b4777ea6 100644
--- a/src/code/graph.c
+++ b/src/code/graph.c
@@ -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);
diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c
index 7f630981b..d623ddad8 100644
--- a/src/code/irqmgr.c
+++ b/src/code/irqmgr.c
@@ -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);
}
}
diff --git a/src/code/rand.c b/src/code/rand.c
index 378f0456e..d6199b189 100644
--- a/src/code/rand.c
+++ b/src/code/rand.c
@@ -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
/**
diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c
index 570da1ab0..38fb38312 100644
--- a/src/code/sys_math3d.c
+++ b/src/code/sys_math3d.c
@@ -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);
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index f368e964d..7cb7e712c 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -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);
diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c
index d9478867f..8abcb62e7 100644
--- a/src/code/z_vimode.c
+++ b/src/code/z_vimode.c
@@ -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);
diff --git a/src/libultra/io/vimodefpallan1.c b/src/libultra/io/vimodefpallan1.c
index 5fb019cdf..37cb5ff55 100644
--- a/src/libultra/io/vimodefpallan1.c
+++ b/src/libultra/io/vimodefpallan1.c
@@ -16,15 +16,15 @@ OSViMode osViModeFpalLan1 = {
{
// comRegs
VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 |
- VI_CTRL_PIXEL_ADV(3), // ctrl
- WIDTH(320), // width
- BURST(58, 30, 4, 69), // burst
- VSYNC(625), // vSync
- HSYNC(3177, 23), // hSync
- LEAP(3183, 3181), // leap
- HSTART(128, 768), // hStart
- SCALE(2, 0), // xScale
- VCURRENT(0), // vCurrent
+ VI_CTRL_PIXEL_ADV_3, // ctrl
+ WIDTH(320), // width
+ BURST(58, 30, 4, 69), // burst
+ VSYNC(625), // vSync
+ HSYNC(3177, 23), // hSync
+ LEAP(3183, 3181), // leap
+ HSTART(128, 768), // hStart
+ SCALE(2, 0), // xScale
+ VCURRENT(0), // vCurrent
},
{ // fldRegs
{
diff --git a/src/libultra/io/vimodempallan1.c b/src/libultra/io/vimodempallan1.c
index 23d53987b..bcc4273af 100644
--- a/src/libultra/io/vimodempallan1.c
+++ b/src/libultra/io/vimodempallan1.c
@@ -16,15 +16,15 @@ OSViMode osViModeMpalLan1 = {
{
// comRegs
VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 |
- VI_CTRL_PIXEL_ADV(3), // ctrl
- WIDTH(320), // width
- BURST(57, 30, 5, 70), // burst
- VSYNC(525), // vSync
- HSYNC(3089, 4), // hSync
- LEAP(3097, 3098), // leap
- HSTART(108, 748), // hStart
- SCALE(2, 0), // xScale
- VCURRENT(0), // vCurrent
+ VI_CTRL_PIXEL_ADV_3, // ctrl
+ WIDTH(320), // width
+ BURST(57, 30, 5, 70), // burst
+ VSYNC(525), // vSync
+ HSYNC(3089, 4), // hSync
+ LEAP(3097, 3098), // leap
+ HSTART(108, 748), // hStart
+ SCALE(2, 0), // xScale
+ VCURRENT(0), // vCurrent
},
{ // fldRegs
{
diff --git a/src/libultra/io/vimodentsclan1.c b/src/libultra/io/vimodentsclan1.c
index 19a7160ac..a29d15129 100644
--- a/src/libultra/io/vimodentsclan1.c
+++ b/src/libultra/io/vimodentsclan1.c
@@ -16,15 +16,15 @@ OSViMode osViModeNtscLan1 = {
{
// comRegs
VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 |
- VI_CTRL_PIXEL_ADV(3), // ctrl
- WIDTH(320), // width
- BURST(57, 34, 5, 62), // burst
- VSYNC(525), // vSync
- HSYNC(3093, 0), // hSync
- LEAP(3093, 3093), // leap
- HSTART(108, 748), // hStart
- SCALE(2, 0), // xScale
- VCURRENT(0), // vCurrent
+ VI_CTRL_PIXEL_ADV_3, // ctrl
+ WIDTH(320), // width
+ BURST(57, 34, 5, 62), // burst
+ VSYNC(525), // vSync
+ HSYNC(3093, 0), // hSync
+ LEAP(3093, 3093), // leap
+ HSTART(108, 748), // hStart
+ SCALE(2, 0), // xScale
+ VCURRENT(0), // vCurrent
},
{ // fldRegs
{
diff --git a/src/libultra/io/vimodepallan1.c b/src/libultra/io/vimodepallan1.c
index 7a8db603f..d656dc4f9 100644
--- a/src/libultra/io/vimodepallan1.c
+++ b/src/libultra/io/vimodepallan1.c
@@ -16,15 +16,15 @@ OSViMode osViModePalLan1 = {
{
// comRegs
VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 |
- VI_CTRL_PIXEL_ADV(3), // ctrl
- WIDTH(320), // width
- BURST(58, 30, 4, 69), // burst
- VSYNC(625), // vSync
- HSYNC(3177, 23), // hSync
- LEAP(3183, 3181), // leap
- HSTART(128, 768), // hStart
- SCALE(2, 0), // xScale
- VCURRENT(0), // vCurrent
+ VI_CTRL_PIXEL_ADV_3, // ctrl
+ WIDTH(320), // width
+ BURST(58, 30, 4, 69), // burst
+ VSYNC(625), // vSync
+ HSYNC(3177, 23), // hSync
+ LEAP(3183, 3181), // leap
+ HSTART(128, 768), // hStart
+ SCALE(2, 0), // xScale
+ VCURRENT(0), // vCurrent
},
{ // fldRegs
{
diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
index 17cb04f17..1ac2d871e 100644
--- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
+++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
@@ -100,13 +100,13 @@ static ColliderCylinderInit sLightBallCylinderInit = {
static u8 D_808E4C58[] = { 0, 12, 10, 12, 14, 16, 12, 14, 16, 12, 14, 16, 12, 14, 16, 10, 16, 14 };
static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
-#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"
+#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
static EnGanonMant* sCape;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
-#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"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
static s32 sSeed1;
static s32 sSeed2;
diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c
index 802ed831a..34237596e 100644
--- a/src/overlays/actors/ovl_Fishing/z_fishing.c
+++ b/src/overlays/actors/ovl_Fishing/z_fishing.c
@@ -14,7 +14,7 @@
#include "cic6105.h"
#endif
-#pragma increment_block_number "gc-eu:157 gc-eu-mq:157 gc-jp:159 gc-jp-ce:159 gc-jp-mq:159 gc-us:159 gc-us-mq:159"
+#pragma increment_block_number "gc-eu:154 gc-eu-mq:154 gc-jp:156 gc-jp-ce:156 gc-jp-mq:156 gc-us:156 gc-us-mq:156"
#define FLAGS ACTOR_FLAG_4
diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c
index bd30f5bff..2bd876a32 100644
--- a/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/src/overlays/actors/ovl_player_actor/z_player.c
@@ -354,19 +354,19 @@ void Player_Action_CsAction(Player* this, PlayState* play);
// .bss part 1
-#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128"
+#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"
static s32 D_80858AA0;
// TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving
// data around. It would be easier if we had more options for controlling BSS ordering in debug.
-#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192"
+#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192"
static s32 D_80858AA4;
static Vec3f sInteractWallCheckResult;
static Input* sControlInput;
-#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224"
+#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224"
// .data