JesseTG / melonds-ds

A remake of the libretro melonDS core that prioritizes standalone parity, reliability, and usability.
GNU General Public License v3.0
106 stars 14 forks source link
ds dsi emulation emulator libretro libretro-cores melonds nds nintendo nintendo-ds nintendo-ds-emulator nintendo-dsi retro retroarch retrocomputing retrogaming

melonDS DS

An enhanced remake of the melonDS core for libretro that prioritizes standalone parity, reliability, and usability.

melonDS DS Latest Release melonDS DS GitHub Actions Workflow Status melonDS DS Gitlab Pipeline Status

Getting melonDS DS

You can download and install melonDS DS through RetroArch's built-in core downloader where supported. If you'd like to try a development build or can't use the core downloader, you can get the latest release of melonDS DS from this repo's Releases, or the raw build artifacts from here.

Installation

Installation instructions may vary depending on your chosen libretro frontend.

RetroArch

You can install melonDS DS through the built-in core downloader where supported. If your build of RetroArch doesn't include it (e.g. Steam) or if you want to use a development build, you can install it RetroArch manually like so:

  1. Place melondsds_libretro.dll (or .so or .dylib, depending on the platform) in RetroArch's cores directory.
  2. Place melondsds_libretro.info in the same directory as the other .info files, which is usually cores or info depending on the platform.

Using melonDS DS

Usage instructions may vary depending on your chosen libretro frontend.

RetroArch

Playing Nintendo DS Games

  1. Start RetroArch.
  2. Scan your Nintendo DS game library with the Import Content menu to build a playlist if you haven't already.
  3. Load a Nintendo DS game from the playlist. If you have the legacy melonDS core installed, you may need to select melonDS DS explicitly.

[!IMPORTANT] If you have ROM hacks or homebrew, you may need to manually add them to the playlist with the Manual Scan submenu.

Installing Nintendo DS BIOS

melonDS includes built-in BIOS and firmware replacements that work with most games. However, additional system files may be required for certain features or games to work properly.

You can place your system files in RetroArch's system directory or in a subdirectory named melonDS DS. Name the system files as follows:

*Required for DSi mode.

Game Boy Advance Connectivity

The steps for loading a Game Boy Advance ROM are a little more involved. Native BIOS files are not required.

  1. Load the melonDS DS core using the Load Core menu.
  2. Enter the Subsystems menu and select Load Slot 1 & 2 Boot.
  3. Select a Nintendo DS ROM, a Game Boy Advance ROM, and optionally a Game Boy Advance save file (in that order).
  4. Start the game.

This combination of ROMs will appear in your History playlist, so you won't have to repeat this process every time you want to play.

[!NOTE] melonDS can load Game Boy Advance ROMs and save data for the purpose of Slot-2 connectivity, but it cannot actually play GBA games. Use a GBA core instead.

New Features

Enhancements over the legacy melonDS core include:

Standalone Parity

Unlike most other libretro cores, melonDS DS is not a fork of an existing code base. It uses standalone melonDS as a statically-linked dependency, which means that large changes and merge conflicts are less of an issue. As a result, improvements to standalone melonDS are much easier to integrate!

Wi-Fi Support

Wi-Fi is fully emulated on all platforms!

For your convenience, you can choose from one of several preconfigured servers in the core options menu, with Kaeru WFC being the default.

If there's another server you'd like to use, you can set its DNS address from within the emulated console's Wi-Fi settings menu.

[!NOTE] Do not confuse this with local multiplayer. melonDS DS does not support emulating local wireless at this time.

Homebrew Save Data

The legacy core does not support save data for homebrew games. However, melonDS DS does!

melonDS DS looks in the system/melonDS DS directory (i.e. alongside the BIOS files) for a homebrew SD card image named dldi_sd_card.bin. If one doesn't exist, a virtual 4GB SD card will be created if necessary. See the core options for more information.

[!NOTE] melonDS DS does not support savestates for homebrew games.

Microphone Support

melonDS DS supports libretro's new microphone API, allowing you to use your device's microphone for Nintendo DS games!

[!NOTE] This feature requires support from the frontend. The latest stable release of RetroArch includes microphone support on several platforms.

Screen Rotation

melonDS DS fully supports rotating the emulated DS left, right, and upside-down! Now you can play games that were meant to be played sideways, such as Brain Age.

Enhanced Screen Layout Options

The legacy melonDS core supports multiple screen layouts, but they can only be switched out through the core options menu. This is inconvenient for games that use different layouts.

melonDS DS allows you to cycle through up to 8 screen layouts (including rotations) at the push of a button!

Streamlined DSiWare Installation

melonDS does not support direct-booting DSiWare at this time; you need to install DSiWare games to a NAND image, then start them from the DSi menu when you want to play.

But melonDS DS streamlines this process!

Other Niceties

Missing Features

These features have not yet been implemented in standalone melonDS, or they haven't been integrated into melonDS DS. If you want to see them, ask how you can get involved!

Compatibility

Games

