Fix Ultimax cartridge rendering, with an e2e guard - #882
Merged
Conversation
Collaborator
|
@GideonZ Looks amazing. I love the test and the golden image. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An 8K cartridge at
$E000with EXROM high and GAME low runs the machine inUltimax mode, where the VIC fetches characters and colour through the cartridge
rather than from the C64's own memory. Core 1.50 draws that correctly.
tests/e2e/io/c64/ultimax_cartridge_test.pyis the regression guard. It startsJupiter Lander through
runners:run_crt, taps F1, and compares the whole384x272 VIC frame against a reference image, index for index, with no tolerance.
Measured on an Ultimate 64-II, one branch, two cores
external/u64e2_100t.bitfrom this branchUnder 1.4F the shapes land in the right places and no character data reaches the
VIC at all: no text, no lander, no fuel bar, and the terrain colours inverted.
The suite reports the pixel count, the colour histogram of the closest frame,
and writes that frame beside the run's other files as
<run>.frame.png.The red core was loaded on the bench for the demonstration and the green core is
the bitstream in this branch, loaded over JTAG into SRAM, so both measurements
are of the same test against the two cores rather than against whatever happened
to be flashed.
Why an exact comparison rather than a tolerance
The game waits for the player before anything moves, so there is no frame timing
to absorb: over more than twenty starts the frame was identical to the reference
every time, arriving 2.1s to 2.9s after the cartridge started.
jupiter_lander.pngis palette-indexed and its indices are what the video streamcarries, so the comparison converts no colour and assumes no palette. F1 repeats
until the frame arrives, because a tap that lands on an already-running game
leaves the picture unchanged, so retrying a lost keystroke costs nothing.
The suite skips on a machine streaming NTSC, since the reference is a PAL frame.
What is in the diff
No firmware source changes. The fix is the three bitstreams and the rest is the
test:
external/u64.sof,external/u64e2_100t.bit,external/u64e2_50t.bit..crtand reference frame beside it.tests/e2e/lib/vic_video.py:VicStreamCapturetakes a target, so it joinsthat target's own video group and ignores datagrams from any other sender. Two
targets on one bench stream to the same group unless
U64_VIDEO_*separatesthem, and an exact-match check cannot assemble a frame out of both machines.
run-tests: registersultimax-cartridgein the standard profile. It runs in2.5s.
tests/README.md: the profile matrix, regenerated bytools/docs/update_test_docs.py. That also picks up three rows the checked-inmatrix was already missing (
iec-dos-commands,rel-copy,ident-leak).🤖 Generated with Claude Code
https://claude.ai/code/session_01Dk5P8LzytLNNWSrtpqte2V