Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
This sounds a bit strange but can you compile it by just converting ascii characters or hex?
Offline
Technically speaking, yes, you could build a GB file by manually setting bytes in a hex editor. You would need to have documents like the header format and the bytes that instructions assemble to, and you would need to do copious math by hand to work out things like jump target addresses. It would be extraordinarily tedious and error-prone.
Judging by your post history, I'm guessing you're exploring this direction because you're struggling to get RGBDS working and are looking for alternatives? If so, I highly recommend continuing to work on trying to get up and running with RGBDS. If you're struggling with how to use command line tools, I recommend finding tutorials on operating command lines in general, so that you would be well-equipped to use any command line tool, and would be able to figure out how to use RGBDS using knowledge you already have, instead of needing to have specific commands provided to you. Additionally, since using something like a makefile or shell scripts rapidly becomes highly useful when programming with a workflow that involves the command line, having a general knowledge of it becomes even more useful.
Offline
DonaldHays wrote:
Technically speaking, yes, you could build a GB file by manually setting bytes in a hex editor. You would need to have documents like the header format and the bytes that instructions assemble to, and you would need to do copious math by hand to work out things like jump target addresses. It would be extraordinarily tedious and error-prone.
Judging by your post history, I'm guessing you're exploring this direction because you're struggling to get RGBDS working and are looking for alternatives? If so, I highly recommend continuing to work on trying to get up and running with RGBDS. If you're struggling with how to use command line tools, I recommend finding tutorials on operating command lines in general, so that you would be well-equipped to use any command line tool, and would be able to figure out how to use RGBDS using knowledge you already have, instead of needing to have specific commands provided to you. Additionally, since using something like a makefile or shell scripts rapidly becomes highly useful when programming with a workflow that involves the command line, having a general knowledge of it becomes even more useful.
I can't find a video on how to set it up.
Offline
Just copy the executables somewhere and use them. Dead simple, which is why no video for setting it up exists.
Offline
Setting up RGBDS on Linux: `cd` into its directory, `make` then `sudo make install`
On Windows: grab the release EXEs, put them somewhere on your PATH or next to the project being compiled. Though on Windows it's kind of a nightmare.
Offline
ISSOtm wrote:
Setting up RGBDS on Linux: `cd` into its directory, `make` then `sudo make install`
On Windows: grab the release EXEs, put them somewhere on your PATH or next to the project being compiled. Though on Windows it's kind of a nightmare.
If you're having trouble using RGBDS (after following the above) ISSOtm has a nice step by step tutorial here: https://eldred.fr/gb-asm-tutorial/hello-world.html (look under Action!)
Offline
gbjosh wrote:
ISSOtm wrote:
Setting up RGBDS on Linux: `cd` into its directory, `make` then `sudo make install`
On Windows: grab the release EXEs, put them somewhere on your PATH or next to the project being compiled. Though on Windows it's kind of a nightmare.If you're having trouble using RGBDS (after following the above) ISSOtm has a nice step by step tutorial here: https://eldred.fr/gb-asm-tutorial/hello-world.html (look under Action!)
So, could I put it in my C:\ directory?
Last edited by zeropagebyte (2019-04-03 11:09:14)
Offline
It's generally a bad idea to put executable files in the root directory of your hard drive. The best way to go about it would be as follows:
1. Create a folder in your C:\ directory named "gbdev" (should be located at C:\gbdev)
2. Put the RGBDS binaries (rgbasm, rgblink, rgbgfx, rgbfix, and any associated DLL files) in the folder you just created.
3. Open a command prompt and run the following command to add the folder to your PATH environment variable:
setx path "%path%; C:\gbdev"
After you've done this, RGBDS should be set up and ready to go.
Offline
DevEd wrote:
It's generally a bad idea to put executable files in the root directory of your hard drive. The best way to go about it would be as follows:
1. Create a folder in your C:\ directory named "gbdev" (should be located at C:\gbdev)
2. Put the RGBDS binaries (rgbasm, rgblink, rgbgfx, rgbfix, and any associated DLL files) in the folder you just created.
3. Open a command prompt and run the following command to add the folder to your PATH environment variable:Code:
setx path "%path%; C:\gbdev"After you've done this, RGBDS should be set up and ready to go.
What command is for compiling .asm files?
Last edited by zeropagebyte (2019-04-04 11:21:48)
Offline
rgbasm to compile them into .o files, rgblink to turn all .o files into a ROM, rgbfix to patch the ROM with a header.
Example of a set of commands to compile a game:
rgbasm [flags...] -o obj/home.o src/home.asm rgbasm [flags...] -o obj/engine.o src/home.asm rgbasm [flags...] -o obj/memory.o src/memory.asm rgbasm [flags...] -o obj/battle.o src/battle.asm rgblink [flags...] [-m bin/rom.map] [-n bin/rom.sym] -o bin/rom.gb obj/home.o obj/engine.o obj/memory.o obj/battle.o rgbfix -v [flags...] bin/rom.gb
A more complex and flexible setup, involving a Makefile, can be found on my GitHub.
Offline
ISSOtm wrote:
rgbasm to compile them into .o files, rgblink to turn all .o files into a ROM, rgbfix to patch the ROM with a header.
Example of a set of commands to compile a game:Code:
rgbasm [flags...] -o obj/home.o src/home.asm rgbasm [flags...] -o obj/engine.o src/home.asm rgbasm [flags...] -o obj/memory.o src/memory.asm rgbasm [flags...] -o obj/battle.o src/battle.asm rgblink [flags...] [-m bin/rom.map] [-n bin/rom.sym] -o bin/rom.gb obj/home.o obj/engine.o obj/memory.o obj/battle.o rgbfix -v [flags...] bin/rom.gbA more complex and flexible setup, involving a Makefile, can be found on my GitHub.
I get an error saying "Code generation before SECTION directive".
Offline
You must define code in SECTIONs. Please read the man pages, especially this one
Offline
ISSOtm wrote:
You must define code in SECTIONs. Please read the man pages, especially this one
I checked gameboy code and I saw the ROM name. So, I could use a HEXADECIMAL to ASCII converter.
Offline