GB/C Dev Environment?

Discussion of programming and development for the original Game Boy and Game Boy Color.
Fatboy
Posts: 8
Joined: Thu Dec 01, 2011 12:23 am

GB/C Dev Environment?

Post by Fatboy » Thu Dec 01, 2011 12:31 am

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 (:

mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ » Thu Dec 01, 2011 5:18 am

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.
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.

User avatar
Dwedit
Posts: 4330
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Thu Dec 01, 2011 7:59 am

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.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

Fatboy
Posts: 8
Joined: Thu Dec 01, 2011 12:23 am

Post by Fatboy » Thu Dec 01, 2011 9:15 am

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 (:

Fatboy
Posts: 8
Joined: Thu Dec 01, 2011 12:23 am

Post by Fatboy » Thu Dec 01, 2011 2:24 pm

What about GBDK, is that just for programming in C. Know if it's any good? Thanks

User avatar
Hamtaro126
Posts: 770
Joined: Thu Jan 19, 2006 5:08 pm

Post by Hamtaro126 » Thu Dec 01, 2011 2:50 pm

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.
AKA SmilyMZX/AtariHacker.

mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ » Thu Dec 01, 2011 10:33 pm

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.

adam_smasher
Posts: 271
Joined: Sun Mar 27, 2011 10:49 am
Location: Seattle

Post by adam_smasher » Fri Dec 02, 2011 2:30 pm

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.

Fatboy
Posts: 8
Joined: Thu Dec 01, 2011 12:23 am

Post by Fatboy » Thu Dec 08, 2011 9:45 am

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.

mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ » Thu Dec 08, 2011 11:43 am

wla-gb -o foo.asm foo.o
wlalink -b foo.link foo.gbc

Fatboy
Posts: 8
Joined: Thu Dec 01, 2011 12:23 am

Post by Fatboy » Thu Dec 08, 2011 12:00 pm

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

mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ » Thu Dec 08, 2011 1:02 pm

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: Select all

[objects]
foo.o

Fatboy
Posts: 8
Joined: Thu Dec 01, 2011 12:23 am

Post by Fatboy » Thu Dec 08, 2011 5:13 pm

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?

mic_
Posts: 922
Joined: Thu Oct 05, 2006 6:29 am

Post by mic_ » Thu Dec 08, 2011 11:12 pm

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).

psc
Posts: 41
Joined: Tue Dec 11, 2012 1:02 pm

Re:

Post by psc » Tue Dec 11, 2012 10:19 pm

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: Select all

[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
"
?

Post Reply