Hello World

To start off let's do something super simple, and print some text on the screen on the PC Engine.

This is the minimum code needed to print text on the screen.

#include <huc.h>

void main(void)
{
    put_string("HELLO WORLD", 1, 1);
    put_string("This is the PC Engine!", 1, 2);
}

This example uses the HuCC put_string text function to display text inside a main function loop.

put_string( unsigned char *string, unsigned char bat_x, unsigned char bat_y );

This writes a null terminated ASCII string, with the x and y coordinates in Tiles.

After running make and loading game.pce in the emulator, this is what you should see:

This is now showing two lines of text being written in the default system font.

By default if a text colour is not defined, the colour of the text will appear as cyan.

Last updated