gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > GB C IDE?

#172175 - Vaati - Fri Jan 22, 2010 6:30 pm

Hello all, this is my first post to the forums!

I was wondering whether there is a C IDE for the Gameboy/GB Color. i.e.; the actual editor would be loaded on the gameboy and the programs would be written to the RAM, and loaded into the flash for use. Then, a small section of the RAM would be dedicated to save files.

Is this possible? Has it been done? If not, then I would be willing to give it my best shot, but I would need help from GB development veterans. :)

#172187 - Miked0801 - Sun Jan 24, 2010 12:01 am

What do you know about the GB? 8k of banked RAM or 32K for the GBC leaves almost no room for anything but game code. Heck, we used straight Z80 assembler back when we were making apps for the GB/GBC due to the limited RAM and 1 or 2MHz CPU. Why add a C IDE to this? Just trying to see your motivation here as this probably is a dead end assignment.

#172189 - Dwedit - Sun Jan 24, 2010 1:37 am

But I bet it might be possible to make an automatic relocating assembler, maybe even with labels.
By auto-relocating, I mean it would keep everything binary, and relocate all labels and address bytes if anything moves around.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#172190 - sgeos - Sun Jan 24, 2010 6:05 am

Barring complacent self satisfaction, this is worth anyone's time why? If this were a good enough idea, it would have been done already. Very few people are tinkering with the GB/GBC these days. Please correct me if I'm wrong, but for those who are, a PC toolchain + emulator + periodic hardware testing is going to be the most efficient way to work.

#172194 - Vaati - Sun Jan 24, 2010 12:58 pm

Hello,

I don't think I made my point clear--what I meant was to have the IDE on a cartridge, with around 1MB flash and 64K SRAM.

Also, my real motivation is to learn C. I would love to be able to have my gameboy/GBA and use it on long trips to learn C and to maybe create games, right on the gameboy without bringing my laptop along.

I do know a good deal about hardware with the gameboy, but not much about software.

#172200 - Dwedit - Sun Jan 24, 2010 4:21 pm

Actually, if you think of C as just another dialect of Basic, you can interpret it even on crappy platforms. The execution speed will suck, and there aren't any ready-made C interpreters for the GBA.

Still, keying in C code on a system without a keyboard is highly impractical. Get a cheap used laptop instead.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#172206 - sgeos - Sun Jan 24, 2010 7:56 pm

Vaati wrote:
Also, my real motivation is to learn C.

Learn on your computer. When you are comfortable with C in a PC (or Mac or whatnot) environment, then apply your skills to the Nintendo handheld or other platform of your choice.

Vaati wrote:
maybe create games, right on the gameboy without bringing my laptop along.

Developing games without a big powerful computer is horribly inefficient. Commercial shops use hardware debuggers. These are modified versions of the game machine that are essentially tethered to the PC the developer works on.

If you are tight on space when you go on long trips and want to develop games, I'd say skip the gameboy, bring your laptop and test on an emulator until you get home. Or work on assets (dialog, graphics) that you can add to your game when you get home.

Vaati wrote:
I don't think I made my point clear--what I meant was to have the IDE on a cartridge, with around 1MB flash and 64K SRAM.

If this were worth the trouble, I think someone would have figured it out already. That means that:
A) It is either not worth the trouble
B) It is worth the trouble, but nobody with the skills or time has attacked the problem yet
C) Everyone has overlooked something that when understood would reduce the scope of the project and make it worth the trouble
D) It has already been figured out, but I don't know about it

In any case, if you are trying to learn C, I suspect you would be in over your head.

Having said all that, I think there is a program homebrew program called Colors for the DS. I have not used it, but creating 2D art directly on the DS seems like it could be worthwhile.

#172207 - ant512 - Sun Jan 24, 2010 8:37 pm

Have you seen this?

http://gbdk.sourceforge.net/

It doesn't run on the GB, but it'll let you develop GB code in C. Features:

- An ANSI C compiler.
- An assembler that generates relocatable code.
- A peephole optimiser.
- A linker that produces GameBoy image files.
- Support for multiple-bank images.
- Smart linking.
- A set of libraries, with source code.
- Example programs in assembly and in C.

#172221 - Kyoufu Kawa - Mon Jan 25, 2010 7:08 pm

Ah yeah, GBDK. I remember that. The sudden rush of nostalgia makes me want to download it.

It seems Harry Mulder's site has fallen off the face of the Internet, so graphics may be a bit of a problem.

#172224 - kusma - Mon Jan 25, 2010 8:55 pm

Kyoufu Kawa wrote:
Ah yeah, GBDK. I remember that. The sudden rush of nostalgia makes me want to download it.

It seems Harry Mulder's site has fallen off the face of the Internet, so graphics may be a bit of a problem.


wow, that happened... like... a couple of days ago...

#172231 - keldon - Tue Jan 26, 2010 8:26 am

I managed to keep hold of a few key programs, namely the all powerful Graphics State GIC demo (which was the best image quantizer available for the GBC).

devrs.com is also down!

#172597 - Kyoufu Kawa - Thu Feb 18, 2010 8:14 pm

Okay, they're back now.