Commit Graph
643 Commits
Author SHA1 Message Date
Rangi 30974be312 Add -Wsingle-union warning for UNION without NEXTU (#2170) 2026-09-27 20:02:42 -04:00
Rangi 4f4800f385 Add __CYCLES__ variable to count cycles used by instructions (#2171) 2026-09-27 19:59:32 -04:00
Rangi ab600acdff Add %A/%a uppercase/lowercase string format specifiers (#2165) 2026-09-26 19:30:05 -04:00
Rangi 477daf099f Make STRCMP and STRICMP tests more precise 2026-09-26 18:31:53 -04:00
Rangi ab9650bcfa Allow RSSET to take a negative value (#2167) 2026-09-26 18:24:39 -04:00
Rangi 95206f24a0 Add STRICMP case-insensitive string compare function (#2164) 2026-09-26 18:19:10 -04:00
Rangi ab0d81591d Add POPCOUNT function (#2166) 2026-09-26 18:17:31 -04:00
RangiandEldred Habert 8328b0364b Make the comma after assert warn/fail/fatal optional (#2160)
Co-authored-by: Eldred Habert <[email protected]>
2026-09-26 13:55:35 -04:00
Rangi fabc276a92 Implement compound assignment operators **= and >>>= (#2158) 2026-09-26 13:10:39 -04:00
Rangi 2de2747389 Allow STARTOF(SECTTYPE) and SIZEOF(SECTTYPE) to be constant when possible (#2131) 2026-09-26 13:08:28 -04:00
Rangi 8bb0fbf8ae Add STRSTARTS and STRENDS functions (#2159) 2026-09-26 13:04:14 -04:00
Rangi ada6be082e Add error check for empty OPT string 2026-10-21 17:25:21 -04:00
ISSOtm d766efe95d Use a vector for emitting section patches
Turns out this makes errors be emitted in source order,
which is far more intuitive and pleasant-looking!
2026-10-17 14:39:51 -04:00
Rangi 7d00c170a5 Use more static_assert in place of assert 2026-10-15 10:18:12 -04:00
Rangi 586bd2eec8 Non-constant expressions do not fail a static_assert (#2215) 2026-10-14 19:24:47 -04:00
Eldred HabertandRangi ddd4ba9952 Always link asm tests (#2151)
We don't want to accidentally have a test pass because an
`assert` gets deferred to a linker invocation that never happens!

---------

Co-authored-by: Rangi <[email protected]>
2026-10-14 18:01:12 -04:00
Rangi 85fdb3b111 Use static_assert in RGBASM tests whenever possible (#2213) 2026-10-14 14:39:59 -04:00
Rangi d73a05aa78 Fix backtraces for REPT nodes with quiet non-REPT ancestors (#2196) 2026-10-03 22:16:58 +02:00
Rangi 1d4c741975 Test division and modulo at link time as well as asm time 2026-09-27 14:01:36 -04:00
ISSOtm 6a08e809b5 Mark an asm test as failed if linking fails 2026-09-25 13:48:10 -04:00
Rangi 646cb05faf Fix BANK(@) discrepancy within LOAD blocks (#2149)
RGBASM and RGBLINK disagreed on which section to consider `@` to be in;
we have decided that the latter is correct.

The `assume` change is known to be suspicious; for more discussion, see
https://github.com/gbdev/rgbds/pull/2149#discussion_r4106902830
2026-09-25 19:18:52 +02:00
Rangi42 dc701294f8 Add an additional check to the jr-@ test (ported from rsgbds) 2026-09-25 12:59:00 -04:00
RangiandEldred Habert 04bbe80ae0 Some shell script style improvements (#2087)
* Escape special characters in filenames when comparing gfx .err output
* Use `if` instead of `&&`
* Use `case` instead of `if` disjunction

---------

Co-authored-by: Eldred Habert <[email protected]>
2026-09-21 10:15:40 -04:00
Rangi a2dd318f1d Remove executable status from non-script files (git update-index --chmod=-x) 2026-09-20 19:46:40 -04:00
Rangi f4c6221eb1 Fix underflow of ALIGN[16, offset] (#2090) 2026-09-15 20:22:33 -04:00
Rangi d81ab2fb23 Fix underflowing SECTION FRAGMENT fixed address (#2091) 2026-09-15 20:22:19 -04:00
Rangi ed1ac7309b Fix overflow with high fixed-point magnitudes 2026-09-14 14:27:16 -04:00
Rangi d082f24a2d Fix rounding of fixed-point constants where fractional digits should carry into integer part (#2088) 2026-09-14 13:52:39 -04:00
Rangi 47bbd30f2c Fix a failing assertion when two sections have the same name (#2079) 2026-09-12 17:58:37 -04:00
Rangi fdd6cece30 Warn about signed 8-bit truncation for add sp, e8 and ld hl, sp + e8 2026-09-07 19:28:45 +02:00
Rangi 7d0cb000e8 Specify COLUMNS in test scripts for consistent output 2026-09-06 00:07:16 +02:00
Rangi a2c52caca2 Disallow NUL characters in section names and assertion messages
Allowing these in object files would lose anything after the '\0'
when RGBLINK reads the object.
2026-08-22 19:51:03 -04:00
Rangi 21a4b85a4f Fix STRFMT stopping at NUL characters in format spec strings 2026-08-22 19:23:49 -04:00
Rangi 9fa5058add Correct error message for macro arg \<-INT_MIN> 2026-08-22 19:02:23 -04:00
Rangi e287ee2724 Fix C++ UB from negating INT_MIN with macro shift INT_MIN 2026-08-22 18:48:36 -04:00
Rangi 196d50c1d7 Add XXX: comment tag to working but fragile test cases 2026-07-13 22:39:41 -04:00
Rangi 96bc58b7f7 Add test case for local labels that superficially look like keywords 2026-07-11 13:51:53 -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 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 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
Rangi 9bbb2247a7 Fix rgbasm -Werror=... not adding to the final error count 2026-07-03 13:05:33 -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 d56dbbb4bf Refactor section creation errors, and simplify output for single errors (#1964) 2026-05-21 13:01:08 -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
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