Commit Graph

628 Commits

Author SHA1 Message Date
Antonio Niño Díaz
8ea3669a64 Merge pull request #235 from obskyr/rgbgfx-color
Add color support to rgbgfx (again)!

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-02-20 19:56:39 +00:00
obskyr
8fe5293077 Allow superfluous height for 1-tile-wide images
Currently used here and there for small, icon-like tiles, it seems.

Signed-off-by: obskyr <powpowd@gmail.com>
2018-02-20 10:06:33 +01:00
obskyr
825fa915ee Fix rgbgfx's code style
Signed-off-by: obskyr <powpowd@gmail.com>
2018-02-20 10:06:00 +01:00
obskyr
885e8ea24a Add to contributor list
Signed-off-by: obskyr <powpowd@gmail.com>
2018-02-20 09:35:07 +01:00
obskyr
898f75ce57 Clarify and update rgbgfx documentation
Signed-off-by: obskyr <powpowd@gmail.com>
2018-02-20 09:35:00 +01:00
obskyr
b8af100c63 Handle grayscale images as expected
Signed-off-by: obskyr <powpowd@gmail.com>
2018-02-20 09:34:48 +01:00
obskyr
3075945367 Add color and transparency support to rgbgfx
In addition, fix various bugs.
Among them are minor memory issues and edge cases with certain inputs.

Signed-off-by: obskyr <powpowd@gmail.com>
2018-02-20 09:33:53 +01:00
Antonio Niño Díaz
d602ebfde5 Fix typo in rgblink manpage
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-02-18 19:57:02 +00:00
Antonio Niño Díaz
305512a2b7 Increase version number to 0.3.5
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
v0.3.5
2018-01-28 13:08:00 +00:00
Antonio Niño Díaz
a6b244b12e Move version files out of extern folder
The folder extern is reserved for external contributions, not common
files.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-28 13:07:21 +00:00
Antonio Niño Díaz
ceabbeaa2f Fix linkerscript man page
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 17:25:21 +00:00
Antonio Niño Díaz
3995852cc5 Fix nit in rgbasm.5 man page
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 15:19:18 +00:00
Antonio Niño Díaz
9793bcba6f Fix local execution of run-tests.sh script
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 15:04:17 +00:00
Antonio Niño Díaz
0727eb4374 Add test to verify hex codes of all instructions
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 14:38:52 +00:00
Antonio Niño Díaz
f8f67fcbce Add external projects to Travis CI jobs
Small tests like the ones included in this repository are good to test
individual features, but it is also a good idea to test some real
projects.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 11:14:10 +00:00
Anthony J. Bentley
abeca2d305 Prefer snprintf to strncpy when outputting C strings
strncpy is designed to output to fixed‐width buffers, not C strings
(hence its weird null termination behavior). In this case it happens to
work correctly due to the length check but, for style reasons, I would
rather use snprintf. Especially in this case, where it shortens the
code a bit.
2018-01-27 01:22:58 +00:00
Antonio Niño Díaz
a7dc86001c Add note about the MIT License in CONTRIBUTING.rst
Also, LICENSE.rst doesn't have any special formatting now, so it has
been renamed to LICENSE.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 00:47:06 +00:00
Antonio Niño Díaz
c071586ae5 Remove dependency of reallocarray()
By removing this dependency, all of the code of this repository is
licensed under the MIT license.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 00:30:13 +00:00
Antonio Niño Díaz
c6187be210 Remove dependency of strlcpy()
There was only one place where `strlcpy` was still used.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 00:02:44 +00:00
Antonio Niño Díaz
f9f3bb7761 Remove dependency of strlcat()
There was only one place where `strlcat` was used, and `snprintf`
actually does a better job at what the code was trying to achieve.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 00:02:26 +00:00
Antonio Niño Díaz
1a5c423984 Relicense codebase under MIT license
With permission from the main authors [1], most of the code has been
relicensed under the MIT license.

SPDX license identifiers are used so that the license headers in source
code files aren't too large.

Add CONTRIBUTORS.rst file.

[1] https://github.com/rednex/rgbds/issues/128

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-26 22:59:02 +00:00
Antonio Niño Díaz
b382dffdec Split src/asm/charmap.c into two files
This way it is easier to identify the license of the code.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-26 22:55:13 +00:00
Antonio Niño Díaz
33e9eb098c Exclude html files from checkpatch
Also, fix 2 nits in the codebase.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-26 18:57:25 +00:00
Antonio Niño Díaz
e77ebfe38a Disable OSX builds in Travis CI
Travis seems to be having some problems with OSX builds, so it's better
to disable them temporarily.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-25 22:23:43 +00:00
Antonio Niño Díaz
698ed9d5fc Don't clean html files with make clean
Added a new target to remove html files: `cleanwwwman`.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-25 22:12:31 +00:00
Antonio Niño Díaz
b07a8501d6 Fix linkerscript linking errors
The problems were introduced by the following commits:

- 959bfe2a9d

