1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-09 16:30:19 +00:00

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 c801337dde.

* 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 d80bdb32da.

* 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`
This commit is contained in:
Dragorn421 2021-10-03 05:17:09 +02:00 committed by GitHub
parent 5c95f70d59
commit f1d27bf653
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 327 additions and 323 deletions

View file

@ -51,7 +51,7 @@ void Idle_ThreadEntry(void* arg) {
osCreateViManager(OS_PRIORITY_VIMGR);
gViConfigFeatures = 0x42;
gViConfigFeatures = OS_VI_GAMMA_OFF | OS_VI_DITHER_FILTER_ON;
gViConfigXScale = 1.0f;
gViConfigYScale = 1.0f;

View file

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

View file

@ -44,7 +44,7 @@ void LogUtils_LogHexDump(void* ptr, s32 size0) {
}
i++;
if (i > 0xf) {
if (i > 0xF) {
break;
}
}
@ -54,13 +54,13 @@ void LogUtils_LogHexDump(void* ptr, s32 size0) {
while (true) {
if (i < rest) {
u8 a = *(addr + i);
osSyncPrintf("%c", (a >= 0x20 && a < 0x7f) ? a : '.');
osSyncPrintf("%c", (a >= 0x20 && a < 0x7F) ? a : '.');
} else {
osSyncPrintf(" ");
}
i++;
if (i > 0xf) {
if (i > 0xF) {
break;
}
}

View file

@ -99,7 +99,7 @@ StackStatus StackCheck_GetState(StackEntry* entry) {
}
osSyncPrintf("head=%08x tail=%08x last=%08x used=%08x free=%08x [%s]\n", entry->head, entry->tail, last, used, free,
entry->name ? entry->name : "(null)");
entry->name != NULL ? entry->name : "(null)");
osSyncPrintf(VT_RST);
if (ret != STACK_STATUS_OK) {

View file

@ -1699,7 +1699,8 @@ void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorName, cons
osSyncPrintf("%c", 7);
osSyncPrintf(VT_FGCOL(RED));
osSyncPrintf("DMA致命的エラー(%s)\nROM:%X RAM:%X SIZE:%X %s\n",
errorDesc ? errorDesc : (errorName ? errorName : "???"), vrom, ram, size, file ? file : "???");
errorDesc != NULL ? errorDesc : (errorName != NULL ? errorName : "???"), vrom, ram, size,
file != NULL ? file : "???");
if (req->filename) {
osSyncPrintf("DMA ERROR: %s %d", req->filename, req->line);
@ -1714,10 +1715,10 @@ void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorName, cons
} else if (sDmaMgrCurFileName) {
sprintf(buff1, "DMA ERROR: %s %d", sDmaMgrCurFileName, sDmaMgrCurFileLine);
} else {
sprintf(buff1, "DMA ERROR: %s", errorName ? errorName : "???");
sprintf(buff1, "DMA ERROR: %s", errorName != NULL ? errorName : "???");
}
sprintf(buff2, "%07X %08X %X %s", vrom, ram, size, file ? file : "???");
sprintf(buff2, "%07X %08X %X %s", vrom, ram, size, file != NULL ? file : "???");
Fault_AddHungupAndCrashImpl(buff1, buff2);
}
@ -1733,7 +1734,7 @@ const char* DmaMgr_GetFileNameImpl(u32 vrom) {
iter++;
name++;
}
//! @bug Since the devs forgot to return in case the file isn't found, the return value will be a pointer to the end
//! @bug Since there is no return, in case the file isn't found, the return value will be a pointer to the end
// of gDmaDataTable
}
@ -1860,7 +1861,7 @@ void DmaMgr_ThreadEntry(void* arg0) {
s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk, OSMesgQueue* queue, OSMesg msg) {
static s32 sDmaMgrQueueFullLogged = 0;
if ((1 && (ram == 0)) || (osMemSize < ram + size + 0x80000000) || (vrom & 1) || (vrom > 0x4000000U) ||
if ((1 && (ram == 0)) || (osMemSize < ram + size + 0x80000000) || (vrom & 1) || (vrom > 0x4000000) ||
(size == 0) || (size & 1)) {
DmaMgr_Error(req, NULL, "ILLIGAL DMA-FUNCTION CALL", "パラメータ異常です");
}