From a2c3feb67a2f8afb1cebd0e77e4a3e23db2c28c4 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Wed, 1 May 2024 10:09:49 -0600 Subject: WIP Compilation --- src/debug/all_variables.h | 2 +- src/debug/crash_screen_enhancement.c | 10 +++++----- src/debug/crash_screen_enhancement.h | 2 +- src/debug/debug.c | 26 +++++++++++++------------- src/debug/debug.inc.c | 16 ++++++++-------- 5 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/debug') diff --git a/src/debug/all_variables.h b/src/debug/all_variables.h index 561a23ea6..73b15e69d 100644 --- a/src/debug/all_variables.h +++ b/src/debug/all_variables.h @@ -63,7 +63,7 @@ #include #include #include "buffers/trig_tables.h" -#include +#include #include #include diff --git a/src/debug/crash_screen_enhancement.c b/src/debug/crash_screen_enhancement.c index 574b3f531..4c05f28ae 100644 --- a/src/debug/crash_screen_enhancement.c +++ b/src/debug/crash_screen_enhancement.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -126,9 +126,9 @@ void crash_screen_print(s32 x, s32 y, const char *fmt, ...) { void crash_screen_sleep(s32 ms) { u64 cycles = ms * 1000LL * osClockRate / 1000000ULL; - osSetTime(0); - while (osGetTime() < cycles) { - } + // osSetTime(0); + // while (osGetTime() < cycles) { + // } } void crash_screen_print_float_reg(s32 x, s32 y, s32 regNum, void *addr) { @@ -215,6 +215,6 @@ void crash_screen_draw(OSThread* thread) { crash_screen_print_float_reg(120, 210, 26, &tc->fp26.f.f_even); crash_screen_print_float_reg(210, 210, 28, &tc->fp28.f.f_even); crash_screen_print_float_reg(30, 220, 30, &tc->fp30.f.f_even); - osViBlack(FALSE); + osViBlack(false); osViSwapBuffer(pFramebuffer); } diff --git a/src/debug/crash_screen_enhancement.h b/src/debug/crash_screen_enhancement.h index 9f9a321ca..5860f9226 100644 --- a/src/debug/crash_screen_enhancement.h +++ b/src/debug/crash_screen_enhancement.h @@ -1,7 +1,7 @@ #ifndef CRASH_SCREEN_ENHANCEMENT_H #define CRASH_SCREEN_ENHANCEMENT_H -#include +#include #include void crash_screen_draw(OSThread* thread); diff --git a/src/debug/debug.c b/src/debug/debug.c index cdc333dc5..f5daa4397 100644 --- a/src/debug/debug.c +++ b/src/debug/debug.c @@ -1,4 +1,4 @@ -#include +#include #include #include "debug.inc.c" #include @@ -82,14 +82,14 @@ static u32 variable_to_u64(variableWatchAttributes *attribute) { u32 variable; switch (attribute->variableSize) { - case sizeof(u8): + case sizeof(u8): variable = *((u8*) attribute->variablePointer); break; - case sizeof(u16): + case sizeof(u16): variable = *((u16*) attribute->variablePointer); break; case sizeof(u32): - case sizeof(u64): + case sizeof(u64): variable = *((u32*) attribute->variablePointer); // no floating point rounding break; default: @@ -103,7 +103,7 @@ static void round_up_float(u32 *variable, u8 variableSize) { switch (variableSize) { case sizeof(u64): case sizeof(u32): - *variable = (u32) (*(f32*) &*variable); + *variable = (u32) (*(f32*) &*variable); break; default: sDisplayListState = BAD; @@ -131,7 +131,7 @@ static void u64_to_string(variableWatchAttributes *attribute, u32 variable, u8 b switch (variableSize) { case sizeof(u8): signedVariable = (s8) variable; - if (signedVariable < 0) { + if (signedVariable < 0) { signedVariable = -signedVariable; variable = (u8) signedVariable; *bufferedString = '-'; @@ -150,7 +150,7 @@ static void u64_to_string(variableWatchAttributes *attribute, u32 variable, u8 b case sizeof(u32): case sizeof(u64): signedVariable = (s32) variable; - if (signedVariable < 0) { + if (signedVariable < 0) { signedVariable = -signedVariable; variable = (u32) signedVariable; *bufferedString = '-'; @@ -164,11 +164,11 @@ static void u64_to_string(variableWatchAttributes *attribute, u32 variable, u8 b // convert u64 into a string but it gets put in reverse if (base != HEXIDECIMAL) { - do { + do { stringLength++; *bufferedString = variable % base + '0'; bufferedString++; - variable /= base; + variable /= base; } while (variable != 0); } else { do { @@ -186,8 +186,8 @@ static void u64_to_string(variableWatchAttributes *attribute, u32 variable, u8 b } while (variable != 0); } - bufferedString -= stringLength; - upperIndex = stringLength - 1; + bufferedString -= stringLength; + upperIndex = stringLength - 1; // flip string 4321 --> 1234 for (lowerIndex = 0; lowerIndex < stringLength >> 1; lowerIndex++) { @@ -228,7 +228,7 @@ static void u64_to_string(variableWatchAttributes *attribute, u32 variable, u8 b static u32 _strlen(const char *str) { u32 len; - + len = 0; for (; *str != '\0'; str++) { len++; @@ -245,7 +245,7 @@ static void _memcpy(char *destStr, const char *copyStr, u32 copySize) { *destStr = *copyStr; destStr++; copyStr++; - } + } } #endif diff --git a/src/debug/debug.inc.c b/src/debug/debug.inc.c index 758bf3600..82f26be03 100644 --- a/src/debug/debug.inc.c +++ b/src/debug/debug.inc.c @@ -1,4 +1,4 @@ -#include +#include #include #include "all_variables.h" @@ -6,7 +6,7 @@ extern s32 gGlobalTimer; -/** +/** * Edit this to edit what displays on the screen while the DVDL is active. * The Size of the structure array is calculated at compile time. */ @@ -14,42 +14,42 @@ variableWatchAttributes gMainVariableWatchList[] = { { "Global Timer: ", &gGlobalTimer, - sizeof(gGlobalTimer), + sizeof(gGlobalTimer), DISPLAY_DECIMAL_NUMBER | DISPLAY_SIGNED_NUMBER, 0, 0 }, { "Actors: ", &gNumActors, - sizeof(gNumActors), + sizeof(gNumActors), DISPLAY_DECIMAL_NUMBER, 0, 0 }, { "Player Type: ", &gPlayers[0].type, - sizeof(gPlayerOne->type), + sizeof(gPlayerOne->type), DISPLAY_HEXIDECIMAL_NUMBER, 0, 0 }, { "X ", &gPlayers[0].pos[0], - sizeof(gPlayerOne->pos[0]), + sizeof(gPlayerOne->pos[0]), DISPLAY_FLOAT_NUMBER, 0, 0 }, { "Y ", &gPlayers[0].pos[1], - sizeof(gPlayerOne->pos[1]), + sizeof(gPlayerOne->pos[1]), DISPLAY_FLOAT_NUMBER, 0, 0 }, { "Z ", &gPlayers[0].pos[2], - sizeof(gPlayerOne->pos[2]), + sizeof(gPlayerOne->pos[2]), DISPLAY_FLOAT_NUMBER, 0, 0 }, -- cgit v1.2.3