1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-14 03:44:34 +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,82 +1,76 @@
#include <z64.h>
#include <global.h>
OSPiHandle* sISVHandle; //official name : is_Handle
OSPiHandle* sISVHandle; // official name : is_Handle
#define gISVDbgPrnAdrs ((ISVDbg*)0xb3ff0000)
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
void isPrintfInit()
{
void isPrintfInit() {
sISVHandle = osCartRomInit();
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0);
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, 0);
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I','S','6','4'));
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I', 'S', '6', '4'));
}
void osSyncPrintfUnused(const char* fmt, ...)
{
void osSyncPrintfUnused(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
}
void osSyncPrintf(const char* fmt, ...)
{
void osSyncPrintf(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
}
//assumption
void rmonPrintf(const char* fmt, ...)
{
// assumption
void rmonPrintf(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
_Printf(&is_proutSyncPrintf, NULL, fmt, args);
}
u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count)
{
u32 is_proutSyncPrintf(void* arg0, const char* str, s32 count) {
u32 data;
s32 pos;
s32 start;
s32 end;
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, &data);
if (data != ASCII_TO_U32('I','S','6','4'))
if (data != ASCII_TO_U32('I', 'S', '6', '4')) {
return 1;
}
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, &data);
pos = data;
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, &data);
start = data;
end = start + count;
if (end >= 0xffe0)
{
if (end >= 0xffe0) {
end -= 0xffe0;
if (pos < end || start < pos)
if (pos < end || start < pos) {
return 1;
}
else
{
if (start < pos && pos < end)
}
} else {
if (start < pos && pos < end) {
return 1;
}
}
while (count)
{
while (count) {
u32 addr = (u32)&gISVDbgPrnAdrs->data + (start & 0xffffffc);
s32 shift = ((3 - (start & 3)) * 8);
if (*str)
{
if (*str) {
osEPiReadIo(sISVHandle, addr, &data);
osEPiWriteIo(sISVHandle, addr, (*str << shift) | (data & ~(0xff << shift)));
start++;
if (start >= 0xffe0)
if (start >= 0xffe0) {
start -= 0xffe0;
}
}
count--;
str++;
@ -85,9 +79,9 @@ u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count)
return 1;
}
void func_80002384(const char* exp, const char* file, u32 line)
{
void func_80002384(const char* exp, const char* file, u32 line) {
osSyncPrintf("File:%s Line:%d %s \n", file, line, exp);
while (true)
while (true) {
;
}
}