-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document RGBLINK's support for SDAS object files #1665
Comments
Give a brief example like this: # Create a RGB object file with RGBASM
rgbasm -o foo.o foo.asm
# Create a SDAS object file with SDCC
sdcc -c -msm83 -o bar.rel bar.c
# Link both objects together into a ROM with RGBLINK
rgblink -o rom.gb foo.o bar.rel |
examples __sdcccall(1) (which is default in SDCC version > 4.1) in: 8-bit (a)
rgbds.asm
in: 16-bit (de)
foo.asm
in: 16-bit (de), 8-bit (a)
foo.asm
|
excerpt from SDCC documentation (4.3.5): This calling convention can be chosen per function via __sdcccall(1). For Functions that do not have variable arguments: the first parameter is passed in a if it has 8 bits. If it has 16 |
Thanks a lot! Some questions:
(I should probably get sdcc set up on my machine and try these out before adding them in docs.) |
also for better sdcc code you may add so for our example:
so caller will not generate push on those register if it may need after return from function call |
AFAIK C doesn't require
I think typo is the difference :D |
variable defined in asmbar.c (https://godbolt.org/z/481n9sqnd)
foo.asm
variable in HRAMbar.c (https://godbolt.org/z/njnvff7Mq)
foo.asm
|
Very cool. I think rgblink(1) should have one basic/minimal "yes this works" example, and these can go elsewhere. Maybe a gbdev.io page. Maybe a new rgbsdcc(5) man page. Maybe an example GitHub repo (but then something ought to link to it). |
@Rangi42 I'd say this should stay in the rgbds.gbdev.io man pages? I like the rgbsdcc(5) man page option |
RGBDS 0.4.1 added "GBDK support" (aka RGBLINK support for objects output by SDAS) in July 2020, but we've neglected to document it. Update rgblink.1 to not only mention "RGB objects".
Note that #1008 mentions other bullet points for ostensibly complete "C toolchain" usability. I don't know how essential/blocking any of those are to actually using RGBASM+RGBLINK as part of a C+asm multilanguage project.
The text was updated successfully, but these errors were encountered: