fix typo debug (#660)

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
coco875 2024-08-01 05:11:24 +02:00 committed by GitHub
parent 9b779c1466
commit 2f288fbe10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 19 deletions

View File

@ -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

View File

@ -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
},