Skip to content

v0.1.1: second game loads fine, multitap option, clean OSD - #8

Merged
rtissera merged 7 commits into
mainfrom
fix/exact-phase-rearm
Sep 27, 2026
Merged

rtissera merged 7 commits into
mainfrom
fix/exact-phase-rearm

Conversation

@rtissera

Copy link
Copy Markdown
Owner
  • Second game: loading another game from the menu no longer leaves the picture wrapped until power-off. The exact-lock raster reset now re-fires whenever a frame starts in the wrong place, not only when the picture height changes. sim/hdmi_exact reproduces the old failure and checks the fix.
  • Multitap: now an OSD option (firmware v0.2.1 Options menu). Empty tap ports read as no buttons pressed; they read as every button held before, which broke Bomberman.
  • OSD: menu and loading text were corrupt under the 480p exact lock. The overlay is mapped onto the 256 x 224 grid textdisp expects, textdisp takes the font bit of the pixel it fetched, and y steps with the line lead-in. sim/osd checks it end to end.
  • Logo: PCETang instead of NESTang.
  • README: firmware v0.2.1, two players, second game.

Tested on Console 60K: 1943 → Parodius → Bomberman '94 without power-cycle, Bomberman '93 with Multitap Off and On, option kept across power-off, OSD and loading screen clean, logo. Primer 25K and Nano 20K build and meet timing.

The one-shot vreset re-armed only when the active height changed. Loading a
second game resets the core, so the source frame restarts at a new phase
with the same height: nothing re-armed and the picture stayed wrapped until
power-off (1943, then Parodius). The first-drawn-line event now re-fires the
raster reset whenever it lands away from cy == 0, with one line of slack.

sim/hdmi_exact/tb_exact.cpp reproduces it: a reload-style source stall in
vblank leaves every later frame wrapped on the old code (0 good / 8 bad) and
recovers within 3 frames with this change, over 20 stall lengths and both
active heights, with no extra resets in a 60-frame steady-state run.
Ports 3-5 of the tap returned all ones, which on this active-high bus is
every button held: with the multitap on, Bomberman saw Select/Up stuck.
MiSTer's 16'h0FFF default is the same idle state on its inverted bus.
iosys's textdisp draws a fixed 256 x 224 grid and returns a pixel two clocks
after its x/y. The overlay coordinates were the game's source-sample index
and line count (up to 512 x 242), so the menu and the loading text wrapped
and tore. Walk the grid across the displayed window instead, the way
TangCore's frame buffer does, with x two pixels early for the latency.
tb_exact.cpp checks x runs 0..255 across the window and y 0..223 down
the screen.
Two more reasons the menu text was corrupt under the 480p exact lock:

- textdisp.v picks the font bit on the third clock after x changes, using the
  current x. At 480p x advances every 2-3 clocks (256 across 720), so it was
  often already the next pixel. Use x_r, the pixel that was fetched; at 720p
  x_r == x at that point, so nothing changes there.
- the OSD window starts two pixels early, at the end of the previous line
  when the picture starts at x = 0, but y only stepped at cx = 0, so those
  first pixels used the previous row. y now steps with the lead-in, and is
  forced to 0 at cy = 0 so a raster reset cannot leave it at the bottom.

sim/osd/tb_osd.cpp runs the wrapper with the real textdisp.v and a font
pattern that depends on both coordinates: the old textdisp draws 3.4% of
OSD pixels wrong, this one 0.13% (the last column, where the window ends);
x and y match the 256 x 224 grid exactly.
The menu memory still held the NESTang logo from the iosys this core was
started from. Redraw it as PCETang in the same letter style; only the logo
rows ($380-$3FF) change, the font is untouched.
@rtissera
rtissera merged commit 021ae92 into main Sep 27, 2026
6 of 7 checks passed
@rtissera
rtissera deleted the fix/exact-phase-rearm branch September 27, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant