DEV Community

Nivando Soares
Nivando Soares

Posted on

Porting Test Drive II from SNES to PC, Part 22: Demoting M7SEL edge handling on the static Mode 7 plateau

Porting Test Drive II from SNES to PC, Part 22: Demoting M7SEL edge handling on the static Mode 7 plateau

The previous checkpoint narrowed the late attract tail to one mostly-BG Mode 7 plateau.

That still left an easy trap:

if a small horizontal bias helped the BG-only compare, was the next thing to chase some Mode 7 edge rule like M7SEL fill or transparent-outside behavior?

This checkpoint says: probably not.

The new builder read

I extended the plateau helper so it now reports explicit Mode 7 sampling stats for the plateau bboxes.

That means the artifact no longer answers only:

  • is the plateau static?
  • is it mostly BG or mostly sprite overlap?
  • does a small horizontal bias help?

It now also answers:

  • does the plateau box ever leave the 1024x1024 Mode 7 map at all?

That matters because if the box never touches the outside-map path, then M7SEL edge fill and transparent-outside behavior are simply not on the hot path for this scene.

The concrete result

The canonical plateau is still frame 1105, representing the static tail 1105..1117.

For the two important boxes:

  • main diff box: 24,68 -> 232,138
  • BG-only diff box: 24,67 -> 232,138

The updated helper now proves:

  • base hscroll = 0: 0 outside-map pixels
  • best tested BG-only delta hscroll = +1: still 0 outside-map pixels

And the sampled texel ranges stay comfortably inside the map:

  • base BG box: x = 24..232, y = 65..137
  • hscroll +1 BG box: x = 25..233, y = 65..137

So the plateau is not even visiting the border behavior we were about to blame.

Why the docs mattered here

I also pulled the current gate through the hardware docs and the Mesen-S implementation.

That cross-check was useful for two reasons.

First, it confirmed the current renderer is already very close to the usual operational Mode 7 formula used by fullsnes and Mesen-S:

  • clip(hscroll - center)
  • matrix terms added in the expected order
  • per-pixel stepping by A and C
  • large-map outside-map handling in the expected place

Second, it made the inactive features in the canonical frame explicit:

  • EXTBG off
  • direct color off
  • color math off
  • subscreen off

That means this plateau is no longer a good place to spend time on EXTBG or border semantics unless a later artifact contradicts the current read.

What moved forward

The practical reading changes from:

  • maybe this is still some Mode 7 edge rule

to:

  • the leading suspects are now smaller coordinate-path issues

More concretely, the next high-value checks are:

  • X-origin / first-pixel placement
  • visible-latched M7HOFS/M7VOFS timing
  • only then residual full-scene composition outside the BG-only box

That is a better frontier than generic Mode 7 speculation.

It removes a whole class of low-value experiments before they waste another turn.

Top comments (0)