I'm trying to compile a simple "hello world" program targetting the gameboy platform:
> sdcc -mgbz80 hello.c
> makebin -Z hello.ihx hello.gb
The rom is build correctly, but no text is shown in the emulator...
After reading some docs, i've found that i probably need a gb-specific "putchar" routine.
Yes, you need to provide a putchar() function. The SDCC function library does implement anything that is specific to the hardware peripherals. If you do not define putchar(), it will use a stub function that simply discards the data. Unfortunately, I am not familiar with gameboy software development so I'm afraid I can't offer more helpful advice.
Several years ago I created a gameboy emulator and wrote some test programs for it with the then current SDCC 2.2.1 of the GBDK 2.95. See <http://gbdk.sourceforge.net/>. Character output worked right out of the box.
Apperently its libraries contained all needed funtions and initializations to emulate a simple console on the display. You should get the source and see what is there...
Basically you need to have tiles that represent the characters of the font and some logic to put the tiles into the screen buffer. Please RTFM!
Ok, i think i've found it:
http://gbdk.cvs.sourceforge.net/viewvc/gbdk/gbdk/lib/platform/rrgb/putchar.s
http://gbdk.cvs.sourceforge.net/viewvc/gbdk/gbdk-lib/libc/consolez80/putchar.s
http://gbdk.cvs.sourceforge.net/viewvc/gbdk/gbdk-lib/libc/rrgb/putchar.s
can you tell me which one to use and how to do the linking?
sorry i'm a bit new to small devices dev...