- 975200834e

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-25 22:07:16 +00:00
Antonio Niño Díaz
f779e724e2 Fix typo in manpage
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-24 20:29:27 +00:00
Antonio Niño Díaz
494b98e46a Fix html doc file name
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-24 20:29:09 +00:00
Antonio Niño Díaz
d1ff057889 Make clean target of Makefile clean html files
The html files generated with `make wwwman` weren't cleaned correctly
with `clean`.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-23 22:54:37 +00:00
Antonio Niño Díaz
292302c6d1 Move documentation to this repository
Modified Makefile wwwman target to output files inside docs/.

Modified .gitignore to allow *.html files.

Update README.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-23 21:28:10 +00:00
Antonio Niño Díaz
b55fead749 Fix typo in documentation
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
v0.3.4
2018-01-23 20:37:00 +00:00
Antonio Niño Díaz
844e027a18 Increase version number to 0.3.4
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-23 20:30:47 +00:00
Antonio Niño Díaz
0fb80cd7a9 Fix indentation in asmy.y
Remove extra spaces.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-21 22:51:42 +00:00
Antonio Niño Díaz
311b412f5d Improve error messages
NULL error messages have been given a description.

Messages that weren't descriptive enough now also print the name of the
function that has failed.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-16 22:39:44 +00:00
Antonio Niño Díaz
975200834e Fix WRAMX BANK offset in the right place
ROMX and WRAMX bank numers are stored in an object file as their number
minus one. This means that this offset has to be applied somewhere.

The old code applied the fix for ROMX and WRAMX in two different places.
It looks like the patch that added support for WRAMX didn't set the
offset correctly in 'src/link/assign.c'. When this was fixed, it was
done in the wrong place, in 'src/asm/asm.y'. This patch moves the fix to
'src/link/assign.c'.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-16 22:39:44 +00:00
Antonio Niño Díaz
c8fa799883 Output error msg when object file can't be opened
In rgbasm, output a fatal error if the destination object file can't be
opened.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-16 22:39:44 +00:00
Antonio Niño Díaz
7f37eef218 Cleanup BANK related definitions
Simplify comparisons and remove magic numbers.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-16 00:46:29 +00:00
Antonio Niño Díaz
8521e45edc Reduce SRAM bank number to 16 in rgbasm
The limit was already 16 banks in the linker, which made the previous
limit of 511 useless.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-14 16:12:29 +00:00
Antonio Niño Díaz
7bd082563d Add CONTRIBUTING.rst file
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-14 14:07:22 +00:00
Antonio Niño Díaz
de32e245c9 PUSHS and POPS also affect the symbol scope
Now, when POPS is executed, it restores the symbol scope of the
corresponding PUSHS. That way, the local symbols previously available
can be used again after the POPS.

This is useful in cases like this one:

```
    SECTION "Section 1", ROMX

BigFunction:

    ...

.loop:

    ...

    PUSHS

    SECTION "Section 2", ROMX

DataForBigFunction:
    DB 1, 2, 3, 4, 5

    POPS

    ld  a,BANK(DataForBigFunction)
    ld  hl,DataForBigFunction

    ...

    jr  .loop
```

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-07 23:05:04 +00:00
Antonio Niño Díaz
f5164325d2 Convert Markdown files to reStructuredText
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-07 19:22:38 +00:00
Antonio Niño Díaz
959bfe2a9d Allow to request BANK() of sections and PC
The bank of a section can be requested with `BANK("Section Name")`, and
the bank of the current section with `BANK(@)`. In both cases, the bank
number is resolved by the linker.

New commands have been added to the list of RPN commands of object
files, and the rest has been moved so that new additions don't force a
new change in the number of the enumerations.

Increase object file version, as it is now incompatible with the old
format.

Update manpages to reflect the new ways of using `BANK()` and the new
format of the object files.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-07 02:05:05 +00:00
Antonio Niño Díaz
d24cf11ad4 Make list of linker symbols common
That way the definitions of the assembler and the linker are always the
same.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-05 00:32:50 +00:00
Antonio Niño Díaz
8d89ba39d4 Decouple commands in checkpatch Makefile target
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-04 21:54:10 +00:00
Antonio Niño Díaz
b04596a32b Move externs to header files
Follow Linux kernel coding style.

Remove exception from checkpatch.pl configuration file.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-04 01:28:23 +00:00
Antonio Niño Díaz
8e8865940a Join list of keywords of locallex.c and globlex.c
It made sense to have them in different files when the toolchain
targeted systems other than the GB. Now, there are no generic and
system-specific keywords because there is only one supported system.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-04 01:28:23 +00:00
Antonio Niño Díaz
3c14f9760f Fix echo command in checkpatch target in Makefile
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-03 19:46:48 +01:00
Antonio Niño Díaz
3c15b141e0 Add checkpatch.pl config file and Makefile targets
This is used to verify the coding style of patches.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-02 17:09:36 +01:00
Antonio Niño Díaz
72f801283d Cleanup code of rgbasm
Follow Linux kernel coding style.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-02 17:09:36 +01:00
Antonio Niño Díaz
2ffaf72e39 Cleanup code of rgbfix, rgbgfx and external libs
Follow Linux kernel coding style.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-02 13:16:53 +01:00