Rangi
307846b03e
Release v1.0.3
2026-08-01 11:27:43 -04:00
Rangi
e7e671b249
Update external test commits
2026-08-01 11:24:42 -04:00
Rangi
0c772ea049
Update external testing CI with libbet's new way of running Python
...
libbet now uses `py -3` if the `py` binary exists, instead of if
`COMSPEC` is defined. So we don't need to `unset COMSPEC`, we just
need to avoid Windows' `py` launcher from being in Cygwin's `PATH`.
It turns out that `C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 ...`
was not effectively preventing Windows' `PATH` from being inherited
by Cygwin's `PATH`, because to take effect it needs to run Cygwin's
`/etc/profile` script. The simple way to do that is using a login
shell. So we don't need the `PREFIX`/`--prefix` from the previous
commit after all.
2026-08-01 04:49:43 +02:00
Rangi
6f64fd00f6
Fix CI testing of installing RGBDS on Cygwin ( #2038 )
...
We need to pass `-e` to Cygwin `bash` explicitly, since specifying
it as the non-default `shell:` no longer automatically adds `-e`
behavior to `run` blocks.
We also need to install to `/usr/bin` (which `cygwin-install-action`
automatically adds to the `PATH`), not `/usr/local/bin` (which is not
in the default `PATH`). This tests our `PREFIX`/`--prefix` handling.
2026-07-31 10:25:59 -04:00
Rangi
4384223951
CI testing in Cygwin 64-bit now uses CMake and runs external tests ( #2037 )
2026-07-30 12:59:53 -04:00
Rangi
4e87f61656
Edit some comments and formatting in testing.yml for consistency
2026-07-29 22:08:21 -04:00
Rangi
9d854114ea
Use Ninja as the generator for CMake on FreeBSD
2026-07-30 02:33:47 +02:00
Rangi
70d8d67ffc
Run external tests for FreeBSD ( #2035 )
...
This requires aliasing `make` to `gmake` and `python` to `python3`
2026-07-29 19:45:07 -04:00
Rangi
ca2b8e4cde
Support the COLUMNS environment variable for help/usage output
2026-07-24 14:46:05 +02:00
Rangi
80c8e77b19
Fixed-point FMOD and LOG explicitly return 0 for some invalid inputs
...
This is consistent with `fix_Div`'s explicit error handling,
and does not rely on subtle C/C++ `fmod` or `log` IEEE 754 behavior.
2026-07-23 00:38:44 -04:00
Rangi
604c69e048
Fix palette-packing decant logic to avoid UB from invalid iterator ( #2031 )
...
The "Iterate through the component's color sets, and transfer them"
logic shifted `from.begin()`, which would make subsequent `std::advance`
calls go past `_assigned.end()` and cause UB. This rewrite uses absolute
numeric indexes into `_assigned` to avoid that potential problem.
I haven't been able to craft a test case that actually *reaches*
that piece of logic, and I suspect that it's unreachable given how
we sort and process color sets before decanting, but cannot prove
that; so it stays in. (Maybe if we added 4bpp 16-colors-per-palette
support, it would become reachable?)
2026-07-22 23:48:02 -04:00
Rangi
ec5e6cbabb
Handle -Wtruncation for link-time jr values
...
Fixes #2028
2026-07-21 14:51:58 -04:00
Rangi
50678d0942
Use _fseeki64/_ftelli64 on Windows since fseek/fell are limited by 32-bit long
2026-07-21 14:38:14 -04:00
Rangi
c691ec6607
Use std::optional<uint64_t> instead of long with a special -1 sentinel for seekSize
2026-07-21 14:31:05 -04:00
Rangi
c3073f4318
Assume that InsertionOrderedMap never adds duplicate keys
2026-07-21 14:07:45 -04:00
Rangi
e5b03e3cb1
Zero-initialize Png struct width and height just in case
2026-07-21 13:58:31 -04:00
Rangi
0d379e9016
Assume clz/ctz argument is nonzero in our fallback implementations
2026-07-21 13:56:57 -04:00
Rangi
9cbfec30c7
Avoid redundant "Unexpected text" error message after "Unknown" error
2026-07-21 13:54:11 -04:00
Rangi
9def9c9aa8
Fix an SDAS object error message to use the valid section name variable
2026-07-21 13:41:53 -04:00
Rangi
b5681c0d34
Set binary or text mode on stdout as well as stdin
2026-07-21 13:39:28 -04:00
Rangi
ec43f06bd9
Fix handling of at-files containing -- followed by positional arguments
2026-07-21 13:35:39 -04:00
Rangi
106ec399d5
Fix reading value of relocations symbol/section index from SDAS objects
2026-07-21 13:14:35 -04:00
Rangi
d9c0d37fd5
Explicitly allow JR offsets to wrap around in RGBLINK
...
This reverts commit f27a8132d9 .
2026-07-20 19:23:11 -04:00
Eldred Habert
3b1606c63c
Fix typo'd APT option in release workflow
...
Fixing up bcff14b596
2026-07-20 21:53:43 +02:00
Rangi
fa49e238a9
Release v1.0.2
2026-07-20 14:08:09 -04:00
Rangi
3426f685a0
Update libpng to 1.6.58
2026-07-20 14:08:09 -04:00
Rangi
c0e2f8340b
Output negative values with correct with in .sym files
2026-07-20 00:09:06 -04:00
Rangi
8883251bf9
Avoid UB from FileStackNodeType(type) on an invalid type
2026-07-20 00:06:09 -04:00
Rangi
f27a8132d9
Avoid truncating too-large JR offset from an invalid object file
2026-07-20 00:02:39 -04:00
Rangi
0af28de791
Fix assertion failure on nonzero base palette ID without an attribute map or palette map
...
Also fix palette map IDs to wrap at 256, not at 8 like attributes
2026-07-19 23:59:38 -04:00
Rangi
8d2275dc48
Use rpnErrorAt wrapper to ensure setting isError on all RPN errors
...
Two possible RPN errors were missing `isError = true;`
2026-07-19 23:45:45 -04:00
Rangi
7e11ab4d8f
uint16_t tileIdx type matches options.baseTileIDs
...
Tile IDs wrap at 8 bits, but that's handled by `uint8_t tileID`
2026-07-19 23:33:01 -04:00
Rangi
e84bcf83b4
Use Procedure concept to type-check decantOn lambda
2026-07-15 23:27:08 -04:00
Rangi
57c9bab3a5
Addresses are 16-bit in .map files, consistent with .sym files
2026-07-15 22:59:50 -04:00
Rangi
4ada3e85d8
Avoid overflow for very large ROMs (e.g. TPP1)
2026-07-15 22:57:25 -04:00
Rangi
ba4a7f2e6a
Explicitly assume what was verified earlier by readSection
2026-07-15 22:56:43 -04:00
Rangi
b0948566bb
Fail-safe treat 16-bit alignment as a fixed address even in RGBLINK
...
RGBASM does this itself, so should not output sections with 16-bit
alignment, but an invalid object file could otherwise cause
`getPlacement` to infinitely loop.
2026-07-15 22:46:57 -04:00
Rangi
5aa7067876
Comment on how overflow to 0 is explicitly allowed for tile and palette IDs
2026-07-15 22:28:08 -04:00
Rangi
dff176791c
Correct grammar "is" vs "are" in RGBGFX reverse mode error messages
2026-07-14 11:29:30 -04:00
Rangi
07f5969005
Consistency check the palette map, not just the attribute map
2026-07-14 11:27:41 -04:00
Rangi
d61c0561c1
Correct condition to completely print both palettes and options.palSpec
2026-07-14 11:23:03 -04:00
Rangi
b13b0c8eb8
Fix the same shifting UB for SDAS objects as for RGBDS ones
2026-07-14 11:13:30 -04:00
Rangi
ca2de0f429
Add issue template
2026-07-14 10:34:43 -04:00
Rangi
a821badc3e
Reorganize the readme
...
- Use sub-headings to let the reader skim more easily
- Link specifically to the Discord server before less-useful
"other community channels"
2026-07-14 10:34:43 -04:00
Rangi
cb34fe18f7
Use transparent instead of repeating 0x8000
2026-07-14 10:34:27 -04:00
Rangi
1ed22cc518
Mask blue for consistency (avoids transparent bit bugs)
2026-07-14 10:34:27 -04:00
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
Rangi
30fd4514dc
Add fail-safe for invalid RPN commands in bad object files
2026-07-07 17:02:46 -04:00
Rangi
08e83601f5
Fix CRLF check in parsing SDAS objects
2026-07-07 17:02:46 -04:00
Rangi
e606f4e997
Fix condition for invalid bank range check ( #2016 )
2026-07-07 17:02:35 -04:00
Rangi
9008d8391c
Consistently use sudo apt install -Uyq in workflows (two other cases)
2026-07-07 02:57:48 -04:00
Rangi
21682e8814
Consistently handle negative shifted macro args ( #2014 )
...
Negative macro arguments count from the end, i.e. `\<-1>`
is equivalent to `\<_NARG>`, even after `shift`ing them.
Negative arguments cannot be used to access shifted values.
2026-07-07 02:19:37 -04:00
Rangi
f82b0838a1
Disallow minus sign before symbol name in bracketed macro arguments ( #2015 )
...
This was being silently allowed but without actually negating the symbol's value
2026-07-07 00:42:09 -04:00
Rangi
dabd0a08d2
Remove impossible condition (uint64_t > UINT64_MAX)
2026-07-06 23:08:05 -04:00
Rangi
c3e10dbb03
Safeguard against localtime or gmtime failure
2026-07-06 23:05:19 -04:00
Rangi
3883c2a2b8
Reuse scrambleLimit instead of its equivalent expression
2026-07-06 22:50:31 -04:00
Rangi
cd0caaaceb
Clarify comment about -Wno-* behavior with parametric warnings
2026-07-06 22:44:39 -04:00
Rangi
1e4a060d9e
Guard against undefined behavior in double2fix
...
I haven't found input which triggers any, but this is more
technically correct just in case.
2026-07-06 22:38:06 -04:00
Rangi
fe3b238dea
Do not allow defining labels outside sections ( #2013 )
...
Creating a `Symbol` with `type = SYM_LABEL` but `section = nullptr`
is inconsistent and dangerous. I was not able to cause any buggy
behavior so far, but it's safer and reasonable to not create such
a symbol in the first place.
The main consequence is that `DEF(LabelOutsideSection)` will now
evaluate as 0.
2026-07-06 16:18:42 -04:00
Rangi
46a6966b70
Fix $8000_0000 % -1 to warn with -Wdiv like $8000_0000 / -1 does ( #2012 )
2026-07-06 15:08:44 -04:00
Rangi
be3fc61859
Fix included linker scripts with no newline at EOF ( #2011 )
2026-07-06 14:01:40 -04:00
Rangi
0adbb92e50
Same-line shellcheck comment explanations
...
These are obvious even with `git grep shellcheck`.
2026-07-06 04:43:08 +02:00
Rangi
09da4e001a
Use Bash arrays instead of POSIX splitting when possible
2026-07-06 04:43:08 +02:00
ISSOtm
3eb8c7e8f2
Let tests know they are being run under Cygwin
2026-07-05 20:58:50 -04:00
Rangi
189c679e13
Parallelize build jobs according to CPU count
2026-07-05 20:58:50 -04:00
Rangi
5d5000011a
Remove CMAKE_INSTALL_PARALLEL_LEVEL
...
This value "has no impact unless `INSTALL_PARALLEL` is enabled",
and since our install procedure is so simple, I don't think we need
to add that. (The `make install` commands don't use `-j` either.)
2026-07-05 20:58:50 -04:00
Rangi
f81f5fe63c
Use git clean -fdx instead of make clean in external projects
2026-07-05 20:58:50 -04:00
Rangi
6e643406a2
Refactor warning diagnostic code to reduce repeated output logic
2026-07-04 23:02:16 -04:00
Rangi
de36a11be7
Prevent rgblink -Wno-* disabled warnings from printing a location trace anyway
...
Fixes #2005
2026-07-04 23:02:16 -04:00
Rangi
799c55b4dd
Add [[gnu::format(printf, 1, 2)]] attribute to variadic function sectError
2026-07-04 23:02:16 -04:00
Rangi
ddd8f37508
Remove unnecessary default constructor for Token
2026-07-04 18:48:03 -04:00
Rangi
c55dec254d
Remove unnecessary const_casting methods
2026-07-04 18:45:41 -04:00
Rangi
0996a2f5ed
Encapuslate UTF-8 decoder state in a struct
2026-07-03 19:35:23 -04:00
Rangi
e3c594c250
Explain why we do not use file(GLOB ext_projects CONFIGURE_DEPENDS "external/*.cfg")
2026-07-03 18:38:07 -04:00
Rangi
daba94b495
Remove pointless std::move from non-move constructor
2026-07-03 13:12:29 -04:00
Rangi
2f604bfa9a
Fix error message when an rgbgfx output file cannot be created
2026-07-03 13:08:28 -04:00
Rangi
9bbb2247a7
Fix rgbasm -Werror=... not adding to the final error count
2026-07-03 13:05:33 -04:00
Rangi
9b4df11473
Describe how to patch external projects
2026-07-02 12:37:26 -04:00
ISSOtm
4a77c42ed7
Remove redundant labels from tests
...
It's possible to filter tests by name (`-R`)
2026-07-02 10:39:59 -04:00
ISSOtm
b12eac356e
Try to automatically determine the test OS name
2026-07-02 10:39:59 -04:00
ISSOtm
82702d8149
Point out an ordering dep isn't a success one
2026-07-02 10:39:59 -04:00
ISSOtm
1f9cc9651a
Avoid fetching some repos twice
...
Also enables a nice bit of logic cleanup
2026-07-02 10:39:59 -04:00
ISSOtm
04b9c7fa3d
Move external tests files to tests/external/
2026-07-02 10:39:59 -04:00
ISSOtm
5e8a6cde20
Remove the need to explicitly list external tests
...
I like having a single source of truth!
2026-07-02 10:39:59 -04:00
ISSOtm
d59081a918
Shorten external test prop names slightly
...
Makes the scripts a bit easier to read, I think
2026-07-02 10:39:59 -04:00
Rangi
250a94c588
Tell Dependabot to ignore minor and patch releases ( #2001 )
...
We specify major-only versions, e.g. `actions/checkout@v7`,
which automatically uses the latest minor+patch of that release.
2026-07-02 13:55:16 +02:00
37818a1847
Updates actions/checkout from 6 to 7 ( #1999 )
...
---------
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rangi <[email protected] >
2026-07-01 23:06:12 -04:00
Rangi
0e3d1df129
Generate install.sh with make -n install ( #1996 )
2026-06-30 21:28:45 +02:00
Rangi
586c3073f9
Revert "Remove static compile flags"
...
This reverts commit e3fc46f933 .
We need compile_flags.txt to support clang-tidy
2026-06-30 11:16:14 -04:00
ISSOtm
e3fc46f933
Remove static compile flags
...
We support CMake now, which can generate a more accurate `compile_commands.json` database
(and our `develop` preset automatically enables them)
2026-06-30 16:52:31 +02:00
Rangi
3941a28661
Remove unused variables
2026-06-30 10:30:31 -04:00
Rangi
a829e6c067
Refactor the test harness for external repo tests ( #1994 )
...
- Use CTest labels to filter tests ("internal"/"external", "free"/"nonfree",
and individual tool+project names) instead of defining `TESTS_RUN_NONFREE`
- Allow each external test to run independently in CTest
- Remove the unused no-op `fetch-test-deps.sh --only-internal` option
2026-06-30 16:19:41 +02:00
Rangi
b252877b05
Comment why we use Ninja as the generator for CMake
2026-06-28 17:38:50 -04:00
Rangi
22a3625144
Explicitly test installation with Make and CMake ( #1992 )
2026-06-28 17:31:24 -04:00
Eldred Habert and Rangi
6cba5518e9
Install Pillow together with the rest of our CI deps ( #1952 )
...
We shouldn't assume how the user wants to install things.
In particular, `--break-system-packages` is egregious.
---------
Co-authored-by: Rangi <[email protected] >
2026-06-28 13:06:40 -04:00
Rangi
caf561457d
Warn about CMake <3.27 for Windows-targeted builds ( #1989 )
...
We only use `$<INSTALL_PREFIX>`` when cross-compiling for MinGW on Linux,
so the relevant block is now wrapped in `if(WIN32)`
so a user can more easily lower the `cmake_minimum_required` version.
2026-06-24 23:53:11 +02:00
Rangi
fc7d9ad573
Handle more numeric literal syntax errors in linker scripts
2026-06-09 18:46:51 -04:00
Rangi
0b91bf654b
Rename BaseV to ValidBaseV
2026-06-09 17:55:38 -04:00
Rangi
6b2b6e6000
Fix off-by-one error with INCLUDEd linker script line numbers
2026-06-09 16:16:21 -04:00
Rangi42
f72a4d53e2
Add -Wlarge-constant to RGBLINK as it is for RGBASM
2026-06-09 16:16:21 -04:00
vulcandth
998f636495
Fix rgbgfx -Z palette overgeneration on merged color sets ( #1912 )
...
- Fix logic for color set comparison (which affects sorting them)
- Prune color sets which are proper subsets of newly-encountered ones
(a comment implied we were already doing this, but we weren't)
- Add more verbose logging to debug this behavior
2026-06-07 09:55:05 -04:00
Rangi
075f132d77
Use a smaller unordered_map just for looking up line-leading keywords
2026-05-27 22:01:20 -04:00
Rangi
31e1d2ec87
Do not build up a std::string when skipping leading keywords
2026-05-27 22:01:20 -04:00
Rangi
673c62414f
Use std::string_view keys for UpperMap
...
This avoids constructing temporary `std::string` objects on lookup
2026-05-27 22:01:20 -04:00
Rangi
007672f080
Intern identifier strings only after checking for keywords
2026-05-25 23:55:57 -04:00
Rangi
7eaca1577d
Update .gitattributes for test/asm/crlf.asm
...
A fresh clone showed a diff even without any bytes changed.
2026-05-25 22:57:52 -04:00
Rangi
996469ee28
Ensure CRLF line endings are preserved when necessary
...
Some test cases need CRLF line endings checked out even on Unix.
Also some source files had inadvertently contained CR bytes.
2026-05-25 22:00:45 -04:00
Rangi
55db252a8f
Simplify the lexer by removing BufferedContent and inlining ViewedContent ( #1981 )
...
Instead of reading 64 characters at a time into a rolling buffer
as `shiftChar()` is called, we read 8192 characters at a time into
a complete buffer before any `peek()`/`shiftChar()` operations.
2026-05-25 21:05:59 -04:00
Rangi
cfa0adf295
Intern strings used as identifiers (for labels, constants, macros, charmaps, etc) ( #1980 )
2026-05-25 16:22:29 -04:00
Rangi
ed19806434
Don't hard-code std::string as the key type for InsertionOrderedMap
2026-05-25 14:21:18 -04:00
Rangi
a0d96a0856
Factor out repeated expandedSymName logic
2026-05-25 14:21:18 -04:00
Rangi
4b992bfea5
Use the name of sym_GetPC() instead of hard-coding "@" again
2026-05-25 14:21:14 -04:00
Rangi
141a7fe22b
Add assume checks for expected Token types, like RPNValue has for RPNCommands
2026-05-25 14:14:34 -04:00
Rangi
43ffc89bb4
Correct comment SIZE_MAX to UINT16_MAX
2026-05-25 13:55:12 -04:00
Rangi
72a410c007
Encapsulate charmap_Init, like sym_Init
2026-05-25 13:54:26 -04:00
Rangi
090768e2c9
Some Expansion references can be const
2026-05-23 13:06:09 -04:00
Rangi42
5f2ee530b8
Pass -Wno-unused-but-set-variable by default, not just in make develop
...
The Bison-generated parser skeleton otherwise triggers this warning
with Apple clang++ for `yynerrs_`.
2026-05-23 01:40:13 -04:00
Rangi
4a173130b9
Optimize skipToLeadingKeyword for the common ViewedContent case ( #1968 )
2026-05-22 19:06:12 -04:00
Rangi
ef2f021892
Simplify sectError handling, without the need for an empty-string sentinel
...
The `errorNoTrace` case for the empty-string sentinel was unreachable,
so we can just have a `fatalNoTrace` error right away.
2026-05-22 18:17:25 -04:00
Rangi
dce14fd4b8
Use C++20 concepts to require constraints on template parameters ( #1977 )
2026-05-22 17:54:34 -04:00
Rangi
728bed39d5
Do not support GCC 9 ( #1978 )
...
This will let us use C++20 features that GCC 9's experimental
C++20 support did not yet cover, such as "concepts".
This reverts some commits:
- 6bcd79b997
- d5ce5329ea
- 728d14879b
2026-05-22 16:46:46 -04:00
Rangi
48fcd9a0ca
Use templates to reduce the redundant number-lexing functions ( #1963 )
2026-05-21 23:13:09 +02:00
Eldred Habert
1871b0a0b8
Use Windows git for checkout's post-job cleanup, not Cygwin's git ( #1953 )
...
This fixes an error from using Cygwin's git in checkout's post-job cleanup
2026-05-21 15:25:29 -04:00
Rangi
d56dbbb4bf
Refactor section creation errors, and simplify output for single errors ( #1964 )
2026-05-21 13:01:08 -04:00
Rangi
728d14879b
Consistently use -std=c++2a, not -std=c++20
...
Commit 63a911e657 switched
to `-std=c++20` since at the time we required GCC 10 or higher.
Commit d5ce5329ea partially reverted
to `-std=c++2a` since we once again support GCC 9, which did not
yet handle `std=c++20`.
2026-05-20 17:09:23 -04:00
ISSOtm
0ed8c2f8ee
Docu-comment an implicit correctness assumption
2026-05-14 14:47:23 +02:00
ISSOtm
d5186b088b
Link against (non-debug) MSVC runtime statically
2026-05-14 14:47:23 +02:00
ISSOtm
fee177d0b9
Link zlib and libpng statically by default
...
Only when we are building them ourselves, that is.
2026-05-14 14:47:23 +02:00
Rangi
42e3da837c
Comment the commands to use for profiling and code coverage
2026-05-09 20:52:45 -04:00
Rangi
358e8fe636
Add more tests of lexer's skipToLeadingKeyword behavior ( #1971 )
...
The character after the ending keyword gets blue-painted.
2026-05-09 15:56:17 -04:00
Rangi
c50a849757
Verbose tracing shows lexed and captured values ( #1969 )
2026-05-09 12:01:29 -04:00
Rangi
57111b219a
Describe the wine-shim Makefile target ( #1967 )
2026-05-09 15:27:08 +02:00
Rangi
be2d028ae6
Format getopt errors more like others (sentence case, quoted options) ( #1966 )
2026-05-09 13:27:34 +02:00
ISSOtm
1af8bdda16
Have CMake put RGBDS executables in our own dir
...
Not the top-level if we are part of a larger project!
2026-05-06 18:49:19 +02:00
ISSOtm
fa22b78e7d
Use type instead of which in shell scripts
...
The latter is not a Bash built-in,
and some environments turn out to produce non-conforming
return codes.
`type` is provided by Bash itself,
so we can rely on it better.
2026-05-05 16:03:33 +02:00
Rangi42
f0161b41c8
Update readHexNumber for consistency with other routines
2026-04-29 12:31:00 +02:00
Rangi42
ca23210f18
Refactor and rename some numeric literal lexing for asm and linkerscript consistency
2026-04-29 12:15:14 +02:00
Rangi42
85e044f5be
Use std::move when relevant in Token constructor
2026-04-28 13:32:45 +02:00
Rangi42
60e76b2da4
Avoid UB if new OOMs by removing std:nothrow
2026-04-28 13:28:32 +02:00
Rangi42
3c7488c131
Some refactoring, renaming, and debug assertions for clarity and safety
...
- Add more `assume()` checks in the lexer
- Replace double negative "`disable* = false`" with "`enable* = true`"
- Naming convention of "`std::deque<> *Stack`" when relying on
`.push_front()` and `.pop_back()`
2026-04-27 18:47:06 +02:00
Rangi42
9fd0c0297f
Fix invalid character in bracketed macro argument
...
The invalid character should not be consumed by `shiftChar()`.
2026-04-27 17:11:20 +02:00
Rangi42
c1c7e64249
Add two assume calls to verify lexer arguments
2026-04-27 15:35:10 +02:00
Rangi42
a18b2f1049
Consistently lex local labels after keywords, even when skipping/capturing
2026-04-27 15:28:30 +02:00
Rangi42
3f144b7713
Add test case for local labels after block-ending keywords
2026-04-27 15:04:12 +02:00
Rangi42
eeb3a73210
Small optimization to skipToLeadingKeyword
2026-04-27 14:26:47 +02:00
ISSOtm
37d39f91f6
Build using GCC 9 in CI
...
Checking that we don't regress this later.
Ubuntu doesn't package GCC 8, and we don't support it either,
so that is a good compromise for now.
2026-04-26 23:30:59 +02:00
ISSOtm
d5ce5329ea
Fix compilation with GCC 9
2026-04-26 23:30:59 +02:00
ISSOtm
6bcd79b997
Revert "Derive operator!= from operator== ( #1660 )"
...
This reverts commit 993879a2ed .
2026-04-26 23:30:59 +02:00
ISSOtm
decc5f7153
Let parallelism be determined automatically
...
Ninja is parallel by default;
however, it is not used on FreeBSD, so we still have to specify it there.
2026-04-20 15:32:54 +02:00
ISSOtm
a3c953ea46
Pass C++ compiler to CMake via env var
...
This is a little terser
2026-04-20 15:32:54 +02:00
ISSOtm
d43049c84d
Imply CMake source dir
...
Shortening our command lines slightly
2026-04-20 15:32:54 +02:00
ISSOtm
b6ff54acc3
Avoid libpng compilation on Windows spamming the Microsoft banner
2026-04-20 15:32:54 +02:00
ISSOtm
71fc449452
Use Ninja on Unix platforms
...
It has nicer UX, only showing full command lines when they fail.
It could also be slightly faster, though I've seen no measurable improvement.
2026-04-20 15:32:54 +02:00
ISSOtm
59dd1fbbf8
Correct naming of MSBuild CMake presets
...
You can build with MSVC without MSBuild
2026-04-20 15:32:54 +02:00
ISSOtm
2502d130eb
Use Ninja on Windows
...
MSBuild is slow, and its output is hard to parse visually
(it's all interwoven, like Make without `--output-sync`).
Since we use CMake anyway, we don't care about the build system.
2026-04-20 15:32:54 +02:00
ISSOtm
a78a268cb4
Pass convenience options to Make invoked via CMake
...
Can't pass them to plain Make invocations,
because we try to be compatible with macOS' old Make.
2026-04-20 15:32:54 +02:00
Rangi42
0553491107
Replace a FIXME comment with an explanation of why we can't/won't "fix" it
2026-04-20 14:51:38 +02:00
Eldred Habert
6edac50cc4
Target an even older version of Mac OS X
...
We can, so let's not ask if we should!
More realistically, we can right now so it's nice to mark that we do, but this is subject to be re-evaluated if any later changes conflicts with this.
Note also that this only affects the binaries we distribute with our releases!
It may very well be possible to compile RGBDS on even older versions of Mac OS X if you have the appropriate compiler setup;
we're just not testing it nor offering such binaries ourselves, but third-party packagers are welcome to do so.
(Looking at you, TigerBrew! ;)
2026-04-20 14:33:59 +02:00
Rangi
77dceaf43a
Update libpng to 1.6.57 ( #1958 )
2026-04-20 13:55:27 +02:00
Rangi
cfec017fed
Consolidate, refactor, and bugfix the lexer's handling of captures and skips ( #1957 )
...
- Do not error about local labels following keywords in skips or captures (fixes #1955 )
- Do not incompletely attempt to handle line continuations in skips (fixes #1956 )
- Rename `skipToLeadingIdentifier` to `skipToLeadingKeyword`, refactor to merge
`skipToEOL` into it, and use it for both skips and captures
2026-04-20 13:04:20 +02:00
Rangi42
12186fdccc
Keep more non-declaration initialization within the for loop clause
2026-04-19 22:01:56 +02:00
Rangi
71dfab3365
Use charmapEntry to simplify charmap_HasChar
2026-04-17 15:39:30 -04:00
Rangi
20b11039c9
Keep trie edges sorted for O(log N) lookup
2026-04-17 15:39:30 -04:00
Rangi
eb9e9c0f33
Replace charmaps' fixed-size 256-value array with a vector of pairs
...
This should save memory at the cost of O(n) instead of O(1) access,
which should be okay because the `next` vector is generally small.
2026-04-17 15:39:30 -04:00
Rangi
ac2a022124
Set the Cygwin shell once as a default for its job
2026-04-15 23:54:12 -04:00
Rangi
1249c4ef58
Revert "Set up Cygwin before cloning our repo"
...
This reverts commit aeedfb35a6 .
2026-04-15 21:53:29 -04:00
ISSOtm
aeedfb35a6
Set up Cygwin before cloning our repo
...
Otherwise different Gits set up and tear down the repo,
leading to issues.
2026-04-16 03:16:56 +02:00
ISSOtm
63609871f4
Cache downloaded dependencies for MinGW build also
...
Forgot about you!
2026-04-16 02:56:14 +02:00
ISSOtm
393eaa9dc1
Fix a Fix typo ;)
2026-04-16 02:54:40 +02:00
Rangi
b3c3981a90
Use a separate CI step to install clang-format before running it
...
Also use short `-Yqu` flags like our other invocations
2026-04-15 20:12:48 -04:00
ISSOtm
185a5c5369
Add necessary flags to apt install for checkformat
2026-04-16 01:58:42 +02:00
ISSOtm
4ea15ed85a
Touch up checkformat.bash
...
The logic can be slightly simplified,
and the script doesn't require Bash after all.
2026-04-16 01:05:03 +02:00
ISSOtm
b218fd65a0
Install clang-format on ubuntu-slim runner
...
Unlike the “fat” runners, that's not installed by default.
Why that causes `find` to nonetheless exit normally, I have no idea.
2026-04-16 01:02:30 +02:00
ISSOtm
81edc27b6e
Fix two warnings on MinGW
2026-04-16 00:57:33 +02:00
ISSOtm
dc52487d31
Make -Wformat non-fatal on MinGW
...
See the comment for a rationale.
2026-04-16 00:57:33 +02:00
ISSOtm
6b994b1737
Fix some warnings raised by MSVC
2026-04-16 00:57:33 +02:00
ISSOtm
0849eb801e
Decouple -Werror from MORE_WARNINGS
2026-04-16 00:57:33 +02:00
ISSOtm
e6916360f4
Set some flags only for our own code
2026-04-16 00:57:33 +02:00
ISSOtm
a802bcb320
Switch MinGW building to CMake
...
Automatically grabs and compiles libpng, and avoids having hacky lines in our Makefile
(the compiler specification *should* be orthogonal to the build target!)
Also move the MinGW package install to the `install_deps.sh` script,
to move logic off of the YAML.
2026-04-16 00:57:33 +02:00
ISSOtm
846aa975f1
Stop trying to install md5sha1sum
...
macOS already provides it and Homebrew doesn't override it,
so that's a no-op anyway.
2026-04-16 00:25:58 +02:00
ISSOtm
b65649ca73
Tidy up system info
2026-04-16 00:25:58 +02:00
ISSOtm
62ddabb570
Avoid hardcoding Brew's prefix
2026-04-16 00:25:58 +02:00
ISSOtm
d48d6fe5d9
Bump our macOS CI runners
2026-04-16 00:25:58 +02:00
Eldred Habert
ac0f93ffda
Delete GCC static analyzer workflow ( #1950 )
...
As for GCC 15, it is stated not to be suitable for C++ code,
and we have gotten annoyingly many false positives out of it,
so let's just disable it (as per
https://github.com/gbdev/rgbds/pull/1950#issuecomment-4243959126 ).
2026-04-14 22:04:20 +02:00
ISSOtm
a1712cb6d9
Run patch format check on ubuntu-slim
2026-04-14 22:03:29 +02:00
Eldred Habert
2968bee86f
Run macos-static tests using CTest ( #1947 )
...
We can, so why not? It has benefits.
2026-04-14 01:25:47 +02:00
ISSOtm
dec7a74166
Fix macOS static build
...
- Turns out the variable wasn't being set, and thus the flags weren't being passed
- Passing the flags via those variables is basically a bad idea, and it
turns out to break libpng's config script
- The flags need to be passed during link as well, otherwise the binary
isn't linked as a fat one
2026-04-14 00:01:14 +02:00
Eldred Habert
9c4e53d1c4
Transition CI from pkg-config to pkgconf ( #1942 )
...
Upstream has changed the providing implementation,
so that package will eventually be removed.
2026-04-13 19:46:05 +02:00
Eldred Habert and Rangi
463edc3c01
Enable color output in our Linux and macOS CI tests ( #1939 )
...
Co-authored-by: Rangi <[email protected] >
2026-04-13 19:31:01 +02:00
Rangi
73941c3249
Add .git-blame-ignore-revs as a blame.ignoreRevsFile
2026-04-13 13:26:29 -04:00
Rangi42
7596ae67b5
Fix internal link to docs/CONTRIBUTING.md
2026-04-13 02:34:46 -04:00
Rangi
fc08ab6aee
Print a GitHub Actions error annotation if install_deps.sh fails
...
See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-an-error-message
2026-04-13 02:04:56 -04:00
Rangi
c7663423d6
Update our Dockerfile to base on Debian 13 slim
2026-04-12 22:36:41 -04:00
Rangi
1ff73cd5e0
Revert "Stop trying to explicitly install pkg-config in CI ( #1940 )"
...
This reverts commit bc3572ec37 .
Turns out that our Dockerfile *does* need to install `pkg-config`
on the `debian:12-slim` image.
2026-04-12 22:33:25 -04:00
Eldred Habert
65ec1af1e8
Switch macOS static build to CMake ( #1938 )
...
This moves the tortuous flags out of our CI scripts,
and allows us to benefit from the libpng download caching.
2026-04-12 22:26:15 -04:00
Eldred Habert
bc3572ec37
Stop trying to explicitly install pkg-config in CI ( #1940 )
...
Turns out it's already installed by default,
but under a different name that's causing extra ops
for no real gain.
2026-04-12 22:08:38 -04:00
Eldred Habert
78281a4aaa
Break down CTest cases into each test suite ( #1931 )
...
This allows parallelising the individual programs'
test suites, which can save a few minutes!
2026-04-12 21:29:12 -04:00
ISSOtm
6e51ab6f55
Remove a duplicate warning flag
...
We always pass this one
2026-04-13 01:52:25 +02:00
ISSOtm
52aaf7e3b3
Fix MSVC dependent option syntax
...
This is not how CMake works lol
2026-04-13 01:37:38 +02:00
ISSOtm
09db4f25dd
Bump the maximum version of CMake tested with
...
Future-proofing!
This is both the version on my own machine,
and what's distributed by Homebrew (thus on GitHub's runners).
2026-04-13 00:33:31 +02:00
Eldred Habert
fed5db7743
Move documentation outside of the root directory ( #1936 )
2026-04-12 18:09:40 -04:00
ISSOtm
c6dbec7830
Stop trying to run version test on Cygwin and FreeBSD
...
Fixes #1934
2026-04-12 23:40:39 +02:00
Eldred Habert
017b0119e6
Overhaul checkdiff CI ( #1930 )
2026-04-12 16:06:28 -04:00
Eldred Habert
0e6e91d048
Avoid copying RGBFIX binary when testing it ( #1933 )
...
This is just cleaner in general,
and also avoids separating it from any DLLs it may be needing.
2026-04-12 13:23:51 -04:00
Rangi
df0b557638
Don't allow invalid interpolations to occur ( #1925 )
...
Fixes #1921
2026-04-11 18:16:07 +02:00
Eldred Habert
123201ecc6
Avoid repeatedly specifying bash as the command shell in CI ( #1926 )
2026-04-10 22:04:16 -04:00
Eldred Habert
422e8eec20
Generate Bison output in CMake build tree ( #1929 )
...
Again, moving away from in-tree builds
2026-04-10 18:46:57 -04:00
Rangi
49a4da2235
Revert "Generate Bison output in CMake build tree"
...
This reverts commit 4577ff16bc .
2026-04-10 17:18:40 -04:00
ISSOtm
4577ff16bc
Generate Bison output in CMake build tree
...
Again, moving away from in-tree builds
2026-04-10 22:56:59 +02:00
ISSOtm
b430d5a8b8
Note why we are not using a CMake list to pass Bison flags
2026-04-10 22:33:54 +02:00
ISSOtm and vulcandth
a5be1d886e
Copy DLLs to appropriate dir for install-less Windows testing
...
Co-authored-by: vulcandth <[email protected] >
2026-04-10 18:01:16 +02:00
vulcandth
c3b47abcc8
Use CPack for Windows packaging
2026-04-10 18:01:16 +02:00
Rangi
2cfb2b2533
Remove the claim that only exported symbols appear in sym and map files
...
Fixes #1916
This claim was true in v0.4.2, but intentionally changed in v0.5.0.
rgblink(1) already explains that "all visible labels and exported numeric constants"
will appear, which is a more appropriate location than rgbasm(5).
2026-04-09 21:28:07 -04:00
Rangi
187e1a55b8
Add examples for using character literals instead of strings as numbers
...
Fixes #1890
2026-04-08 21:42:10 -04:00
Rangi
143d503c6c
Update libpng to 1.6.56 ( #1922 )
...
Fixes #1920
This also switches from Homebrew-installed `sha2`
to macOS-preinstalled `shasum`.
2026-04-08 20:58:41 -04:00
Rangi
6e13779b8b
Use C++-sryle static_cast, not C-style explicit cast
...
`uint32_t(param)` is actually functional notation of explicit casting,
not a direct constructor call. `uint32_t{param}` would be uniform
initialization syntax for a constructor call, but would not allow
narrowing from `uint64_t`. See issue #1904 for discussion.
2026-04-08 20:05:36 -04:00
ISSOtm
ace2f3e613
Document why lib src cache is cross-OS
...
See https://github.com/gbdev/rgbds/pull/1919#discussion_r3048475606
2026-04-08 12:25:43 +02:00
ISSOtm
8d1a60d6b5
Switch release process to a lightweight runner
...
Easier to provision, less concurrency overhead for us
2026-04-08 12:25:43 +02:00
ISSOtm
11ac22d8f5
Switch from an Action to gh release
...
Fewer supply chain risks whooooo
2026-04-08 12:25:43 +02:00
ISSOtm
812e1f6d4b
Remove dead code checking for version tag
...
It was also vulnerable to template injection attacks.
2026-04-08 12:25:43 +02:00
ISSOtm
8dc052475b
Avoid caching in our release workflow
...
This is a malware distrib vector,
and we run this workflow sporadically enough
that we can afford to do so uncached.
2026-04-08 12:25:43 +02:00
ISSOtm
133eaa4e92
Build Windows release in, well, Release mode
2026-04-08 12:25:43 +02:00
ISSOtm
57f1894fbd
Fix installing Windows build deps on release
2026-04-08 12:25:43 +02:00
ISSOtm
021fe01eb0
Avoid CMake looking at test dir if testing is disabled
...
This saves building the two test support programs.
2026-04-08 12:25:43 +02:00
Rangi
9b4b4a581b
Check for overflow in fixed-point precision suffix ( #1918 )
...
Fixes #1917
2026-04-07 17:06:54 -04:00
ISSOtm
bcff14b596
Clean up docs workflows
...
Usethe `ubuntu-slim` runner to (hopefully) get faster setup times
2026-04-07 21:48:26 +02:00
Rangi
11f6278d95
Refactor lexing of fixed-point numbers ( #1915 )
...
This incidentally fixes a bug with too-long fixed-point literals
that have precision suffixes.
2026-04-06 21:45:34 -04:00
Rangi
ede9405daf
Fix some fixed-point literal lexing issues ( #1914 )
...
- No fractional digits are necessary after the decimal point,
e.g. `42.` is valid instead of `42.0`
- Error messages refer to "fixed-point" not "integer" constants
- Test more carefully for lexing unrelated to underscores
2026-04-04 13:41:45 -04:00
Rangi
25bf0e9e2c
SOURCE_DATE_EPOCH must be in base 10
2026-03-30 21:31:37 -04:00
dependabot[bot] and dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
167a7ee80c
Bump the actions group with 6 updates ( #1910 )
...
- Updates `actions/checkout` from 4 to 6
- Updates `docker/login-action` from 3 to 4
- Updates `Chizkiyahu/delete-untagged-ghcr-action` from 5 to 6
- Updates `actions/upload-artifact` from 4 to 7
- Updates `actions/download-artifact` from 4 to 8
- Updates `cygwin/cygwin-install-action` from 4 to 6
Signed-off-by: dependabot[bot] <[email protected] >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 21:28:45 -04:00
Rangi
4ce4162da4
A little .yml cleanup
2026-03-30 20:29:06 -04:00
Rangi
18b074711e
Fix rgbasm -s not overriding a previous -s
2026-03-30 20:18:19 -04:00
Eldred Habert
44b6a2c453
Add a key that turns out to be required
...
The documentation is super flaky tbh
2026-03-31 02:14:24 +02:00
Eldred Habert
3fc3130364
Fix some YAML syntax
...
I prefer TOML and JSON anyway...
2026-03-31 02:12:29 +02:00
Eldred Habert
5090395ca7
Enable GH Actions to be automatically bumped
...
Turns out those get new major releases somewhat often, and we get deprecation warnings and brownouts and all that.
Automatic bumps should help us avoid that, though I've set a *very* large scan interval to shield us from churn.
2026-03-31 02:03:37 +02:00
Rangi
efd4373a56
Check for a SDAS "Def" or "Ref" line before reading a subsequent integer
...
Without checking `token[0]` through `token[2], `readInt` starting at
`&token[3]` could go out of bounds on a badly-formed SDAS .rel object file
2026-03-30 19:45:44 -04:00
Rangi
92a31ff7df
Correct list numbering
2026-03-30 19:23:42 -04:00
ISSOtm
8025c2ae66
Require uploaded artifacts to be non-empty
...
We can get silent failures otherwise
2026-03-28 11:31:49 +01:00
ISSOtm
f7831ce8da
Simplify CTest pre-run test command
2026-03-28 01:21:08 +01:00
ISSOtm
b736fa22ff
Suppress status messages when fetching test deps
...
Let's avoid status message spam.
2026-03-27 22:07:28 +01:00
ISSOtm
0692d1d28c
Avoid passing a C++-only flag when compiling C files
...
Avoids compiler warnings. This can happen because zlib and libpng are both C projects,
and we build them from source if they are unavailable.
2026-03-25 17:11:46 +01:00
Eldred Habert
4b69d5cc8a
Fix name of test repo cache used by macos-static ( #1909 )
2026-03-24 09:02:28 -04:00
Eldred Habert
52aa518e20
Enable Git colours in CI
2026-03-24 12:40:34 +01:00
Rangi42
919a5dba89
Correct CONTRIBUTING.md to accurately describe test/fetch-test-deps.sh
2026-03-23 11:13:23 -04:00
Eldred Habert
d9932b9031
Always clone deps with --depth=1 ( #1908 )
2026-03-23 11:02:29 -04:00
Rangi
66e521e9e5
Factor out common error-handling functions for lexing numbers of different bases ( #1888 )
2026-03-19 15:32:25 -04:00
ISSOtm
b8e425b41d
Avoid passing irrelevant flags to our deps
2026-03-19 20:30:12 +01:00
ISSOtm
6b0658fb59
Cache library deps on Windows
...
Besides the immediate performance improvement, reducing
the frequency of downloads should make spurious
failures (network, rate-limiting...) less bothersome.
2026-03-19 20:30:12 +01:00
ISSOtm
91fdfcd179
Specify MSVC architecture using presets
...
Shortens CI command lines slightly,
and documents the requirement.
2026-03-19 20:30:12 +01:00
ISSOtm
5abebcf61f
Specify build type implicitly
...
Again, shortening the CMake command line.
Unfortunately, this doesn't apply to `--install`.
2026-03-19 20:30:12 +01:00
ISSOtm
145473d9bd
Use develop preset on FreeBSD
...
Leak detection is not supported, so we have to disable it.
2026-03-19 20:30:12 +01:00
ISSOtm
2fb64816a9
Indicate more clearly that LTO is not used in debug mode
...
This has made me worried once or twice
2026-03-19 20:30:12 +01:00
ISSOtm
7cf330e3f9
Enable CMake parallelism in a central place
...
Shortening command lines is useful
2026-03-19 20:30:12 +01:00
ISSOtm
2e66515096
Invoke CTest directly
...
This allows passing it arguments directly, like `--verbose` here
(which is more appropriate for CI use).
2026-03-19 20:30:12 +01:00
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
Rangi
65b0b49720
Update zlib to 1.3.2
...
Note that the DLL name created by CMake with `BUILD_SHARED_LIBS`
has changed from `zlib1.dll` to `z.dll`. This was caused by the
"Continued rewrite of CMake build [Vollstrecker]" from its
changelog <https://zlib.net/ChangeLog.txt >, and has been reported
in <https://github.com/madler/zlib/issues/1181 >.
The MinGW package `libz-mingw-w64-dev` still calls it `libz1.dll`.
2026-03-06 22:28:09 -05:00
Rangi
48d58ba095
Pass -Wdangling-alias to Bison 3.5 or newer
...
`bison -Wall` enables all diagnostics except `-Wcounterexamples`
(added in 3.7; we already pass it), `-Wyacc` (which we do not need),
and `-Wdangling-alias` (added in 3.5).
2026-03-06 22:28:09 -05:00
Rangi
af0505b4cd
Explicitly clarify that SECTION(@) returns the name of the current section
2026-02-06 19:37:49 -05:00
Eldred Habert
7c1e1fe515
Reference the file that actually provides the linker script lexer
2026-01-27 12:54:06 +01:00
Rangi
d053025070
Avoid writing "XXX" since it's a conventional "TODO/FIXME" comment
2026-01-22 13:01:10 -05:00
Rangi
ade898d815
List -B in rgbgfx options
2026-01-13 09:46:33 -05:00
Rangi
e738b90c69
Refactor to combine similar functions into one
2026-01-07 16:36:04 -05:00
Rangi
a91d26192d
Fix SECTION UNION alignment depending on piece order
2026-01-07 16:36:04 -05:00
Rangi
92bfe5d930
Release v1.0.1
2026-01-01 00:43:43 -05:00
Rangi
41fe1d8f25
Correct error message for unconstrained sections with overlay ( #1879 )
2025-12-28 19:21:53 -05:00
Rangi
63a911e657
Specify -std=c++20 not c++2a ( #1877 )
2025-12-21 11:44:14 -05:00
Rangi
a9ab248fed
Improve some RGBGFX error messages ( #1876 )
...
* Improve some RGBGFX error messages
* Fix assertion failure on ambiguous transparent/opaque pixels
2025-12-19 13:00:05 -05:00
Rangi
9b22ff3491
Fix link in man page
2025-12-12 18:25:47 -05:00
Rangi
a4af81f250
Fix two "Using a macro as first argument cancels effect of .Li" man page warnings
...
These were observed in https://udd.debian.org/lintian/?packages=rgbds
and can be reproduced by running:
for f in man/*; do
echo $f
LC_ALL=C.UTF-8 MANROFFSEQ='' MANWIDTH=120 \
man --warnings -E UTF-8 -l -Tutf8 -Z "$f" >/dev/null
done
2025-12-12 12:31:03 -05:00
Rangi
e08de399db
Clarify usage versus encoding of jr and ldh ( #1875 )
2025-12-11 17:46:39 -05:00
Rangi
d4e0ca5f90
Update libpng to 1.6.53
2025-12-11 11:48:18 -05:00
Rangi
2666dcbc26
Remove exclamation marks and periods from error messages ( #1874 )
2025-12-10 11:50:33 -05:00
Rangi42
27dca5680c
Fix formatting typo in man/rgbasm-old.5
2025-12-09 10:33:24 -05:00
Rangi
b0e0dfc56e
Handle a missing -P/--preinclude file the same as an INCLUDE ( #1873 )
2025-12-08 14:39:34 -05:00
Rangi
33475e2c36
Factor out version-printing to usage.cpp ( #1870 )
2025-12-05 23:04:49 -05:00
Rangi
c8161be23a
Add missing SPDX-License-Identifier: MIT comments
2025-12-05 22:41:12 -05:00
Rangi
2c5c453ab8
Refactor FileStackNode::printBacktrace from recursive to iterative
...
This avoids a potential stack overflow for very long backtraces,
or for corrupt object files with cyclic backtraces
2025-12-05 22:41:12 -05:00
Rangi
c3e245c13e
Correct typo in rgbds(5)
2025-12-05 22:39:30 -05:00
Rangi
3631fab63c
Fix bug where an object's invalid ROMX bank of 0 could break rgblink ( #1868 )
2025-12-05 11:21:00 -05:00
Rangi
1c00123b33
Add missing return 0; to rgblink main()
2025-12-04 21:06:46 -05:00
Rangi
131bb97ebc
Fix some rgblink object file input bugs found via fuzzing with AFL++ ( #1867 )
...
- ID numbers (for fstack nodes, sections, symbols, patches, etc)
might be too large for their associated collection
- Enum values might be invalid
- Bank values might be out of range for their section types
2025-12-04 20:49:16 -05:00
Rangi
8d6c617875
Use 4 spaces per tab in LCOV coverage report
2025-12-04 17:56:16 -05:00
Rangi42
752e2b3620
Symbol names with more than two '.'s could be defined as constants
...
Dot-only names could also trip an assertion in `make develop`
when used as labels
2025-12-04 15:15:41 -05:00
Rangi42
ad3188f038
Fix garbage characters at EOF causing an infinite loop
2025-12-04 15:15:41 -05:00
Rangi
a6eb6457d8
Clarify documentation of rgbgfx -C/--color-curve ( #1864 )
2025-12-04 10:49:23 -05:00
Rangi
0d3276975e
Update test dependencies ( #1865 )
2025-12-04 10:29:40 -05:00
Rangi
d961c697d7
Update libpng to 1.6.51 ( #1862 )
2025-11-22 19:05:52 -05:00
Rangi
1eb4eb3339
Reuse the usage.name for printing version info
2025-11-18 22:32:45 -05:00
Rangi
a3d3e1525a
Fix RGBLINK object type detection
2025-11-18 22:01:43 -05:00
Rangi
3553c9c4da
Fix RGBLINK evaluation of undefined RPN symbols
...
This was the only RPN case to not assign a deliberate value
in all possible branches.
Fixes #1858
2025-11-18 16:40:24 -05:00
Rangi
5c2c893ced
Refactor getSectionDescription in src/link/assign.cpp
2025-11-16 17:37:01 -05:00
Rangi
0f266d1c66
Specify more ASan options ( #1860 )
2025-11-16 17:11:09 -05:00
Rangi
8ab4602ae5
Add -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG to develop builds ( #1859 )
2025-11-16 13:11:08 -05:00
Rangi
04e3a904c2
Avoid calling style_Set/Reset before strerror(errno),
...
since they may call `isatty` which can change `errno`
Fixes #1857
2025-11-08 12:06:16 -05:00
Rangi
395b03e88e
Disallow SECTION UNION for ROM sections
...
Fixes #1855
2025-11-07 11:38:06 -05:00
Rangi42
fb9fa6038c
Release version 1.0.0
2025-10-31 20:19:24 -04:00
Rangi
35e5808423
Update rgbasm(5) docs based on @nummacway's feedback ( #1852 )
2025-10-31 18:36:53 -04:00
Rangi42
558d3ca0fc
Disallow labels before ENDC
2025-10-31 18:21:59 -04:00
Rangi42
df5162edca
Use loops instead of tail calls and musttail
...
gcc 15.2.1 20250813 complains "address of automatic variable can
escape to `musttail` call" from `-Wmaybe-musttail-local-addr`,
and guaranteeing tail-call optimization cross-platform is more
trouble than it's worth.
2025-10-27 12:05:27 -04:00
Rangi42
2519d1e698
Mention REDEF and FOR regarding EQUS expansion
...
Fixes #1851
2025-10-27 10:54:16 -04:00
Rangi42
ca383c91ca
Revert "More accurate 8-bit <=> 5-bit RGB color conversion ( #1827 )"
...
This reverts commit 223b3d1921 .
2025-10-24 13:32:59 -04:00
Rangi
8bedd710d7
Simplify musl's getopt, including removing optind, optopt, opterr, idx, and longonly
2025-10-23 13:39:28 -04:00
Rangi
efb5a88edb
Show conventional colored "error:"/"FATAL:" for CLI option errors
2025-10-23 12:40:29 -04:00
Rangi
f065243cd2
Enable RGBGFX's CLI "at-files" for all programs ( #1848 )
2025-10-22 17:05:59 -04:00
Rangi
a0bb830679
More consistent man page descriptions for CLI options
2025-10-22 14:48:24 -04:00
Rangi
7654c6e27a
More consistent man page descriptions for warning diagnostics
2025-10-22 14:03:34 -04:00
Rangi
400375b2e5
Share some handling between two tests of rgbasm -M -
2025-10-20 20:57:48 -04:00
Rangi
7462bccb72
Move struct Palette into its own file ( #1850 )
2025-10-20 16:59:24 -04:00
Rangi
2873e0b8c8
Use musttail attribute to guarantee tail recursion ( #1849 )
2025-10-20 15:56:22 -04:00
Rangi
1badba03d8
Clean up some #define callables
...
These are used where anonymous functions would not be sufficient
2025-10-13 13:14:49 -04:00
Rangi42
64bcef99bd
Lower default -Wtrunction= level to 1
2025-10-13 11:48:33 -04:00
Rangi42
aa672bbec9
Rephrase PURGE documentation and raise the default level to 2
...
Fixes #1847
2025-10-13 11:43:29 -04:00
Rangi42
651877e094
Avoid reusing a static local variable (too fragile)
2025-10-08 21:19:23 -04:00
Rangi
26c48cc409
Add RGBGFX test for libpng warning with invalid bKGD chunk
2025-10-08 15:44:15 -04:00
Rangi
23b9039716
Give clearer names to template parameters
2025-10-08 14:55:43 -04:00
Rangi
711fba5e35
Add more tests for things that only the external tests had covered
2025-10-08 13:32:48 -04:00
Rangi
089fc11e31
A local label starting with a keyword (e.g. jr.local) is an error
2025-10-08 12:23:08 -04:00
Rangi42
837f552987
Fix bank increment never happening due to unsigned overflow
2025-10-07 16:20:24 -04:00
Rangi
cb8c973453
Add test for undefined __SCOPE__
2025-10-06 17:51:21 -04:00
Rangi
cca3794dd0
Mention libpng in its internal warning and error messages
2025-10-06 17:03:51 -04:00
Rangi
02c2408f58
Implement reversed template for reversing for-each loops
2025-10-06 16:50:47 -04:00
Rangi
fba0562650
Fix repeated REPT nodes in backtraces
2025-10-06 16:36:55 -04:00
Rangi
0c9920d4a6
Use C++ iterator for fragment/union "pieces" of RGBLINK sections
2025-10-05 15:07:25 -04:00
Rangi
7733ccdeb6
Implement __SCOPE__ ( #1845 )
2025-10-04 16:41:21 -04:00
Rangi
13e85b5151
Replace all ctype.h functions with locale-independent ones
2025-10-03 12:52:24 -04:00
Rangi
268b586c9d
Release v1.0.0-rc2
2025-09-30 18:56:00 -04:00
Rangi
85d3b5df58
Add more RGBFIX tests
2025-09-30 18:20:53 -04:00
Rangi
eea277ae9c
Add more tests for RGBFIX
2025-09-29 22:43:16 -04:00
Rangi
538395b92c
Prevent simple syntax highlighters from breaking on /* in a string
2025-09-29 11:11:40 -04:00
Rangi
3108fb5297
Rename gbz80.7 "CPU opcode reference" to "Game Boy CPU instruction reference"
2025-09-28 16:43:36 -04:00
Rangi42
f99591bf6f
Link FORCE_COLOR and NO_COLOR
2025-09-25 14:06:44 -04:00
Rangi42
0297da4d4c
Add more tests for RGBASM coverage
2025-09-25 13:30:30 -04:00
Rangi42
96b953fe51
Add a test case for overlapping IF/ENDC and REPT/ENDR
...
This trips an asserton in the Rust rewrite because of its different
conditional stack design
2025-09-25 11:57:56 -04:00
Rangi42
0670c03bc2
Add CLI tests for RGBASM
2025-09-25 11:57:56 -04:00
Rangi42
09ef5b7e06
Refactor error fix suggestions in fstk_RunMacro
2025-09-24 19:35:41 -04:00
Rangi42
d5bb462f25
Separate isLetter into isUpper and isLower
2025-09-24 19:19:50 -04:00
Rangi42
b0727e9779
Suggest removing space before colon to define a label instead of invoking a macro
2025-09-24 18:32:45 -04:00
Rangi42
ca4b890273
Consistently do & alignMask, not % alignSize
...
Also add more unrelated tests for coverage
2025-09-23 13:25:51 -04:00
Rangi42
96a75500d3
Test gb-starter-kit from codeberg.org, not github.com
2025-09-23 13:06:12 -04:00
Rangi
634fd853d1
Factor out a single parseNumber utility function ( #1839 )
2025-09-22 15:15:24 -04:00
Rangi42
c8d22d8744
Refactor some iterator template code in RGBGFX pal_packing.cpp
2025-09-21 10:59:59 -04:00
Rangi42
3ece61b103
Use fewer templates in RGBGFX pal_packing.cpp
2025-09-20 22:00:17 -04:00
Rangi42
a82fd17529
Simplify RGBGFX code by using fewer templates
2025-09-20 21:06:51 -04:00
Rangi42
e7f5ab3f55
Warn about rgbgfx -O without -o or any of -A -T -P -Q
2025-09-20 20:23:29 -04:00
Rangi42
595c87b2f8
Update test dependencies
2025-09-20 15:23:02 -04:00
Rangi
c49a7d1e2f
Make CLI and OPT options -p and -Q more consistent ( #1834 )
2025-09-20 13:54:28 -04:00
Rangi42
d8aff148bb
Factor out RRANGE macro like RANGE
2025-09-19 16:53:44 -04:00
Rangi
e31bcabbaa
Implement === and !== string comparison operators ( #1832 )
2025-09-19 14:06:36 -04:00
Rangi
67741ab428
Trim left space from macro args, even past block comments ( #1831 )
2025-09-19 13:44:18 -04:00
Rangi
e0a6199f83
Allow charmap to map 'characters' as well as "strings" ( #1830 )
2025-09-16 12:51:07 +02:00
Rangi42
6cffd991f7
Document rgbasm -Wempty-data-directive
...
Fixes #1829
2025-09-15 09:44:50 -04:00
Rangi42
1fdeb34e50
Fix too-short .out.bin expected test results
...
RGBASM tests now use `rgblink -x` instead of `dd` to get trimmed
test output. RGBLINK tests cannot do so because some of them
(e.g. bank-numbers.asm and sizeof-startof.asm) rely on ROMX
sections above 1, and `-x` implies `-t` which breaks that.
2025-09-15 09:25:33 -04:00
Rangi42
9f16881d64
Use for-each loop
2025-09-10 21:18:33 -04:00
Rangi
223b3d1921
More accurate 8-bit <=> 5-bit RGB color conversion ( #1827 )
2025-09-08 15:13:25 -04:00
Rangi
65d408eb5d
Document more about the RGBDS architecture ( #1809 )
2025-09-07 15:34:52 -04:00
ReiquelApplegate
3677ab2ebf
Correct -q's arg name in rgbgfx(1) ( #1826 )
2025-09-07 18:28:37 +02:00
Rangi42
d404621e0d
Don't silence strings-as-numbers with OPT Wno-obsolete in tests
2025-09-07 12:17:39 -04:00
Rangi42
c8a088f281
Avoid nonessential EQUS expansion in tests
2025-09-06 13:45:12 -04:00
Rangi42
94ed28acf8
Avoid nonessential strings-as-numbers in tests
2025-09-06 12:45:01 -04:00
Rangi42
00b5077b2a
Make usage info output responsive to the terminal width
2025-09-05 21:58:17 -04:00
Rangi42
024b33b63a
make format should apply to all .cpp and .hpp files
2025-09-05 21:05:58 -04:00
Rangi42
dcc10cebc3
Add test for duplicate section after use of fragment literal
...
Verifies that #1822 was fixed (by c6997fe73c )
2025-09-05 20:14:01 -04:00
Rangi42
1fc9ba86c4
Some RGBLINK refactoring
...
- Consistently refer to `Section` fragments/unions as "pieces" (renaming `.nextu`)
- Remove `Symbol`'s `.label()` accessors (use `std::get<Label>`)
- Move some `Label`-related logic into `Symbol` methods
2025-09-05 16:34:51 -04:00
Rangi42
e569e0c200
Don't comment "; Next fragment/union" in .map files for empty section pieces
...
Fixes #1821
2025-09-05 15:31:46 -04:00
Rangi42
f7fb3af615
Run make tidy with Checks: '-*,misc-include-cleaner' in .clang-tidy (IWYU)
2025-09-04 13:39:23 -04:00
Rangi42
1dfc1d3231
Factor out isBinDigit and parseHexDigit utility functions
2025-09-04 13:23:10 -04:00
Rangi42
891e6f98df
Fix formatting of very long fixed-point numbers
2025-09-04 12:54:14 -04:00
Rangi42
bdc885bd69
Avoid UB when checking truncation range
...
Fixes #1818
2025-09-04 12:04:10 -04:00
Rangi42
5b67dc94b6
Add more test coverage
2025-09-04 01:29:50 -04:00
Rangi42
4f702a4be8
Try to optimize RPN expressions with .emplace_back instead of .push_back
2025-09-03 23:00:06 -04:00
Rangi42
c5d437ab3c
Tell people to use character literals or CHARVAL instead of strings as numbers
2025-09-03 22:46:19 -04:00
Rangi42
c5c2800f17
Move RPN buffer encoding logic into rpn.cpp
2025-09-03 22:36:00 -04:00
Rangi42
c798500563
Don't call rpn.clear() when we can safely assume it's already empty()
2025-09-03 21:02:57 -04:00
Rangi
590d113e94
Use a vector of RPN values ( #1820 )
...
This is instead of byte-encoding them in a different way than the actual object output's RPN buffer
2025-09-03 14:42:37 -04:00
Rangi
ee1db0a582
Fix RPN patches for all commands ( #1819 )
2025-09-02 16:44:25 -04:00
Rangi42
5701d747d4
Document the stricter rules for lexing underscores in integer constants
2025-09-02 14:39:28 -04:00
Rangi42
2110aaca20
Fix RGBLINK and RGBGFX warning/error message colors
2025-09-01 20:51:33 -04:00
Rangi42
8df88f92ba
Release v1.0.0-rc1
2025-09-01 18:09:42 -04:00
Rangi
534a4efee4
Add 0/1/2 warning levels to rgblink -Wtruncation ( #1816 )
2025-09-01 15:35:53 -04:00
Rangi42
cc96b4d517
Two small improvements
...
- Check whether `.read()` completed
- `.reserve()` expected space ahead of time
2025-09-01 11:46:41 -04:00
Rangi42
0ccdbf509a
Simplify format specs to not use a per-character state machine
2025-08-30 12:23:01 -04:00
Rangi
531278961f
Require underscores to actually be digit separators ( #1812 )
...
Multiple, trailing, or next to decimal point are errors
2025-08-30 10:44:20 -04:00
Rangi
85176ef10a
Fix q format spec ( #1811 )
2025-08-29 14:23:49 -04:00
Rangi
02b880e1b0
Separate RGBFIX header fixing from CLI option parsing ( #1808 )
2025-08-28 12:28:08 -04:00
Rangi42
c6997fe73c
Factor out InsertionOrderedMap to group an indexed list with a string-keyed map
2025-08-26 16:04:45 -04:00
Rangi42
c578a7b761
More specific error message when an expression is not constant because a symbol is undefined
2025-08-24 22:02:41 -04:00
Rangi42
8564df51e5
-Wexport-undefined warning for exporting undefined symbols
2025-08-24 17:36:47 -04:00
Rangi42
62d3b44768
Add test for UNION without NEXTU
2025-08-24 13:08:27 -04:00
Rangi42
ead5337fe0
Use scoped blocks for case-specific variables
2025-08-23 21:52:22 -04:00
Rangi42
0d509aa65c
Suggest DEF when undefined macros look like definitions
2025-08-23 21:40:51 -04:00
Rangi42
fcfc931867
Shorten lexing of simple tokens
2025-08-20 22:37:03 -04:00
Rangi
3d155d5695
Some refactoring and cleanup ( #1806 )
...
* Use clang-tidy `misc-include-cleaner` for IWYU `#include` cleanup
* Use `std::optional<size_t>` instead of `ssize_t`
* Rename some functions in linkdefs.hpp
* Fix header order
2025-08-20 16:09:04 -04:00
Rangi42
92ed6ece53
Support 32-bit addresses ("XL4") as of SDCC 4.4.0
2025-08-20 09:17:45 -04:00
Rangi42
e0e9ef190a
Clarify DAA documentation
2025-08-20 08:57:32 -04:00
Rangi42
386fb5f398
Add more character utility functions
2025-08-19 19:17:40 -04:00
Rangi42
94e9ef5213
Factor shared code out of lexer_CaptureRept and lexer_CaptureMacro
2025-08-19 18:11:50 -04:00
Rangi
0c4c25b2d2
Add a little more test coverage ( #1805 )
...
Format main.cpp files more consistently
Add `make format` to run clang-format on everything
2025-08-19 15:26:23 -04:00
Rangi42
f7167d8115
More consistent documentation for NP-complete heuristics
2025-08-18 21:45:26 -04:00
Rangi
b7e0783ae7
Implement ? suffix to "quiet" a context and exclude it from backtraces ( #1800 )
2025-08-18 21:34:58 -04:00
Rangi42
77a105e189
Mention the "first-fit bin packing" algorithm of RGBLINK
2025-08-18 11:51:01 -04:00
Rangi42
a16dcc0ea5
Downgrade FreeBSD release used for testing from 15 to 14.3
...
See https://github.com/vmactions/freebsd-vm/issues/108
We get the error:
ld-elf.so.1: Shared object "libutil.so.10" not found, required by "pkg"
2025-08-17 14:09:39 -04:00
Rangi42
9f373d49ac
Add more tests for edge-case macro and interpolation expansion behavior
...
Fixes #1803
2025-08-17 13:52:58 -04:00
Rangi
272019beb0
Fix line numbers from nested expansions ( #1802 )
2025-08-14 11:13:50 -04:00
Rangi
db6793f444
Don't count single quote ' as garbage ( #1801 )
...
Also copy the "blank space" (space or tab) vs "whitespace" (space,
tab, or newline) convention from `<ctype.h>`
2025-08-14 10:10:59 -04:00
Rangi42
ea1358bbe6
Predef std::pair to two-element std::tuple
2025-08-13 20:48:54 -04:00
Rangi42
2bdf61da70
Increase RGBASM test coverage
2025-08-13 12:26:01 -04:00
Rangi42
92826a726a
Move some static variables into the only functions that use them
2025-08-13 09:34:49 -04:00
Rangi
9c3ce69180
Factor out shared backtrace code ( #1793 )
2025-08-12 17:56:54 -04:00
Rangi
50d0b101c3
Format linker script error backtraces the same way as others ( #1792 )
2025-08-12 16:58:17 -04:00
Rangi42
1bf1219e07
Factor out shared --color-parsing code
2025-08-12 15:53:57 -04:00
Rangi
7b405513d9
Make quote marks consistent in error/warning messages ( #1791 )
...
- "Double quotes" for strings (filenames, section names, CLI option arguments, etc)
- 'Single quotes' for characters and CLI option flags
- `Backticks` for keywords and identifiers (symbol names, charmap names, etc)
CLI option flags also have their leading dashes
2025-08-12 15:24:21 -04:00
Rangi
7df9c12a6c
Fix division and modulo for very large negative numbers ( #1790 )
2025-08-11 20:46:47 -04:00
Rangi42
30a8503dcd
Format RGBFIX and RGBGFX warnings/errors the same way as RGBASM and RGBLINK
2025-08-11 15:16:00 -04:00
Rangi42
02310489c6
Suggest ld and call when failing to link ldh and rst
2025-08-11 15:02:18 -04:00
Rangi
5f8b7474b4
Add -B/--backtrace option to RGBASM and RGBLINK ( #1787 )
2025-08-11 14:30:14 -04:00
Rangi
92a9c73ee7
Deprecate __DATE__ and __TIME__ ( #1786 )
2025-08-11 09:48:18 -04:00
Rangi42
7ade3e74b3
Avoid the need to repeat -Weverything in test .flags
2025-08-11 08:11:32 -04:00
Rangi
978e832914
Allow :: to join instructions *and* data declarations ( #1785 )
2025-08-11 08:04:42 -04:00
Rangi42
2130a5ba1f
Error messages refer to "undefined" symbols and sections
2025-08-08 19:47:42 -04:00
Rangi42
9fc83efe06
Make rgbasm -Wlarge-constant enabled by default
2025-08-08 19:00:13 -04:00
Rangi
e41ce49698
Only print one warning for too-large integer constants, not one per digit ( #1781 )
...
This also makes all too-large integer constants evaluate to 0.
2025-08-08 18:58:38 -04:00
Rangi42
1574b5b1f7
Test the behavior of ds N, @
2025-08-07 09:41:33 -04:00
Rangi42
3f6db080b4
Ensure that alignment is at most 16 and we do not cause UB
2025-08-06 15:31:30 -04:00
Rangi42
f9a55bd5cd
Allow OPT to accept optional dashes before flags
2025-08-06 10:19:01 -04:00
Rangi
a4a830776b
Deprecate treating strings as numbers ( #1780 )
2025-08-06 10:13:22 -04:00
Rangi42
34d99b273c
Add zsh completions for --color flag
2025-08-06 09:26:22 -04:00
Rangi42
feb8365812
Document the deprecated rgbfix -O and string functions
2025-08-06 09:07:35 -04:00
Rangi42
bf66e346f0
Add -Wobsolete to RGBFIX and RGBGFX, and deprecate rgbfix -O
2025-08-05 17:18:54 -04:00
Rangi42
3a0a4b7f90
Deprecate 1-indexed string functions
2025-08-05 16:58:06 -04:00
Rangi
39f0f9edc0
Remove previously deprecated features ( #1777 )
...
- Treating multi-unit strings as numbers
- `rgbasm -Wnumeric-string`
- `ldio [c], a` and `ldio a, [c]` (use `ldh`)
- `ld [c], a` and `ld a, [c]` (use `ldh`)
- `ldh [$xx], a` and `ldh a, [$xx]` (use `$FFxx`)
2025-08-05 16:24:10 -04:00
Rangi42
a3983b7b0f
Support rgbgfx -c dmg to imply -c dmg=e4
...
Fixes #1776
2025-08-05 14:18:25 -04:00
Rangi42
504a45a4ed
Reuse isWhitespace and isNewline, also refactoring readAtFile
2025-08-05 13:46:53 -04:00
Rangi42
98c5c7f776
Support rgbgfx -c auto for automatic palette generation
2025-08-05 13:05:21 -04:00
Rangi42
7020cf7188
Make struct Uppercase have constexpr methods
2025-08-05 12:11:23 -04:00
Rangi42
70d129fcd7
Color "warning:" yellow in warnx
2025-08-05 11:26:21 -04:00
Rangi42
2d5f4d8910
More consistent missing-input error messages
2025-08-05 11:22:58 -04:00
Rangi42
26c6911c8f
More consistent man pages
2025-08-05 11:16:00 -04:00
Rangi42
f1fd3abcff
Don't bother searching the keywordDict for local labels
2025-08-05 10:49:09 -04:00
Rangi42
2cae47a5a2
Color verbose output as magenta
...
Output RGBASM's lexed tokens at level 5 (TRACE)
2025-08-05 00:00:57 -04:00
Rangi42
ac75a085fa
Refactor lexer_CaptureRept and lexer_CaptureMacro
2025-08-04 23:26:29 -04:00
Rangi42
0c1b422c36
Refactor some redundant lexer code
2025-08-04 22:43:34 -04:00
Rangi
23ce888d65
Use colored/styled text output for diagnostics and usage info ( #1775 )
2025-08-04 17:02:24 -04:00
Rangi42
d992b21141
Fix man page syntax for Flags
2025-08-03 13:22:22 -04:00
Rangi42
903492cce2
Fully support rgbasm -MC in Bash completion script
2025-08-03 13:08:36 -04:00
Rangi42
fc9b614225
Allow the index of CHARVAL to be optional
...
Fixes #1773
2025-08-03 08:44:06 -04:00
Rangi42
543b7fa6c2
Use std::nothrow for the only new expression
...
Ideally we'd use `std::make_shared`, but it has insufficient compiler
support for array types
2025-08-02 22:52:20 -04:00
Rangi42
5a7ffd19b0
Move or remove some redundant information from the README
...
* Move the folder structure to ARCHITECTURE.md (which can be
expanded as per #707 )
* Move the acknowledgements to CONTRIBUTORS.md
* Remove the history (it's a copy of man/rgbds.7)
2025-08-02 22:09:09 -04:00
Rangi42
7be7483571
Move more RGBASM parser action code out of the Bison file
2025-08-02 21:38:13 -04:00
Rangi42
2eeb333be0
Factor out more shared math operations between RGBASM and RGBLINK
2025-08-02 19:55:44 -04:00
Rangi42
fe8baaec50
Show contributors' avatars with contrib.rocks
2025-08-02 17:12:29 -04:00
Rangi
752b273aec
Extend RGBASM and RGBLINK verbosity flags to have multiple levels like RGBGFX ( #1772 )
2025-08-02 17:10:10 -04:00
Rangi42
b51056f743
Fix "while expanding symbol" error message
...
Fixes #1771
2025-08-01 16:25:44 -04:00
Rangi42
ee1aed51d8
Use std::numbers::pi instead of nonstandard M_PI
2025-08-01 13:07:02 -04:00
Rangi42
db2cda790c
Factor out a single consumeChar function
...
This and `peek` are the only functions that should call the low-level
`peekChar` and `peekCharAhead` methods.
2025-08-01 12:12:22 -04:00
Rangi42
86b43ea14f
Fix interpolation after empty string literal
2025-07-31 15:17:11 -04:00
Rangi42
d1829ed923
Release v0.9.4
2025-07-31 07:41:49 -04:00
Rangi42
6d53bc4121
Simplify toggling of enabling/disabling expansions
2025-07-31 07:19:04 -04:00
Rangi42
32b5ef5095
Expand the test for {interpolation} after two double quotes
2025-07-31 07:08:05 -04:00
Rangi42
a36f2b3b7d
Add test for {interpolation} after two double quotes
...
This is an edge case of how the lexer changes behavior when
reading string literals versus reading unquoted source code.
Three double quotes would begin a multi-line string literal,
but just two are still ambiguous, so it has to `peek()` to
see whether it's inside a multi-line string literal or
outside an empty regular string.
2025-07-31 03:31:16 -04:00
Rangi42
cd4be6aa07
Update test dependencies
2025-07-30 14:49:11 -04:00
Rangi42
499edaecd0
Exclude verboseOutputAssignments from LCOV coverage testing
2025-07-29 14:53:30 -04:00
Rangi
225490163e
Fix RGBGFX "decanting" on "components" (color sets sharing colors) ( #1768 )
2025-07-29 14:52:20 -04:00
Rangi42
d388a60daa
Reduce deep nesting in gfx/pal_packing.cpp
2025-07-29 14:02:51 -04:00
Rangi42
6d05de9d4d
Remove a little no-longer-necessary header boilerplate
2025-07-29 11:22:31 -04:00
Rangi42
5d6e571338
Mention palette filenames in rgbgfx -c error messages
2025-07-29 06:44:33 -04:00
Rangi42
308d488833
Use UpperMap for rgblink -S scramble spec matching
...
This also makes invalid RGBLINK CLI options into fatal errors
like the other programs
2025-07-29 03:41:31 -04:00
Rangi42
cecbf0aa0e
Add test case for some macro+interpolation behavior
2025-07-29 01:34:55 -04:00
Rangi42
d21e6669ce
Unrefactor peek() to use tail recursion instead of a loop
...
Profiling RGBDS on building pret/pokecrystal reveals commit
cfe1f60e47 as a clear outlier
among the past few hundred commits for reducing performance
(an 8% increase on my machine from ~5 to ~5.4 seconds).
2025-07-29 00:24:51 -04:00
Rangi42
2341d1ee50
Replace platform-specific mmap with reading the entire .asm file
2025-07-28 20:50:48 -04:00
Rangi42
53949761a7
Factor out our manual std::filesystem::path.replace_extension replacement into its own function
2025-07-28 13:11:47 -04:00
Rangi42
f7eb986313
Encapsulate access to sectionList and currentSection
2025-07-28 11:47:37 -04:00
Rangi42
75aed1afd5
Factor out an UpperMap for case-insensitive matching
2025-07-28 00:00:24 -04:00
Rangi42
d16751f56a
Avoid hard-coding a redundant "FATAL:" in RGBLINK
2025-07-27 20:07:53 -04:00
Rangi42
8b1a5244f7
Avoid hard-coding a redundant "FATAL:" in RGBFIX
2025-07-27 19:35:08 -04:00
Rangi42
b2747dfbd8
Factor out common usage-help code
2025-07-27 19:20:04 -04:00
Rangi42
16e16cdf51
Split up the linkerscript lexer and layout actions
2025-07-27 13:38:20 -04:00
Rangi42
a353637a90
Split RGBLINK linkerscript parser functions into their own file
2025-07-27 11:31:25 -04:00
Rangi42
f3cbfcecf4
Split RGBASM parser action functions into their own file
2025-07-26 16:20:25 -04:00
Rangi42
3bc8b1ff7c
Handle unknown MBCs, since raw numeric values are accepted
2025-07-26 14:15:05 -04:00
Rangi42
aa46c79db6
Use unordered_map lookups instead of manual switches for MbcType data
2025-07-26 13:30:56 -04:00
Rangi42
92acb6e547
Implement a single nbErrors counter inside generic diagnostic code
2025-07-26 12:54:50 -04:00
Rangi42
ac632d9223
RGBFIX returns 1 if there was a -Werror before processing any files
2025-07-26 12:29:57 -04:00
Rangi
0df5b7b86d
Implement warning diagnostic flags for RGBFIX ( #1766 )
...
* Implement warning diagnostic flags for RGBFIX
* `-m/--mbc-type help` prints to stdout
* Support `-m list` as well as `-m help`
* Make invalid `rgbfix -l` characters a fatal error, like other invalid CLI arguments
* Refactor fix/main.cpp into multiple files
2025-07-26 12:11:52 -04:00
Rangi42
87c10988ed
Add test case for block comments after line continuations
2025-07-25 07:49:25 -04:00
Rangi42
d6a28a6259
Prefer pre-increment/decrement operators in for loops
2025-07-24 18:08:17 -04:00
Rangi42
c6d0e8de63
Improve some error messages
2025-07-24 11:19:04 -04:00
Rangi42
ded4ef4072
Avoid non-ASCII characters when not necessary
2025-07-23 21:18:21 -04:00
Rangi42
1849a35e61
Rename proto-palettes to color sets (copied from rsgbds)
2025-07-23 21:13:46 -04:00
Rangi42
18e35053fa
Replace vectors with unordered_sets
2025-07-23 18:17:39 -04:00
Rangi
7e151f16c3
Factor out a single PNG-reading function to encapsulate the libpng API ( #1765 )
2025-07-23 15:53:33 -04:00
Rangi42
2ce4cdbff6
Reduce deep nesting some more, including larger refactors to assign.cpp
2025-07-22 19:38:49 -04:00
Rangi42
eea532ded1
Make sectionMap not extern
2025-07-21 20:20:04 -04:00
Rangi42
c83b87e0a0
Make all non-extern globals static
2025-07-21 20:14:09 -04:00
Rangi42
8d268e8a8a
Initialize maxRecursionDepth with other options
2025-07-21 19:58:37 -04:00
Rangi42
ee0f311c10
Make nbErrors not extern
2025-07-21 19:49:08 -04:00
Rangi42
61730be6ce
Make failedOnMissingInclude not extern
2025-07-21 19:40:01 -04:00
Rangi42
5f333d9753
More refactoring around extern variables
2025-07-21 19:22:10 -04:00
Rangi42
d1493a9f96
Group extern RGBASM variables in an Options struct
2025-07-21 19:02:21 -04:00
Rangi42
d652212857
Group extern RGBLINK variables in an Options struct, like RGBGFX
2025-07-21 18:12:40 -04:00
Rangi42
0cd60ea1e6
Use a patch_AddAssertion function instead of extern assertions
2025-07-21 17:49:41 -04:00
Rangi42
a0e23ee911
Remove unnecessary extern from nbSectionsToAssign
2025-07-21 17:27:43 -04:00
Rangi
ad81c74cda
Support PNG-format palette spec files ( #1764 )
2025-07-21 11:33:16 -04:00
Rangi42
9ef32e405c
Combine two places that did REPT chain printing
2025-07-20 15:16:53 -04:00
Rangi42
89ca6a325c
Increase parser test coverage
2025-07-20 13:52:29 -04:00
Rangi42
9e0e7ef9a1
Improve RGBASM test coverage
2025-07-20 13:13:45 -04:00
Rangi42
2dc948fefb
Miscellaneous refactoring
2025-07-20 12:28:59 -04:00
Rangi42
e3a5290dad
Restore blue-painting of macro arg expansions to prevent recursion
2025-07-20 11:53:36 -04:00
Rangi42
cfe1f60e47
Refactor peek() to use a loop instead of tail recursion
2025-07-20 11:38:26 -04:00
Rangi42
0eed237517
Refactor peeking at macro args to be like peeking at interpolations
2025-07-20 11:21:44 -04:00
Rangi42
68ffb01cac
Use nextChar() for shiftChar() and then peek()
2025-07-20 11:15:06 -04:00
Rangi42
169ac61e14
Rename nextChar to bumpChar in the RGBASM lexer for symmetry with std::filebuf in the RGBLINK lexer
2025-07-20 11:02:02 -04:00
Rangi42
0681110647
Refactor peek() some more
2025-07-20 10:59:35 -04:00
Rangi42
8d1b111692
Small lexer refactors, commenting when tail recursion occurs
2025-07-20 00:14:13 -04:00
Rangi
2935942667
Allow multiple preinclude files ( #1763 )
2025-07-19 17:07:15 -04:00
Rangi42
9a4593e823
Reduce nesting depth some more
2025-07-19 16:18:35 -04:00
Rangi42
250e08043b
Fix -W parameter parsing
2025-07-19 16:18:35 -04:00
Rangi42
14f5e16ae8
Prefer pre-inc/dec unless post-inc/dec are necessary
2025-07-19 16:18:35 -04:00
Rangi42
bf69043a1d
Reduce deep nesting some more
2025-07-19 16:18:30 -04:00
Rangi42
7086b8aeff
Document that -MG and -MC count READFILE
2025-07-18 20:32:08 -04:00
Rangi
53c39d01d4
Implement READFILE function ( #1759 )
2025-07-18 18:27:52 -04:00
Rangi42
4a2f9fc744
A little refactoring
2025-07-18 14:17:23 -04:00
Rangi42
e7d63f5f6b
Refactor code that handles when included files are missing
...
- Single unified routine for erroring out or handling missing dependencies
- Single three-state enum instead of two Booleans for missing dependencies
(this causes `-MC` to imply `-MG` instead of needing `-MG -MC`)
- Functions than can miss included files return a Boolean for whether the
parser should `YYACCEPT` and exit
2025-07-18 14:03:23 -04:00
Rangi42
b80b30fba1
Ensure that INCBIN parameters are non-negative
2025-07-18 12:44:27 -04:00
Rangi42
8e84850679
Run clang-tidy with make tidy
2025-07-18 10:10:34 -04:00
Rangi42
e31256c0d4
Remove rgbasm-only -lm from Makefile
2025-07-18 08:22:40 -04:00
Rangi42
9a9fd6603c
Replace test comments with assertions
2025-07-18 07:47:40 -04:00
Rangi42
e99ff5ac45
Use more concrete types instead of auto
2025-07-17 23:52:09 -04:00
Rangi42
60cec85638
Use separate caches for zlib and libpng on Windows 2022 vs 2025
...
Windows 2025 no longer has a D:/ drive
<https://github.com/actions/runner-images/issues/12416 >
which affects where the cached files go.
This can result in one of two errors in the "Install zlib" step
after restoring from cache:
- file cannot create directory: D:/a/rgbds/rgbds/install_dir/lib.
Maybe need administrative privileges.
- file INSTALL cannot find "C:/a/rgbds/rgbds/zbuild/Release/zlib1.dll":
File exists.
Separate caches per OS should solve this problem.
2025-07-17 21:47:45 -04:00
Rangi42
39f2ed1339
Fix order of sentences
2025-07-17 20:14:50 -04:00
Rangi
4c8724899b
Support SIZEOF(reg) to distinguish 8- and 16-bit registers ( #1758 )
2025-07-17 15:49:28 -04:00
Rangi
0c96234532
Use concrete types instead of auto when convenient and not redundant ( #1757 )
2025-07-17 14:59:51 -04:00
Rangi
9dddd87893
Run all CMake commands in bash ( #1755 )
2025-07-17 13:39:37 -04:00
Rangi
5eb093f13e
Implement warning diagnostic flags for RGBLINK ( #1754 )
2025-07-17 12:54:29 -04:00
Rangi
529989bde5
Update libpng to 1.6.50 ( #1750 )
...
* Update libpng to 1.6.50
* Don't patch MinGW libpng APNG support
* Use current libpng repo URL
2025-07-16 19:00:51 -04:00
Rangi
776e37980b
Add gb-starter-kit to test suite, excluding it on Windows, macOS, and BSD ( #1753 )
2025-07-16 18:17:01 -04:00
Rangi
7f24d46d44
Support more syntax in linkerscripts ( #1752 )
...
* No need to use `locale`s
* Implement octal numbers, `_` digit separators, and `0x/0b/0o` prefixes in linkerscripts
* Refactor some functions out of `yylex`
* Support `\0` in linkerscripts
2025-07-16 15:00:02 -04:00
Rangi42
cf6e5fec63
Fix unterminated strings in linkerscripts consuming their newline
2025-07-16 09:59:48 -04:00
Rangi42
d8fc25ee43
Add TODO comment for SDAS XL4 support
2025-07-15 22:07:11 -04:00
Rangi42
a0eccceb01
Remove unplanned TODO comments
2025-07-15 21:53:55 -04:00
Rangi42
2720224890
Refactor parsing of ld hl, sp + e8
2025-07-15 21:52:22 -04:00
Rangi42
8bebab1db0
Abbreviate RGBLINK errput that includes a src+lineNo
2025-07-15 18:37:28 -04:00
Rangi42
ee29579d3e
Reduce some more deep nesting
2025-07-15 17:41:32 -04:00
Rangi42
5aec36350b
Document more deprecated/removed features
...
Fixes #1748
2025-07-15 16:32:03 -04:00
Rangi
1fecf80659
Implement 'character' literals ( #1747 )
2025-07-15 13:08:50 -04:00
Rangi
b6d77fbb9e
Implement BYTELEN and STRBYTE ( #1744 )
2025-07-14 21:46:35 -04:00
Rangi
8a19c5c30a
Fix string function behavior with NUL characters ( #1746 )
2025-07-14 21:43:32 -04:00
Rangi42
0149122cd0
Note how to print lexed token names for future reference
2025-07-14 10:25:47 -04:00
Rangi42
35335aadbe
Add test for labels when expecting symbols
2025-07-14 00:10:14 -04:00
Rangi42
80df858ee3
Clarify comment
2025-07-14 00:02:25 -04:00
Rangi42
eafc32fd68
Simplify switch with one case to if
2025-07-13 23:48:01 -04:00
Rangi42
2adeda0318
Use std::tie for sort comparator functions
2025-07-13 14:47:10 -04:00
Rangi42
21a6d35b8b
Simplify readString
2025-07-13 13:26:59 -04:00
Rangi42
ce78280af3
Simplify appendCharInLiteral
2025-07-13 13:22:40 -04:00
Rangi42
041b86b8dd
Use Defer instead of relying on a "Don't return before this" comment
2025-07-13 12:52:45 -04:00
Rangi
611b0041c4
Exclude Bison-generated files from coverage report, and use dark theme ( #1742 )
2025-07-12 10:11:23 -04:00
Rangi42
ddb2acb652
Reduce more nesting depth, and fix an error message
2025-07-12 08:17:26 -04:00
Rangi42
da133baf17
Reduce nesting depth in lexer.cpp
2025-07-12 07:54:16 -04:00
Rangi42
d32b1912ed
Use verbosePrint in rgbasm as well as rgblink
2025-07-12 01:38:19 -04:00
Rangi42
82513e5255
Simplify appendCharInLiteral
2025-07-11 23:52:52 -04:00
Rangi42
f2708ce967
Consolidate readString and appendStringLiteral
2025-07-11 23:43:36 -04:00
Rangi42
01a5c94c7e
Factor out common code from readString and appendStringLiteral
2025-07-11 22:37:28 -04:00
Rangi42
e7a05b1db8
Refactor for better formatting
2025-07-11 10:59:03 -04:00
Rangi
510a4aa99d
Add RGBASM -MC flag to continue -MG after missing dependency files ( #1687 )
2025-07-10 13:25:36 -04:00
Rangi
3f4e8396aa
Implement warning diagnostic flags for RGBGFX ( #1738 )
2025-07-10 09:58:40 -04:00
Rangi42
276a200590
A few miscellaneous edits
2025-07-10 00:33:03 -04:00
Rangi
a40109e4e4
Update the UTF-8 decoder ( #1741 )
2025-07-09 23:13:30 -04:00
Rangi
34cf959c9d
Refactor to reduce nesting depth some more ( #1740 )
2025-07-09 22:46:40 -04:00
Rangi42
bf6875f160
Reduce nesting depth in diagnostics.cpp
2025-07-09 19:37:55 -04:00
Rangi
44f5b47bf0
Reduce nesting depth in some functions ( #1739 )
2025-07-09 16:20:33 -04:00
Rangi
41ab5dff5a
Implement [[ fragment literals ]] ( #1614 )
...
This feature is referred to as "code/data literals" in ASMotor,
and simply as "literals" in some older assemblers like MIDAS
for the PDP-10. RGBASM already had the "section fragments"
feature for keeping disparate contents together when linked,
so these worked naturally as "fragment literals".
2025-07-09 12:13:01 -04:00
Rangi
5e43ece578
Remove errx and errors.hpp ( #1737 )
2025-07-09 11:04:23 -04:00
Rangi
9acba4b412
Generate a coverage report in CI ( #1736 )
2025-07-08 21:39:11 -04:00
Rangi42
8c50839109
Miscellaneous updates
2025-07-08 17:45:13 -04:00
Rangi42
6736d2ec66
Ignore errors to allow lcov 2.3 to work
2025-07-08 17:02:28 -04:00
Rangi
6869e4807c
Make file.hpp independent of gfx ( #1733 )
2025-07-08 15:16:16 -04:00
Rangi
5de05e2e4b
Replace DefaultInitVec with std::vector ( #1732 )
2025-07-08 14:55:28 -04:00
Rangi
fda54fd0c3
Replace Either with std::variant ( #1731 )
2025-07-08 13:59:03 -04:00
Rangi
35962dedc4
Refactor warnings and errors ( #1728 )
...
* Remove `err` and `warn`, keep `errx` and `warnx`, using them in RGBGFX too
* Separate RGBGFX and RGBLINK warnings/errors from main options
* Separate `report` function into `error` and `fatal` messages
* Implicit newlines for most RGBASM errors
2025-07-08 12:58:23 -04:00
Rangi
991b74dd0d
Fix segfault with invalid RGBLINK scramble spec ( #1730 )
2025-07-08 12:34:54 -04:00
Rangi
1a77667409
Fix UBSan error with overflowing exponent operator ( #1727 )
2025-07-07 19:08:26 -04:00
Rangi
c9765ec158
Factor out program-independent warning diagnostic code ( #1725 )
2025-07-07 18:34:34 -04:00
Rangi42
202c91471c
Fix alignment compatibility with current lower alignment
2025-07-07 22:43:19 +02:00
Rangi
e14f68d1d7
Improve error message for align failure ( #1721 )
2025-07-06 08:36:11 -04:00
Rangi42
185a3b29e6
Implement base palette ID
2025-07-06 12:57:20 +02:00
Rangi42
d7b1569ee6
Document % changing from remainder to modulo in 0.5.0
2025-07-04 23:02:45 +02:00
Rangi42
468f1cd912
"The windows-2019 runner image is being deprecated"
2025-07-02 19:43:11 +02:00
Rangi42
965288de38
Fix out-of-bounds image slices
2025-07-02 19:43:11 +02:00
Antonio Vivace
008920f533
ci: tag rgbds:latest before pushing it
2025-07-01 01:29:57 +02:00
Rangi42
20ed6a52ee
Clarify release procedure checklist
2025-06-30 15:52:42 -04:00
Rangi42
8b85875b67
Release v0.9.3
2025-06-30 15:08:04 -04:00
Rangi
7054d81650
Implement grayscale DMG palette specs ( #1709 )
2025-06-30 14:53:05 -04:00
Rangi
5942117ac3
Avoid generating phony dependencies for files that don't exist ( #1708 )
2025-06-29 16:42:24 -04:00
Rangi42
e7a3b9d90e
Format rgbgfx -vvvvvv string visually
2025-06-21 14:16:48 -04:00
Rangi
b13d623ad4
Encode reversed PNG images as grayscale or indexed when possible ( #1703 )
2025-06-19 09:48:27 -04:00
Rangi
37bf9fae01
Only define parse.lac for Bison 3.5 or greater ( #1702 )
2025-06-14 17:01:16 -04:00
Rangi42
612cf3b7dd
Fix some formatting
2025-06-12 17:27:08 -04:00
Rangi
089e366ddc
Implement CHARVAL function ( #1701 )
2025-06-12 17:21:12 -04:00
Rangi
fa9e29e4ce
Implement ++ operator for string concatenation ( #1698 )
2025-06-12 22:52:00 +02:00
Antonio Vivace
fa3d83a3d1
ci container build: when pushing a version-tagged build, overwrite 'latest' as well
2025-06-08 18:21:58 +02:00
Rangi
804db4e073
Handle missing newline at EOF for linkerscript INCLUDEd files ( #1691 )
2025-05-22 10:55:58 +02:00
Rangi
5d998ef483
Restrict custom binary and graphics digits ( #1693 )
...
* Restrict custom binary and graphics digits
* Update documentation
* Fix build error
2025-05-22 10:52:51 +02:00
Rangi
126b1e5726
Reuse startsIdentifier and continuesIdentifier functions ( #1695 )
2025-05-19 15:31:26 -04:00
Rangi
4f2400c15b
Hint to {interpolate} names when EQUS expanding does not occur ( #1692 )
2025-05-18 17:53:34 +02:00
Antonio Vivace
063d284cbf
Dockerfile: explain commands
2025-05-16 18:48:08 +02:00
Antonio Vivace
205bf5a11d
Dockerfile: install the compiled tools after the compilation ( #1690 )
2025-05-16 18:48:08 +02:00
Rangi
41c94aa448
Omit the version number from distrbuted release archive filenames ( #1685 )
2025-05-06 13:28:54 +02:00
Rangi
d413870e6d
.sym file sorting accounts for local labels' parents' addresses and names ( #1684 )
2025-05-05 13:57:25 -04:00
Rangi
e95ac6fb06
Recover from errors even inside REPT/FOR loops ( #1683 )
2025-05-04 17:51:53 -04:00
Rangi
e1ae92709c
Fix STRSLICE with no stop index argument ( #1682 )
2025-05-04 16:56:25 -04:00
Rangi42
1715f85d50
Release v0.9.2
2025-05-04 10:04:11 -04:00
Rangi42
c2de0a991a
Update test dependency
2025-05-03 12:43:57 -04:00
Rangi
2e6e1ccf06
Show specific messages for some more invalid instructions, not just "syntax error" ( #1679 )
2025-05-03 12:31:00 -04:00
Rangi42
081f48404c
Remove a TODO comment about overlapping proto-palettes
...
The original algorithm makes a simplifying assumption that one
proto-palette does not fully contain another, and we have no
particular reason to violate this condition.
2025-05-03 10:19:33 -04:00
Rangi42
bdac0ce053
Remove unplanned TODO comments in src/gfx/pal_spec.cpp
...
ACT palette files support a transparent color index, but RGBGFX
cannot apply *one* such transparent color; it would need every
palette's first color to be transparent. Also ACT files tend to
say the first color is transparent anyway, which the user may
not have intended.
ACO palette files can specify version 2 color data, but it's
required to come after version 1 data, and the colors themselves
already exist in the earlier v1 data; v2 just adds UTF-16 names.
Thus, we do not need to be handling these data in those formats.
2025-05-02 21:29:14 -04:00
Rangi
122d91509f
Clear some more TODO comments ( #1677 )
2025-05-02 21:06:34 -04:00
Rangi
7c6f778ae7
Take care of miscellaneous commented TODOs ( #1676 )
2025-05-02 16:44:12 -04:00
Eldred Habert and Rangi42
8cf6c5423a
Implement --background-color ( #1508 )
...
Co-authored-by: Rangi42 <[email protected] >
2025-05-01 23:39:52 -04:00
Rangi
56f7222230
Don't output anonymous labels in map files ( #1674 )
2025-05-01 19:19:25 +02:00
Rangi
e45b9625ca
Group sequences of garbage characters ( #1672 )
2025-04-30 23:31:41 -04:00
Rangi42
e0a8eb8aff
Update test dependencies
2025-04-24 09:52:08 -04:00
Rangi and Eldred Habert
2a5b9b5f98
Fix two RGBGFX bugs ( #1671 )
...
* Fix two RGBGFX bugs
* Fix clang-format idempotence
* Update src/gfx/rgba.cpp
Co-authored-by: Eldred Habert <[email protected] >
---------
Co-authored-by: Eldred Habert <[email protected] >
2025-04-24 15:39:14 +02:00
Rangi42
a72843748f
Avoid using indirect C++ types
2025-04-23 00:53:20 -04:00
Rangi42
762e2311d2
Add test case for FOR loop variable reusing an existing one
2025-04-22 15:10:50 -04:00
Rangi
0b7cda9e0c
Allow negative values to count macro arguments from the end ( #1670 )
2025-04-20 00:37:50 -04:00
Rangi42
df83bc31d2
Consistently use PRId* not PRIi*
2025-04-19 23:44:34 -04:00
John Millikin
bc8d99d915
Add -o / --output option to rgbfix to write separate output files ( #1666 )
2025-04-19 23:17:11 -04:00
Rangi42
c841672059
Don't use tabs for alignment
2025-03-31 19:13:46 -04:00
Rangi42
75b605797d
Fix rgblink(5) man page syntax error
...
Copied from https://salsa.debian.org/twolife/rgbds/-/blob/640a5293/debian/patches/groff.patch
2025-03-07 10:37:20 -05:00
Rangi42
00d0ae840d
Avoid use of goto in nextLine
2025-02-27 14:28:17 -05:00
Rangi42
2cdbb145da
Avoid use of goto in shiftChar
2025-02-27 14:17:01 -05:00
Rangi42
d8192560b0
Avoid use of goto in FormatSpec::useCharacter
2025-02-27 13:45:13 -05:00
Rangi42
9b395f3bf1
Fix double negative
2025-02-23 13:36:55 -05:00
Rangi
0150eb4bf3
Exclude more lines from test coverage ( #1663 )
...
These fall into a few categories:
- `_unreachable()`
- Verbose print messages
- Errors that should never practically occur (alloc/read/write failure,
more than UINT32_MAX anonymous labels, etc)
2025-02-17 04:56:10 -05:00
Rangi
632342b254
Use LCOV_EXCL comments to exclude some lines from test coverage ( #1662 )
2025-02-16 13:56:55 -05:00
Rangi
c9060c7f2d
Increase test coverage ( #1661 )
2025-02-16 09:29:16 -05:00
Rangi
993879a2ed
Derive operator!= from operator== ( #1660 )
2025-02-15 12:37:42 +01:00
Rangi
62309d5c87
Define operator!= in terms of operator== ( #1659 )
2025-02-15 11:34:06 +01:00
Rangi
b2e865ee2a
Disable EQUS expansion for raw symbols (by parsing them as strings) ( #1648 )
2025-02-15 10:44:51 +01:00
Rangi
3feb75f84f
Implement new string functions ( #1655 )
...
`STRFIND`, `STRRFIND`, `STRCHAR`, `STRSLICE`, `CHARCMP`, `CHARSIZE`, and `REVCHAR`
2025-02-14 23:09:45 +01:00
Rangi42
ad4d9da4cf
Remove unnecessary default constructor definitions
2025-02-14 18:58:34 +01:00
Rangi42
1489854932
Use more const references when possible
2025-02-14 18:58:34 +01:00
Rangi
2aef09c8d9
Allow the bit/res/set bit index to be determined at link time ( #1654 )
...
This increments the object file revision number from 11 to 12
since it adds a new `RPN_BIT_INDEX` command.
2025-02-12 17:14:10 +01:00
Rangi42
48412e9c56
Some miscellaneous refactoring and copy-editing
2025-02-10 16:51:51 +01:00
Rangi
177a3abfac
Fix bug where macro names can be treated as numeric symbols ( #1653 )
2025-02-08 23:03:21 +01:00
Rangi
4c916b8da8
Parser refers to "symbol"s, "label"s, and "local label"s, not "identifier"s ( #1652 )
...
This better matches how the lexed tokens are discussed in rgbasm(5)
2025-02-06 18:01:33 +01:00
Rangi42
d9d381cb62
Refactor the parser to have fewer *_no_str intermediate rules
2025-02-04 18:59:11 +01:00
Rangi
fbde24ee17
Add contrib/checkformat.bash to check for clang-formatting ( #1646 )
2025-02-04 10:40:38 +01:00
Rangi
91310c9eb6
Update the post-release checklist to mention rgbds-live ( #1647 )
2025-02-04 09:59:03 +01:00
Rangi42
81ea4ee920
Release 0.9.1
2025-02-02 20:16:54 +01:00
Rangi
29ece2940d
Mention ASMotor's continued development ( #1643 )
2025-02-01 21:39:19 +01:00
Rangi
03452c6d4f
Allow git describe to get the version for FreeBSD and Cygwin in CI ( #1640 )
...
* Specify `safe.directory`
* Fetch tags
* Fetch all commits
2025-01-29 19:57:15 -05:00
Rangi
b35e9d86fb
Remove redundant @-style doc comment tags ( #1641 )
2025-01-29 19:56:28 -05:00
Rangi
e20347e38c
Add more RGBLINK tests ( #1639 )
2025-01-29 12:53:44 -05:00
Rangi
f61019dd68
Add more RGBLINK test coverage ( #1637 )
2025-01-29 11:41:08 -05:00
Rangi
c19ddc80f0
Fix failing assertion with backslash at EOF in macro arguments ( #1634 )
...
`Expansion::advance()` can increase its offset beyond the size,
so I don't think this assumption was valid in the first place;
`BufferedContent::advance()` should be able to as well.
2025-01-28 21:51:11 -05:00
Rangi
a59867cd78
Consistently use LF line endings in expected .out and .err output ( #1635 )
...
Test scripts compare files as text
2025-01-28 21:24:40 -05:00
Rangi
375adc6804
Fix STRLEN and STRSUB on incomplete UTF-8 ( #1633 )
2025-01-28 13:13:35 -05:00
Rangi
44caffe04a
Fix CHARLEN and CHARSUB on invalid UTF-8 ( #1630 )
2025-01-28 02:01:18 -05:00
Rangi42
d54619a453
Remove colNo column tracking from lexer
...
This was added as part of 71f88717 just for debug and fstack trace
output, but we no longer output it anyway.
2025-01-28 01:12:18 -05:00
Rangi42
e49291b7cf
Refactor readUTF8Char into charmap_ConvertNext
2025-01-28 00:07:08 -05:00
Rangi42
34a9c8e083
Add some more string test cases
2025-01-28 00:02:25 -05:00
Rangi42
c4b456b166
Remove unused fix_PrecisionFactor function
2025-01-27 23:04:11 -05:00
Rangi42
79401cce8b
Add braces inside #define macro bodies
2025-01-27 20:12:12 -05:00
Rangi42
4e44958d26
Add braces to Bison .y files
2025-01-27 20:12:12 -05:00
Rangi42
cae31005f8
Always use braces with InsertBraces: true in .clang-format
2025-01-27 20:12:12 -05:00
Rangi42
25c9f8f383
Add more rules to .clang-format
2025-01-27 20:12:12 -05:00
Rangi42
01c9106b59
Include windows.h before other Win32 header files
2025-01-27 20:12:12 -05:00
Rangi42
192fc808c8
Run clang-format on some Bison .y file contents
2025-01-27 20:12:12 -05:00
Rangi42
9c8e327ae2
Zero-initialize trimmedTile array
2025-01-27 20:12:12 -05:00
Rangi42
9ebd2a7e8e
Fix clang-format of sectionTypeInfo array
2025-01-27 20:12:12 -05:00
Rangi42
b8b60207f5
Use // line comments not /* block comments
2025-01-27 20:12:12 -05:00
Rangi42
c5e59f40fd
Get rid of unnecessary extern "C" blocks
2025-01-27 20:12:12 -05:00
Rangi42
a354af3d08
Reformat source files with clang-format 19.1.7
2025-01-27 20:12:12 -05:00
Rangi
20c18256ed
Avoid errors after missing INCLUDE with -MG ( #1627 )
2025-01-25 12:38:17 -05:00
Rangi42
890528812e
Prefer C++ constructs to C-style sizeof-based macros
2025-01-24 18:56:41 -05:00
Rangi42
84f59e14ed
Rename Z80 prefix to SM83
2025-01-24 12:11:46 -05:00
Rangi42
91d7ce5e09
Add test case for expansions changing context
2025-01-21 21:47:22 -05:00
Rangi
d9654b752f
Support -h/--help for all programs ( #1620 )
2025-01-21 21:24:17 -05:00
Rangi42
157826bf82
Support fetch-test-deps.sh --get-deps debian
...
Also use `apt-get` instead of `pip` to install
Pillow for libbet
2025-01-21 14:40:09 -05:00
Rangi42
a5e36f924f
Update help and error messages in run-tests.sh
2025-01-21 14:10:36 -05:00
robbi-blechdose
82f7bdb480
Allow running external tests against installed rgbds ( #1621 )
2025-01-21 13:43:31 -05:00
Rangi42
056190413e
Add test to cover RGBLINK behavior for patch overflow
2025-01-20 14:42:58 -05:00
Rangi
c2db23aef0
Run internal tests in FreeBSD ( #1616 )
2025-01-20 14:08:48 -05:00
Rangi
2426068409
Undeprecate ld [$ff00+c] ( #1619 )
2025-01-20 14:05:15 -05:00
Rangi
147a5c9bf3
Document more obsolete syntax ( #1618 )
2025-01-18 23:50:20 -05:00
Rangi
6ae3f040b8
Correct the DAA documentation ( #1617 )
2025-01-17 23:04:03 -05:00
Rangi
e561f63db3
Run internal tests in Cygwin ( #1592 )
2025-01-17 18:31:37 -05:00
Rangi
af9de812ec
Update libpng to 1.6.45 ( #1615 )
2025-01-17 14:41:38 -05:00
Rangi42
edc9e07a2d
Move all common error checks together inside mergeSections
2025-01-17 02:18:40 -05:00
Rangi
382ad17969
Don't output sections in reverse order ( #1613 )
2025-01-17 01:28:17 -05:00
Rangi42
fac5e35d24
Prefer empty braces to semicolons for empty loop bodies
2025-01-17 00:20:33 -05:00
Rangi42
a85d6b3b57
Remove unused readMagic function
2025-01-17 00:09:47 -05:00
Rangi42
f23a14afc7
Remove unnecessary semicolons after closing braces
2025-01-17 00:01:06 -05:00
Rangi42
f63167dd0f
Use const reference
2025-01-16 23:45:43 -05:00
Rangi42
0ee4ba95b3
Replace old-style cast in Windows-only code with static_cast
2025-01-16 23:41:12 -05:00
Rangi
727c1f5b50
Update Dockerfile to use Debian 12 slim ( #1599 )
2025-01-04 14:54:30 -05:00
Rangi
d829fd2ffe
Remove the 99999 macro arg limit ( #1597 )
2025-01-04 04:04:12 -05:00
Rangi
b13c0f2f8e
Use a constant for 0x8001 ( #1596 )
2025-01-04 04:03:40 -05:00
Rangi42
d9773424e4
RGBDS_OBJECT_VERSION_STRING is a literal
2025-01-04 03:53:59 -05:00
Rangi42
4e2464a69d
Replace some #define with constexpr
2025-01-04 03:53:59 -05:00
Rangi42
a5f12f66bb
Define the default -recursion depth in main.cpp with other default values
2025-01-04 03:53:59 -05:00
Rangi
73ad431b8d
Fix the node type for "file" nodes in object files ( #1593 )
2025-01-03 17:20:06 +01:00
Rangi42
d88feee1c0
Update test dependencies
2024-12-31 13:07:46 -05:00
Rangi42
5963dc9e0e
Only define __asan_default_options in make develop builds
...
`NDEBUG` is not defined in `develop`, `debug`, `profile`, and `coverage`
builds.
`__SANITIZE_ADDRESS__` is defined in `develop` builds.
2024-12-31 11:01:26 -05:00
Rangi
8363f25d47
Enable more sanitizers in make develop ( #1588 )
...
- `-fsanitize=undefined` encompasses multiple checks we were specifying
- "detect_leaks=1" for `__asan_default_options` checks for memory leaks
(except for with macOS clang++, which does not support LSan)
- `-fsanitize=float-divide-by-zero` is an extra UBSan check
(and reveals a UB bug to fix with fixed-point `DIV` and `LOG`)
2024-12-31 10:02:20 +01:00
Rangi
72b2a4d7c0
Use if constexpr to guarantee compile-time simplification ( #1590 )
2024-12-30 23:44:12 -05:00
Rangi
06daf2a9b5
Include <signal.h> in rgbgfx_test.cpp ( #1589 )
2024-12-30 23:22:14 +01:00
Rangi
ad95d2e06f
Allow deduplicating tiles with neither an input nor output tileset ( #1585 )
2024-12-30 18:58:07 +01:00
Rangi
5197e6b79f
Run gcc static analysis in CI ( #1587 )
2024-12-30 09:57:41 -05:00
Rangi42
b99ce3845e
Fix RGBFIX writing bytes when one syscall is not sufficient
2024-12-30 11:25:20 +01:00
Rangi42
d63955eccd
Release 0.9.0
2024-12-25 10:46:17 -05:00
Rangi42
2c4fc4cbe8
Update man page dates
2024-12-25 10:37:08 -05:00
Rangi42
7d3c31b6d8
Update CI test project commits
...
Note that libbet's latest commit updated some text, so its ROM hash changed
2024-12-25 10:29:06 -05:00
Rangi42
151f83db6d
Using C++20 [[unlikely]] here would be excessive micro-optimization
2024-12-23 14:14:10 -05:00
Rangi42
22838ce2d8
Remove redundant 0xC7 masking for RST values (the parser handles it)
2024-12-23 10:10:01 -05:00
Rangi42
b058bb6e15
Sorting RGB palettes by luminance is not a "legacy" feature
2024-12-23 10:01:30 -05:00
Rangi42
36b04b5dea
Rename parser value const to iconst to distinguish it from C++ keyword
2024-12-23 09:21:30 -05:00
Rangi42
a7296ecb31
Fix man page formatting
2024-12-21 00:44:33 -05:00
Rangi42
92917ceb2f
List LDHL as an unsupported instruction alias
2024-12-13 11:35:59 +01:00
Sylvie
c1c5b10082
Deprecate LDH with $00-$FF ( #1575 )
2024-12-10 21:27:37 -05:00
Sylvie
f44de0c7ae
Deprecate LD with [C] ( #1574 )
2024-12-10 21:13:09 -05:00
Rangi42
b18cfe6bdb
Consistently use UINT32_MAX, not -1, for uint32_t values
2024-12-10 19:47:23 -05:00
Rangi42
a8ec9228d4
List post-release steps to take for other gbdev projects
2024-12-10 13:06:58 -05:00
Sylvie
c1b85554a8
Document obsolete syntax in rgbasm-old(5) ( #1571 )
2024-12-10 12:34:37 -05:00
Sylvie
b877c81c32
Use C++-style casts ( #1576 )
2024-12-09 21:56:54 -05:00
Rangi42
e66da4c8c7
Consistently capitalize C
2024-12-09 13:42:01 -05:00
Sylvie
573e044b30
Deprecate LDIO ( #1567 )
...
* Deprecate `LDIO`
* `ld [$ff00+n8], a` is not treated as `ldh [n8], a`
2024-12-05 12:49:13 -05:00
Rangi42
ceb43c7aa4
Remove sample comments in workflow
2024-12-04 15:38:49 -05:00
Antonio Vivace
eae1ecb77e
ci: re-trigger build-container.yml with fine-grained PAT
2024-12-04 19:05:10 +01:00
Antonio Vivace
c4de6c402b
ci: clean up untagged artifacts
2024-12-04 18:57:43 +01:00
Sylvie
0b147c9386
Fix ** right-associativity, and clarify docs ( #1566 )
2024-12-03 20:40:50 -05:00
Sylvie
6982c8a116
Improve the instruction documentation ( #1561 )
2024-12-02 15:41:57 -05: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
Sylvie
a5d18d62df
Explain the DAA instruction algorithm ( #1564 )
2024-11-29 10:42:34 -05:00
Rangi42
a27f704c25
Implement -Wunmatched-directive
2024-11-28 20:30:38 +01:00
Rangi42
9216485bca
Add TRACE-level verbose logging for efficiency calculations
2024-11-27 21:06:18 +01:00
Rangi42
c33acb905b
Avoid precision loss from floating-point division in calculating efficiency
...
This was breaking test results on 32-bit MinGW
2024-11-27 21:06:18 +01:00
Rangi42
81c3521610
Add color_curve RGBGFX test
2024-11-27 21:06:18 +01:00
Sylvie
e0ee9dc3ad
Add reverse_1bit RGBGFX test ( #1555 )
...
Fixes a bug to always use 2bpp `_data` in `TileData`
2024-11-24 19:30:49 -05:00
Rangi42
cb546f0cd8
Fix rgbasm(1) formatting
2024-11-08 22:29:52 -05:00
Rangi42
a60186db2f
Document the RGBGFX -X and -Y options
2024-11-03 18:54:16 +01:00
Antonio Vivace
d9f87a5721
contributing: add paragraph regarding the container image
2024-10-29 00:43:48 +01:00
Sylvie
a7fdb2c3d3
Add more RGBGFX test coverage ( #1553 )
2024-10-27 11:32:21 -04:00
Sylvie
5efd303b7f
Allow LOAD FRAGMENT ( #1552 )
...
This was implemented in #736 but removed after discussion in #869 .
Fixes #1537
2024-10-24 19:45:44 -04:00
Rangi42
0d3980d039
Refactor how map file sections are printed
...
This makes size-0 sections print as "($0000 bytes)" instead of
"(0 bytes)", which is more consistent.
2024-10-23 17:10:39 +02:00
Rangi42
ab6244d81c
Escape characters in section names in map files
2024-10-23 17:10:39 +02:00
Sylvie
7fcf4ba60f
Correctly recover from syntax errors at the first token of a line ( #1549 )
2024-10-22 21:01:44 +02:00
Sylvie
f048cbbb11
Clean up some man pages ( #1547 )
2024-10-22 13:07:09 -04:00
Rangi42
4c495c31d9
Release 0.9.0-rc2
2024-10-21 22:52:18 -04:00
Sylvie
90286ccbbc
Fix detection of tiles with too many colors ( #1546 )
2024-10-20 13:51:39 -04:00
Sylvie
b33aa31944
LOAD FRAGMENT is not allowed (#1536 )
2024-10-17 14:42:19 -04:00
Quinn
dd6c741143
Swap manpage descriptions of HIGH(n) and LOW(n) ( #1545 )
2024-10-16 21:10:50 +02:00
Sylvie
3b3263273c
Make ENDL optional like ENDSECTION ( #1538 )
...
Add warning for `LOAD` without `ENDL`
2024-10-15 21:13:50 -04:00
Sylvie
bc5a71ff88
Update some RGBLINK error messages ( #1544 )
2024-10-16 01:42:49 +02:00
JL2210
e623aeb85d
Make tests work with CTest ( #1539 )
...
Adds option to disable non-free tests
2024-10-15 19:26:17 -04:00
Sylvie
a2ff653a83
Fix nested undefined interpolation segfault ( #1542 )
2024-10-16 00:09:47 +02:00
Sylvie
a13723c523
Implement 0x/0o/0b number prefixes ( #1533 )
2024-10-08 15:56:00 -04:00
Sylvie
cf85146353
Refactoring and enhancements to RGBASM warnings ( #1526 )
...
* Allow a `no-` prefix to negate "meta" warnings
(`-Wno-all`, `-Wno-extra`, `-Wno-everything`)
* Allow `-Wno-error=...` to override `-Werror`
(including for "meta" warnings)
2024-10-04 21:52:40 +02:00
Rangi42
a9e49a09fd
Allow tab character after backslash line continuation
2024-10-01 22:41:55 -04:00
Antonio Vivace
cbe44fed9b
ci: run only the "build tagged container image" step on tag pushes
2024-10-02 00:57:44 +02:00
Antonio Vivace
c439b8e27f
ci: add descriptions to built container images
2024-10-01 22:57:30 +02: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
Rangi42
e1ac7f389d
Correct some documentation of RGBASM warnings
2024-09-30 15:58:09 -04:00
Sylvie
d5159f66be
-Wall enables -Wcharmap-redef, and document -Wnested-comment (#1528 )
2024-09-30 14:34:58 -04:00
Rangi42
c7a029a051
Remove duplicated condition check
2024-09-30 10:47:57 -04:00
Sylvie
d5ded84501
Move definition of _POSIX_C_SOURCE to include/platform.hpp ( #1524 )
2024-09-29 23:53:15 +02:00
Sylvie
4cd0dd5314
Use setmode instead of fdopen ( #1520 )
2024-09-29 14:06:59 -04:00
Sylvie
9783671399
Simplify some C++ abstractions ( #1518 )
...
* Remove namespaces
* Prefer `bool operator==`, not `friend auto operator==`
* Prefer not to use `using`
* Use a `constexpr` function instead of a template for `flipTable`
2024-09-26 00:07:27 -04:00
Rangi42
8037b9e10a
Run clang-format
2024-09-25 13:15:58 -04:00
Rangi42
7c74653aa1
Fix swapped warning comments
2024-09-25 11:25:03 -04:00
Sylvie
22767e36e2
Refer to "end of line", not "newline" ( #1517 )
2024-09-23 02:15:02 +02:00
Sylvie
6b89938da7
Avoid treating labels and macros differently in column 1 ( #1515 )
...
Fixes #1512
2024-09-23 01:26:25 +02:00
Sylvie
15919e550f
Add test to demonstrate lack of expansions in skipIfBlock ( #1516 )
2024-09-22 15:31:12 -04:00
Antonio Vivace
f93587c805
ci: give packages/write permission to build container image action
2024-09-22 01:14:44 +02:00
Antonio Vivace
a870f7de10
ci: tag release container images
2024-09-22 01:06:33 +02:00
Antonio Vivace
6b72067387
ci: add explicit write permission to the build container image job
2024-09-22 01:05:22 +02:00
Sylvie
84c01f064f
Refactor some workflows for consistency ( #1510 )
2024-09-21 11:12:09 -04:00
Rangi42
5d3e96662e
Only publish container for gbdev
2024-09-21 10:06:23 -04:00
Rangi42
91580043e0
Use latest docker/login-action
2024-09-21 09:59:28 -04:00
Antonio Vivace
3e28e92622
ci: build "master" container image and publish it to ghcr on every push
2024-09-20 16:49:25 +02:00
ISSOtm
d494f73825
Document extra pre-release updates
2024-09-18 19:38:03 +02:00
Rangi42
b03a5b13b7
Clarify when to manually publish prerelease docs
2024-09-18 12:40:08 -04: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
Rangi42
dd20012e88
Release 0.9.0-rc1
2024-09-18 10:15:38 -04:00
Rangi42
91fbece1ad
Update man page and license copyright dates
2024-09-18 10:01:39 -04:00
Rangi42
0597ff82e3
Update test dependencies
2024-09-18 09:59:00 -04:00
Sylvie
9ef2e43bf7
Track local label scope, string equated as .. ( #1504 )
2024-09-18 09:52:30 -04:00
Sylvie
197f6cb0ba
No need for .c_str() with keywordDict lookups ( #1505 )
2024-09-18 12:23:05 +02:00
Rangi42
9b3d19c3f2
Prefer snprintf to sprintf
...
This also simplifies advancing `ptr`
2024-09-15 00:01:09 -04:00
Rangi42
02439b18c0
\# will always be defined inside macros
...
This lets the case structure here match the other branches
2024-09-15 00:00:00 -04:00
Sylvie
122ef95d9c
Implement . string constant for the current label scope ( #1499 )
2024-09-13 21:20:01 +02:00
Sylvie
bfb96b038d
Make error messages for "undefined" built-ins more accurate ( #1501 )
2024-09-11 17:54:23 +02:00
Rangi42
1adf68d018
Refer to "label scope", not "symbol scope"
2024-09-10 21:38:50 +02:00
Rangi42
750e69c5a6
More asserts like the one in addLabel
2024-09-10 21:38:50 +02:00
Rangi42
6e83a14143
Consistently handle auto-scoping of local symbols
2024-09-10 21:38:50 +02:00
Rangi42
cff05435ad
Remove redundant and sometimes inaccurate comments
2024-09-10 21:38:50 +02:00
Rangi42
3b59e8963e
Rename variables to avoid C++ reserved "_[A-Z]" prefix
2024-09-10 21:38:50 +02:00
Rangi42
56af572bfd
Refactor symbol value getters for less redundancy
2024-09-10 21:38:50 +02:00
Rangi42
6bc2446966
Rephrase error messages for consistency
2024-09-10 21:38:50 +02:00
Rangi42
155e7287db
Store a pointer to the scoped label, not just its name
2024-09-10 21:38:50 +02:00
Sylvie
1dcc000572
Report locations for RGBLINK errors with conflicting objects ( #1494 )
...
This requires updating the object file format to record the
fstack context for sections themselves, not just for patches.
2024-09-10 19:23:48 +02:00
Rangi42
8cd0e66297
Revert "Implement INCLUDE_ONCE directive ( #1481 )"
...
This reverts commit 5f07095f6d .
2024-09-08 11:30:31 -04:00
sukus
5f07095f6d
Implement INCLUDE_ONCE directive ( #1481 )
...
Identify files by (device, inode), not by path, so that symlinks,
relative paths, case-insensitive paths, or other edge cases
do not result in double includes.
2024-09-08 00:02:02 -04:00
Rangi42
11f0e88b30
Factor out common sanity checks for section union and fragment
2024-09-06 21:55:28 -04:00
Rangi42
d917df406d
Use camelCase instead of lowercase for static functions
2024-09-06 21:48:57 -04:00
Sylvie
323028d9f2
RGBLINK lists local symbols when encountering an unknown symbol reference ( #1496 )
2024-09-06 21:31:13 -04:00
Rangi42
7960a10228
These extensions should be binary
2024-09-06 21:35:17 +02:00
Rangi42
068ad93427
Allow syntax cpl a
2024-09-06 21:35:17 +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
Sylvie
1283b0b6a6
Allow dollar signs in identifiers ( #1493 )
2024-09-03 23:09:06 +02:00
Rangi42
a098213053
Rearrange switches so default cases are last
2024-09-01 13:00:04 -04:00
Sylvie
6b8d33529e
Improve string/interpolation formatting ( #1491 )
...
- The '#' component for type 's' now escapes the string characters
- The '#' component for type 'f' now prints a precision suffix
- The new 'q' component specifies a precision value
2024-09-01 12:54:26 -04:00
Sylvie
2fb76ce584
Traverse the charmap trie to reconstruct mappings instead of saving them ( #1487 )
2024-09-01 15:22:56 +02:00
Sylvie
7330c2c606
Replace unmangle with cygpath ( #1490 )
...
Use `-m` not `-w` so paths use forward slashes
2024-08-31 00:10:44 -04:00
Rangi42
c07371c9fc
Revert "Show test issues as annotations in the GitHub Actions job summary"
...
This reverts commit 3a5ff35928 .
Annotations were not actually appearing.
<https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions >
2024-08-27 14:07:35 -04:00
Rangi42
15f0871683
Update some names and comments
2024-08-27 14:04:52 -04:00
Rangi42
26fcff831d
Run clang-format
2024-08-27 01:49:05 -04:00
Rangi42
3a5ff35928
Show test issues as annotations in the GitHub Actions job summary
2024-08-27 01:02:53 -04:00
Rangi42
38a90890fb
A few more rgbasm documentation tweaks
2024-08-27 01:02:06 -04:00
Rangi42
de84e3ea8b
Rewrite and rearrange some rgbasm docs
2024-08-27 00:48:49 -04:00
Rangi42
b77ba1d87d
Forward declare struct Section to avoid a nested header include
2024-08-26 22:58:38 -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
Rangi42
fbe28e0def
Remove outdated "absolute data" terminology in function names
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
Sylvie
44332ff4be
Charmaps cannot map an empty string ( #1486 )
2024-08-22 13:21:16 -04:00
Sylvie
81ab133566
Enable more testing of RGBGFX output ( #1473 )
2024-08-22 19:19:39 +02:00
Sylvie
0e8a17ce82
Report any section overflows at the end of assembly ( #1482 )
...
* Report any section overflows at the end of assembly
* Immediately handle overflow of the 32-bit size counter
2024-08-22 18:51:52 +02:00
Rangi42
7bc9a24bf0
Edit some documentation of unions and macros
2024-08-22 00:41:07 -04:00
Sylvie
b438c83bda
Implement a '#' prefix for raw identifiers that may alias keywords ( #1480 )
...
* Implement a '#' prefix for raw identifiers that may alias keywords
* Review comments
* Disallow hashless raw identifiers in interpolations
* Run clang-format
2024-08-21 19:31:44 +02:00
Sylvie
82e81ab1da
Test RGBLINK on SDCC object files ( #1479 )
2024-08-20 17:51:01 -04:00
Sylvie
57c3d74b9e
Use a custom generic tagged union Either instead of std::variant for efficiency ( #1476 )
...
* Implement custom generic tagged union `Either`
This should be more efficient than `std::variant`, while still
keeping runtime safety as it `assert`s when `get`ting values.
* Use `Either` for RPN expressions
* Use `Either` for file stack node data
* Use `Either` for `File` buffer
* Use `Either` for `STRFMT` args
* Use `Either` for RGBLINK symbol values
* Support an equivalent of `std::monostate` for `Either`
* Use `Either` for lexer tokens
* Use `Either` for symbol values
* Use `Either` for lexer mmap/buffer state
2024-08-20 21:19:11 +02:00
Sylvie
7d98b9a900
Add RGBFIX tests for MBC names ( #1477 )
...
RGBFIX tests are now based on .flags files
The .bin and .err files are optional
2024-08-20 21:15:37 +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
Sylvie
8c96293b11
Test the RGBASM state file output ( #1472 )
2024-08-19 20:13:27 +02:00
Sylvie
57f122a04e
Document !cc support alongside HIGH(r16) and LOW(r16) support ( #1475 )
2024-08-19 18:56:16 +02:00
Sylvie
356367bfd3
Allow mirroring only the X or Y axes ( #1468 )
2024-08-18 21:47:39 -04:00
Rangi42
b7290366cb
Reword some RGBASM docs
2024-08-18 21:38:45 -04:00
Rangi42
731715ff36
Refactor test.sh scripts for consistency
2024-08-18 21:38:45 -04:00
Rangi42
7cf4156003
Add some more tests, and fix some existing ones
2024-08-18 21:38:45 -04:00
Rangi42
ee3a93a442
Test macro args \0 and \<0>
2024-08-18 21:38:45 -04: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
Ruben Zwietering
60c03ec1e3
Clear the old line buffer when filling the next one in nextLine
2024-08-18 19:44:04 +02:00
Ruben Zwietering
379aa8c267
Use line.reserve in sdobj_ReadFile instead of constructor
...
Passing a count parameter to the vector constructor does not reserve
count elements but instead fills the vector with count elements.
This caused the endianness check to fail first because the first 256
characters were null bytes.
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
Rangi42
c42e856efb
Fix charmap state output for inherited characters
2024-08-09 22:13:43 -04:00
Sylvie
b987e5669f
Comment the parsers better ( #1463 )
2024-08-09 21:36:52 -04: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
Sylvie
2d530dbcd6
Fix constant expression detection functions ( #1462 )
2024-08-09 09:40:53 +02: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
Rangi42
0adff57e2c
Sync warning flags between Makefile and CMakeLists.txt
2024-08-08 16:02:11 -04: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
Sylvie
a3f9952b9e
Advise on how to use -x to make -r work ( #1459 )
2024-08-08 19:50:51 +02:00
Sylvie and ISSOtm
0cd79c33ef
Fix RGBGFX reversal ( #1425 )
...
* Print all OoB tilemap IDs before aborting
* Rename `nbTileInstances` to `mapSize`
* Check that reversing doesn't overflow the tile array
---------
Co-authored-by: ISSOtm <[email protected] >
2024-08-08 19:40:41 +02: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
Sylvie
5b486e1d87
Document the behavior of FMOD, and other man page cleanup ( #1458 )
2024-08-07 19:51:35 +02:00
Sylvie
e93190d491
Implement BITWIDTH and TZCOUNT functions ( #1450 )
2024-08-07 10:39:30 -04:00
Sylvie
7435630d6a
Error messages note when a symbol has been purged ( #1453 )
2024-08-06 15:35:06 -04:00
Sylvie
fc8707886c
Output exported numeric constants to sym file ( #1439 )
2024-08-06 10:58:35 -04:00
Sylvie
bb480b761c
Rephrase numeric-string warning to not be identical to another one ( #1449 )
2024-08-06 13:56:09 +02:00
Sylvie
2706f94788
Multiple fixes and enhancements to RPN behavior: ( #1448 )
...
- FIX: `Label & const` was not actually doing the `& const` masking
(fixes #1446 )
- ADD: `LOW(Label)` can be constant if `Label` is aligned to 8 or more bits
(resolves #1444 )
- ADD: `!expr` can be constant 0 if `expr` has any non-zero bits
(resolves #1447 )
- `LOW()` and `HIGH()` have their own RPN operator values
(resolves #1445 )
The change to RPN values means that the object file version was incremented.
This also refactors unary operators and functions, combining their
evaluation similarly to binary ones.
2024-08-06 13:54:55 +02:00
Sylvie
2f8f99bd94
Implement -Wpurge= ( #1443 )
2024-08-05 12:50:48 -04:00
Sylvie
f304e1dd7f
Implement state file output for RGBASM ( #1435 )
2024-08-05 12:41:40 -04:00
Sylvie
c5e6a815fa
Deprecate treating multi-unit strings as numbers ( #1438 )
2024-08-05 16:05:50 +02:00
Sylvie
d4231f9efa
Remove redundant "unknown option" error messages ( #1441 )
...
`getopt` already prints "unrecognized option"
2024-08-05 16:04:53 +02:00
Rangi42
e4ffcf7153
Update the 'ucity' commit used for testing
...
This removes our need to patch it for compatibility
2024-08-04 21:52:57 -04:00
Sylvie
1d194b68ca
Update test deps ( #1440 )
2024-08-04 21:49:22 -04:00
Sylvie
9a5b3f0902
Implement multi-value charmaps ( #1429 )
2024-08-04 23:32:08 +02:00
Rangi42
436580a649
Consistently use "palette spec" not "color spec"
...
Fixes #1436
2024-08-04 16:24:14 -04:00
Sylvie
8af9e9d465
Add rgbgfx -r 0 to infer a width ( #1437 )
2024-08-04 20:31:05 +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
Rangi42
3bd35a8848
"Write" to files, "print" to console
2024-08-02 16:26:42 -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
Rangi42
0ed846c773
Remove outdated RGBASM options from man page
2024-07-27 09:57:52 -04:00
Rangi42
4e0f794c23
More refactoring and renaming
2024-07-26 20:12:51 -04:00
Sylvie
6a65cbc9ed
Some refactoring and reformatting ( #1431 )
2024-07-26 11:51:27 -04:00
Sylvie
92abe24894
Implement EXPORT DEF to define and export symbols ( #1422 )
2024-07-25 17:40:58 -04:00
Sylvie
13a8895fca
Improve the error messages for interpolating undefined or invalid symbols ( #1423 )
2024-07-25 17:36:02 -04:00
Sylvie
e179ba5fd3
Add syntax to push and modify stacks in one line ( #1421 )
2024-07-25 23:14:59 +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
Sylvie
c0904228f2
Fix bison.sh for patch-less bison versions ( #1416 )
2024-07-03 13:37:04 +02:00
Rangi42
556c8a968a
Release 0.8.0
2024-06-28 14:53:17 -04:00
Sylvie
ed5529d639
Fix generating a palette overriding a previous pal spec ( #1415 )
2024-06-25 18:27:01 +02:00
Sylvie
240ab8ed1c
Keep the object version as RGB9; only increment the revision to 10 ( #1413 )
2024-06-21 16:47:49 +02:00
Sylvie
0433714d77
Allow a suffix (e.g. the version) to be added when installing ( #1406 )
2024-06-18 22:06:43 +02:00
Sylvie
ee748cfe26
Miscellaneous refactoring of code and docs ( #1411 )
2024-06-18 20:47:31 +02:00
Sylvie
623c3f662c
Allow NUL characters in strings ( #1405 )
2024-06-18 14:26:18 -04:00
Sylvie
9cc595b2cc
Specify a custom logo file to use instead of the Nintendo logo ( #1400 )
...
Fixes #1398
2024-06-18 20:02:50 +02:00
Sylvie
8c3ca462fe
Add more test cases ( #1409 )
2024-06-17 15:07:35 -04:00
Sylvie
9e1898238d
Remove unsupported macOS 11 from CI ( #1410 )
2024-06-17 14:30:57 -04:00
Sylvie
b3c94b5b87
Give names to links in man pages ( #1407 )
2024-06-15 13:48:37 +02:00
Sylvie
82f60e26c4
Fix reading ACO palette files ( #1404 )
2024-06-13 12:21:19 -04:00
Sylvie
dfec7111e2
X && 0 and X & 0 are constant 0; X || 1 is constant 1 (#1399 )
...
Fixes #977
2024-06-13 11:09:39 -04:00
Sylvie
c5c6cc9794
Refactor macros for fixing/trashing header values ( #1401 )
2024-06-13 10:59:48 -04:00
Rangi42
39e9315e8a
Use a smaller size for the lexer buffer
...
Large sizes are more efficient when it's actually buffered,
but most of the time `mmap` is used instead, and the extra size
just slows down allocation of lexer states.
2024-05-17 20:59:42 -04:00
Sylvie
352551d4f8
Allow padding to coexist with overlay file ( #1395 )
2024-05-17 11:14:44 +02:00
Sylvie
e2633d5b66
Use the standard stream buffer size for the lexer buffer ( #1396 )
2024-05-17 11:02:36 +02:00
Sylvie
3e9d2cab12
Make some error messages more consistent ( #1393 )
...
* Update some error messages
* Make non-A destination operand syntactically invalid
2024-04-20 23:13:01 +02:00
Chris Pickel
7aecc00919
Fix rectangular rgbgfx --reverse --columns ( #1392 )
...
When width != height, the math was off, causing some tiles to be
repeated or skipped.
2024-04-20 18:20:16 +02:00
Rangi42
b8387427a6
Use consistent RGBDS_<PROG>_<NAME>_HPP header guard convention
2024-04-14 21:50:05 -04:00
Sylvie
a234da42a6
Replace assert with assume for release build optimization ( #1390 )
2024-04-02 11:09:31 -04:00
Sylvie
1d39e5ed56
Use std::variant for RPN expression value ( #1389 )
2024-04-01 16:47:15 +02:00
Sylvie
9ab3446d1a
Fix two bugs with RGBASM fixed-point math ( #1388 )
...
- Fixed-point formulas are implemented using IEEE-754 floating-point
internally, which could give infinity or NaN values whose conversion
to fixed-point integer was platform-dependent.
- Formatting fixed-point $8000_0000 (INT32_MIN, -2147483648) was
not putting the negative sign in front.
2024-03-31 12:53:20 -04:00
Rangi42
6b5248f15b
Add a build target for include-what-you-use
2024-03-29 20:49:09 -04:00
Rangi42
eb708ebee5
Rename some variables left from the C parser (e.g. yylval)
2024-03-29 19:42:23 -04:00
Rangi42
cf3e5e15f8
Update the 'ucity' commit used for testing
...
This reduces our need to patch it for compatibility
2024-03-29 14:42:23 -04:00
Sylvie
408a783fd8
Add more RGBLINK tests ( #1386 )
2024-03-29 14:30:32 -04:00
Rangi42
17afe611fd
Update the 'libbet' commit used for testing
...
This reduces our need to patch it for compatibility
2024-03-29 13:35:12 -04:00
Sylvie
996db14ffa
Make test built of 'libbet' reproducible with old Pillow versions ( #1385 )
...
The Python Pillow image library gives different output for
`Image.getcolors()` in version 9 than version 10. This causes
libbet's SGB border to be built differently, giving a different
ROM hash and technically failing the test script.
This patches libbet to only keep the known-good colors. It also
adapts the coverage script to run all the tests, including
building the third-party projects.
2024-03-29 11:59:36 -04:00
Sylvie
7326cc6875
Verify ROM hashes for all CI test projects ( #1384 )
...
Ucity and Libbet build files in a nondeterministic order, which
we have to patch to sort consistently for reproducible builds.
2024-03-28 22:37:33 -04:00
Rangi42
9dac583e45
Patch test projects so they build without deprecated features
...
Also ensure the test scripts pass shellcheck
2024-03-28 17:26:42 -04:00
Rangi42
ccfd3b6af8
Remove documentation of already-removed RGBGFX options
2024-03-28 17:26:42 -04:00
Rangi42
4a4656af1b
Remove the deprecated RGBGFX --output-* options (use --auto-*)
2024-03-28 17:26:42 -04:00
Rangi42
b021090e7f
Remove deprecated -i for --include (use -I)
2024-03-28 17:26:42 -04:00
Rangi42
230b1db438
Remove deprecated DEF-less definitions
2024-03-28 17:26:42 -04:00
Rangi42
14b72222b1
Remove the deprecated -H/-h/-L/-l options
2024-03-28 17:26:42 -04:00
Rangi42
106e516962
Split the .peek() method into its next-char and lookahead cases
2024-03-28 15:37:25 -04:00
Rangi42
6f74e4fb9c
Remove the suboptimal .canPeek() and .peek() methods
2024-03-28 14:49:36 -04:00
Rangi42
83c0634f15
Refactor peekInternal to be a LexerState method
2024-03-28 13:21:28 -04:00
Rangi42
4172d330b9
Refactor BufferedContent and Expansion to have methods
...
Use a buffer size that is a power of two for fast modulus
2024-03-28 12:57:23 -04:00
Rangi42
cf7bdb19b6
Run clang-format 14 on everything
...
Later versions may need some proprties added or changed to not
format closing braces weirdly.
2024-03-28 09:17:27 -04: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
Rangi42
506911d7d0
Refactor to avoid redundant obj_CheckAssertions function
2024-03-27 16:19:01 -04:00
Rangi42
dcb4e40388
Use QUOTEDSTRLEN macro instead of sizeof or strlen
2024-03-27 11:50:48 -04:00
Rangi42
912a1504ec
Defer closing of depend file
2024-03-27 11:44:26 -04:00
Rangi42
2ef5e807f8
No more memory leaks!
2024-03-27 11:27:34 -04:00
Rangi42
b6039870e5
Remove now-redundant MmappedContent struct
2024-03-27 11:27:34 -04:00
Rangi42
78801e324c
Group pointer and size as a ContentSpan struct
2024-03-27 11:27:34 -04:00
Rangi42
bf0cabb3ea
Use std::shared_ptr for lexer capture buffers
2024-03-27 11:27:34 -04:00
Sylvie
a68bebf4a2
Use a Defer struct to close files and restore lexer state with RAII ( #1379 )
2024-03-27 10:42:53 -04:00
Rangi42
32db0a0f18
Rename CaptureBody to Capture, and refactor its methods
2024-03-26 12:29:59 -04:00
Rangi42
a167d23d01
Use content-specific destructors for lexer state
...
Also rename `LexerState` content structs from `*LexerState` to `*Content`
2024-03-26 12:29:59 -04:00
Rangi42
8b6ae994b1
Use STR and CAT macros for # and ##
2024-03-25 14:22:43 -04:00
Rangi42
2b44672873
Rename a few variables
2024-03-25 14:22:38 -04:00
Rangi42
3568418c5d
Remove RGBLINK's unimplemented '-s' "smart linking" placeholder flag
2024-03-25 11:36:23 -04:00
Rangi42
cb59119881
Use automatically-allocated std::string_view for macros
2024-03-25 11:33:17 -04:00
Rangi42
d9e5e57e27
Make CaptureBufs be parser values instead of a single static global
2024-03-23 19:44:54 -04:00
Rangi42
e9e8915725
Refactor to keep lexerState and lexerStateEOL static
...
Also run `clang-format` on everything
2024-03-23 19:14:46 -04:00
Sylvie
c075ffb570
Update test project commits ( #1377 )
2024-03-22 17:06:39 -04:00
Sylvie
96c808810f
Remove .simple.err files, since we require Bison 3.0 ( #1373 )
2024-03-22 15:36:32 -04:00
Rangi42
6a5518e0c5
Use RAII to unmap or close the lexer states' files automatically
2024-03-22 14:25:36 -04:00
Rangi42
507439bc25
Refactor macro args to be owned collectively by their fstack contexts
2024-03-22 14:25:36 -04:00
Rangi42
b85c5cde8f
Use std::shared_ptr for MacroArgs
2024-03-22 14:25:36 -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
ISSOtm
52e8e1f9fc
Simplify \@ handling by using std::shared_ptr<std::string>
...
This has been relocated from macro.cpp to fstack.cpp, since both
MACRO and REPT/FOR nodes have their own unique `\@` values.
2024-03-22 14:25:36 -04:00
Sylvie
04405fb444
Use std::shared_ptr for fstack nodes ( #1371 )
2024-03-22 13:27:21 -04:00
Sylvie
dd43723e20
Use methods for RPN Expression ( #1372 )
2024-03-22 04:41:04 -04:00
Rangi42
de667c8afb
Remove unused Visitor template
2024-03-22 03:29:56 -04:00
Sylvie
f792580816
Only restore parent context's \@ value if it had one defined ( #1366 )
...
This way, if a child context initializes `\@`, the parent won't
reset it. And if the child context did not initialize `\@`,
then resetting it would be redundant.
2024-03-21 19:53:49 -04:00
orbea
0f772932a5
Convert bison.sh to posix shell ( #1369 )
...
* Convert bison.sh to posix shell
* Refactor bison.sh to be more like CMakeLists.txt
No current warnings with shellcheck.net.
2024-03-21 16:06:36 -04:00
Sylvie and ISSOtm
0300971a17
Fix some header #includes with clangd LSP ( #1370 )
...
Co-authored-by: ISSOtm <[email protected] >
2024-03-21 15:13:10 -04:00
Rangi42
32b4a6f284
Use "snake_case" consistently in parsers
2024-03-21 11:44:07 -04:00
Rangi42
6560b7819d
Add make profile, optimized for callgrind
2024-03-21 11:42:12 -04:00
Sylvie
0af1e512c2
Use std::get_if instead of std::visit ( #1367 )
...
`std::visit` is (arguably) cleaner code, but older versions of gcc
and clang (not very old; the ones packaged with Ubuntu 22.04 LTS)
compile them as tables of function pointers, instead of efficient
jump tables.
2024-03-20 22:37:54 -04:00
Sylvie
035678d250
Remove workaround for GitHub Actions issue ( #1368 )
2024-03-20 20:46:08 -04:00
Sylvie
554778da5b
Built-in symbols are "<builtin>", not "<command-line>" ( #1362 )
2024-03-19 16:01:45 -04:00
Sylvie
fec2266dd8
Use std::string for string-formatted values ( #1360 )
...
* Use `std::string` for string-formatted values
* Make `formatString` and `formatNumber` be `const`
2024-03-19 07:43:18 +01:00
Sylvie
33dd97b6a0
Fix CI builds for Ubuntu 22.04 ( #1361 )
...
Ubuntu 22.04 provides LLVM 14, which links an ASan version incompatible with
high-entropy ASLR in newer Linux kernels that GitHub Actions runners use.
2024-03-19 01:05:10 -04:00
Rangi42
a862c7b17b
Use sed instead of awk to extract Bison version
2024-03-18 15:36:45 -04:00
Rangi42
40db9d5cef
Use std::string for lexer state paths
2024-03-18 14:42:05 -04:00
Rangi42
05d79d87f6
Pass std::string references to RPN functions
2024-03-18 14:42:05 -04:00
Rangi42
e96675be03
Pass std::string references to fstack functions
2024-03-18 14:42:05 -04:00
Rangi42
472d1bde06
Pass std::string references to symbol functions
2024-03-18 14:42:05 -04:00
Rangi42
6cabb8c9af
Pass std::string references to output functions
2024-03-18 14:42:05 -04:00
Rangi42
7b11c528ef
Pass std::string references to section functions
2024-03-18 14:42:05 -04:00
Rangi42
91164ac1b0
Pass std::string references to charmap functions
2024-03-18 14:42:05 -04:00
Rangi42
04899a21cd
Pass std::string references to parser semantic functions instead of .c_str() pointers
...
This also refactors some semantic functions to be more efficient
2024-03-18 14:42:05 -04:00
Rangi42
8f77518406
Use std::string for most intermediate parsed strings
...
This is a work in progress: its performance is unacceptably slow,
and it is obviously not a complete refactoring:
- The parser's semantic functions are still written for C-style
strings, taking `.c_str()` pointers instead of `std::string`
references (and using their methods, `<algorithm>`s, etc).
- Quoted string literals from the lexer still use our `String`
struct, which wraps around a fixed-size char array.
- Symbol values, macro arguments, and so forth are still pointers
to C-style strings with unclear ownership semantics (i.e. we
still have "leaks as a feature").
2024-03-18 14:42:05 -04:00
Rangi42
b76e196c89
Run clang-format on everything
2024-03-18 14:08:57 -04:00
Rangi42
d06376c170
Use std::unordered_map and std::vector for sections
...
This allows us to control the order in which sections are iterated,
instead of it depending on the internals of `std::map`. (This order
is arbitrary, but should be deterministic regardless.)
2024-03-16 11:51:47 -04:00
Rangi42
cefc4f4aa3
Use std::unordered_map for symbols
2024-03-16 11:19:19 -04:00
Rangi42
a14de10e28
Use std::unordered_map for charmaps
2024-03-16 11:13:14 -04:00
ISSOtm
e4a3509845
Fix build failure with GCC 13
...
It complains about *those* calls returning a dangling reference...
Unfortunately, GCC does not provide more information about what the
reference *is*. (It only mentions the temporary being destroyed at
the end of this *huge* expression.)
I am normally not one to just commit a thing that gets rid of a
warning if I can't explain why, but this eludes me.
Stubbing out the calls to only return a captured variable still
complains, which led me to test that the error wasn't stemming
from the `Visitor` itself... which it seems to?
But I don't see why a reference to the *visitor* should be kept...
Anyway, here is the obligatory part where I state my yearning for Rust :)
2024-03-15 21:40:11 +01:00
Sylvie
eb99fc8681
Use a std::unordered_map for looking up sections by name ( #1357 )
2024-03-13 19:45:52 -04:00
Sylvie
8ec0d01fc4
Sort .sym files in ascending order, and test for it ( #1355 )
2024-03-13 18:32:35 -04:00
Sylvie
658286c8e4
Move a SECTION FRAGMENT test to the test/link/section-fragment folder ( #1354 )
...
Add a binary comparison for the same-label SECTION UNION test
2024-03-13 15:34:27 -04:00
Sylvie
a1bbb3b3f7
Strip CI binaries built with make ( #1345 )
2024-03-13 14:42:11 -04:00
Sylvie
67c707739d
Allow multiple identical exported numeric constants ( #1341 )
...
This still doesn't allow identical exported label constants.
That can be addressed when or if it's requested for a real use case.
Symbols only store one source filename + line number, so this
arbitrarily keeps the last read symbol as the reported one.
2024-03-13 14:06:20 -04:00
Sylvie
68f6ab5c32
Add test cases for SECTION UNION defining multiple identical labels ( #1349 )
...
Exported labels should fail to link; non-exported ones should be okay.
2024-03-13 13:34:44 -04:00
Rangi42
188fcfdd64
Add license header to test/CMakeLists.tst like the rest
2024-03-13 11:55:17 -04:00
Sylvie
4f15f07dd4
Refactor link/test.sh to avoid repeating test names ( #1353 )
2024-03-13 11:43:50 -04:00
Eldred Habert
08066d4692
Fix a reference being used after being invalidated ( #1352 )
...
Your classic use-after-free bug.
2024-03-12 22:19:01 -04:00
ISSOtm
42d32c72a6
Use a unique name to upload W32/W64 binaries in CI
...
This now breaks in CI.
2024-03-13 01:07:28 +01:00
ISSOtm
81ed5fe41e
Update Actions to Node 20
...
There are some warnings in CI about this.
2024-03-13 00:15:43 +01:00
ISSOtm
b9596890c9
Disable a Clang warning
...
Fixes `make develop` with Clang 17.
The warning only triggers on the auto-generated `yynerrs_` in `src/asm/parser.cpp`,
so it's not very useful to us right now.
2024-03-13 00:04:11 +01:00
Rangi42
846a9411b9
Refactor FileStackNode::dump to not need a helper function
2024-03-10 14:14:34 -04:00
Rangi42
58fdaa8747
Avoid a couple of clang-format quirks
2024-03-10 12:31:03 -04:00
Sylvie
820f6b5b3c
Consistently format type qualifiers like const on the right ( #1347 )
2024-03-10 12:21:52 -04:00
Rangi42
d982d47c56
Use move semantics for more parsed values
2024-03-09 20:05:09 -05:00
Rangi42
569b940b82
No need to manually do the Expression destructor's job
2024-03-09 19:33:53 -05:00
Rangi42
ba104baf3e
Refactor mapFile for Windows
2024-03-09 19:22:06 -05:00
Rangi42
cce7f51235
Remove RPN symbol name length limit
2024-03-09 17:56:30 -05:00
Sylvie
17444e825a
Reduce the header declarations ( #1342 )
...
- Since we have style rules to include foo.hpp at the top of its
corresponding foo.cpp, this takes any headers included by foo.hpp
as being also guaranteed for foo.cpp.
- Use C-style <foo.h> instead of <cfoo>, since the latter only
guarantees putting symbols in the `std` namespace, which we are
not using for C functions (e.g. `printf` not `std::printf`).
- Remove now-unused `__PRETTY_FUNCTION__` reporting
2024-03-09 14:55:39 -05:00
Sylvie
3323cb56fe
Make enum patterns more explicit ( #1343 )
2024-03-09 14:55:17 -05:00
Sylvie
5681be1fd8
Use automatic allocation and std::move for RPN bytes ( #1336 )
2024-03-09 11:12:34 -05:00
Sylvie
4a7d333891
Use std::unique_ptr for rgblink sections ( #1337 )
2024-03-09 11:12:01 -05:00
SnDream
9890cf25b4
Fix -O being always ignored ( #1339 )
...
The file isn't opened at this point, it's the file name that should be inspected.
2024-03-09 14:11:56 +01:00
Rangi42
9f5bf5e285
Remove an unnecessary .close() call that the destructor handles
2024-03-08 22:29:37 -05:00
Rangi42
0bfade4435
Fix enum: REG_SP == REG_AF == 3
2024-03-08 20:00:29 -05:00
Rangi42
40704b5055
Remove unused yyerror declaration
...
Also reformat some `enum`s
2024-03-08 19:47:57 -05:00
Sylvie
53537cf9af
Remove now-unnecessary enum keyword ( #1338 )
...
C++ does not need it
2024-03-08 19:40:41 -05:00
Rangi42
1b97297d63
Fix a typo bug in sdas_obj.cpp
...
This was introduced in commit 447c561 , PR #1330
2024-03-08 18:30:30 -05:00
Rangi42
75cc12bb3d
Use std::optional for fstack paths
2024-03-07 21:41:02 -05:00
Rangi42
563d699394
Avoid an extra operation if !labelScope (thanks, ISSOtm)
2024-03-07 17:33:33 -05:00
Rangi42
e701faa1bc
Print summaries at the end of test.sh scripts
2024-03-07 16:45:53 -05:00
Rangi42
aed172071b
Replace some macros with static functions or constants
2024-03-07 16:10:05 -05:00
Rangi42
90356ee669
Remove unused #define
2024-03-07 15:07:16 -05:00
Rangi42
0a4a01c5e5
Ignore callgrind output files
2024-03-07 14:56:32 -05:00
Rangi42
0f52cd0bab
Use std::reverse for binary digits
2024-03-07 14:48:23 -05:00
Rangi42
2fd95381a6
Get rid of some fixed-size char buffers
2024-03-07 14:36:30 -05:00
Rangi42
184957c0ed
Use fwrite and fputs instead of multiple putc
2024-03-07 12:40:37 -05:00
Rangi42
7663a777d5
Remove 255-character limit on symbol names
2024-03-07 12:40:37 -05:00
Rangi42
097b7c3baf
Use std::string for symbol names
2024-03-07 12:40:33 -05:00
Rangi42
bf45ebb178
Run clang-format to fix some inconsistent style
2024-03-07 11:52:53 -05:00
Rangi42
84bedc7bbe
Use automatic allocation for RPN reasons
2024-03-07 09:58:45 -05:00
Rangi42
e5b7e65e91
Use std::nothrow from <new> with every new allocation
2024-03-07 09:56:15 -05:00
Rangi42
104fd6c70d
Use automatic allocation for some parser values
2024-03-06 22:17:35 -05:00
ISSOtm
0ea174f0dd
Stop explicitly passing zlib/libpng path to CMake in Windows CI
...
Turns out CMake auto-detects the libs just fine from the
`CMAKE_INSTALL_PREFIX`, and `PNG_BUILD_ZLIB` was actually breaking things.
2024-03-06 21:02:13 -05:00
Rangi42
35ec190664
Update Windows libpng to 1.6.43
2024-03-06 21:02:13 -05:00
Sylvie
292adb27a3
Adapt the RGBASM parser to C++ ( #1333 )
...
This uses variants instead of a `%union`, and "complete symbols"
that can call complex constructors.
2024-03-06 20:40:36 -05:00
Rangi42
8c173b4e95
Remove declaration for compatibility with macOS bison 2.3
...
We've required bision 3.0 since October 2022
2024-03-06 17:58:15 -05:00
Rangi42
94b724ae5f
Update to use winflexbison 2.5.25 (bison 3.8.2)
2024-03-06 17:56:16 -05:00
Rangi42
6d4a61f51d
Fix some numeric bases in RGBLINK output
2024-03-06 17:43:26 -05:00
Rangi42
75105016f7
Make sure that parsed subexpressions are fully defined
...
We were not initializing some expressions, and they were using
the values of the previous expressions instead. This just so
happened to not crash the tests, and to sometimes even give valid
results (although `BANK()` of a non-label symbol being $4B4E4142,
the ASCII balue of "BANK", was something we missed).
2024-03-06 16:00:55 -05:00
Rangi42
f419f206e5
Fix a latent bug with parsing macro args
...
This seems to only have worked by coincidence; `$$` was an
undefined value that happened to equal `$1` already.
2024-03-06 15:14:17 -05:00
Rangi42
82824a4bf2
Avoid using Bison's typed mid-rule actions
...
These work with `%union`, but will not work with C++ `variant`
2024-03-06 14:19:37 -05:00
Rangi42
d1652c0028
Refactor cases for simplicity, and remove redundant comments
2024-03-06 14:10:50 -05:00
Rangi42
053aa80951
Improve some const correctness in RGBASM
2024-03-06 13:53:03 -05:00
Rangi42
585c620945
Rename fail to sectError, since it increments nbSectErrors
2024-03-05 14:36:18 -05:00
Rangi42
bd88787cb3
Use FileStackNode constructor to avoid std::monostate possibility
2024-03-05 14:22:29 -05:00
Rangi42
74539f08ba
Add some more trailing commas
2024-03-04 22:53:11 -05:00
Sylvie
e74073e480
Run clang-format on everything ( #1332 )
2024-03-04 14:22:49 -05:00
Sylvie
b004648a13
Use std::variant for symbol values ( #1331 )
2024-03-04 08:55:33 -05:00
Rangi42
f2c875e71e
Avoid using std::get except in holds_alternative-asserting accessors
2024-03-03 23:33:23 -05:00
Rangi42
13904dc536
Remove EQUS callbacks for symbols
...
They're no longer used since `__FILE__` was removed
2024-03-03 21:26:44 -05:00
Rangi42
ba183e900b
Update contributors
2024-03-03 21:17:52 -05:00
Sylvie
447c561aaa
Use std::variant for symbol values ( #1330 )
2024-03-03 21:16:36 -05:00
Sylvie
f8dab23e8f
Use uncommented sizes for pointer-to-array arguments ( #1329 )
...
This is syntactically valid despite not being enforced, and
is a feature we already use elsewhere.
2024-03-03 19:43:08 -05:00
Eldred Habert
0da216897a
Improve tests a little ( #1324 )
...
* Avoid redirecting error messages in RGBLINK tests
We check that RGBLINK prints nothing to stdout, so all that
would be captured on stdout is a putative failure message.
* Require each RGBLINK test to check error output
Otherwise, you can have a test that just... checks nothing!
* Document how to add tests
Fixes #1300 's last remaining item.
Also add `checkdiff` rules to remind us to update that doc if
any of the test driver scripts are updated.
2024-03-03 19:12:29 -05:00
Sylvie
8cf446b14c
Use std::variant for lexer mmap/buffer state ( #1328 )
2024-03-03 18:45:50 -05:00
Evie
6b67c82b94
Implement -c #none ( #1301 )
...
Also adds a test case for round-tripping `-r` with `-c #none`.
2024-03-03 18:45:33 -05:00
Rangi42
930a5c3e44
Replace RGBLINK non-null pointers with references
2024-03-03 00:57:03 -05:00
Rangi42
538b253dfb
Replace RGBFIX non-null pointers with references
2024-03-03 00:57:03 -05:00
Rangi42
277ea9be28
Replace RGBASM non-null pointers with references
2024-03-03 00:57:03 -05:00
Rangi42
d812acff24
Check RGBGFX warning/error format strings with format_ macro
2024-03-02 23:17:54 -05:00
Rangi42
2e1b0b6421
Remove commented-out C-only macro features
2024-03-02 20:17:22 -05:00
Rangi42
52f8ecc347
We do not call malloc/free any more
2024-03-02 08:16:44 -05:00
Rangi42
19bb12754b
Use new allocation for expanding \#
2024-03-02 08:04:59 -05:00
Rangi42
dbcb82799e
Use std::vector for capture buffer
2024-03-02 06:46:11 -05:00
Sylvie
a71e4086a2
Use std::string_view for macro bodies ( #1326 )
...
This removes the last use of `strdup`
This required making a lot of related pointers be `const`.
That in turn conflicted with the need to `munmap()` a pointer
eventually, which was similar to the need to eventually `free()`
an `Expansion`'s contents, so I used the same solution of a
`union`. That lets us normally use the `const` pointer for
`const` correctness, and the non-`const` one for the not-really-
mutating destruction cases.
2024-03-02 13:21:28 -05:00
Rangi42
2069a95e0f
Use std::string for macro args
2024-03-02 05:23:15 -05:00
Rangi42
b130c2e27c
Use std::string for STRFMT spec and args
2024-03-02 05:09:43 -05:00
Rangi42
ba00cf5684
Use std::string for section names
2024-03-02 04:47:02 -05:00
Rangi42
b488d3a90f
Use std::optional<std::string> for lexer expansion names
2024-03-02 04:34:42 -05:00
Sylvie
701b926288
Use RAII std::string and std::vector in randtilegen ( #1325 )
2024-03-02 11:02:26 -05:00
Sylvie
446fb07fd5
Use std::deque<std::vector> for free space ( #1323 )
2024-03-01 16:21:29 -05:00
Sylvie
1ac3c0262f
Refactor structs to use methods instead of functions ( #1322 )
2024-03-01 13:11:45 -05:00
Rangi42
e14ba664ea
Remove redundant (void) parameter declarations
2024-03-01 10:41:47 -05:00
Rangi42
91d22f180e
Reorganize the asm parser to be more like the linker script parser
...
Split the declarations into those required for the `%union` and
those only required for the `code`.
Only declare functions on top; define them at the bottom.
2024-02-29 16:23:53 -05:00
Sylvie
043db49676
Replace NULL with nullptr ( #1321 )
2024-02-29 15:06:33 -05:00
Sylvie
eff8c324c8
Remove now-unnecessary struct keyword ( #1320 )
...
C++ acts like structs are `typedef`ed by default
We do have to keep `struct stat`, since there's ambiguity
with the function also called `stat`.
2024-02-29 14:41:58 -05:00
Rangi42
1210a7441f
Use std::visit with Visitor helper instead of std::holds_alternatve
2024-02-29 13:44:08 -05:00
Rangi42
cf08fed067
Use std::vector for SDCC object section data
2024-02-29 13:44:08 -05:00
Rangi42
c44b336e1b
Use std::vector for SDCC object line buffer
2024-02-29 13:44:08 -05:00
Rangi42
e90084ad06
Rename isWRA0Mode to isWRAM0Mode
2024-02-29 13:44:08 -05:00
Rangi42
cdb9315366
Use std::vector for rgbfix ROMX data
...
Statically links libstdc++ for 32-bit MinGW
2024-02-29 13:44:08 -05:00
Rangi42
2ff723f943
Use vec.data() instead of &vec[0]
...
In general `vec.data()` is always safe, whereas `&vec[0]`
may fail when `vec` is empty.
2024-02-29 13:44:08 -05:00
Rangi42
d1fa5ccd4d
Rename lexer_DeleteState to lexer_CleanupState
2024-02-29 13:44:08 -05:00
Rangi42
17df94c75b
Remove now-unnecessary cleanup functions
2024-02-29 13:44:08 -05:00
Rangi42
96f354026a
Use automatic allocation for section data
2024-02-29 13:44:08 -05:00
Rangi42
8fe6be19f1
Use automatic allocation for tryReadstring
2024-02-29 13:44:08 -05:00
Rangi42
002eed405b
Use automatic allocation for assertion error messages
2024-02-29 13:44:08 -05:00
Rangi42
ef1c1440a0
Use automatic allocation for symbol names
2024-02-29 13:44:08 -05:00
Rangi42
826512730c
Use automatic allocation for section symbols
2024-02-29 13:44:08 -05:00
Rangi42
5a26a48d11
Use automatic allocation for section names
2024-02-29 13:44:08 -05:00
Rangi42
3c0af94c5c
Use automatic allocation for patches
2024-02-29 13:44:08 -05:00
Rangi42
fc5ab8a14c
Clarify comment explaining how referenced works
2024-02-29 13:44:08 -05:00
Rangi42
ace45bfd90
Refactor to avoid repeating rpn_isKnown(expr)
2024-02-29 13:44:08 -05:00
Rangi42
d6681d3580
struct Section's src can be const
2024-02-29 13:44:08 -05:00
Rangi42
0cc49782ab
Use std::variant and automatic allocation for file stack node data
2024-02-29 13:44:08 -05:00
Rangi42
e1ac51d7da
Use std::vector's .size() for SDCC sections and symbols
2024-02-29 13:44:08 -05:00
Rangi42
c3eb532439
Use copy constructor for file stack node
2024-02-29 13:44:08 -05:00
Rangi42
18d4a81954
Use move semantics for the union stacks
2024-02-29 13:44:08 -05:00
Rangi42
7daa8759c9
Use std::variant for STRFMT arguments
2024-02-29 13:44:08 -05:00
Rangi42
beb1997378
Use std::unordered_map for the keyword dict
2024-02-29 13:44:08 -05:00
Rangi42
962398969b
Use std::string for PURGE args
2024-02-29 13:44:08 -05:00
Rangi42
0bed84174b
Use std::string for FOR loop variables
2024-02-29 13:44:08 -05:00
Rangi42
48b2e94aa3
Use std::string for symbol/section/node names and assertion messages
2024-02-29 13:44:08 -05:00
Rangi42
a24df27cd8
Use std::vector for charmap output
2024-02-29 13:44:08 -05:00
Rangi42
52ac98c294
Use std::vector for section data
2024-02-29 13:44:08 -05:00
Rangi42
4cd88ade54
Use automatic allocation for object file symbols
2024-02-29 13:44:08 -05:00
Rangi42
dead69eb2c
Use std::vector for section symbols
2024-02-29 13:44:08 -05:00
Rangi42
f47ce337bf
Use std::vector for reading object file symbols
2024-02-29 13:44:08 -05:00
Rangi42
9a51fbafb3
Use std::vector for file stack nodes
2024-02-29 13:44:08 -05:00
Rangi42
3d23f5bbb3
Use std::vector for reading object file sections
2024-02-29 13:44:08 -05:00
Rangi42
af055ecd27
Use automatic allocation for IF stacks and expansions
...
Switch to using `std::deque` for IF stacks (supports `.clear()`)
2024-02-29 13:44:08 -05:00
Rangi42
31836967fa
Use automatic allocation for lexer states
...
Lexer states are now owned by fstack contexts
2024-02-29 13:44:08 -05:00
Rangi42
514044496f
Use std::string for RPN error reasons
2024-02-29 13:44:08 -05:00
Rangi42
cf42d035f2
Use std::variant for file stack nodes
2024-02-29 13:44:08 -05:00
Rangi42
4b2294292a
Use std::string for target file name
2024-02-29 13:44:08 -05:00
Rangi42
0e19f6c0ae
Use automatic allocation for fstack nodes' iters/names
2024-02-29 13:44:08 -05:00
Rangi42
5075ac8887
Use std::vector for RPN expressions
2024-02-29 13:44:08 -05:00
Rangi42
d792ee4b61
Use std::vector for section patches
2024-02-29 13:44:08 -05:00
Rangi42
b207bff157
Use std::vector for fstack REPT nodes
2024-02-29 13:44:08 -05:00
Rangi42
53343d2fa6
Use automatic allocation for symbols
2024-02-29 13:44:08 -05:00
Rangi42
e98d1efee3
Use std::vector for include paths
2024-02-29 13:44:08 -05:00
Rangi42
e4764e37b1
Use std::stack for fstack contexts
2024-02-29 13:44:08 -05:00
Rangi42
b8e267e387
Use std::vector for SDAS file sections
2024-02-29 13:44:08 -05:00
Rangi42
17861a970f
Use std::vector for RPN data
2024-02-29 13:44:08 -05:00
Rangi42
a5ea25cde5
Use automatic allocation for RPN stack
2024-02-29 13:44:08 -05:00
Rangi42
843f3394c8
Use automatic allocation for DS args
2024-02-29 13:44:08 -05:00
Rangi42
b1aa98b43d
Use automatic allocation for PURGE args
2024-02-29 13:44:08 -05:00
Rangi42
6a23c5fd48
Use automatic allocation for STRFMT args
2024-02-29 13:44:08 -05:00
Rangi42
6b2c6c20bc
Use automatic allocation for macro args
2024-02-29 13:44:08 -05:00
Rangi42
a4ed7e1d18
Use automatic allocation for charmaps
2024-02-29 13:44:08 -05:00
Rangi42
1b8e588961
Use automatic allocation for patch RPN
2024-02-29 13:44:08 -05:00
Rangi42
dec1811d20
Use automatic allocation for section data
2024-02-29 13:44:08 -05:00
Rangi42
72e9f55368
Use automatic allocation for patches
2024-02-29 13:44:08 -05:00
Rangi42
9140180c85
Use automatic allocation for sections
2024-02-29 13:44:08 -05:00
Rangi42
e022adf4a0
Use automatic allocation for assertions
2024-02-29 13:44:08 -05:00
Rangi42
6e03504802
Use std::deque for expansions
2024-02-29 13:44:08 -05:00
Rangi42
003977a9fb
Use std::deque for unassigned sections
2024-02-29 13:44:08 -05:00
Rangi42
1afc8554c0
Use std::deque for file stack nodes
2024-02-29 13:44:08 -05:00
Rangi42
26a93a530b
Use std::deque for assertions
...
Also fix a memory leak
2024-02-29 13:44:08 -05:00
Rangi42
2df4fff6c9
Use std::vector for sorted symbols
2024-02-29 13:44:08 -05:00
Rangi42
b74b40abd2
Use std::deque for sorted sections
2024-02-29 13:44:08 -05:00
Rangi42
d53bba97e8
Remove our custom hashmap
2024-02-29 13:44:08 -05:00
Rangi42
95e7dac9a6
Use std::map for rgbasm charmaps
2024-02-29 13:44:08 -05:00
Rangi42
83d3a39dcd
Use std::map for rgbasm symbols
2024-02-29 13:44:08 -05:00
Rangi42
f44701c02d
Use std::map for rgblink symbols and sections
2024-02-29 13:44:08 -05:00
Rangi42
d5de3fa111
Use std::deque for symbol lists
...
Also fix a memory leak that this reveals
2024-02-29 13:44:08 -05:00
Rangi42
bc8cb754c0
Use std::deque for sections
2024-02-29 13:44:08 -05:00
Rangi42
2ea6de7195
Use std::stack for unions
2024-02-29 13:44:08 -05:00
Rangi42
8083ef605f
Use std::deque for section patches
2024-02-29 13:44:08 -05:00
Rangi42
b87ee62e6c
Use std::deque for assertions
2024-02-29 13:44:08 -05:00
Rangi42
521ca1c34a
Use std::vector for symbols
2024-02-29 13:44:08 -05:00
Rangi42
a310b659cd
Use std::deque (iterable) for section stack
2024-02-29 13:44:08 -05:00
Rangi42
feb342804b
Use std::stack for IF stack
2024-02-29 13:44:08 -05:00
Rangi42
36cfce40ad
Use std::stack for options
2024-02-29 13:44:08 -05:00
Rangi42
52c80c2740
Use std::stack for charmaps
2024-02-29 13:44:08 -05:00
ISSOtm
0e07408c63
Document how to run the test suite
2024-02-29 11:03:45 +01:00
Rangi42
3da201b26e
Give explicit test output if the scramble-romx size is wrong
2024-02-26 18:26:17 -05:00
Sylvie
b66212e6d6
Fix fstack traces for macro nodes ( #1318 )
...
Since the lexer rewrite, MACRO nodes' fstack traces have not
included their parent REPT nodes' names.
2024-02-24 20:23:25 -05:00
Rangi42
d87b1ed22a
Refactor some redundant error/warning-printing code
2024-02-24 19:05:29 -05:00
Sylvie
595c066c2a
Remove #include <stdbool.h> ( #1317 )
2024-02-24 10:51:46 -05:00
Sylvie
54d6a22d19
Build with pedantically standard C++ ( #1309 )
...
* Remove array designators (not standard C++)
* Build with pedantically standard C++
2024-02-23 16:46:53 -05:00
Sylvie
c0d534f5ad
No more flexible array members (not standard C++) ( #1307 )
...
* Replace FAMs with `std::vector`s (or one `std::string`) in four `struct`s
* Anonymous types declared in an anonymous union are also non-standard
Only Clang complains about this (-Wnested-anon-types)
2024-02-22 16:22:37 -05:00
Sylvie
6d29d2a67e
Simplify fstk_FindFile usage ( #1310 )
...
* Simplify `fstk_FindFile` usage
* Use `std::string` for `fstk_FindFile`
2024-02-22 13:14:38 +01:00
Rangi42
c70cecc24a
Add missing license header
2024-02-21 19:20:10 -05:00
Rangi42
bba5b8a740
Remove unused struct definition
2024-02-21 16:42:14 -05:00
Rangi42
c0da9fa2bb
Remove obsolete #undef fail
2024-02-20 20:15:34 -05:00
Rangi42
ee59f17ea1
Free all the charmaps after parsing
2024-02-19 09:00:15 -05:00
Rangi42
464000bca8
Clarify TODO comment
2024-02-19 08:49:12 -05:00
Rangi42
bc8fd8a6dc
Separate union members for EQUS and MACROs
2024-02-19 08:49:04 -05:00
Sylvie
9cdd0b8a02
No more anonymous structs (not standard C++) ( #1305 )
...
This is one step to restoring `-pedantic` builds
2024-02-19 08:12:20 +01:00
Sylvie
a02687a83e
Fix behavior of non-ASCII bytes with INCHARMAP ( #1308 )
2024-02-19 08:09:55 +01:00
Rangi42
f00e57a0ed
Log indiviual rgblink test variants
2024-02-18 19:37:19 -05:00
Rangi42
cd297e1f90
Remove unused rgblink function sym_ForEach
2024-02-18 18:46:07 -05:00
Rangi42
5e8c87cf82
.dockerignore is too trivial to license :P
2024-02-18 18:45:49 -05:00
ISSOtm
a0ae37d580
Fix coverage script checking for .c files
...
This tripped `gcov`.
2024-02-19 00:30:43 +01:00
ISSOtm
18e83c17b4
Add a few more linker script tests
2024-02-19 00:23:08 +01:00
Rangi42
3860ab11c7
Reformat some deeply-indented lines
2024-02-18 18:14:13 -05:00
ISSOtm
1b08a12b26
Ensure that mid-section align 16 makes PC constant
...
This makes `align 16` a sort of `org`, which is *very* useful :)
2024-02-18 17:53:56 -05:00
ISSOtm
36dad4380e
Honor alignment offset for ALIGN[16, N]
...
The *one* place where it was missed...
2024-02-18 17:53:56 -05:00
ISSOtm
b100c8ebee
Add several tests for linker script syntax
...
Fixes a slice of #1276
2024-02-18 23:25:58 +01:00
ISSOtm
0769694839
Report mismatched file better when diff fails
2024-02-18 23:25:58 +01:00
ISSOtm
4064e4a7a9
Only look for linkerscripts in the same dir as the asm file
2024-02-18 23:25:58 +01:00
Eldred Habert
efaef7039e
Make sure to detect Git info from *our* Git repo ( #1303 )
2024-02-18 17:08:30 -05:00
Rangi42
580b7ec5be
Avoid links that just say "here"
2024-02-18 15:06:55 -05:00
Rangi42
bd56405aae
Remove now-unnecessary indentation of code blocks
2024-02-18 15:02:17 -05:00
Rangi42
2dee0fc536
Refer to https URLs when applicable
2024-02-18 14:58:46 -05:00
Rangi42
26f150220b
Update some contributors
2024-02-18 20:44:23 +01:00
Rangi42
289910fe83
Convert reStructuredText to Markdown
2024-02-18 20:44:23 +01:00
Rangi42
f1b6ef204d
Fix some reStructuredText
2024-02-18 14:09:37 -05:00
Sylvie
8a49a0b714
Report "<stdin>" or "<stdout>" when using "-" as a filename placeholder ( #1297 )
...
Also fix a memory leak with `targetFileNames`
2024-02-18 17:07:25 +01:00
Sylvie
c07f3da9a1
Provide guidance to remove the deprecated rgbasm flags ( #1296 )
...
* Explain to remove the deprecated rgbasm flags
* Rephrase deprecation warnings
2024-02-18 16:16:15 +01:00
Sylvie
d71a161bc9
Phrase error messages as "Failed to", not "Could not" or "Couldn't" ( #1298 )
2024-02-18 14:52:31 +01:00
Sylvie
ef0d973187
Truncate long format spec strings before using them ( #1299 )
...
Fixes #1293
2024-02-18 14:27:03 +01:00
Rangi42
a5ceaa3664
Use semicolons, not comma splices
2024-02-17 09:43:22 -05:00
Marcus Huderle
a37285eae9
Fix two instances of possible infinite loops in the linker ( #1292 )
2024-02-08 11:46:04 +01:00
ISSOtm
8d48cc79a2
Update to Zlib 1.3.1
2024-02-08 11:08:08 +01:00
Rangi42
3741510108
Use rgbasm -I, not -i
2024-01-29 16:41:06 -05:00
Sylvie
66fd5a7062
Fix some usually disabled compiler warnings ( #1286 )
...
* Fixes from temporarily re-enabling more compiler warnings
* More edits suggested by cppcheck
* Fix hanging on append_yylval_string
* Fix FOR loop increment
2024-01-18 20:47:20 +01:00
Rangi
d179f3ed28
Increment object file revision number to 10 ( #1287 )
2024-01-09 18:55:05 +01:00
Rangi42
eaed9eee5b
Gameboy -> Game Boy
2024-01-03 11:28:02 -05:00
ISSOtm
08f3e360c9
Release v0.7.0
2023-12-31 13:18:52 +01:00
ISSOtm
0524eeb61a
Remove .Tg macro
...
Downstream support seems to be too sparse for the time being,
not worth the tiny gain we get from it
2023-12-31 13:18:37 +01:00
Rangi
b0f2f0ffd6
Allow fewer tRNS entries than PLTE colors ( #1284 )
2023-12-31 12:47:53 +01:00
ISSOtm
528a4c0b70
Get rid of macOS hack to try having the filesystem cake and eat it too
2023-12-30 23:20:04 -05:00
ISSOtm
6b559e99b2
Revert "Switch to using std::filesystem ( #1235 )"
...
This reverts commit cf62ff772f .
Some functions used by this break on macOS before 10.15,
which we want to keep supporting.
2023-12-30 23:20:04 -05:00
ISSOtm
93d1d85f94
Generate macOS static bins under correct name
...
168950855 only did one half of the job, lol.
2023-12-29 23:25:28 +01:00
Rangi
1f3985a164
Fix build compatibility for macOS 10.14 and below ( #1280 )
...
macOS 10.15 introduced full `std::filesystem::path` support.
Before that our use of it would cause the build to fail.
This was not caught because "-mmacosx-version-min=10.9" was only
being passed to clang++ for release builds.
This passes that flag in a new static CI test build, and introduces
a hack developed by @LIJI32 to silence the availability errors,
since we use features already available in macOS 10.9.
This means we are testing both "vanilla" building,
and building static binaries using the same configuration
as during release, which should help avoiding last-minute
surprises.
2023-12-29 22:47:11 +01:00
Ron Nelson
dc5d3a7342
Fix "build from source" link in README ( #1281 )
2023-12-29 02:35:59 +01:00
Eldred Habert
ccf9dcb851
Improve linker scripts a little ( #1275 )
...
* Allow for optional sections in linker scripts
These are more useful for frameworks/toolchains.
* Check for an active mem region everywhere
Do you like segfaults? Too bad!
* Allow the address to be floating in linker scripts
Try and make the life of SDCC interop easier.
* Also validate alignment when floating
* Overhaul the linker script manual page
Documenting the new features, but also restructuring the
existing documentation to make the manual page (hopefully)
easier to understand.
2023-12-24 23:29:11 -05:00
Rangi42
7b199d7550
Fix documentation for ATAN2's (y, x) argument order
2023-12-24 03:59:01 -05:00
ISSOtm
98cecaee9e
Fix some formatting errors in man pages
2023-12-24 17:12:38 +01:00
Rangi
d5cddb202c
Update the man pages' dates and history ( #1279 )
2023-12-23 00:15:35 +01:00
Rangi42
09dbc50447
Some refactoring
2023-12-18 15:51:13 -05:00
Rangi
fdd45ab1dc
Improve linker script align ( #1271 )
...
An offset is now supported, and invalid values are no longer silently
truncated, aligning behaviour with other instances of the directive.
2023-12-18 07:16:48 +01:00
Rangi
39018174c5
Scramble banks from the end of the ROM ( #1273 )
...
This is more likely to test edge cases, such as having content in banks with their highest bit set.
2023-12-17 20:14:03 -05:00
Rangi and ISSOtm
5a3a215b0e
Don't delete script.cpp after building ( #1272 )
...
Ensure consistency in linker script parser interface
Make the declaration and definition visible when compiling
so that the compiler can warn about inconsistencies.
Co-authored-by: ISSOtm <[email protected] >
2023-12-17 11:42:07 -05:00
Rangi
495d701022
Use RANGE macro to abbreviate begin/end pairs ( #1269 )
2023-12-11 14:10:20 -05:00
Rangi
b886b7e611
Add LADX disassembly to test suite ( #1265 )
2023-12-11 18:21:38 +01:00
Eldred Habert and Rangi42
fd78a9ae83
Port linkerscript parser to Bison ( #1266 )
...
Notable side effects:
* Use the standard-conformant MSVC preproc
* Add test for linker script INCLUDE
* Improve wording of placement conflict errors
* Fix errors from not newline-terminated files
* Teach checkdiff about the linker script doc
* Call linker script "commands" "directives" instead
---------
Co-authored-by: Rangi42 <[email protected] >
2023-12-11 02:29:37 +01:00
Antonio Vivace
ab30690854
readme: improve wording on how to reach maintainers
2023-12-10 23:10:43 +01:00
Rangi and Eldred Habert
34b2543c8b
Implement -X/--max-errors for RGBASM ( #1262 )
...
Co-authored-by: Eldred Habert <[email protected] >
2023-12-07 11:42:47 +01:00
Rangi
1fa289f2ee
Add SameBoy's BootROMs to the test suite ( #1264 )
2023-12-06 22:37:59 +01:00
Rangi
22ff7ff101
Add PinoBatch's game Libbet to the test suite ( #1260 )
2023-12-06 10:30:11 +01:00
Rangi and Eldred Habert
1402615bc0
Refactor how Makefile invokes Bison for reusability ( #1259 )
...
Co-authored-by: Eldred Habert <[email protected] >
2023-12-01 13:29:05 -05:00
Rangi
6132b77c1e
Add more tests for RGBASM code coverage ( #1257 )
...
* Add more tests for RGBASM code coverage
* Use C++ unnamed parameters, not `(void)` casting
* Fix crash in `sect_AlignPC` from #1253
2023-12-01 10:21:43 -05:00
Rangi
cee3d1c859
Add more test coverage for RGBASM ( #1256 )
...
This also fixes two bugs: `-1 >>> 32` was -1 not 0, and `macro_FreeArgs` should have been called but wasn't.
2023-11-29 15:16:05 -05:00
Rangi42
b46aa0f55b
colour->color, behaviour->behavior
...
These spellings are more common elsewhere in the codebase
2023-11-27 16:02:17 -05:00
Eldred Habert
e1220d6fc6
Acknowledge Liji's contribution to RGBGFX
...
Make their help with #1241 more prominent, since it won't appear in the commit log
2023-11-27 18:04:30 +01:00
Rangi
2ebd7f2ea3
Allow negative alignment offsets ( #1255 )
2023-11-25 09:40:20 +01:00
Rangi
756f2866bb
Refactor alignment spec parsing ( #1253 )
2023-11-25 00:06:05 +01:00
Rangi and ISSOtm
92836408cc
Remove empty .out and .err test files ( #1249 )
...
Co-authored-by: ISSOtm <[email protected] >
2023-11-24 17:52:55 -05:00
ISSOtm
c5721b749c
Use proper style to document long opts
...
Correct mandoc style is to use `Fl \-`, not `Fl Fl`, apparently.
2023-11-24 21:41:21 +01:00
ISSOtm
6f0defbfe5
Fix shellcheck warnings in the test scripts
...
Making them more robust to changes.
We ought to automate this some day.
My version of ShellCheck (v0.9.0) errors on test/gfx/test.sh, though...
2023-11-24 20:54:28 +01:00
Eldred Habert
f4463b1708
Honor -c with rgbgfx -r ( #1254 )
...
Fixes #1166
2023-11-24 13:19:04 -05:00
Rangi
39e85c6dec
Document pre-ASMotor history and add links ( #1252 )
2023-11-24 18:54:33 +01:00
ISSOtm
aa5b163944
Clean up RGBGFX's "SEE ALSO" section
...
Applying the previous fix there, plus reordering xrefs more usefully.
2023-11-23 18:10:45 +01:00
ISSOtm
eb237ea4e1
Update link to Pan Docs gfx overview
...
"Rendering" is now a much lower-level description of the rendering
process, not exactly what we are looking for there :)
2023-11-23 18:08:18 +01:00
ISSOtm
27c1237daa
Fix formatting errors in man pages
...
As reported by the following command:
mandoc -T lint man/* | grep -v "input text line longer than 80 bytes"
(One of them also showed up as a warning while setting up Debian packaging.)
2023-11-23 18:05:55 +01:00
Rangi and Eldred Habert
a218622d73
Remove checkpatch, since it's tuned for C not C++ ( #1250 )
...
Co-authored-by: Eldred Habert <[email protected] >
2023-11-22 19:26:08 +01:00
Rangi
46e29de66f
Implement ds align[alignment, offset] ( #1181 )
2023-11-21 23:57:47 +01:00
Rangi
6f0ffcf3e1
Remove deprecated RGBGFX options ( #1246 )
2023-11-21 23:30:34 +01:00
Rangi
c7b39f094c
Update the reverse color curve ( #1241 )
...
Based on SameBoy's "accurate modern" colour mapping.
Special thanks to @Rangi42 for her patience throughout development, @LIJI32 for researching the colour curve and helping with the creation of the reverse mapping (colour spaces are *fun*!), and @coffeevalenbat for testing :)
2023-11-21 19:41:18 +01:00
Rangi
f5ae6a80f0
Rename the RGBGFX --output-* options to --auto-* ( #1245 )
...
Fixes #1243
2023-11-21 17:52:16 +01:00
Rangi42
482160ea04
Prefer rpn_isKnown(expr) accessor to expr->isKnown directly
2023-11-21 10:46:59 -05:00
Rangi42
ad62421264
Use rpn_isKnown wrapper outside rpn.cpp
2023-11-21 10:33:35 -05:00
Rangi
083a82f6d1
Implement rgbgfx -O ( #1240 )
2023-11-21 10:19:44 -05:00
Eldred Habert
99671b8eb5
Avoid building test support programs by default with CMake ( #1244 )
...
Copy CMake-built test executables to test directory
Fixes CI failures on Windows.
CI should also have failed on Unices, but it turns out
we instead merely hit the fallback that the `make` path
relies on (building those executables with `make`),
which fails on Windows since `make` is not set up to
find libpng.
2023-11-21 09:54:22 -05:00
Rangi
3c0879a3c6
Fix spurious truncation warning ( #1238 )
2023-11-20 22:51:51 +01:00
Rangi
232416b30d
Fix the hack for File::c_str to work ( #1242 )
2023-11-14 13:38:18 +01:00
Rangi
cf62ff772f
Switch to using std::filesystem ( #1235 )
...
Allows better platform-agnostic path manipulation.
Also, using `std::optional` rather than empty strings allows
correctly handling empty arguments (treating them as such,
instead of acting as they were never passed).
2023-11-13 18:10:09 +01:00
Rangi
e824e34526
Use an iterator template for enum sequence loops ( #1228 )
2023-11-12 09:19:19 +01:00
Eldred Habert
d390db5c57
Remove references to C compiler from CI ( #1234 )
2023-11-11 20:50:36 -05:00
Rangi
31529524c8
Use some more C++20 features ( #1231 )
2023-11-11 20:47:53 -05:00
Rangi
dde9f2bb79
Rename some RPN constants for consistency ( #1230 )
2023-11-08 21:30:27 +01:00
Rangi
5711c088e5
Add exact dates for history ( #1233 )
...
Citations (I think these would be excessive in the readme itself, but maybe the dates could have links?):
- Carsten Sørensen's ASMotor: <http://otakunozoku.com/RGBDSdocs/geninfo.htm >
- Justin Lloyd's RGBDS: <http://otakunozoku.com/rednex-gameboy-development-system/ >
- Vegard Nossum's rgbds-linux: <https://github.com/vegard/rgbds-linux/commit/e895832b2b89cf341ef84ee43e70aaa41f002fed >
- Anthony J. Bentley's fork: <https://github.com/bentley/rgbds_/commits/?after=60451fd41fc6dd0446798c8598f5effaacc2d065+69 > (prior to <https://gbdev.gg8.se/forums/viewtopic.php?id=81 >)
- Rednex move: <https://github.com/gbdev/rgbds/commit/0588e42520c7882c27cd67fd3ac518f99fc93adf >
- MIT relicensing: <https://github.com/gbdev/rgbds/commit/1a5c423984ca6cce1cb0b6b2100836bf4aa56e84 >
- Gbdev move: <https://github.com/gbdev/rgbds/commit/6eb284f99e7adb18dcad5e14bd619c08dfc864e6 >
The "neutral name" is clarified as Rednex, since we still use that name elsewhere in the readme, the sidebar, etc.
2023-11-08 21:25:27 +01:00
Rangi
765ae3f484
Build a code coverage report with gcov and lcov ( #1221 )
2023-11-08 00:03:26 +01:00
Rangi
f3dbf17b78
AUTHORS and more copyright comments are redundant with CONTRIBUTORS.rst ( #1227 )
2023-11-07 17:57:59 -05:00
Rangi
8eeb40cca8
Implement #"raw strings" ( #1122 )
...
Fixes #1121
2023-11-07 23:48:23 +01:00
Rangi
9fc088dcb0
Fix the FOR loop count formula ( #1222 )
2023-11-07 23:43:46 +01:00
Rangi
5379e51094
Make requested revisions to recent PRs ( #1195 )
2023-11-07 23:11:08 +01:00
Rangi
05a0905582
Fix the rgbgfx color curve ( #1200 )
2023-11-07 22:24:37 +01:00
Rangi
1e70e703a7
Build everything as C++ ( #1176 )
2023-11-07 21:45:56 +01:00
Rangi
78d83be2b2
Have the eqn preprocessor run on rgbasm(5) and rgbgfx(1) ( #1225 )
2023-11-07 18:08:13 +01:00
Rangi
a28f32a8a0
Download libpng source from GitHub, not SourceForge ( #1223 )
2023-11-07 08:29:01 +01:00
Rangi42
7a1e052b58
Factor out one shared enum FileStackNodeType
2023-11-07 08:27:03 +01:00
Rangi42
02f9128d07
Make some changes noticed while porting to C++
2023-11-07 08:27:03 +01:00
Rangi
6ac1dd8966
Fix RGBGFX -r with -d 1 ( #1224 )
2023-11-07 08:25:30 +01:00
Eldred Habert and Rangi
968c6f7ab7
Compute height and width directly in tile units
...
Co-authored-by: Rangi <[email protected] >
2023-11-06 08:14:13 +01:00
ISSOtm
93285f8ea8
Fix use of input slice without dedup active
2023-11-06 08:14:13 +01:00
Rangi
28358b55fe
Separate multiple instructions per line with :: ( #1210 )
2023-11-05 19:13:33 +01:00
Rangi
0afb6cd53c
Reminder to update the Dockerfile version for a release ( #1219 )
2023-11-05 18:54:15 +01:00
Rangi
143e76b7e3
Output the map file summary at the top of the file ( #1203 )
2023-11-05 15:43:58 +01:00
Rangi
f8af569680
Shorten license comments and consolidate an AUTHORS file ( #1217 )
2023-11-05 09:54:32 +01:00
Rangi
259ec58140
Implement ENDSECTION ( #1211 )
2023-11-04 23:41:17 +01:00
Rangi
99727cbe99
#!/bin/bash -> #!/usr/bin/env bash (#1216 )
2023-11-04 23:37:34 +01:00
Rangi
46e67ee078
Remove deprecated RGBASM features ( #1215 )
...
- Escaped commas "\," inside strings
- `name: MACRO` syntax
- `__FILE__` and `__LINE__`
- `-H/--nop-after-halt` and `-l/--auto-ldh` on by default
2023-11-04 23:22:46 +01:00
Rangi
28d92b7be3
Update ucity for testing ( #1212 )
2023-11-04 10:23:27 +01:00
Rangi
c869edd1d2
Implement SIZEOF and STARTOF for section types ( #1205 )
2023-11-03 08:50:04 +01:00
Rangi
8f3369fe29
Implement DS for linker scripts ( #1206 )
2023-11-03 08:47:22 +01:00
Rangi
477e9812d4
Actually use PNGCFLAGS to build rgbgfx ( #1209 )
2023-11-03 08:37:18 +01:00
Rangi
9e4b9e75e3
Sort symbols by address, then parentage, then index ( #1186 )
2023-11-02 23:58:25 +01:00
Rangi
55f946198b
Update the ucity repo being tested ( #1207 )
2023-11-02 23:57:13 +01:00
Rangi
181512ad9d
Implement INCHARMAP function ( #1184 )
2023-11-02 20:14:54 +01:00
Rangi
5a25c547ab
Allow rgbgfx to generate a palette from a spec, without an image ( #1192 )
2023-11-02 20:12:48 +01:00
Rangi
0d72ba886b
Consistent behavior with missing or incorrect parameters ( #1179 )
2023-11-02 17:40:40 +01:00
Rangi42
a64f28de5c
Avoid using %# printf specifier
2023-11-02 17:38:10 +01:00
Rangi42
b4dbb5093a
Warn when SGB compatibility is set without old licensee 0x33
2023-11-02 17:38:10 +01:00
Rangi
e7d0428a2e
Explicitly specify which files build with PNGCFLAGS ( #1201 )
2023-11-02 17:36:46 +01:00
Rangi
bb7c34db65
Deprecate DEF-less definitions ( #1193 )
2023-11-02 10:18:59 +01:00
Rangi
02f06407b1
Correct documentation for rgbgfx -r ( #1197 )
2023-11-02 07:59:46 +01:00
Rangi
73e9aac135
Update the pret repos being tested ( #1198 )
2023-11-01 23:07:41 +01:00
Rangi
32bc68d06d
Don't export anonymous labels ( #1185 )
2023-11-01 00:06:28 +01:00
Antonio Vivace
a5d51b4330
readme: update email
2023-10-31 20:21:51 +01:00
Rangi
79948be3a0
Improve incorrect object file revision error ( #1189 )
...
Fixes #1118
2023-10-31 15:04:27 -04:00
Rangi42
ab42eb2c50
Document STRUPR/STRLWR as ASCII-only
2023-10-31 14:28:38 -04:00
Rangi42
45c2a5e4ec
Consistently use uppercase hex digits
2023-10-31 14:28:38 -04:00
Rangi
ae38ebaf6f
Clarify documentation of RGBGFX deduplication ( #1191 )
...
Fixes #1169
2023-10-31 14:28:14 -04:00
Rangi
80bdc889f8
Revise documentation for rgbasm -p ( #1190 )
...
Fixes #1125
2023-10-31 14:27:59 -04:00
Rangi
84f3cb4075
ENDL restores the label scope from before LOAD ( #1180 )
2023-10-26 22:58:36 +02:00
Rangi
22def89760
Save and restore opt r on the stack. ( #1178 )
...
Fixes #1174
2023-10-26 22:54:42 +02:00
Rangi
a15f1a52c7
contributing: update repository links (rednex -> gbdev org) ( #1177 )
2023-10-26 00:44:01 +02:00
Quinn and Rangi42
944c5f0cd0
Implement order-independent purge ( #1173 )
...
Each symbol passed to purge is collected in a list before mass removal.
Fixes the issue described in gbdev/rgbds issue #1152 .
---------
Co-authored-by: Rangi42 <[email protected] >
2023-10-25 22:34:56 +02:00
Antonio Vivace
7a39e9e569
Add dockerfile to build and run RGBDS ( #1167 )
2023-09-14 17:17:53 +02:00
ISSOtm
cfe432ea65
Enforce that transparent colours take slot #0 in all palettes
2023-08-26 23:23:28 +02:00
ISSOtm
36bfeea8dc
Silence spurious GCC warning
2023-08-26 22:57:06 +02:00
Damian Yerrick
7b3a05eea8
Add --only-free and --help options to test scripts ( #1161 )
2023-08-20 13:46:00 -04:00
Damian Yerrick and Rangi
e1f0a13e5a
Allow defining local labels for another scope ( #1159 )
...
fix #1157 for the following source code
```
section "hSAVE_locals",HRAM
func3.hSpam: ds 1 ; no longer produces an error
;.hEggs: ds 1 ; uncomment this to see the new error
section "demo",ROM0
func3:
ldh a, [.hSpam]
ret
```
Remove two errors:
- `Not currently in the scope of 'func3'`
- `Local label 'func3.hSpam' in main scope`
Add one error:
- `Relative local label '.hSpam' in main scope`
Co-authored-by: Rangi <[email protected] >
2023-08-20 02:29:53 +02:00
Eldred Habert
e634888a50
Improve description of rgblink -O ( #1162 )
2023-08-19 11:52:09 +02:00
Eldred Habert and Antonio Vivace
168950855d
Create statically-linked Linux binaries on release ( #1148 )
...
Co-authored-by: Antonio Vivace <[email protected] >
2023-07-08 22:04:00 +02:00
Robbi-Blechdose
a2e0ac2872
Fix typos reported by lintian ( #1147 )
...
From https://mentors.debian.net/package/rgbds/#upload-1
2023-06-24 16:26:04 +02:00
ISSOtm
6d806238fb
Improve bit rotation/shift explanations by using Unicode box diagrams
...
The existing explanations have proven confusing to many,
and presenting the instructions in a more visual manner should help a lot.
Additionally, the Unicode codepoints are typed as-is in the source,
because that allows much more WYSIWYG editing, and god damn it this is the year
two thousand and twenty three, if your man and/or terminal software does't
support Unicode, then what are you *doing*.
2023-06-17 12:38:52 +02:00
Evie
a0dfa916e6
Fix off-by-one error in "scramble spec" validation ( #1144 )
2023-06-16 09:28:19 +02:00
Eldred Habert
9748524ef6
Fix incorrect options in RGBGFX zsh completions
2023-06-13 07:57:24 +02:00
Tian(Maxwell) Yang
718cfa133f
Fix SRL [HL] Flags link
2023-05-23 08:29:40 +02:00
Rangi
4cadc6f0fe
\en not \n is a newline in troff
2023-03-04 18:36:22 -05:00
Eldred Habert
2023d9ed99
Fix palmap option using wrong file name
2023-02-21 12:05:39 +01:00
ISSOtm
6828f7bf49
"Hook up" new releases' docs
2023-02-08 01:45:35 +01:00
ISSOtm
33a0857b8d
Properly detect tiles with more than 4 colours
...
Fixes #1127 , which was caused by a dumb logic error. Duh me.
2023-02-08 00:21:05 +01:00
Antonio Vivace
4e712807d7
funding: add GitHub sponsors
2023-01-19 22:07:14 +01:00
ISSOtm
2d15e40539
Fix WRAM0/WRAMX test
...
The previous test did not expect failure when trying to stuff
$3000 bytes into $2000-byte WRAM; this is now fixed, and we
also test the reverse now (that we cannot stuff more than
$1000 bytes into WRAM0 without `-d`/`-w`.
2023-01-07 22:20:42 +01:00
Eldred Habert
50aaa6524d
Fix -w not coercing WRAMX sections to WRAM0
...
Fixes #1116
2022-12-21 23:43:57 +01:00
Rangi
01f1703dfb
Preserve \@ through INCLUDE
...
Fixes #1112
2022-12-11 18:56:03 +01:00
Rangi
69a573923f
Version 0.6.1
2022-12-02 22:48:37 -05:00
ISSOtm
7eb4ecea8b
Remove use of std::filesystem
...
This appears to break compatibility with macOS 10.9
2022-12-03 01:51:14 +01:00
ISSOtm
599ce757a1
Force Windows builds to use our zlib and libpng
...
Otherwise we will have a few problems if, say, a system version was
detected and picked up instead of ours...
2022-12-03 00:58:50 +01:00
ISSOtm
75a07a90f8
Always initialise section->data to avoid an uninit read
...
The addition of SDCC objects required a change in the logic of
`mergeSections()` to dispatch based on `->data` instead of
`sect_HasData`, which implicitly assumes that `->data` is
always initialised (maybe NULL).
However, RGBDS sections did not do that!
2022-12-02 22:39:31 +01:00
ISSOtm
ec2d1312ef
Remove auto parameter to -flto
...
Not all supported compilers support the argument;
the move was a bit premature.
2022-11-15 19:49:04 +01:00
ISSOtm
03b6dd9321
Only cache dependency directories instead of whole test/
...
Otherwise, changes made to the test suite are not picked up
2022-11-15 19:49:04 +01:00
ISSOtm
a16d3d6405
Fail RGBGFX test suite if support test programs fail to be built
2022-11-15 19:49:04 +01:00
ISSOtm
3e5cd8ce1a
Use a special name for stdin/stdout in diagnostics
2022-11-15 19:49:04 +01:00
ISSOtm
6902387991
Allow rgbgfx - for stdin and stdout
...
Closes #1087
2022-11-15 19:49:04 +01:00
ISSOtm
62b4f2b264
Upgrade to checkout action v3
...
No code changes, just uses Node 16 instead of the
deprecated Node 12
2022-11-13 14:33:03 +01:00
Rangi
79748afdc4
Align the "; Next union/fragment" comments with their symbols
2022-11-06 23:55:15 +01:00
Rangi
32cb0558e4
Print "; Next union/fragment" between "pieces" in .map file
...
Resolves #1099
2022-11-06 23:55:15 +01:00
rlewicki
92b2ac3c8c
Remove duplicated EMPTY label in case no bank memory is used
2022-11-03 19:54:21 +01:00
rlewicki
0e67298dff
Fix indention when writing EMPTY label inside link output.c file
2022-11-03 19:54:21 +01:00
Robert Lewicki
f6d218ed36
Fix regression tests failing due to invalid cache being restored ( #1104 )
2022-11-01 14:27:40 +01:00
1a9fc964df
#1082 Add cache check for external repositories used during testing ( #1100 )
...
Co-authored-by: Rangi <[email protected] >
Co-authored-by: Eldred Habert <[email protected] >
2022-10-25 08:39:19 +02:00
ISSOtm
48248faab0
Suppress CMake project maintainer warnings in CI
2022-10-16 12:21:54 +02:00
ISSOtm
58181c2d73
Hoist common Windows dep grabbing code to a script
...
Function courtesy of @aaaaaa123456789
2022-10-16 12:21:54 +02:00
ISSOtm
0f86084e08
Rename actions folder as scripts
...
It's clearer this way.
2022-10-16 12:21:54 +02:00
ISSOtm
c8e602dec1
Mangle the name of absolute sections
...
They are unlikely to be unique across files, actually
2022-10-15 23:16:04 +02:00
ISSOtm
b168717e91
Update zlib to 1.2.13
...
1.2.12 is no longer provided by upstream anymore,
which fails Windows CI
2022-10-15 22:02:34 +02:00
ISSOtm
930c2ac328
Require Bison 3.0.0 in CMakeLists
...
We actually require that version, so be explicit about it
to provide better error messages.
2022-10-13 11:02:33 +02:00
ISSOtm
28737d5778
Enable GLIBCXX_ASSERTIONS in make develop
...
Not sure it's very portable, but this is only the dev config
2022-10-12 01:23:37 +02:00
ISSOtm
12ba057b4f
Check that colour slot is non-empty before checking for gray-ness
...
This is otherwise UB, and trips a GLIBCXX assertion (when enabled).
2022-10-11 21:39:32 +02:00
ISSOtm
0e0876b17f
Print addr ranges for empty blocks as well
...
Mirrors what sections do, for clarity & consistency
2022-10-07 16:04:02 +02:00
Eldred Habert and Rangi
b28eea24fc
Update .github/workflows/create-release-artifacts.yaml
...
Co-authored-by: Rangi <[email protected] >
2022-10-04 12:50:46 -04:00
ISSOtm
a1e59ddc3d
Avoid -x c++ affecting ${PNGLDLIBS}
...
version.c doesn't link to anything from libpng, so it'll be fine
2022-10-04 12:50:46 -04:00
ISSOtm
3fbdba31bf
Build macOS binaries as well for releases
2022-10-04 12:50:46 -04:00
ISSOtm
d90a7e4302
Terminate RGBGFX when opening a file fails
...
`std::filebuf::open`'s result must be checked, though that's not obvious.
2022-10-04 13:58:05 +02:00
ISSOtm
7377a14245
Improve RGBASM's "input files" error messages slightly
2022-10-03 17:17:19 +02:00
Eldred Habert
e2136d60b2
Print a more user-friendly error message for leftover diff marks ( #1089 )
2022-10-03 16:52:29 +02:00
ISSOtm
74e40654e6
Sync release docs CI workflow with master
...
We should look into reusable workflows, really.
https://docs.github.com/en/actions/using-workflows/reusing-workflows
2022-10-03 01:50:17 +02:00
Rangi
f90857032c
Version 0.6.0
2022-10-02 19:08:13 -04:00
Rangi
1653a9a3f2
Use -flto=auto
2022-10-02 13:50:35 -04:00
Rangi
3c049983f1
Fixed-point functions can take specific precision ( #1086 )
2022-10-02 16:56:08 +02:00
Rangi
8553b61a94
Fixed-point values can use all 32-Q magnitude bits ( #1085 )
2022-10-02 11:08:38 +02:00
ISSOtm
ab12c474d2
Properly exclude GCC from macOS matrices
2022-10-02 02:50:38 -04:00
ISSOtm
8ccbd9dc36
Properly build and link against libpng
...
Doing it right this time.
Also bundling the newly required DLLs.
2022-10-02 02:50:38 -04:00
ISSOtm
b8307432b8
Fix use of bitwise OR instead of logical
...
Thanks, Clang!
2022-10-02 02:50:38 -04:00
ISSOtm
80a62a8a03
Update CI target OSes
...
Remove platforms deprecated by GitHub Actions
Add new platforms supported by the same
2022-10-02 02:50:38 -04:00
Rangi
bbe28faab4
Sort rgbgfx's -r option alphabetically
2022-10-01 21:22:39 -04:00
Rangi
106ad30e5a
Allow fixed-point constants to have unsigned range ( #1084 )
...
For example with Q.4, $F0 is 15.0, which no longer warns
2022-10-01 23:32:34 +02:00
Rangi
a1107fc5cf
Refactor !!x to x != 0
...
Also limit comments and docs to single "!"s
2022-10-01 14:09:02 -04:00
Rangi
969412af24
Parse HEX palettes ( #1081 )
...
Addresses one item of #1065
2022-10-01 12:45:00 -04:00
Eldred Habert and Rangi
c10345f26d
Comply with sym file spec ( #1078 )
...
Co-authored-by: Rangi <[email protected] >
2022-10-01 12:35:00 -04:00
ISSOtm
6fd5c94b27
Document gbc pal spec format
...
I *knew* I had forgotten something!
2022-10-01 10:48:40 +02:00
Rangi
ddb1d0b6aa
Parse GPL palettes, and fix PSP palette parsing ( #1080 )
...
Addresses one item of #1065
2022-10-01 10:46:13 +02:00
Rangi and Eldred Habert
08545643cf
Only define @ and _NARG when they have values ( #1073 )
...
Fixes #1069
Co-authored-by: Eldred Habert <[email protected] >
2022-10-01 01:04:03 +02:00
Rangi
140c6b169e
Patch pokecrystal to use embedded palettes
2022-10-01 00:51:14 +02:00
Rangi
d86d24bdc1
Remove legacy support for generating a palette with unused colors
...
If you need an explicit set of colors, possibly including
unused ones, use `-c`.
Fixes #1062
2022-10-01 00:51:14 +02:00
Eldred Habert
a1a919579c
Add support for GBC palette dumps to -c ( #1075 )
...
Fixes #1063
2022-09-30 17:09:28 -04:00
Rangi
a47da5f71f
Deprecate __FILE__ and __LINE__ ( #1072 )
...
Unlike C, these constants are not convenient for logging in macros,
since they always report the same data (their location in the macro).
Fixes #1068
2022-09-30 19:48:30 +02:00
Rangi
68ad926279
Patch projects so CI will build ( #1071 )
...
Fixes #1070
2022-09-30 12:19:11 +02:00
Rangi and Eldred Habert
dec4133e84
SECTION(symbol) returns the name of a symbol's section (#1066 )
...
Fixes #963
Co-authored-by: Eldred Habert <[email protected] >
2022-09-30 01:59:33 +02:00
Rangi
c35cb6ac32
Warning levels -Wunmapped-char=0/1/2 ( #1061 )
...
Fixes #1058
2022-09-29 18:14:04 -04:00
Rangi
023884d2b0
Redefine the trig functions to divide circles into 1.0 turns ( #1060 )
...
This makes their behavior consistent across Q settings
Fixes #1059
2022-09-29 10:57:29 +02:00
ISSOtm
3567faf395
Use backslash escape instead of "backwards slash" in man pages
...
The latter is in the "Lines" category, which seems inappropriate.
2022-09-26 09:45:25 +02:00
Eldred Habert and Rangi
6502ed3919
Add -I as an alias for -i in rgbasm ( #1056 )
...
Co-authored-by: Rangi <[email protected] >
2022-09-26 03:42:30 -04:00
Rangi
b1a241233e
Preserve Unix line endings for .bash and .flags files ( #1054 )
...
Fixes #955
2022-09-25 11:18:44 +02:00
Rangi
f88968ec20
Fix rgbasm -b and rgbasm -g ( #1052 )
...
Fixes #1051
2022-09-25 10:22:55 +02:00
Rangi
5ad8a8c958
Warn when a duplicate CLI argument overrides a previous one ( #1053 )
...
Fixes #1050
2022-09-25 10:04:30 +02:00
Rangi and Eldred Habert
2827374505
Use STD*_FILENO constants ( #1055 )
...
These are defined in platform.h, but not consistently used
Co-authored-by: Eldred Habert <[email protected] >
2022-09-25 10:02:53 +02:00
Rangi and ISSOtm
b8385a50e3
Support -P/--preinclude to pre-INCLUDE a file ( #1043 )
...
Fixes #1041
Co-authored-by: ISSOtm <[email protected] >
2022-09-24 12:37:16 -04:00
ISSOtm
02923a67f3
Use tabs for indentation in map files
...
As requested by #1012
2022-09-24 12:58:48 +02:00
Rangi
f5b1990604
Document that symbol interpolation works outside of strings too
2022-09-22 01:15:17 -04:00
ISSOtm
0794da22bc
Clarify at-files documentation
2022-09-13 08:34:41 +02:00
Rangi
6df75f7af3
Summarize used and free space at the end of the .map file
...
Fixes #1046
2022-09-12 23:16:09 +02:00
Rangi
7ae23e6cdb
Release 0.6.0-rc2
2022-09-08 17:07:47 -04:00
Rangi and ISSOtm
98a6dffbca
Implement opt Q for fixed-point precision, and q literals (e.g. 12.34q8) ( #958 )
...
Fixes #957
Co-authored-by: ISSOtm <[email protected] >
2022-09-05 00:47:32 +02:00
Rangi
889302a9e2
Document the -H and -l flags
...
Fixes #1042
2022-09-02 08:43:41 +02:00
Rangi
c01317e08d
Only increment the unique \@ ID when it is first used per context ( #1030 )
...
This avoids changes to generated `\@` labels just by adding or
removing macros or loops which do not actually use `\@`.
Fixes #1019
2022-08-31 17:45:21 -04:00
Rangi
a52a00a9ca
macro_UndefUniqueID uses 0 to mean \@ is undefined
2022-08-30 16:50:34 -04:00
Rangi
fa13611bbf
Make comments more consistent
...
- Changes most `/* comments */` to `// comments`
- Changes `/**` block comments consistently to `/*`
- Adds consistent license comments to all files
Also renames `T_POP_SET` to `T_Z80_SET`
2022-08-30 07:51:32 +02:00
Rangi
dca24a6d50
Test that OPT r fails immediately if the recursion depth is already exceeded
...
Fixes #1034
2022-08-28 22:21:24 +02:00
Rangi
4363ffcad4
Clarify the JR documentation based on its usage ( #1032 )
...
Fixes #1020
2022-08-28 15:42:04 -04:00
Rangi
14e6a79adc
Deprecate the old macro syntax ( #1025 )
...
Fixes #1011
2022-08-28 15:22:21 -04:00
Rangi
7a2ee26792
rgbasm -r sets the maximum recursion depth (#1026 )
...
Previously it set the minimum failure depth (off by one)
Fixes #978
2022-08-28 15:21:29 -04:00
Rangi
425339ccf6
Implement FMOD function for fixed-point modulo
...
Fixes #1021
2022-08-28 21:21:10 +02:00
Rangi and Eldred Habert
1a1f1365e6
Clarify the FOR loop documentation ( #1031 )
...
Clarify the FOR loop documentation
Fixes #1003
Co-authored-by: Eldred Habert <[email protected] >
2022-08-28 15:16:49 -04:00
Rangi
f97139461c
Clarify the linkerscript example ( #1028 )
...
* Clarify the linkerscript example
* Explain that backslash escape sequences are supported
Fixes #1006
2022-08-28 15:13:43 -04:00
Rangi
8207dc57b7
Add a -Wunmapped-char warning for characters not in the charmap ( #1023 )
...
Fixes #1022
2022-08-28 15:12:43 -04:00
Rangi
d29057e747
Indent "SLACK:" to match the "SECTION" headers
2022-08-28 20:35:21 +02:00
Rangi
f1b74fa610
Report empty space between sections in map file
2022-08-28 20:35:21 +02:00
Rangi
c7a92d3104
rgblink -M omits symbol names from .map file
2022-08-28 20:35:21 +02:00
ISSOtm
0105779789
Fix incorrect Bash completions after --long-opt=
...
This is because `$COMP_CWORD` points to that `=` "word".
2022-08-10 08:44:41 +02:00
ISSOtm
9ef7954670
Fix some lint warnings in Bash completions
2022-08-10 00:16:05 +02:00
ISSOtm
d7d524294b
Fix shebangs in Bash completion scripts
...
Not that you are really supposed to run them stand-alone?
2022-08-09 22:32:18 +02:00
ISSOtm
12fed4c68e
Harden Bash completion scripts against invalid states
...
Printing an error message is better than locking the shell up, honestly.
2022-08-09 22:30:50 +02:00
ISSOtm
3db3421f07
Correct wrong state transitions in RGBGFX Bash completion script
...
Isn't strinly-typed programming just lovely?
Fixes #1018
2022-08-09 22:28:12 +02:00
ISSOtm
92eb0a133b
Allow rgbgfx -r to read an infinite amount of tiles without tilemap
...
Previously, indices would be wrapped after 256 even without a tilemap;
since RGBGFX can generate arbitrarily large tile data if `-N` is not used,
it should be possible to read those in.
Of course, this won't work if a tilemap is provided, but such "big blobs"
can't generate a meaningful tilemap anyway.
2022-08-04 20:50:08 +02:00
ISSOtm
b02ccf8f4a
Check before attempting to generate empty image
...
This causes a libpng warning then error, but print a better error message
Fixes #1016
2022-08-04 20:40:20 +02:00
ISSOtm
2e0991f32b
Use proper 16-bit type for image reversing width
...
Fixes #1015
2022-08-04 20:40:20 +02:00
Eldred Habert and Antonio Vivace
f3f2c2ca16
Improve object file format documentation ( #1010 )
...
Replacing the big pre-formatted text block with a list brings:
- Better accessibility, obviously
- Responsiveness
- Better formatting (bold, etc.)
- Sub-sections that can now be linked to
- Hyperlink cross-refs to other pages
The slight disadvantage is that `ENDC` etc. are now individual
list items, whereas they'd be better as part of the same item.
No big deal though, it was much worse before.
Some descriptions have been overhauled for clarity, and some
outright corrected (such as Assertions' "Offset" field).
Co-authored-by: Antonio Vivace <[email protected] >
2022-07-29 22:48:55 +02:00
ISSOtm
9ec8186ac6
Switch linkdefs from scattered arrays to an array of structs
...
The info is better organized this way
2022-07-19 19:11:02 +02:00
ISSOtm
ab9945c1ee
Avoid using fscanf to detect RGBDS object files
...
This function is made for text, e.g. accepts spaces, leading zeros, etc. before `%u`.
This way checks that the correct amount of bytes are read instead.
2022-07-19 19:10:58 +02:00
ISSOtm
18e4f132a8
Fix labels subtraction docs
...
Fixes #1009
2022-07-14 13:43:36 +02:00
ISSOtm
828b2adcdf
Make RGBLINK able to link SDCC object files
...
This requires a LOT of tricky code, mostly due to the format itself being,
er, not the most straightforward.
Everything is converted to existing RGBLINK concepts (sections, patches,
etc.), so the core code is essentially unchanged.
(A couple of genuine RGBLINK bugs were uncovered along the way, so some of
the core code *is* changed, notably regarding `SECTION FRAGMENT`s.)
All of this code was clean-roomed, so SDCC's GPLv2 license does not apply.
2022-07-11 21:17:34 +02:00
ISSOtm
1c2965467d
Process linker script before doing sanity checks
2022-07-11 21:17:34 +02:00
ISSOtm
d243e50390
Do not perform any sanity checks for bad section types
...
Otherwise, the arrays get overflowed
2022-07-11 21:17:34 +02:00
ISSOtm
acb33777c6
Sort RGB colors as specified in the docs
2022-07-10 12:36:10 +02:00
ISSOtm
d15916b1bd
Clarify sorting order of RGB colors
2022-07-10 12:32:57 +02:00
ISSOtm
28fcef0ecd
Improve some wording slightly
2022-07-10 12:30:18 +02:00
ISSOtm
b53c115ec2
Fix width and height being reported in wrong order
2022-07-10 12:14:24 +02:00
ISSOtm
6a51e39a5c
Print error if reverse() fails to open a file
2022-07-10 11:55:56 +02:00
Antonio Vivace
e348f70866
Remove funding options, leaving only OpenCollective
2022-07-08 21:22:28 +02:00
ISSOtm
43a487f0bf
Fix two inverted column widths
2022-07-02 17:48:28 +02:00
ISSOtm
6b2dc37f43
Release 0.6.0-rc1
2022-07-02 17:08:54 +02:00
ISSOtm
2b83a81ceb
Update completion scripts
...
Also correct minor blunders in the man page
2022-07-02 17:04:17 +02:00
ISSOtm
ca8693690a
Cancel -U option
...
As it turns out, it is really difficult to implement, and can be dealt with later.
2022-07-02 17:04:17 +02:00
ISSOtm
87092208bc
Stop passing options.columnMajor explicitly everywhere
2022-07-02 17:04:17 +02:00
ISSOtm
0d32775a1f
Add more sanity checks when reversing an image
2022-07-02 17:04:17 +02:00
ISSOtm
0df07d3688
Add note on supporting extra pal formats
2022-07-02 17:04:17 +02:00
ISSOtm
3f70372308
Implement slicing input image
2022-07-02 17:04:17 +02:00
ISSOtm
9646f15b59
Add error message for nigh-impossible proto-palette overflow
2022-07-02 17:04:17 +02:00
ISSOtm
973fbb91bc
Improve error message when a tile has too many colors
2022-07-02 17:04:17 +02:00
ISSOtm
903862c451
Improve flag set generation of RGBGFX tests
...
Less duplication = good
2022-07-02 17:04:17 +02:00
ISSOtm
3f5983358c
Add proper error message for bad manual palettes
2022-07-02 17:04:17 +02:00
ISSOtm
7a7126f3b8
Implement bit flipping with a lookup table
...
Should improve performance.
This version is cooler, and also does not suffer from iteration limits
2022-07-02 17:04:17 +02:00
ISSOtm
b4dadd35b6
Use an iterator zip
...
Simplifies iterating over tiles and attributes at the same time
2022-07-02 17:04:17 +02:00
ISSOtm
d9b1402ef8
Fix RGBGFX number parsing
2022-07-02 17:04:17 +02:00
ISSOtm
832e0ec972
Report position in color errors
2022-07-02 17:04:17 +02:00
ISSOtm
caaf7a8444
Test VRA0 size as well in randtilegen tests
2022-07-02 17:04:17 +02:00
ISSOtm
a5ed0292b1
Reject colors with ambiguous alpha channel
2022-07-02 17:04:17 +02:00
ISSOtm
05e36767b0
Implement "palette map" output
2022-07-02 17:04:17 +02:00
ISSOtm
531092f5bd
Add corrupted PNGs to check error handling
...
This is not intended to test libpng as much as checking that
we behave correctly if libpng gives us an error
2022-07-02 17:04:17 +02:00
ISSOtm
4c51792f15
Allow testing RGBGFX with specific images as input
...
No such tests yet, but the infrastructure will be there.
2022-07-02 17:04:17 +02:00
ISSOtm
c4359c1058
Ignore -b and -N when reversing without tilemap
...
These offsets should only be applied to a tile ID read as input... but this ain't one!
2022-07-02 17:04:17 +02:00
ISSOtm
159efe1257
Transfer test programs as well for cross-testing
2022-07-02 17:04:17 +02:00
ISSOtm
3cfe7800c7
Make randtilegen and rgbgfx_test compile with MSVC
2022-07-02 17:04:17 +02:00
ISSOtm
01cf0c5f98
Print RGBGFX test names
2022-07-02 17:04:17 +02:00
ISSOtm
0dbcebfeb4
Have CMake build and install steps be verbose
2022-07-02 17:04:17 +02:00
ISSOtm
491b6746ab
Clean RGBGFX test programs with make clean
2022-07-02 17:04:17 +02:00
ISSOtm
cbf6fadcdb
Add RGBGFX tests
2022-07-02 17:04:17 +02:00
ISSOtm
a77b0b396a
Fix grayscale sorting not setting palette size
...
A black+white palette would turn into white+transparent, removing black pixels
from the palette (the third slot would be empty, and the 4th slot be set directly)
2022-07-02 17:04:17 +02:00
ISSOtm
568fb5e4c8
Only report "fusing" different colors once per pair
2022-07-02 17:04:17 +02:00
ISSOtm
82012f698e
Fix alpha channel checking in RGBGFX test driver
...
Compare CGB colors only, including ignoring RGB components if alpha says
the color is transparent
2022-07-02 17:04:17 +02:00
ISSOtm
57ac07b03e
Correctly handle fully-transparent tiles when outputting unoptimized tilemap
2022-07-02 17:04:17 +02:00
ISSOtm
c521233499
Fix ProtoPalette::compare
...
Some disjoint sets were mistakenly reported not as such
For example, {0} was considered to include {1}.
2022-07-02 17:04:17 +02:00
ISSOtm
bf869f6961
Fix memory leak in test driver program
...
Teeny tiny
2022-07-02 17:04:17 +02:00
ISSOtm
0f8cbb1faf
Generate all necessary files for RGBGFX tests
2022-07-02 17:04:17 +02:00
ISSOtm
fcce42d3d2
Avoid sorting proto-palettes breaking mappings
...
The sorting was performed without updating the mappings, which broke the world.
We can instead sort the IDs as they are inserted into the packing queue,
which should also be faster than moving the actual proto-pal objects around.
2022-07-02 17:04:17 +02:00
Eievui and ISSOtm
ed104a9f70
Add rgbgfx test program
...
Co-Authored-By: ISSOtm <[email protected] >
2022-07-02 17:04:17 +02:00
ISSOtm
f5d4126303
Report when an input "tile" contains too many colors
...
Which otherwise trips a later assertion in debug mode (phew!)
and crashes in release mode (oops)
2022-07-02 17:04:17 +02:00
ISSOtm
78e751f022
Fix reading interlaced PNGs
...
Either we let libpng handle the transform, or we don't.
But make up your mind!
2022-07-02 17:04:17 +02:00
ISSOtm
d569c6392c
Avoid initializing the PNG row
...
It gets overwritten right after, and uncovers an error in the interlaced read
2022-07-02 17:04:17 +02:00
ISSOtm
75b9d48990
Make randtilegen report the file names it fails to open
...
Which of the two is erroring out can be inferred from the file name,
anyway.
2022-07-02 17:04:17 +02:00
ISSOtm
3aabe9c799
Move randtilegen to test/gfx subdir
...
It's tool-specific, so categorize it where it belongs
2022-07-02 17:04:17 +02:00
ISSOtm
5be2b96b40
Remove incorrect check for reversed image width
...
That check was when the image width was in tiles, and another check right below
is the correct equivalent for the new pixel-unit argument
2022-07-02 17:04:17 +02:00
ISSOtm
7fdfbbbbba
Fix inverted condition in tile dedup warning
2022-07-02 17:04:17 +02:00
ISSOtm
7fdc6cbced
Fix erroneous tabs in rgbgfx usage text
...
Thanks @GreenAndEievui!
2022-07-02 17:04:17 +02:00
ISSOtm
56115653ef
Include cross-ref link to at-files where mentioned
2022-07-02 17:04:17 +02:00
ISSOtm
7927dfd2e3
Remove negative values in parseNumber checking
...
Including removal of a dead & useless check.
By the way, fuck integer promotion.
2022-07-02 17:04:17 +02:00
ISSOtm
b1aec91912
Assert that row size is not null
...
Silences some static analysis warning
2022-07-02 17:04:17 +02:00
ISSOtm
7defaad9d2
Remove placeholder palette output format from -p
...
This is now described in its own section
2022-07-02 17:04:17 +02:00
ISSOtm
dc9185e50b
Make output format descriptions more succinct and link to Pan Docs
2022-07-02 17:04:17 +02:00
ISSOtm
02d957278d
Document output formats
2022-07-02 17:04:17 +02:00
ISSOtm
6feb1fb73a
Retire -f
2022-07-02 17:04:17 +02:00
ISSOtm
dc67f152a9
Document accepted external palette formats
2022-07-02 17:04:17 +02:00
ISSOtm
913c3dd711
Accept both colons and semicolons in inline pal spec
2022-07-02 17:04:17 +02:00
ISSOtm
32242e0ff2
Switch from colon separators to semicolon
...
As documented, oops
2022-07-02 17:04:17 +02:00
ISSOtm
91071009a8
Implement some external palette specs
...
PSP, ACT, and ACO are complete
2022-07-02 17:04:17 +02:00
ISSOtm
1da884db15
Handle processing errors appropriately
...
Alter the return status accordingly, and print the error counts on exit
2022-07-02 17:04:17 +02:00
ISSOtm
ef473de75a
Explicitly error out if no input image is given
2022-07-02 17:04:17 +02:00
ISSOtm
6b0cab32a6
Implement inline palette spec parsing
2022-07-02 17:04:17 +02:00
ISSOtm
cc27169ecd
Implement preliminary version of "reverse" feature
...
Not hooked to all RGBGFX flags yet, but good enough for most use cases
(and as a base for future development, should I need to `reset --hard`.)
TODOs marked appropriately.
2022-07-02 17:04:17 +02:00
ISSOtm
843022772b
Clean up randtilegen
...
Apply review comments
2022-07-02 17:04:17 +02:00
ISSOtm
75f8b16f33
Implement "at-files" for RGBGFX
...
Useful for persisting flags outside of the build system
2022-07-02 17:04:17 +02:00
ISSOtm
188027bccc
Rename convert to process
...
More consistent with its "main" function's name
2022-07-02 17:04:17 +02:00
ISSOtm
79adcdb7ea
Ignore tested sub-projects
2022-07-02 17:04:17 +02:00
ISSOtm
8ed65078da
Import fixes to random image generator
2022-07-02 17:04:17 +02:00
ISSOtm
7311fc9ef8
Fix transparency handling
...
Ensure that the color count is properly used, and that
transparency is not counted as a color when packing palettes
2022-07-02 17:04:17 +02:00
ISSOtm
7d54145e56
Record "seed" when generating images as well
...
For reproducibility
2022-07-02 17:04:17 +02:00
ISSOtm
e753b62d1a
Add program by @aaaaaa123456789 to generate RGBGFX-able images
2022-07-02 17:04:17 +02:00
ISSOtm and Rangi
6ed220b4c1
Make some style corrections
...
Co-Authored-By: Rangi <[email protected] >
2022-07-02 17:04:17 +02:00
ISSOtm
e49fb457ea
Factor out row bitplanes extraction into a common function
2022-07-02 17:04:17 +02:00
ISSOtm
3c9d5b05d6
Implement transparency handling
...
Though none of this has been tested so far...
2022-07-02 17:04:17 +02:00
ISSOtm
e86eb9337a
Check the range of the CLI-specified palette size
2022-07-02 17:04:17 +02:00
ISSOtm
b0f8e04fb7
Do not do anything if option parsing goes wrong
2022-07-02 17:04:17 +02:00
ISSOtm
493b94919f
Fix -TAP being non-functional
2022-07-02 17:04:17 +02:00
ISSOtm
71e22f3bfe
Correct "is this palette empty?" function
...
This notably caused decantation to delete non-empty palettes, which crashes
2022-07-02 17:04:17 +02:00
ISSOtm
ac02382632
Clean up palette packing a bit
...
Rename a poorly-named attribute, and add a bunch of debug logging
2022-07-02 17:04:17 +02:00
ISSOtm
943d631701
Implement max palette count
2022-07-02 17:04:17 +02:00
ISSOtm
d2f9cc7e8c
Document accepted number formats
2022-07-02 17:04:17 +02:00
ISSOtm
76bb950be5
Parse bank capacities
2022-07-02 17:04:17 +02:00
ISSOtm
f29c5d81ec
Provide a per-option sane default when number parsing fails
2022-07-02 17:04:17 +02:00
ISSOtm
2307981878
Parse base tile IDs
2022-07-02 17:04:17 +02:00
ISSOtm
6bab2ea5c8
Add different verbosity levels
...
And also some ASCII art, perhaps?
2022-07-02 17:04:17 +02:00
ISSOtm
35e57a55c9
Handle base tile IDs in "optimized" output
2022-07-02 17:04:17 +02:00
ISSOtm
21e9a65f0b
Remove old C headers
2022-07-02 17:04:17 +02:00
ISSOtm
779c8c9368
Implement -m
...
Though none of the code involved has been tested in any capacity yet, lol
2022-07-02 17:04:17 +02:00
ISSOtm
e855b6f622
Include libstdc++-6.dll in 32-bit MinGW build
2022-07-02 17:04:17 +02:00
ISSOtm
3b1808cc8f
Fix Windows-breaking use of struct vs class
...
MSVC's (broken) ABI breaks otherwise.
What the f@!$#ck, Microsoft?
(Thank you based Clang for warning, by the way.)
2022-07-02 17:04:17 +02:00
ISSOtm
71cb2854e8
Use cinttypes instead of inttypes.h
...
Fixes build on some compilers for some reason I fail to understand
2022-07-02 17:04:17 +02:00
ISSOtm
2099a25ee0
Avoid using transform_reduce
...
Not available in libstdc++ 7, apparently
2022-07-02 17:04:17 +02:00
ISSOtm
b9de65c9a2
Set C++ compiler in CI as well
...
Duh
2022-07-02 17:04:17 +02:00
ISSOtm
c82cce6d95
Explicitly specify queue template param
...
GCC 7 fails to deduce the contained type
2022-07-02 17:04:17 +02:00
ISSOtm
97965c9766
Revamp number parsing and remove <charconv>
...
Support all intended formats and allow partial parsing
<charconv> is not available in GCC 7
2022-07-02 17:04:17 +02:00
ISSOtm
5efc49cb12
Change UseTab to ForIndentation
...
This fixes many whitespace issues
2022-07-02 17:04:17 +02:00
ISSOtm
c4361b965c
Remove <filesystem>
...
Should fix compilation with GCC before 9
2022-07-02 17:04:17 +02:00
ISSOtm
8d00a61602
Flesh out man page
...
Describe current options, and add some TODOs for functionality to be implemented
2022-07-02 17:04:17 +02:00
ISSOtm
20442c8a43
Add compatibility hack for unused colors in indexed PNGs
2022-07-02 17:04:17 +02:00
ISSOtm
b95c26c886
Fully implement decanting step
2022-07-02 17:04:17 +02:00
ISSOtm
a96aa1725f
Optimize AssignedProtos::empty() to stop early
...
Also allow counting an `AssignedProtos`'s number of proto-palettes
2022-07-02 17:04:17 +02:00
ISSOtm
3d79f76e41
Avoid calling skipEmpty() for AssignedProtos::end()
2022-07-02 17:04:17 +02:00
ISSOtm
fdfedc45a6
Allow computing the combined weight of any proto-palette set
2022-07-02 17:04:17 +02:00
ISSOtm
c98d92a4c4
Implement -C
2022-07-02 17:04:17 +02:00
ISSOtm
d438838db4
Correctly handle "multiple" overlap between proto-palettes
...
As explained by the comment
2022-07-02 17:04:17 +02:00
ISSOtm
d675523e49
Skip initializing the PNG pixel array
...
We are about to set all of the pixels anyway
2022-07-02 17:04:17 +02:00
ISSOtm
ad07c9deb9
Implement (stub) handling for all options
2022-07-02 17:04:17 +02:00
ISSOtm
bf9f99ebf5
Reorder Options members by usage order
2022-07-02 17:04:17 +02:00
ISSOtm
f0eca86c52
Update checkdiff to check for gfx/main.cpp
2022-07-02 17:04:17 +02:00
ISSOtm
e8d8ae4c78
Print all configuration on verbose startup
2022-07-02 17:04:17 +02:00
ISSOtm
0cc62824b9
Use MinGW C++ compiler as well
2022-07-02 17:04:17 +02:00
ISSOtm
2fb1eb9136
Print file paths in a platform-independent way
...
Conversion may be unspecified, but Windows better do the right thing (or else.)
2022-07-02 17:04:17 +02:00
ISSOtm
bde380f38b
Fix unchecked narrowing conversion of tile IDs
...
The conversion is OK because of the tile amount cap
2022-07-02 17:04:17 +02:00
ISSOtm
38e8024ffa
Add missing return type for unreachable_()
2022-07-02 17:04:17 +02:00
ISSOtm
3bd6078537
Tag AssignedProtos iterator as forward
...
That's what it actually is, oops
(Required for `minmax_element`)
2022-07-02 17:04:17 +02:00
ISSOtm
5409d0d15a
Add missing header for strcasecmp
2022-07-02 17:04:17 +02:00
ISSOtm
9262fefd07
Fix compiling with Clang
...
Force version.c to be compiled as C++ (bodge, will need a proper fix for `version.c`)
Remove user-defined `ProtoPalette` assignment operator (same as default, anyway)
2022-07-02 17:04:17 +02:00
ISSOtm
638d024040
Update subprojects and patch pokecrystal
2022-07-02 17:04:17 +02:00
ISSOtm
3fa1854332
Implement enough functionality to compile & match pokecrystal
2022-07-02 17:04:17 +02:00
ISSOtm
6e406b22bb
Implement more features and fix bugs
2022-07-02 17:04:17 +02:00
ISSOtm
d30e507270
Fix duplicated CGB color calculation in pal sorting
...
And also the inverted alpha channel condition causing the wrong colors
to be treated as transparent
2022-07-02 17:04:17 +02:00
ISSOtm
373a22660b
Switch clang-format to C++17
...
Be consistent with what we settled on in code
2022-07-02 17:04:17 +02:00
ISSOtm
8c62e80c18
Reimplement basic RGBGFX features in C++
...
Currently missing from the old version:
- `-f` ("fixing" the input image to be indexed)
- `-m` (the code for detecting mirrored tiles is missing, but all of the
"plumbing" is otherwise there)
- `-C`
- `-d`
- `-x` (though I need to check the exact functionality the old one has)
- Also the man page is still a draft and needs to be fleshed out
More planned features are not implemented yet either:
- Explicit palette spec
- Better error messages, also error "images"
- Better 8x16 support, as well as other "dedup unit" sizes
- Support for arbitrary number of palettes & colors per palette
- Other output formats (for example, a "full" palette map for "streaming"
use cases like gb-open-world)
- Quantization?
Some things may also be bugged:
- Transparency support
- Tile offsets (not exposed yet)
- Tile counts per bank (not exposed yet)
...and performance remains to be checked.
We need to set up some tests, honestly.
2022-07-02 17:04:17 +02:00
DaKnig
34bc650341
Fix shebangs ( #992 )
2022-07-01 22:59:41 +02:00
ISSOtm
43ba7d0efb
Explain to static analyzer that initial symbol creation cannot fail
2022-06-12 16:49:06 +02:00
ISSOtm
685ea5feed
Fix RGBLINK leaking partial string at EOF
...
Does not really do much, but silences some static analyzers
2022-06-12 16:39:55 +02:00
ISSOtm
f5ac268989
Fix unchecked realloc in makeUnknown
2022-06-12 16:36:35 +02:00
ISSOtm
d51ab35203
Trim macro arg whitespace after line continuations
2022-06-09 00:07:27 +02:00
aaaaaa123456789
3a71910312
Update link to TPP1 spec in RGBFIX man page ( #1004 )
...
To match the repo transfer from late 2021.
2022-06-05 23:02:19 +02:00
ISSOtm
ec25b4ac0e
Disable -Winline
...
<@aaaaaa123456789> I mean, `-Winline -Werror` is the "make my builds fail at random for no reason" switch
2022-06-04 11:14:07 +02:00
ISSOtm
83222a8147
Fix "building from source" link in README
...
Fixes #1001
2022-05-27 11:56:52 +02:00
ISSOtm
97c326942f
Warn about automatic instruction alterations
...
Step 1 of #986
2022-05-21 21:49:07 +02:00
ISSOtm
b037d54f64
Remove deprecated symbols
...
Fixes #896
2022-05-21 21:45:06 +02:00
ISSOtm
80df6640e3
Update checkdiff to check new man page locations
2022-05-21 11:01:32 +02:00
ISSOtm
68d3ef8e76
Only test a few random padding values each time
...
It's unlikely that a specific value matters, though in theory possible;
however, an exhaustive test every time is really slow, and testing a couple
random values should, over time, cover everything.
It is fine to test random values because those tested will be logged,
so the problem can be manually reproduced later.
It does make CI technically not deterministic... but that should be fine.
2022-05-19 22:47:48 +02:00
Eldred Habert
01777c96c8
Link to rgbds-www repo in README
...
Should make it easier to find..!
2022-05-18 19:27:55 +02:00
ISSOtm
28f9183d80
Fix formatting of rgbasm -D documentation
2022-05-17 20:11:00 +02:00
ISSOtm
74c31f7c0f
Update docs CI workflows to sync with new rgbds-www repo
2022-05-17 18:36:31 +02:00
ISSOtm
7e94ecbfe6
Move all man pages to a separate directory
...
Simplifies processing all around, and makes more sense
2022-05-15 13:34:35 +02:00
ISSOtm
0195196425
Cache built deps in Windows CI runs
2022-05-01 16:40:11 +02:00
ISSOtm
19c85a7c2e
Update uCity commit to fix deprecation warnings
...
Cleaning up the logs!
See #991 for context.
2022-04-30 20:42:55 +02:00
ISSOtm
59e73e64ca
Unconditionally output ROM0 even without any sections
...
Required for example when "overlaying" over a ROM and only patching ROMX.
Fixes #993
2022-04-30 14:27:36 +02:00
ISSOtm
972d06bb41
Fix gbdiff script
...
Fix issues with spaces in input filenames,
as well as a bunch more lint warnings.
2022-04-30 14:27:36 +02:00
ISSOtm
e27da737c6
Print name of up to 10 floating sections on overlay error
2022-04-14 23:58:32 +02:00
ISSOtm
e6ae1992fe
Update zlib downloaded for generating releases
2022-04-01 12:46:44 +02:00
ISSOtm
d9b46cdec9
Update CI builds to zlib 1.2.12
...
"Due to the bug fixes, any installations of 1.2.11 should be replaced with 1.2.12."
2022-03-28 09:10:04 +02:00
ISSOtm
570cd62b81
Update subproject commits and shallow dates
...
Added a comment to explain what to update those to, too
2022-03-13 14:43:27 +01:00
ISSOtm
a4ead0c25f
Freshen version number when building with CMake
...
Fixes #979
2022-03-11 09:21:08 +01:00
ISSOtm
da66eeb40e
Clean up lint warnings in deps install script
...
Also use a simpler way to remove the version number, lol
2022-03-10 00:06:32 +01:00
ISSOtm
0c4f1f8334
Add a shebang to the deps install script
...
Duh.
2022-03-10 00:03:54 +01:00
ISSOtm
af70d555fc
Remove signed check on unsigned variable
2022-03-09 08:40:49 +01:00
Eldred Habert
e07bd92314
Have the eqn preprocessor run on rgbasm(5)
...
This is required for the built-in functions (L315-337), otherwise the math syntax doesn't get processed.
This magic line is detected by most `man` impls:
https://www.gnu.org/software/groff/manual/html_node/Preprocessors-in-man-pages.html
2022-03-08 22:11:49 +01:00
ISSOtm
9169028e57
Add .clang-format
...
Should not be followed for C files, to avoid mucking `blame`s,
but will be applied during the gradual C++ rollout, since that
will likely touch most lines in the codebase anyway.
2022-02-28 01:52:54 +01:00
ISSOtm
7dd8ba37f1
Allow changing recursion depth limit at runtime
2022-02-05 20:32:56 +01:00
Eldred Habert
6842c831fd
Allow binary AND to be sometimes constant ( #976 )
2022-02-05 14:17:57 -05:00
Eldred Habert
6b903059fe
Document endianness of dw and dl ( #972 )
2022-02-05 14:12:35 -05:00
ISSOtm
eb5af70d79
Add unsigned right shift operator
2022-02-05 20:12:15 +01:00
ISSOtm
cf19879281
Enable make develop on all Unix platforms
...
We are actually already doing it, so simplify the code
2022-02-05 20:11:25 +01:00
ISSOtm
ac59ecf3c0
Enable -Wsign-compare and fix the warnings
2022-02-05 20:11:25 +01:00
ISSOtm
72b677a8d7
Enable "debug" optimizations in make develop
...
Enhances some warnings as well as the sanitizers (Clang especially complained about it)
The `-f*` flags are to get better stack traces out of the sanitizers, as recommended
by Clang's docs: https://clang.llvm.org/docs/AddressSanitizer.html#usage
GCC's docs claim that these optimizations should not hinder the debugging
experience, and Clang's don't mention optimization flags at all.
2022-02-05 20:11:25 +01:00
ISSOtm
bbae9966e9
Fix string constness issues in RGBASM
2022-02-05 20:11:25 +01:00
ISSOtm
b3304ae1ac
Add more warnings to develop
...
As suggested by #969
2022-02-05 20:11:25 +01:00
ISSOtm
a48801a675
Trim down develop warning list and add comments
...
Remove already-enabled warnings as pointed out by #969
Comments added to the CMakeLists because the Makefile format does not really allow them
"Plain" list also sorted alphabetically, the rest (somewhat) thematically
2022-02-05 20:11:25 +01:00
ISSOtm
7dc81a64d3
Make recursive Make invocations properly recurse flags
2022-02-05 20:11:25 +01:00
ISSOtm
3afa6b5a5a
Use pedantic warnings in Makefile default config as well
...
We aim to be standard-conformant, and the CMakeLists already does it
2022-02-05 20:11:25 +01:00
ISSOtm
9b49f788e4
Add missing header in opt.h
2022-02-05 13:37:40 +01:00
ISSOtm
acc31feaa1
Fix "shift" test to actually test RGBLINK
2022-02-05 11:39:10 +01:00
Rangi
4ed5ba7508
Finish using time_utc before initializing time_local
...
gmtime and localtime may share the same static internal struct tm,
so they cannot both be initialized and then used.
2022-01-27 22:32:34 -05:00
Rangi
20a26599a3
Simplify allocating multiple ds args
...
Dealing with indexes is only necessary for `strfmt`
2021-12-01 20:24:31 -05:00
Rangi
7bdfc9da23
Really don't use new as a variable name
2021-11-30 17:06:36 -05:00
Rangi
d073cffa74
Don't use new as a variable name
...
It conflicts with the C++ keyword
2021-11-24 22:48:28 -05:00
Rangi
8435a29c4e
Turn the readChars macro into a readInternal function
...
This macro was only used twice, and the second usage did
some unnecessary work.
2021-11-25 00:26:23 +01:00
Eievui
b7fe78cad8
Fix improperly terminated region name check ( #953 )
2021-11-24 16:00:54 -05:00
Rangi
9d993d84e8
Release 0.5.2
2021-11-23 17:08:03 -05:00
ISSOtm
fef168b2a5
Add the new completion scripts to checkdiff
2021-11-23 22:12:57 +01:00
ISSOtm
4a4b22c78c
Add Bash completion scripts for the last 3
2021-11-23 22:10:08 +01:00
Rangi
db79689e81
Add -Wnumeric-string to shell autocompletion
2021-11-22 17:58:12 -05:00
Rangi
c2ca46c27d
Remove TRACE_PARSER support
...
Attempting to build with this gave an "undefined reference to `yydebug'"
error (maybe a version issue with bison?), and I don't think it's been
used for recent parser debugging either.
2021-11-22 23:49:59 +01:00
Rangi
aac839f389
Remove dbgPrint and TRACE_LEXER support
...
I have not found `TRACE_LEXER` to be useful in debugging
actual lexer issues.
2021-11-22 23:49:59 +01:00
Rangi
9d9febe1d3
Consistent title case for rgbasm.5 headings
2021-11-22 17:12:16 -05:00
Rangi
b9fd85470e
Reword docs now that SET is deprecated ( #946 )
...
- '=' constants are "variables" (not "mutable constants")
- EQU constants are "numeric constants" (not "immutable constants")
- EQUS constants are "string constants" (not "string equates")
- DS declarations are "static allocations" (not "variables")
2021-11-22 17:08:29 -05:00
Rangi
ec6d63bce3
Allow underscores in gfx literals ( #951 )
...
Fixes #950
2021-11-21 16:18:23 -05:00
Rangi
bdcef6f252
Refactor error reporting to simplify BSD-style err ( #949 )
2021-11-21 16:16:54 -05:00
ISSOtm
54293a9184
Remove unused "MAX_PATH" header
...
The header's name was also quite misleading.
Also remove an unused define in `asm/symbol.h`.
2021-11-21 18:32:29 +01:00
ISSOtm
b04e71ed34
Use correct length type for Abs*Group
2021-11-21 18:28:42 +01:00
Rangi
f82603f196
Lowercase "error:" in -Werror output
2021-11-20 11:21:46 +01:00
Rangi
cedfd2582a
Move more statements into for loop clauses
2021-11-19 22:55:20 -05:00
Rangi
c7322258fc
Refactor readGfxConstant for consistency, and edit warning message
2021-11-19 21:36:56 -05:00
Rangi
036b6c1b89
Capitalize "FATAL:" in rgblink error messages
...
"warning:" and "error:" are lowercase
This matches rgbasm's formatting
2021-11-19 19:52:57 -05:00
Rangi
8e2a164a32
Implement compound assignment operators for mutable constants
...
Fixes #943
2021-11-19 08:50:00 +01:00
Rangi
b76819792d
Deprecate SET in favor of =
...
`SET` is redundant with `=`, and is already the name of an instruction.
2021-11-19 00:05:49 +01:00
Rangi
3e945679ad
Standardize on "east const" (type const * not const type *)
...
Avoid "WARNING: Move const after static - use 'static const char'"
2021-11-18 09:12:00 +01:00
Rangi
efccf6c931
A few stylistic tweaks
...
- `goto free_romx` -> the more typical `goto cleanup`
- `goto fail` -> the more typical `goto finish`
- Remove a redundant `todo` variable
2021-11-17 23:51:40 -05:00
Rangi
e5552e27f2
strrstr can take and return char const *
2021-11-17 22:47:05 -05:00
Rangi
438963fb24
Remove unused #include "extern/utf8decoder.h" ( #940 )
...
Fixes #937
2021-11-12 23:37:19 +01:00
Rangi
0bb815edc0
Implement -Wnumeric-string[=0|1|2] ( #935 )
...
Fixes #934
2021-11-12 23:09:35 +01:00
Rangi
55a02981b5
Small updates to documentation wording ( #939 )
...
Fixes #936
2021-11-12 23:06:02 +01:00
ISSOtm
b06e3b239d
Clean up -MT/-MQ code
...
Remove unreachable argument presence check (handled by `getopt`)
Merge allocation paths into a single `realloc` call
Avoid searching for string lengths multiple times
Tiny (compatible) change: no space between last dependent and colon if
`-MT` or `-MQ` is specified
2021-11-06 13:21:39 +01:00
Rangi
47442941b6
Support ! operator for condition codes ( #720 )
...
Fixes #719
2021-11-02 00:16:52 +01:00
DaKnig and ISSOtm
b16d2d0695
Add Bash completion script for rgbasm ( #895 )
...
* Add Bash completion script for RGBASM
Should have large feature parity with the Zsh completion
Co-authored-by: DaKnig <[email protected] >
* Register RGBASM Bash completion in `checkdiff`
Co-authored-by: ISSOtm <[email protected] >
2021-10-31 23:44:01 +01:00
Eievui and Eldred Habert
8b1cc72f09
Added scramble flags to RGBLINK. ( #921 )
...
* Add scramble flags to RGBLINK
-S and -W will scramble ROMX and WRAMX respectively.
* Modify scramble CLI
CLI now takes a list of comma-separated values.
Added arg_error to clean up messages.
Co-authored-by: Eldred Habert <[email protected] >
* Document scrambling functionality
Co-authored-by: Eldred Habert <[email protected] >
2021-10-31 22:58:26 +01:00
Rangi and ISSOtm
11a6a81169
Implement -Wtruncation=level ( #931 )
...
* Implement -Wtruncation=level
-Wtruncation=0 is the same as the current -Wno-truncation.
-Wtruncation=2 is the same as the current -Wtruncation.
-Wtruncation=1 is the new default; it's less strict, allowing
N-bit values to be between -2**N and 2**N (exclusive).
* Implement generic "parametrized warning" system
* Test more `Wtruncation` variants
Co-authored-by: ISSOtm <[email protected] >
2021-10-31 17:47:31 -04:00
ISSOtm
0ce66009c1
Parallelize CMake builds
2021-10-31 22:01:35 +01:00
ISSOtm
33f2f555a6
Enable sanitizers with Clang on Ubuntu as well
2021-10-31 21:41:58 +01:00
ISSOtm
0487f9f841
Enable more checks in CMake builds on macOS
2021-10-31 21:17:51 +01:00
ISSOtm
0d6bfb84ce
Ignore unknown warning options
...
GCC and Clang do not understand the exact same warning option sets
2021-10-31 21:17:51 +01:00
ISSOtm
1e4ace8974
Update tested subproject commits
2021-10-31 20:50:26 +01:00
Eldred Habert and Rangi
a378d1e8cb
Reword label definition docs ( #887 )
...
* Reword label definition docs
A bunch of short sentences isn't very readable, this should be better
* Use correct wording for "computing difference"
Co-authored-by: Rangi <[email protected] >
* Explain how to define a label before mentioning local ones
* Move double-colon paragraph to make the explanation flow better
* Clarify what a label's value is
Co-authored-by: Rangi <[email protected] >
2021-10-31 20:20:57 +01:00
ISSOtm
81ea39effe
Add two forgotten warnings to RGBASM Zsh completion
2021-10-31 20:16:03 +01:00
ISSOtm
1a07391a97
Introduce ARRAY_SIZE macro
...
Checked by `checkpatch`, and you know what? Not a bad thing
See https://github.com/gbdev/rgbds/pull/931#discussion_r738856724
2021-10-31 07:53:33 +01:00
Rangi
b002d95459
Fix precison of fixed-point formatting
...
Fixes #908
2021-10-28 23:29:16 +02:00
ISSOtm
646fc62b89
Avoid running duplicate CI on macOS
...
`gcc` is just an alias to `clang` on macOS, so save on CI time.
2021-10-26 01:39:05 +02:00
ISSOtm
699c00dc20
Enable MacOS Big Sur in CI
2021-10-20 23:11:19 +02:00
Eldred Habert
9b9f3ffb96
Remove Ubuntu 16.04 from CI
...
It's been deprecated, see https://github.com/actions/virtual-environments/issues/3287
2021-10-05 22:24:24 +02:00
Eldred Habert and Rangi
00a67c3fb2
Clarify xref to fmt spec
...
Co-authored-by: Rangi <[email protected] >
2021-09-09 15:08:52 +02:00
ISSOtm
50d6403c72
Move section interpolation to its own section
...
Fixes #907
2021-09-09 15:08:52 +02:00
Eldred Habert
9111157b82
Add NieDzejkob and JL2210 to contributor list
...
Significant contributions all around are worth acknowledging.
2021-09-09 14:53:34 +02:00
Eldred Habert
794dd6cd7e
Mark Rangi and I as main contributors
...
I think we've earned it, at least for being maintainers for a couple years.
I believe the work done by those before us is more important (relicensing & cleanup),
but we've both made significant changes on top of what they made possible.
2021-09-09 14:37:23 +02:00
ISSOtm
ae4352c198
Fix typos in rgbasm(5)
2021-08-23 18:39:19 +02:00
Rangi
4a73eb56ea
Make peek() tail recursive instead of using goto
...
Compilation is identical with `gcc` or `clang`, -O3` or `-O2`
2021-08-18 01:30:47 +02:00
martendo and Eldred Habert
0f321bc797
Fix section merge alignment error message ( #919 )
...
Co-authored-by: Eldred Habert <[email protected] >
2021-08-17 18:03:46 -04:00
ISSOtm
94d07c78d8
Fix MBC3+TIMER + handle lack of BATTERY
...
`TIMER & BATTERY` is 0, but even `|` would only be checking if
*either* is set; instead, imply BATTERY as soon as TIMER is given,
printing a warning if it was not given.
2021-08-12 10:20:09 +02:00
Rangi
b51e1c7c2c
Compare FOR ranges to Python's range
2021-08-01 10:45:44 +02:00
Rangi
26ddf1ff4d
Prevent defining invalid local labels
...
Fixes #913
2021-07-30 15:21:47 +02:00
ISSOtm
20fd6eabbb
Fix up gitignores
...
Move tests gitignore into its own directory
Use stricter patterns where they make sense
2021-07-25 12:15:56 +02:00
ISSOtm
fbe29006d4
Document two two .github subdirectories
2021-07-25 12:12:36 +02:00
Rangi
03bb510588
endCapture shouldn't handle lexerState->atLineStart
...
`startCapture` did not initialize `lexerState->atLineStart`;
its final value is a consequence of the separate but similar
behaviors within `lexer_CaptureRept` and `lexer_CaptureMacroBody`.
2021-07-04 18:31:46 -04:00
Rangi
695dfe9dbd
Add missing file line-continuation-string.asm
...
Also make some minor formatting corrections
2021-07-04 16:12:34 -04:00
Rangi
9782f7d942
Factor out endCapture to go with startCapture ( #904 )
...
This also refactors `startCapture` to modify the
capture body as an argument.
2021-07-04 16:08:59 -04:00
Rangi
1b5648bb06
Line continuations *do* work inside strings
...
The rgbasm.5(5) documentation was outdated here
2021-07-01 17:56:49 -04:00
Rangi
a67f5d6e01
SIZEOF("Section") and STARTOF("Section") can be known
...
Fixes #890
2021-06-27 21:03:06 +02:00
Rangi
06b57aa1ce
Avoid unnecessary "overwriting a non-zero byte" warnings
...
- Don't warn if the non-zero byte being written is the same as the original byte
- Add a `-O` / `--overwrite` flag to silence all such warnings
Fixes #897
2021-06-27 19:16:11 +02:00
Rangi
6d2db2ef64
make checkdiff does CI documentation checks (#900 )
...
Fixes #744
2021-06-24 17:49:08 -04:00
Eldred Habert
9868a01163
Format -m help better in the man page
...
Use semantic macros instead of plain text
2021-05-30 13:59:02 +02:00
Eldred Habert
0c8cdd92d6
Make instruction descriptions more proper English
...
Use articles where appropriate
Use adjectives where it makes sense
2021-05-24 22:07:36 +02:00
Rangi
80a376f045
Syntax errors resets the lexer right away
...
`DEF`, `REDEF`, etc disable EQUS expansion, and reading
macro or OPT arguments sets the lexer to raw mode.
Syntax errors resume normal parsing at the line's end,
but should resume normal tokenization even before that.
2021-05-22 16:08:55 -04:00
Rangi
0068c1375c
Syntax error message hints to indent macro invocations
...
This message is only printed for identifiers parsed as
`T_LABEL` (since they're at the start of a line) but
already defined as macros. Otherwise it may not be
relevant, e.g. for `MyLabel;:` or `My Label::`.
2021-05-22 14:58:26 +02:00
ISSOtm
872af9c7ed
Remove dead store in linker script CRLF handling
2021-05-21 17:20:47 -04:00
ISSOtm
06ea7b20bf
Reinstate "empty filename" assertion in __FILE__ callback
...
This assertion was mentioned by a comment, but deleted for some reason.
2021-05-21 17:20:47 -04:00
ISSOtm
a3c4652bfd
Fix dead stores in charmap_ConvertNext
...
Also cleanup / rearrange some of the function while we're at it.
2021-05-21 17:20:47 -04:00
Rangi
5ad48851ed
Allow error messages for subsequent syntax errors ( #892 )
...
Fixes #891
2021-05-21 17:04:27 -04:00
ISSOtm
e3b7339dd6
Save UNION stack when using PUSHS as well
...
This allows using the latter within the former
2021-05-21 09:47:27 +02:00
ISSOtm
69d7f84502
Reset LOAD offset when changing SECTIONs
...
This would cause spurious section overflow messages, since the load offset
is added to the section's when computing its size.
2021-05-21 09:37:17 +02:00
ISSOtm
e970b6d6eb
Update Zsh completions with CLI changes
...
Also fix some misc. issues with them, and fix an incorrect reported ID for MBC1
2021-05-15 19:21:39 +02:00
ISSOtm
d9cce3fa1f
Update TPP1 canonical name to "TIMER", not "RTC"
...
See previous commit
2021-05-15 19:13:24 +02:00
Rangi
23721694ea
Comment that anonymous labels internally start with '!'
...
`startsIdentifier` should not accept this character so
anonymous labels won't conflict with nonymous ones.
2021-05-15 12:57:22 -04:00
ISSOtm
aa02958e18
Fix mandoc warnings
2021-05-15 12:23:05 +02:00
ISSOtm
011d4ec392
Use the Ad macro for RST addresses
...
Sy has no semantic meaning, and Ad may fix how the "x" is rendered
in the HTML export
2021-05-15 12:03:20 +02:00
ISSOtm
afbaf10185
Fix MBC help string
...
It's called TIMER, not RTC >_<
2021-05-15 11:25:09 +02:00
Rangi
6a5e2f439e
Fix the STRFMT documentation in rgbasm(5)
...
Fixes #886
2021-05-09 17:23:57 -04:00
Rangi
fba77c4dce
Specify to update the release branch in RELEASE.rst
...
This is done manually after publishing a release.
2021-05-08 23:44:53 -04:00
Rangi
830df360ae
Specify that all .sh files need Unix line endings
...
The `git config --global --unset core.autocrlf` command
was failing in the "Create release artifacts" workflow,
so this is an alternate method of fixing issue #841 .
2021-05-08 23:22:31 -04:00
Rangi
c75551b1b3
Release 0.5.1
2021-05-08 22:38:20 -04:00
Rangi
5a38f6e148
rgbasm supports "Q16.16" fixed-point literals
...
"Qm.n" signifies an m-bit two's complement integer
with n fractional bits.
<https://en.wikipedia.org/wiki/Q_(number_format) >
2021-05-06 23:17:08 -04:00
Rangi
869021f47d
Fix -Wformat build warnings on macOS
...
C arithmetic promotes certain expressions to `int`,
so formatting has to use "%d" or "%x", not inttypes.h.
Fixes #883
2021-05-04 21:28:57 -04:00
Eldred Habert and Rangi
c06985a7ad
Fix incorrect lexing of "$ff00+c" ( #882 )
...
Fixes #881 by moving the task from the lexer to the parser.
This both alleviates the need for backtracking in the lexer,
removing what is (was) arguably a hack, and causes tokenization
boundaries to be properly respected, fixing the issue mentioned above.
Co-authored-by: Rangi <[email protected] >
2021-05-05 02:04:19 +02:00
ISSOtm
c502804192
Update winflexbison to 2.5.24
...
Updates Bison to 3.7.4, removing support for VS2015
https://github.com/lexxmark/winflexbison/releases/tag/v2.5.24
2021-05-05 01:57:16 +02:00
ISSOtm
75f1bcde31
Make SECTION size overflow non-fatal
...
Fixes #538
2021-05-04 15:34:20 +02:00
ISSOtm
60b85298a9
Fix all memory leaks in RGBLINK
...
At least all that were reported in the tests.
Partial fix for #709 , that only leaves RGBASM to be fixed... oh boy!
2021-05-03 12:50:14 +02:00
ISSOtm
8bbafb7200
Rename out_ functions in section.c to sect_
...
More consistent with convention used everywhere, and makes it easier to
know which file the functions come from.
2021-05-03 12:22:14 +02:00
ISSOtm
75ce230dce
Make UNION-related errors non-fatal
2021-05-03 10:57:14 +02:00
ISSOtm
1d01268249
Remove LOAD FRAGMENT
...
It's very troublesome, with flaky semantics and a very restricted use space.
2021-05-03 10:51:55 +02:00
ISSOtm
02cb5a0526
Avoid performing invalid actions on LOAD errors
...
These are rejected because they could lead to incorrect behavior,
so then don't do it...
2021-05-03 10:46:52 +02:00
Rangi
8397b3d8ec
.sym file sorts symbols from zero-length sections first
...
This will, for instance, ensure that a zero-length
`SECTION "NULL", ROM0[0] / NULL::` comes first.
2021-05-02 17:57:20 -04:00
Rangi
296e5489c9
rgblink adjusts patches' PC offsets when merging FRAGMENTs
...
Fixes #869
2021-05-02 23:54:42 +02:00
Rangi
9ab9d0f39c
Output all SECTION UNION/FRAGMENT symbols in .sym files
...
Fixes #809
2021-05-02 23:51:17 +02:00
ISSOtm
6e1a5dcc9d
Add TPP1 support
...
Fixes #846
2021-05-02 19:09:53 +02:00
Jakub Kądziołka and ISSOtm
d360d03403
Enable address sanitizer in develop builds ( #834 )
...
Co-authored-by: ISSOtm <[email protected] >
2021-05-02 18:08:03 +02:00
Rangi
e9bfe849ad
Allow OPT to toggle -h
2021-05-02 11:06:53 +02:00
Rangi
665eb916a2
OPT L acts like -L and *dis*ables optimizing LD to LDH
...
Fixes #867
2021-05-02 11:06:53 +02:00
Rangi
04788e15af
Fix a potential out-of-bounds array access in RGBGFX
...
This was caught by ASAN for pokered's gfx/battle/minimize.png.
2021-05-01 22:33:54 -04:00
ISSOtm
dcb8c69661
Fix UAF in lexer capture
...
Fixes #689
2021-05-02 03:24:18 +02:00
ISSOtm
cc6b70f1d5
Add option to list accepted MBC names and clarify man page
...
Referring to "Pan Docs names" skims over a lot of details.
Add `-m help` to list accepted names for clarity
2021-05-02 00:39:42 +02:00
ISSOtm
38a9a613da
Make data output outside of a SECTION non-fatal
2021-05-01 23:48:48 +02:00
ISSOtm
ad9a766a56
Allow dollar-prefixed hex for RGBFIX -m
...
Fixes #872
2021-05-01 23:48:23 +02:00
Eldred Habert
21b59c4651
Reinstate PUSHS clearing the SECTION scope ( #870 )
...
* Reinstate PUSHS clearing the SECTION scope
Otherwise you can use `PUSHS` to simulate the old `ds -21`, and possibly cause bugs
* Have PUSHS push LOAD block state as well
It does not make sense not to, and coud cause bugs.
2021-05-01 23:30:09 +02:00
ISSOtm
3ffdd50909
Test that RGBFIX does nothing when given no flags
2021-05-01 14:16:45 +02:00
Rangi
ca36422ac9
Parse 'ld hl, sp - <e8>' correctly
...
Fixes #864
2021-05-01 11:08:01 +02:00
Rangi
8e4ba8d2e4
Allow REDEF for EQU constants
...
Fixes #853
2021-04-29 12:24:07 +02:00
Rangi
ee67f1039c
Fix REDEF EQUS behavior
...
Redefining an EQUS constant will now update its filename,
like redefining a SET/= constant.
Attempting to redefine as EQUS a non-EQUS constant will
print an appropriate error message.
This also standardizes on `sym` versus `symbol` as a
variable name (which pairs with `symName`).
2021-04-28 12:11:26 -04:00
Rangi
d37aa93a7d
Port some cleanup from the WIP 'strings' branch
...
This is mostly variable renaming
2021-04-28 11:58:56 -04:00
Rangi
bba532193b
Port some cleanup from PR #847
...
- Update some whitespace formatting
- Factor out some functions
- Free data after outputting to an object file
2021-04-28 11:58:56 -04:00
GreenAndEievui
b4814b06b9
Updated RGBFIX to report when non-zero bytes are overwritten
...
Also updated many .err files with the new warning.
2021-04-28 11:57:43 -04:00
Rangi
4ee2eb845b
Clone test repositories with earlier --shallow-since dates
...
The previous dates were not reliably downloading the
necessary commit IDs for checkout to work.
2021-04-27 17:27:23 -04:00
Rangi
3fdf01c0f5
Resolve some TODO comments
...
- `out_PushSection` should not set `currentSection` to NULL because
PUSHS, PUSHC, and PUSHO consistently keep the current section,
charmap, and options, even though the stack has been pushed.
- `Callback__FILE__` does not need to assert that `fileName` is not
empty because `__FILE__`'s value is quoted, and can safely be empty.
- `YY_FATAL_ERROR` and `YYLMAX` are not needed since the lexer is
not generated with flex.
2021-04-26 15:52:30 -04:00
Rangi
1949a61c6f
Tested the ctz and clz shim functions
...
Their values match the GCC builtins for all
4,294,967,295 nonzero inputs.
2021-04-26 12:17:34 -04:00
Rangi
43cf20b155
Support Mac OS classic CR line endings in linkerscripts
...
This also refactors `readChar(file)` to `nextChar()` to be
more like the rgbasm lexer.
2021-04-26 12:05:36 -04:00
Rangi
e27a6d53a0
Support character escapes in linkerscript strings
...
This allows linkerscripts to refer to section names even if
they contain special characters: '\r' '\n' '\t' '"' '\\'.
2021-04-26 12:05:36 -04:00
Rangi
d17e9c663e
Update the tested commits of pokecrystal, pokered, and ucity ( #859 )
...
These are the latest commits as of today. The pokecrystal and
pokered commits use rgbds 0.5.0 features; ucity does not but
is compatible with it.
2021-04-26 10:47:32 -04:00
ISSOtm
dd8f396227
Fix compiler warnings
...
As reported in #789
2021-04-25 20:40:11 +02:00
ISSOtm
b60853ea21
Fix RGBFIX option parsing on platforms with unsigned char
...
Such as Termux, once again.
2021-04-25 11:05:34 +02:00
ISSOtm
b936ca27ab
Enable _ISOC11_SOURCE
...
See #789
2021-04-23 17:07:52 +02:00
Rangi
e050803ed1
Use size_t for measuring nested depths
...
Multiple functions involve tracking the current depth
of a nested structure (symbol expansions, interpolations,
REPT/FOR blocks, parentheses).
2021-04-23 14:28:10 +02:00
Rangi
27f38770d4
Parentheses in macro args prevent commas from starting new arguments
...
This is similar to C's behavior, and convenient for passing
function calls as single values, like `MUL(3.0, 4.0)` or
`STRSUB("str", 2, 1)`.
Fixes #704
2021-04-23 14:28:10 +02:00
ISSOtm
db1f77f90b
Correct "| operator" line not including the pipe
2021-04-23 14:24:53 +02:00
Rangi
4d21588eb2
Make invalid UTF-8 characters in strings non-fatal
...
STRLEN and STRSUB report the erroneous bytes
Fixes #848
2021-04-22 09:59:02 +02:00
Rangi
e596dbfc80
Make failed macro arg expansions non-fatal
...
Expanding empty strings is valid but pointless;
macro args already skipped doing so, now other
`beginExpansion` calls do too.
This also fixes failed interpolations (which were
already non-fatal) to continue reading characters,
not evaluate to their initial '{' character.
2021-04-22 09:59:02 +02:00
Rangi
1aeaca2af6
Add test case sort-algorithms.asm
...
This combines 0.5.0 and post-0.5.0 features:
print and println, strfmt, for loops,
def assignments, redef equs, {interpolation},
new macro syntax, and \<bracketed macro args>
2021-04-20 22:36:56 -04:00
Rangi
267e4bc25c
rgbds.7(7) shows an example of piping rgbasm to rgblink to rgbfix
...
This uses one line instead of three
2021-04-20 22:06:02 -04:00
Rangi
c3e27217dd
More specific "Symbol name too long" error messages
...
Identifiers, {interpolations} and \<macroArgs> are distinct
2021-04-20 17:14:21 +02:00
Rangi
fe3521c7a4
Switch from parentheses to angle brackets
...
`\(` is more likely to be a valid escape sequence in the
future (as is `\[`) and `\{` is already taken.
2021-04-20 17:14:21 +02:00
Rangi
b0f8d75d1d
Shorten quine.asm with \(parenthesized) macro args
2021-04-20 17:14:21 +02:00
Rangi
7a314e7aff
Support numeric symbol names in \(parentheses)
...
For example, \(_NARG) will get the last argument
2021-04-20 17:14:21 +02:00
Rangi
637bbbdf43
Support multi-digit macro arguments in parentheses
...
This allows access to arguments past \9 without using 'shift'
2021-04-20 17:14:21 +02:00
Rangi
8230e8165c
Eliminate isAtEOF by changing yylex control flow
...
`yylex` calls `yywrap` at the beginning of the next call, after it
has set `lexerState->lastToken` to `T_EOB`.
2021-04-20 17:10:08 +02:00
Rangi
a727a0f81f
Capture termination status is equivalent to not having reached EOF
...
This avoids the need for a separate `terminated` flag
2021-04-20 17:10:08 +02:00
Rangi
7a587eb7d6
Use midrule action values for captures' terminated status
...
Bison 3.1 introduces "typed midrule values", which would write
`<captureTerminated>{ ... }` and `$$` instead of `{ ... }` and
`$<captureTerminated>[1-9]`, but rgbds supports 3.0 or even lower.
2021-04-20 17:10:08 +02:00
Rangi
7ac8bd6e24
Return a marker token at the end of any buffer
...
Removes the lexer hack mentioned in #778
2021-04-20 17:10:08 +02:00
Rangi
be2572edca
Track nested interpolation depth even outside string literals
...
Fixes #837
2021-04-20 09:37:29 -04:00
Rangi
cf2bbe6435
Position -1 is the last character of a string
...
Position 0 is invalid, which matches with STRIN/STRRIN
returning 0 on failure.
2021-04-20 14:27:59 +02:00
Rangi
dc5b7802c8
Make the len parameter optional in STRSUB(str, pos, len)
...
An unspecified length will continue to the end of the string.
2021-04-20 14:27:59 +02:00
Rangi
b1e6c73197
STRSUB and CHARSUB allow zero or negative positions
...
These are offsets from the end of the string, as if the
STRLEN or CHARLEN respectively were added to the position.
Fixes #812
2021-04-20 14:27:59 +02:00
Rangi
459773b3f0
Update some whitespace after Hungarian prefixes were removed
...
Keep the parameter alignment and 100-char line limit
2021-04-19 16:47:39 -04:00
ISSOtm
6d0a3c75e9
Get rid of Hungarian notation for good
...
Bye bye it was not nice knowing ya
2021-04-19 22:12:10 +02:00
ISSOtm
e35585960c
Avoid generating CRLF'd release tarballs
...
Fixes #841
2021-04-18 23:19:22 +02:00
Rangi
3bea7930a9
Only update documentation for gbdev/rgbds
...
Prevent the relevant GitHub Actions from running on forks
2021-04-18 16:16:17 -04:00
Rangi
52797b6f68
Implement SIZEOF("Section") and STARTOF("Section") ( #766 )
...
Updates the object file revision to 8
Fixes #765
2021-04-17 18:36:26 -04:00
Rangi
5108c5643c
Let charmap_ConvertNext advance its output pointer
2021-04-17 18:18:34 -04:00
Rangi
2005ed1df9
Implement CHARLEN and CHARSUB
...
Fixes #786
2021-04-17 18:18:34 -04:00
Rangi
d43408f4f3
Allow OPT to modify -W
...
Warning flags are processed individually;
PUSHO and POPO (re)store all the warning states.
2021-04-18 00:11:18 +02:00
Rangi
2c30ab8731
Allow OPT to modify -L
...
-L is a Boolean flag option, so you specify 'OPT L' or 'OPT !L'.
2021-04-18 00:11:18 +02:00
ISSOtm
432c769d60
Release v0.5.0
2021-04-17 22:53:00 +02:00
Rangi
9923fa3eee
Fix expansions that start from the end of another expansion ( #839 )
...
Do not free an expansion until its offset is *past* its size.
This means potentially freeing a nested stack of expansions
all at once.
Fixes #696
2021-04-17 13:14:40 -04:00
Rangi
750e93be3d
Further simplify formatting code
...
- Remove redundant length checks before `memcpy`
- Coerce `sign` and `prefix` to boolean for `numLen`
2021-04-17 01:11:11 -04:00
Rangi
ee5da4468d
Fix interpolation/STRFMT overflow issues ( #838 )
...
Widths and fractional widths greater than 255 would overflow a
uint8_t and wrap around to smaller values.
Total formatted lengths greater than the avilable buffer size
would overflow it and potentially corrupt memory.
Fixes #830
Closes #831
2021-04-17 00:52:55 -04:00
Rangi
503c3b5364
Revert "Fix interpolation/STRFMT overflow issues"
...
This reverts commit 992be3fd9b .
2021-04-16 22:19:37 -04:00
Rangi
992be3fd9b
Fix interpolation/STRFMT overflow issues
...
Widths and fractional widths greater than 255 would overflow a
uint8_t and wrap around to smaller values.
Total formatted lengths greater than the avilable buffer size
would overflow it and potentially corrupt memory.
Fixes #830
Closes #831
2021-04-16 22:00:17 -04:00
Rangi
c755fa3469
readIdentifier does not process characters that get truncated
...
Previously a '.' could be past the truncation limit but still
cause the identifier to be marked as local, violating an
assertion in `sym_AddLocalLabel`.
Fixes #832
2021-04-16 21:15:01 -04:00
Rangi
e78a1d5bfd
readInterpolation is limited by nMaxRecursionDepth
...
Fixes #837
2021-04-16 16:10:46 -04:00
Rangi
d2f6def2eb
Remove unused function hash_ReplaceElement
2021-04-16 12:36:45 -04:00
Jakub Kądziołka
1ffd7cb5bb
Make tests work on NixOS
...
Some distributions, such as NixOS and Guix, only have the /bin/sh and
/usr/bin/env binaries in standard locations.
2021-04-16 16:38:04 +02:00
Jakub Kądziołka
215e26b478
charmap: Store hashmap nodes in charmap stack
...
This helps update all the pointers during reallocation.
2021-04-16 16:00:26 +02:00
Jakub Kądziołka
8885f7bcf6
hash_AddElement: return the new node
2021-04-16 16:00:26 +02:00
Jakub Kądziołka
5334fc334e
Don't report hashmap collisions
...
This doesn't seem to be very useful, and keeping this "feature" is
difficult.
2021-04-16 16:00:26 +02:00
Jakub Kądziołka
f97663aa37
hashmap: add hash_GetNode
2021-04-16 16:00:26 +02:00
Jakub Kądziołka
08bdbd1949
Add an .editorconfig
...
This automatically sets up the formatting settings in a number of
editors, regardless of the user's preferences.
2021-04-16 15:56:57 +02:00
Rangi
5c852c7651
Store the nested expansions starting from the deepest one ( #829 )
...
This shortens the lexer by 100 lines and simplifies
access to expansion contents, since it usually needs the
deepest one, not the top-level one.
Fixes #813
2021-04-16 09:54:13 -04:00
Rangi
6be3584467
LexerState's 'size' and 'offset' for mmapped files are unsigned
...
These were using signed 'off_t' because that is the type of
'st_size' from 'stat()', but neither one can be negative.
2021-04-16 10:23:37 +02:00
Rangi
8c90d9d2d7
Get rid of skip in struct Expansion
...
This was only used to skip the two macro arg characters,
but shiftChar() can skip them before the expansion.
2021-04-16 10:23:37 +02:00
Rangi
f69e666b00
expansionOfs cannot be negative
...
lexerState->expansionOfs is always either set to 0, or updated by
adding a positive quantity:
if (distance > lexerState->expansions->distance) {
lexerState->expansionOfs += distance - lexerState->expansions->distance;
...
}
so it will always be positive or zero.
2021-04-16 10:23:37 +02:00
Rangi
eba06404f0
peek(0) => peek()
...
This does not completely refactor `peek` as #708 suggested,
to make it shift and cache a character itself. However it
does simplify the lexer code.
2021-04-16 10:23:37 +02:00
Rangi
9558ccea1b
shiftChars(1) => shiftChar()
...
Only two sites were for distances greater than 1:
a `shiftChars(2)`, trivial to just do two `shiftChar()`s;
and `shiftChars(size)` in `reportGarbageChar`, which
can be a `for` loop, and should be fixed anyway to
"avoid having to peek further than 0".
2021-04-16 10:23:37 +02:00
Rangi
260d372acd
Lex $ff00+c without needing large peek lookahead
...
This also allows arbitrary amounts of whitespace in `$ff00 + c`,
instead of needing to fit in the 42-byte LEXER_BUF_SIZE
2021-04-16 10:23:37 +02:00
Rangi
4e1b0ce793
Rephrase CONTRIBUTING.rst
...
Fix #729
2021-04-14 21:19:54 -04:00
Rangi
363ee9578c
Document the release process in RELEASE.rst
...
Fix #718
2021-04-14 21:13:37 -04:00
Rangi
8fa5a4255e
Mention alternative mnemonics in gbz80(7)
...
Fixes #819
2021-04-14 16:59:31 -04:00
Rangi
b3312886fb
Use a lookupExpansion, but not as an X macro
...
Instead of defining `LOOKUP_PRE_NEST` and `LOOKUP_POST_NEST`,
pass a variable name and a block to `lookupExpansion`; it
will assign successive looked-up expansions to the variable
and use them in the block.
The technique of using `__VA_ARGS__` to allow commas within a
block passed to a macro is not original, and should be stable.
2021-04-13 17:58:46 +02:00
Rangi
7fc8a65d0a
Refactor the lexer to not use the lookupExpansion X macro
...
This macro was only used twice, in `beginExpansion` and
`lexer_DumpStringExpansions`, with `getExpansionAtDistance`
already containing an inlined and slightly modified version
of `lookupExpansion` (retaining the `LOOKUP_PRE_NEST` and
`LOOKUP_POST_NEST` macros, but with both of them doing nothing).
Not using an X macro here makes the actual control flow in both
places more obvious, and I think the repeated code is acceptable
for the same reasons as the similar-but-distinct implementations
of `readString`, `appendStringLiteral`, `yylex_NORMAL`, and
`yylex_RAW`.
2021-04-13 17:58:46 +02:00
Rangi
c278a361da
Remove the unused calchash djb2 hash function
...
Note that hashmap.c uses its own FNV-1a hash function
2021-04-13 17:41:12 +02:00
Rangi
a2f52867ad
Rename print to printChar
...
This clarifies its usage, for printing a single character
in error messages.
2021-04-13 17:41:12 +02:00
Rangi
ab79e6bede
Change how print(c) formats reported characters
...
Printable ASCII becomes single-quoted, using backslash
escapes if necessary. Unprintable characters use 0xNN
formatting, without quotes.
2021-04-13 17:41:12 +02:00
Rangi
850c78aaf4
Report garbage chars as their bytes; don't try decoding them as UTF-8
...
This decoding required high lookahead, and was not even
consistently useful (the `garbage_char` test case was not
valid UTF-8 and so did not benefit from `reportGarbageChar`).
This limits UTF-8 handling to the `STRLEN` and `STRSUB`
built-in functions, and to charmap conversion.
2021-04-13 17:41:12 +02:00
Rangi
c08cf783c8
Remove 'inline' from functions not in headers
2021-04-13 10:27:08 -04:00
Rangi
25a8518fbf
Remove unused function removeLeadingZeros
2021-04-13 10:12:40 -04:00
Rangi
49174f4486
Define the UTC time components as EQU, not EQUS
...
Fixes #827
2021-04-13 10:11:21 -04:00
Rangi
81327b0d99
Merge branch 'master' of https://github.com/gbdev/rgbds
2021-04-13 09:31:35 -04:00
Rangi
c0859e64f7
fstk_FindFile checks for sprintf failure
2021-04-13 09:31:05 -04:00
Rangi
3e0b7d428f
Fix an unclosed file and unfreed memory in out_BinaryFileSlice
...
Use 'goto cleanup' in both out_BinaryFileSlice and out_BinaryFile
2021-04-13 09:19:59 -04:00
ISSOtm
ba3428314b
Add contact info for potential contributors
...
I'm going on a break, but I'll stay available if anyone wants to contribute.
2021-04-13 00:27:49 +02:00
Rangi
bcb78f5d18
Define __RGBDS_VERSION__ as the output of rgbasm --version (sans "rgbasm")
...
Fixes #824
2021-04-09 19:42:48 +02:00
ISSOtm
de7d1facf3
Add assertion that an expansion's total len doesn't overflow
...
Typically not needed because the recursion depth limit should prevent it,
but it might help debug weird lexer issues.
2021-04-03 18:31:30 +02:00
Rangi
310d34c655
Comment on REG_SP and REG_AF both being 3
...
No instruction needs to distinguish them both
2021-03-31 18:41:42 -04:00
Rangi
39c38f9838
Add a test case for unattainable SECTION UNION alignment
...
This test cases used to fail an assertion in `make develop`
2021-03-31 16:09:52 -04:00
Rangi
576b063519
Fix unattainable alignments to address 0
...
Fixes #818
2021-03-31 16:06:15 -04:00
Rangi
596e17ee61
Factor out a common strlen into beginExpansion
...
This avoids the possibility of `size` not matching `str`
2021-03-31 14:41:38 -04:00
Rangi
363b3d0134
Flush stdout after PRINTLN
...
This allows debug PRINTLN statements to run even if
subsequent rgbasm directives cause a crash.
2021-03-31 11:22:41 -04:00
Rangi
c7ed9a275e
Do not expand empty strings
...
Fixes #813
2021-03-31 10:21:04 -04:00
Rangi
49aac2961d
Warn about backwards FOR loops with -Wbackwards-for (-Wall)
...
Fixes #816
2021-03-31 10:00:21 -04:00
Rangi
3741bd4617
Speed up the div-mod test case
...
Test various explicit cases, not nested `for` loops
over thousands of cases
2021-03-31 09:37:23 -04:00
Jakub Kądziołka
937c9888a4
Robustly disallow overwriting builtin symbols ( #817 )
2021-03-31 09:03:57 -04:00
Rangi
61a9bfd33c
Some tests use the new macro <name> syntax
...
This happens to make quine.asm shorter
2021-03-31 00:00:18 -04:00
Jakub Kądziołka
d08bcc455d
Handle errors when opening source file
...
Before this commit, opening a file for which the user didn't have
permission resulted in a "Bad file descriptor" error.
2021-03-30 23:35:50 +02:00
Rangi
aaa92659ea
Require a plus sign in ld hl, sp + <e8>
...
Fixes #810
2021-03-30 13:05:21 -04:00
Rangi
be877134e5
Remove support for ld bc/de/hl/sp for ld hl, bc/de/hl/sp
...
Fixes #811
2021-03-30 13:01:49 -04:00
Rangi
d05703c692
Release 0.5.0-rc2
2021-03-28 17:15:44 -04:00
Rangi
5dbfafcc55
Update man page copyrights to 2021
2021-03-28 16:37:15 -04:00
Rangi
a265b85d9d
Report "1 error", not "1 errors", when assembly is aborted
...
This matches other such pluralized error messages
2021-03-28 15:55:32 -04:00
Rangi
28abf03c0a
Output USED space, not FREE space, in the .map file
...
Fixes #808
2021-03-28 15:49:44 -04:00
Rangi
7e7f92f18c
Assign section locations to all UNIONs/FRAGMENTs
...
Fixes the test case from #800
The `out.gb` output was corrected, since the two "test"
fragments have a different order in ROM than in SRAM.
It is effectively:
; ROM0[$0000], fragments ordered by size
jr Label
dw Label
db 0
; SRAM[$a000], fragments ordered by .o order
ds 1 ; db 0
ds 2 ; jr Label
Label: ; $a003
ds 2 ; dw Label
2021-03-28 15:21:17 -04:00
Eldred Habert
7461170956
Add LOAD FRAGMENT pc test ( #800 )
...
Reproduces a reported problem, fix pending
2021-03-28 15:11:20 -04:00
Rangi
57d966d6e0
Merge pull request #804 from Rangi42/normal-backslash
...
Backslash in normal lexer mode must be a line continuation
2021-03-26 13:33:11 -04:00
Rangi
17752d7094
Backslash in normal lexer mode must be a line continuation
...
Macro args were already handled by `peek`, and character escapes
do not exist outside of string literals.
This only affects the error message printed when a non-whitespace
character comes after the backslash. Instead of "Illegal character
escape '%s'", it will print "Begun line continuation, but
encountered character '%s'".
2021-03-26 13:23:05 -04:00
ISSOtm
4216f0a9b0
Init top-level fstack node line number
...
It still gets written to the object file, generating Valgrind warnings
about using uninitialized memory. To silence those errors, and make
output more reproducible, init the line no to a dummy (0) value.
2021-03-25 11:26:58 +01:00
ISSOtm
e3fde986ad
Remove hashmap collision warning
...
It was only used to check hashmap collision rate in the wild,
but it no longer has a purpose and produces spurious messages
2021-03-23 21:34:08 +01:00
Rangi
aa99ed056c
Do not evaluate an untaken ELIF's condition
...
Fixes #764
2021-03-23 16:20:24 +01:00
ISSOtm
46d6652df1
Fix missing .sym/.map symbols in SECTION UNION/FRAGMENTs
...
Only the first "slice"'s symbols were considered, forgetting some symbols
2021-03-22 23:23:06 +01:00
ISSOtm
5406674cdd
Install groff to build PDFs correctly in CI
2021-03-20 02:09:47 +01:00
ISSOtm
5d2e2e2182
Make docs update script also produce PDFs
...
See rgbds-www#12
2021-03-20 01:53:26 +01:00
ISSOtm
a929f36bc5
Replace UTF-8 hyphens with ASCII ones in man pages
2021-03-20 01:25:17 +01:00
ISSOtm
bdb84a901f
Use sub-sections for the different symbol types
...
This will make them appear in the ToC, and generate HTML anchors for them
2021-03-19 11:04:22 +01:00
Rangi
093631ca0b
Revise rgbasm(5) string symbol documentation
...
Clarify the differences between EQUS expansion and {interpolation}
2021-03-19 01:48:36 +01:00
Rangi
7e127a4e52
Don't expand string symbols in MACRO and FOR symbol names
...
Explicit {interpolation} can still achieve this, but
to match DEF, REDEF, and PURGE, these new directives that
define symbols do not expand string EQUS.
2021-03-19 01:48:36 +01:00
Rangi
b8093847dc
New definition syntax with leading DEF keyword
...
This will enable fixing #457 later once the old
definition syntax is removed.
2021-03-19 01:48:36 +01:00
Rangi
8d1b56bcf5
rgblink identifies patches' PC sections after reading all sections
...
Fixes #794
2021-03-18 23:53:54 +01:00
ISSOtm
5fb7fcf461
Fix description of rgbgfx -h
...
The old description was backwards and mostly confusing.
2021-03-18 15:35:01 +01:00
Rangi
ee900ae7a3
Add a missing newline to a verbosePrint
2021-03-17 20:53:25 -04:00
ISSOtm
3ca58e13dc
Fix verbose messages claiming non-existent errors
...
They were confusing when trying to debug other things
2021-03-14 18:52:16 +01:00
ISSOtm
aaa4e17454
Add verbose messages for early exit from -MG
...
Should help debugging Make invocations
2021-03-14 18:28:05 +01:00
daid
a81d383f75
Alignment mask was incorrectly checked for 1 instead of 0
...
This caused an `ALIGN[1]` to be ignored.
2021-03-11 13:24:59 +01:00
ISSOtm
60019cf476
Fix a bunch of Clang warnings
...
As reported by #789
Should avoid relying on 32-bit int (for implicit conversions)
and account for more extreme uses of RGBDS.
2021-03-10 10:56:57 +01:00
ISSOtm
5a6a44cbc1
Fix master documentation updater
...
Its path was not synced with a recent change
2021-03-10 01:15:51 +01:00
ISSOtm
b61a187b19
Add forgotten __RGBDS_RC__ symbol
2021-03-10 01:09:18 +01:00
ISSOtm
6382f13647
Release 0.5.0-rc1
2021-03-10 01:04:23 +01:00
ISSOtm
714d39c86f
Make some INCBIN errors non-fatal
2021-03-10 01:02:45 +01:00
ISSOtm
f11241c2ae
Add INCBIN tests
2021-03-10 01:02:45 +01:00
daid
cb47ac8b97
Change the start position check on INCBIN
...
Currently INCBIN gives an error if your start position == file size.
This means you cannot include an empty file.
It also means the text of the error message is incorrect
(as the start is not greater, but equal to the length of the file)
2021-03-10 01:02:45 +01:00
ISSOtm
028e7af7d1
Prepare release candidates
...
We'll use "-rcX" instead of "-pre" to allow multiple ones, jic
Additionally, they will be able to be detected using __RGBDS_RC__
Finally, adapt everything version-related to this new system
2021-03-10 00:06:32 +01:00
ISSOtm
e141da1d94
Compute fallback version string at compile time
2021-03-09 23:59:34 +01:00
ISSOtm
35367282e4
Add workflow to auto-prepare a release
...
Just push a tag beginning with "v" and a number to trigger it
2021-03-09 22:58:42 +01:00
ISSOtm
4c0fa6732e
Fix release doc creation workflow
2021-03-09 22:58:42 +01:00
ISSOtm
e9d9a44687
Make release doc update also register docs
2021-03-09 22:58:42 +01:00
ISSOtm
611bd46e0b
Ignore CRLF vs LF for syntax error test check
2021-03-09 22:58:32 +01:00
ISSOtm
e67254093e
Delete version test if stale
2021-03-09 22:58:00 +01:00
ISSOtm
3ce3d2f662
Explicitly force tested projects to use tested bins
2021-03-09 22:56:59 +01:00
ISSOtm
3da9d81071
Ignore DLLs too
...
Since you may want to put them next to the EXEs here
2021-03-09 22:46:17 +01:00
Rangi
88646093ca
Swap the Name and Type columns in Predeclared Symbols
2021-03-05 17:00:06 -05:00
Rangi
0a0427afbb
windows-xbuild CI uses ubuntu-18.04 for its gcc 7.3.0 ( #784 )
...
GitHub's ubuntu-18.04 environment installs gcc 7.3.0.
The latest ubuntu-20.04 environment installs gcc 9.3.0.
Version 9.3.0 is incompatible with building libpng 1.6.37,
as of 2021-03-04.
Fixes #783
2021-03-05 11:27:12 -05:00
Rangi
88048cdcd7
Clarify the character encoding example in rgbasm.5
2021-03-05 10:08:43 -05:00
Rangi
c878ff8775
Report slack totals at the end of the .map file ( #781 )
...
Fixes #777
2021-03-05 08:53:27 -05:00
dannye
a4049a3f1b
rgbasm(5): Clarify charmap behavior ( #558 )
2021-03-05 13:16:49 +01:00
Rangi
8a75cc5051
Test an indented anonymous label
2021-03-03 12:26:35 -05:00
Rangi
b674c5fcaa
Comment refers to "built-in" symbols
2021-03-03 10:35:47 -05:00
daid
a6d3df7ac9
Put all local symbols in object/sym/map files ( #774 )
...
* Store all the local symbols in object files, not only the ones that need linker patches.
This generates better map/sym files, and thus allows for better debugging as well.
* Add comments explaining the ->src and the (void)arg;
2021-03-03 10:59:51 +01:00
Rangi
365484ef18
Factor out handleCRLF()
...
This logic repeats ten times
2021-03-03 10:03:52 +01:00
Rangi
5e2bd35239
Factor out a 'plain_directive' parser rule similar to the reverted 'last_line'
...
Also expand on the comment explaining how the EOF-newline hack affects the parser
2021-03-02 20:46:17 -05:00
Rangi
6655e04ef0
Restore the "EOF-newline" lexer hack
...
This was removed in b3c0db218d
(along with two unrelated changes).
Removing this hack introduced issue #742 , whereby INCLUDing
a file without a trailing newline can cause a syntax error.
A more proper fix would involve Bison's tracking locations,
but for now the EOF-newline hack fixes the issue while only
affecting some reported errors (expecting "newline"
instead of "end of file").
Fixes #742
2021-03-02 16:53:56 -08:00
ISSOtm
40c6b840f8
Add tests for certain directives at EOF without a newline
2021-03-02 16:53:56 -08:00
daid
5d6e0677d9
Fix error-related issues ( #773 )
...
* Mark `error` as a `format` function, to properly scan its format
* Fix the call to error() from parser.y:
- Use '%s' to avoid passing an arbitrary format
- Simplify yyerror overall
* Fix size parameter of %.*s format being an int... bonkers standard.
* Report the number of arguments required and provided on a STRFMT mismatch
* Add an assert to check for a very unlikely bug
2021-03-02 16:34:19 +01:00
Rangi
56071599e7
Allow trailing commas in bare lists
...
This applies to macro arguments, DB, DW, DL, DS,
PRINT, PRINTLN, EXPORT, PURGE, and OPT.
It also removes support for empty entries in DB/DW/DL.
(Deprecating it would require keeping parser support,
which is ambiguous with trailing commas.)
Fixes #753
2021-03-02 11:48:20 +01:00
Rangi
c637447d5d
Make the "db/dw/dl directive without data in ROM" warning more specific
...
Also use uppercase for DB/DW/DL to be consistent
2021-03-02 11:48:20 +01:00
Rangi
ac2cefdd87
Refactor some math functions into a shared file for rgbasm and rgblink
...
Fixes #769
Fixes #770
2021-03-02 11:40:03 +01:00
Rangi
0774f5eb9d
Rename math.c/mymath.h to fixpoint.c/.h
...
This also changes the functions' prefix
from "math_" to "fix_".
2021-03-02 11:40:03 +01:00
Rangi
76d8862900
Refactor part of getSection into createSection
...
getSection validates its parameters and calls
either mergeSections or createSection.
2021-02-28 16:12:03 -05:00
Rangi
1dafc1c762
Allow empty macro arguments, with a warning
...
Fixes #739
2021-02-28 10:38:49 -08:00
Rangi
63d15ac8c9
append_yylval_tzString should always evaluate its argument
...
Fixes #762
2021-02-28 10:38:49 -08:00
Rangi
1f579deaff
Trim right whitespace from macro args before warning about length
2021-02-28 10:38:49 -08:00
Rangi
fad48326f8
Support /* block comments */ in macro arguments
...
Fixes #746
2021-02-28 10:38:49 -08:00
Rangi
e7d6ddf593
Fix linking tiny overlay files ( #755 )
...
* Fix compatibility of rgblink -O and -t
The -t "tiny mode" option makes ROM0 cover 0x8000 bytes,
not 0x4000. The -O "overlay" option fills areas uncovered
by sections with data from an overlay file. These needed
to cooperate so that the calculated uncovered overlay size
does not exceed the actual size of the ROM.
Fixes #754
* Print link test names like asm tests do
* Make the three test.sh scripts more similar
2021-02-24 23:04:51 -05:00
Rangi
953f79c0d9
Support 'MACRO mac' as well as 'mac: MACRO' for defining macros
...
The new syntax is used in documentation, but
the old syntax is not yet deprecated.
2021-02-25 04:42:35 +01:00
Rangi
3c5e1caa7c
Disallow "." as a local label
...
Fixes #760
2021-02-25 04:40:42 +01:00
Rangi
d4028fff10
Prevent ELIF or ELSE after an ELSE
...
Fixes #749
2021-02-25 04:39:49 +01:00
Rangi
dd892d61d8
Correct rgbasm(5) about whitespace before labels
...
Also rephrase some more label-related documentation
2021-02-23 15:31:29 -05:00
Rangi
a09f2d4115
Test an indented macro label
2021-02-23 14:48:27 -05:00
Eldred Habert
dafef5a953
Remove column 1 restriction for labels with colons ( #635 )
...
Partial fix for #457
2021-02-23 14:42:24 -05:00
dannye
929e2a4490
rgbasm: Report conflicting file/line number for duplicate sections
2021-02-23 20:08:59 +01:00
dannye
cc1129093d
Add duplicate-section test
2021-02-23 20:08:59 +01:00
ISSOtm
72911ada2d
Prevent non-numeric symbol from overriding refs
...
Fixes #751
2021-02-22 13:00:25 +01:00
Rangi
037bc7abb3
Add an rgblink test case for an $8000-byte ROM0 section with -t
2021-02-21 16:30:02 -05:00
Rangi
5fd636ac4b
Implement floored / and divisor-sign % operators ( #745 )
...
Fixes #703
2021-02-21 16:14:44 -05:00
Rangi
a6d844a9a5
Add more test cases for IF, REPT, and MACRO ( #748 )
2021-02-19 19:34:21 -05:00
ISSOtm
bee62076c6
Allow ENDC at EOF without a newline
2021-02-20 00:51:33 +01:00
ISSOtm
cd072d5e6a
Add assertion check for potential UAF trigger
...
It actually currently triggers if an INCLUDE directive is given at EOF,
but #742 will fix that.
2021-02-19 16:53:30 +01:00
ISSOtm
6ef3ee1391
Give void* ptr to %p formatter
...
Silences a format type mismatch warning
2021-02-19 16:53:26 +01:00
ISSOtm
c29b616f93
Fix forgotten initialization of lexerState->isReferenced
2021-02-18 16:33:06 +01:00
Rangi
39c179aa32
Fix missing newline in a dbgPrint
2021-02-17 13:14:02 -05:00
Rangi
5c1ae4ce22
Shorter quine test cases
2021-02-17 11:51:21 -05:00
Rangi
efbfeca292
Avoid two peek(1) calls when lexing """multi-line strings"""
2021-02-17 10:36:36 -05:00
Rangi
7dd34f1572
Format INT32_MIN as '-2147483648', not '--2147483648'
2021-02-17 09:48:40 -05:00
Rangi
748e7dd4c7
Fix calculation of 2**30
...
In exponent(), 'base *= base;' should not run
when base is 65536, since it overflows an int32_t.
This also optimizes exponent() based on
gcc and clang -O3 test cases in godbolt.org.
2021-02-17 09:25:02 -05:00
Rangi
d049ffc0f0
Handle string literals within macro arguments ( #685 )
...
Fixes #683 and #691
The lexer's raw mode for reading macro args already attempted
to handle semicolons inside string literals, versus outside ones
which start comments. This change reuses the same function for
reading string literals in normal and raw modes, also handling:
- Commas in strings versus between macro args
- Character escapes
- {Interpolations} and \1-\9 args inside vs. outside strings
- Multi-line string literals
Macro args now allow escaping '\', '"', and '\\'.
A consistent model for expanding macro args and interpolations,
within macro args, string literals, and normal context:
- "{S}" should always equal the contents of S
- "\1" should always act like quoting the value of \1
2021-02-16 22:44:25 -05:00
Rangi
8c0275480c
Allow ds to take multiple values to repeat for a count ( #725 )
...
Fixes #722
2021-02-16 22:01:23 -05:00
Rangi
76d6ef8695
Implement LOAD UNION and LOAD FRAGMENT
...
Fix #632
2021-02-17 03:42:06 +01:00
Rangi
c67a696a87
Use macros to convert between radians and fixed-point 65536ths
2021-02-16 18:07:05 -05:00
Rangi
ee20d9010e
Make @ relative to the start of a ds even at link time
...
Fix #737
2021-02-16 22:47:07 +01:00
Rangi
2bc12447e2
Update rgbds(5) object file format documentation ( #740 )
2021-02-16 16:36:37 -05:00
Rangi
cb61da8842
-Wmacro-shift warns about shifting macro arguments too far ( #741 )
...
Fixes #735
2021-02-16 16:31:01 -05:00
ISSOtm
122ba6eba5
Update deprecated feature examples
...
Those have been removed, lol
2021-02-16 22:09:31 +01:00
Rangi
dddff0f450
Cannot start a new section that's already on the stack
...
This is only relevant for FRAGMENT or UNION sections, since
normal ones would fail with "Section already defined previously".
Fixes #730
2021-02-16 21:51:48 +01:00
Antonio Vivace
a919f922a1
Add FUNDING.yml to show the Sponsor button on the repository
2021-02-16 21:23:27 +01:00
Rangi
8f20620c16
Allow shifting macro arguments by a negative amount
...
Fixes #733
2021-02-14 16:21:00 +01:00
Rangi
96bce05be2
Newlines in multi-line strings update the line number
...
This affects error and warning messages, and dbgPrint
2021-02-14 16:16:52 +01:00
Rangi
fc2bf3d11d
Prefer sizeof($$) to MAXSTRLEN + 1
...
This makes `strsubUTF8` similar to `strrpl` and `strfmt`
2021-02-14 16:16:52 +01:00
Rangi
8415ce3ed0
Correct the keywordDict size
...
The stale keywords XDEF and GLOBAL were removed,
so there can be fewer keyword nodes.
2021-02-14 16:16:52 +01:00
Rangi
ebb5aab6db
Correct some comments
...
nPCOffset no longer exists, and the lexer only
returns T_NEWLINE for EOF in raw mode.
2021-02-14 16:16:52 +01:00
Rangi
464a3a4892
Separate extern getopt implementation from the unistd.h one
...
Fixes #710
2021-02-12 00:29:21 +01:00
ISSOtm
88e1cc7302
Make EOF token name consistent across Bison versions
...
The "end of file" name apparently only became a default recently
2021-02-11 13:04:43 +01:00
ISSOtm
b3c0db218d
Remove "EOF-newline" lexer hack
...
In preparation for an upcoming change
Makes for nicer error messages, complaining about EOF instead of newlines
The hack had to be kept for the lexer raw mode to avoid a bug;
see the relevant code comment for more info.
2021-02-11 12:48:37 +01:00
ISSOtm
76446e6d00
Change behavior of merging FRAGMENTs to constrain each fragment individually
...
Additionally, remove the deprecated merging of non-fragment SECTIONs
2021-02-10 10:19:16 +01:00
ISSOtm
6623b1dc45
Fix CI on macOS
...
Apple supplies version 2.3 (from 2006!!), which doesn't support `%empty`.
2021-01-23 13:45:12 +01:00
ISSOtm
70bbb098d3
Remove stale keywords
...
They were removed from the grammar, but not the lexer
2021-01-23 00:05:56 +01:00
ISSOtm
1926065377
Enable Bison warnings
...
-Wall should be old enough.
Also use %empty instead of comments
2021-01-23 00:05:56 +01:00
Rangi
e3d355d976
Attempt to recover from syntax errors with bison
...
Fixes #595
2021-01-22 15:54:24 +01:00
ISSOtm
a679e02246
Get rid of asm.h and localasm.h
...
No need to make them global
2021-01-22 13:34:16 +01:00
ISSOtm
592e9b3725
Reorganize and comment better main()
2021-01-22 11:09:27 +01:00
ISSOtm
effc58241d
Rework defining variables on command-line
...
Avoids allocating memory
Detects CLI errors even when failing to open file
Reports symbols as defined on command-line instead of input line 0 (!?)
2021-01-22 11:03:43 +01:00
ISSOtm
3697065afc
Add asm/opt.c to CMakeLists
...
Fixes compiling with CMake
2021-01-22 11:01:33 +01:00
ISSOtm
fa0fa4d5ac
Significantly overhaul OPT code
...
Simplify the mess that was option setting (2 redundant variables !?)
Move options to a separate file
Have "modules" own their options, and OPT only access them (less redundancy)
Simplify code, respect naming conventions better
2021-01-22 10:41:09 +01:00
ISSOtm
5acc48fa54
Error out when given several input files
...
Also rename tzMainFile
2021-01-22 09:44:41 +01:00
ISSOtm
1487eebe79
Remove time counter
...
Nobody uses that, and it requires running extra code for each line
2021-01-22 08:51:57 +01:00
ISSOtm
993c034039
Avoid using EXPAND_AND_STR with external defines
...
There is no guarantee that they are purely numeric, use the values instead
2021-01-22 08:51:35 +01:00
ISSOtm
09f16bda4a
Use putc instead of fputc
...
Also rename some functions for consistency
2021-01-22 08:32:28 +01:00
ISSOtm
41d544a4eb
Rewrite RGBFIX
...
- Make it work inside pipelines
- Add RGBFIX tests to the suite
- Be more flexible in accepted MBC names
- Add warnings for dangerous or nonsensical input params
- Improve man page
2021-01-20 21:22:55 +01:00
Rangi
f28b4abafc
Fix a potential buffer overflow in strrpl
...
This caused an error using clang with -O3 -flto
2021-01-20 10:21:53 +01:00
ISSOtm
ca1c934629
Have CMake use specified compiler in CI, not system default
...
Otherwise it's just GCC on Linux and Clang on macOS...
2021-01-19 16:35:06 +01:00
Rangi
d5a00cf634
Comment cites the string hash algorithm (djb2)
...
"If you just want to have a good hash function,
and cannot wait, djb2 is one of the best string
hash functions I know."
2021-01-19 15:03:22 +01:00
Rangi
fb39c3a70e
Consistently refer to "directives", not "pseudo-ops"
...
Some docs and warnings already referred to SECTION and
db/dw/dl "directives", but others used "pseudo-ops".
2021-01-19 15:03:22 +01:00
ISSOtm
15ec6efc28
Fix missing newline in charmap override warning
2021-01-17 20:13:51 +01:00
Rangi
93d83e17dc
Don't override bison's internal 'yytnamerr' function
...
This is not used in all bison versions, which causes a
"defined but not used" warning for the 'rgbasm_yytnamerr'
replacement, treated as an error by 'make develop'.
2021-01-15 11:51:31 +01:00
Rangi
df16e64fc6
Handle MACRO and REPT/FOR bodies differently
...
Fixes #697
2021-01-15 02:16:37 +01:00
Rangi
a4ebb87858
Add Rangi to contributors
2021-01-14 18:36:10 +01:00
Rangi
5ef8e0a1f6
Use an IELR parser if available
2021-01-14 18:36:10 +01:00
Rangi
eb4952c188
Use more verbose syntax error messages
...
Fixes #385
2021-01-14 18:36:10 +01:00
ISSOtm
57b734a7df
Reinstate RL into the _RS family
...
Removal of colon-less labels lifted the grammar ambiguity that
prevented `RL` from being usable as a variable declarator.
Thus, reinstate its functionality.
2021-01-11 01:38:03 +01:00
ISSOtm
5be1c0da62
Fix intra-section ALIGN not computing offset correctly
2021-01-09 23:29:08 +01:00
ISSOtm
b598911e96
Enable LTO in release builds
...
Fixes #693
2021-01-09 20:31:15 +01:00
Rangi
cab9cb06a3
Store IF depth relative to each fstack context
...
This disallows starting/ending an IF inside an
INCLUDEd file or a macro expansion
2021-01-09 20:12:14 +01:00
Rangi
62bea23c49
Implement BREAK to exit REPT and FOR loops
...
Fixes #684
2021-01-08 21:13:23 +01:00
Rangi
7ce5cf1595
Convert floating to fixed point by rounding, not truncation
...
Fixes #678
2021-01-04 21:23:43 +01:00
Rangi
7e3fc1db03
Fix Actions CI for MSVC
...
Fixes #616
2021-01-04 02:01:25 +01:00
Rangi
77279984a5
Implement STRRPL
...
Fixes #660
STRRPL(str, "", new) does nothing
(warn about it with -Wempty-strrpl)
2021-01-04 00:20:35 +01:00
Rangi
669a392fcd
Revise the rgbasm(5) docs
2021-01-02 08:29:57 +01:00
ISSOtm
51ce0b038a
Remove removed features from documentation
2021-01-02 02:47:13 +01:00
ISSOtm
bd244e6865
Remove deprecated features
...
Trimming off the fat!
- GLOBAL and XDEF keywords
- Colon-less global labels
- *-comments
2021-01-02 02:42:44 +01:00
Rangi
a70ecba06f
Implement PRINT and PRINTLN ( #672 )
...
Fixes #669
Closes #368
Closes #624
Deprecate PRINTT, PRINTV, PRINTI, and PRINTF
Default STRFMT("%f") to 5 fractional digits like "{f:}"
Any use of string formatting will share this default
2021-01-02 02:37:32 +01:00
Rangi
9d2d5cfcfe
Implement REDEF to allow redefining EQUS string equates
...
Fixes #677
2021-01-02 01:49:00 +01:00
ISSOtm
18f3c8ff9a
Un-document deprecated _PI
2021-01-02 01:43:49 +01:00
Rangi
895ec5564d
Update mathematical functions ( #675 )
...
Document the existing `ROUND`, `CEIL`, and `FLOOR` functions
Also update the trig function docs for searchability
Implement `POW` and `LOG`
Addresses part of #675
Implement ** for integer exponents
** has higher precedence than -, like Python, so -3**4 == -(3**4) == 81
2021-01-02 01:39:20 +01:00
Rangi
7bb6f71f0b
Change FOREACH to FOR ( #680 )
2021-01-02 00:46:26 +01:00
Rangi
10e3f1a02b
Deprecate built-in _PI
...
Fixes #670
2021-01-01 19:18:17 +01:00
Rangi
2a9d52871b
Make dbgPrint in lexer.c report the correct colNo ( #676 )
...
Fixes #656
2021-01-01 18:44:47 +01:00
ISSOtm
c4fb5591ee
Fix size of unterminated REPT/FOREACH blocks
...
Do not "uncapture" ENDR if it was not read in the first place
2020-12-30 15:52:24 +01:00
Rangi
c0ce1da4c3
Implement STRFMT and more printf-like format specifiers for string interpolation ( #646 )
...
Fixes #570
Fixes #178
Use errors for inapplicable format spec flags instead of -Wstring-format
2020-12-29 22:53:15 +01:00
ISSOtm
aa27e714d4
Make Bison version detection more portable
...
- POSIX sh actually does NOT support `+=`,
but Bash does even in compatibility mode
- `mawk` does not fully support POSIX EREs (regexes),
so work around its lack of brace support
Fixes building on Debian, apparently.
2020-12-29 22:31:15 +01:00
Rangi
6874f694e5
Implement FOREACH ( #658 )
...
This acts like `REPT` with a variable automatically
incremented across a range of values
Fixes #432
2020-12-29 21:30:42 +01:00
Rangi
3690546795
make checkpatch and make checkcodebase check the same files
...
Only check src and include (not test), and
exclude src/extern and include/extern.
2020-12-29 20:27:00 +01:00
ISSOtm
7bc42d468b
Clean up temp test files even if interrupted
...
Avoids "tmp.*" piling up in /tmp
2020-12-26 14:38:04 +01:00
ISSOtm
097999cad3
Prevent tests from running if RGBDS hasn't been built
...
Prevents a *lot* of spurious errors due to files not generating
2020-12-26 14:26:50 +01:00
ISSOtm
f82edaa7ec
Make gbdiff.bash handle CRLF sym files gracefully
...
Additionally, reduce the amount of lines piped through `cut`,
improving performance
2020-12-26 02:47:04 +01:00
ISSOtm
d8e8b796e7
Update tested projects to latest commits
...
Compatibility fixes, etc.
2020-12-26 02:02:38 +01:00
ISSOtm
900fd8cabc
Improve gbdiff script
...
Use better constructs where possible
- <<< instead of echo|
- Parameter expansions instead of `cut`
- Etc.
Improves performance and reliability somewhat
Also, accept "d" between diff line info parts
2020-12-26 01:44:45 +01:00
ISSOtm
c20ac35074
Refactor readString
...
Much more readable, and avoids `peek(nz)`
2020-12-19 13:02:05 +01:00
Rangi
255b8bf9ba
Implement """triple-quoted""" multi-line strings
...
Fixes #589
2020-12-19 12:34:32 +01:00
Rangi
ad6f17cd93
Support SOURCE_DATE_EPOCH for reproducible builds
...
See https://reproducible-builds.org/docs/source-date-epoch/
Fixes #286
2020-12-19 01:09:45 +01:00
Rangi
063a22ddf9
LOAD blocks cannot create a ROM section
...
Fixes #576
2020-12-19 00:58:54 +01:00
Rangi
1d9cc01ae1
Macro arguments within a string literal are read into the string, not expanded
...
Fixes #643
2020-12-15 21:28:15 +01:00
Rangi
f31deb5010
Fix STRUPR and STRLWR after 5aabb915ec
...
Fixes #647
2020-12-15 20:18:45 +01:00
Rangi
0956d300c4
Document \#
2020-12-14 10:48:03 +01:00
ISSOtm
4ef490f3cb
Avoid interpreting Liquid in doc pages
...
They are auto-generated, so they wouldn't normally contain Liquid
(The post-processor may insert some, but it has control over the `raw` tags)
Some code introduced as examples contains `{{` due to nested brace expansions,
which was interpreted as (invalid) Liquid. This fixes such problems.
Additionally, Jekyll generates warnings about excerpts being part of a Liquid
block (the `{% raw %}`). This is fine, since doc pages don't use excerpts.
2020-12-14 10:35:30 +01:00
ISSOtm
8f2a894b88
Add anonymous labels
...
Fix #497
2020-12-14 10:14:40 +01:00
Rangi
0e40543757
Implement \# to expand to all unshifted macro arguments
...
Fixes #596
2020-12-14 00:12:36 +01:00
Rangi
ce58f6d6be
Allow {symbol} interpolation outside of strings
...
Fixes #629
Closes #631
2020-12-13 23:53:16 +01:00
ISSOtm
5aabb915ec
Allow STRCAT to take any number of args
...
Fixes bullet point 1 of #625
2020-12-12 23:46:32 +01:00
ISSOtm
0d9de01f9d
Make charmap-converting a non-UTF8 string non-fatal
2020-12-12 14:16:50 +01:00
ISSOtm
f5b0eae9cd
Remove custom action code when equivalent to default
...
Enables Bison to better reason about it, and should improve performance
2020-12-12 12:22:36 +01:00
Rangi
e6552064bf
Specify rgbfix --mbc-type by name
...
This supports the names listed in Pan Docs:
https://gbdev.io/pandocs/#_0147-cartridge-type
Spaces may be replaced with underscores.
It also supports "ROM" for "ROM ONLY".
2020-12-12 01:53:42 +01:00
Rangi
861cb552c4
discardBlockComment sets lexerState->disableMacroArgs = true, like discardComment
2020-12-12 01:34:01 +01:00
ISSOtm
417cceb0de
Document dw and dl with strings
2020-12-11 11:02:20 +01:00
Rangi
165bd8cb71
Allow 'dw' and 'dl' to apply to characters of strings
...
Fixes #568
The old behavior of `dw "string"` can be replicated with `dw ("string")`; likewise for dl
2020-12-11 11:02:20 +01:00
ISSOtm
e54e02dc77
Correct underscore-in-number documentation
...
No radix actually allows underscores at the beginning of a literal
2020-12-10 16:01:18 +01:00
ISSOtm
2bf3b08d76
Document underscores in numeric literals
2020-12-10 15:40:59 +01:00
ISSOtm
21b58b08b8
Fix not shifting CRLF at end of raw lines
...
Fixes line reporting errors on Windows
2020-12-10 15:37:50 +01:00
Rangi
af530859f0
Allow underscores in numeric literals
...
Fixes #539
Changes \@'s output to start with "_u", not "_", so it will be valid within labels but not numerics
2020-12-10 15:34:21 +01:00
Rangi
58739b0bf2
Implement STRRIN, like STRIN but searching from the right
2020-12-10 15:32:17 +01:00
ISSOtm
3e4c2fe712
Avoid error with old Bison versions
...
`api.token.raw` is only defined starting with Bison 3.5
Since it's not essential, define it on the command-line iff the Bison
version is sufficient.
2020-12-10 15:13:45 +01:00
ISSOtm
bdfce25db0
Avoid running version test when git describe fails
...
Can happen when not enough history has been fetched, notably in our CI
2020-12-10 13:43:22 +01:00
ISSOtm
2b6d9cd1e0
Avoid using yytoken_kind_t
...
Apparently it was added in a fairly recent Bison version...
2020-12-10 13:32:18 +01:00
ISSOtm
bf789dd7b3
Add automated test for version consistency
...
Automatically check that the version number constants
(__RGBDS_MAJOR__ etc.) match `rgbasm -V`
Should avoid the problem with 0.4.2's release...
2020-12-10 12:22:29 +01:00
ISSOtm
9b6f01047c
Enable raw token types
...
Removes one layer of indirection for the parser, and helps remove all literals from the grammar
The latter preparing the next change
2020-12-09 21:22:05 +01:00
ISSOtm
3fe2fa43bb
Switch to GNU Bison as a dependency
...
First step for #595
2020-12-09 20:30:31 +01:00
ISSOtm
ede982b50a
Bump patch level appropriately
...
*HEADDESK*
2020-12-09 20:30:31 +01:00
ISSOtm
319d775c13
Add CI script to create docs on new releases
2020-12-09 16:08:43 +01:00
ISSOtm
44124319a6
Work around old Bison versions not forward-declaring yyparse
...
Notably, macOS still ships 2.3 (from 2008)...
Should fix #214
2020-12-09 16:00:22 +01:00
ISSOtm
462fd7539c
Prohibit nested macros
...
After discussion (starting there:
https://github.com/gbdev/rgbds/pull/594#issuecomment-706437458
), it was decided that plain nested macros should not be
allowed.
Since #590 is fixed, EQUS can be used as a workaround;
multiline strings (#589 ) will make that easier on the
user when implemented.
Fixes #588 , supersedes and closes #594 .
Additionally, closes #388 .
2020-12-09 10:44:39 +01:00
ISSOtm
f16e34b804
Fix captures beginning in expansions
...
Fixes #590
2020-12-09 09:54:55 +01:00
ISSOtm
c3ccdc548e
Remove unnecessary flex dep from Dockerfile
2020-12-09 09:42:19 +01:00
ISSOtm
fd721ca480
Document optional RB/RW/RL argument
2020-12-09 09:39:46 +01:00
ISSOtm
eac365aef0
Allow argument to rb, rw and rl to be optional
...
Fixes #617
2020-12-09 09:31:47 +01:00
ISSOtm
4de6266442
Add explanation of how EXPORT works
...
Fixes #608
2020-12-08 21:07:24 +01:00
ISSOtm
213d985e17
Fix incorrect "sliced" INCBIN causing memory leaks
...
Oh, how I miss RAII...
2020-11-29 12:47:53 +01:00
ISSOtm
de76dcb8fb
Fix possible segfault from -MT and -MQ
...
Happened only if `malloc` failed, so...
2020-11-29 12:47:53 +01:00
Eldred Habert
30fb6bde5e
Merge pull request #615 from ISSOtm/find-sym
...
Create specialized symbol finder functions
2020-11-25 15:17:34 +01:00
ISSOtm
4f842a1248
Create specialized symbol finder functions
...
The old "find symbol with auto scope" function is now three:
- One finds the exact name passed to it, skipping any checks
This is useful e.g. if such checks were already performed.
- One checks that the name is not scoped, and calls the first.
This is useful for names that cannot be scoped, such as checking for EQUS.
Doing this instead of the third should improve performance somehwat, since
this specific case is hit by the lexer each time an identifier is read.
- The last one checks if the name should be expanded (`.loc` → `Glob.loc`),
and that the local part is not scoped. This is essentially the old function.
2020-11-21 01:06:17 +01:00
ISSOtm
cc4d455b8a
Add test for empty local label component
2020-11-21 00:58:40 +01:00
Eldred Habert
0bb5efebfd
Merge pull request #610 from daid/stdin
...
Allow rgbasm and rgblink to use stdout and stdin as input and output
2020-11-08 01:20:44 +01:00
ISSOtm
b6bf7ae620
Fix RGBLINK incorrectly reading file stack nodes
...
This caused node IDs to mismatch, yielding possibly corrupted file stacks
Worst part is, the docs mentioned the reading order had to be reversed...
2020-11-04 02:52:06 +01:00
ISSOtm
dc96cc6d1e
Add zsh completion scripts
...
Can't get bash ones to work, but these do.
2020-11-03 23:29:47 +01:00
daid
642daf1a76
Update main.c
2020-11-03 13:33:57 +01:00
daid
84edfb3d88
Update output.c
2020-11-03 13:33:02 +01:00
Daid
7e620bff81
Allow rgbasm and rgblink to use stdout and stdin as input and output
2020-10-26 20:28:15 +01:00
ISSOtm
0c55703438
Improve helpers.h
...
Use C11 standard _Noreturn instead of attributes (except, of course, MSVC)
Remove unused helpers
Avoid trapping in release builds, in favor of just unreachability
Improve shim when __builtin_* are not available
2020-10-26 15:19:31 +01:00
ISSOtm
6c57ad2226
Have make clean delete parser artifacts
...
Forgot to update the names there
2020-10-25 16:26:58 +01:00
ISSOtm
9028fb5391
Fix mistakes in RGBDS man pages
...
As reported by `mandoc -Wall`
2020-10-23 01:02:59 +02:00
ISSOtm
12dc49b60a
Make page processor print usage only after reporting all bad opts
2020-10-23 00:40:05 +02:00
Eldred Habert
7e1d20acdf
Merge pull request #607 from anderoonies/inline-comment-#537
...
handle inline c-like comments in lexer
2020-10-19 19:36:49 +02:00
anderoonies
5230104852
documentation for block comments
2020-10-19 18:05:37 +02:00
anderoonies
55be77be69
discard block comments delimited with /* */
2020-10-15 12:42:53 -04:00
Eldred Habert
42b3a17356
Merge pull request #602 from NieDzejkob/shiftstorm
...
Report only one error when invalid shift has argument
2020-10-13 15:48:16 +02:00
Jakub Kądziołka
4e1d79081c
Improve error message for negative shift arguments
2020-10-13 15:42:16 +02:00
ISSOtm
4ce4fdec71
Mention setting CMAKE_BUILD_TYPE to Release when using CMake
...
Not *necessary*, but if you don't know better, you should probably use it.
Fixes rgbds-www#9
2020-10-13 11:37:25 +02:00
Eldred Habert
05256946ac
Merge pull request #604 from NieDzejkob/narg-overwrite
...
Don't overwrite symbol when it's not allowed
2020-10-13 10:47:57 +02:00
Eldred Habert
73396166aa
Merge pull request #605 from NieDzejkob/invalid-labels
...
Don't consider difference of invalid labels constant
2020-10-13 10:42:05 +02:00
Jakub Kądziołka
4c5d5c7085
Don't consider difference of invalid labels constant
...
If a label is defined outside of a section, avoid trying to obtain its
value.
2020-10-12 23:03:14 +02:00
Jakub Kądziołka
045a9e8b93
Report only one error when invalid shift has argument
...
Not to mention that incrementing a variable in a loop is kinda dumb.
2020-10-12 22:54:20 +02:00
Jakub Kądziołka
4419f0d54f
remove dead function: sym_GetDefinedValue
2020-10-12 13:31:21 +02:00
Jakub Kądziołka
b07aa00d5c
Don't overwrite symbol when it's not allowed
...
When a user tried to overwrite a builtin symbol, it would change its
type despite the error, making the second try succeed. This is
problematic, as the location of a builtin symbol cannot be updated.
2020-10-12 12:35:49 +02:00
Eldred Habert
e4f5df1306
Merge pull request #603 from NieDzejkob/rpn-realloc
...
reserveSpace: don't assume one doubling is enough
2020-10-12 12:26:44 +02:00
Jakub Kądziołka
dc62d60e9b
reserveSpace: don't assume one doubling is enough
2020-10-12 11:57:03 +02:00
ISSOtm
71d8aeb4c2
Add CMake defines to enable tracing lexer and parser
2020-10-12 09:02:21 +02:00
Eldred Habert
0836f67d42
Merge pull request #601 from NieDzejkob/utf8decoder
...
utf8decoder: Use byte-sized byte argument
2020-10-12 01:49:57 +02:00
Eldred Habert
176a57a1e9
Merge pull request #600 from NieDzejkob/stray-shift
...
Report error when shifting outside a macro
2020-10-12 01:44:10 +02:00
Eldred Habert
0d02355dbf
Merge pull request #599 from NieDzejkob/stray-align
...
Report error when aligning outside of a section
2020-10-12 01:43:35 +02:00
Jakub Kądziołka
6767d11c23
utf8decoder: Use byte-sized byte argument
...
This prevents passing a negative value out of a signed char by accident.
Also renders some casts in the code superfluous.
2020-10-12 01:22:09 +02:00
ISSOtm
2dd9015dc6
Remove two stale variables from parser.y
...
They were made useless with the lexer rewrite
2020-10-12 00:52:12 +02:00
Jakub Kądziołka
217c10ddac
Report error when shifting outside a macro
2020-10-12 00:47:01 +02:00
Jakub Kądziołka
822e4e7c44
Report error when aligning outside of a section
2020-10-12 00:27:54 +02:00
ISSOtm
0b1d01792d
Indicate cur offset in linkerscript "backwards org" message
2020-10-12 00:04:08 +02:00
ISSOtm
01637768cf
Rename asmy to more explicit parser
...
This should make the purpose of that file clearer to newcomers
2020-10-11 21:03:41 +02:00
ISSOtm
6a8ae643d5
Mention that SHIFT updates _NARG
...
Fixes #598
2020-10-11 02:13:30 +02:00
ISSOtm
fd83d46ba0
Enable master docs update workflow always
...
There seems to be no way to make the check work, and Actions are disabled
in forks by default anyways.
2020-10-11 02:04:09 +02:00
ISSOtm
914856342c
Fix incorrect documentation of accepted sym names
...
No, they cannot start with a digit!
2020-10-11 01:57:27 +02:00
Eldred Habert
91889fc14a
Merge pull request #593 from Rangi42/issue586
...
Fix #586 : Update the `charmaps` hashmap when an existing charmap is resized
2020-10-10 02:15:04 +02:00
Rangi
7c8ec5a5ed
Add a test case for charmaps that segfaults prior to this fix
2020-10-09 20:06:02 -04:00
Rangi
effc6788eb
Fix #586 segfault: Update the charmaps hashmap when an existing charmap is resized
2020-10-07 13:21:13 -04:00
Eldred Habert
f9daf27511
Merge pull request #585 from ISSOtm/msvc-ci
...
Add MSVC in CI
2020-10-06 17:48:13 +02:00
ISSOtm
06f7387466
Avoid using VLA in EQUS dumping
...
MSVC does not support those...
Also add a `develop` warning about VLAs, to avoid future incidents
2020-10-06 08:55:45 +02:00
ISSOtm
21e50eeff1
Have lexer not require <unistd.h> on MSVC
...
Required for `open`, `close`, `read`, and `STDIN_FILENO`,
which are defined elsewhere on MSVC.
2020-10-06 08:55:45 +02:00
ISSOtm
fd4cec93cd
Compile with MSVC as well in CI
2020-10-06 08:55:41 +02:00
ISSOtm
92f2055a6c
Fix implicit cast between enums
...
This caused `make develop` to fail
2020-10-05 01:53:54 +02:00
Eldred Habert
be9b1198e9
Merge pull request #584 from Xeyler/master
...
Add directory summary to README.rst
2020-10-04 20:20:08 +02:00
Brigham Campbell
56bea083f9
Add directory summary to README.rst
2020-10-04 12:04:59 -06:00
Eldred Habert
fdfc02ab96
Merge pull request #583 from JL2210/cmake-build-type
...
Modularize CMake build configuration
2020-10-04 19:45:20 +02:00
Eldred Habert
fc7f042ad6
Merge pull request #551 from NieDzejkob/errors-after-unknown-symbol
...
link: Suppress cascading errors.
2020-10-04 19:43:38 +02:00
James Larrowe
761c775043
Modularize CMake build configuration
...
Build type no longer defaults to Release (!)
have separate options for extra warning flags and sanitizers
toss DEVELOP macro
Fix sanitizers with CMake while I'm at it :|
2020-10-04 13:28:00 -04:00
Jakub Kądziołka
b421c983d6
link: Suppress cascading errors.
2020-10-04 18:14:22 +02:00
Eldred Habert
3036b58598
Merge pull request #557 from ISSOtm/new-lexer-electric-boogaloo
...
New lexer 2 — Electric Boogaloo
2020-10-04 16:45:47 +02:00
ISSOtm
2eca43cd2d
Fix critical oversight in lexer buffer refilling
...
Since the lexer buffer wraps, the refilling gets handled in two steps:
First, iff the buffer would wrap, the buffer is refilled until its end.
Then, if more characters are requested, that amount is refilled too.
An important detail is that `read()` may not return as many characters as
requested; for this reason, the first step checks if its `read()` was
"full", and skips the second step otherwise.
This is also where a bug lied.
After a *lot* of trying, I eventually managed to reproduce the bug on an
OpenBSD VM, and after adding a couple of `assert`s in `peekInternal`, this
is what happened, starting at line 724:
0. `lexerState->nbChars` is 0, `lexerState->index` is 19;
1. We end up with `target` = 42, and `writeIndex` = 19;
2. 42 + 19 is greater than `LEXER_BUF_SIZE` (= 42), so the `if` is entered;
3. Within the first `readChars`, **`read` only returns 16 bytes**,
advancing `writeIndex` to 35 and `target` to 26;
4. Within the second `readChars`, a `read(26)` is issued, overflowing the
buffer.
The bug should be clear now: **the check at line 750 failed to work!** Why?
Because `readChars` modifies `writeIndex`.
The fix is simply to cache the number of characters expected, and use that.
2020-10-04 16:10:32 +02:00
ISSOtm
c24694233f
Fix incomplete duplication of REPT nodes
...
"Initialization, sizeof, and the assignment operator ignore the flexible array member."
Oops!
2020-10-04 04:46:01 +02:00
ISSOtm
423a7c4899
Handle \\r better
...
Translate it to \\n regardless of the lexer mode
2020-10-04 04:46:01 +02:00
ISSOtm
ee9e45b3d4
Change assertion condition in __FILE__ buf dumping
...
Removes a false positive from Clang static analysis
2020-10-04 04:46:01 +02:00
ISSOtm
5a65188ca9
Implement compact file stacks in object files
...
Gets rid of `open_memstream`, enabling Windows compatibility again
Also fixes #491 as a nice bonus!
2020-10-04 04:46:01 +02:00
ISSOtm
930080f556
Mark not unmapping macro-containing files as okay
...
There isn't really a better alternative.
Making several mappings instead requires too much bookkeeping.
2020-10-04 04:46:01 +02:00
ISSOtm
8e7afb0ab3
Move some MSVC-specific defines to platform.h
2020-10-04 04:46:01 +02:00
ISSOtm
138523570e
Fix possible uninitialized read on Windows
2020-10-04 04:46:01 +02:00
ISSOtm
82469ac0fd
Shim around mmap on Windows
2020-10-04 04:46:01 +02:00
ISSOtm
96cb5e10ed
Fix range-dependent dead code in recursion depth check
2020-10-04 04:46:01 +02:00
ISSOtm
b224cab3e0
Harmonize printing distance
2020-10-04 04:46:01 +02:00
ISSOtm
7381d7b92f
Remove unnecessarily nested symbol data union
2020-10-04 04:46:01 +02:00
ISSOtm
dbef51ba05
Move isWhitespace to a place where it makes more sense
2020-10-04 04:46:01 +02:00
ISSOtm
c952dd8a6e
Fix fixed-point constants not working correctly
...
And added a test to check their behavior
2020-10-04 04:46:01 +02:00
ISSOtm
b65ea64a58
Add newlines to all test output
...
MacOS treats them differently, for some reason.
2020-10-04 04:46:01 +02:00
ISSOtm
542b5d18f1
Fix possible capture buffer size overflow
...
Attempt to grow it to the max size first.
Seriously, if this triggers, *how*
2020-10-04 04:46:01 +02:00
ISSOtm
71a0a42cfb
Fix C2x use of static_assert
2020-10-04 04:46:01 +02:00
ISSOtm
ac011fe69f
Use common function to discard comments in macro args
2020-10-04 04:46:01 +02:00
ISSOtm
9e3d7a50e6
Handle comments in line continuations
2020-10-04 04:46:00 +02:00
ISSOtm
e33c2ad6a2
Fix INCLUDE ignoring -MG
2020-10-04 04:46:00 +02:00
ISSOtm
615f1072d9
Fix readFractionalPart never shifting characters
2020-10-04 04:46:00 +02:00
ISSOtm
f7b7a97407
Prevent expanding macro args in comments
...
Also use a cleaner way, instead of hardcoding to capture
2020-10-04 04:46:00 +02:00
ISSOtm
ece6853e0f
Implement opt b and opt g
2020-10-04 04:46:00 +02:00
ISSOtm
b7b03ee451
Fix "REPT 0" not being a no-op
2020-10-04 04:45:59 +02:00
ISSOtm
f9b48c0cad
Fix else working incorrectly from macros
...
Since the "skip ELSE blocks" variable is global, it used to get carried
over from the macro's `if` to the outer's.
2020-10-04 04:45:59 +02:00
ISSOtm
aa76603da9
Add line+col trace info to lexer
2020-10-04 04:45:59 +02:00
ISSOtm
b83b9825f8
Fix _NARG crashing outside of macros
...
And add a test for it
2020-10-04 04:45:59 +02:00
ISSOtm
d641972cde
Fix macro args not being restored when exiting macros
2020-10-04 04:45:59 +02:00
ISSOtm
4d1333e124
Fix incorrect error reporting of INCLUDEd files
2020-10-04 04:45:59 +02:00
ISSOtm
35396e6410
Fix files being unmapped when still referenced by macros
2020-10-04 04:45:59 +02:00
ISSOtm
8d18b39eee
Support missing register tokens
...
Made possible by #491
2020-10-04 04:45:59 +02:00
ISSOtm
ae77893021
Fix file name reporting
...
As noted in the function's code, this is very error-prone, but
will do the job; this needs rewriting due to #491 anyways, so, temporary.
2020-10-04 04:45:59 +02:00
ISSOtm
baeb180acd
Apply error reporting changes to tests
2020-10-04 04:45:58 +02:00
ISSOtm
fd02ffb7bd
Implement __FILE__ symbol
...
Also clean up built-in symbol creation
This is not great, but currently okay.
Should be fixed later, like the rest...
2020-10-04 04:45:58 +02:00
ISSOtm
62ecdce0b0
Fix line-continuation-macro test
2020-10-04 04:45:58 +02:00
ISSOtm
e4f2fad215
Support line continuations in main scope
2020-10-04 04:45:58 +02:00
ISSOtm
3f5f9bcaf0
Fix numeric constant overflow checks
2020-10-04 04:45:58 +02:00
ISSOtm
08867b3cec
Enable catching invalid macro arg 0
2020-10-04 04:45:55 +02:00
ISSOtm
9081feab51
Reinstate macro arg scan distance
...
Used to be broken, so it was removed, but doing so prevents escaping them.
So it was instead put back in, but with corrected behavior
2020-10-04 04:39:27 +02:00
ISSOtm
cf992164f7
Fix lexer capture sometimes not being reset
2020-10-04 04:39:27 +02:00
ISSOtm
b27b821e7f
Fix RAW lexer length underflow
...
Also added an assertion to check against more such overflows
2020-10-04 04:39:26 +02:00
ISSOtm
d9ecaabac1
Add debug tracing code to lexer
...
Hidden behind a #define, like YYDEBUG
2020-10-04 04:39:26 +02:00
ISSOtm
cd747d8175
Fix many lexer bugs
...
More to come...
2020-10-04 04:39:25 +02:00
ISSOtm
df75fd2ec2
Fix expansion reporting being incorrect
2020-10-04 04:38:53 +02:00
ISSOtm
adcaf4cd46
Fix crash when no macro args are being used
2020-10-04 04:38:53 +02:00
ISSOtm
81a77a9b88
Re-implement block copy to avoid expanding macro args
...
They were expanded during the capture, and there was no easy way to
avoid expanding them (believe me, after three hours and somehow an OOM, I
gave up trying).
2020-10-04 04:38:53 +02:00
ISSOtm
6e805cd318
Implement macro args
...
This finally allows running 90% of the test suite, debugging time!
2020-10-04 04:38:53 +02:00
ISSOtm
e11f25024e
Add test for built-in file symbol
...
It's currently defined in fstack.c, making it more prone to accidental
dropping. Let's not repeat the 0.3.9 scenario...
2020-10-04 04:38:53 +02:00
ISSOtm
7c895f8a1b
Fix diagnostic formatting
...
Missing colon and space after the file stack
2020-10-04 04:38:53 +02:00
ISSOtm
38bda7e1bb
Fix string expansion reporting
...
More expansions were allowed than the limit specified, and reporting code
did not account for the extra one that caused overflow
2020-10-04 04:38:52 +02:00
ISSOtm
149db9a022
Fix incorrect freeing of expansions
...
Freeing an expansion should free its children, not its siblings...
Fixes a use-after-free reported by scan-build. Nice catch!
2020-10-04 04:38:52 +02:00
ISSOtm
fed252bc49
Fix nested expansions being incorrectly handled
...
The biggest problem was simply that the length of children expansions was
not accounted for when skipping over the parent... this took a lot of
arduous debugging, but it finally works!
2020-10-04 04:38:52 +02:00
ISSOtm
61b2fd9816
Add string expansion reporting
...
And fix line counting with expansion-made newlines.
This has the same bug as the old lexer (equs-newline's output does not
print the second warning as being part of the expansion).
Additionally, we regress equs-recursion, as we are no longer able to
catch this specific EQUS recursion. Simply enough, the new expansion
begins **after** the old one ends! I have found no way to handle that.
2020-10-04 04:38:52 +02:00
ISSOtm
5ad7a93750
Add EQUS expansion
2020-10-04 04:38:52 +02:00
ISSOtm
2ec10012b6
Fix mmap read offset not being initialized
2020-10-04 04:38:52 +02:00
ISSOtm
e56c6cc291
Fix PC's name not being passed to parser
2020-10-04 04:38:52 +02:00
ISSOtm
4c9a929a14
Implement almost all functionality
...
Add keywords and identifiers
Add comments
Add number literals
Add strings
Add a lot of new tokens
Add (and clean up) IF etc.
Improve reporting of unexpected chars / garbage bytes
Fix bug with and improved error messages when failing to open file
Add verbose-level messages about how files are opened
Enforce that files finish with a newline
Fix chars returned not being cast to unsigned char (may conflict w/ EOF)
Return null path when no file is open, rather than crash
Unify and improve error printing slightly
Known to be missing: macro expansion, REPT blocks, EQUS expansions
2020-10-04 04:38:50 +02:00
ISSOtm
71f8871702
Implement more functionality
...
Macro arg detection, first emitted tokens, primitive (bad) column counting
2020-10-04 04:37:58 +02:00
ISSOtm
6dc4ce6599
Implement infrastructure around new lexer
...
The lexer itself is very much incomplete, but this is intended to be a
safe point to revert to should further implementation go south.
2020-10-04 04:37:58 +02:00
Eldred Habert
3a44cc7722
Merge pull request #582 from ISSOtm/rewrite-charmap
...
Rewrite charmap system
2020-10-04 04:37:06 +02:00
ISSOtm
4cfed3c98f
Rewrite charmap system
...
Avoid allocating a *ton* of data per charmap
Stop relying on uninitialized data in charmap nodes
Only initialize charmap nodes lazily
2020-10-04 04:31:10 +02:00
Eldred Habert
6af57ff026
Merge pull request #581 from JL2210/cmake-docs
...
Install manpages with CMake
2020-10-03 22:15:17 +02:00
ISSOtm
2e3db9d56a
Clean up label generation
...
Only check for localness when we already know we have a local
2020-10-03 21:33:30 +02:00
James Larrowe
f8d9fa87ed
Install manpages with CMake
2020-10-03 12:37:56 -04:00
ISSOtm
f53ad359a6
Remove whoami step from Windows CI
...
A carry-over from testing
2020-10-03 02:17:18 +02:00
ISSOtm
84de86beb5
Enable make develop on Ubuntu 20.04 CI as well
2020-10-03 01:05:09 +02:00
Eldred Habert
04e7af2675
Merge pull request #579 from ISSOtm/cmake-ci
...
Enable CMake in CI
2020-10-02 23:30:26 +02:00
Eldred Habert
4f13a336b9
Merge pull request #578 from JL2210/cmake-pkgconfig
...
Use pkg-config to detect libpng
2020-10-02 22:30:30 +02:00
ISSOtm
03508119e5
Use CMake in CI as well
2020-10-02 22:24:02 +02:00
James Larrowe
03e20138d3
Use pkg-config to detect libpng
...
Only fall back to findpng
2020-10-01 18:58:36 -04:00
Antonio Niño Díaz
dfcba36448
test: Update commit of uCity used for testing
...
This one updates the code to fix all warnings introduced in the last few
months because of updates to RGBDS.
2020-09-27 22:47:56 +01:00
ISSOtm
8e4a9a5c21
Remove assertions from release builds
...
I believe the CMakeLists already did that, but the Makefile did not.
2020-09-27 17:05:52 +02:00
ISSOtm
a1286e6f0e
Make newlines explicit in error messages
...
In preparation for a change a PR is about to make
2020-09-27 10:54:06 +02:00
ISSOtm
c0808246e5
Silence the mingw test
...
Use "quiet" instead of "count"...
2020-09-27 10:51:52 +02:00
ISSOtm
ba051e10fb
Factor printing assert failures into functions
...
Saves some code duplication
2020-09-27 09:24:24 +02:00
ISSOtm
9fee0603b1
Fix typo in object file format doc
...
Thanks @ax6!
2020-09-24 16:43:13 +02:00
ISSOtm
be8ebe6db9
Fix master docs update CI script
...
GitHub documentation about the syntax is unclear, this should be right
according to the examples I saw.
2020-09-24 16:41:23 +02:00
ISSOtm
548e3dc31c
Correct previously-introduced test being a no-op
...
Forgot to invoke the macro due to a copy-paste error
2020-09-24 16:35:45 +02:00
ISSOtm
9440086d77
Add a test for purging a macro while running
...
This could cause a crash if the macro name is then used for error reporting
2020-09-24 16:14:18 +02:00
ISSOtm
ec5a1bc71f
Fix incorrect obj file documentation
...
Bit 7 of section types was actually documented in the symbol type
Bit 6 of section types was not documented at all
2020-09-24 10:26:02 +02:00
ISSOtm
9742fa731c
Run the quote in file name except on Windows
...
This should make the CI function again
2020-09-22 18:13:26 +02:00
ISSOtm
91a3c538d9
Enable running regression tests on PRs as well
2020-09-22 17:27:29 +02:00
ISSOtm
e98485da3f
Make code style errors fail their CI job
...
Mimics the behavior of the old Travis script
2020-09-22 02:59:38 +02:00
ISSOtm
6528a955fe
Fix checkpatch in CI
2020-09-22 02:44:24 +02:00
ISSOtm
431f77127e
Also update master docs when updating script
2020-09-22 01:05:49 +02:00
ISSOtm
2cc58723cb
Do not try updating docs if no key is set
...
This will avoid this randomly failing in forks, unless we want to run it
2020-09-22 00:56:14 +02:00
ISSOtm
268219d74e
Avoid warning about /* fallthrough */ comments
...
We do not have `fallthrough;`, so...
2020-09-21 17:46:44 +02:00
ISSOtm
d09ed3e52e
Get rid of flex as a dependency in CMakeLists
...
It will actually not be needed for new lexer
2020-09-20 03:39:53 +02:00
ISSOtm
421d1f5490
Add regression test for #546
...
Check for quotes in `__FILE__`
2020-09-20 00:44:29 +02:00
ISSOtm
66784b7122
Fix documentation not mentioning SECTION FRAGMENTsyntax
2020-09-20 00:06:51 +02:00
ISSOtm
54f2d99ce7
Apply two minor fixes to rgbasm(5)
...
Mustn't → must not
Add a comma to INCBIN sentence to mirror INCLUDE's
2020-09-17 20:45:58 +02:00
ISSOtm
557c799ec9
Update README to point to online install instructions
2020-09-17 03:47:55 +02:00
ISSOtm
d22a667095
Update help text to redirect to new online docs
2020-09-17 03:10:02 +02:00
ISSOtm
30085a5342
Update documentation link in README
2020-09-16 15:52:36 +02:00
ISSOtm
304e6c4279
Sync redirect page generation with site
2020-09-16 06:25:46 +02:00
ISSOtm
12458aae6f
Fix permalinks of index pages
2020-09-16 06:04:38 +02:00
ISSOtm
7e5d9683b1
Use mandoc 1.14.5 in CI
...
This is the version that added -Otoc
2020-09-15 19:24:25 +02:00
ISSOtm
210a4a957a
Get rid of in-repo HTML documentation
...
The online documentation is now managed by a CI hook
2020-09-15 18:39:22 +02:00
ISSOtm
131ad9b315
Fix GitHub link in BUGS sections
2020-09-15 18:35:04 +02:00
ISSOtm
06b4cf57ab
Fix example arguments to -MT appearing as options
2020-09-15 18:32:13 +02:00
ISSOtm
dbefdc923a
Clean up doc post-processor
...
Description blurb is already inline from new stylesheet
`Xr` links are already handled by `mandoc` now
Handle spaces between both dashes in long options
Remove `<head>` modifications, as fragments are generated instead
2020-09-15 18:30:40 +02:00
ISSOtm
37e45de9c1
Improve rendering of pages
...
Make links to other man pages work
Add a table of contents to rgbasm(5)
Make the OS at the bottom of all pages 'Linux'
Apply post-processor that used to be used
2020-09-15 18:27:55 +02:00
ISSOtm
5e63527190
Update repo link at bottom of all man pages
2020-09-15 16:00:17 +02:00
ISSOtm
0cc9026978
Fix docs update action
...
Make script executable (facepalm)
Fix `run**s**-on` typo
Add key using ssh-agent
Force using SSH for pushing back
2020-09-15 15:57:20 +02:00
ISSOtm
bb6a5441ed
Update RGBDS history to mention org move
2020-09-15 15:02:26 +02:00
ISSOtm
0ffda1bf29
Add CI Action to update man pages from master
2020-09-15 15:00:07 +02:00
Antonio Vivace
56b5f77dc8
Mention the new website, add notice about the movement to the gbdev org
2020-09-15 14:01:38 +02:00
Antonio Vivace
6eb284f99e
Update README.rst
2020-09-15 13:53:22 +02:00
Marco Spataro
34c2288fd0
Fix __FILE__ when filename contains quotes
2020-09-10 12:49:04 +02:00
ISSOtm
304bb9f902
Remove most Hungarian notation in section module
...
Seriously, it sucks.
2020-09-06 20:43:13 +02:00
ISSOtm
14be01880d
Move UNION code inside section.c
...
Improves organization and locality
2020-09-06 19:18:10 +02:00
ISSOtm
12b7cf3cd4
Move curOffset into section code
...
Improves organization
2020-09-06 18:50:19 +02:00
ISSOtm
0d7914bff7
Fix asm/charmap.h not including required header
2020-09-06 17:16:49 +02:00
ISSOtm
d2285953d7
Fix test missed by last PR
...
We need to fix CI
2020-09-03 14:28:28 +02:00
Eldred Habert
d2801505c3
Merge pull request #562 from Rangi42/strsub-0
...
Resolve #554 : STRSUB("<N-char string>", N, 0) will not warn "Position N is past the end of the string"
2020-09-03 12:12:03 +02:00
ISSOtm
9d62b4b9bb
Fix bugs with LOAD section size
...
LOAD blocks did not properly update their parent's size until after closed
Additionally, section size wasn't correctly sanitized inside LOAD blocks
2020-09-03 12:07:12 +02:00
Rangi
b65b723fa6
Resolve #554 : STRSUB("<N-char string>", N, 0) will not warn "Position N is past the end of the string"
2020-08-31 15:40:25 -04:00
ISSOtm
e05321356b
Fix truncation warning when adding charmap mapping
...
It used to warn when mapping negative values
2020-08-31 21:33:53 +02:00
ISSOtm
0778959e98
Remove arbitrary limits on charmap
...
They were made irrelevant when switching to a trie
2020-08-31 21:26:21 +02:00
Eldred Habert
76331d1c4a
Merge pull request #552 from mattcurrie/incbin-length-optional
...
Make INCBIN's length argument optional
2020-08-23 00:11:54 +02:00
Eldred Habert
9e378ec5cf
Bump license year
...
I feel like there's a 20xx joke to be made here...
2020-08-20 23:02:25 +02:00
ISSOtm
f57d33b17a
Update subprojects in test suite
...
Especially necessary for the "new lexer" branch
2020-08-18 16:40:41 +02:00
Matt Currie
c389e8dccb
Fix typo
...
'arugment' => 'argument'
2020-08-17 13:57:58 +12:00
Matt Currie
90c64a94d1
Revert change to rgbasm.5.html
...
Will be rebuilt upon release
2020-08-17 13:56:29 +12:00
Eldred Habert
df27af6d1c
Merge pull request #553 from JL2210/cmake-develop
...
Add DEVELOP option to CMake
2020-08-16 22:12:47 +02:00
James Larrowe
c85b48f23e
Default to debug when building in develop mode
2020-08-16 13:58:02 -04:00
James Larrowe
5a9f2b7750
Add DEVELOP option to CMake
...
This requires CMake 3.0 so -Werror won't conflict with link tests.
Remove all version checks to improve simplicity.
2020-08-16 13:23:29 -04:00
ISSOtm
fcfecc6e82
Improve description of @ symbol
...
As requested by someone on GBDev
2020-08-15 15:23:11 +02:00
Matt Currie
f863a927c1
Make INCBIN's length argument optional
...
INCBIN can now be used with just a start position to include everything
from the start position until the end of the file.
2020-08-15 17:24:11 +12:00
Eldred Habert
cb4fbdfcd5
Merge pull request #550 from rednex/an/array
...
Refactor warning array for clarity
2020-08-05 10:53:21 +02:00
Eldred Habert
c6eacde55e
Merge pull request #544 from ISSOtm/atomic_ind
...
Split register-indirect tokens
2020-08-05 10:52:18 +02:00
Antonio Niño Díaz
daf780c7e6
Refactor warning array for clarity
2020-08-04 22:28:56 +01:00
Eldred Habert
613305d234
Add checkpatch link in README
2020-07-31 16:07:00 +02:00
ISSOtm
656432301d
Run as many CI jobs as possible when one fails
...
The other matrixes should not have this problem, so only touch unix testing
2020-07-27 18:34:32 +02:00
ISSOtm
38a80f2816
Fix test failing on OS-dependent trailing newline
2020-07-27 18:30:12 +02:00
ISSOtm
6563133426
Avoid using echo -e in tests
2020-07-27 18:26:05 +02:00
ISSOtm
762474d3ac
Let RGBASM write JR offsets in floating sections
...
This requires some special-casing for `jr @` because the `jr` opcode has
already been emitted, but not the operand, so PC points to the middle.
Moved the RGBLINK test to RGBASM's folder, and created a new RGBLINK test.
2020-07-27 18:17:29 +02:00
ISSOtm
b1adbcc77c
Output a non-empty RPN buffer from known expressions
...
The code expected to never get "known" expressions passed in, as RGBASM
otherwise patches the bytes in by itself; however, JR cannot be patched in
by RGBASM unless the section's base address is known as well!
2020-07-27 17:43:31 +02:00
Eldred Habert
dda052da20
Merge pull request #545 from JL2210/consistent-versions
...
Use versioning consistent with the Makefile in CMake
2020-07-26 19:16:27 +02:00
James Larrowe
2d6bdbc1b1
Use versioning consistent with the Makefile in CMake
...
This uses git to determine the dirty version and uses a fallback
if that's not available.
2020-07-23 10:47:01 -04:00
ISSOtm
0600856167
Move incbin slice sign check
...
The grammar's message is pretty generic, so this one is more useful.
2020-07-23 01:06:28 +02:00
ISSOtm
ce47b57b03
Document version string fallback in Makefile
...
For a packager just looking at the Makefile, it's not obvious that there
is one...
2020-07-22 16:21:58 +02:00
ISSOtm
f3c916ab96
Allow env vars to override default CFLAGS etc.
...
Should make the work easier for downstream packagers
2020-07-22 16:21:21 +02:00
ISSOtm
ca6fa6d1d7
Split register-indirect tokens
...
This allows whitespace between the brackets and the register.
This also fixes #531
Note that `$ff00 + c` is still treated as a single token, because trying to
use an expression on the left side causes a shift/reduce conflict.
This isn't great, but most people seem to be either used to it as-is, or
using the new `ldh a, [c]` syntax.
If this causes problems with a lexer rewrite, it'll be deprecated; but for
now, keep it around, as the support is clunky but bearable.
2020-07-22 15:00:39 +02:00
ISSOtm
fcd37b52b6
Update pret projects to latest commits
...
Behind pokecrystal by 123, behind pokered by 172
2020-07-22 00:29:38 +02:00
ISSOtm
8c0adb63a1
Sync release version in CMakeLists
2020-07-21 23:54:36 +02:00
ISSOtm
f5b0c701a6
Add install hint to CMakeLists
2020-07-21 23:41:56 +02:00
ISSOtm
874bd92604
Only require libpng 1.2 in CMakeLists
...
This version is sufficient for rgbgfx to function properly, according to testing.
The security problems are not ours to decide, however!
2020-07-21 23:23:52 +02:00
ISSOtm
69a8c62863
Add install directives to CMakeLists
...
Otherwise `make install` or `cmake --install` does not work
2020-07-21 23:17:33 +02:00
ISSOtm
5481af5093
Release 0.4.1
2020-07-21 23:11:06 +02:00
ISSOtm
6355d0598b
Regenerate docs for 0.4.1
2020-07-21 23:10:14 +02:00
Eldred Habert
1145d10996
Merge pull request #543 from ISSOtm/ubuntu20
...
Add Ubuntu 20.04 to CI
2020-07-21 22:24:28 +02:00
ISSOtm
32231e3f7e
Add Ubuntu 20.04 to CI
2020-07-21 22:15:56 +02:00
Eldred Habert
29314f76f7
Merge pull request #533 from JL2210/platform-fixes
...
Add platform-specific fixes file (only for MSVC, currently)
2020-07-21 22:11:25 +02:00
ISSOtm
8e92383fa3
Enable -Wobsolete by default
...
The fact that deprecations were common and quickly acted upon was raised by
some users
2020-07-21 21:06:48 +02:00
James Larrowe
e51701acaa
Add platform-specific fixes file
...
Create a new file, platform.h, for platform-specific hacks
for MSVC, this includes defining strncasecmp to _stricmp and
strdup to _strdup, among other things like defining missing
stat macros
Change some things not supported in MSVC, like _Static_assert,
to their counterparts (in this case, static_assert)
Replace usage of VLAs with malloc and free
Update getopt_long and use the getopt implementation from musl
on Windows.
Use comments to show which functions from platform.h are being used
2020-07-21 14:24:22 -04:00
ISSOtm
0793e9effe
Fix develop compilation error
...
This bug slipped by because my pre-commit hook for testing was broken...
2020-07-21 20:10:28 +02:00
ISSOtm
c25b0be085
Document that -t and -w convert section types
...
This is also a fairly overdue doc update
2020-07-21 20:05:26 +02:00
ISSOtm
1f2f797cb9
Add section fragments
...
Fixes #517 , and hopefully enables RGBDS as a SDCC back-end
2020-07-21 19:56:46 +02:00
ISSOtm
aca00e4fce
Document MP etc. in rgbasm(1)
...
This is actually kind of overdue...
2020-07-21 15:55:56 +02:00
Eldred Habert
cf80293d9b
Merge pull request #540 from daid/patch-1
...
Make the local variables of getopt static.
2020-07-21 13:11:30 +02:00
daid
6d53753c66
Make the local variables of getopt static.
...
While compiling for empscripten there is a duplicate symbol conflict with these two variables. And as they are only used locally, and do not need a symbol exported they can just be static.
2020-07-21 10:21:33 +02:00
Eldred Habert
79f293c3d7
Merge pull request #529 from JL2210/cmake
...
Add CMake build system
2020-07-20 16:02:47 +02:00
Eldred Habert
8c765883fb
Merge pull request #536 from braydenm303/patch-1
...
Fix error in documentation about unary not
2020-07-20 15:11:29 +02:00
Brayden Morris
83aa456d05
Fix error in documentation about unary not
2020-07-13 09:32:43 -06:00
James R Larrowe
819c36943e
Add CMake build system
...
This should hopefully work torwards compatibility with more systems.
I've tried to make this as general as possible but some small assumptions
about the compiler are made. I've also tried to recreate the build process
as closely as possible, but I had to change some things slightly to work
with CMake (version strings, mainly).
For now, it doesn't allow in-source builds, as that could overwrite the
Makefile.
This adds:
- Support for more build systems
- Automatic dependency generation
- Performance gains (especially when using i.e. Ninja)
Defaults to Release build.
2020-07-03 15:10:18 -04:00
Eldred Habert
8b60efa149
Merge pull request #530 from JL2210/fix-clang
...
Fix Clang warning in linkdefs
2020-06-27 22:07:19 +02:00
James Larrowe
240fca0861
Fix Clang warning in linkdefs
...
This one's really stupid; printing an int with %hhu gives a warning
even though a regular unsigned char is promoted to an int before
printing anyway. Silence it so the build with Clang works.
This is a regression introduced in 5c24de3
2020-06-23 23:29:49 -04:00
Eldred Habert
f996186fae
Merge pull request #526 from JL2210/fix-bank-index
...
Fix indexing of banks array, fixes #525
2020-06-21 12:44:17 +02:00
James Larrowe
69a41d8ef9
Fix indexing of banks array
...
When ROMX bank 1 is given, the banks array is indexed with an index
of 1 rather than an index of zero.
2020-06-17 13:33:48 -04:00
Eldred Habert
b958820bce
Merge pull request #523 from RandomBananazz/patch-1
...
Fixed error in POP AF instruction reference
2020-05-27 12:45:44 +02:00
Jason Yuan
7624bd524c
Fixed error in POP AF instruction reference
...
The "imaginary" equivalent instructions put the instructions in the wrong order (inc sp first).
2020-05-26 23:29:06 -04:00
Eldred Habert
663f0ca3b0
Merge pull request #522 from JL2210/djgpp
...
Fix DJGPP build
2020-05-21 22:37:24 +02:00
James Larrowe
f88d9e728d
Fix DJGPP build
...
GCC with the -std=c11 defines __STRICT_ANSI__. DJGPP checks if
__STRICT_ANSI__ is defined and if so doesn't define some things
mandated by POSIX such as struct stat, PATH_MAX, and others.
The -std=gnu11 option does not define this macro, so use it instead.
_DEFAULT_SOURCE isn't needed as no GNU nor BSD-specific functions
are used. Remove it.
Fix the last two occurrences of incorrect format specifiers for standard
fixed-width integer types.
2020-05-19 19:21:16 -04:00
ISSOtm
71fa62c9d1
Fix incorrectly spaced unary ! in RPN documentation
2020-05-13 01:20:34 +02:00
ISSOtm
5c6069dbe9
Add NULL and overflow checks to macro args
2020-05-13 01:17:58 +02:00
ISSOtm
d517d2d6b4
Change macro arg allocation to geometric growth array
2020-05-13 00:22:56 +02:00
ISSOtm
80218fa109
Fix array overflow on invalid macro arg evaluation
...
`macro_GetArg` had not been changed after the previous commit; however,
the old code relied on the `macroArgs->args` array being at least
`MAXMACROARGS` entries large (which was the case until the last commit).
The boundary against which it checked would have better been written as
`sizeof(macroArgs->args)/sizeof(macroArgs->args[0])`, I guess, but what's
done is done.
2020-05-12 16:44:23 +02:00
Eldred Habert
fee8a58b77
Merge pull request #521 from aaaaaa123456789/master
...
Support over 256 macro arguments
2020-05-12 15:46:42 +02:00
aaaaaa123456789
fd52a6f046
Add a test for >256 macro arguments
2020-05-12 07:22:42 -03:00
aaaaaa123456789
89fb372326
Set max macro arguments to 99,999
2020-05-12 06:46:17 -03:00
aaaaaa123456789
a828f82414
Remove fixed-size array for macro arguments
2020-05-12 06:46:07 -03:00
Eldred Habert
4d0d6664d7
Merge pull request #520 from JL2210/inttypes-stdint
...
Use inttypes for stdint types
2020-05-07 17:31:06 +02:00
James Larrowe
5c24de3dc4
Use inttypes for stdint types
...
This should help make RGBDS portable to systems with 16-bit integers,
like DOS.
For kicks, use the macros for 16-bit and 8-bit integers.
Fix other miscellaneous things, like #include ordering and other
printf-format related things.
Reduce repitition in math.c while I'm there.
2020-05-07 11:10:20 -04:00
ISSOtm
363458c3bc
Fix semi-unused variable in lexer.c
2020-05-06 19:55:37 +02:00
ISSOtm
b299f6fb3b
Fix uninitialized memory use with -MT and -MQ
...
This didn't break unless the first uninitialized byte was non-zero,
which happened to be the case on someone's Windows machine.
Would it be worth it setting up Valgrind in CI?
2020-05-06 19:19:10 +02:00
Eldred Habert
645473e336
Merge pull request #518 from JL2210/warn-parameterless-dx
...
Add empty data directive warning
2020-05-06 16:25:03 +02:00
James Larrowe
bdf397bba7
Add empty data directive warning
...
Fixes #516
2020-05-06 09:50:28 -04:00
ISSOtm
781a65ee49
Fix hashmap collisions sometimes hanging deletion
2020-05-03 19:13:12 +02:00
ISSOtm
c135e2c6a0
Fix local sym names not being expanded by PURGE
...
And an additional bug that broke the attached test
2020-05-03 19:06:48 +02:00
ISSOtm
12693081c9
Use colons for hour symbols
2020-04-28 13:05:06 +02:00
Eldred Habert
7c22954fd5
Merge pull request #513 from JL2210/disable-padding-option
...
Add option to disable padding in rgblink
2020-04-27 11:05:55 +02:00
ISSOtm
8958e352df
Update documentation for new -x option
2020-04-27 11:04:29 +02:00
ISSOtm
573003113b
Fix 0-byte sections incorrectly printed in map files
...
Fixes #515
2020-04-17 11:38:28 +02:00
JL2210
8b1351fc3e
Add option to disable padding in rgblink
...
Fixes #307
RGBFIX can handle padding, so there's no reason why
we can't add an option to disable padding in rgblink.
Signed-off-by: JL2210 <[email protected] >
2020-04-15 09:34:51 -04:00
Eldred Habert
106ef895ee
Merge pull request #514 from JL2210/fix-gfx-gb-leak
...
Add error checking and fix memory leak in gfx/gb.c
2020-04-14 21:31:12 +02:00
JL2210
7f9bd12f76
Add error checking and fix memory leak in gfx/gb.c
...
It's possible that tile could be leaked, so free it.
Fix sizeof convention and check the result of malloc.
Signed-off-by: JL2210 <[email protected] >
2020-04-13 22:02:24 -04:00
ISSOtm
5fe3a0adb6
Remove non-OPT options from Options struct
2020-04-13 17:15:00 +02:00
Eldred Habert
cdb4c5f553
Merge pull request #509 from JL2210/zero-alloc-use-fix-3
...
Fix use of zero-allocated memory
2020-04-13 02:50:58 +02:00
ISSOtm
57639f3765
Change comment style and use errx instead of err
2020-04-13 02:50:11 +02:00
Eldred Habert
9bec983923
Merge pull request #511 from JL2210/memory-errors
...
Fix memory errors in makepng
2020-04-13 02:39:17 +02:00
ISSOtm
2220f19fa7
Fix use-after-free with include in linker scripts
...
Fixes #510 , and further proves that you *really* should not entrust memory
ownership management to humans :P
2020-04-13 02:36:19 +02:00
JL2210
2a734ecba2
Fix memory errors
...
This includes not checking the result of malloc and
using the wrong type in sizeof. Only the latter was
caught by scan-build.
Also use more idiomatic sizeof().
Signed-off-by: JL2210 <[email protected] >
2020-04-12 19:45:37 -04:00
JL2210
d21015e34a
Fix use of zero-allocated memory
...
It's possible that the unsigned integer may overflow to zero,
and then we might use zero-allocated memory.
This is incredibly unlikely, and I would even go so far as to say
that this is a false positive. Fix it anyway, to silence this warning:
src/link/patch.c:92:24: warning: Use of zero-allocated memory
stack.buf[stack.size] = value;
~~~~~~~~~~~~~~~~~~~~~ ^
Deal with overflow, and check for zero to get rid of the warning.
Signed-off-by: JL2210 <[email protected] >
2020-04-12 19:36:47 -04:00
ISSOtm
023a3c037f
Properly handle missing symbols
...
Fixes #512
2020-04-12 22:52:32 +02:00
ISSOtm
828edb7403
Remove spurious error from div by zero test
2020-04-12 01:05:06 +02:00
ISSOtm
a034ce0478
Deprecate '*' for comments
2020-04-09 17:57:15 +02:00
Eldred Habert
d6cd5823e3
Merge pull request #508 from JL2210/mod-by-zero-fix-2
...
Fix modulo by zero
2020-04-09 14:52:12 +02:00
JL2210
5dd941b311
Fix modulo by zero
...
Yet another case caught by scan-build:
src/link/patch.c:188:21: warning: Division by zero
value = popRPN() % value;
~~~~~~~~~^~~~~~~
Just copy over the code from the division case, with a few modifications.
Signed-off-by: JL2210 <[email protected] >
2020-04-09 08:50:23 -04:00
ISSOtm
f9f27d6f5a
Clean up symbol system
...
Get rid of Hungarian notation
Improve encapsulation (the rest of the world should not touch PC directly)
2020-04-09 10:42:37 +02:00
Eldred Habert
5ea8490e2b
Merge pull request #507 from JL2210/null-pointer-fix-1
...
Fix possible null pointer dereference
2020-04-08 23:35:21 +02:00
JL2210
5863cd10b8
Fix possible null pointer dereference
...
It's possible that if the FILE passed to yy_create_buffer is at the
end-of file, there may be a null pointer dereference.
This should hopefully fix that.
Found with clang-tools' scan-build:
src/asm/lexer.c:281:25: warning: Array access (via field 'pBuffer')
results in a null pointer dereference
pBuffer->pBuffer[size] = 0;
~~~~~~~ ^
1 warning generated.
Signed-off-by: JL2210 <[email protected] >
2020-04-08 17:30:43 -04:00
ISSOtm
40f8e33e6c
Fix periods not being accepted as second char of label names
2020-04-08 15:14:07 +02:00
ISSOtm
0157ba63d3
Document whitespace before local labels
2020-04-08 15:08:29 +02:00
ISSOtm
9e3d8b22cb
Document new intra-section align
...
Also sneak in two code style fixes forgotten in last commit
2020-04-08 15:01:36 +02:00
ISSOtm
665412c073
Implement mid-section alignment directive
...
Fixes #254 .
2020-04-08 12:29:00 +02:00
ISSOtm
2b0c34ecb5
Fix a few code style errors
2020-04-08 00:44:41 +02:00
ISSOtm
b0ec8468e6
Allow specifying offset in addition to alignment
2020-04-08 00:40:41 +02:00
ISSOtm
e82ad21704
Use a single byte for alignment
2020-04-07 21:19:09 +02:00
ISSOtm
e098bf47ba
Allow references to be overridden by constant symbols
...
RGBLINK is capable of handling it now.
Though it'd be ideal for RGBASM to directly catch it.
Fixes #496 .
2020-04-07 20:57:20 +02:00
ISSOtm
190678107b
Prevent RGBLINK from crashing when getting the bank of a constant
2020-04-07 20:41:29 +02:00
ISSOtm
9f82fa4cf7
Fix BANK(@) outside sections causing crashes
2020-04-07 15:51:17 +02:00
Eldred Habert
562835308b
Merge pull request #504 from runlevel5/gcc10-fix
...
Fix multiple definitions for GCC10
2020-04-07 15:18:23 +02:00
ISSOtm
927c65e863
Fix incorrect PC in LOAD blocks at link time
2020-04-07 14:44:51 +02:00
ISSOtm
5b6c1569a4
Make failure to open file a fatal error
2020-04-07 11:36:44 +02:00
Trung Lê
65121e6d5d
Fix multiple definitions for GCC10
2020-04-07 14:48:30 +10:00
ISSOtm
82e0e4ffaf
Make some RGBLINK errors non-fatal
2020-04-06 00:48:10 +02:00
ISSOtm
ffb199a26a
Avoid Useless Use of backticks in rgblink testing
2020-04-06 00:44:59 +02:00
ISSOtm
175933d2b1
Remove old scripts for updating references for tests
...
I much rather prefer correcting everything by hand, and gauging
whether the change is good on a case by case basis
2020-04-06 00:41:37 +02:00
Eldred Habert
c86e6fef0a
Merge pull request #502 from JL2210/more-conventional-permissions
...
Use more conventional permissions and man-page directory
2020-04-06 00:25:33 +02:00
JL2210
1e3ce2a36f
Use more conventional permissions and man-page directory
...
As 444 and 555 seem to be used for no apparent reason, use the more
conventional 644 and 755.
/man is typically unused or a symlink to /share/man now, so just use
/share/man.
Signed-off-by: JL2210 <[email protected] >
2020-04-05 17:02:12 -04:00
ISSOtm
153915dc2f
Improve portability of new make dist
2020-04-04 14:48:15 +02:00
ISSOtm
ced38bc6ee
Add new Makefile target for release tarballs
2020-04-04 14:23:28 +02:00
ISSOtm
4e96cf9875
Release 0.4.0
2020-04-03 12:11:50 +02:00
ISSOtm
80170eb6eb
Regenerate man page HTML renders
2020-04-03 12:03:59 +02:00
ISSOtm
bdad1499fe
Merge branch 'release'
2020-04-03 11:58:53 +02:00
Eldred Habert
1f5ca39559
Merge pull request #494 from ISSOtm/docs
...
Overhaul man pages
2020-04-03 11:56:41 +02:00
ISSOtm
5013b64f55
Update disassemblies to latest commits
2020-04-02 21:26:38 +02:00
ISSOtm
7eb73d766e
Make compilation optimized unless debugging
...
Note: I wanted to enable `-Og` on `develop`, but this generated warnings
(thus, errors) that aren't in `-O0`. Needs further investigation, but
annoyingly some of those are within `extern/` code, thus requiring
different flags, which AFAIK is only possible (sanely) with GNU Make.
2020-04-02 16:56:04 +02:00
ISSOtm
bcfeb49d6b
Allow labels to be passed to DEF
2020-04-02 16:54:41 +02:00
ISSOtm
702d9e0542
Fix wrong error function used in RGBGFX
2020-03-31 17:28:31 +02:00
ISSOtm
c0aff678e9
Improve arg-shift test
2020-03-29 12:34:13 +02:00
ISSOtm
a3d8836671
Prevent assertions outside sections from crashing
2020-03-29 12:18:24 +02:00
ISSOtm
db1eb8fbcb
Revert "Prevent RGBASM from outputting corrupted files"
...
This reverts commit 06fe27c516 .
According to Microsoft's documentation
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tmpfile?view=vs-2019
`tmpfile` attempts to create the temporary file at the **root** folder
This seems to assume that the user has admin rights; might be a compat
thing, idk, but it breaks on people's computers.
(CI didn't catch it, annoyingly.)
Reverting to make RGBASM usable on most Windows computers.
(Sanely-configured ones, at least.)
Another solution to #446 needs to be figured out, yay...
2020-03-27 23:36:11 +01:00
ISSOtm
95f347dc6a
Evaluate assertions after placing sections
2020-03-27 20:00:29 +01:00
ISSOtm
6579120d9e
Simplify symbol-writing logic
2020-03-27 12:32:14 +01:00
ISSOtm
84cd9f2db9
Fix segfaults when using PC outside a section
2020-03-27 12:30:09 +01:00
ISSOtm
06fe27c516
Prevent RGBASM from outputting corrupted files
...
Properly fixes #451
2020-03-27 11:19:02 +01:00
ISSOtm
5039af6af1
Document new "unionized section" feature
2020-03-26 23:50:30 +01:00
ISSOtm
4df74d44ec
Improve opcode reference
2020-03-26 23:11:01 +01:00
ISSOtm
9113647d41
Fix incorrect macro used for x-ref
2020-03-26 23:11:01 +01:00
ISSOtm
26af2bff5e
Prevent text from bumping sides on mobile devices
2020-03-26 23:11:01 +01:00
ISSOtm
3c304f3acf
Override mandoc styling without modifying the stylesheet
2020-03-26 23:11:01 +01:00
ISSOtm
e308130e23
Update style overrides for new mandoc.css
2020-03-26 23:11:01 +01:00
ISSOtm
713eef9ef2
Update mandoc style sheet
2020-03-26 23:11:01 +01:00
ISSOtm
7635a2fc74
Reword and give an example of symbol interpolation
2020-03-26 23:11:01 +01:00
ISSOtm
6889334521
Add viewport tag for mobile users
2020-03-26 23:11:01 +01:00
ISSOtm
d1e82e50cb
Improve style of man page HTML renders
...
See individual comments within `rgbds.css` for more info
Not too fond of having to modify `mandoc.css`, but I did my best to
modify as little as possible
2020-03-26 23:11:01 +01:00
ISSOtm
7955447ca4
Overhaul man pages
2020-03-26 23:11:01 +01:00
ISSOtm
51e225cd75
Add post-processor for HTML renders
...
Adds links to argument descriptions in synopsis
Adds links to man pages in the set (not to external ones)
Removes artifact from the way long opts are encoded
Makes description blurb inline, consistently with terminal output
2020-03-26 23:11:01 +01:00
ISSOtm
187f88aa50
Only copy necessary characters for bare labels
2020-03-26 23:10:51 +01:00
ISSOtm
caddd61f17
Remove "column 1" restriction for local labels
...
Because a local symbol is necessarily a label, the disambiguation
is not necessary. This is a first step towards fixing #457 .
2020-03-26 22:36:40 +01:00
ISSOtm
29629245a4
Use new hashmap implementation for symbols
2020-03-24 12:50:53 +01:00
ISSOtm
666b9f8f7b
Add tests for purging symbols
2020-03-24 10:52:45 +01:00
ISSOtm
7deb8d3e8a
Allow purging exported symbols
2020-03-24 10:52:02 +01:00
ISSOtm
cb0a882a31
Order warnings alphabetically
2020-03-23 16:03:36 +01:00
ISSOtm
df2c0dc2f9
Check for unsatisfiable alignment constraints
...
Fixes #493
2020-03-22 11:54:57 +01:00
ISSOtm
062fa5392b
Still override alignment even if not satisfied
2020-03-22 11:52:31 +01:00
Eldred Habert
baeec2315f
Merge pull request #495 from ISSOtm/sectunion
...
Implement unionized sections
2020-03-22 11:21:24 +01:00
ISSOtm
92134d7684
Add testing for assertions inside unionized sections
2020-03-22 11:14:04 +01:00
ISSOtm
4877bb783c
Add more tests for unionized sections + fix bugs
...
Implementing those tests found a few bugs... oops
2020-03-22 11:14:04 +01:00
ISSOtm
275b8e15ff
Document modification to object file format
2020-03-22 11:14:04 +01:00
ISSOtm
e123b6dec7
Implement unionized sections in RGBLINK
2020-03-22 11:13:39 +01:00
ISSOtm
cb52ae0f26
Implement unionized sections in RGBASM
...
This touched a lot more code than initially expected, for two reasons.
First, this broke a big RGBASM assumption: that sections are always being
written to at their end. This plus other problems required touching
basically the entirety of `section.c`.
Second, I tried different solutions to solve the above problem, and along
the way I cleaned up many things around. (I believe that keeping this to
"cleanup" commits yields subpar results, and since it's boring they get
postponed anyways.)
RGBLINK support still needs to be added, but this will come next.
2020-03-22 11:06:17 +01:00
ISSOtm
46a402f7d7
Prevent passing assertions that RGBASM passed to RGBLINK
2020-03-22 10:46:37 +01:00
ISSOtm
e233c5d256
Don't drop RGBLINK output in RGBASM tests
2020-03-22 10:43:06 +01:00
Eldred Habert
fe824e0068
Merge pull request #490 from ISSOtm/const
...
Implement `ISCONST`, reporting compile-time constness
2020-03-21 23:20:01 +01:00
Eldred Habert
66512ed8d2
Merge pull request #488 from rednex/assert
...
Add assertions
2020-03-21 23:06:44 +01:00
ISSOtm
fb58166e5d
Add assertions
...
Closes #292
2020-03-21 23:00:38 +01:00
ISSOtm
0759c98d91
Increase version number to 0.3.10
2020-03-21 21:18:14 +01:00
ISSOtm
402ffbf0c5
Add test for version constants
2020-03-21 21:01:25 +01:00
ISSOtm
8191e5eb27
Define version symbols
...
Major blunder. That warrants a new release on its own...
2020-03-21 19:26:40 +01:00
ISSOtm
03967bd623
Prevent purging referenced symbols
...
This is an immediate fix for #492 , although #342 is needed to implement the
desired functionality.
2020-03-21 15:42:52 +01:00
ISSOtm
eb445271df
Remove carryover from RGBASM in RGBLINK tests
2020-03-20 21:50:38 +01:00
ISSOtm
af22cf182b
Simplify out_PCRelByte by using PC
2020-03-20 20:22:19 +01:00
ISSOtm
5a0fcda4c8
Prevent POPS within LOAD blocks
2020-03-20 18:57:37 +01:00
ISSOtm
29623c4146
Test generating direct bytes in LOAD blocks
2020-03-20 18:29:15 +01:00
ISSOtm
ebda8255ff
Improve LOAD test to also test patches inside LOAD section
2020-03-20 18:20:20 +01:00
ISSOtm
deb91f679d
Reset symbol scope on every section change
2020-03-20 17:59:47 +01:00
ISSOtm
fb5e768142
Prevent using LOAD blocks outide code sections
2020-03-20 16:37:10 +01:00
ISSOtm
ecf44c784c
Reject including directories
2020-03-20 01:24:53 +01:00
ISSOtm
5bca1172ff
Fix section continuation when only one bank exists
2020-03-19 23:07:07 +01:00
ISSOtm
136446fccb
Improve checking of RST and LDH values at assembly time
2020-03-15 15:23:39 +01:00
ISSOtm
49bca8d588
Fix misnamed hashmap function
2020-03-15 15:23:39 +01:00
ISSOtm
7ddbe44b21
Use hashmap system for charmap
2020-03-15 15:23:32 +01:00
ISSOtm
af60e7f74a
Allow charmap creation even if its base doesn't exist
2020-03-15 00:40:45 +01:00
ISSOtm
2f16e82cf7
Improve PC offset management
...
Basically make it always point to the instruction's first byte.
This was the behavior all whom I asked to intuitively expected.
2020-03-15 00:18:10 +01:00
ISSOtm
7b54312d97
Deprecate OPT z in favor of OPT p
...
Fixes #298
2020-03-14 17:09:15 +01:00
ISSOtm
5b98beec8b
Use left recursion instead of right
...
> Any kind of sequence can be defined using either left recursion or right
> recursion, but you should always use left recursion, because it can
> parse a sequence of any number of elements with bounded stack space.
https://www.gnu.org/software/bison/manual/html_node/Recursion.html
2020-03-14 16:22:33 +01:00
ISSOtm
6662c86d5e
Define 3-bit value when invalid
2020-03-14 16:17:30 +01:00
ISSOtm
2f466c2939
Revamp macro arg system
...
This should significantly improve performance: on pokecrystal builds, perf
reported as much CPU time spent on `yyparse` as on `sym_UseNewMacroArgs`
Measurements show ~6 seconds of improvement on that codebase.
This also fixes #321 , as a bonus, due to saner management!
2020-03-14 16:13:40 +01:00
ISSOtm
61897d8b52
Fix warning.h not including a required header
2020-03-14 11:33:51 +01:00
ISSOtm
a259f53b52
Rename macro functions with proper prefix
2020-03-13 23:20:27 +01:00
ISSOtm
ffdb1fbfe5
Split macro arg management into its own file
...
It has no relation to symbols, and helps a tiny bit deflate `symbol.c`
2020-03-11 02:39:36 +01:00
ISSOtm
4b33b4b387
Remove forward decl of nonexistent function
...
I can only assume it was for debugging? (No, I'm not looking it
up the history)
2020-03-11 02:21:30 +01:00
ISSOtm
8fcdcb1731
Implement ISCONST, reporting compile-time constness
2020-03-11 02:15:31 +01:00
ISSOtm
55b911654c
Get rid of obsoleted function
2020-03-11 01:46:26 +01:00
ISSOtm
7c8eba9fd2
Remove error message causing segfault
...
This was utterly stupid. The check right above ensured that `sym` was NULL,
ergo that the argument to `yyerror` *would* segfault.
The only two call sites cannot pass a non-NULL pointer anyways, which I'm
betting is why this went unnoticed.
I did what an optimizing compiler would do anyways: remove the dead code.
2020-03-11 00:39:57 +01:00
ISSOtm
23effcc3f0
Fix error messages in sym_GetConstantValue
2020-03-11 00:16:35 +01:00
ISSOtm
ea0c5581a5
Prevent deletion of built-in symbols
2020-03-10 23:25:33 +01:00
ISSOtm
2ea329c920
Make symbol creation funcs return ptr to symbol
2020-03-10 16:36:02 +01:00
ISSOtm
3948795d49
Remove deprecated section types
2020-03-10 16:08:09 +01:00
ISSOtm
13e4920122
Get rid of comma token
2020-03-10 16:08:09 +01:00
ISSOtm
88b1121037
Uniformize style in asmy.y
2020-03-10 16:08:02 +01:00
ISSOtm
d2a97e934b
Remove obsolete instruction forms
2020-03-10 15:50:11 +01:00
ISSOtm
cb3997d8c9
Fix org location being undefined when incorrect
2020-03-10 15:37:33 +01:00
ISSOtm
c7320a49a9
Deprecate GLOBAL and XDEF
...
They're basically synonyms for `EXPORT`, and the latter isn't
even documented!
2020-03-10 13:49:55 +01:00
ISSOtm
8d9a896166
Remove deprecated IMPORT symbol
...
It had a warning that it had no effect for a long while now; removing it so
the name can be re-used
2020-03-10 13:43:15 +01:00
ISSOtm
81a057416f
Remove typing for operators that don't need it
2020-03-08 16:26:09 +01:00
ISSOtm
361326e06c
Allow inlining of two simple RPN functions
2020-03-07 18:18:57 +01:00
ISSOtm
0d31afaff8
Correct four code style issues
2020-03-07 18:09:00 +01:00
ISSOtm
48ad3973a9
Tell the user about "label"s instead of "relocatable"s
...
That's the common term, and even the manual uses it.
2020-03-07 18:04:13 +01:00
ISSOtm
f6f25296a0
Fix passing constant label to BANK() causing an error
2020-03-07 18:02:06 +01:00
ISSOtm
cb62076f8c
Use $(MAKE) instead of make in develop
2020-03-06 18:15:32 +01:00
ISSOtm
8034e567f1
Un-silence make checkpatch in CI
2020-03-06 02:32:46 +01:00
ISSOtm
59546c8980
Un-trivialize expression in long RPN expr test
2020-03-05 04:33:43 +01:00
ISSOtm
eee0e6adc8
Simplify long-rpn-expression.asm test
2020-02-29 16:39:13 +01:00
ISSOtm
fa10ee4356
Deprecate colon-less non-local labels
2020-02-29 16:30:47 +01:00
ISSOtm
5bc8d51a9e
Ignore unused arguments in a more standard way
2020-02-29 16:25:54 +01:00
Eldred Habert
361d6cf517
Merge pull request #437 from rednex/locals
...
Prevent local symbols that are not labels
2020-02-26 02:56:35 +01:00
ISSOtm
6800609fa7
Make RGBLINK check divisions by zero
2020-02-24 17:54:55 +01:00
ISSOtm
dac13ba4bb
Add string format checking to err.h functions
...
And fix all problems this detected... oops
2020-02-24 16:58:55 +01:00
ISSOtm
702075eba6
Add forgotten file name argument to err
2020-02-24 16:58:55 +01:00
ISSOtm
3b62bd0bce
Bundle GCC runtime in Win32 bin package
...
After discussing with some Windows user, this actually seems to be
a common thing to do (it seemed weird to me, but I know Windows' handling
of DLLs is weird anyways), so bundle that runtime and reinstate the
full test run for Win32.
2020-02-23 23:14:26 +01:00
ISSOtm
4cc24f4369
Add ds cnt, byte syntax
...
As suggested by https://github.com/rednex/rgbds/issues/350#issuecomment-498030458
The order `count` then `byte` was decided after some discussion:
- First argument consistent with single-arg syntax
- Intuitive at least to some people other than myself
- Consistent with other assemblers, at least ca65
2020-02-23 22:43:50 +01:00
ISSOtm
cfe21876e5
Make writing patches not affect the expression
...
This also removes one int member from the struct that shouldn't be there
2020-02-23 22:29:01 +01:00
ISSOtm
ef2bfe4ea0
Store patch file line in the file name
...
It's more consistent with how it's stored for all other entries in the stack
2020-02-19 09:51:40 +01:00
ISSOtm
14731c0a1d
Use the GitHub-provided base ref for checkpatch testing
2020-02-19 00:56:06 +01:00
ISSOtm
93747af215
Allow overriding the base ref for checkpatch
...
The default is sane, but not a catch-all.
2020-02-19 00:55:00 +01:00
ISSOtm
76efd26da0
Prevent local symbols that are not labels
...
Fixes errors brought up in #423
2020-02-19 00:20:58 +01:00
ISSOtm
cf2001de5f
Allow compiling parser in debug mode with -DYYDEBUG=1
2020-02-19 00:01:51 +01:00
ISSOtm
6d00877231
Prevent infinite loop with line continuations without newlines
2020-02-18 20:58:20 +01:00
ISSOtm
6755a0912b
Improve naming of CI build artifacts
2020-02-18 20:23:37 +01:00
ISSOtm
b6ac23be3d
Remove Travis CI files
...
Obsoleted by GitHub Actions since #486
2020-02-18 20:12:18 +01:00
ISSOtm
e941cafedb
Make locals in main scope a non-fatal error
2020-02-18 20:07:44 +01:00
ISSOtm
03fe077b41
Make locals without parent a non-fatal error
2020-02-18 20:07:44 +01:00
Eldred Habert
12ef879860
Merge pull request #486 from ISSOtm/actions
...
Switch CI to GitHub Actions
2020-02-18 20:04:26 +01:00
ISSOtm
179e047474
Add Windows testing
2020-02-18 02:55:38 +01:00
ISSOtm
d497190aa1
Do not zip artifacts ourselves
...
GitHub does it, this creates zips of zips...
2020-02-17 15:04:14 +01:00
ISSOtm
e078c1e793
Use develop in CI when possible
2020-02-17 15:04:14 +01:00
ISSOtm
7471f46a07
Add checkpatch testing
2020-02-17 15:04:14 +01:00
ISSOtm
8cee3c3c3e
Upload binaries after compilation
2020-02-17 15:04:14 +01:00
ISSOtm
97bcbf5d84
Add GitHub Actions for regression testing
2020-02-17 15:04:14 +01:00
ISSOtm
3fce9ed9a4
Have Wine shim explicitly require bash
...
I didn't know the substitution was Bash-only..!
2020-02-17 15:03:46 +01:00
ISSOtm
21ffcc74db
Don't use echo -e for creating the Wine shim
...
Apparently that's not as portable as I expected.
2020-02-17 14:32:35 +01:00
ISSOtm
9e99db9a8e
Allow \r in strings
...
Fixes #484
2020-02-17 13:52:38 +01:00
ISSOtm
5fd38c5f67
Do not try to link libpng statically
2020-02-14 03:07:24 +01:00
ISSOtm
03ed914714
Give reason to why writing the object file fails
2020-02-14 00:29:24 +01:00
ISSOtm
42faffe6f3
Make the Wine shims a separate target
2020-02-13 23:06:05 +01:00
ISSOtm
bc80e910ed
Fix two code style errors
2020-02-13 20:43:47 +01:00
ISSOtm
30a95d735a
Improve testing PC
2020-02-13 20:20:35 +01:00
ISSOtm
f01a227470
Fix non-const labels with callbacks having incorrect values when diffed
...
Basically, this broke PC, which is currently the only label-typed symbol
with a callback.
2020-02-13 20:16:59 +01:00
ISSOtm
91b65c9380
Add include guards and license header to section.h
2020-02-13 15:57:27 +01:00
ISSOtm
18c47843f1
Check if sections referenced in linker script exist
2020-02-12 15:27:07 +01:00
Eldred Habert
d5fe377c11
Merge pull request #482 from ISSOtm/conflict
...
Fix one shift/reduce and one reduce/reduce conflict
2020-02-12 01:39:18 +01:00
ISSOtm
ed4a613473
Rename productions to "reloc" when not really constant
2020-02-11 19:04:35 +01:00
ISSOtm
112098514d
Fix 1 s/r and 1 r/r conflict
...
Implements the fix suggested [here](https://github.com/rednex/rgbds/issues/44#issuecomment-69360499 ), which performed better than expected!
I'm not \*too\* fond of this but this seems like the right way
2020-02-11 18:59:55 +01:00
ISSOtm
31aa1ea474
Improve arg-shift test
...
New test case courtesy of @aaaaaa123456789
2020-02-11 11:38:57 +01:00
ISSOtm
96b6e4a76e
Add forgotten semicolon in grammar
2020-02-11 11:36:50 +01:00
ISSOtm
001b95d12a
Add SHIFT with numeric argument
...
Fixes #442 .
2020-02-11 11:25:38 +01:00
ISSOtm
3b2c862320
Make more RGBASM errors print their line number
...
Fixes #379 .
2020-02-11 09:35:19 +01:00
ISSOtm
230f849229
Fix error output slightly broken on Windows
...
Apparently, `perror` on Windows forces a newline before itself, which is
not the behavior intended. Instead, print the error message inline.
2020-02-11 09:06:38 +01:00
Eldred Habert
c37253fe5a
Merge pull request #480 from ISSOtm/section
...
Improve section management
2020-02-11 08:51:00 +01:00
Eldred Habert
0ed8d3859d
Merge pull request #481 from rednex/revert-451-atomic_output
...
Revert "Make RGBASM overwrite output files atomically"
2020-02-11 08:32:27 +01:00
ISSOtm
6963d77f8a
Add documentation for LOAD blocks
2020-02-10 09:30:33 +01:00
ISSOtm
02ea52f453
Add test for LOAD
2020-02-10 03:39:09 +01:00
ISSOtm
cdabc057a0
Allow unseekable files with INCBIN
...
Go figure the use case, but the feature is there now
2020-02-10 03:39:09 +01:00
ISSOtm
eb0d75711a
Implement LOAD/ENDL blocks
...
Basically implements and closes rednex#274.
2020-02-10 03:39:09 +01:00
ISSOtm
f121119283
Use section's offset instead of general one
...
That's more future-proof and makes more sense
2020-02-10 03:37:44 +01:00
ISSOtm
d9c1b66931
Deduplicate value output function code
2020-02-10 03:37:43 +01:00
ISSOtm
2f60e0a59e
Use meaningful types for byte output functions
2020-02-10 03:36:51 +01:00
ISSOtm
ffe9e92b48
Skip double-checking overflow in byte output
2020-02-10 03:36:51 +01:00
ISSOtm
aa90a53f34
Move 1-byte overflow check to out_AbsByte
...
This check is already performed in bulk by all functions calling it except
`out_AbsByte`, adding extra overhead to those.
2020-02-10 03:36:51 +01:00
ISSOtm
598c923506
Use callback for PC's value
...
This causes it to auto-update whenever the current section's attributes are
updated, simplifying the code and eliminating redundancy.
This should also overall reduce overhead (one extra function call on each
PC evaluation, but less bookkeeping for each byte output)
2020-02-10 03:36:51 +01:00
ISSOtm
8c4b473d6f
Add more checks to section creation in RGBASM
...
Fixes rednex#471, but also backports a couple more checks from RGBLINK
2020-02-10 03:35:55 +01:00
ISSOtm
a4fe274c25
Unify all section declarations
2020-02-10 03:35:55 +01:00
ISSOtm
34597ce6a0
Mark some section functions as const
2020-02-10 03:34:58 +01:00
ISSOtm
4a2af807b2
Remove legacy forward declaration
2020-02-10 03:34:58 +01:00
ISSOtm
d0ec35628f
Split section management into its own file
2020-02-10 03:34:58 +01:00
ISSOtm
bfdbd00092
Do some misc cleanup of output.c
2020-02-10 03:25:03 +01:00
ISSOtm
d0278d8663
Invert logic for section max sizes
...
Prep for the next commit
2020-02-10 03:25:03 +01:00
Eldred Habert
632bc2aaec
Merge pull request #476 from ISSOtm/expr_cleanup
...
Clean up expression evaluation
2020-02-10 03:10:05 +01:00
Eldred Habert
1ca59f25d0
Revert "Make RGBASM overwrite output files atomically"
2020-02-10 03:08:27 +01:00
Eldred Habert
1d0c8fa113
Merge pull request #451 from rednex/atomic_output
...
Make RGBASM overwrite output files atomically
2020-02-10 03:08:14 +01:00
ISSOtm
1d70c989be
Test one more label diff case
2020-02-10 02:55:51 +01:00
ISSOtm
818a0d0296
Test more cases in label-diff test
2020-02-10 02:51:48 +01:00
ISSOtm
ab1eb146c9
Print special message when PC is not constant
2020-02-10 02:51:48 +01:00
ISSOtm
63054ae0fd
Make more functions ignore the RPN buffer when constant
2020-02-10 02:51:48 +01:00
ISSOtm
155040240d
Improve error message when a symbol's value is not constant
2020-02-10 02:51:48 +01:00
ISSOtm
d466cab1e8
Init RPN expressions created by binary operators
2020-02-10 02:51:48 +01:00
ISSOtm
4e8b34f42e
Improve error message when a symbol is not constant
2020-02-10 02:51:48 +01:00
ISSOtm
5014f55c48
Treat PC as a symbol as well
2020-02-10 02:51:48 +01:00
ISSOtm
1d78cd0f03
Axe the constexpr expression evaluator
...
This avoids redundancy between them (and also having to port fixes and features)
The error messages have been preserved through a string reporting mechanism
2020-02-10 02:51:48 +01:00
ISSOtm
52d62c6b21
Handle subtractions between labels
2020-02-10 02:47:50 +01:00
ISSOtm
b4a73f33ce
Avoid undefined behavior when shifting in RPN math
2020-02-10 02:47:50 +01:00
ISSOtm
f9c25608e9
Ignore RPN strings when their value is known
2020-02-10 02:47:50 +01:00
ISSOtm
9fb9e63554
Reserve space for RPN expressions in a single call
...
This should mean less overhead with some commands
2020-02-10 02:47:12 +01:00
ISSOtm
9ce8a9f5f0
Add comments to RPN expr struct
2020-02-10 02:47:12 +01:00
ISSOtm
cc59730c5b
Cleanup the RPN evaluator somewhat
...
Make the bool field an actual bool
Rename `iReloc` to a more exact `isKnown` (as was already pointed out by some
comments)
Make the value of `BANK(symbol)` consistent when the argument is invalid
2020-02-10 02:47:12 +01:00
ISSOtm
0a04904b75
Refactor RPN binary expressions into a single func
...
This mirrors what the constexpr evaluator is doing, and removes a lot of code shared
between all of them
2020-02-10 02:47:12 +01:00
ISSOtm
9ed6e9af65
Make = a separate token from SET
...
This does break backwards compat, but if anyone complains I'm gonna be mad
2020-02-10 00:49:45 +01:00
ISSOtm
c424a9bf5a
Only output a single error with charmaps
2020-02-09 22:15:43 +01:00
ISSOtm
9d811e1267
Warn when truncating values in charmap
2020-02-09 22:13:16 +01:00
ISSOtm
af6f62701c
Remove ambiguous charmap syntax
...
The syntax was `charmap "anything", "string"`; the second string was
already handled by `const`, but to the same effect... the ambiguous
declaration has been removed, leaving us at "only" two reduce/reduce
conflicts.
2020-02-09 22:03:11 +01:00
ISSOtm
299574221e
Truncate shift.out.bin
...
Too large a size makes diff output (when tests fail) annoying
2020-02-09 19:51:47 +01:00
ISSOtm
fe0c269382
Use ++ and -- instead of [+-]= 1
...
Seriously...
2020-02-09 15:21:08 +01:00
ISSOtm
579a324ce7
Fix diffing bin files in RGBASM tests
2020-02-09 13:58:47 +01:00
ISSOtm
7903c14993
Fix undefined behavior when reading constant in RGBLINK
2020-02-07 14:51:26 +01:00
ISSOtm
b42a04c24e
Add test for jr @
...
Fun fact: current build *fails* this test!
2020-02-07 13:19:50 +01:00
ISSOtm
ea52e45335
Fix @
...
The symbol's evaluation by the assembler and linker was very inconsistent
2020-02-07 13:19:50 +01:00
ISSOtm
9687e6e1dd
Allow forcing the second byte of STOP
...
Fixes #433
2020-02-07 10:06:02 +01:00
ISSOtm
ee34200e5f
Output diffs when binary tests fail
2020-02-06 15:36:15 +01:00
ISSOtm
295fc6c619
Improve coverage of db-@ test
2020-02-05 13:24:50 +01:00
ISSOtm
28473d314a
Make implicit truncation a warning
2020-02-05 13:20:51 +01:00
ISSOtm
35f7340dc9
Report failing test names in RGBLINK as well
2020-02-04 01:41:35 +01:00
Eldred Habert
b76567e7d1
Merge pull request #470 from ISSOtm/rst
...
Allow using labels as argument to `rst`
2020-02-04 01:26:06 +01:00
ISSOtm
652db60ad6
Document modifications made to object file format
2020-02-03 21:10:05 +01:00
ISSOtm
a7cb0a166a
Inline readRGBxObject
...
This was made separate with the intention of supporting multiple versions,
but after some discussion this was decided against, so better improve
readability instead.
2020-02-03 21:10:05 +01:00
ISSOtm
f363541611
Introduce revision number field
2020-02-03 21:10:05 +01:00
ISSOtm
fa1fba7fd9
Increase object version to RGB9
2020-02-03 21:07:46 +01:00
ISSOtm
d73fa09774
Remove RGB6 parsing
2020-02-03 21:07:12 +01:00
ISSOtm
b1cd730db2
Add link-time RST instruction
...
This allows using a label as the argument to a `rst` instruction
Fixes rednex#448
2020-02-03 21:07:12 +01:00
ISSOtm
359a048b6e
Bump object version number
...
We're about to break the format, so let's do this
2020-02-03 21:07:12 +01:00
ISSOtm
f2be601a13
Check "left" boundary as well in isLocationSuitable
...
"fixed" and "aligned" location checking advanced the target location to places
regardless of the associated free space, potentially breaking the assumption
that the location was always further in memory than the free space's base.
Rather than adding more code to try keeping that assumption true, harden
`isLocationSuitable` and handle that case as well.
2020-02-03 20:57:12 +01:00
ISSOtm
4d2379b3df
Merge both "single-side" code paths in placeSection
2020-02-03 20:19:30 +01:00
ISSOtm
fd32b2252f
Define additional variable when doing make develop
2020-02-03 19:58:02 +01:00
ISSOtm
d15915ef14
Simplify bankrangecheck
2020-02-03 15:36:38 +01:00
ISSOtm
877e0e0b91
Get rid of BANK_COUNT_* symbols
...
They weren't used save for the definitions right below, so Occam's razor applies
2020-02-03 15:19:48 +01:00
ISSOtm
da1d9f68c7
Remove and reorder bank counts
...
Why was this an enum in the first place, anyways?
2020-02-03 15:19:48 +01:00
ISSOtm
24f41ef897
Expose link def arrays to RGBASM
2020-02-03 15:19:48 +01:00
ISSOtm
09dff85d5b
Merge common.h into linkdefs.h
2020-02-03 14:50:00 +01:00
Eldred Habert
20e5685c1a
Merge pull request #424 from ISSOtm/better_deps
...
Improve dependency generation
2020-02-03 03:50:09 +01:00
Eldred Habert
ac6232bc87
Merge pull request #473 from ISSOtm/shift_ub
...
Remove undefined behavior from shifts
2020-02-03 03:49:38 +01:00
ISSOtm
b16ec83a33
Add gbdiff.bash script
...
This script allows diffing two Game Boy ROMs using `xxd` and `diff` and
attempts to augment the diff using information pulled from SYM files.
It's not part of RGBDS proper, but can be useful to debug tests (when ROMs fail
to match).
2020-01-30 02:43:31 +01:00
ISSOtm
ed72baca2a
Make more symbol functions const
...
Can't hurt to specify those as they are now. Perhaps it'll enable slightly more
compiler optimizations, too?
2020-01-30 02:38:33 +01:00
ISSOtm
edb562d2e5
Mark a few symbol functions as static
2020-01-30 02:19:36 +01:00
ISSOtm
6d4b128611
Avoid unnecessary copies in symbol init
2020-01-30 02:15:43 +01:00
ISSOtm
e2e01e84fa
Fall back from failure in time a bit better
2020-01-30 02:07:55 +01:00
ISSOtm
93ee417567
Fix timestamp symbols on Windows (partially)
...
Windows does not honor `%F` nor `%T` in `strftime`. These are worked around
by writing the full format they serve as a short for.
However, Windows also treats `%z` and `%Z` identically, where SUS instead
requires `%z` to output a ±XXXX offset.
Since the current information is broken (no information), this isn't *breaking*
anything, but at least provides something a human will probably understand.
`__ISO_8601_UTC__` is unaffected because it hardcodes the timezone character,
only `__ISO_8601_LOCAL__` suffers from this.
2020-01-30 01:47:50 +01:00
ISSOtm
44cdcd12c3
Use tput for formatting escape sequences
2020-01-28 21:04:41 +01:00
ISSOtm
ed06981f57
Add test for db X, @
...
It should behave identically to both of these on separate lines
2020-01-28 21:04:41 +01:00
Eldred Habert
ec6c42e9d6
Merge pull request #467 from ISSOtm/report
...
Report failing file names in comparisons
2020-01-28 18:59:11 +01:00
ISSOtm
b11d121c48
Remove undefined behavior from shifts
...
`asl` and `asr` in `src/link/patch.c` courtesy of @pinobatch, and rearranged in RGBASM
evaluators.
2020-01-28 12:37:38 +01:00
ISSOtm
cdf6000618
Report failing file names in comparisons
...
The files being diffed (especially for variants) are temp files, so their
names are pretty nondescript. This improve error output, using ANSI escape
sequences to make those lines stand out.
2020-01-28 11:44:50 +01:00
ISSOtm
2e8094b712
Allow RGBASM to overwrite object files on Windows
2020-01-28 11:08:16 +01:00
ISSOtm
a9cb4f8245
Make RGBASM overwrite output files atomically
...
Fixes rednex/#446.
I am not sure this is the best (in cases where the target directory
is not writable but the target file is), but maybe this can be
toggled via a flag, for example.
2020-01-28 11:08:16 +01:00
ISSOtm
1bd41bf79a
Don't use diff to compare bin files in tests
2020-01-26 21:10:31 +01:00
ISSOtm
08ab34cf57
Fix a few checkpatch warnings in symbol.h
2020-01-26 18:26:57 +01:00
ISSOtm
7bb55469fe
Fix partial paths being output to dep files with -i
2020-01-26 15:33:36 +01:00
ISSOtm
a29dd738f2
Reimplement -M variants using long options
2020-01-26 15:33:36 +01:00
ISSOtm
4a98b41d57
Fix -MG always being enabled
2020-01-26 15:33:36 +01:00
ISSOtm
6fc5097278
Allow outputting dep files to stdout using -
2020-01-26 15:33:36 +01:00
ISSOtm
12f2f654dd
Add -MG
...
This option allows for automatic dependency detection and generation:
as soon as a missing file is found, it is output to the dep file, and
assembly immediately aborts. (No .o file is produced, even if `-o` was
speicified.) This doesn't cause an error, either; the point is that once
the file is added to the dep file, the Makefile is re-parsed, and this
time the file will be generated, so the dep list builds up automatically.
This mimicks GCC's option and behavior.
2020-01-26 15:33:36 +01:00
ISSOtm
0649b360fb
Allow specifying multiple dependency targets
...
This is done to match GCC's behavior.
Also, this unifies the code of -MT and -MQ.
2020-01-26 15:32:45 +01:00
ISSOtm
f1f314270d
Add -MQ
...
Just like GCC's -MQ, this is basically -MT but the file name is escaped.
2020-01-26 15:32:45 +01:00
ISSOtm
1fb9f90f0f
Add -MT option
...
Allows overriding the output file in dependencies, which also allows
outputting those without also outputting the object file.
This, again, mimicks GCC's option.
2020-01-26 15:32:45 +01:00
ISSOtm
bfa8da78a6
Add -MP option
...
Adds a phony target to every included file, mimicking gcc's
2020-01-26 15:32:45 +01:00
Eldred Habert
fb81733b2b
Merge pull request #472 from ISSOtm/romx-tiny
...
Allow ROMX and WRAMX sections in restricted modes
2020-01-26 14:48:32 +01:00
Eldred Habert
e7eac583da
Merge pull request #477 from ISSOtm/sym_overhaul
...
Overhaul the symbol system
2020-01-26 14:30:47 +01:00
ISSOtm
cd107855e7
Test new working label subtractions
2020-01-24 03:03:18 +01:00
ISSOtm
ab9307ac61
Clean up symbol management
...
Stop using that bitfield for everything, including what can be determined otherwise
It also makes it easier to have a sane state, since some bits were (supposedly)
mutually exclusive
2020-01-24 02:51:48 +01:00
ISSOtm
e3ef194b4f
Remove local label error checking
...
This is actually not necessary, because RGBLINK would warn about missing labels.
Besides, through semi-esoteric ways, it is possible to define more labels in this scope,
and there's no reason to prevent that.
2020-01-24 02:51:48 +01:00
ISSOtm
ab4ca9ad8c
Make symbol ref in patch symbols constant
2020-01-24 02:51:48 +01:00
ISSOtm
3fb5648880
Actually rely on createsymbol never returning NULL
...
This reduces complexity, basically
2020-01-24 02:51:48 +01:00
ISSOtm
a7c0616cd8
Rename export type enum to that
...
This prevents a conflict in the next commit
2020-01-24 02:51:48 +01:00
ISSOtm
51d5ff0567
Test subtracting labels
2020-01-24 02:50:24 +01:00
ISSOtm
0665146dcd
Report line info on empty RPN stack
2020-01-21 03:12:43 +01:00
ISSOtm
1f8422575e
Test that all-instructions does not error out
2020-01-21 03:05:22 +01:00
ISSOtm
61c381a62c
Systemize RGBLINK testing
2020-01-21 03:01:58 +01:00
ISSOtm
56d5f1588a
Do not run .pipe tests if the normal variant fails
...
They'll most likely fail as well, just adding redundant error output
2020-01-21 00:27:28 +01:00
ISSOtm
c05334dfc1
Upgrade testing to latest disasm commits
2020-01-20 14:51:25 +01:00
Eldred Habert
09d6c7a54f
Merge pull request #475 from ISSOtm/licensing
...
Add license headers where missing
2020-01-19 15:45:46 +01:00
ISSOtm
4fe44447a2
Add license headers where missing
2020-01-19 11:11:36 +01:00
ISSOtm
23c600eef5
Remove unnecessary gitignore file
...
This became unnecessary when the linker script parser was rewritten ad-hoc
2020-01-19 11:02:47 +01:00
ISSOtm
50f091ab7c
Fix RGBLINK failing to read args on certain machines
...
`char` has implementation-defined signedness, and if it's chosen to be unsigned,
then -1 gets converted to 255, which is then promoted back to `int` as... 255,
always failing the loop condition in src/link/main.c:118
`int8_t` has the correct signedness, but considering `musl_getopt_long_only`
returns `int`, better use that so as not to lose any bits
2020-01-18 22:12:25 +01:00
ISSOtm
7437f7eb85
Clarify redefinition error message
2020-01-17 03:53:27 +01:00
ISSOtm
d6a99981d6
Fix checkcodebase warnings
2020-01-16 22:31:24 +01:00
ISSOtm
71fe652556
Allow ROMX and WRAMX sections in restricted modes
...
Closes #462 , although with this implementation `BANK("some ROMX section")` would
return 0 instead of 1, which I think is benign anyways
2020-01-16 22:24:05 +01:00
ISSOtm
89917ef688
Put semicolons before labels in test suite
2020-01-16 22:09:31 +01:00
Eldred Habert
097e4c9799
Merge pull request #468 from ISSOtm/include_stem
...
Enforce trailing slash in include paths
2020-01-16 19:18:00 +01:00
ISSOtm
2c37a1e971
Fix default warning states
...
They were in the wrong order for some reason, this especially caused user
warnings to be off by default
2020-01-16 19:16:54 +01:00
ISSOtm
2c52364978
Add test for fixed section addresses
2020-01-16 18:12:42 +01:00
ISSOtm
10140f74dc
Allow RGBLINK to report multiple sanity check errors
2020-01-16 18:10:35 +01:00
ISSOtm
558e8f46ff
Sanity check fixed address of sections in RGBLINK
...
This could otherwise cause segfaults while reporting errors (!) during placement
2020-01-16 12:41:23 +01:00
ISSOtm
9ccb71205a
Remove stale clean line
...
Those files don't exist in RGBLINK's source anymore
2020-01-14 11:42:07 +01:00
ISSOtm
e50bcaa272
Enforce trailing slash in include paths
...
Fixes rednex#456
2020-01-13 22:48:59 +01:00
ISSOtm
86a28e8201
Provide string arguments to errors in constexpr_BankSection
...
How the f did it work before
2020-01-13 15:13:19 +01:00
ISSOtm
95cd0c6e53
Add test for BANK() in constant context
2020-01-12 13:09:27 +01:00
ISSOtm
23ab245cec
Return a consistent number for const BANK() when erroring out
2020-01-12 13:07:48 +01:00
ISSOtm
eb82476591
Make bank of "bank 0" sections known to RGBASM
...
This allows `BANK("Some ROM0 section")` to be used in a constant expression
2020-01-10 14:57:39 +01:00
ISSOtm
f1f70d250a
Add test for DEF(@)
2020-01-09 06:10:28 +01:00
ISSOtm
98a221d6b6
Add test for DEF(@)
2020-01-09 02:10:48 +01:00
Eldred Habert
fb22d12b0f
Merge pull request #463 from ISSOtm/windows_test_suite
...
Run tests on MinGW versions
2020-01-09 01:15:47 +01:00
ISSOtm
83249ed69f
Cap the number of concurrent jobs for testing
...
This has a serious tendency to just blow up process load (~35 here with the shim)
2020-01-09 01:10:51 +01:00
ISSOtm
1534df0b3c
Use minGW's pkg-config
2020-01-09 01:10:51 +01:00
ISSOtm
ece9177f5a
Produce shims to run the test suite on Windows bins via Wine
2020-01-09 01:10:51 +01:00
ISSOtm
8a90d74340
Ignore line endings in test suite
...
This removes many false positives with Windows
2020-01-09 01:10:51 +01:00
ISSOtm
5a06fad31e
Separate stdout and stderr in tests
...
POSIX leaves undefined the order of output if stderr is injected into stdout,
and in practice it differs on Windows (Linux buffers both streams separately,
Windows interleaves them as they arrive without buffering).
This should help testing on other platforms
2020-01-09 01:10:51 +01:00
Eldred Habert
add07259f4
Merge pull request #465 from ISSOtm/rebuild_version
...
Always update version
2020-01-09 01:01:11 +01:00
Eldred Habert
36ca18bc7b
Merge pull request #466 from AntonioND/an/warning
...
Fix declaration of constexpr_BankSymbol()
2020-01-09 00:46:47 +01:00
Antonio Niño Díaz
6003be3fae
Fix declaration of constexpr_BankSymbol()
2020-01-08 23:33:42 +00:00
ISSOtm
6d9399e3a0
Always update version
...
Implements https://github.com/rednex/rgbds/pull/378#issuecomment-569836686
2020-01-09 00:27:22 +01:00
Eldred Habert
676800476d
Merge pull request #430 from ISSOtm/known_selfbank
...
Make `BANK(@)` and `BANK("section")` known to RGBASM
2020-01-08 18:56:28 +01:00
Eldred Habert
4dfa3157e5
Merge pull request #454 from ISSOtm/unlocked_windows
...
Fix mingw build
2020-01-08 13:14:13 +01:00
Eldred Habert
f26cfa2d94
Merge pull request #455 from ISSOtm/man
...
Overhaul RGBDS man pages and help messages
2020-01-07 22:44:58 +01:00
ISSOtm
d3328406a2
Improve jr out-of-reach error message
2020-01-02 14:06:40 +01:00
ISSOtm
3564b3f9ea
Have jr offset wrap with 16 bits
...
Overflow with `int16_t` is defined to two's complement so it's OK
This could trigger when jumping from the top of ROM0 to HRAM
2020-01-02 14:03:54 +01:00
ISSOtm
b81faeccfa
Rename rgbfix long opt verbose to validate
...
The previous name was probably copy-pasted, it was completely wrong
2019-12-29 17:41:19 +01:00
ISSOtm
1c4cb2cd2d
Add warning option to RGBASM man synopsis
2019-12-29 17:38:46 +01:00
ISSOtm
6959b76749
Rework help/usage messages
...
Trimmed down the option lists as per @bentley's request;
Reinstated the man pages' synopsis
2019-12-29 17:38:08 +01:00
ISSOtm
8a1e920e23
Fix incorrect line counting when running REPT blocks.
...
Fixes #461
2019-12-12 23:46:16 +01:00
ISSOtm
606519c515
Touch up ds documentation as per rednex#350
2019-12-12 23:22:51 +01:00
ISSOtm
34618e0294
Overhaul RGBDS man pages and help messages
2019-12-12 23:22:51 +01:00
ISSOtm
373762dedc
Fix lack of newline when passing no files to RGBLINK
2019-12-10 18:35:40 +01:00
ISSOtm
b30dfb166b
Fix a line over 80 chars
2019-12-08 00:08:44 +01:00
ISSOtm
36db3257f3
Align fatalerror return code with every other one
2019-12-08 00:07:48 +01:00
ISSOtm
cad23465a5
Remove flex from the list of dependencies in the README
2019-12-08 00:04:15 +01:00
ISSOtm
d23401316e
Improve pc-bank test
2019-12-07 23:44:00 +01:00
ISSOtm
b49e025703
Allow BANK() in constexpr expressions
2019-12-07 23:43:02 +01:00
ISSOtm
e4f4706508
Add tests for new "known self-bank"
2019-12-07 22:15:07 +01:00
ISSOtm
02fe73d1f3
Make BANK("Section") known at assembling time when possible
...
If the target section is in the current file and its bank is known,
this means this value is known prior to linking.
2019-12-07 22:15:07 +01:00
ISSOtm
74f43d4e09
Add a way to seek a SECTION by name without creating one
2019-12-07 22:15:07 +01:00
ISSOtm
54ed050ecf
Make BANK(@) known at assembling time when possible
...
If the current section's bank is fixed, this means this value is
known prior to linking.
2019-12-07 22:12:57 +01:00
ISSOtm
f262d3b34b
Fix undefined behavior in readlong
...
See the new comment for what caused the UB, and how it was fixed
2019-12-07 21:19:13 +01:00
ISSOtm
32f7860a4e
Fix possible 0-length array in RGBLINK
2019-12-07 15:23:52 +01:00
ISSOtm
b62832e94d
Move empty entries warning to -Wextra
...
Since the behavior actually kinda makes sense, it's better as extra.
2019-12-07 02:48:06 +01:00
ISSOtm
e5820312d4
Document actual behavior of empty entries in db and co
2019-12-07 02:46:59 +01:00
ISSOtm
f710f21ad8
Reorder warnings alphabetically
2019-12-06 12:06:21 +01:00
ISSOtm
90fefb468b
Remove user warnings from -Wall
...
It does not make sense to include it there, as it's enabled by default.
2019-12-06 12:06:21 +01:00
ISSOtm
21f4cafef5
Make -Werror= with a meta warning an error
...
The previous behavior was to just enable the meta warning's warnings.
This is an error now because it doesn't make sense to do that, does it?
2019-12-06 12:06:21 +01:00
ISSOtm
b1d4be66e4
Remove deprecated "section charmap" feature
2019-12-04 01:56:06 +01:00
ISSOtm
ef43ae0eea
Add a verbose print each time a file is included
2019-12-04 01:55:01 +01:00
ISSOtm
9976a139de
Update test repos to latest commits
...
They work, and after an upcoming change the current ones are not
going to anymore!
2019-12-04 01:54:22 +01:00
ISSOtm
5718354500
Get rid of joinexpr()
...
This macro hid away the arguments to the underlying call, and served
no purpose beyond saving the programmer some typing. This is 2019,
people have IDEs (even Vim!) with autocompletion.
2019-12-04 00:21:57 +01:00
ISSOtm
2d7d9eef9f
Fix some make checkcodebase errors
...
- Reorder checkpatch ignore flags alphabetically
- Fix checkpatch WARNINGs and CHECKs when they make sense
- Add more checkpatch ignores
2019-12-04 00:16:28 +01:00
ISSOtm
a290e19f46
Make make checkcodebase ignore extern/
...
That folder contains external code, and modifying it to conform to our
code style would make applying upstream patches, amongst others,
problematic. Therefore, skip checking it.
Ideally, the folder should also be excluded from `make checkpatch`,
but I haven't figured out a way to do that yet.
2019-12-03 23:09:07 +01:00
ISSOtm
92a2be62fe
Remove lex rules from Makefile
...
Since the RGBLINK rewrite, there have been no .l files in the whole codebase
(RGBASM has the C file directly, for better and for worse)
Since flex isn't used anymore, it's a good idea to remove it from the Makefile
so people don't think it's a dependency.
2019-12-03 23:02:38 +01:00
ISSOtm
5410dba4f4
Do prevent using org in linker scripts to go backwards
2019-11-27 01:37:00 +01:00
ISSOtm
d93ad2e650
Rename all functions imported from musl
...
This is to avoid conflicting with libraries, which occurred in the mingw builds
2019-11-23 23:08:44 +01:00
ISSOtm
68410d35d3
Get rid of unlocked_stdio functions
...
Those did not provide a significant speedup, and are not provided by mingw
2019-11-23 23:00:44 +01:00
ISSOtm
ceae4a44f3
Stop using f(un)?lockfile
...
Those are only useful for locking file IO across threads, but RGBLINK is
single-threaded anyways, so they don't matter. Plus, they aren't provided by
mingw, so that'll remove part of the problem
2019-11-23 22:21:11 +01:00
ISSOtm
ea003487aa
Use trap_ instead of abort() for consistency
2019-11-23 21:59:36 +01:00
Eldred Habert
401fd8b56b
Merge pull request #452 from ISSOtm/warn
...
Add support for toggleable warnings
2019-11-18 20:58:21 +01:00
ISSOtm
191ee4ba1f
Add support for toggleable warnings
2019-11-18 20:45:21 +01:00
ISSOtm
58556f91f7
Disable chcecking for global initialisers
...
This is specific to the kernel and does not apply to us
2019-11-18 12:45:38 +01:00
ISSOtm
faa7893761
Fix develop error in getopt_long_only
...
The error was due to casting `const` away for permuting argv
elements, which is necessary for a libc for compatibility with older
systems, but not for us.
Checkpatch will complain about the style not being followed, but this is not
our code, so it can be ignored.
2019-11-09 00:48:00 +01:00
Eldred Habert
648df0dc7d
Merge pull request #449 from ISSOtm/better_error_msg
...
Report overlapping sections whenever possible
2019-11-06 09:00:11 +01:00
ISSOtm
44173dbe8b
Improve error messages slightly
2019-11-06 08:48:24 +01:00
ISSOtm
7233f568a7
Report overlapping sections whenever possible
2019-11-06 08:40:13 +01:00
Eldred Habert
197f1e9b7b
Merge pull request #444 from ISSOtm/fix_develop
...
Fix errors in `make develop`
2019-11-06 08:34:37 +01:00
Eldred Habert
7063f66b2d
Merge pull request #450 from ISSOtm/labels_in_sections
...
Prevent creating labels outside of sections
2019-11-06 08:33:25 +01:00
Eldred Habert
6e59bcb60e
Merge pull request #447 from ISSOtm/long_opts
...
Add long options
2019-11-06 02:34:26 +01:00
ISSOtm
0649e6d65f
Add long options
2019-11-06 00:48:41 +01:00
ISSOtm
072c965ba5
Add musl's implementation of getopt_long_only
...
Both `getopt_long` and `getopt_long_only` are GNU-specific, so we'll be
copying musl's implementation for portability.
This was retrieved as of commit 90251cf73dfdd44e7a3f085d236e89a7dff1b00b.
musl is licensed as MIT, which is compatible (being identical...) to RGBDS'.
The file is being copied as-is, without a copyright notice or attribution,
but this is only to have a verbatim copy in the history. Those will be added
in the next commit.
2019-11-06 00:40:55 +01:00
ISSOtm
122f5fe12e
Prevent creating labels outside of sections
...
This doesn't make sense, and causes RGBLINK to misbehave
2019-11-04 08:35:00 +01:00
ISSOtm
a40d599cd7
Fix extraneous comma in error message
2019-11-04 01:20:23 +01:00
ISSOtm
babf36e96e
Don't forget to initialize additional banks when using an overlay
2019-11-04 01:16:08 +01:00
ISSOtm
d6a43f6a53
Fix RGBGFX man page
...
- Add color curve option to synopsis
- Fix ordering of `-d`'d description
2019-11-03 21:21:53 +01:00
Eldred Habert
ff8e38fcc6
Merge pull request #441 from ISSOtm/linker_error_stack
...
Make linker output error stacks instead of their top level
2019-11-03 16:41:09 +01:00
Eldred Habert
192f2de704
Merge pull request #440 from ISSOtm/nested_brackets
...
Allow nested bracketed symbols
2019-11-03 16:40:34 +01:00
Eldred Habert
c568b3a976
Merge pull request #439 from ISSOtm/tests_locale
...
Run tests under a specific locale
2019-11-03 16:30:38 +01:00
Eldred Habert
9c818ef3e1
Merge pull request #438 from ISSOtm/sub_doc_fix
...
Fix documentation for `sub`, `sbc` and `cp`
2019-11-03 16:18:09 +01:00
Eldred Habert
5aea30f40d
Merge pull request #434 from ISSOtm/rgblink_rewrite
...
Rewrite RGBLINK entirely
2019-11-03 16:15:37 +01:00
ISSOtm
09c9395ff8
Fix NULL deref when fetching an unknown symbol in RPN expressions
...
was being overwritten with the result, so
was meaningless. Using a temporary instead is better.
2019-11-02 22:37:10 +01:00
ISSOtm
81047afb4b
Rework "overflow" error message
2019-11-02 22:37:10 +01:00
ISSOtm
f1441cc962
Make linker script error messages more descriptive
...
Provide file names when appropriate, print memory locations in hex
2019-11-02 22:37:10 +01:00
ISSOtm
50804d661a
Fix linkerscript not updating section categorization
2019-11-02 22:37:10 +01:00
ISSOtm
9b895e8a0a
Fix bank-fixed sections going in any bank
2019-11-02 22:37:10 +01:00
ISSOtm
4600f70fef
Fix address-fixed sections potentially incorrectly assigned
...
This happened if all space before their fixed location was taken
2019-11-02 22:37:10 +01:00
ISSOtm
9e33cc998f
Implement INCLUDE keyword in linker scripts
2019-11-02 22:37:10 +01:00
ISSOtm
5496c2e76f
Make linkerscript errors report file names
2019-11-02 22:37:10 +01:00
ISSOtm
bf75971a3a
Only open files when necessary
2019-11-02 22:37:10 +01:00
ISSOtm
8a59994c0d
Fix false positives in readstr
...
Reading the byte `EOF & 0xFF` would cause an incorrect termination
2019-11-02 22:37:10 +01:00
ISSOtm
f2e1b7d868
Add EOF checking in string reading
...
Fixes rednex/#422
2019-11-02 22:37:10 +01:00
ISSOtm
8c91b31ae6
Fix typo that led to segfault
2019-11-02 22:37:10 +01:00
ISSOtm
302b210470
Fix error in object file documentation
2019-11-02 22:37:10 +01:00
ISSOtm
5bd0076233
Write some doc comments
2019-11-02 22:37:10 +01:00
ISSOtm
0e24adcafd
Rewrite RGBLINK entirely
...
The goal was to improve readability, but along the way a few things were
gained.
- Sorted sym and map files
- Infrastructure for supporting multiple .o versions
- Valgrind-proof, as far as my testing goes anyways
- Improved verbosity messages
- Added error checking
- Performance improvements, see end of commit message
The readability improvement was spurred while trying to make sense of the
old code while trying to implement features such as sorted sym and map
files.
I also did my best to remove hardcoded logic, such that modifications
should be doable; for example, "RAM loading" sections, which are linked
against a different location than the one they're stored at.
Some work remains to be done, see the "TODO:" and "FIXME:" comments.
Further, while regression tests pass, this new linker should be tested on
different codebases (ideally while instrumented with `make develop` and
under valgrind).
The few errors spotted in the man pages (alignment) need to be corrected.
Finally, documentation comments need to be written, I have written a lot of
them but not all.
This also provides a significant performance boost (benchmarked with a
51994-symbol project):
Current master RGBLINK:
2.02user 0.03system 0:02.06elapsed 99%CPU (0avgtext+0avgdata 84336maxresident)k
0inputs+11584outputs (0major+20729minor)pagefaults 0swaps
Rewritten RGBLINK:
0.19user 0.06system 0:00.63elapsed 40%CPU (0avgtext+0avgdata 32460maxresident)k
23784inputs+11576outputs (0major+7672minor)pagefaults 0swaps
2019-11-02 22:37:10 +01:00
ISSOtm
696feae32e
Have RGBDS' err and warn output an error message
...
The stdlib functions specify the difference between `err` and `errx`
is that the former prints a message obtained with `strerror`.
However, RGBDS' implementation breaks that contract, and `warn`'s puts the
added semicolon in the wrong place.
2019-11-02 22:37:10 +01:00
ISSOtm
f7c2665e14
Fix errors in make develop
2019-10-30 13:34:21 +01:00
ISSOtm
ae0b95ec6d
Make linker output error stacks instead of their top level
2019-10-11 17:12:18 +02:00
ISSOtm
cdd8200936
Add test for nested brackets
2019-10-10 15:00:59 +02:00
ISSOtm
694075e840
Allow nested bracketed symbols
...
Fixes #320
2019-10-10 14:58:17 +02:00
ISSOtm
d76f994318
Run tests under a specific locale
...
Fixes #427
2019-10-10 13:23:36 +02:00
ISSOtm
11b7052f94
Fix flag documentation for sub, sbc and cp
2019-10-10 01:01:21 +02:00