Commit Graph

489 Commits

Author SHA1 Message Date
Rangi42
45c2a5e4ec Consistently use uppercase hex digits 2023-10-31 14:28:38 -04:00
Rangi
84f3cb4075 ENDL restores the label scope from before LOAD (#1180) 2023-10-26 22:58:36 +02:00
Quinn
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 <remy.oukaour+rangi42@gmail.com>
2023-10-25 22:34:56 +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
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 <35663410+Rangi42@users.noreply.github.com>
2023-08-20 02:29:53 +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
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
Rangi
01f1703dfb Preserve \@ through INCLUDE
Fixes #1112
2022-12-11 18:56:03 +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
Robert Lewicki
1a9fc964df #1082 Add cache check for external repositories used during testing (#1100)
Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
2022-10-25 08:39:19 +02: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
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
08545643cf Only define @ and _NARG when they have values (#1073)
Fixes #1069

Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
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
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
dec4133e84 SECTION(symbol) returns the name of a symbol's section (#1066)
Fixes #963

Co-authored-by: Eldred Habert <eldredhabert0@gmail.com>
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
Rangi
f88968ec20 Fix rgbasm -b and rgbasm -g (#1052)
Fixes #1051
2022-09-25 10:22:55 +02:00
Rangi
b8385a50e3 Support -P/--preinclude to pre-INCLUDE a file (#1043)
Fixes #1041

Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
2022-09-24 12:37:16 -04:00
Rangi
98a6dffbca Implement opt Q for fixed-point precision, and q literals (e.g. 12.34q8) (#958)
Fixes #957

Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
2022-09-05 00:47:32 +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
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
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
8207dc57b7 Add a -Wunmapped-char warning for characters not in the charmap (#1023)
Fixes #1022
2022-08-28 15:12:43 -04: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
3f70372308 Implement slicing input image 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
caaf7a8444 Test VRA0 size as well in randtilegen tests 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
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
cbf6fadcdb Add RGBGFX tests 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
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
Eievui
ed104a9f70 Add rgbgfx test program
Co-Authored-By: ISSOtm <eldredhabert0@gmail.com>
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