Commit Graph

88 Commits

Author SHA1 Message Date
AntonioND
e9ed81074b Rename OPT_SMALL to OPT_TINY
This way it is easier to identify the flag passed to the binary (-t).

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-03 21:22:16 +01:00
AntonioND
e50e3e5a23 Remove trailing whitespace
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 17:46:14 +01:00
AntonioND
ec44b554e8 Merge pull request #150 from Ben10do/deprecation-positions
Add a warning() function, similiar to other error handlers
2017-04-02 17:03:03 +01:00
AntonioND
01a710a47d Remove Zero Page linker patch RPN_PCEZP
This patch isn't used because it's meant to be an optimization for
labels in the memory region 0x2000-0x20FF. That memory region doesn't
have anything special on the Game Boy, and there are no instructions
optimized to read or write from there, so it was probably meant for
another hardware that was supported by ASMotor in the past.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 16:19:45 +01:00
Ben10do
ff2ba7290c Add a warning() function, similiar to yyerror()
This function produces a similar output to the other error handlers, including printing to stderr, and including a stack trace. However, ‘warning’ is displayed instead of ‘ERROR’, and the compilation does not fail.

This function is now used for the deprecation warnings, ensuring that these errors can be found.
2017-04-02 13:18:29 +01:00
AntonioND
85ff75d2d3 Merge pull request #146 from AntonioND/an/same-name
Prohibit sections from having the same name
2017-04-02 00:36:28 +01:00
AntonioND
adef2e18cc Fix bank assignments from linkerscript
Even though the bank number was read from the linkerscript and the
linker verified that each section could be mapped in the final rom, the
bank number was never actually set by the linkerscript parser.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 00:22:37 +01:00
AntonioND
5ba8405dfa Prohibit sections from having the same name
To make the behaviour of the linkerscript consistent, every section read
from an object file must have an unique name. This is needed as the
linkerscript uses the name of sections to place them and it expects
every section to have a different name.

This doesn't break compatibility with the old behaviour that allowed to
continue sections if they had the same name, bank number and starting
address. That's still allowed because `rgbasm` outputs a single section
if this functionality is used, it is transparent to `rgblink`.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-01 15:33:17 +01:00
AntonioND
d1ed4fbded Use linkerscript parser in rgblink
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-28 22:19:50 +01:00
AntonioND
22d4a10cb6 Implement linkerscript parser
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-28 22:19:45 +01:00
AntonioND
469e3e7c86 Merge branch 'contiguous-wram' of git://github.com/TwitchPlaysPokemon/rgbds into TwitchPlaysPokemon-contiguous-wram 2017-03-15 21:00:06 +00:00
AntonioND
9193710ff9 Merge pull request #131 from Sanqui/overlay
Add overlay to rgblink
2017-03-15 20:42:32 +00:00
Ben10do
3dcfe2b9f6 Add support for OAM Sections
Allows sections (and labels within) to be defined that correspond to the Game Boy’s Object Attributes Memory.
2017-03-10 22:18:14 +00:00
Ben10do
523b7538f0 Replace magic numbers with BANK_COUNT_* constants
Previously, some instances of the number of banks for each section remained hardcoded. These have been replaced with BANK_COUNT_* constants.

As a side-effect, this could fix a theoretical bug when using BANK(label) when the label is in a high SRAM bank (≥ 4).
2017-03-10 19:24:54 +00:00
Sanqui
bd00b9ab59 Merge branch 'master' of github.com:rednex/rgbds into overlay 2017-03-02 22:46:19 +01:00
AntonioND
4f86a12539 Merge pull request #125 from Ben10do/section-alignment
Implement byte alignment for data
2017-03-02 09:17:46 +00:00
Sanqui
c9daf80f11 Merge github.com:rednex/rgbds into overlay 2017-02-28 18:58:58 +01:00
AntonioND
92b81b1d5a Merge pull request #79 from yenatch/longer-charmap
Increase the length of charmaps.
2017-02-26 22:04:26 +00:00
Ben10do
e4cbf773f6 Add alignment of sections to objects
Aligned sections can now be created with out_NewAlignedSection(). This information is stored in created object files, and read by the linker.

The names of each section are also included in the object file, enabling potential improvements to error messages in the future.
2017-02-19 22:35:32 +00:00
scnorton
6d1c60b0a6 Contiguous WRAM 2017-02-06 16:31:57 -05:00
PikalaxALT
998cfe1bdd 16-bank SRAM 2017-02-06 08:27:32 -05: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
defd4f589e Add noreturn attribute to fatalerror()
Should silence compiler warnings that expect fatalerror() to return.
2017-01-24 11:38:26 +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
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
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
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
c3c31138dd Add rgbgfx. 2016-09-05 01:29:45 -06:00
Sanqui
2e9c68f8c3 Add overlay file option to rgblink (-O)
This option takes a file and places fixed sections on top of it.
Should prove useful for patches and partial disassemblies.
2016-03-28 01:02:05 +02: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
yenatch
1a15ee5363 Increase the length of charmaps. 2015-10-13 08:46:29 -07:00
Anthony J. Bentley
2ea2e47231 Avoid a pointless strcpy(). 2015-10-05 23:58:00 -06:00
Anthony J. Bentley
6c10ca62ad Don't silently truncate banks greater than 255 to 8 bits. 2015-07-26 02:08:39 -06: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
261503c7c8 Fix the reallocarray header by providing a prototype. 2015-02-25 02:13:23 -07:00
Anthony J. Bentley
c8d9ae21e6 A header file this simple doesn’t satisfy modicum of creativity. 2015-02-24 16:02:21 -07:00
Anthony J. Bentley
5281704f62 These internal headers don’t need C++ boilerplate. 2015-02-24 16:01:53 -07:00
Anthony J. Bentley
1c47ffcce8 Import reallocarray() for later use. 2015-02-14 00:14:39 -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
stag019
2b839fec37 Use the options parameter provided for command line options. Specifically, for haltnop. 2014-12-31 13:29:24 -05:00
Anthony J. Bentley
513d451710 Tweak path for stdnoreturn.h header. 2014-12-31 03:21:46 -07:00
Anthony J. Bentley
9399ba36f9 Check for standards‐compliant platforms first in stdnoreturn.h. 2014-12-31 03:20:14 -07:00
stag019
f0e5c5ccc8 Cross-compiler noreturn support. 2014-12-31 04:11:06 -05:00
stag019
9b4959cb75 Implement round, ceil, and floor math functions. 2014-12-17 01:30:19 -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