D243 M-154: chrdraw census probe + extended tick fields (GE_D243M)

Discriminates the two remaining hypotheses for the Dam-abseil frozen
Bonds (H1 multiple Model instances vs H2 framebuffer accumulation):

- objecthandler.c drawjointlist (both region variants): new
  'D243M: chrdraw' line per CHR render submission while a scripted
  camera mode is active (POSEND/INTRO/SWIRL/FADESWIRL), logging Model*
  + raw root-matrix translation. A second Bond instance = extra lines
  with distinct model pointers at the same frame. All CHR draws funnel
  through here (chrRenderProp; player path bondview2.c:10883, generic
  chrprop.c:443).
- bondview2.c tick probe extended: propptr/chrptr (phase-3 A,A,B,C
  position cycle could be pp->prop rotating among three PropRecords),
  rp= render_pos pointer (change = buffer reassignment/aliasing),
  raw= pre-view-transform root translation (model-matrix vs
  view-matrix origin of the cycle).
- bondview2.c: d243mProbeActive()/d243mGetFrameCounter() accessors;
  camera gate folded into active() so objecthandler.c needs no
  bondview.h include. D250 cached getenv kept.

#ifdef PORT only; silent when GE_D243M unset or during FPS play.
Smoke: 45s bare -level_33 boot -> 4,053 chrdraw + 1,066 tick lines,
clean link, no behaviour change.
This commit is contained in:
James Dansereau committed 2026-09-16 16:47:31 -04:00
1 parent 8d42ac5ee2
commit 1b3476a401
2 files changed
+70 -3

No files matched your search

+39 -3
View File
@@ -365,6 +365,19 @@ static int d243mEnabled(void)
} }
static int g_d243mFrameCounter = 0; static int g_d243mFrameCounter = 0;
/* M-154: accessors for the D243M: chrdraw census probe in objecthandler.c's
* drawjointlist (which does not include bondview.h). ProbeActive() folds in
* the scripted-camera gate (POSEND/INTRO/SWIRL/FADESWIRL) so callers need no
* camera-mode knowledge; silent during FPS play. */
int d243mProbeActive(void)
{
return d243mEnabled() &&
((g_CameraMode == CAMERAMODE_POSEND) || (g_CameraMode == CAMERAMODE_INTRO) ||
(g_CameraMode == CAMERAMODE_SWIRL) || (g_CameraMode == CAMERAMODE_FADESWIRL));
}
int d243mGetFrameCounter(void) { return g_d243mFrameCounter; }
#endif #endif
void solo_char_load(void) void solo_char_load(void)
@@ -10394,11 +10407,32 @@ s32 playerTick(PropRecord *prop)
int cutsceneCam = ((g_CameraMode == CAMERAMODE_POSEND) || (g_CameraMode == CAMERAMODE_INTRO)); int cutsceneCam = ((g_CameraMode == CAMERAMODE_POSEND) || (g_CameraMode == CAMERAMODE_INTRO));
g_d243mFrameCounter++; g_d243mFrameCounter++;
if (cutsceneCam || (pp->bodyModel != NULL)) { if (cutsceneCam || (pp->bodyModel != NULL)) {
osSyncPrintf("D243M: tick frame=%d idx=%d model=%p cam=%d subcam=%d " /* M-154: rp = the render_pos pointer itself (a change between
* phases would mean the Model's matrix buffer is being
* reassigned/aliased); raw = render_pos[0]'s translation BEFORE
* the view transform (distinguishes model-matrix cycling from
* view-matrix cycling in f488pos). */
RenderPosView *d243mrp = (pp->bodyModel != NULL) ? pp->bodyModel->render_pos : NULL;
double d243mrx = 0.0, d243mry = 0.0, d243mrz = 0.0;
if (d243mrp != NULL) {
Mtxf *d243mraw = (Mtxf *) d243mrp;
d243mrx = d243mraw->m[3][0];
d243mry = d243mraw->m[3][1];
d243mrz = d243mraw->m[3][2];
}
/* M-154b: propptr/chrptr -- the phase-3 A,A,B,C position cycle
* with smoothly falling y could mean pp->prop itself rotates
* among three PropRecords per frame; a changing pointer proves
* it, a constant one points at a cycling x/z source (script /
* anim table). */
osSyncPrintf("D243M: tick frame=%d idx=%d model=%p propptr=%p chrptr=%p "
"cam=%d subcam=%d "
"prop=%.1f,%.1f,%.1f f488pos=%.1f,%.1f,%.1f " "prop=%.1f,%.1f,%.1f f488pos=%.1f,%.1f,%.1f "
"f3B8=%.1f,%.1f,%.1f f3C4=%.1f,%.1f,%.1f\n", "f3B8=%.1f,%.1f,%.1f f3C4=%.1f,%.1f,%.1f "
"rp=%p raw=%.1f,%.1f,%.1f\n",
g_d243mFrameCounter, index, g_d243mFrameCounter, index,
(void *) pp->bodyModel, (void *) pp->bodyModel,
(void *) pp->prop, (void *) pp->prop->chr,
(int) g_CameraMode, (int) dword_CODE_bss_80079A18, (int) g_CameraMode, (int) dword_CODE_bss_80079A18,
(double) pp->prop->pos.f[0], (double) pp->prop->pos.f[0],
(double) pp->prop->pos.f[1], (double) pp->prop->pos.f[1],
@@ -10411,7 +10445,9 @@ s32 playerTick(PropRecord *prop)
(double) pp->field_3B8.f[2], (double) pp->field_3B8.f[2],
(double) pp->field_3C4, (double) pp->field_3C4,
(double) pp->field_3C8, (double) pp->field_3C8,
(double) pp->field_3CC); (double) pp->field_3CC,
(void *) d243mrp,
d243mrx, d243mry, d243mrz);
} }
} }
#endif #endif
+31
View File
@@ -887,6 +887,24 @@ void drawjointlist(ModelRenderData *data, ModelHitEntry *entry)
Gfx *gdl; Gfx *gdl;
s32 opcode; s32 opcode;
#ifdef PORT
/* D243 M-154: per-frame model-draw census. One line per drawjointlist
* call (i.e. per CHR render submission) while a scripted camera mode is
* active, logging the Model* pointer and render_pos[0]'s raw translation
* BEFORE the view transform. A second Bond instance shows up as extra
* lines with distinct model pointers at the same frame; a shared/aliased
* matrix buffer shows up as one pointer whose raw position cycles.
* Diagnosis only; silent when GE_D243M is unset or during FPS play. */
extern int d243mProbeActive(void);
extern int d243mGetFrameCounter(void);
if (d243mProbeActive() && (entry != NULL) && (entry->model != NULL) && (entry->model->render_pos != NULL)) {
Mtxf *d243mraw = (Mtxf *) entry->model->render_pos;
osSyncPrintf("D243M: chrdraw frame=%d model=%p raw=%.1f,%.1f,%.1f\n",
d243mGetFrameCounter(), (void *) entry->model,
(double) d243mraw->m[3][0], (double) d243mraw->m[3][1], (double) d243mraw->m[3][2]);
}
#endif
if (data->gdl == NULL) if (data->gdl == NULL)
{ {
osSyncPrintf("drawjointlist: no gfxlist!\n"); osSyncPrintf("drawjointlist: no gfxlist!\n");
@@ -1014,6 +1032,19 @@ void drawjointlist(ModelRenderData *data, ModelHitEntry *entry)
Gfx *gdl; Gfx *gdl;
s32 opcode; s32 opcode;
#ifdef PORT
/* D243 M-154: per-frame model-draw census (EU variant) -- see the US/JP
* copy above for the full rationale. */
extern int d243mProbeActive(void);
extern int d243mGetFrameCounter(void);
if (d243mProbeActive() && (entry != NULL) && (entry->model != NULL) && (entry->model->render_pos != NULL)) {
Mtxf *d243mraw = (Mtxf *) entry->model->render_pos;
osSyncPrintf("D243M: chrdraw frame=%d model=%p raw=%.1f,%.1f,%.1f\n",
d243mGetFrameCounter(), (void *) entry->model,
(double) d243mraw->m[3][0], (double) d243mraw->m[3][1], (double) d243mraw->m[3][2]);
}
#endif
while (entry != NULL) while (entry != NULL)
{ {
root = entry->rootnode; root = entry->rootnode;