Copy Link
Add to Bookmark
Report

Tutorial 1: Setting up your dev environment

sang's profile picture
Published in 
GP32
 · 14 Aug 2021

So you want to code for the GP32, huh? No problem. Normally you'd have to get the Dev Kit Advance pack, which is made for the GBA, then modify it to work with the GP32. However I noticed a lot of the download links are dead now, so I prepared my own kit.

The RAR is better if you have WinRAR or similar, try to get that. The file might be a little large for dial-up users - but it works out the same as downloading all the files manually. Bz2 version coming soon if anyone asks for one :P

The zip has docs, tools, the compiler, a test program and a copy of this tutorial (slightly summarised).

Getting Started

To get started, unzip or unrar the archive to c:\ and add c:\devkitadv\bin to your PATH. Also make friends with your command prompt, you'll need to use it (or batch files). For those of you unsure how to edit your PATH:

95/98/Me: Start -> Run -> sysedit.
Go to autoexec.bat .
At the end of the file, add the line set path=%path%;c:\devkitadv\bin and save.
Reboot your computer (or type the above line into your command prompt directly)

NT/2K/XP: Right click My Computer and select Properties .
From the Advanced tab, click the Environment Variables button.
Under 'System Variables', find Path.
Select it and click Edit. Add ;c:\devkitadv\bin to the end of the 'Variable field'.
Click OK, OK, OK :D

Now go into the MS-DOS prompt or shell, navigate to the test directory ( cd c:\devkitadv\test ) and type make , enter. A few lines should appear. If all goes well you'll have a GXB file.

The GXB file is a form of executable program, similar to an EXE on the PC, but without some extra stuff like a name or an icon. Free Launcher won't run them, although Wind-Ups will.

Testing the Emulator

Now go into c:\devkitadv\emu and open up geepee32.exe .
File -> Load -> GXB/... and select the GXB file you just made (under the test directory). Click 'play'. You should see some text. If so, congratulations, it works! There's nothing else to it, just quit.

Note: You will get a warning:

 gpmain.c: In function `GpMain': 
gpmain.c:13: warning: unused parameter `arg'

However this is totally harmless and can't really be avoided, so ignore it.
You will also find a .o and .elf file, you are safe to delete them.

Converting to FXE

An FXE contains the game/program itself, along with an icon and a name, and some miscellaneous information. Before distributing your game, you'll need to convert it to FXE. How? It's not too tricky. There are two ways. If you don't like command prompts, you can use FxeMaker in the tools directory. While easy to use, you'll probably want to make an fxe quite a bit as you test the program on a real gp32 every so often, so it's easier to use b2fxe , a useful converter through the command prompt.

Go to the directory containing your GXB, and type:

 b2fxe -t "Hello Test" -b "icon.bmp" -a "Rico" -r "PD" hello.gxb hello.fxe 

Where 'PD' is the license info, in this case Public Domain. 'Hello Test' appears in the free launcher. icon.bmp is a 32x32 bitmap with the standard gp32 palette, I supplied one for you (it's crummy but does the job for our tutorial). If this works, try running the FXE in the emulator or sending it to your gp32. You can delete the .gxb.

I don't want it in c:\devkitadv !

Some users might be forced to put the development kit somewhere else. You need to change three things if you change the directory:

  1. Change your PATH to the right one, e.g. e:\public\devkitadv\ (as shown above)
  2. Also add to autoexec.bat the line set GCC_EXEC_PREFIX=e:/public/devkitadv/lib/gcc-lib/
    Remember
    the forward quotes, it's a Unix thing.
    If you're using NT/2K/XP, you can go into Environment Variables and add the variable GCC_EXEC_PREFIX yourself.
  3. Change each makefile. Specifically for our test program, open ' Makefile ' and change the line export CCBASE= to your path, with forward slashes and no slash at the end.


Making your own SMCs for the emulator

If your game loads external files, you need to put these files into a fake filesystem, or SMC file, so the program can access them.

Let's say you want to load a snes emulator, and access snes games. You can. First of all make a new directory somewhere, e.g c:\gpfs . In it make the directories GPMM, GAME, GPETC, MP3, GPSYS as your real SMCs have. In the GPMM dir add what you would usually add e.g. gp:\GPMM\SNES\ - snes roms go here.

Now go into devkitadv\tools. Type makesmc_128 "c:\gpfs" "c:\devkitadv\emu\snesroms.smc" with quotes. If you need help using makesmc, run it without any arguments. It will take ALL the files under c:\gpfs and make an SMC out of them. Note that it will stop if it hits a file that isn't 8.3 characters long, e.g. "super metroid.srm" will stop it.

Now go into geepee32, load smc, load snesroms.smc or whatever. Don't press play. Now load, from the same submenu, the fxe of your snes emu.

Press play, and your snes emu will scan your SMC just like the real thing. It should find your snes roms fine.

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT