ISSOtm
c93f377bfb
Enable colour diagnostics in CI
...
At least for CMake.
2026-03-19 20:30:12 +01:00
ISSOtm
d6d1844d60
Seek lib deps via CMake FetchContent
...
`FetchContent` respects existing installs, and downloads and compiles the libs
if they aren't found.
This is admittedly a little finicky, since this ignores the usual `Find*`
modules provided by CMake, requiring a bit of glue on our side.
But, one upside is that this moves that logic from our CI into the build system,
which can thus benefit other downstream users.
This also opens the door to some improvements in upcoming commits.
Doing this with Bison turned out to be much more painful, however, due to
`FindBISON` providing the specific `bison_target` command; thus, it remains
installed externally, so that it can be picked up by `FindBISON`.
This also bumps our CMake version requirement slightly, though it's
possible that older versions keep working, or could be supported with small patches;
however, our CI doesn't provide anything below 3.31, so we can't check.
2026-03-19 20:30:12 +01:00
ISSOtm
fd38a3dbc4
Add CMake and YAML files to EditorConfig
...
Since we use a different style for those
2026-03-19 20:30:12 +01:00
ISSOtm
60d58723aa
Use a modern GNU Make for CMake CI on macOS
...
We can assume that CMake handles old Make correctly,
but we'd like to benefit from improvements
like output batching.
2026-03-19 20:30:12 +01:00
ISSOtm
a9b6cda77b
Reorder CMakeLists commands by topic
2026-03-17 08:18:50 +01:00
ISSOtm
091452d591
Remove call to configuring version file
...
Missed in 5c4ca36c5a
2026-03-17 05:28:23 +01:00
ISSOtm
df1d909853
Improve documentation of CMake bin output dir
2026-03-17 05:27:39 +01:00
ISSOtm
fb4e08ce71
Tidy up CMake sanitizer flags
...
Set the flags in the build itself instead of trying to override the cache
(this was an artifact of when I didn't understand the CMake variable model),
which avoids them being duplicated on each re-configuration.
Also remove `-g`, since it's defined by the build type by default
(we leave it up to the user to choose Debug or RelWithDebInfo).
2026-03-16 20:23:47 -04:00
ISSOtm
7244b9d17e
Silence the same warning as in the Makefile
...
As requested by https://github.com/gbdev/rgbds/pull/1899#discussion_r2943039607
2026-03-16 20:23:47 -04:00
ISSOtm
5c4ca36c5a
Harmonise passing build version
...
Avoid running some configure step, instead pass it as a define like the Makefile
2026-03-16 20:23:47 -04:00
ISSOtm
292c297518
Sync Windows release steps with new CI
2026-03-16 20:23:47 -04:00
ISSOtm
a5bb431d47
Fix debug-mode building on Windows
...
ASan seems broken, and the debug-mode DLL names are different
2026-03-16 20:23:47 -04:00
ISSOtm
10e1c9d187
Avoid passing sanitizer options to MSVC linker
...
Apparently it does not support them
2026-03-16 20:23:47 -04:00
ISSOtm
d8722b6705
Use imported targets for linking to libpng
...
This massively simplifies the process lol
2026-03-16 20:23:47 -04:00
ISSOtm
2d0ac7eeb0
Disable exceptions and RTTI when building with CMake
2026-03-16 20:23:47 -04:00
ISSOtm
d5033a2bd9
Handle project version better in CMake
...
Parse the version from `version.hpp`, and check its consistency with
the Git tag to help catch release blunders.
2026-03-16 20:23:47 -04:00
ISSOtm
45fff0fd58
Harmonise naming of CMake test knobs
...
Also reorganise the file a little
2026-03-16 20:23:47 -04:00
ISSOtm
c963c7b1c7
Simplify include directory directive
2026-03-16 20:23:47 -04:00
ISSOtm
63c7835e71
Stop overriding the binaries' install dir
...
This is equivalent to the default, except the default accepts being overridden
2026-03-16 20:23:47 -04:00
ISSOtm
35af3185eb
Enable LTO even for multi-config CMake generators
...
See https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
for the rationale.
2026-03-16 20:23:47 -04:00
ISSOtm
db9d9c7653
Install our man pages in a more standard-configurable manner
2026-03-16 20:23:47 -04:00
ISSOtm
9e5a9107f2
Remove enforced CTest verbosity
...
It can be controlled from the command line instead, and that's better
2026-03-16 20:23:47 -04:00
ISSOtm
275fcf8fcf
Improve CMake-in-tree fatal error message
2026-03-16 20:23:47 -04:00
ISSOtm
bc37b0ece6
Skip trying to link to libm explicitly
...
This doesn't seem to be necessary: it is automatically linked to,
at least on my machine. \*shrugs\*
2026-03-16 20:23:47 -04:00
ISSOtm
e63ce24e48
Add a CMake preset for maintainer flags
2026-03-16 20:23:47 -04:00
ISSOtm
d524884799
Run CI tests using CTest when possible
2026-03-16 20:23:47 -04:00
ISSOtm
34e1f8dcc5
Remove useless MSVC flag
...
CMake only passes a single file at a time anyway
2026-03-16 20:23:47 -04:00
ISSOtm
cd64de9323
Remove a warning triggered by MSVC's own standard library
...
No longer triggers now, so we can remove our workaround for their breakage.
2026-03-16 20:23:47 -04:00
ISSOtm
a01b805e4b
Remove an outdated comment
2026-03-16 20:23:47 -04:00
ISSOtm
a139cbc744
Refactor the source file listing
...
Make the common files into an object library, which lets them
be compiled only once (saving 41 build steps)
This also lends itself well to removing the per-program loop,
which simplifies the code somewhat.
2026-03-16 20:23:47 -04:00
ISSOtm
06e5386d93
Move FreeBSD deps install to common CI script
...
Making the OS filter in test driver consistent as per
https://github.com/gbdev/rgbds/pull/1899#discussion_r2942998932
2026-03-16 20:23:47 -04:00
ISSOtm
37f57a752f
Print a more graceful error message for run-tests.sh --unk
2026-03-16 20:23:47 -04:00
ISSOtm
670bdf2095
Document run-tests.sh --os
...
Also switch to heredoc syntax for ease of editing
2026-03-16 20:23:47 -04:00
ISSOtm
6270f654a1
Make sure to init all variables involved in CMake tests
2026-03-16 20:23:47 -04:00
ISSOtm
676db46c01
Add a few details to the project() call
...
We can use them now that the minimum version has been bumped
2026-03-16 20:23:47 -04:00
ISSOtm
8979b54281
Ignore a CMake file that is not intended to be checked in
2026-03-16 20:23:47 -04:00
ISSOtm
a6f03530ed
Correct minimum CMake version required
...
Turns out the status messages use 3.17
2026-03-16 20:23:47 -04:00
ISSOtm
b56b56a695
Reformat some long warning-flag-setting lines
2026-03-16 20:23:47 -04:00
ISSOtm
dc5fc9f327
Remove obsolete CMake version comment
2026-03-16 20:23:47 -04:00
ISSOtm
3d35457eeb
Avoid showing the "more warnings" option for MSVC
2026-03-16 20:23:47 -04:00
ISSOtm
aea39ec8c8
Log with sanitizers are enabled under CMake
...
This can help bring attention to the MSVC difference (no UBSan there)
2026-03-16 20:23:47 -04:00
ISSOtm
9293068370
Properly specify our max CMake version supported
...
Also bump it to the version I just tested it with
2026-03-16 20:23:47 -04:00
ISSOtm
d054f07703
Fix some truncation warnings
...
Amusingly, reported by MSVC only
2026-03-10 01:31:23 -04:00
Eldred Habert
7c1e1fe515
Reference the file that actually provides the linker script lexer
2026-01-27 12:54:06 +01:00
Eldred Habert and Rangi42
8cf6c5423a
Implement --background-color ( #1508 )
...
Co-authored-by: Rangi42 <[email protected] >
2025-05-01 23:39:52 -04:00
Eldred Habert
d5f39c8dce
Remove the use of floating-point for palette packing ( #1565 )
...
This is primarily a correctness change, *not* a performance one.
The expected performance impact is minimal anyway.
The goal is to eliminate the use of platform-inconsistent floating-point operations
for this load-bearing task.
2024-11-29 13:44:19 -05:00
ISSOtm
86bf289452
Process the last line of textual palette specs even without a trailing newline
...
Fixes #1519
2024-09-30 22:26:00 +02:00
ISSOtm
d494f73825
Document extra pre-release updates
2024-09-18 19:38:03 +02:00
Eldred Habert
37b64ca51f
Give release workflow permission to create a release
2024-09-18 17:00:30 +02:00
ISSOtm
deb3ac3452
Update release instructions
2024-09-18 16:47:10 +02:00
ISSOtm
610f04beeb
Fix condition for assuming at EOF
...
Part of that condition's purpose is to ensure that we read the correct
lexer state; but it's possible now for the fstack to be non-empty
*before* the lexer state is registered, i.e. if there is an error
in the function that registers it.
This causes a NULL pointer deref.
2024-09-05 17:48:52 +02:00
ISSOtm
e289387b09
Avoid attempting to link if assembling fails
2024-09-05 17:19:05 +02:00
Eldred Habert
80d37f9988
Implement --input-tileset ( #1464 )
...
As discussed in https://github.com/gbdev/rgbds/issues/575#issuecomment-1991456862
2024-09-04 15:20:01 -04:00
ISSOtm
4ce6c9f4a5
Avoid bogus comparisons when linking fails
...
This avoids drowning RGBLINK's errors in a meaningless `diff` output
2024-08-26 22:58:38 -04:00
ISSOtm
8286d9c462
Check that there is enough room to write a patch when linking
...
Prevents segfaulting if a patch's offset is too large
2024-08-26 22:58:38 -04:00
ISSOtm
23272f028f
Update the best proto-pal relative size when a new best is found
...
*facepalm*
2024-08-23 13:35:48 +02:00
ISSOtm
77129b9e80
Fix a false positive reported by scan-build
...
Arguably this also makes the logic a little clearer, so might as well
2024-08-23 01:34:36 +02:00
Eldred Habert and Sylvie
8f47fb494b
Improve some documentation ( #1474 )
...
* Delete removed symbol from PRINTLN examples
* Touch up `SHIFT` docs
Co-authored-by: Sylvie <[email protected] >
2024-08-19 20:29:20 +02:00
ISSOtm
96a0481cba
Pass RGBDS= to make clean as well in downstream tests
...
Avoids some spurious "command not found" errors when cleaning SameBoy
Fixes #1471
2024-08-18 20:11:01 +02:00
ISSOtm
86140b5b2f
Correctly apply section fragment offsets to contained symbols
2024-08-18 19:44:04 +02:00
ISSOtm
369296693c
Avoid softlock if linker script contains a comment but no newline
2024-08-18 19:44:04 +02:00
ISSOtm
47b2e0e912
Trap bad __at() values too
...
Those set the section type earlier than the linker script,
so a check needs to be performed there too
2024-08-18 19:44:04 +02:00
ISSOtm
28733fe312
Implement floating bank in linker script
...
Turns out that we can solve being unable to choose a bank to change
the PC of, by simply refusing to choose!
2024-08-18 19:44:04 +02:00
ISSOtm
e45a422da3
Clarify error message when a section lacks a type
...
The previous commit has made this precision possible
2024-08-18 19:44:04 +02:00
ISSOtm
9fd4ba90cc
Trap invalid section types in RGBDS objs
2024-08-18 19:44:04 +02:00
ISSOtm
e548ecc6fa
Report attempts to assign a SDCC area in a way inconsistent with its data
...
This actually avoids breaking the (segfaulting) invariant that
a section whose type "has data" has as many bytes of `->data` as
its `->size`.
2024-08-18 19:44:04 +02:00
ISSOtm
00b0914436
Reserve space to avoid file sym array realloc
...
This line was missing; in its absence, as soon as the array reallocs,
all registered symbol pointers are invalidated, leading to a crash
(e.g. when generating a sym file).
Made the reallocation check into a hard error, too.
Since fileSymbols gets registered with each section, we would have to
change that, and then it cascades throughout all of RGBLINK.
This will be handled correctly in the Rust port.
2024-08-18 19:44:04 +02:00
ISSOtm
589cea47f6
Add a contrib script for visualising the generated palettes as a PNG
2024-08-14 17:55:39 +02:00
ISSOtm
68a6abd00e
Fix ProtoPalette::compare
...
The function only stopped at the end of the *arrays*,
not of *their used portions*!
This could cause false negatives one way or the other.
This appears not to affect the palette packing, since the packing algorithm
deals with them efficiently; but it should speed up processing slightly,
and as the test changes show, it also improves the UX of palette packing
error messages!
2024-08-14 17:36:15 +02:00
Eldred Habert
718066c2cf
Build “fat binaries” for macOS ( #1461 )
...
The same binary, both for Intel and ARM Macs!
Builds libpng manually since the lib Brew distributes only contains code for the host arch.
2024-08-09 13:18:58 -04:00
Eldred Habert
a9140e6bb4
Fix incorrect name of macos-static artifact
2024-08-09 01:59:17 +02:00
Eldred Habert
fb6f861a08
Use macOS 14 in CI ( #1335 )
2024-08-08 22:16:32 +02:00
ISSOtm
784e828219
Enforce C++ compiler when building test binaries in CI too
2024-08-08 20:45:36 +02:00
ISSOtm
b20b2dd28c
Pass CXX env var through when compiling RGBGFX test binaries
2024-08-08 20:45:36 +02:00
ISSOtm
2a85009b6b
Be verbose about building the RGBGFX test binaries
...
People may not expect that to happen!
And CI would be easier to debug that way, too.
2024-08-08 20:45:36 +02:00
ISSOtm
809b364958
Be stricter in test scripts
...
Omitting parameters is not a good idea, but even worse if it fails
mysteriously without any error messages
2024-08-08 20:34:09 +02:00
ISSOtm
60f9e86361
Pass libpng CFLAGS when building rgbgfx_test.cpp too
...
Don't ask me how this hasn't broken earlier, but hey, now it's fixed
2024-08-08 20:30:31 +02:00
Eldred Habert
817dcfdc70
Improve fixed-point documentation ( #1455 )
...
* Clarify the operator relationship of ordinary and fixed-point numbers
* Attempt to clarify description of fixed-point numbers
* Note that RGBASM does not check fixed-point precisions
* Simplify sine table example a bit
* Remove misleading equations describing `DIV`, `MUL`, and `FMOD`
* Various minor style and formatting fixups
2024-08-08 13:56:08 -04:00
ISSOtm
747427e801
Make test/gfx/at-file-ref consistent
...
The generated `result.pal` can change between platforms, it turns out
(due to "unstable sort" differences), and creates additional churn if
changing anything related to palette generation.
tl;dr this makes the test less flaky in the long run.
2024-08-08 12:23:12 +02:00
ISSOtm
6b09838739
Sort proto-palettes by decreasing size when refitting overloaded palettes
...
Since that refitting process is a First-Fit, it benefits from that sorting step.
2024-08-08 12:12:29 +02:00
ISSOtm
0f1137c6ec
Fix ineffective sorting of palettes pre-packing
...
We were sorting the *IDs*, not the proto-palettes...
2024-08-08 11:31:46 +02:00
ISSOtm
1ad9383042
Disable optimisations in make debug
...
I am starting to feel aggravated by `$1 = <optimized out>`
2024-08-08 11:15:19 +02:00
ISSOtm
98bca79df4
Run clang-format
2024-08-02 22:36:33 -04:00
ISSOtm
dae4219acd
With -r, print both palettes if -c and -p mismatch
2024-08-02 22:36:33 -04:00
ISSOtm
3d1f5386c2
Fix parsing of GPL files
...
Can you tell this was *not* tested whatsoever?
2024-08-02 22:36:33 -04:00
ISSOtm
1f8f28cac8
Fix parsing of textual colours
...
`n`'s input value was not honored, and its updating logic incorrect
2024-08-02 22:36:33 -04:00
ISSOtm
8e60d1f0b8
Fix textual palettes not accepting to be filled
...
A weird case of off-by-one error
2024-08-02 22:36:33 -04:00
ISSOtm
d8aceaea4a
Ignore empty lines in HEX files
...
They are free-form enough that empty lines should probably be supported.
2024-08-02 22:36:33 -04:00
ISSOtm
a23b4732e3
Distinguish EOF and empty lines when parsing text pal files
2024-08-02 22:36:33 -04:00
ISSOtm
41046c287f
Use appropriate format specifier for number of palettes
2024-08-02 21:59:51 +02:00
ISSOtm
f4d0f01f91
Fix max number of palettes wrapping around after 255
2024-08-02 16:14:43 +02:00
Eldred Habert
1d89d75381
Fix use-after-free when keeping pointers to args from at-files ( #1426 )
2024-07-25 23:00:48 +02:00
ISSOtm
20b7b591d4
Run clang-format
...
Fix some small style inconsistencies
2024-03-28 01:41:25 +01:00
ISSOtm
d327138cd8
Report as many build errors as possible in CI
...
This allows debugging more problems in a single cycle
2024-03-28 01:37:10 +01:00
ISSOtm
0c0923ac16
Disable some spurious MSVC warnings
...
Not that it will de-clutter our CI logs very much, but eh, you know.
2024-03-28 01:33:21 +01:00
ISSOtm
e5078aba3b
Clean up #includes
...
Remove unused headers, and avoid relying on transitive inclusions
`include-what-you-use` has been very useful for this!
2024-03-28 01:25:38 +01:00
ISSOtm
cae7b5dcf6
Use standard attribute syntax instead of IBM __attribute__
...
Move format attrs to proper standard location
For some reason, GCC 13 is more lax than earlier versions...
2024-03-27 20:01:12 -04:00
ISSOtm
e255af9e10
Do not limit strings to 255 characters
2024-03-22 14:25:36 -04:00
ISSOtm
9f239f6dcc
Use std::shared_ptr<std::string> for lexed/parsed strings
2024-03-22 14:25:36 -04:00
ISSOtm
412073774c
Refactor string-formatting routines to append to an existing string
2024-03-22 14:25:36 -04:00