GP32 Simple Beginner Question


Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
41
Location
Dteuschland ;)
Well, I just want to try to run this simple c prog on my gp32:

Code:
#include <stdio.h>

main();
{
      printf("This is a message!");
}

What do I have to do to get get a .fxe that runs on my gp32?
Do I have to change the code?
What about program termination? How do I make button A restart my gp32?

Has anyone good sites with simple starting tutorials?
Edit: Oh, a step by step tutorial would be best for me.

Thanks!

Sorry if this thread is useless or senseless, but, well, just want to try.
 
This particular program would not work, because none of the GP32 SDKs (neither the official GPSDK nor Mirko's SDK) has a STDIN or STDOUT interface (basically text mode/terminal windows and keyboard).

To get a fxe, you'll need to choose any of the SDKs, get an arm GCC (or ARM SDT payware), some libc (preferably newlib). All that stuff has been packed into one package by wintermute as devkitarm. You can get it at http://www.devkit.tk.

Regarding howtos, if you're using the GPSDK, there's a tutorial available rico made (i think), and Mirko's SDK has a lot of examples included.

Hope that helps.
 
If you are not too deep into c/c++ you can also try Fenix language.
Check THIS.

Byes
 
Last edited by a moderator:
Thanks Don.
Anyone has a link to download Mirkos SDK (I`m too lazy to search)


And since my study is about programming basicly in C (later on in C++) and Java, I stay with C for the moment.
 
A basic test, like the one you want to do, is gptest which is available via the development links off the main website. Code is duped here:

Code:
#include "defines.h"
#include "gpgraphic.h"
#include "gpfont.h"

/* Converts 8bit rgb values to a GP32 palette value */
#define GP_RGB24(r,g,b) (((((r>>3))&0x1f)<<11)|((((g>>3))&0x1f)<<6)|((((b>>3))&0x1f)<<1))

/* Global variables */
GPDRAWSURFACE gpDraw[2];

/* Sets a single GP32 palette entry */
void GpSetPaletteEntry ( u8 i, u8 r, u8 g, u8 b )
{
    GP_PALETTEENTRY entry = GP_RGB24(r,g,b);
    GpPaletteEntryChange ( i, 1, &entry, 0 );
}

void GpMain (void * arg)
{
    int * t;

    /* Initialize graphics */
    GpGraphicModeSet(8, t);
    GpLcdSurfaceGet(&gpDraw[0], 0);
    GpLcdSurfaceGet(&gpDraw[1], 1);
    GpSurfaceSet(&gpDraw[0]);
    GpLcdEnable();

    GpSurfaceFlip(&gpDraw[0]);
    GpSetPaletteEntry ( 0, 0,0,0 );
    GpSetPaletteEntry ( 1, 255,0,0 );
    GpSetPaletteEntry ( 2, 255,255,255 );

    GpTextOut(NULL, &gpDraw[0], 0, 0, "This is a message!", 1);

    while(1);
}
 
Last edited by a moderator:
Back
Top