1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-14 11:00:41 +00:00

Format all src C files

This commit is contained in:
Roman971 2020-03-22 22:19:43 +01:00
parent 251aea64ab
commit 8cfe7cce9f
652 changed files with 12488 additions and 19093 deletions

View file

@ -1,12 +1,11 @@
#include <global.h>
#include <ultra64/hardware.h>
typedef struct
{
u32 ins_00; //lui k0, 0x8000
u32 ins_04; //addiu k0, k0, 0x39e0
u32 ins_08; //jr k0 ; __osException
u32 ins_0C; //nop
typedef struct {
u32 ins_00; // lui k0, 0x8000
u32 ins_04; // addiu k0, k0, 0x39e0
u32 ins_08; // jr k0 ; __osException
u32 ins_0C; // nop
} struct_exceptionPreamble;
u64 osClockRate = 62500000;
@ -16,14 +15,13 @@ u32 __OSGlobalIntMask = 0x003FFF01;
u32 D_800145C0;
void __createSpeedParam(void)
{
void __createSpeedParam(void) {
__Dom1SpeedParam.type = DEVICE_TYPE_INIT;
__Dom1SpeedParam.latency = HW_REG(PI_BSD_DOM1_LAT_REG, u32);
__Dom1SpeedParam.pulse = HW_REG(PI_BSD_DOM1_PWD_REG, u32);
__Dom1SpeedParam.pageSize = HW_REG(PI_BSD_DOM1_PGS_REG, u32);
__Dom1SpeedParam.relDuration = HW_REG(PI_BSD_DOM1_RLS_REG, u32);
__Dom2SpeedParam.type = DEVICE_TYPE_INIT;
__Dom2SpeedParam.latency = HW_REG(PI_BSD_DOM2_LAT_REG, u32);
__Dom2SpeedParam.pulse = HW_REG(PI_BSD_DOM2_PWD_REG, u32);
@ -31,25 +29,26 @@ void __createSpeedParam(void)
__Dom2SpeedParam.relDuration = HW_REG(PI_BSD_DOM2_RLS_REG, u32);
}
void __osInitialize_common(void)
{
void __osInitialize_common(void) {
u32 sp2C;
D_800145C0 = 1;
__osSetSR(__osGetSR() | 0x20000000);
__osSetFpcCsr(0x1000800);
__osSetWatchLo(0x4900000);
while (__osSiRawReadIo((void*)0x1fc007fc, &sp2C))
;
while (__osSiRawWriteIo((void*)0x1fc007fc, sp2C | 8))
while (__osSiRawReadIo((void*)0x1fc007fc, &sp2C)) {
;
*(struct_exceptionPreamble*)0x80000000 = *(struct_exceptionPreamble*)__osExceptionPreamble; //TLB miss
*(struct_exceptionPreamble*)0x80000080 = *(struct_exceptionPreamble*)__osExceptionPreamble; //XTLB miss
*(struct_exceptionPreamble*)0x80000100 = *(struct_exceptionPreamble*)__osExceptionPreamble; //cache errors
*(struct_exceptionPreamble*)0x80000180 = *(struct_exceptionPreamble*)__osExceptionPreamble; //general exceptions
}
while (__osSiRawWriteIo((void*)0x1fc007fc, sp2C | 8)) {
;
}
*(struct_exceptionPreamble*)0x80000000 = *(struct_exceptionPreamble*)__osExceptionPreamble; // TLB miss
*(struct_exceptionPreamble*)0x80000080 = *(struct_exceptionPreamble*)__osExceptionPreamble; // XTLB miss
*(struct_exceptionPreamble*)0x80000100 = *(struct_exceptionPreamble*)__osExceptionPreamble; // cache errors
*(struct_exceptionPreamble*)0x80000180 = *(struct_exceptionPreamble*)__osExceptionPreamble; // general exceptions
osWritebackDCache(0x80000000, 0x190);
osInvalICache(0x80000000, 0x190);
@ -59,25 +58,28 @@ void __osInitialize_common(void)
osClockRate = (u64)((osClockRate * 3ll) / 4ull);
if (!osResetType)
if (!osResetType) {
bzero(osAppNmiBuffer, 0x40);
}
if (osTvType == 0)
if (osTvType == 0) {
osViClock = VI_PAL_CLOCK;
else if (osTvType == 2)
} else if (osTvType == 2) {
osViClock = VI_MPAL_CLOCK;
else
} else {
osViClock = VI_NTSC_CLOCK;
}
if (__osGetCause() & 0x1000)
while (true)
if (__osGetCause() & 0x1000) {
while (true) {
;
}
}
HW_REG(AI_CONTROL_REG, u32) = 1;
HW_REG(AI_DACRATE_REG, u32) = 0x3fff;
HW_REG(AI_BITRATE_REG, u32) = 0xf;
}
void __osInitialize_autodetect()
{
void __osInitialize_autodetect() {
}