Commit Graph

368 Commits

Author SHA1 Message Date
Ben10do
9be7c4c849 Remove duplicate documentation of -E
Remove Sanqui’s documentation of the -E argument to rgbasm, in favour of bentley’s better-worded one.
2017-02-07 11:05:35 +00:00
Anthony J. Bentley
5ee058f217 Merge branch 'linker-refactor-assign' of https://github.com/Ben10do/rgbds 2017-02-05 23:24:13 -07:00
Ben10do
420ea638a7 Refactor section assignment in linker
Deduplicates and generalises a lot of code in assign.c:

- Replace area_AllocAbs*AnyBank() with area_AllocAbsAnyBank() function
that accepts a section type parameter
- Replace area_Alloc*AnyBank() with area_AllocAnyBank()
- Replace FindLargest*() with FindLargestSection()
- Replace Assign*Sections() with AssignBankedSections()
- Add VerifyAndSetBank(), which enables bank checks (and addition with
BANK_*) to be centralised
- Refactor the initialisation of AssignSections(), removing some magic
numbers and only setting MaxAvail[i] once
- Overhaul the duplicated cases throughout AssignSections()
2017-01-27 08:56:36 +00:00
Ben10do
b40c567aee Add ldi a, [hl] and ldd a, [hl] instructions
These are equivalent to ld a, [hl+] and ld a, [hl-] respectively.
2017-01-26 16:55:00 +00:00
Anthony J. Bentley
547abfefc1 Merge branch 'fatal-error-noreturn' of https://github.com/Ben10do/rgbds 2017-01-25 00:47:25 -07:00
Ben10do
06f0472f81 Emit a single error when using BANK incorrectly
Previously, if BANK is used when defining a section that’s not ROMX,
WRMAX, SRAM or VRAM, a second error message would appear, e.g. “(null)
bank value $1 out of range $5d to $0”.

This would appear due to the usage of uninitialised variables. This
change ensures that the uninitialised variables are not accessed when
using an invalid section.

This also silences compiler warnings about usage of uninitialised
variables.
2017-01-24 11:50:18 +00:00
Ben10do
defd4f589e Add noreturn attribute to fatalerror()
Should silence compiler warnings that expect fatalerror() to return.
2017-01-24 11:38:26 +00:00
Anthony J. Bentley
dc4a98048d Simplify string copy by using strlcpy(). 2017-01-24 01:26:55 -07:00
Anthony J. Bentley
efaa6d9ff7 Add .gitignore. 2017-01-24 01:19:16 -07:00
Anthony J. Bentley
ab19dab899 Merge branch 'include-cli' of https://github.com/AntonioND/rgbds 2017-01-24 01:18:28 -07:00
Ben10do
e86a70d2cb Fix the name of the GNUmakefile
GNU make actually looks for ‘GNUmakefile’, not ‘GNUMakefile’.

Consequently, GNU make would erroneously attempt to use the standard
makefile, instead of the GNU-specific one. This would cause an error
when attempting to import png.h, due to PNGFLAGS not being correctly
set.
2017-01-23 23:46:44 +00:00
AntonioND
a91187d8dc Increase number of include paths through CLI
Increase number of include paths that can be passed through the
command line interface. The previous number, 16, is only good enough
for small projects. 128 is still an arbitrary number, but it is harder
to reach.
2017-01-22 23:08:10 +00:00
AntonioND
0b5e074591 Output error messages for command line includes
The code that adds an include path to the array of paths doesn't check
the lenght of the path (which can cause overflows because of strcpy).

It doesn't check if the max number of paths has been reached, either.

