forked from Ports/goldeneye-pc-port
zbufClearCurrentPlayer (viewport.c) clears the N64 Z buffer with the 'point the colour image at the Z buffer and gDPFillRectangle it' idiom. fast3d does not emulate that: gfx_dp_fill_rectangle bails when color_image_address == z_buf_address assuming glClear already cleared depth, but the frame-start clear_framebuffer(true,false) is colour-only. fast3d expects G_CLEAR_DEPTH_EXT (0x44) for a real depth clear and GE never emits it. Here the two addresses don't even match (gDPSetDepthImage(z_buffer & ~0x3F) vs gDPSetColorImage(K0_TO_PHYSICAL)) so the packed-Z fill colour is scribbled onto the framebuffer instead. Net: every in-level frame rendered against a stale/garbage depth buffer, all ~160k room triangles failed the Z test, only skyRender's background fill survived -> flat dark-blue screen + HUD. PORT branch in zbufClearCurrentPlayer emits a bare G_CLEAR_DEPTH_EXT and returns, skipping the N64 idiom (a no-op / harmful in fast3d anyway). Verified -level_09: 90% flat sky-colour -> 2585 distinct colours, sky 16%; recognisable BUNKER1 (textured walls, storage racks, floor). 70s crash-free. Adds GE_D104 room-render-pass probe in bg.c (gated, capped). Remaining: dark-blue wedge (geometry gap) + brown band top third (ceiling tex); then struct player weapon/offset pass; then D75(b).