Use Macro for __FILE__ & __LINE__ when possible (#559)

* First batch some overlay

* Almost all overlay

* effect & gamestate

* kaleido stuffs

* more overlay

* more left over from code folder

* remaining hardcoded line and file

* Open & Close _DISP __FILE__ & __LINE__ clean up

* Some if (1) {} remove

* LOG_xxxx __FILE__ , __LINE__ cleaned

* ASSERT macro __FILE__ __LINE__

* mtx without line/file in functions

* " if (1) {} " & "if (0) {}" and tab/white place

* LogUtils as macro

* GameState_, GameAlloc_, SystemArena_ & ZeldaArena_

* Revert "GameState_, GameAlloc_, SystemArena_ & ZeldaArena_"

This reverts commit 0d85caaf7e.

* Like last commit but as macro

* Fix matrix not using macros

* use function not macro

* DebugArena_* functions
GameAlloc_MallocDebug
BgCheck_PosErrorCheck as macros
removed issues with ; in macro file
This commit is contained in:
Baoulettes 2022-07-06 01:29:34 +02:00 committed by GitHub
parent a9c3c7541e
commit a5df9dddf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
467 changed files with 3081 additions and 3459 deletions

View file

@ -410,7 +410,7 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
sEntranceIconMapIndex = extendedMapIndex;
//DmaMgr_SendRequest1(interfaceCtx->mapSegment,
//(uintptr_t)_map_grand_staticSegmentRomStart + gMapData->owMinimapTexOffset[extendedMapIndex],
//gMapData->owMinimapTexSize[mapIndex], "../z_map_exp.c", 309);
//gMapData->owMinimapTexSize[mapIndex], __FILE__, __LINE__);
if (sEntranceIconMapIndex < 24)
memcpy(globalCtx->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(minimapTableOW[sEntranceIconMapIndex]), gMapData->owMinimapTexSize[mapIndex]);
@ -443,7 +443,7 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
//DmaMgr_SendRequest1(globalCtx->interfaceCtx.mapSegment,
//(uintptr_t)_map_i_staticSegmentRomStart +
//((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * 0xFF0),
//0xFF0, "../z_map_exp.c", 346);
//0xFF0, __FILE__, __LINE__);
memcpy(globalCtx->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(minimapTableDangeon[gMapData->dgnMinimapTexIndexOffset[mapIndex] + room]), 0xFF0);
@ -516,11 +516,11 @@ void Map_Init(GlobalContext* globalCtx) {
interfaceCtx->unk_258 = -1;
interfaceCtx->unk_25A = -1;
interfaceCtx->mapSegment = GameState_Alloc(&globalCtx->state, 0x1000, "../z_map_exp.c", 457);
interfaceCtx->mapSegment = GAMESTATE_ALLOC_MC(&globalCtx->state, 0x1000);
// " texture initialization scene_data_ID=%d mapSegment=%x"
osSyncPrintf("\n\n\n テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", globalCtx->sceneNum,
interfaceCtx->mapSegment, globalCtx);
ASSERT(interfaceCtx->mapSegment != NULL, "parameter->mapSegment != NULL", "../z_map_exp.c", 459);
ASSERT(interfaceCtx->mapSegment != NULL);
switch (globalCtx->sceneNum) {
case SCENE_SPOT00:
@ -599,7 +599,7 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 tempX, tempZ;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 565);
OPEN_DISPS(globalCtx->state.gfxCtx);
if (globalCtx->interfaceCtx.minimapAlpha >= 0xAA) {
func_80094A14(globalCtx->state.gfxCtx);
@ -618,7 +618,7 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
Matrix_RotateX(-1.6f, MTXMODE_APPLY);
tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400;
Matrix_RotateY(tempX / 10.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_map_exp.c", 585),
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255);
@ -632,14 +632,14 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY);
Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY);
Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_map_exp.c", 603),
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0xFF, 200, 0, 0, 255);
gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL);
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 607);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void Minimap_Draw(GlobalContext* globalCtx) {
@ -647,7 +647,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s32 mapIndex = gSaveContext.mapIndex;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 626);
OPEN_DISPS(globalCtx->state.gfxCtx);
if (globalCtx->pauseCtx.state < 4) {
switch (globalCtx->sceneNum) {
@ -819,7 +819,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
}
}
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_map_exp.c", 782);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
s16 Map_GetFloorTextIndexOffset(s32 mapIndex, s32 floor) {
@ -876,7 +876,6 @@ void Map_Update(GlobalContext* globalCtx) {
if (R_MAP_TEX_INDEX != (R_MAP_TEX_INDEX_BASE + Map_GetFloorTextIndexOffset(mapIndex, floor))) {
R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE + Map_GetFloorTextIndexOffset(mapIndex, floor);
}
if (1) {} // Appears to be necessary to match
if (interfaceCtx->mapRoomNum != sLastRoomNum) {
// "Current floor = %d Current room = %x Number of rooms = %d"