Commit Graph

3190 Commits

Author SHA1 Message Date
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 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