Nintendo DS

From Lazarus wiki
Revision as of 18:25, 19 December 2006 by Legolas (talk) (Port notes: Small changes in the compiler)

NDS port is still in heavy development, but is gaining progress rather quickly. Port began and was created by Francesco Lombardi with the knowledge gained from the making of the GBA port. This endeavor is an extension of the original goals of the FPC 4 GBA project.

Nintendo DS port


  • The 2.1.x compiler has compiler support for Nintendo DS.
  • ARM7 and ARM9 CPU are supported.
  • ASM THUMB mode is not supported yet.
  • Base RTL is working, though it needs some optimizations

Port notes

Nintendo DS can run executables made for ARM9 and/or ARM7 cpu. The Free Pascal compiler can switch between ARM9 and ARM7 by using

{$apptype arm9} 
{$apptype arm7}

that generates .arm9.bin and .arm7.bin binaries. If not specified, fpc assumes arm9 as default apptype and, in this case, calls ndstool.exe (a tool you can find as part of devkitPro) in order to generate a patched binary with .nds extension. This file should work on your hardware/emulator. In case of an arm7/arm9 mixed program, it is necessary to compile separately arm7 and arm9 code, then convert the .arm9.bin and .arm7.bin binaries with ndstool.exe in this way:

ndstool -c myprog.nds -9 myprog.arm9.bin -7 myprog.arm7.bin

The current NDS port is tested and reported as working with the latest devkitPro arm-eabi binutils.