Skip to content

Renderers: a choice of them for the race view (F5), and a blitter-polygon prototype - #8

Open
MarkyTurtle wants to merge 14 commits into
mainfrom
enhanced/renderers
Open

MarkyTurtle wants to merge 14 commits into
mainfrom
enhanced/renderers

Conversation

@MarkyTurtle

Copy link
Copy Markdown
Owner

A choice of renderers for the race view, and a first prototype of one.

  • renderer.i (F5): the view's stages (mountains, far rows, near rows) are called through a table chosen once a view. Renderer 0 is the release's; the race is byte-for-byte as before (test_physics.py, 8 tracks x 3,000 vertical blanks).
  • Helper block: its flags move from $170 to $180 (the F5 key made its code longer). bench.py and test_physics.py now take the flag addresses and the helper from each game's own build, so --base still compares across the change.
  • renderer_blit.i (renderer 1): the mountains drawn by the blitter (clipped edges in line mode into a mask, area fill, colour cut into each plane). tools/test_renderers.py measures the picture against renderer 0: 0.40% of the view's pixels differ on average over the 8 tracks (0.55% at half height), a one-pixel shift along ridge lines.
  • It is slower: 16.1 ms a frame for the mountains against 10.8 ms by the CPU. A polygon costs the blitter its bounding box and about as much work as the CPU's own, and overlapping it with the geometry would at best break even on an A500 (shared chip bus; scremu does not model that). TODO.md records this, corrects the earlier 15-25% estimate for blitter polygons, and describes a panorama of the mountains (drawn once, blitted each frame, about 8 ms a frame saved) as the next thing to try.
  • scremu gains the blitter's line mode; the workflow gains test_renderers.py and the new disk checksum.

Generated by Claude Code

MarkyTurtle and others added 14 commits November 9, 2026 20:16
…ygon prototype

renderer.i: the view's stages (the mountains, the far rows, the near rows) are called through
a table, chosen by F5 once a view (RendererLatch). Renderer 0 is the release's: the race is
exactly as before (test_physics.py: 8 tracks x 3,000 vertical blanks, every variable the same).
The helper block's flags move from $170 to $180 (the F5 handler made its code longer); the
benchmark and test_physics.py take each game's flag addresses from its own listing and helper.

renderer_blit.i: renderer 1's mountains drawn by the blitter - each polygon's edges clipped and
drawn in the line mode into a mask, the mask area-filled, then cut into the planes in the
polygon's colour. The picture is within a pixel of the release's (tools/test_renderers.py: 0.40%
of the view's pixels differ on average over the 8 tracks, 0.55% at half height). It is slower
than the CPU's drawing, though - 16.1 ms a frame against 10.8 ms for the mountains - because a
polygon costs the blitter its bounding box and about as much work as the CPU's own. TODO.md
records the measurement, drops the estimate of 15-25% for blitter polygons and describes a
panorama of the mountains drawn once and blitted each frame.

scremu: the blitter's line mode.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
BmColour is a byte, so the word variables after it (BmY0, BmY1, BmEX1..BmEY2)
were at odd addresses: an address error (Guru #3) on a real 68000 / WinUAE
A500 once F5 selected renderer 1. The emulator used by the tests does not trap
unaligned word accesses, so it went unseen. Add the missing `even`, and an
assert in the source that fails the build if those words are ever odd again.
Update ADF_SHA1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
BLTCON1's SUD bit is set when y moves only sometimes, i.e. x is the major
axis; BlitLine set it for y-major lines, and scremu's line mode had the same
reading, so the tests agreed with the bug. On real hardware the lines went the
wrong way: the mountains were wrong and lines ran off the mask (the crash).
Fix both. Also wait for the last blit at the end of BlitMountains (with a5
reset), a blitcheck in scremu for blitter registers written while it is busy,
and test_renderers takes VASMOPT. Update ADF_SHA1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
…rows' blitter estimate in TODO

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
…gv would lose (--half too)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
…re-interpolating

The mountains' polygons are blitted over their bounding words (clear, fill and the
4 colour blits), and the pieces of a clipped edge take their ends' x from the
crossings. The blitter's mountains cost 2.3 ms more than the CPU's (was 5.3).
Update ADF_SHA1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
…0's, not faster)

RenderFillSurface (src/renderer_surf.i) replaces FillBetweenEdges for FillRowSurface's
polygon: the edge buffers' x as bit changes in a mask, the blitter's fill, the colour cut
on the 4 planes. Same cost as the CPU's fill (area-bound); recorded in TODO.md.
Update ADF_SHA1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
…(and half height, no mountains)

Renderer 2: F4's flag; 3: F4, F9 and F10's. Set by RendererLatch when F5 changes to or from them
(the flags stay free to change). bench.py --renderer N, test_renderers.py --vs N.
Work (A500): 0 108.6 ms, 1 112.8, 2 91.7, 3 76.1. Update ADF_SHA1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
FarShortLimit (renderer.i) replaces ProjectFarPieces' constant: renderer 2 draws 6 far rows,
renderer 3 draws 3. README, ADF_SHA1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
…chmark race

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LbtcUXcr7yMJSt5hPh9v8F
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