ISSOtm
ef709fade6
Refactor and fix sect packing's bank iteration
...
Moving both pieces of related code together, as it were.
This also ends up changing the behaviour of scrambling,
where sections could “leak” out of the scrambling's bank pool
and resume being placed normally.
We have discussed it offline, and decided that this was a bug.
The test suite has been updated accordingly, which even gives
the occasion to move this test from a special case to the main
generic loop!
2026-09-18 21:19:37 +02:00
ISSOtm
8685bcbfbf
Refactor all scrambling-related dispatch into a single func
...
Yay for (poor man's) pattern matching! 🦀
2026-09-18 21:19:37 +02:00
ISSOtm
1ca4282e31
Move a function closer to its usage point
...
Trying to keep code grouped together well.
2026-09-18 21:19:37 +02:00
Eldred Habert
afe1f01d00
Fix linker script align 16 in floating address context ( #2115 )
...
Turns out we were just using the wrong var lmao
2026-09-17 20:46:55 -04:00
Rangi
8bf5957c83
Fix RGBLINK assertion failure when -s and -c invalidly match ( #2109 )
2026-09-18 01:34:14 +02:00
ISSOtm
f234796428
Avoid allocating for our linkdef names ( #2111 )
...
This reverts a change introduced in fd78a9ae8 , though it wasn't that commit's main point
so I'm feeling okay with undoing that.
This feels like an overkill change, using a static string is good enough for this
since we never modify this. I have considered using `string_view` instead, to have
the best of both worlds, but that's not NUL-terminated so our print functions
get a little grumpy.
2026-09-17 13:58:30 -04:00
ISSOtm
0b9f8ab523
Use Section::typeInfo() more
2026-09-17 13:19:26 -04:00
Eldred Habert
3b250d5386
Emit auxiliary files even if asserts fail ( #2104 )
...
Closes #2100
2026-09-17 17:47:53 +02:00
Rangi
b4988afc8a
Fix RGBLINK ignoring alignment constraints when placing empty sections
...
Fixes #2095
2026-09-17 11:16:18 -04:00
ISSOtm
6f69867d04
Make more RGBLINK tests use at-files
...
Less special handling = good
Possibly this can be done to more tests, but this is what I found.
2026-09-17 10:25:47 -04:00
ISSOtm
960f82126f
Fix to actually allow one-past-the-end zero-sized sections in linker scripts
2026-09-17 10:19:47 -04:00
ISSOtm
b9b5c9a2b4
Avoid reporting redundant errors on too-large fixed sect addr
...
This would happen for any such section of non-zero size.
2026-09-17 10:17:26 -04:00
Rangi
aa657cd481
Make array buffers for snprintf just large enough for their uint32_t and uint16_t types
...
Note that `bank` can store 9 bytes (8 digits plus NUL terminator)
even though `section.bank` should never go above 16-bit (4 digits).
2026-09-17 10:12:05 -04:00
ISSOtm
e39dbe1752
Remove no-op in link test script
...
No, `printf` does not do that.
This works because making it read from stdin suppresses
any words after the first one.
2026-09-17 09:35:32 -04:00
ISSOtm
9f175f7923
Use SectionTypeInfo struct member functions for section type info
2026-09-17 09:33:21 -04:00
Rangi
b2967ff509
Correct rgblink(5) linkerscript doc to match behavior of unbanked ROMX/WRAMX ( #2103 )
2026-09-17 05:32:15 +02:00
Rangi and Eldred Habert
e8d9eb4511
Document how multiple rgblink -S get merged ( #2098 )
...
Co-authored-by: Eldred Habert <[email protected] >
2026-09-17 01:52:10 +02:00
Rangi
589616338f
Remove redundant conditional check ( #2099 )
...
If `nbBanks > 1` is true, then `sectionTypeInfo[type].firstBank !=
sectionTypeInfo[type].lastBank` must also be true, so checking
whether either is true is unnecessary.
(On the other hand, if `nbBanks == 1`, then we might still have
`sectionTypeInfo[type].firstBank != sectionTypeInfo[type].lastBank`,
since only one of many valid banks for `type` could be in use.)
2026-09-17 00:27:22 +02:00
ISSOtm
6587941512
Allow scrambling SRAM banks up to the full 8-bit range
2026-09-15 23:06:19 -04:00
Rangi
004749ea75
Halt processing when any ambiguous-transparency colors exist ( #2093 )
2026-09-16 04:03:56 +02:00
Rangi
f4c6221eb1
Fix underflow of ALIGN[16, offset] ( #2090 )
2026-09-15 20:22:33 -04:00
Rangi
d81ab2fb23
Fix underflowing SECTION FRAGMENT fixed address ( #2091 )
2026-09-15 20:22:19 -04:00
Rangi
febdf63896
Fix invalid UTF-8 byte $E2 at the end of a symbol name reading past the string's end ( #2092 )
...
This is only possible in an invalid object file, but we do have other safety checks for those.
Assisted-by: opencode:big-pickle
2026-09-15 20:22:06 -04:00
Rangi
b0f49a36b7
Fix -t/--tiny for ROMX in bank 1, and -w/--wramx for WRAMX in bank 1 ( #2089 )
2026-09-14 15:53:45 -04:00
Rangi
ed1ac7309b
Fix overflow with high fixed-point magnitudes
2026-09-14 14:27:16 -04:00
Rangi
d082f24a2d
Fix rounding of fixed-point constants where fractional digits should carry into integer part ( #2088 )
2026-09-14 13:52:39 -04:00
Rangi
7746ddbf2b
Fix reverse-graphics check for whether the tilemap references too-high tile IDs in bank 1 ( #2086 )
2026-09-14 10:26:57 -04:00
Eldred Habert
0fe43bf0cb
Use CMake-native methods to do our static-build macOS trickery ( #2083 )
...
This should remain equivalent for our current setups,
but play nicer with anyone wanting to experiment further.
It *may* break for someone building on an Intel Mac,
but this is a libpng limitation and thus out of our control.
2026-09-14 09:55:34 -04:00
Eldred Habert
c8e8a2f522
Avoid duplicating warning flags when linking with the Makefile ( #2085 )
...
The warning flag list with `make develop` is quite long,
and this duplication is making those command lines particularly indigestible.
2026-09-13 20:35:54 -04:00
Eldred Habert
de1e1ff688
Actually silence -Wformat et al. on MinGW ( #2084 )
...
Thus far, we have just ensured they wouldn't fail the build,
but they still pollute the build log, so we should silence them entirely.
2026-09-13 20:25:13 -04:00
Rangi
f8a1da71c1
Only sort generated palette colors by PLTE order for indexed PNG images
...
Non-indexed images can still have a PLTE chunk. We should use
`sortRgb` instead of `sortIndexed` for them, since their pixels' colors
may not all be present in the PLTE chunk and would be unsortable.
2026-09-13 18:53:31 -04:00
Rangi
49b3f566b1
Fix handling of PNG files with RGB or RGBA color type that have a PLTE chunk
2026-09-13 16:09:49 -04:00
Rangi
82f58b95ac
Fix reversing some images with an input tileset ( #2081 )
2026-09-13 21:00:58 +02:00
Rangi and Eldred Habert
e9fc7b3135
Warn when tile or palette IDs cannot fit in the tilemap or attrmap respectively ( #2077 )
...
Co-authored-by: Eldred Habert <[email protected] >
2026-09-13 19:18:24 +02:00
Rangi
47bbd30f2c
Fix a failing assertion when two sections have the same name ( #2079 )
2026-09-12 17:58:37 -04:00
Rangi
520cc2a80d
Fix reversing a tilemapped image with -x trimmed tiles
2026-09-12 15:38:34 -04:00
Rangi
a703b8c704
Ignore .pdb files (generated by CMake on Windows)
2026-09-12 14:49:17 -04:00
Rangi
e9c800b3be
Fix reversing 1bpp images
...
Fixes #2075
2026-09-12 14:17:33 -04:00
Rangi
8a7019e1f8
Only register colors inside the -L/--slice region, including transparent color
...
Fixes #2074
2026-09-12 12:52:35 -04:00
Rangi
439a7a1828
Fix reversing multiple palettes with fewer than 4 colors per palette
...
Fixes #2073
2026-09-12 11:50:47 -04:00
Rangi
438b943a1a
Make background tile IDs consistent whether or not deduplication is enabled
...
Fixes #2072
2026-09-11 20:45:52 -04:00
Erickson Munoz
5a2927778f
Remove extra parentheses in man page comment ( #2066 )
2026-09-11 20:40:06 -04:00
Rangi and ISSOtm
9e785495ff
Fix crash when a background tile first occurs after both tile banks are full ( #2070 )
...
Co-authored-by: ISSOtm <[email protected] >
2026-09-12 01:04:31 +02:00
ISSOtm
9d69a08909
Determine the number of fetch/clone jobs ourselves
...
Apparently our CI has some versions of Git too old to support zero to mean that.
2026-09-11 16:31:19 -04:00
ISSOtm
970bb84450
Fix updating ext-test repos from existing copies
...
The current setup fails with a "cannot read tree" error.
Also added flags to parallelise each fetch, which is relevant when submodules
are involved. (So, pretty much just starter-kit, haha.)
It would be nice to also parallelise the various fetches, but that would hit
the same remote multiple times, and could lead to rate-limiting...
2026-09-11 16:17:26 -04:00
Rangi
a662cad7ce
Fix infinite loop when an aligned HRAM section cannot be placed ( #2064 )
2026-09-11 05:21:26 +02:00
Rangi
e85375f3e1
Avoid truncation warning from sp instruction test
2026-09-10 19:09:15 -04:00
Rangi
429a2325fb
Add test case for reversing image with transparent color
2026-09-10 18:18:37 -04:00
Rangi
9c5e872f9c
First color of -c palettes with transparent pixels is transparent $8000, not unspecified $ffff
2026-09-10 16:41:32 -04:00
Rangi
25240e9fc0
Fix but deprecate an implicit transparent color #0
2026-09-10 19:32:00 +02:00