#83 gameboy putchar


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.


  • Erik Petrich

    Erik Petrich - 2013-01-29

    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.

  • Bodo Wenzel

    Bodo Wenzel - 2013-01-29

    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!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks