Commit Graph
3587 Commits
Author SHA1 Message Date
Rangi 9a15b723f2 Format CGB colors in error/verbose messages as "GB:rr,gg,bb"
These should be more debuggable than packed "$xxxx" format.
2026-07-14 10:34:27 -04:00
Rangi 7e2a3491a5 Encapsulate fseek+ftell idiom in seekSize
This allows a single check for the return value of `seekSize`
to verify all three `fseek`+`ftell`+`fseek` calls.
2026-07-14 01:32:18 -04:00
Rangi e7855ea1b8 Fix reverse mode with -s/--palette-size too small for the tile data 2026-07-14 01:11:11 -04:00
Rangi 19e60d9864 Fix large ds in linker script overflowing the PC 2026-07-14 00:42:42 -04:00
Rangi c0ff3d92ad Fix reverse palette offsets when base palette ID wraps around to 0 2026-07-13 23:08:20 -04:00
Rangi e4583e7ac2 RGBGFX reverse mode checks for too-low palette IDs, not just too-high 2026-07-13 23:08:20 -04:00
Rangi 5869e0dc60 Fix RGBLINK scrambling algorithm to work for SRAM
Since SRAM sections start from 0, we had been using a signed
`int8_t curScrambleSRAM` counter to allow 0 as a scrambled bank,
but this actually just placed all floating SRAM sections in bank 0.
2026-07-13 22:39:41 -04:00
Rangi 196d50c1d7 Add XXX: comment tag to working but fragile test cases 2026-07-13 22:39:41 -04:00
Rangi 8b951bc047 Fix a flaky/random-seed rgbgfx_test test failure
Commit 21eaa2d2cc missed some
intentional unsigned underflow that is needed to set `nbTilesInBank`.
Without it, some of the randomly-seeded RGBGFX tests, such as
`./rgbgfx_test seed8.bin -b 207 -N 54,256`, can fail with "Color
mismatch after round-tripping" errors.
2026-07-13 21:31:05 -04:00
Rangi 59b6b15106 Run make format 2026-07-13 21:30:23 -04:00
Rangi 304cbb464f Factor out verboseDo to encapsulate magenta output color 2026-07-13 18:05:55 -04:00
Rangi ea3a8ee171 Use magenta color for some verbose output which was missing it 2026-07-13 17:47:38 -04:00
Rangi f0419eb183 More guards against invalid object file patch data 2026-07-13 17:47:38 -04:00
Rangi 4a6ea35299 Avoid overflow in counting tiles for unrealistically large images 2026-07-13 17:47:38 -04:00
Rangi 08354cf573 Explicitly encode assumption that an overlapping section exists 2026-07-13 17:47:38 -04:00
Rangi 417b5212d4 Fix OOM for too-small overlay files in 32K mode (rgblink -t) 2026-07-13 16:17:30 -04:00
Rangi 66312f55dd Avoid unsigned overflow/truncation from bad offset values in invalid object files 2026-07-13 13:17:09 -04:00
Rangi 21eaa2d2cc Fix a > to >=, and avoid underflow in some sanity checks 2026-07-13 13:14:06 -04:00
Rangi e9fa1e4e94 Avoid closing stdin/stdout/stderr standard streams 2026-07-13 13:02:46 -04:00
Rangi 8ab6190f96 Fix relative links in Markdown docs 2026-07-11 16:19:27 -04:00
Eldred Habert 22bd8a9bd5 Enable automatic generation of compile_flags.txt for clang-tidy via make tidy (#2008) 2026-07-11 16:11:14 -04:00
Rangi 96bc58b7f7 Add test case for local labels that superficially look like keywords 2026-07-11 13:51:53 -04:00
Rangi 4857ad1e00 Fix crash on image without any colors (all transparent) 2026-07-11 13:18:40 -04:00
Rangi 3b33c942ae Fix a crash and a limitation in RGBGFX unoptimized output
- If both banks 0 and 1 were completely filled, then
  `assume(bank == 0)` would false and potentially crash.
- If the input image had fully-background tiles, they would be
  incorrectly counted towards `nbTiles` and could cause the
  "Image contains N tiles, exceeding the limit" check to fail.
2026-07-11 12:32:31 -04:00
Rangi 5525dd902b Update external test commits 2026-07-10 23:29:19 -04:00
Rangi 4350a3252d Upgrade FreeBSD testing from 14.3 to 15.1 2026-07-10 23:14:39 -04:00
Rangi a8442bccc7 Group the two dep install commands together in Dockerfile 2026-07-10 23:12:49 -04:00
Rangi 00006a9d00 Use set -u too 2026-07-10 23:12:49 -04:00
Rangi a383bec96e Rename install_deps.sh to install-deps.sh for consistency 2026-07-10 23:12:49 -04:00
Rangi 226031c18b Use #!/usr/bin/env bash, not #!/bin/bash 2026-07-10 23:12:49 -04:00
Rangi 24a896f60a Move CI-only check-diff script to .github/ 2026-07-10 23:12:49 -04:00
Rangi a6f5e3efd1 Move CI-only check-format script to .github/ 2026-07-10 23:12:49 -04:00
Rangi c02b234bb1 Add CI job to check syntax of contrib scripts
Note that `zsh` is not installed in `ubuntu-slim` by default.
2026-07-10 23:12:49 -04:00
Rangi be4c1161bd Fix RGBGFX crash when trimming more tiles than exist after deduplication 2026-07-10 17:35:32 -04:00
Rangi 0e1e5e80f6 Use correct PRIu32 format spec for uint32_t usedTotal 2026-07-10 17:01:43 -04:00
Rangi 118f1f7543 Correct option letter in error message 2026-07-10 16:59:30 -04:00
Rangi eaa35ed26d Remove dead return after no-return fatal call 2026-07-10 14:36:46 -04:00
Rangi 7b39bcd412 Refactor expression for clarity
`tileData[realY + 1 % options.bitDepth]` relied on order of
operations and the fact that `1 % 1 == 0` but `1 % 2 == 1` for
correct indexing. However, it was not obvious at first glance,
and confusable with the more common `(base + offset) % size`
pattern. (And would need changing anyway if we ever support 4bpp.)
2026-07-10 14:30:25 -04:00
Rangi 255cd7f7f6 Fix a typo in a comment 2026-07-10 14:29:32 -04:00
Rangi b8011947a8 Correct assumption to avoid UB with 1 << 31 2026-07-09 21:36:34 -04:00
Rangi 39e7e064c9 Print correct color set limit value in error message 2026-07-09 21:29:02 -04:00
Rangi 7b97d7ce15 Fix RGBGFX crash on deduplicating transparent tiles 2026-07-09 21:24:59 -04:00
Rangi c667bac93a Use trailing return type for begin()/end() 2026-07-08 16:57:52 -04:00
Rangi db96144d49 Use [[nodiscard]] instead of [[gnu::warn_unused_result]] 2026-07-08 16:44:15 -04:00
Rangi 276a1a7952 Use const_cast more precisely to remove const without changing type 2026-07-08 16:42:53 -04:00
Rangi b219e03b38 Use more structured bindings 2026-07-08 16:38:32 -04:00
Rangi 824ebd80f9 Use [[fallthrough]]; attribute instead of // fallthrough comment 2026-07-08 16:30:52 -04:00
Rangi 5aedf31b46 Prevent 32-bit multiplication overflow
Basically impossible to achieve, but just in case
2026-07-07 17:02:46 -04:00
Rangi d94d0bcc2f Make explicit the assumption that targetFileName is checked before ever calling printDep 2026-07-07 17:02:46 -04:00
Rangi ed8e3e4d02 Reset errno = 0 before parseWholeNumber calls and errno == ERANGE checks 2026-07-07 17:02:46 -04:00