summaryrefslogtreecommitdiff
path: root/src/code/z_vimode.c
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2023-06-24 04:40:26 -0400
committerGitHub <noreply@github.com>2023-06-24 18:40:26 +1000
commit9b341a4d6a721b46baa81ee2f47815b6073f5096 (patch)
treee1c5794f5111d3db2d628b8590e1c5a1b4b34d12 /src/code/z_vimode.c
parent19da43859e700a3f312133130e9d897b33e5f389 (diff)
A few UB fixes (#1272)
* Fix OoB in ObjDriftie * Fix OoB in EnHorseLinkChild * Fix negative shift in jpegdecode * more oob fixes * AVOID_UB * clean * huh? * change viint.h macros * objdriftice * ub labelling * review * review * fix z_parameter arrays * u32 cast * missing &
Diffstat (limited to 'src/code/z_vimode.c')
-rw-r--r--src/code/z_vimode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c
index 2ddd27775..3909c7a05 100644
--- a/src/code/z_vimode.c
+++ b/src/code/z_vimode.c
@@ -153,14 +153,14 @@ void ViMode_Configure(OSViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 ant
viMode->comRegs.vSync++;
if (tvType == OS_TV_MPAL) {
viMode->comRegs.hSync += HSYNC(1, 4);
- viMode->comRegs.leap += LEAP((u16)-4, (u16)-2);
+ viMode->comRegs.leap += LEAP(-4, -2);
}
} else {
- viMode->fldRegs[0].vStart += START((u16)-3, (u16)-2);
+ viMode->fldRegs[0].vStart += START(-3, -2);
if (tvType == OS_TV_MPAL) {
- viMode->fldRegs[0].vBurst += BURST((u8)-2, (u8)-1, 12, -1);
+ viMode->fldRegs[0].vBurst += BURST(-2, -1, 12, -1);
} else if (tvType == OS_TV_PAL) {
- viMode->fldRegs[1].vBurst += BURST((u8)-2, (u8)-1, 2, 0);
+ viMode->fldRegs[1].vBurst += BURST(-2, -1, 2, 0);
}
}