Commit Graph

439 Commits

Author SHA1 Message Date
AntonioND
e4b4e427f1 Return bank 0 for labels in HRAM
Instead of returning the internal representation of the linker, return
0 when using BANK() on a label in HRAM.

Also, generate a warning when calculating the bank of labels in OAM
and HRAM, as there is no valid reason for doing it, so it's likely a
programming mistake.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-03 21:15:14 +01:00
AntonioND
2138bb46fd Fix generation of html man page in Makefile
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 21:08:53 +01:00
AntonioND
ec5eb4f9ff Merge pull request #152 from Ben10do/update-readme-for-mac
Update the README’s Mac-specific instructions
2017-04-02 18:08:47 +01:00
Ben10do
b31632b51d Update the README’s Mac-specific instructions
- Rename the “Installing RGBDS (UNIX)” section to “Building RGBDS”, as that’s what we’re doing, regardless of platform.
- Update references of Mac OS X to macOS.
- State that only libpng and pkg-config need to be downloaded with Homebrew; the others are pre-installed along with Xcode.
- State that RGBDS itself is available through Homebrew.
2017-04-02 17:57:51 +01:00
AntonioND
e50e3e5a23 Remove trailing whitespace
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 17:46:14 +01:00
AntonioND
f63339472e Update reference output of tests
Due to recent changes, lots of tests generated a slightly different
error output.

- bank-noexist : This test doesn't generate any error output now as
  unknown labels are left for the linker to resolve.

- null-in-macro : This test used to crash. Now, the parser verifies that
  a MACRO ends in ENDM, generating an error message if not.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 17:18:08 +01:00
AntonioND
43fd1ee024 Fix some signed/unsigned comparison warnings
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 17:08:12 +01:00
AntonioND
d61a0a8a8f Cleanup Makefile
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 17:07:40 +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
53842cd07d Create man5 folder when installing
`make install` would blindly try to copy `rgblink.5` even if the
destination folder didn't exist.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-02 00:40:35 +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
f0d4750ebc Fix rgblink.5 man page installation path
The man page rgblink.5 was installed in the `man1` folder instead of
`man5` as expected.
2017-04-01 15:06:26 +01:00
AntonioND
eed098ac8e Merge pull request #140 from AntonioND/an/linkerscript
Implement linkerscript
2017-04-01 10:33:49 +01:00
AntonioND
64dbcc0912 Update README.md
Inform about the actual dependencies.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-28 22:19:50 +01:00
AntonioND
5947ca10dc Document linkerscript format in manpage
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-28 22:19:50 +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
dfb99618f5 Document missing build options
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-28 19:37:18 +01:00
AntonioND
6b21e02c95 Merge pull request #143 from Sanqui/parametrize-makefile
Parametrize install arguments in Makefile
2017-03-28 12:49:23 +01:00
Sanqui
011c2c953b Parametrize install arguments in Makefile 2017-03-28 13:22:33 +02:00
AntonioND
8eb1a42e31 Merge pull request #141 from AntonioND/an/deprecate-jp-hl
Declare some opcodes obsolete
2017-03-24 23:23:43 +00:00
AntonioND
c51aac0c20 Declare some opcodes obsolete
They are still working, they just output a warning.

`jp [hl]` is confusing as it may be thought that the CPU reads the value
pointed by hl and jumps to it.

`ldi a,hl` and `ldd a,hl` are also confusing as they load from the
address pointed by `hl`, the correct mnemonic should say `[hl]`.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-24 23:22:30 +00:00
AntonioND
6feaba2343 Document -w option of rgblink
This option hadn't been added to the manpage.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-23 22:12:06 +00:00
AntonioND
0867476bde Allow ',' to be escaped in string literals
It should only be needed for macro arguments, added to string parsing
function as well for consistency.
2017-03-19 00:05:50 +00:00
AntonioND
fa962b9470 Merge pull request #139 from chastai/escape-cb
Allow { and } to be escaped in string literals
2017-03-18 23:54:59 +00:00
Christophe Staïesse
b8642bf3af Allow { and } to be escaped in string literals
As stated in the documentation but that was not actually implemented.
2017-03-18 16:23:41 +01:00
AntonioND
317b206fa8 Improve map file output
Print the name of each section along with the size, base and end
addresses. If a section is empty, don't print the end address, as it
can overflow if the base address is 0.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-03-15 23:52:56 +00: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
Sanqui
263c9222ab Require all sections to be fixed when using overlay 2017-03-13 17:08:27 +01:00
AntonioND
947d767c64 Merge pull request #135 from Ben10do/improve-assign-error-messages
Improve assignment error messages
2017-03-12 17:06:54 +00:00
AntonioND
82cf3eb48f Merge pull request #134 from Ben10do/oam-sections
Add support for OAM Sections
2017-03-11 12:18:40 +00:00
Ben10do
a75c15ec46 Improve assignment error messages
Make the error messages in assign.c more descriptive, including the name of the section that caused the error, and its alignment.
2017-03-10 23:21:59 +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
bc2f885d29 Also require ROM0 sections to be fixed when using overlay 2017-03-02 23:02:56 +01: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
Ben
7e2457c9be Re-allow alignment of 0 bits 2017-03-02 08:29:28 +00:00
Ben10do
7993d3455d Update alignment error handling
Ensure (in rgbasm) that the alignment value is between 1-16. Replaces the previous “alignment must not be negative” check.
2017-03-02 08:02:05 +00:00
Sanqui
c9daf80f11 Merge github.com:rednex/rgbds into overlay 2017-02-28 18:58:58 +01:00
Sanqui
5a7faa7dff Add overlay to rgblink manpage 2017-02-28 18:48:09 +01:00
AntonioND
7b8d4de35c Merge pull request #16 from yenatch/eval-rpn-bank
rgbasm: Evaluate BANK() arguments to verify they exist.
v0.2.5
2017-02-27 21:21:45 +00:00
AntonioND
c7fe281c86 Merge pull request #114 from Ben10do/fix-asm-tests
Fix issues in rgbasm raised by the tests
2017-02-27 21:09:04 +00:00
AntonioND
fa8f25a4de Merge pull request #123 from Ben10do/deduplicate-e-doc
Remove duplicate documentation of -E
2017-02-27 20:35:13 +00:00
AntonioND
7c2cae7a32 Merge pull request #127 from rogersachan/patch-1
Convert README to markdown
2017-02-26 22:28:10 +00:00