Francesco's knick-knacks

_FPC 4 GBA Game Programming Tutorial
_Setting up a FPC 4 NDS development environment

_About me

_bin2unit - bin to pascal converter
_FPC 4 Wii (NEW!!!)
_Nintendo DS programming with Free Pascal - WIP (!!!NEW!!!)

Site made with

Valid CSS!

Valid HTML 4.01 Transitional

2006.12.18 FPC4NDS: libnds and some minor changes
First libnds conversion attempt is available here:
Some TODOs here and there, but it should work... well, I get some errors on no$gba, but it works on Dualis emulator and - most important thing - on real hardware =D
In order to work with libnds, you will need to install devkitPro for Nintendo DS (
You can get a new fpc4nds snapshot from freepascal ftp (about 3.7 MB) or from this site (link below).
I suggest you to start from this tutorial, that explains very well all nds coding aspects.
libnds porting is 1:1, so converting c code should be a trivial task
A couple of hints:
program main;
{$apptype arm9} //...or arm7
{$define ARM9}   //...or arm7, according to apptype

{$mode objfpc}   // required for some libc funcs implementation

  ctypes; // required by nds headers!

{$include}  // headers!

  while true do;  // Infinite loop, otherwise Dualis 
                          // emulator will suddenly close!
In order to compile your code:
ppcarmnds.exe -g --gc-sections -Tnds main.pp
If you are compiling an ARM9 source, you will get main.arm9.bin and main.nds binary; if you are compiling an ARM7 source, then you will get main.arm7.bin only, in order to link it with an arm9 binary with ndstool. In this case, you can patch the binary with:
ndstool -c main.nds -9 main.arm9.bin -7 main.arm7.bin

2006.12.15 FPC4NDS binaries released!
Another step is done: fpc4nds binaries are available for download here (A snapshot on freepascal server will be available soon). The zip package is pretty small (about 3.6 MB) and contains all you need to start developing for Nintendo DS. As usual, binutils and tools are kindly provided by DevkitPro team. This time you can't find any library in the package, because I'm converting libnds headers from c and it is a huge work! =O
Feel the power of Free Pascal and enjoy! =D

2006.12.14 FPC4NDS committed on svn
If you are interested, now you can download from freepascal SVN the fpc compiler for Nintendo DS. In a couple of hour/days/weeks I should provide a package for download and, maybe, a new FPC4GBA too, who knows... =D
Stay tuned!

2006.12.10 FPC4NDS is growing fast!
When I have started working on fpc4nds I didn't think it could grown so fast... Well, the compiler itself works fine now, and it can switch between arm7 and arm9 by using:
{$apptype arm7} or {$apptype arm9}
The basic rtl works, but it needs some minor stuff, like replacing software math routines and so on, but basically it works. I'm translating libnds headers, and this work could take much time (about 170 kb of c header files...). Sadly, libnds headers are overcomplicated for h2pas, so I need to do all by hand. I need some help, even little, because it's a huge task: if you have some experience in c to pascal translation, then feel free to contact me (remove antispam!).
Here is a screenshot of the last working demo for nds created by fpc4nds =)

2006.12.08 Switching to arm-eabi binutils
I have spent the last few days working a little bit on fpc4gba in order to reactivate the libc/libgcc linking; in this way it will be possible to link devkitPro libs in your projects. Following devkitPro, I'm trying to switch from arm-elf to arm-eabi toolchain for compatibility purposes, otherwise it will be impossible to interlink fpc4gba and devkitPro stuff. Besides, this change will simplify the nds porting too =)

1 2 3 4 5 6 7 8 9 10 
11 12 13 14 

Get Firefox!

!!!Disclaimer!!! Read it carefully!!! : All the software you can find in this site is provided as is. I can't be considered responsible for damages caused directly or indirectly by my software. Gameboy, Gameboy Advanced, Nintendo DS are trademark of Nintendo. I'm not related to Nintendo in any way and all informations you can find in these pages come from reverse engineering, search'n'try and from publically and available docs.