GB/C Dev Environment?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
GB/C Dev Environment?
by on (#87016)
I've been looking into GB/C development for the past few months. I tried jumping straight into to Z80 ASM but realized I needed a better understanding of processors in general to really learn ASM. So, I read two books detailing microprocessors and I am now going through a book on Z80. I'm also studying http://nocash.emubase.de/pandocs.htm

But my question is, what do I need to set up a development environment for a large Gameboy project? I have linux and windows based machines. Any suggestions on assemblers, graphics programs, ect. I'm also looking to eventually get my project working on the actual hardware.

If anybody could point me in the right direction that would be great. (GBC-Specific info is preferred).
Thanks (:

by on (#87023)
Quote:
But my question is, what do I need to set up a development environment for a large Gameboy project? I have linux and windows based machines. Any suggestions on assemblers, graphics programs, ect.

I use WLA-DX for assembling/linking. I know some people doesn't like it, but I think it works fine for my needs.
For graphics I don't really have anything. I wrote my own tool for converting image files to tile data suitable for the monochrome Gameboy, but I haven't put it online yet. I haven't looked into GBC stuff yet, apart from writing a GB/GBC emulator a couple of years ago.
For music I have my own tool. There are probably many others, some of which are likely to be better.

Quote:
I'm also looking to eventually get my project working on the actual hardware.

http://store.kitsch-bent.com/product/usb-64m-smart-card

For general hardware info, pandocs (which you had already found) is a great resource.

by on (#87024)
For graphics, try YY-CHR. It's a romhacking tool, but it's also good for original development. You can either draw your graphics in there, or copy-paste images from the clipboard, as long as they are indexed color images created by a suitable paint program, and have dimensions that are multiples of 8.

by on (#87030)
Thanks guys. WLA-DX is pretty much what I was looking for, and for the most part it seems it can what I want it to. I'll check out YY-CHR. Appreciate the feedback (:

by on (#87046)
What about GBDK, is that just for programming in C. Know if it's any good? Thanks

by on (#87051)
Fatboy wrote:
What about GBDK, is that just for programming in C. Know if it's any good? Thanks


GBDK has never been updated since 2008, but there is Z88DK for C programs, If there is no GB/C Setup for Z88DK, you may build one for it.

by on (#87064)
Hamtaro126 wrote:
Fatboy wrote:
What about GBDK, is that just for programming in C. Know if it's any good? Thanks


GBDK has never been updated since 2008, but there is Z88DK for C programs, If there is no GB/C Setup for Z88DK, you may build one for it.

There's also SDCC, which has GB-Z80 support. But I don't know if it comes with any libraries for the GB. It produces better code than Z88DK though, at least when I compared them for the Z80 back in february/march.

by on (#87079)
Honestly, I doubt any compiler is able to generate efficient enough code for anything beyond simple demos. The GBZ80 is a pretty lousy processor (much less powerful than a real Z80), and its design isn't exactly amenable to C's abstractions.

by on (#87287)
I've got another question, and I think the answer is easy but I couldn't find any help through google.

Once I've written my program and saved it as a .asm file how do I make a .gbc rom image?

http://www.smspower.org/maxim/HowToProgram/SettingItUp
This link shows how to set up context to use F9 to compile .sms image files. But he uses a batch file that he wrote himself and it only works to create master systems roms.

Anybody know of anything like this for the gameboy?
Thanks.

by on (#87289)
wla-gb -o foo.asm foo.o
wlalink -b foo.link foo.gbc

by on (#87290)
Awesome, do I just throw those into command prompt, or do I need to create a batch file? Thanks by the way

by on (#87292)
You don't need to create a batch file, though it can be convenient to have one.

You'll need to create the .link file though, which should contain:

Code:
[objects]
foo.o

by on (#87304)
Apparently I haven't learned as much as I thought I had, is there any sort of tutorial on using wla-dx for gameboy development?

by on (#87318)
I'm not aware of any tutorials, bu there's the wla-dx manual.

As for code examples, I have some (for the monochrome Gameboy): here and here (in demo\gbc).
Re:
by on (#104552)
mic_ wrote:
You don't need to create a batch file, though it can be convenient to have one.

You'll need to create the .link file though, which should contain:

Code:
[objects]
foo.o



So, what is the purpose of the link file? Can you compile/assemble the ASM file without the link file?
Could you do something like this:
"
wla-gb nameofassemblyfile.asm nameoffinalgbfile.gb
"
?
Re: GB/C Dev Environment?
by on (#104554)
You should probably try to find a GB Hello world type example that has the framework for building a GB ROM and then you're able to begin programming whatever it is you want from there. Otherwise you'll just have to take the time to figure out how the assembler and linker and all that works together. It probably isn't that hard to figure out though it may be a little intimidating at first.

I do recommend the GB USB SmartCard for testing whatever you make on a real GBC. It's cheap and works pretty well.
Re: GB/C Dev Environment?
by on (#104575)
Or, use BGB. 99% of the times, it emulates things correctly. (Make sure you have the latest version if you already have a copy on your hard drive, however. There has been some substantial improvement in several areas over the last two years.)