Commit Graph

142 Commits

Author SHA1 Message Date
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
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
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
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
stag019
ebc9a4b786 Merge include/link/types.h and include/asm/types.h into include/types.h 2015-03-07 16:04:07 -05: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
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
stag019
b924f58bb0 Added -D to manpage 2015-02-24 18:31:13 -05:00
stag019
ac78c37f9d Add reallocarray to Makefile; clean up some things in main.c 2015-02-24 18:11:02 -05:00
stag019
fd4327327c Command line definitions. 2015-02-23 21:23:51 -05:00
Anthony J. Bentley
bc60b85785 Support BANK() correctly when given WRAMX/SRAM/VRAM labels.
(Mostly) from Antonio Niño Díaz.
2015-02-22 03:33:18 -07:00
Sanqui
bbf60c7197 Fix _PI (define it for pass 2) 2015-02-11 00:45:42 +01:00
Anthony J. Bentley
60c3a7e2f3 Reformat code for better spacing, and provide a more detailed error. 2015-01-30 20:30:33 -07:00
Anthony J. Bentley
483d94f88b rgbasm: Fixed a dumb typo; pointed out by stag019. 2015-01-27 05:42:51 -07:00
Anthony J. Bentley
a3e95f99d2 rgbasm: Fix a division by zero in section address specifiers. 2015-01-27 04:56:42 -07:00
Anthony J. Bentley
361f1ac50b Work around a crash when '@' is interpreted as a macro name. 2015-01-22 21:12:57 -07:00
Anthony J. Bentley
4f8cf84ed4 rgbasm: improve (some) pathological spacing. 2015-01-22 21:09:10 -07:00
Anthony J. Bentley
cd2af0204e rgbasm: Save some horizontal space in main.c. 2015-01-22 20:33:07 -07:00
yenatch
91241b44da rgbasm: bump MAXMACROARGS up to 256 from 9 2015-01-19 23:28:09 -08:00
Anthony J. Bentley
1d174f37da rgbasm: Convert oDontExpandStrings to bool. 2015-01-07 23:52:22 -07:00
Anthony J. Bentley
2777044f70 Delete some unused functions. 2015-01-07 23:39:00 -07:00
Anthony J. Bentley
e5e64b8cec rgbasm: trim ludicrously redundant comments. 2015-01-07 23:36:08 -07:00
Anthony J. Bentley
8534f3a148 Unify usage strings/functions across programs.
The funny spacing is to make it easier to keep to 80 characters/line.
2015-01-07 23:13:18 -07:00
Anthony J. Bentley
a305649557 rgbasm: Print usage if no filename is given after flags. 2015-01-07 22:44:28 -07:00
stag019
2b839fec37 Use the options parameter provided for command line options. Specifically, for haltnop. 2014-12-31 13:29:24 -05:00
stag019
9b4959cb75 Implement round, ceil, and floor math functions. 2014-12-17 01:30:19 -05:00
stag019
dca82e6d95 Fix DEF() automatically converting string EQUS. 2014-11-07 16:42:55 -05:00
stag019
871c5ed360 We aren't kidding ourselves anymore. This is a Gameboy assembler, not any sort of generic assembler. 2014-11-07 16:36:03 -05:00
Anthony J. Bentley
7ad634febd Don’t assign to self. 2014-11-06 21:42:40 -07:00
Anthony J. Bentley
1e1339467e Use POSIX 2001 as the base standard. 2014-11-06 21:39:36 -07:00
stag019
a64d725a8d The actual way the macro bug should have been fixed. 2014-11-04 18:09:22 -05:00
stag019
80e2129f22 Merge https://github.com/bentley/rgbds
Conflicts:
	include/lib/types.h
	src/asm/symbol.c
2014-11-02 01:00:20 -05:00
stag019
af70f03933 A few more small changes to charmap.c. 2014-10-31 19:01:21 -04:00
stag019
004bc2e50e Fix a few charmap bugs maybe? 2014-10-31 10:48:54 -04:00
Christophe Staïesse
25efb00769 fix a bug in the lexer involving double quote escaping and semicolons
The bug showed up when a semicolon was located anywhere after \".

These three test cases are syntaxically correct but didn't compile:

1)
SECTION "HOME", HOME
	db "\";"

2)
SECTION "HOME", HOME
	db "\""
	nop
	;

3)
SECTION "HOME", HOME
	db "\"" ;

The problem was located in yy_create_buffer(). Basicaly, this function loads an
entire source file, uniformizes EOL terminators and filters out comments without
touching literal strings.

However, bounds of literal strings were wrongly guessed because \" was
interpreted as two characters (and so the double quote was not escaped).

In test 1, the string terminates early and so ;" is filtered out as it was a
comment and so the assembler complains of an unterminated string.
In test 2 and 3, the string is in fact interpreted as two strings, the second
one terminates at EOF in these cases and so comments are not filtered out and
that makes the assembler complains.

A special case must be taken into account:

4)
SECTION "HOME", HOME
	db "\\" ;

So we need to ignore \\ as well.

Note that there is still a problem left: in yy_create_buffer() a string may
span multiple lines but not in the lexer. However in this case I think the lexer
would quit at the first newline so there should be nothing to worry about.
2014-10-10 16:50:11 +02:00
Anthony J. Bentley
c6c7b99fad PATH_MAX is not exactly portable. Hack around it for now. 2014-10-10 03:48:52 -06:00
Anthony J. Bentley
27a350eaab Merge branch 'fix-uniquearg-segfault' of https://github.com/chastai/rgbds 2014-10-06 01:55:19 -06:00