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
Rangi42
2130a5ba1f
Error messages refer to "undefined" symbols and sections
2025-08-08 19:47:42 -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
2eeb333be0
Factor out more shared math operations between RGBASM and RGBLINK
2025-08-02 19:55:44 -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
d6a28a6259
Prefer pre-increment/decrement operators in for loops
2025-07-24 18:08:17 -04:00
Rangi42
2ce4cdbff6
Reduce deep nesting some more, including larger refactors to assign.cpp
2025-07-22 19:38:49 -04:00
Rangi42
c83b87e0a0
Make all non-extern globals static
2025-07-21 20:14:09 -04:00
Rangi42
0cd60ea1e6
Use a patch_AddAssertion function instead of extern assertions
2025-07-21 17:49:41 -04:00
Rangi
5eb093f13e
Implement warning diagnostic flags for RGBLINK ( #1754 )
2025-07-17 12:54:29 -04:00
Rangi42
8bebab1db0
Abbreviate RGBLINK errput that includes a src+lineNo
2025-07-15 18:37: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
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
Rangi
b35e9d86fb
Remove redundant @-style doc comment tags ( #1641 )
2025-01-29 19:56:28 -05:00
Rangi
f61019dd68
Add more RGBLINK test coverage ( #1637 )
2025-01-29 11:41:08 -05:00
Rangi42
cae31005f8
Always use braces with InsertBraces: true in .clang-format
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
fac5e35d24
Prefer empty braces to semicolons for empty loop bodies
2025-01-17 00:20:33 -05:00
Sylvie
c1c5b10082
Deprecate LDH with $00-$FF ( #1575 )
2024-12-10 21:27:37 -05:00
Sylvie
b877c81c32
Use C++-style casts ( #1576 )
2024-12-09 21:56:54 -05:00
Sylvie
bc5a71ff88
Update some RGBLINK error messages ( #1544 )
2024-10-16 01:42:49 +02:00
Rangi42
6bc2446966
Rephrase error messages for consistency
2024-09-10 21:38:50 +02:00
Sylvie
323028d9f2
RGBLINK lists local symbols when encountering an unknown symbol reference ( #1496 )
2024-09-06 21:31:13 -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
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
e93190d491
Implement BITWIDTH and TZCOUNT functions ( #1450 )
2024-08-07 10:39:30 -04: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
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
Sylvie
a234da42a6
Replace assert with assume for release build optimization ( #1390 )
2024-04-02 11:09:31 -04:00
ISSOtm
20b7b591d4
Run clang-format
...
Fix some small style inconsistencies
2024-03-28 01:41:25 +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
Rangi42
506911d7d0
Refactor to avoid redundant obj_CheckAssertions function
2024-03-27 16:19:01 -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
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
4a7d333891
Use std::unique_ptr for rgblink sections ( #1337 )
2024-03-09 11:12:01 -05:00
Sylvie
53537cf9af
Remove now-unnecessary enum keyword ( #1338 )
...
C++ does not need it
2024-03-08 19:40:41 -05:00
Rangi42
aed172071b
Replace some macros with static functions or constants
2024-03-07 16:10:05 -05:00
Sylvie
e74073e480
Run clang-format on everything ( #1332 )
2024-03-04 14:22:49 -05:00
Rangi42
f2c875e71e
Avoid using std::get except in holds_alternative-asserting accessors
2024-03-03 23:33:23 -05:00
Sylvie
447c561aaa
Use std::variant for symbol values ( #1330 )
2024-03-03 21:16:36 -05:00
Rangi42
930a5c3e44
Replace RGBLINK non-null pointers with references
2024-03-03 00:57:03 -05:00
Rangi42
52f8ecc347
We do not call malloc/free any more
2024-03-02 08:16:44 -05:00
Rangi42
e14ba664ea
Remove redundant (void) parameter declarations
2024-03-01 10:41:47 -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
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
96f354026a
Use automatic allocation for section data
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