melonDS DS is compatible with all games that melonDS supports, unless otherwise noted in the Missing Features section. If this is not the case, please report it.

Frontends

melonDS DS primarily targets RetroArch, but you can use it with most libretro frontends. If you encounter problems using this core with other frontends, please report them! Support is not guaranteed, but I'll do the best I can.

Platforms

melonDS DS will run on the following platforms, assuming it's used with a frontend that also supports them:

Available features may vary depending on the platform and frontend.

The legacy melonDS core has builds for the Nintendo Switch and for 32-bit versions of the above platforms, but melonDS DS will not support these platforms unless there's enough demand.

Building

melonDS DS is built with CMake.

Dependencies

You will need to install the following beforehand:

Most other dependencies are fetched automatically by CMake.

Windows

  1. Install MSYS2.
  2. Open the MSYS2 MinGW 64-bit terminal from the Start Menu.
  3. Install dependencies like so:

    pacman -Syu # update the package database
    pacman -S git mingw-w64-x86_64-{cmake,toolchain} # install dependencies
  4. Proceed to Compilation. You may need to remain in the MSYS2 terminal.

macOS

  1. Install Homebrew.
  2. Install dependencies like so:

    brew install cmake git pkg-config cmake
  3. Install Xcode and the Xcode command-line tools.
  4. Proceed to Compilation.

[!NOTE] macOS builds exclude OpenGL by default, as the OpenGL renderer doesn't currently work on the platform. To enable it anyway, pass -DENABLE_OPENGL=ON to CMake.

Linux

  1. Install dependencies like so:

    sudo apt install cmake git pkg-config # Ubuntu/Debian
    sudo pacman -S base-devel cmake extra-cmake-modules git # Arch Linux
  2. Proceed to Compilation.

Android

  1. Install the Android SDK and NDK. The simplest way to do this is through Android Studio.
  2. Proceed to Compilation.

iOS

These steps can only be done on macOS.

  1. Install Xcode and the Xcode command-line tools.
  2. Proceed to Compilation.

Compilation

Once you've installed the dependencies, the process for building melonDS DS is mostly the same on all platforms:

git clone https://github.com/JesseTG/melonds-ds
cd melonds-ds
cmake -B build # Generate the build system, and add any -D or --toolchain flags here
cmake --build build # Build the project

However, some platforms or features need you to add some extra flags to the first cmake command:

macOS

If building for the macOS architecture that your device uses, no extra flags are required. To produce a build for a specific arhitecture, pass -DCMAKE_OSX_ARCHITECTURES:STRING=$ARCH to the initial cmake command, where $ARCH is one of the following:

[!WARNING] Universal builds of melonDS DS are not supported, as there is a history of them not working reliably.

Android

You'll need to add the following flags to build for Android.

You should also use the version of cmake that the NDK includes.

Here's an example configure step for cmake on Windows. This command uses the NDK-bundled toolchain to prepare a 64-bit ARM build for Android API level 24.

PS C:\Users\Jesse\Projects\melonds-ds> $Env:ANDROID_SDK_ROOT\cmake\3.22.1\bin\cmake.exe `
    -DANDROID_ABI=arm64-v8a `
    -DANDROID_PLATFORM=24 `
    -DCMAKE_TOOLCHAIN_FILE=$Env:ANDROID_NDK\build\cmake\android.toolchain.cmake

The command will be more or less the same on other platforms, but the paths will be different.

See here for more information about these and other Android-specific CMake variables.

iOS/tvOS

You will need to add the following flags to build for iOS or tvOS:

Tracy Integration

melonDS DS supports the Tracy frame profiler. To enable it, add -DTRACY_ENABLE=ON to the initial cmake command.

CMake Variables

These are some of the most important CMake variables that can be used to configure the build. To see the rest, run cmake -LH in the build directory.

Variable Description
ENABLE_OPENGL Whether to build the OpenGL renderer. Defaults to ON on Windows and Linux, OFF on other platforms.
TRACY_ENABLE Enables the Tracy frame profiler.
MELONDS_REPOSITORY_URL The Git repo from which melonDS will be cloned. Set this to use a fork.
MELONDS_REPOSITORY_TAG The melonDS commit to use in the build.
FETCHCONTENT_SOURCE_DIR_MELONDS Path to a copy of the melonDS repo on your system. Set this to use a local branch instead of cloning.
LIBRETRO_COMMON_REPOSITORY_URL The Git repo from which libretro-common will be cloned. Set this to use a fork.
LIBRETRO_COMMON_REPOSITORY_TAG The libretro-common commit to use in the build.

See here and here for more information about the variables that CMake and its modules define; these can also be used to customize the build.

About the Name

Various games received enhanced remakes or ports to the Nintendo DS, including such gems as:

What do these games have in common? They're all remakes or enhanced ports with a suffix of "DS"!

I see this core as an enhanced remake of the legacy melonDS core, so I wanted to embody that in the name.

Special Thanks

Disclaimers

This project is not affiliated with, developed by, or endorsed by the melonDS team or by Nintendo.