NDS/Libfat DLDI

From Dev-Scene

< NDS(Redirected from NDS/DLDI)

Contents

[edit] Dynamically Linked Device Interface for libfat.

This is an add-on for libfat (and GBA NDS FAT). It allows people to patch new interfaces for their disc devices into existing applications, provided they were built with DLDI support.

The DLDI patcher is required when an app has been compiled with the new version of libfat. The DLDI patcher will not work on homebrew compiled against older libfat releases. DLDI was released on christmas eve 2006 and support was included in libfat CVS as of 2006-12-25.

By default libfat now supports a number of default hardware devices and for those of you using older hardware patching may not be required to run homebrew. so just try the ROM to see if it works with your flash cart. If it does, then great! If not, you'll need to patch it. You'll need two things, a patcher and the appropriate patch for your flash cart.

[edit] End User Instructions

King of the castle! stub

http://chishm.drunkencoders.com/DLDI/index.html

[edit] DLDI Walkthrough

First, download the DLDI file for your device, as well as the Win32 GUI from Adam Hodson (bob_fossil).

Start the app, and you should see the following screen:

Image:DLDITut1.jpg

Click on the "..." button next to the DLDI File and browse the the directory you saved your specific DLDI file to.

Next, click on the "..." button next to the Binaries area and browse to the file you need to use. In this example, it will be the .nds file. If you are using a SuperCard (for example) you are going to choose the .ds.gba file, after patching, and rename it to .sc.nds.

Image:DLDITut2.jpg

So, now that we have the DLDI file chosen, and the .nds file chosen, we just hit the "Patch" button as shown:

Image:DLDITut3.jpg

If all went well, you should get the following:

Image:DLDITut4.jpg

Now, just copy the patched file onto your media and toss it into your DS.

[edit] Developer Guide

  • To develop using DLDI, there are only a few simple steps you need to complete:
  1. Add "#include <fat.h>" to the top of your main source file
  2. Add "-lfat" to the LIBS:= line in Makefile
  3. Initialize FAT before using, by "int result = fatInitDefault();", a result of 1 is success
  4. Then just use standard C file I/O commands. Such as fopen, fread, fseek, fwrite, fclose, feof. There are many guides & documentation on using these, a simple search should find tons, since they are not specific to the DS.
Dev-Scene (c)