Libfat
Encyclopedia
libfat is a FAT
Fat
Fats consist of a wide group of compounds that are generally soluble in organic solvents and generally insoluble in water. Chemically, fats are triglycerides, triesters of glycerol and any of several fatty acids. Fats may be either solid or liquid at room temperature, depending on their structure...

 library made by Michael "Chishm" Chisholm for the Nintendo DS
Nintendo DS
The is a portable game console produced by Nintendo, first released on November 21, 2004. A distinctive feature of the system is the presence of two separate LCD screens, the lower of which is a touchscreen, encompassed within a clamshell design, similar to the Game Boy Advance SP...

 to code Nintendo DS Homebrew
Nintendo DS homebrew
Nintendo DS homebrew software is unofficial software written for the Nintendo DS by hobbyist programmers, as opposed to software written by a game production company or corporation . The DS homebrew software is typically used on the DS via third-party rewritable game cartridges, or SD cards...

 applications. It is the successor of the dual GBA NDS FAT library, which was also used, like libfat, to code Nintendo DS Homebrew
Nintendo DS homebrew
Nintendo DS homebrew software is unofficial software written for the Nintendo DS by hobbyist programmers, as opposed to software written by a game production company or corporation . The DS homebrew software is typically used on the DS via third-party rewritable game cartridges, or SD cards...

 applications. It is packaged as part of DevKitARM, a software development kit, or Devkit for ARM microprocessor microprocessors namely the ARM7TDMI(-S) and ARM946E-S cores used in the Nintendo DS
Nintendo DS
The is a portable game console produced by Nintendo, first released on November 21, 2004. A distinctive feature of the system is the presence of two separate LCD screens, the lower of which is a touchscreen, encompassed within a clamshell design, similar to the Game Boy Advance SP...

.

It is a replacement SDK (Devkit) for the commercial Nintendo SDK. It is a minimalist-style library, easier to use than the Nintendo SDK. Libfat, like libnds, supports nearly all features of the DS including touch screen, microphone, 3D hardware, 2D hardware, and IEEE 802.11b Wi-Fi via the dswifi library. Multiple slot booting is a feature unique to libfat.

DLDI

DLDI (or Dynamically-Linked Device Interface) is a technology created by Michael "Chishm" Chisholm as an interface for libfat that developers attach to their projects. libfat is programmed in a sigle language, but different flashcarts, such as the R4DS, use different read/write commands. The DLDI Patch fixes this, as explained below.

Without DLDI, libfat receives encrypted commands from the flashcart, and cannot act accordingly, so it sends an error to the homebrew explaining that it cannot understand the commands, which then presents this information to the flashcart, and the user, in the form of a black screen.

With the correct DLDI patch applied to the homebrew, the DLDI patch acts as an interface between the flashcart/user and the homebrew. It unencrypts the flashcart's specific read/write commands and converts them into a libfat-specific programming language, which libfat can understand and present the homebrew with information which can then be passed onto the flashcart/user.

Using libfat

libfat, like any FAT
Fat
Fats consist of a wide group of compounds that are generally soluble in organic solvents and generally insoluble in water. Chemically, fats are triglycerides, triesters of glycerol and any of several fatty acids. Fats may be either solid or liquid at room temperature, depending on their structure...

library, uses a main source file. The library's operations are conducted by a single fat.h file in the source file with the code:


#include


libfat can be uniquely programmed to use the slots on the Nintendo DS Slot 1 being the main DS cartridge slot, Slot 2 being the GBA slot on the Nintendo DS and DS Lite, and SD Card slot on the DSi and DSiXL. libfat can use or boot from two slots at the same time, as in taking information from a SLOT 2 device while running the main program from SLOT 1. This can be programmed by using the following codes:


fat: -- the default device
fat0: -- same as fat:
fat1: -- the device in Slot-1 of the NDS
fat2: -- the device in Slot-2 of the NDS
fat3: -- a custom mounted device
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK