Skip to content

RGBGFX reverse mode checks for too-low palette IDs, not just too-high#2024

Merged
Rangi42 merged 2 commits into
gbdev:masterfrom
Rangi42:reverse-checks
Jul 14, 2026
Merged

RGBGFX reverse mode checks for too-low palette IDs, not just too-high#2024
Rangi42 merged 2 commits into
gbdev:masterfrom
Rangi42:reverse-checks

Conversation

@Rangi42

@Rangi42 Rangi42 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

I'm trying to fix the sanity checks for invalid input into RGBGFX reverse mode. Specifically, we should ensure that the tilemap's tile IDs and the attribute map's palette IDs are valid, even with nonzero base tile/palette IDs specified.

However, I'm having trouble getting that to cooperate with the randtilegen/rgbgfx_test randomized test cases. Sometimes they fail, as in https://github.com/Rangi42/rgbds/actions/runs/29282085627/job/86927774014:

Testing: ./rgbgfx_test seed8.bin -b 217 -N 57,256
error: Color mismatch at (8, 56): (90,198,148,255) became (66,66,214,255) after round-tripping
error: Color mismatch at (9, 56): (231,173,0,255) became (16,173,107,255) after round-tripping
...
error: Color mismatch at (61, 63): (132,148,247,255) became (189,165,57,255) after round-tripping
error: Color mismatch at (63, 63): (189,165,57,255) became (0,24,140,255) after round-tripping
Test failed with 342 errors
Test ./rgbgfx_test seed8.bin -b 217 -N 57,256 failed! (RC=1)

Edit: Turns out it was a mistake in 21eaa2d, which 8b951bc has fixed. I confirmed this by locally editing test/gfx/test.sh to iterate over every possible $ofs value ("All 30723 tests passed!").

@Rangi42 Rangi42 added this to the 1.0.2 milestone Jul 13, 2026
@Rangi42
Rangi42 requested a review from ISSOtm July 13, 2026 20:45
@Rangi42 Rangi42 added bug Unexpected behavior / crashes; to be fixed ASAP! rgbgfx This affects RGBGFX labels Jul 13, 2026
@Rangi42
Rangi42 marked this pull request as ready for review July 14, 2026 01:56
@Rangi42
Rangi42 merged commit c0ff3d9 into gbdev:master Jul 14, 2026
28 checks passed
@Rangi42
Rangi42 deleted the reverse-checks branch July 14, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior / crashes; to be fixed ASAP! rgbgfx This affects RGBGFX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant