Nintendo DS homebrew
This article needs additional citations for verification. (March 2010) (Learn how and when to remove this template message)
Nintendo DS homebrew software is unofficial software written for the Nintendo DS by hobbyist programmers, versus software written by a game production company or corporation using the official development tools from Nintendo. Homebrew software is typically used on the DS via third-party rewritable game cartridges, SD cards, emulators, or rewritten game cards. It is made using libnds and often using the libfat FAT library.
Since the Nintendo DS is not sold with a storage medium, a third-party storage device is needed to store homebrew.
SLOT-1 and SLOT-2 devices
The earliest systems for homebrew employed a storage device in the Game Boy Advance (GBA) cartridge slot (referred to as SLOT-2) and a booting tool in the Nintendo DS cartridge slot (referred to as SLOT-1). This two-tool combination is commonly referred to as SLOT-2 or 1st Generation. Later on, cards that only used the DS slot (SLOT-1) to store and run homebrew software were developed. These devices are referred to as 2nd Generation cards.
There are a few main differences between the two technologies used:
- SLOT-1 devices do not require users to acquire and use a separate booting tool in addition to a storage device.
- Only SLOT-2 devices can run GBA homebrew directly, although programs such as gbaldr can be used to copy a GBA program from a SLOT-1 card to a Game Boy Advance flash cartridge in SLOT-2.
- Homebrew compatibility has typically been better on SLOT-2 cards because they have been around longer, and thus supported more. And so, many early programs were written for them specifically. This has changed with increasing adoption of SLOT-1 devices by developers and the introduction of Dynamically Linked Device Interface (DLDI) drivers, which allow a piece of homebrew to be written to work with any DLDI-supporting device. Previously, a FAT library had to be recompiled for each new device, which was time-consuming. However, not all developers have adopted this technology yet, and many programs from before 2007 have since been abandoned and may never be updated.
- SLOT-2 devices sometimes contain extra RAM (similar to the SLOT-2 RAM expansion cartridge that comes with the Nintendo DS Browser) or Rumble Pak abilities that can be used by homebrew or, for the Rumble, Nintendo games. However, the serial design of SLOT-1 does not lend itself to being used for RAM or Rumble expansion, and therefore SLOT-1 devices do not offer extra RAM or Rumble ability. (Separate RAM/Rumble expansion packs for SLOT-2 can still be bought.) However, somehow a few manufacturers have managed to pack processors in SLOT-1 devices.
SLOT-1 devices include the DSTT, DS iPlayer, R4DS (Gold), M3 DS Simply, and their clones, R4i, N-Card, MK5, iTouch DS, SuperCard DS One, SuperCard DS Onei, SuperCard DSTwo, CycloDS Evolution, EDGE DS, iEDGE, the AceKard, Acekard 2, Acekard 2i, the DS Link, the DS-Xtreme, the NinjaPass X9, EZ-Flash V, the Datel Games n' Music, M3 Real, M3i Zero, G6 Real, and DSTTi.
The available systems for Game Boy Advance or Nintendo DS homebrew differ in size, compatibility with commercial ROM images, bundled special features (such as included media players), availability, and cost. To store homebrew, all flash cards use either built-in flash memory or external flash memory cards, like microSD or CompactFlash. Nintendo states the internal memory capacity of their game cartridges in bits, while external cards state capacity in 8-bit bytes.
This section possibly contains original research. (March 2010) (Learn how and when to remove this template message)
This section does not cite any sources. (March 2010) (Learn how and when to remove this template message)
Running DS homebrew using a SLOT-2 storage device needs a booting tool. A booting tool is a device that sends the DS' instruction pointer to an address in the GBA slot, allowing programs to be run from storage there. A booting tool is not needed for SLOT-1 devices, nor is a booting tool needed to use GBA homebrew on the DS.
One of the most popular booting tools is the program FlashMe. This is a modified firmware for the DS. Once it is installed over the existing firmware on the DS, homebrew applications can be booted directly from SLOT-2. In addition to being a booting tool, it also protects the DS from the 1 known DS Bricker program and removes the RSA check on DS Download Play, allowing the user to use WifiME (Wireless Multi Boot) to download homebrew applications. Optionally, it can disable the health and safety warning shown when the device is powered on. Many users of SLOT-1 devices still install FlashMe because of these extra features.
Since the FlashMe installation program is itself a homebrew program, another homebrew booting tool is needed for its installation. The other homebrew booting tool is only needed once, at install time, and therefore can either be borrowed for this occasion or sold after use. Upgrades to FlashMe can be booted from the existing FlashMe installation.
The other method commonly seen is a device called a PassMe. This is a physical card, sold under brand names such as EZ-Pass, SuperKey and MAX Media Launcher, that look like a DS Game Card. They feature a FPGA SOC whose unique goal is to redirect the program counter to the GBA slot. Some SLOT-1 cards, such as the M3 DS Simply and the DSTT, have this built into their firmware so they can act as a slot 2 booting device; other SLOT-1 cards can run a program stored on the card to jump to SLOT-2 in the same way.
Before the encryption on SLOT-1 was reverse-engineered, which allowed the creation of SLOT-1 storage and NoPass devices, booting tools had to exploit flaws in early versions of the Nintendo DS' firmware or in specific games. Booting tools under this category include PassMe, which exploited a flaw in the DS firmware's header check for Game Cards; WiFiMe, which exploited a flaw in the DS firmware's header check for DS Download Play; and PassMe2, which exploited a flaw in the DS BIOS. Some PassMe and PassMe2 devices came with a serial port for some homebrew apps to use. PassMe and WiFiMe worked only with early versions of the DS firmware, causing mild confusion until a method of checking a DS's firmware version involving crashing PictoChat was discovered. But because these methods require a DS with older firmware, must be programmed to work with a specific game, or leave clumsy dongles hanging off the back of the DS, these booting tools have seen decreasing popularity as of 2006[update].
Checking the firmware version
In the third quarter of 2005, after SLOT-2 cards first became popular, Nintendo changed the firmware of new DS units to lock out the PassMe booting tool, starting with the iQue DS. A different, more difficult exploit for the new firmware was discovered a bit later. In January 2006, the homebrew community found a way to determine the version of firmware installed on a DS, so that the user could determine which exploit to buy. It involved the behavior of PictoChat if a DS Game Card or Game Boy Advance cartridge is ejected or the lid is closed. In the first version, PictoChat would freeze; later versions would change both screens to a solid color, with a different color for each firmware version. It is commonly called the Pink Screen of Death; not to be confused with the Blue Screen of Death or Black Screen of Death.
The version results are as follows:
- v1: Pictochat hangs/no colour appears
- v2: two greyish blue screens
- v3/iQue: two dark green screens
- v4: two golden yellow screens
- v5: two magenta screens (DS lite units have this, along with a few pink original DS units)
- v6: two dark blue screens
- v7: DS system does not crash (Only present on the Japanese limited edition golden DS Lite)
Note: the DSi does not crash when ejecting a Slot-1 Card in Pictochat. It uses a completely different firmware that can be updated at will. The version is shown in the Settings applet.
Homebrew using expanded RAM
This section does not cite any sources. (March 2010) (Learn how and when to remove this template message)
Many homebrew programmers have encountered difficult to navigate obstacles while developing their projects as a result of the DS's relatively weak CPU and little RAM compared to PCs of the time. The introduction of the Nintendo DS Memory Expansion Pak (included with Nintendo DS Browser) and the recent inclusion of extra RAM in some Slot-2 devices (SuperCard SD/CF/Lite, EZ3-in-1), as well as the 1GB of NAND memory in the Acekard RPG, and a GBA slot expansion pack with the M3 Real has allowed programmers to overcome some of these obstacles.
Homebrew DS applications are generally programmed using C/C++. A popular toolchain is devkitARM. A few libraries that make programming easier include libnds, libfat, dswifi, NFlib and PAlib (not being developed anymore). libfat helps developers write to a File Allocation Table (FAT) file system on the homebrew storage device while dswifi lets developers access the console's Wi-Fi abilities. Several tutorials have been written about the various aspects of the system.
Some other programming languages have been ported to the console:
- fpc4nds is a port of Free Pascal for cross compiling for DS
- Micro Lua DS brings Lua to the Nintendo DS
- DSPython is a port of Python (programming language)
- DSBasic is a port of BASIC
One of the biggest issues of programming homebrew on the DS is accessing a card's file system. This is due to each homebrew device using a different interface to access an inserted media card. This has been solved by the introduction of DLDI (Dynamically Linked Disc Interface) drivers, which superseded the use of drivers statically linked into the homebrew application during compiling. The current FAT library, libfat, is provided with the ability to use these drivers. Its predecessor, GBA NDS FAT, can be modified to use these drivers too.
A problem with early DS homebrew was that many programs were not compatible with certain flash cards. Each card requires its own routine to access the storage device (CF/SD/etc). A program compiled before the release of a certain card would not have the needed routines to support that card. Additionally, including all of these routines would bloat the program. DLDI (Dynamically Linked Device Interface) solves this issue by removing the access routines from the programs. Instead, a module containing the routines for a given card is patched into the executable by the user using a simple graphical or command-line utility. This ensures forward-compatibility, as the driver for a card can be inserted into any DLDI-compatible program, and prevents bloat by removing support code for other cards from the program.
DLDI patches and patching tools can be found at DLDI Wiki.
Modern Slot-1 flash cards (usually starting from 2007 or newer, like R4 DS or M3 DS Real) automatically patch compatible homebrew with the designated DLDI driver on startup to eliminate the need of manual patching on the PC.
Sites and projects
Homebrew applications for the DS add many features to the console. There are internet related tools like web browsers, instant messengers, and email clients. Multimedia programs allow users to enjoy movies, music, ebooks and comics. Emulators let people play games designed for another system.
- Animanatee DS – a digital painting and fan Animated application for Nintendo DS and Nintendo 3DS
- Colors! – a digital painting application for Nintendo DS
- DSLinux – a port of Linux to the DS
- Mini vMac DS – A port of Mini vMac, a Macintosh Plus emulator to the DS.
- DS2Win – a remote control for DS
- DSx86 – an x86 PC emulator
- dslibris – an EPUB book reader
- DSOrganize – includes a file browser, launcher, web browser, organizer, media player, and other features
- DSwiki – an offline Wikipedia reader
- Eigenmath DS – a computer algebra system for the Nintendo DS
- GEOS – a GUI initially developed for the Commodore 64
- Inferno DS – a port of the distributed operating system Inferno to the Nintendo DS
- MoonShell – a media player that plays DPG movies and several music formats; also allows viewing images and text files
- Dubquake – an online multiplayer game
- SvSIP – a VoIP/SIP client for Nintendo DS
- GameUP – a repository that allows the user to download and rate over 400 homebrew applications
- Beup Live – a Windows Live Messenger (MSN) client for Nintendo DS created by HtheB
- EOSTools – a tool to preview and install skins, update shell and data (ndsinfo.dat, ds1patch.dat) of the supercards' Evolution OS
- fb4nds – a program that gives access to Facebook
- "Nintendo 1.4.1 / 1.4.2 Firmware Blocks DSi Flash Cards". Retrieved 2010-09-20.
- DS Firmware - PHWiki (Backup at WayBack Machine)
- https://github.com/develersrl/dspython DSPython on GitHub
- DSBasic project on Dev Scene
- DLDI Wiki
- DSLinux homepage
- DSOrganize home page
- "dswiki - Offline-Wikipedia reader for the Nintendo DS - Google Project Hosting". Code.google.com. Retrieved 2014-06-20.
- Eigenmath DS homepage
- inferno-ds home page
- Infantile Paralysiser: MoonShell Ver1.71 Top page Archived March 9, 2007, at the Wayback Machine.
- Dubquake home page
- "supercard.fr". Gameup.supercard.fr. Retrieved 2014-06-20.
- Beup Live
- http://www.htheb.com HtheB website
- Fef51's EOSTools website
- "fb4nds - Facebook for Nintendo DS - Google Project Hosting". Code.google.com. Retrieved 2014-06-20.