strip closed-Dxx debug scaffolding (D54/D63/D90) from compiled src/

Removes inert env-gated (GE_D54/GE_D63/GE_D90) probe blocks left in game
and libaudio TUs after those findings closed. All were #ifdef PORT +
getenv-guarded with no side effects; bg.c also drops a bare non-PORT
static (d63bgprimarycount) + entry log. No behaviour change.

Build green (ntsc-final, 10/10 link); -level_09 + -level_20 render
crash-free (19 frames each, Silo frame 300 @ 88.4% non-clear).
This commit is contained in:
James Dansereau committed 2026-08-31 15:41:03 -04:00
1 parent ae065c2082
commit cde5505840
9 files changed
-161

No files matched your search

-4
View File
@@ -2873,12 +2873,8 @@ void bgRoomsTickUnload(void)
* Ensures the room's bg data is loaded if budget allows, then appends its display list.
* Also resets the age of rendered rooms so bgRoomsTickUnload won't unload it.
*/
static int d63bgprimarycount = 0;
Gfx *bgRenderRoomPrimary(Gfx *gdl, s32 room_index)
{
if (getenv("GE_D63") && (d63bgprimarycount++ % 500 == 0))
osSyncPrintf("D63 bgRenderRoomPrimary called count=%d room=%d\n", d63bgprimarycount, room_index);
if (room_index >= g_MaxNumRooms)
{
return gdl;
-12
View File
@@ -231,12 +231,6 @@ Gfx *sub_GAME_7F01C1A4(Gfx *gdl) {
s32 die_blood_image_routine(s32 arg0) {
s8 sp37;
u8* temp_v0_2;
#ifdef PORT
/* TEMP D63: catch VTX-pool overflow into the gun-barrel buffer. */
extern u8 *g_GfxMemPos;
if (getenv("GE_D63"))
osSyncPrintf("D63 blood-routine arg=%d mempos=%p\n", arg0, (void *)g_GfxMemPos);
#endif
if (arg0 == 0) {
g_CurrentPlayer->bloodImgCur = die_blood_image_1;
@@ -249,12 +243,6 @@ s32 die_blood_image_routine(s32 arg0) {
g_CurrentPlayer->bloodImgIdx = (1 - g_CurrentPlayer->bloodImgIdx);
g_CurrentPlayer->bloodImgBufPtrArray[g_CurrentPlayer->bloodImgIdx] = dynAllocate(BLOOD_IMG_WIDTH * BLOOD_IMG_HEIGHT);
temp_v0_2 = dynAllocate(BLOOD_IMG_WIDTH * BLOOD_IMG_HEIGHT);
#ifdef PORT
if (getenv("GE_D63"))
osSyncPrintf("D63 blood: buf=%p temp=%p\n",
(void *)g_CurrentPlayer->bloodImgBufPtrArray[g_CurrentPlayer->bloodImgIdx],
(void *)temp_v0_2);
#endif
g_CurrentPlayer->bloodImgNxt = decrypt_bleeding_animation_data(g_CurrentPlayer->bloodImgCur, BLOOD_IMG_WIDTH, BLOOD_IMG_HEIGHT, temp_v0_2, &sp37);
bloodImgTranspose(temp_v0_2, BLOOD_IMG_WIDTH, BLOOD_IMG_HEIGHT, g_CurrentPlayer->bloodImgBufPtrArray[g_CurrentPlayer->bloodImgIdx]);
sub_GAME_7F01D02C(g_CurrentPlayer->bloodImgBufPtrArray[g_CurrentPlayer->bloodImgIdx], BLOOD_IMG_WIDTH, g_CurrentPlayer->bloodImgBufPtrArray[g_CurrentPlayer->bloodImgIdx]);
-16
View File
@@ -186,15 +186,6 @@ void bondviewLoadSetupIntroSection(void)
&& (check_ramrom_flags() == ((struct SetupIntroSpawn*)intro_record)->is_demo_playback))
{
g_Startpad[startpadcount] = &g_CurrentSetup.pads[((struct SetupIntroSpawn*)intro_record)->index];
#ifdef PORT
if (getenv("GE_D90")) {
struct SetupIntroSpawn *sp = (struct SetupIntroSpawn *)intro_record;
fprintf(stderr, "D90 SPAWN slot=%d padidx=%d is_demo=%d ramrom=%d stan=%p\n",
startpadcount, sp->index, sp->is_demo_playback,
check_ramrom_flags(),
(void *)g_Startpad[startpadcount]->stan);
}
#endif
startpadcount++;
}
@@ -470,13 +461,6 @@ void bondviewLoadSetupIntroSection(void)
g_CurrentPlayer->bondprevpos.f[2] = start_pos.f[2];
g_CurrentPlayer->prop->stan = start_stan;
#ifdef PORT
if (getenv("GE_D90"))
fprintf(stderr, "D90 spawn: startpadcount=%d rand_pad_index=%d start_stan=%p prop=%p pos=%.1f,%.1f,%.1f\n",
startpadcount, rand_pad_index, (void *)start_stan,
(void *)g_CurrentPlayer->prop,
start_pos.f[0], start_pos.f[1], start_pos.f[2]);
#endif
chrpropActivate(g_CurrentPlayer->prop);
chrpropEnable(g_CurrentPlayer->prop);
-39
View File
@@ -98,23 +98,6 @@ s32 dynGetFreeGfx2(Gfx *gdl) {
*/
Vtx *dynAllocateVertices(s32 count)
{
#ifdef PORT
/* TEMP D63: catch the gun-barrel sub-DL clobber with caller context. */
if (getenv("GE_D63")) {
static u32 s_last = 0;
static int s_init = 0;
static int s_changes = 0;
const u32 *slot = (const u32 *)0x7012EC38;
u32 cur = *slot;
if (!s_init) { s_init = 1; s_last = cur; }
else if (cur != s_last && s_changes < 64) {
osSyncPrintf("D63 vtx-alloc clobber: word@0x7012ec38 %08x -> %08x caller=%p mempos=%p\n",
s_last, cur, __builtin_return_address(0), (void *)g_GfxMemPos);
s_last = cur;
++s_changes;
}
}
#endif
void *ptr = g_GfxMemPos;
g_GfxMemPos += count * sizeof(Vtx);
return ptr;
@@ -145,28 +128,6 @@ void *dynAllocate(s32 size) {
}
void dynSwapBuffers(void) {
#ifdef PORT
/* TEMP D63: log buffer bounds + bump position each frame */
if (getenv("GE_D63")) {
static int d63dyncount = 0;
if ((d63dyncount++ % 100) == 0 || g_GfxMemPos > g_VtxBuffers[g_GfxActiveBufferIndex + 1]) {
osSyncPrintf("D63 dynSwap #%d active=%d gfx=[%p..%p) vtx=[%p..%p) mempos=%p\n",
d63dyncount, (int)g_GfxActiveBufferIndex,
(void *)g_GfxBuffers[g_GfxActiveBufferIndex],
(void *)g_GfxBuffers[g_GfxActiveBufferIndex + 1],
(void *)g_VtxBuffers[g_GfxActiveBufferIndex],
(void *)g_VtxBuffers[g_GfxActiveBufferIndex + 1],
(void *)g_GfxMemPos);
extern MemoryPool g_mempPools[];
for (int b = 0; b < 8; b++) {
if (g_mempPools[b].start || g_mempPools[b].end)
osSyncPrintf("D63 pool[%d] start=%p end=%p pos=%p prevpos=%p\n",
b, (void *)g_mempPools[b].start, (void *)g_mempPools[b].end,
(void *)g_mempPools[b].pos, (void *)g_mempPools[b].prevpos);
}
}
}
#endif
g_GfxActiveBufferIndex = (g_GfxActiveBufferIndex ^ 1);
g_GfxRequestedDisplayList = FALSE;
g_GfxMemPos = g_VtxBuffers[g_GfxActiveBufferIndex];
-22
View File
@@ -229,22 +229,6 @@ void rspGfxTaskStart(Gfx *firstGdl, Gfx *gdl, s32 arg2, OSMesg rspReplyMsg)
OSScTask *sctask;
OSTask *task;
#ifdef PORT
/* TEMP D63: log task submission (main thread) with tid */
if (getenv("GE_D63")) {
unsigned long tid = 0;
#if defined(PLATFORM_WINDOWS)
tid = GetCurrentThreadId();
#else
tid = (unsigned long)pthread_self();
#endif
osSyncPrintf("D63 rspGfxTaskStart first=%p last=%p size=%d tid=%lu slot=%08x\n",
(void *)firstGdl, (void *)gdl,
(int)((gdl - firstGdl) * sizeof(Gfx)), tid,
*(const u32 *)0x7012EC38);
}
#endif
sctask = &((struct GfxInfo_s *)g_gfxTaskSettingsList)->task;
task = &sctask->list;
@@ -281,12 +265,6 @@ void rspGfxTaskStart(Gfx *firstGdl, Gfx *gdl, s32 arg2, OSMesg rspReplyMsg)
sctask->framebuffer = (void *) ((struct GfxInfo_s *)g_gfxTaskSettingsList)->cfb;
#if defined(PORT)
/* TEMP D63: log the DL range before task submit (env GE_D63=1) */
if (getenv("GE_D63"))
osSyncPrintf("D63 rspGfxTaskStart firstGdl=%p gdl=%p\n", (void *)firstGdl, (void *)gdl);
#endif
osWritebackDCacheAll();
/* start graphic task */
-15
View File
@@ -43,11 +43,6 @@
#include "seqp.h"
#include "cseqp.h"
#include "cseq.h"
#ifdef PORT
/* TEMP D54 probe — delete before commit. */
#include <stdio.h>
#include <stdlib.h>
#endif
static ALMicroTime __CSPVoiceHandler(void *node);
@@ -447,16 +442,6 @@ static void __CSPHandleMIDIMsg(ALCSPlayer *seqp, ALEvent *event)
break;
sound = __lookupSoundQuick((ALSeqPlayer*)seqp, key, vel, chan);
#ifdef PORT
/* TEMP D54 probe — delete before commit. */
if (getenv("GE_D54")) {
fprintf(stderr, "D54 NOTEON seqp=%p chan=%d key=%d vel=%d sound=%p wt=%p inst=%p\n",
(void *)seqp, chan, key, vel, (void *)sound,
sound ? (void *)sound->wavetable : 0,
(void *)seqp->chanState[chan].instrument);
fflush(stderr);
}
#endif
ALFlagFailIf(!sound, seqp->debugFlags & NO_SOUND_ERR_MASK,
ERR_ALSEQP_NO_SOUND);
-18
View File
@@ -23,11 +23,6 @@
#include "synthInternals.h"
#include <os.h>
#include <R4300.h>
#ifdef PORT
/* TEMP D54 probe — delete before commit. */
#include <stdio.h>
#include <stdlib.h>
#endif
#ifndef MIN
# define MIN(a,b) (((a)<(b))?(a):(b))
@@ -364,19 +359,6 @@ alLoadParam(void *filter, s32 paramID, void *param)
switch (paramID) {
case (AL_FILTER_SET_WAVETABLE):
#ifdef PORT
/* TEMP D54 probe — delete before commit. */
if (getenv("GE_D54")) {
ALWaveTable *wt = (ALWaveTable *) param;
fprintf(stderr, "D54 SET_WAVETABLE wt=%p base=%p len=%d type=%d book=%p\n",
(void *)wt,
wt ? (void *)wt->base : 0,
wt ? wt->len : -1,
wt ? wt->type : -1,
(wt && wt->type == AL_ADPCM_WAVE) ? (void *)wt->waveInfo.adpcmWave.book : 0);
fflush(stderr);
}
#endif
a->table = (ALWaveTable *) param;
a->memin = (s32) a->table->base;
a->sample = 0;
-15
View File
@@ -42,11 +42,6 @@
#include "include/assert.h"
#include "seqp.h"
#include "seq.h"
#ifdef PORT
/* TEMP D54 probe — delete before commit. */
#include <stdio.h>
#include <stdlib.h>
#endif
static ALMicroTime __seqpVoiceHandler(void *node);
@@ -463,16 +458,6 @@ void __handleMIDIMsg(ALSeqPlayer *seqp, ALEvent *event)
break;
sound = __lookupSoundQuick(seqp, key, vel, chan);
#ifdef PORT
/* TEMP D54 probe — delete before commit. */
if (getenv("GE_D54")) {
fprintf(stderr, "D54 SFXNOTEON seqp=%p chan=%d key=%d vel=%d sound=%p wt=%p inst=%p\n",
(void *)seqp, chan, key, vel, (void *)sound,
sound ? (void *)sound->wavetable : 0,
(void *)seqp->chanState[chan].instrument);
fflush(stderr);
}
#endif
ALFlagFailIf(!sound, seqp->debugFlags & NO_SOUND_ERR_MASK,
ERR_ALSEQP_NO_SOUND);
-20
View File
@@ -209,26 +209,6 @@ void *mempAllocBytesInBank(u32 bytes, u8 poolnum)
if (needmemallocation);
#ifdef PORT
/* TEMP D63: map allocations around the gun-barrel buffer base 0x7012EA38. */
if (getenv("GE_D63")) {
u8 *a = allocation;
if ((a >= (u8 *)0x70129000 && a < (u8 *)0x7012EA38) ||
(a >= (u8 *)0x7012D000 && a < (u8 *)0x7012F500)) {
static u32 s_seen[64];
static u32 s_sizes[64];
int i, n = 0;
for (i = 0; i < 64 && s_seen[i]; i++) {
if (s_seen[i] == (u32)a && s_sizes[i] == bytes) return allocation;
}
for (n = 0; n < 64 && s_seen[n]; n++);
if (n < 64) { s_seen[n] = (u32)a; s_sizes[n] = bytes; }
osSyncPrintf("D63 alloc %p size=%x ra=%p\n", (void *)a, bytes,
__builtin_return_address(0));
}
}
#endif
return allocation;
}