Massively simplified, by not trying to shoehorn differently-behaving cases into the same one loop! This may have introduced bugs (the test suite has caught three different oversights, two of which via external projects, in fact!), but this also makes the logic clearer and more streamlined, so that we are also less likely to have any latent or future bugs. In particular, previously, the first iteration of the loop could attempt placement at an address not matching the section's constraints, which made advancing to the next target address unnecessarily complicated (https://github.com/gbdev/rgbds/pull/2064#discussion_r3985466596), among other weirdness. The code ended up being defensive, and thus the overall logic was murky. I'm also expecting that this should provide a performance improvement due to being essentially a form of loop-invariant code motion (and very likely one a compiler couldn't have performed automatically), though I haven't measured.
RGBDS
RGBDS (Rednex Game Boy Development System) is a free assembler/linker package for the Game Boy and Game Boy Color.
It consists of four tools:
- RGBASM: assembler
- RGBLINK: linker
- RGBFIX: ROM checksum/header fixer
- RGBGFX: PNG-to-Game Boy graphics converter
Documentation
The full documentation is available online, including the development history and version history, generated from the man pages in this repository.
The documentation website's own source code is available in the rgbds-www repository.
Community
If you have questions about the RGBDS code or its organization, you can contact
the maintainers on the GBDev Discord server or
other community channels, or via email at
rgbds at gbdev dot io.
If you want to help maintain RGBDS, please read the contribution guide.
Installing
The platform-specific installation instructions
are available online. To build from source
using make or cmake, briefly:
make
sudo make install
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
Both build systems support a prefix (e.g. to install into a specific directory) and a suffix (e.g. to append the version number or commit ID):
make
sudo make install PREFIX=install_dir/ SUFFIX=-$(git rev-parse --short HEAD)
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSUFFIX=-$(git rev-parse --short HEAD)
cmake --build build
cmake --install build --prefix install_dir
On Windows, any SUFFIX should include the .exe extension.