summaryrefslogtreecommitdiff
path: root/src/boot/is_debug.c
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2021-10-03 05:17:09 +0200
committerGitHub <noreply@github.com>2021-10-02 23:17:09 -0400
commitf1d27bf6531fd6579d09dcf3078ee97c57b6fff1 (patch)
tree54d463be5b46f7fe77d1da1d8c34972db9092262 /src/boot/is_debug.c
parent5c95f70d5913ade28916464812c89c4dfa209e9e (diff)
Fix/cleanup/rephrase miscellaneous stuff (#983)
* Add parens around params usage in VEC_SET macro * Remove unnecessary space character in a xml * Use defines instead of magic values in head/tail magic comments * Use `OS_USEC_TO_CYCLES` to make a time look better in `Graph_TaskSet00` * `0x25800` -> `sizeof(u16[SCREEN_HEIGHT][SCREEN_WIDTH])` * `0x803DA800` -> `0x80400000 - frame buffer size` * Use `OS_VI_` defines instead of hex * Add empty line after some variable declarations * Remove unused `extern CutsceneData` in `z_bg_dy_yoseizo.c` * `Matrix_MtxFToYXZRotS` does not use `MTXMODE_` * Use `MTXMODE_` more * Remove `ASCII_TO_U32`, use `'IS64'` * Add explicit `!= NULL` in some ternaries * Use `INV_CONTENT`, `AMMO` macros more * Use `PLAYER_AP_` enum more to compare to `Player#heldItemActionParam` * Get rid of lowercase hex (outside libultra) * `gWindMill*` -> `gWindmill*` * Format and small fix enums in `z_boss_mo.h` * Use `CHECK_BTN_ANY` more * Fix xz/xy mistake in comment in tektite * Rephrase comments mentioning "the devs" in a more neutral way * Clean-up some objectively useless parens * Fix some negative values written as u16 instead of s16 in ichains * `SKJ_ACTON_` -> `SKJ_ACTION_` * Run formatter * Fix unk_ offset of `TransformUpdateIndex#unk_10` -> `unk_0E` * Remove comments using in-game text * Remove `U` suffix from integer literals * Revert "Remove `ASCII_TO_U32`, use `'IS64'`" This reverts commit c801337dde9fe5e8b7a7ecf85ad3629bf5b87aaf. * Use `PLAYER_STR_*` to compare to `CUR_UPG_VALUE(UPG_STRENGTH)` * Add empty line after decl x2 * Revert "Use `PLAYER_STR_*` to compare to `CUR_UPG_VALUE(UPG_STRENGTH)`" This reverts commit d80bdb32da449edc74e02b8ab3f5a2c532e74bdb. * Make `CUR_UPG_VALUE(UPG_STRENGTH)` compare to integers (eventually needs its own enum) * Only use `PLAYER_SHIELD_` enum with `Player#currentShield` * Only use `PLAYER_TUNIC_` enum with `Player#currentTunic`
Diffstat (limited to 'src/boot/is_debug.c')
-rw-r--r--src/boot/is_debug.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c
index 2b4fb87d8..13ce544b3 100644
--- a/src/boot/is_debug.c
+++ b/src/boot/is_debug.c
@@ -2,7 +2,7 @@
OSPiHandle* sISVHandle; // official name : is_Handle
-#define gISVDbgPrnAdrs ((ISVDbg*)0xb3ff0000)
+#define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000)
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
void isPrintfInit(void) {
@@ -55,8 +55,8 @@ void* is_proutSyncPrintf(void* arg, const char* str, u32 count) {
osEPiReadIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, &data);
start = data;
end = start + count;
- if (end >= 0xffe0) {
- end -= 0xffe0;
+ if (end >= 0xFFE0) {
+ end -= 0xFFE0;
if (pos < end || start < pos) {
return 1;
}
@@ -66,15 +66,16 @@ void* is_proutSyncPrintf(void* arg, const char* str, u32 count) {
}
}
while (count) {
- u32 addr = (u32)&gISVDbgPrnAdrs->data + (start & 0xffffffc);
+ u32 addr = (u32)&gISVDbgPrnAdrs->data + (start & 0xFFFFFFC);
s32 shift = ((3 - (start & 3)) * 8);
+
if (*str) {
osEPiReadIo(sISVHandle, addr, &data);
- osEPiWriteIo(sISVHandle, addr, (*str << shift) | (data & ~(0xff << shift)));
+ osEPiWriteIo(sISVHandle, addr, (*str << shift) | (data & ~(0xFF << shift)));
start++;
- if (start >= 0xffe0) {
- start -= 0xffe0;
+ if (start >= 0xFFE0) {
+ start -= 0xFFE0;
}
}
count--;