This patch adds error messages for such cases, giving the user more
information than before and crashing the assembly instead of
continuing and failing when it can't find a file to include.
2017-01-22 23:04:50 +00:00
Anthony J. Bentley
f8531ed410 Add a thin wrapper makefile for GNU Make.
GNU Make 3.x doesn't support the "!=" syntax for shell assignment,
although 4.x does, BSD Makes do, and it has been submitted to POSIX
for possible inclusion in the standard. Unfortunately, GNU Make 3.x
is still in common use, so provide an alternative makefile (GNU Make
reads "GNUmakefile" instead of "Makefile" by default) that sets the
variables and then reuses the rest of the default Makefile.
2016-12-16 23:23:37 -07:00
Francisco Requena
0a8401741d Fixes rgbgfx linkage issues with old libpng (pre 1.4.2) 2016-12-17 04:04:45 +01:00
Anthony J. Bentley
a079a69b7c Add a note about installing libpng. 2016-10-22 14:13:19 -06:00
Anthony J. Bentley
d86cb41972 Rename png.h to makepng.h, to avoid conflicts with libpng's png.h. 2016-10-22 14:03:14 -06:00
yenatch
95cd960b3b Fix the order of flags when including libpng.
This apparently does matter.
2016-10-11 21:54:18 -06:00
Anthony J. Bentley
bed43d2530 Document rgbasm -E. 2016-09-05 02:46:59 -06:00
Anthony J. Bentley
c02b04f7d2 Merge branch 'export-all-2' of https://github.com/Sanqui/rgbds 2016-09-05 02:43:23 -06:00
Anthony J. Bentley
2339f0fbae Merge branch 'an/fix-gfx-prefix' of https://github.com/AntonioND/rgbds 2016-09-05 02:35:24 -06:00
Anthony J. Bentley
6e0aca47d4 Declare string uppercase/lowercase functions unconditionally.
Avoid naming them str*(), because such names are reserved by ISO C.
2016-09-05 01:41:39 -06:00
Anthony J. Bentley
a8c603a7e8 Removed the wrong pkg-config. 2016-09-05 01:41:39 -06:00
Anthony J. Bentley
97a31c8fc0 Remove duplicate PKG_CONFIG. 2016-09-05 01:34:17 -06:00
Anthony J. Bentley
c3c31138dd Add rgbgfx. 2016-09-05 01:29:45 -06:00
AntonioND
fbb825af3b Fix GB graphics prefix output
The output of using the prefix '`' was inverted: The MSB was placed
before the LSB. Now, the LSB are placed first, allowing a direct copy
to VRAM.
2016-07-01 19:54:48 +01:00
Anthony J. Bentley
330a39596c Instead of blindly trusting the first byte, decode UTF-8 safely. 2016-01-28 23:16:42 -07:00
Anthony J. Bentley
e241137508 KNF. 2016-01-28 23:05:25 -07:00
Sanqui
deb44eaeef Merge branch 'master' into HEAD 2015-10-13 22:37:25 +02:00
Sanqui
338c176b37 Add -E option to rgbds, allows exporting all labels by default 2015-10-13 22:35:02 +02:00
Anthony J. Bentley
2ea2e47231 Avoid a pointless strcpy(). 2015-10-05 23:58:00 -06:00
Anthony J. Bentley
31294d6d9d rgbasm: refactor bank range checking, and bump the SRAM limit.
This doesn’t affect rgblink, which still needs work.
2015-10-05 17:14:24 -06:00
Anthony J. Bentley
6c10ca62ad Don't silently truncate banks greater than 255 to 8 bits. v0.2.4 2015-07-26 02:08:39 -06:00
Christophe Staïesse
49809f6caf Fix segfault in createpatch() when symbol is an inexistant local label or bank
Fixed as follows: if the symbol doesn't exist, don't add it to the relocation
table. The functions calling createpatch will nevertheless increment PC
correctly.

Test case:

SECTION "CODE", CODE
glob:
        jp .loc

; from test/asm/banknoexist.asm:
SECTION "sec", ROM0
        db BANK(noexist)

See also issue #68
2015-07-26 01:57:30 -06:00
Christophe Staïesse
81675bc4c7 Fix yacc conflict (asmfile/lastline/lines/line rules) 2015-07-26 01:50:56 -06:00
YamaArashi
37b615f070 Fix bug with macro args in symbol names
If a macro arg came in the middle of a symbol or at the end, e.g. "SYM\1", it would say that the symbol was not defined. This was because it wasn't looking up the macro arg's value correctly.
2015-07-25 21:20:44 -07:00
stag019
6438ae2591 Remove __progname; add progname set to argv[0] in each main(). 2015-03-09 13:57:04 -04:00
Anthony J. Bentley
33ae6d8ca3 Use long for file offsets. 2015-03-07 14:21:57 -07:00
stag019
ebc9a4b786 Merge include/link/types.h and include/asm/types.h into include/types.h 2015-03-07 16:04:07 -05:00
stag019
e195076793 Only block comments in headers 2015-03-07 15:50:09 -05:00
stag019
b14beeff10 Consistency in #includes 2015-03-07 15:49:17 -05:00
stag019
db54c2ebd6 Replace all ASMOTOR references with RGBDS. 2015-03-07 15:42:06 -05:00
Anthony J. Bentley
eadaa47770 Sync with upstream. 2015-03-03 23:15:05 -07:00
Anthony J. Bentley
b5e7855afd Remove reference to currently nonexistent gbz80(7) manual. 2015-02-26 00:37:45 -07:00
Anthony J. Bentley
ce7d1d5d49 Use real dates in the manpages. 2015-02-26 00:37:13 -07:00
Anthony J. Bentley
64a3929f4e “No Ns” is redundant. 2015-02-26 00:36:46 -07:00
Anthony J. Bentley
1c1a4e6ac9 Merge branch 'master' of https://github.com/Sanqui/rgbds 2015-02-26 00:36:14 -07:00
Anthony J. Bentley
cc3aa969b8 Merge branch 'cldefines' of https://github.com/stag019/rgbds 2015-02-26 00:25:32 -07:00
Anthony J. Bentley
7055301616 Don’t unnecessarily escape hyphens in manpages. 2015-02-25 02:17:54 -07:00
Anthony J. Bentley
bbf24916e6 Sync usage lines. 2015-02-25 02:16:41 -07:00