Coder Social home page Coder Social logo

jessetg / melonds-ds Goto Github PK

View Code? Open in Web Editor NEW
89.0 6.0 14.0 2.1 MB

A remake of the libretro melonDS core that prioritizes standalone parity, reliability, and usability.

License: GNU General Public License v3.0

CMake 9.40% C++ 86.15% C 2.67% GLSL 0.16% Python 0.73% Lua 0.89%
ds dsi emulation emulator libretro libretro-cores melonds nintendo-ds nintendo-ds-emulator nintendo-dsi retroarch retrocomputing retrogaming nintendo nds retro

melonds-ds's Introduction

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:

  • DS ARM7 BIOS: bios7.bin*
  • DS ARM9 BIOS: bios9.bin*
  • DS Firmware: Anything, pick an image in the core options
  • DSi ARM7 BIOS: dsi_bios7.bin*
  • DSi ARM9 BIOS: dsi_bios9.bin*
  • DSi Firmware: Anything, pick an image in the core options*
  • DSi System NAND: Anything, pick an image in the core options*

*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!

  • When you select a DSiWare ROM, it's temporarily installed on the NAND and removed when you exit the core.
  • Title metadata is automatically downloaded from Nintendo's servers and cached locally for later.
  • When a DSi game is loaded, the DSi menu will boot with the temp-installed game selected.

Other Niceties

  • Battery Support: melonDS DS uses libretro's new power state API to reflect your device's power status (battery level, charging status, etc.) in the emulated console! Requires support by the frontend.
  • Selectable NAND and Firmware Images: You don't need to hard-code a specific name for your firmware or NAND images! Just place them in system/melonDS DS (or local equivalent) and pick them from the core options.

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!

  • Local Wireless: Upstream melonDS supports emulating local wireless multiplayer (e.g. Multi-Card Play, Download Play) with multiple instances of melonDS on the same computer. However, melonDS DS does not support this functionality at this time.
  • Homebrew Savestates: melonDS has limited support for taking savestates of homebrew games, as the virtual SD card is not included in savestate data.
  • DSi Savestates: Nintendo DSi mode does not support savestates. This implies that rewinding and runahead are not supported in DSi mode.
  • DSi Direct Boot: Direct Boot does not support DSiWare games at this time. They must be installed on a NAND image, and they must be started from the DSi menu.
  • Game Boy Advance Emulation: melonDS can load Game Boy Advance ROMs and save data for use by compatible Nintendo DS games, but it cannot actually emulate the GBA. GBA emulation is not within the scope of melonDS; use a GBA emulator instead.
  • Slot-2 Accessories: The only Slot-2 accessories that melonDS currently supports are the solar sensor and Memory Expansion Pak. However, melonDS DS does not yet support these devices.
  • GDB Stub Support: melonDS recently gained support for debugging emulated DS games with GDB. This is a low priority for melonDS DS, since libretro frontends are typically used for playing games. However, I may integrate it if there's enough demand.
  • DSi Camera Support: Standalone melonDS supports emulating the DSi's cameras. Support in melonDS DS is planned, but has not yet been integrated.

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:

  • Windows (x86_64)
  • macOS (x86_64 and arm64)
  • Linux (x86_64 and arm64)
  • Android (arm64)
  • iOS (arm64)

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:

  • CMake 3.19 or later
  • Git
  • A C++17 compiler (MSVC is not supported)

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:

  • x86_64 for x86_64 builds.
  • arm64 for Apple Silicon builds.
  • x86_64;arm64 for universal builds.

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.

  • --toolchain=...: The path to the android.toolchain.cmake file in your NDK installation. The location varies depending on how you installed the NDK; it will most likely be in $ANDROID_NDK/build/cmake.
  • -DANDROID_ABI=...: The ABI to build for. This should be arm64-v8a or x86_64. If in doubt, use arm64-v8a.
  • -DANDROID_PLATFORM=...: The Android API level to target. The minimum level supported by melonDS DS is 24.

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:

  • --toolchain=./cmake/toolchain/ios.toolchain.cmake: The path to the ios.toolchain.cmake that's bundled with melonDS DS.
  • -DPLATFORM=...: The target platform to build for. Use OS64 for iOS and TVOS for tvOS. See cmake/toolchain/ios.toolchain.cmake for more information about the available CMake variables that this toolchain defines.
  • -DDEPLOYMENT_TARGET=...: The minimum SDK version to target. The minimum level supported by melonDS DS is 14.

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

  • The melonDS team for making a great emulator and for their help on Discord.
  • The libretro team for making a great app, for their help on Discord, and for fixing RetroArch bugs that affected melonDS DS.
  • Everyone who's ever reported a bug, for their role in ensuring a polished product.
  • Nintendo, for all the memories.

Disclaimers

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

melonds-ds's People

Contributors

jessetg avatar olemorud avatar robloach avatar warmenhoven avatar zorn-v avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

melonds-ds's Issues

Add support for the solar sensor

I'm thinking there are four modes of support I'll want to implement:

  1. Use the luminescence sensor, if available
  2. Use the camera and take the brightness of the image
  3. Use manual hotkeys
  4. Use a mouse wheel

Feature roadmap: Support GBA save data

Right now there are no libretro APIs that facilitate getting information about other cores; specifically, there's no way to know where the frontend will save a particular game's data (for a given core). You can make some guesses, but:

  • These guesses may not hold for each frontend
  • Frontends can override settings on a per-game or per-core basis

On top of that, SRAM is stored in a fixed location. So even if you could figure out where another game's data is saved, you can't write directly back to it using existing libretro APIs.

So I'd like to submit a new API to RetroArch before implementing support for GBA save data.

Feature roadmap: Migrate existing melonDS core config

This entails two things:

  1. Providing instructions in the README on renaming RetroArch directories (and maybe other frontends)
  2. Recognizing settings that are named with the melonds prefix and adapting them to melondsds equivalents.

Software renderer only displays a blank white screen

According to someone from upstream melonDS...

it compiles and loads but the game doesn't run [on an ARM-based Mac]

video driver doesn't make a difference
regardless of which one I use, all I get is a white screen with the movable touchscreen cursor

I even have direct boot disabled, so the game shouldn't matter
same result [if direct boot is enabled]

retroarch.log

Show an on-screen status indicator

Possible items to include:

  • Microphone state (on or off)
  • Lid state (open or closed)
  • Layout state (current layout/number of layouts)

Maybe I'll want a new settings category for notifications, too.

Touchscreen Cursor Doesn't Work in "Top Only" Screen Layout

Touch Mode "Mouse" or "Joystick" don't work in the "Top Only" Screen Layout option. They do work in "Bottom Only", but somewhat oddly the cursor doesn't disappear when you use the screen toggle button to switch to the top screen. I would expect to only see the cursor when viewing the bottom screen. Though I don't think I'd mind that much if the cursor autohid after a few seconds like in Desmume libretro.

JIT_FastMemory doesn't work on macOS builds

JIT_FastMemory doesn't work on the macOS version of upstream melonDS, so I need to disable it entirely in the macOS builds.

The JIT works [on macOS] but fastmem does not
Fixing it is actually trivial but it seems to have no impact on performance

You should disable it for both versions of macOS

Itโ€™s broken on Intel too, not sure why and canโ€™t really test it
might be the same issue with unmapping the space in memory it reserves or whatever
(arm64 also breaks because it tries to write to executable memory but thatโ€™s not a problem on x86 macOS)

Feature roadmap: Camera support

Once I get the core reliably working on other people's machines and attain feature parity with the existing core, the first new feature I have my sights on is camera support for DSi games. That will entail use of this API.

Failure to start core in RALibretro for DSi games (wine)

When attempting to start the core for a DSi game in RALibretro, the core fails to initialize based on seemingly being unable to open the DSi NAND. This -seems- to be due to a double backslash in the path based on the log, but I can't say with certainty. Tested on Garuda Linux x86_64 via wine using the Windows x86_64 version of the core, RALibretro 1.6 (current).

This core was previously known to work with DSi on Windows (untested via wine), so this is likely a regression introduced by the selectable DSi NAND location. It still works fine for DS games in DS mode.

RALibretro log of core run

[INFO ] [UTL] Read 3605 bytes from "Z:\home\ccrowley\src\RALibretro\bin64\RALibretro.json"
[INFO ] [APP] Initialized audio device. 2 channels@44100Hz (format:8010, silence:0, samples:1024, padding:0, size:4096)
[INFO ] [INP] Controller Keyboard (Keyboard) added
[INFO ] [OGL] Initializing OpenGL 4.6.0 NVIDIA 535.98
[INFO ] [UTL] Read 13661 bytes from "Z:\home\ccrowley\src\RALibretro\bin64\Cores\cores.json"
[INFO ] [BCR] Loading core Z:\home\ccrowley\src\RALibretro\bin64\Cores\melondsds_libretro.dll
[INFO ] [BCR] Found libretro API retro_init
[INFO ] [BCR] Found libretro API retro_deinit
[INFO ] [BCR] Found libretro API retro_api_version
[INFO ] [BCR] Found libretro API retro_get_system_info
[INFO ] [BCR] Found libretro API retro_get_system_av_info
[INFO ] [BCR] Found libretro API retro_set_environment
[INFO ] [BCR] Found libretro API retro_set_video_refresh
[INFO ] [BCR] Found libretro API retro_set_audio_sample
[INFO ] [BCR] Found libretro API retro_set_audio_sample_batch
[INFO ] [BCR] Found libretro API retro_set_input_poll
[INFO ] [BCR] Found libretro API retro_set_input_state
[INFO ] [BCR] Found libretro API retro_set_controller_port_device
[INFO ] [BCR] Found libretro API retro_reset
[INFO ] [BCR] Found libretro API retro_run
[INFO ] [BCR] Found libretro API retro_serialize_size
[INFO ] [BCR] Found libretro API retro_serialize
[INFO ] [BCR] Found libretro API retro_unserialize
[INFO ] [BCR] Found libretro API retro_cheat_reset
[INFO ] [BCR] Found libretro API retro_cheat_set
[INFO ] [BCR] Found libretro API retro_load_game
[INFO ] [BCR] Found libretro API retro_load_game_special
[INFO ] [BCR] Found libretro API retro_unload_game
[INFO ] [BCR] Found libretro API retro_get_region
[INFO ] [BCR] Found libretro API retro_get_memory_data
[INFO ] [BCR] Found libretro API retro_get_memory_size
[INFO ] [BCR] Core successfully loaded
[INFO ] [UTL] Read 1841 bytes from "Z:\home\ccrowley\src\RALibretro\bin64\Cores\melondsds_libretro.json"
[INFO ] [CFG] Selection melonds_number_of_screen_layouts deserialized as "2"
[INFO ] [CFG] Selection melonds_ds_battery_ok_threshold deserialized as "20"
[INFO ] [CFG] Selection melonds_screen_layout5 deserialized as "hybrid-top"
[INFO ] [CFG] Selection melonds_hybrid_small_screen deserialized as "both"
[INFO ] [CFG] Selection melonds_jit_literal_optimisations deserialized as "enabled"
[INFO ] [CFG] Selection melonds_direct_network_interface deserialized as "auto"
[INFO ] [CFG] Selection melonds_audio_interpolation deserialized as "disabled"
[INFO ] [CFG] Selection melonds_show_cursor deserialized as "always"
[INFO ] [CFG] Selection melonds_dsi_nand_path deserialized as "dsi_nand.bin"
[INFO ] [CFG] Selection melonds_hybrid_ratio deserialized as "2"
[INFO ] [CFG] Selection melonds_audio_bitdepth deserialized as "auto"
[INFO ] [CFG] Selection melonds_threaded_renderer deserialized as "disabled"
[INFO ] [CFG] Selection melonds_language deserialized as "auto"
[INFO ] [CFG] Selection melonds_opengl_better_polygons deserialized as "disabled"
[INFO ] [CFG] Selection melonds_dsi_sdcard_readonly deserialized as "disabled"
[INFO ] [CFG] Selection melonds_console_mode deserialized as "ds"
[INFO ] [CFG] Selection melonds_cursor_timeout deserialized as "3"
[INFO ] [CFG] Selection melonds_network_mode deserialized as "indirect"
[INFO ] [CFG] Selection melonds_boot_directly deserialized as "enabled"
[INFO ] [CFG] Selection melonds_use_external_bios deserialized as "enabled"
[INFO ] [CFG] Selection melonds_override_fw_settings deserialized as "disabled"
[INFO ] [CFG] Selection melonds_dsi_sdcard deserialized as "enabled"
[INFO ] [CFG] Selection melonds_opengl_resolution deserialized as "1"
[INFO ] [CFG] Selection melonds_screen_layout2 deserialized as "left-right"
[INFO ] [CFG] Selection melonds_firmware_favorite_color deserialized as "0"
[INFO ] [CFG] Selection melonds_mic_input_active deserialized as "hold"
[INFO ] [CFG] Selection melonds_opengl_filtering deserialized as "nearest"
[INFO ] [CFG] Selection melonds_screen_gap deserialized as "0"
[INFO ] [CFG] Selection melonds_render_mode deserialized as "software"
[INFO ] [CFG] Selection melonds_mic_input deserialized as "microphone"
[INFO ] [CFG] Selection melonds_screen_layout1 deserialized as "top-bottom"
[INFO ] [CFG] Selection melonds_battery_update_interval deserialized as "15"
[INFO ] [CFG] Selection melonds_dsi_sdcard_sync_sdcard_to_host deserialized as "disabled"
[INFO ] [CFG] Selection melonds_screen_layout3 deserialized as "top"
[INFO ] [CFG] Selection melonds_screen_layout4 deserialized as "bottom"
[INFO ] [CFG] Selection melonds_screen_layout6 deserialized as "hybrid-bottom"
[INFO ] [CFG] Selection melonds_screen_layout7 deserialized as "bottom-top"
[INFO ] [CFG] Selection melonds_screen_layout8 deserialized as "right-left"
[INFO ] [CFG] Selection melonds_homebrew_sdcard deserialized as "enabled"
[INFO ] [CFG] Selection melonds_homebrew_readonly deserialized as "disabled"
[INFO ] [CFG] Selection melonds_homebrew_sync_sdcard_to_host deserialized as "disabled"
[INFO ] [CFG] Selection melonds_jit_enable deserialized as "enabled"
[INFO ] [CFG] Selection melonds_jit_block_size deserialized as "32"
[INFO ] [CFG] Selection melonds_jit_branch_optimisations deserialized as "enabled"
[INFO ] [CFG] Selection melonds_jit_fast_memory deserialized as "enabled"
[WARN ] [COR] Unimplemented env call: SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK (69)
[INFO ] [COR] retro_system_content_info_override
[INFO ] [COR]   srm|sav need_fullpath=1 persistent_data=0
[WARN ] [COR] Unimplemented env call: 77
[WARN ] [COR] Unimplemented env call: GET_MESSAGE_INTERFACE_VERSION (59)
[INFO ] Save directory: "Z:\home\ccrowley\src\RALibretro\bin64\Saves\"
[INFO ] System directory: "Z:\home\ccrowley\src\RALibretro\bin64\System\"
[INFO ] melonDS DS system directory: "Z:\home\ccrowley\src\RALibretro\bin64\System\melonDS DS"
[INFO ] [COR] GET_VFS_INTERFACE: requested version 1, providing version 2
[INFO ] Frontend supports no-game mode.
[WARN ] [COR] Unimplemented env call: 75
[WARN ] Microphone interface not available; substituting silence instead.
wine: Read access denied for device L"\\??\\D:\\", FS volume label and serial are not available.
[INFO ] [UTL] Read 16739328 bytes from "D:\Nintendo - Nintendo DSi (Digital)\Shantae - Risky's Revenge (Europe)\Shantae - Risky's Revenge (Europe).nds"
[WARN ] [COR] Unimplemented env call: GET_GAME_INFO_EXT (66)
[INFO ] [CFG] Variable melonds_console_mode found in selections, set to "ds"
[INFO ] [CFG] Variable melonds_boot_directly found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_override_fw_settings found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_language found in selections, set to "auto"
[INFO ] [CFG] Variable melonds_firmware_favorite_color found in selections, set to "0"
[INFO ] [CFG] Variable melonds_use_external_bios found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_battery_update_interval found in selections, set to "15"
[INFO ] [CFG] Variable melonds_ds_battery_ok_threshold found in selections, set to "20"
[INFO ] [CFG] Variable melonds_dsi_sdcard found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_dsi_sdcard_readonly found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_dsi_sdcard_sync_sdcard_to_host found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_dsi_nand_path found in selections, set to "dsi_nand.bin"
[INFO ] [CFG] Variable melonds_render_mode found in selections, set to "software"
[INFO ] [CFG] Variable melonds_opengl_resolution found in selections, set to "1"
[INFO ] [CFG] Variable melonds_opengl_better_polygons found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_opengl_filtering found in selections, set to "nearest"
[INFO ] [CFG] Variable melonds_threaded_renderer found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_mic_input found in selections, set to "microphone"
[INFO ] [CFG] Variable melonds_mic_input_active found in selections, set to "hold"
[INFO ] [CFG] Variable melonds_audio_bitdepth found in selections, set to "auto"
[INFO ] [CFG] Variable melonds_audio_interpolation found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_network_mode found in selections, set to "indirect"
[INFO ] [CFG] Variable melonds_direct_network_interface found in selections, set to "auto"
[INFO ] [CFG] Variable melonds_show_cursor found in selections, set to "always"
[INFO ] [CFG] Variable melonds_cursor_timeout found in selections, set to "3"
[INFO ] [CFG] Variable melonds_hybrid_ratio found in selections, set to "2"
[INFO ] [CFG] Variable melonds_hybrid_small_screen found in selections, set to "both"
[INFO ] [CFG] Variable melonds_screen_gap found in selections, set to "0"
[INFO ] [CFG] Variable melonds_number_of_screen_layouts found in selections, set to "2"
[INFO ] [CFG] Variable melonds_screen_layout1 found in selections, set to "top-bottom"
[INFO ] [CFG] Variable melonds_screen_layout2 found in selections, set to "left-right"
[INFO ] [CFG] Variable melonds_screen_layout3 found in selections, set to "top"
[INFO ] [CFG] Variable melonds_screen_layout4 found in selections, set to "bottom"
[INFO ] [CFG] Variable melonds_screen_layout5 found in selections, set to "hybrid-top"
[INFO ] [CFG] Variable melonds_screen_layout6 found in selections, set to "hybrid-bottom"
[INFO ] [CFG] Variable melonds_screen_layout7 found in selections, set to "bottom-top"
[INFO ] [CFG] Variable melonds_screen_layout8 found in selections, set to "right-left"
[INFO ] [CFG] Variable melonds_homebrew_sdcard found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_homebrew_readonly found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_homebrew_sync_sdcard_to_host found in selections, set to "disabled"
[INFO ] [CFG] Variable melonds_jit_enable found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_jit_block_size found in selections, set to "32"
[INFO ] [CFG] Variable melonds_jit_branch_optimisations found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_jit_literal_optimisations found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_jit_fast_memory found in selections, set to "enabled"
[INFO ] [CFG] Variable melonds_console_mode is "ds"
[INFO ] [CFG] Variable melonds_boot_directly is "enabled"
[INFO ] [CFG] Variable melonds_use_external_bios is "enabled"
[INFO ] [CFG] Variable melonds_ds_battery_ok_threshold is "20"
[INFO ] [CFG] Variable melonds_battery_update_interval is "15"
[INFO ] [CFG] Variable melonds_jit_enable is "enabled"
[INFO ] [CFG] Variable melonds_jit_block_size is "32"
[INFO ] [CFG] Variable melonds_jit_branch_optimisations is "enabled"
[INFO ] [CFG] Variable melonds_jit_literal_optimisations is "enabled"
[INFO ] [CFG] Variable melonds_jit_fast_memory is "enabled"
[INFO ] [CFG] Variable melonds_dsi_sdcard_readonly is "disabled"
[INFO ] [CFG] Variable melonds_dsi_sdcard_sync_sdcard_to_host is "disabled"
[INFO ] [CFG] Variable melonds_dsi_sdcard is "enabled"
[INFO ] [CFG] Variable melonds_dsi_nand_path is "dsi_nand.bin"
[INFO ] [CFG] Variable melonds_override_fw_settings is "disabled"
[INFO ] [CFG] Variable melonds_mic_input_active is "hold"
[INFO ] [CFG] Variable melonds_mic_input is "microphone"
[INFO ] [CFG] Variable melonds_audio_bitdepth is "auto"
[INFO ] [CFG] Variable melonds_audio_interpolation is "disabled"
[INFO ] [CFG] Variable melonds_network_mode is "indirect"
[INFO ] [CFG] Variable melonds_threaded_renderer is "disabled"
[INFO ] [CFG] Variable melonds_render_mode is "software"
[INFO ] [CFG] Variable melonds_opengl_resolution is "1"
[INFO ] [CFG] Variable melonds_opengl_better_polygons is "disabled"
[INFO ] [CFG] Variable melonds_opengl_filtering is "nearest"
[INFO ] [CFG] Variable melonds_screen_gap is "0"
[INFO ] [CFG] Variable melonds_cursor_timeout is "3"
[INFO ] [CFG] Variable melonds_show_cursor is "always"
[INFO ] [CFG] Variable melonds_hybrid_ratio is "2"
[INFO ] [CFG] Variable melonds_hybrid_small_screen is "both"
[INFO ] [CFG] Variable melonds_number_of_screen_layouts is "2"
[INFO ] [CFG] Variable melonds_screen_layout1 is "top-bottom"
[INFO ] [CFG] Variable melonds_screen_layout2 is "left-right"
[INFO ] [CFG] Variable melonds_screen_layout3 is "top"
[INFO ] [CFG] Variable melonds_screen_layout4 is "bottom"
[INFO ] [CFG] Variable melonds_screen_layout5 is "hybrid-top"
[INFO ] [CFG] Variable melonds_screen_layout6 is "hybrid-bottom"
[INFO ] [CFG] Variable melonds_screen_layout7 is "bottom-top"
[INFO ] [CFG] Variable melonds_screen_layout8 is "right-left"
[WARN ] Forcing DSi mode for DSiWare game
[INFO ] Found dsi_bios7.bin
[INFO ] Found dsi_bios9.bin
[INFO ] Found dsi_firmware.bin
[INFO ] Found dsi_nand.bin
[INFO ] Not using homebrew SD card
[INFO ] No DSi SD card image found at "Z:\home\ccrowley\src\RALibretro\bin64\Saves\dsi_sd_card.bin"; will create an image.
[WARN ] [COR] Unimplemented env call: GET_TARGET_REFRESH_RATE (50)
[INFO ] [VID] OSD message (300): This frontend doesn't support microphones.
[INFO ] [CFG] Variable melonds_render_mode is "software"
[INFO ] [CFG] Setting visibility on variable melonds_opengl_resolution to hidden
[INFO ] [CFG] Setting visibility on variable melonds_opengl_filtering to hidden
[INFO ] [CFG] Setting visibility on variable melonds_opengl_better_polygons to hidden
[INFO ] [CFG] Variable melonds_console_mode is "ds"
[INFO ] [CFG] Setting visibility on variable melonds_dsi_sdcard to hidden
[INFO ] [CFG] Setting visibility on variable melonds_dsi_sdcard_readonly to hidden
[INFO ] [CFG] Setting visibility on variable melonds_dsi_sdcard_sync_sdcard_to_host to hidden
[INFO ] [CFG] Variable melonds_show_cursor is "always"
[INFO ] [CFG] Setting visibility on variable melonds_cursor_timeout to hidden
[INFO ] [CFG] Variable melonds_number_of_screen_layouts is "2"
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout1 to visible
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout2 to visible
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout3 to hidden
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout4 to hidden
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout5 to hidden
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout6 to hidden
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout7 to hidden
[INFO ] [CFG] Setting visibility on variable melonds_screen_layout8 to hidden
[INFO ] [CFG] Variable melonds_screen_layout1 is "top-bottom"
[INFO ] [CFG] Variable melonds_screen_layout2 is "left-right"
[INFO ] [CFG] Setting visibility on variable melonds_hybrid_small_screen to hidden
[INFO ] [CFG] Setting visibility on variable melonds_hybrid_ratio to hidden
[INFO ] [CFG] Variable melonds_jit_enable is "enabled"
[WARN ] [COR] Unimplemented env call: GET_CAMERA_INTERFACE (26)
[WARN ] Camera interface not available.
[WARN ] [melonDS] ROM entry not found for gamecode 1345540939
[WARN ] [melonDS] !! bad ROM size 16739328 (expected 16777216) rounded to 16777216
[INFO ] Using software renderer
[INFO ] No need to defer initialization, proceeding now
[INFO ] [melonDS] ARM9 BIOS loaded
[INFO ] [melonDS] ARM7 BIOS loaded
[INFO ] [melonDS] ARM9i BIOS loaded
[INFO ] [melonDS] ARM7i BIOS loaded
[INFO ] [melonDS] MAC: A4:C0:E1:D3:56:DA
[INFO ] [melonDS] Loading DSi NAND
3E9B3A034E3257373136354D00011500
[ERROR] [UTL] Error opening "Z:\home\ccrowley\src\RALibretro\bin64\Saves\dsi_sd_card.bin": No such file or directory
[ERROR] [melonDS] Attempted to open SDCardImage "Z:\home\ccrowley\src\RALibretro\bin64\Saves\dsi_sd_card.bin" in FileMode 0x7, but failed
[WARN ] [melonDS] Attempted to open SDCardImage "Z:\home\ccrowley\src\RALibretro\bin64\Saves\dsi_sd_card.bin" in FileMode 0xf, but the file doesn't exist and FileMode::NoCreate is set
[INFO ] [melonDS] NWifi MAC: A4:C0:E1:D3:56:DA
[INFO ] [melonDS] Loading DSi NAND
[ERROR] [UTL] Error opening "Z:\home\ccrowley\src\RALibretro\bin64\System\\dsi_nand.bin": Permission denied
[ERROR] [melonDS] Attempted to open DSiNANDImage "Z:\home\ccrowley\src\RALibretro\bin64\System\\dsi_nand.bin" in FileMode 0xf, but failed
[ERROR] [melonDS] Failed to load DSi NAND
[ERROR] Failed to load NAND. Please report this issue.
[INFO ] [VID] OSD message (300): An internal error occurred with melonDS DS. Please contact the developer withthe log file.
[ERROR] [COR] Error loading content
[INFO ] [BCR] Core destroyed
[INFO ] [UTL] Wrote 1841 bytes to "Z:\home\ccrowley\src\RALibretro\bin64\Cores\melondsds_libretro.json"
[INFO ] [BCR] Core destroyed

Add a way to adjust placement and scale of touch screen area

When we use shaders to move around the DS screens for artistic or usage reasons this creates a problem for the user that the image of the second screen no longer matches the actual touchscreen area mapped by the core.

To address this it would be great to have a way to scale and position the screen relative to it's default position so what might work would be something like:

  • A parameter to adjust the scale of the screen relative to it's default scale as a percentage maybe something like 0-300%
  • A parameter to scale vertically
  • A parameter to scale horizontally
  • A parameter to adjust the position up or down (Based in percentage of the vertical height of the screen)
  • A parameter to move it left and right (Based in percentage of the vertical height of the screen this is so that when the horizontal aspect gets larger, e.g. on a 21:9 monitor the horizontal position would not move)
  • When rotating the positions should of course rotate as well.

We would need to optionally constrain base aspect of the touch screen mapping when we have a video scaling which would stretch it, e.g. m. For example in the Mega Bezel example, or any border shader like it, you need to set the video scaling aspect ratio to FULL so that the shader renders over the entire monitor. But the touch screen mapping needs to avoid stretching, since after the shader the image of the touch screen will not be stretched across the whole monitor.

Here's an example shader setup that we'd like to support, here the video/scaling is set to FULL so the shader can render all across the screen so we can add dynamic lighting etc.
image
image
image

This is 3ds but similar idea could be applied to NDS
image

Here's a link to a pared down version of Duimon's NDS presets.
https://1drv.ms/u/s!AlJgyN_LYasy5qEPm_njQuRXJzbSzg?e=weoh81

The files should go in: shaders/Mega_Bezel_Packs/Duimon-Mega-Bezel-NDS

There are additional Mega Bezel install instructions here:
https://forums.libretro.com/t/mega-bezel-reflection-shader-feedback-and-updates/25512

Cursor position is incorrect in OpenGL mode

When using the OpenGL renderer, the on-screen cursor is drawn in a slightly incorrect position. The actual input coordinates are fine. So is the cursor when rendered in software mode.

Feature roadmap: Customizable layout hotkey sequences

The current melonDS core lets you switch the position of the top and bottom screens with the press of a hotkey, but that's it. Some games have segments that are played sideways, others have segments that only use one screen.

[Request] Allow loading EU bios specifically for EU DSi games

DSi games are region locked, meaning attempting to load an EU game with a US bios in place doesn't work. It'd be nice if, either via core option or string detection (Europe in the name for instance), the core could switch to a European bios on-demand to allow these titles to work without filesystem shenanigans.

Unexposed memory for DSi necessary for achievement support

I was testing for RetroAchievements purposes earlier and while some games did work, Shantae in particular did not. This indicates a region of memory not being exposed properly, though I currently can't open the core in RALibretro to attempt to confirm further details.

Per request, this is the memory expected by RetroAchievements:
https://github.com/RetroAchievements/rcheevos/blob/111db1cabe6a3723155cbe8726874b4b3abbbb6c/src/rcheevos/consoleinfo.c#L652

Joystick Touchscreen Cursor Control Doesn't Work

I have my touch joystick controls set to the right stick like so:

nojoystickworky

But moving the right stick doesn't move the cursor. There's no core option to select joystick for touchscreen cursor movement anymore, so I assume it should just work. Only the mouse moves it now though.

Won't compile on platforms that lack `std::filesystem` support

Some platforms lack support for C++17's std::filesystem, even if the rest of the language is fully implemented. (The standard says this is okay.)

I don't use std::filesystem, but upstream melonDS does in a few places. I've been told that they're unwilling to remove std::filesystem entirely, but there are libraries that mimic the interface. Depending on how they work, I might want to send another patch. Or perhaps a simple -include;header.h compiler argument hack would suffice. Not sure yet.

But this is a low-priority item for now.

Flush the emulated filesystems at a regular interval

Changes to the DSi NAND image, homebrew SD card, or DSi SD card are not guaranteed to be flushed to disk at any particular time, except when their underlying files on the host disk are closed. However, if RetroArch crashes then any changes might be lost.

So I need to flush changes to these file systems to disk at a regular interval. Don't know when yet.

OpenGL ES is not supported

Upstream melonDS does not support OpenGL ES, which means that neither does melonDS DS. The software renderer is faster, more accurate, and more compatible than the OpenGL renderer; the only disadvantage is the lack of resolution upscaling. Given that, I do not consider OpenGL ES support a priority -- however, I will accept PRs that contribute it (although most of the work will have to be done upstream).

Feature roadmap: Wi-fi

The current melonDS core does not support wi-fi. I intend to add support for it. (Not to be confused with local multiplayer; that's probably not in the cards for a while, if at all.)

Fails to Load Content When zlib1.dll Not Present in RetroArch Directory (Windows)

I have Github Actions scripts to build "Minimal" and "Super Minimal" versions of RetroArch. They have certain features disabled to reduce the amount of .dll's required and the .exe size. The latest builds of melonDS DS work fine in the "Minimal" build (or the official full RA build from the buildbot), but not the "Super Minimal" build, which has many more things disabled. Here is a log: https://pastebin.com/ygfhSrp3

For reference, the "Minimal" build uses this configure setup:

./configure --disable-qt --disable-ffmpeg --disable-sdl2

While "Super Minimal" looks like this:

./configure --disable-overlay --disable-networking --disable-video_filter --disable-glsl --disable-bsv_movie --disable-dsp_filter --disable-cheats --disable-rewind --disable-accessibility --disable-translate --disable-cdrom --disable-imageviewer --disable-qt --disable-ffmpeg --disable-sdl2 --disable-blissbox --disable-xmb --disable-materialui --disable-rgui --disable-d3d9 --disable-d3d10 --disable-d3d12 --disable-wasapi --disable-libretrodb --disable-audiomixer --disable-dsound --disable-flac --disable-dr_mp3 --disable-rtga --disable-rjpeg --disable-rbmp --disable-freetype --disable-langextra --disable-cc_resampler --disable-nearest_resampler --disable-crtswitchres --disable-chd --disable-7zip --disable-patch

Simplify BIOS settings

Instead of controlling the use of BIOS behind two or three flags, I'd like to just use one setting. Perhaps something like:

System BIOS:

  • Require Native: Only use the native BIOS. Exit if it's not available.
  • Prefer Native (default): Use the native BIOS if available, fall back to FreeBIOS if not.
  • Use FreeBIOS: Use FreeBIOS, and don't look for the native BIOS.

Loading file contained in DSiWare archives does not remove the game on exit

DSiWare commonly comes as a file titled 00000000, which itself is an archive containing a file named file. 7zip can be used to extract this if desired. Loading 00000000 (with a .dsi extension) installs and uninstalls the game as expected, but loading file.dsi installs to nand and doesn't remove it at the end of the session. For whatever reason, both files can exist on the nand simultaneously as well, as seen when loading 00000000 after loading file.

Segfault on re-launch of core within same session

Currently closing and reopening the core within the same retroarch session results in a segfault. The first launch works fine. JIT Fast Memory was disabled to allow gdb to capture the backtrace properly. System is Garuda Linux x86_64. Game launched was a DSi game, in case it's relevant.

Full thread backtrace

Thread 1 "retroarch" received signal SIGSEGV, Segmentation fault.
0x00007fff907859ba in melonds::SaveManager::SramLength (this=0x0)
at /home/runner/work/melonds-ds/melonds-ds/src/libretro/memory.hpp:72
Downloading source file /home/runner/work/melonds-ds/melonds-ds/src/libretro/memory.hpp
72      /home/runner/work/melonds-ds/melonds-ds/src/libretro/memory.hpp: Directory not empty.
(gdb) thread apply all bt

Thread 29 (Thread 0x7fffe1c456c0 (LWP 4553) "retroarch"):
#0  0x00007ffff39039df in __GI___poll (fds=fds@entry=0x7fffe1c42a88, nfds=nfds@entry=1, timeout=5000) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff3938127 in send_dg (statp=statp@entry=0x7fffe1c45d78, buf=buf@entry=0x7fffe1c42ce0 "\330o\001", buflen=buflen@entry=39, buf2=buf2@entry=0x7fffe1c42d08 "eq\001", buflen2=buflen2@entry=39, ansp=ansp@entry=0x7fffe1c42c38, anssizp=<optimized out>, terrno=<optimized out>, ns=<optimized out>, v_circuit=<optimized out>, gotsomewhere=<optimized out>, anscp=<optimized out>, ansp2=<optimized out>, anssizp2=<optimized out>, resplen2=<optimized out>, ansp2_malloced=<optimized out>) at res_send.c:994
#2  0x00007ffff3938e03 in __GI___res_context_send (ctx=ctx@entry=0x7fff84002220, buf=buf@entry=0x7fffe1c42ce0 "\330o\001", buflen=buflen@entry=39, buf2=buf2@entry=0x7fffe1c42d08 "eq\001", buflen2=buflen2@entry=39, ans=<optimized out>, ans@entry=0x7fffe1c43550 "", anssiz=<optimized out>, ansp=<optimized out>, ansp2=<optimized out>, nansp2=<optimized out>, resplen2=<optimized out>, ansp2_malloced=<optimized out>) at res_send.c:373
#3  0x00007ffff39361fa in __GI___res_context_query (ctx=ctx@entry=0x7fff84002220, name=name@entry=0x555556f7d0f8 "retroachievements.org", class=class@entry=1, type=type@entry=439963904, answer=answer@entry=0x7fffe1c43550 "", anslen=anslen@entry=2048, answerp=<optimized out>, answerp2=<optimized out>, nanswerp2=<optimized out>, resplen2=<optimized out>, answerp2_malloced=<optimized out>) at res_query.c:221
#4  0x00007ffff3936fa5 in __res_context_querydomain (answerp2_malloced=0x7fffe1c43524, resplen2=0x7fffe1c43520, nanswerp2=0x7fffe1c4351c, answerp2=0x7fffe1c43530, answerp=0x7fffe1c43528, anslen=2048, answer=0x7fffe1c43550 "", type=439963904, class=1, domain=0x0, name=0x555556f7d0f8 "retroachievements.org", ctx=0x7fff84002220) at res_query.c:633
#5  __GI___res_context_search (ctx=ctx@entry=0x7fff84002220, name=name@entry=0x555556f7d0f8 "retroachievements.org", class=class@entry=1, type=type@entry=439963904, answer=answer@entry=0x7fffe1c43550 "", anslen=anslen@entry=2048, answerp=<optimized out>, answerp2=<optimized out>, nanswerp2=<optimized out>, resplen2=<optimized out>, answerp2_malloced=<optimized out>) at res_query.c:389
#6  0x00007ffff3930111 in __GI__nss_dns_gethostbyname4_r (name=name@entry=0x555556f7d0f8 "retroachievements.org", pat=pat@entry=0x7fffe1c43e80, buffer=0x7fffe1c43fe0 "\177", buflen=<optimized out>, errnop=<optimized out>, herrnop=herrnop@entry=0x7fffe1c45614, ttlp=<optimized out>) at nss_dns/dns-host.c:418
#7  0x00007ffff38e370e in get_nss_addresses (res=0x7fffe1c43e80, tmpbuf=0x7fffe1c43fd0, req=<optimized out>, name=<optimized out>) at ../sysdeps/posix/getaddrinfo.c:637
#8  gaih_inet (tmpbuf=0x7fffe1c43fd0, naddrs=<synthetic pointer>, pai=0x7fffe1c43e50, req=<optimized out>, service=<optimized out>, name=<optimized out>) at ../sysdeps/posix/getaddrinfo.c:1170
#9  __GI_getaddrinfo (name=<optimized out>, service=<optimized out>, hints=<optimized out>, pai=<optimized out>) at ../sysdeps/posix/getaddrinfo.c:2378
#10 0x0000555555fffa7f in getaddrinfo_retro (node=0x555556f7d0f8 "retroachievements.org", service=0x7fffe1c445c2 "443", hints=0x7fffe1c44590, res=0x7fffe1c445f8) at libretro-common/net/net_compat.c:337
#11 0x000055555600210d in socket_init (address=0x7fffe1c445f8, port=443, server=0x555556f7d0f8 "retroachievements.org", type=SOCKET_TYPE_STREAM, family=0) at libretro-common/net/net_socket.c:73
#12 0x0000555556000291 in net_http_new_socket (conn=0x555557bdcae0) at libretro-common/net/net_http.c:431
#13 0x0000555556000c5f in net_http_new (conn=0x555557bdcae0) at libretro-common/net/net_http.c:745
#14 0x00005555560061e9 in cb_http_conn_default (data_=0x55555c099fd0, len=0) at tasks/task_http.c:97
#15 0x000055555600617d in task_http_conn_iterate_transfer_parse (http=0x55555c099fd0) at tasks/task_http.c:77
#16 0x00005555560063de in task_http_transfer_handler (task=0x555557cfd690) at tasks/task_http.c:152
#17 0x000055555574ea33 in threaded_worker (userdata=0x0) at libretro-common/queues/task_queue.c:515
#18 0x0000555555a86778 in thread_wrap (data_=0x555557124f60) at libretro-common/rthreads/rthreads.c:144
#19 0x00007ffff388c9eb in start_thread (arg=<optimized out>) at pthread_create.c:444
#20 0x00007ffff391123c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 9 (Thread 0x7fffade6b6c0 (LWP 4510) "retroarch"):
#0  0x00007ffff38894ae in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x7fffade6a5c0, op=137, expected=0, futex_word=0x555559257dec) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x555559257dec, expected=expected@entry=0, clockid=clockid@entry=1, abstime=abstime@entry=0x7fffade6a5c0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007ffff388952f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x555559257dec, expected=expected@entry=0, clockid=clockid@entry=1, abstime=abstime@entry=0x7fffade6a5c0, private=private@entry=0) at futex-internal.c:139
#3  0x00007ffff388c325 in __pthread_cond_wait_common (abstime=<optimized out>, clockid=<optimized out>, mutex=0x555559257d98, cond=0x555559257dc0) at pthread_cond_wait.c:503
#4  ___pthread_cond_clockwait64 (abstime=<optimized out>, clockid=<optimized out>, mutex=0x555559257d98, cond=0x555559257dc0) at pthread_cond_wait.c:682
#5  ___pthread_cond_clockwait64 (cond=0x555559257dc0, mutex=0x555559257d98, clockid=<optimized out>, abstime=<optimized out>) at pthread_cond_wait.c:670
#6  0x000055555605256d in std::__condvar::wait_until(std::mutex&, int, timespec&) (this=0x555559257dc0, __m=..., __clock=1, __abs_time=...) at /usr/include/c++/13.2.1/bits/std_mutex.h:185
#7  0x0000555556053eb4 in std::condition_variable::__wait_until_impl<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) (this=0x555559257dc0, __lock=..., __atime=std::chrono::_V2::steady_clock time_point = { 879768028229ns }) at /usr/include/c++/13.2.1/condition_variable:203
#8  0x000055555605385b in std::condition_variable::wait_until<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) (this=0x555559257dc0, __lock=..., __atime=std::chrono::_V2::steady_clock time_point = { 879768028229ns }) at /usr/include/c++/13.2.1/condition_variable:113
#9  0x0000555556052ce8 in std::condition_variable::wait_for<long, std::ratio<1l, 1000l> >(std::unique_lock<std::mutex>&, std::chrono::duration<long, std::ratio<1l, 1000l> > const&) (this=0x555559257dc0, __lock=..., __rtime=std::chrono::duration = { 500ms }) at /usr/include/c++/13.2.1/condition_variable:165
#10 0x0000555556052791 in IoThreadHolder::Start()::{lambda()#1}::operator()() const (__closure=0x55555925af28) at deps/discord-rpc/src/discord_rpc.cpp:102
#11 0x0000555556054c52 in std::__invoke_impl<void, IoThreadHolder::Start()::{lambda()#1}>(std::__invoke_other, IoThreadHolder::Start()::{lambda()#1}&&) (__f=...) at /usr/include/c++/13.2.1/bits/invoke.h:61
#12 0x0000555556054c15 in std::__invoke<IoThreadHolder::Start()::{lambda()#1}>(IoThreadHolder::Start()::{lambda()#1}&&) (__fn=...) at /usr/include/c++/13.2.1/bits/invoke.h:96
#13 0x0000555556054bc2 in std::thread::_Invoker<std::tuple<IoThreadHolder::Start()::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x55555925af28) at /usr/include/c++/13.2.1/bits/std_thread.h:292
#14 0x0000555556054b96 in std::thread::_Invoker<std::tuple<IoThreadHolder::Start()::{lambda()#1}> >::operator()() (this=0x55555925af28) at /usr/include/c++/13.2.1/bits/std_thread.h:299
#15 0x0000555556054b7a in std::thread::_State_impl<std::thread::_Invoker<std::tuple<IoThreadHolder::Start()::{lambda()#1}> > >::_M_run() (this=0x55555925af20) at /usr/include/c++/13.2.1/bits/std_thread.h:244
#16 0x00007ffff3ce1943 in std::execute_native_thread_routine(void*) (__p=0x55555925af20) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#17 0x00007ffff388c9eb in start_thread (arg=<optimized out>) at pthread_create.c:444
#18 0x00007ffff391123c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Thread 1 (Thread 0x7fffe1c8be80 (LWP 4421) "retroarch"):
#0  0x00007fff907859ba in melonds::SaveManager::SramLength() const (this=0x0) at /home/runner/work/melonds-ds/melonds-ds/src/libretro/memory.hpp:72
#1  0x00007fff9078c711 in retro_get_memory_size(unsigned int) (type=0) at /home/runner/work/melonds-ds/melonds-ds/src/libretro/memory.cpp:186
#2  0x000055555566a9d6 in core_get_memory (info=0x7ffffffefa20) at runloop.c:7648
#3  0x0000555555757237 in autosave_init () at tasks/task_save.c:359
#4  0x000055555564f3e0 in command_event (cmd=CMD_EVENT_AUTOSAVE_INIT, data=0x0) at retroarch.c:2994
#5  0x0000555555662c55 in runloop_path_init_savefile (runloop_st=0x55555682bec0 <runloop_state>) at runloop.c:4215
#6  0x0000555555662d43 in event_init_content (runloop_st=0x55555682bec0 <runloop_state>, settings=0x7fffe1c46010, input_st=0x555556883b00 <input_driver_st>) at runloop.c:4258
#7  0x0000555555663a11 in runloop_event_init_core (settings=0x7fffe1c46010, input_data=0x555556883b00 <input_driver_st>, type=CORE_TYPE_PLAIN, old_savefile_dir=0x555556829c92 <rarch_st+37394> "/home/ccrowley/.config/retroarch/saves", old_savestate_dir=0x55555682ac92 <rarch_st+41490> "/home/ccrowley/.config/retroarch/states") at runloop.c:4728
#8  0x0000555555650133 in command_event (cmd=CMD_EVENT_CORE_INIT, data=0x555556833c74 <runloop_state+32180>) at retroarch.c:3360
#9  0x00005555556582e1 in retroarch_main_init (argc=11, argv=0x7fffffff68f0) at retroarch.c:6580
#10 0x0000555555752394 in content_load (info=0x7fffffff6b30, p_content=0x55555682c638 <runloop_state+1912>) at tasks/task_content.c:1455
#11 0x0000555555752c77 in command_event_cmd_exec (p_content=0x55555682c638 <runloop_state+1912>, data=0x7fffffff8de0 "/home/ccrowley/ROMs/_addpath/1001 Crystal Mazes Collection (Europe) (extracted).nds", content_ctx=0x7fffffff6bd0, launched_from_cli=false) at tasks/task_content.c:1849
#12 0x000055555575344d in task_push_load_content_from_playlist_from_menu (core_path=0x7fffffffade0 "/home/ccrowley/.config/retroarch/cores/melondsds_libretro.so", fullpath=0x7fffffff8de0 "/home/ccrowley/ROMs/_addpath/1001 Crystal Mazes Collection (Europe) (extracted).nds", label=0x0, content_info=0x7fffffff6c50, cb=0x0, user_data=0x0) at tasks/task_content.c:2112
#13 0x00005555559fa642 in default_action_ok_load_content_from_playlist_from_menu (_path=0x7fffffffade0 "/home/ccrowley/.config/retroarch/cores/melondsds_libretro.so", path=0x7fffffff8de0 "/home/ccrowley/ROMs/_addpath/1001 Crystal Mazes Collection (Europe) (extracted).nds", entry_label=0x0) at menu/cbs/menu_cbs_ok.c:2410
#14 0x00005555559fb930 in action_ok_playlist_entry_collection (path=0x7fffffffc94a "Run", label=0x7fffffffca49 "collection", type=7, idx=0, entry_idx=0) at menu/cbs/menu_cbs_ok.c:2789
#15 0x00005555559f4848 in generic_menu_entry_action (userdata=0x555558c9dfe0, entry=0x7fffffffc530, i=0, action=MENU_ACTION_OK) at menu/menu_driver.c:7509
#16 0x0000555555962327 in xmb_menu_entry_action (userdata=0x555558c9dfe0, entry=0x7fffffffc530, i=0, action=MENU_ACTION_OK) at menu/drivers/xmb.c:4750
#17 0x00005555559ed621 in menu_entry_action (entry=0x7fffffffc530, i=0, action=MENU_ACTION_OK) at menu/menu_driver.c:4173
#18 0x00005555559f3762 in generic_menu_iterate (menu_st=0x5555568f5bc0 <menu_driver_state>, p_disp=0x5555568a0a00 <dispgfx_st>, p_anim=0x5555568a0ae0 <anim_st>, settings=0x7fffe1c46010, menu=0x555558c8ffa0, userdata=0x555558c9dfe0, action=MENU_ACTION_OK, current_time=878531405) at menu/menu_driver.c:7167
#19 0x00005555559f52ad in menu_driver_iterate (menu_st=0x5555568f5bc0 <menu_driver_state>, p_disp=0x5555568a0a00 <dispgfx_st>, p_anim=0x5555568a0ae0 <anim_st>, settings=0x7fffe1c46010, action=MENU_ACTION_OK, current_time=878531405) at menu/menu_driver.c:7734
#20 0x00005555556663ac in runloop_check_state (error_on_init=false, settings=0x7fffe1c46010, current_time=878531405) at runloop.c:5893
#21 0x0000555555668eac in runloop_iterate () at runloop.c:6900
#22 0x000055555565322d in rarch_main (argc=1, argv=0x7fffffffd5b8, data=0x0) at retroarch.c:4926
#23 0x000055555584cfcb in main(int, char**) (argc=1, argv=0x7fffffffd5b8) at ui/drivers/ui_qt.cpp:4219

Android version crashes on startup

Whenever I try to start the core directly or load a game on Android Retroarch, the core instantly crashes.

Below you'll find the log along with the settings and a recording of the bug:
https://github.com/JesseTG/melonds-ds/assets/78131583/64ee69c8-45f1-4c30-bb60-541828f5f348

retroarch__2023_08_06__19_51_37.log

this is the opt file setting:

melonds_audio_bitdepth = "auto" melonds_audio_interpolation = "disabled" melonds_boot_directly = "disabled" melonds_console_mode = "ds" melonds_dsi_sdcard = "enabled" melonds_dsi_sdcard_readonly = "disabled" melonds_dsi_sdcard_sync_sdcard_to_host = "disabled" melonds_firmware_favorite_color = "0" melonds_homebrew_readonly = "disabled" melonds_homebrew_sdcard = "enabled" melonds_homebrew_sync_sdcard_to_host = "disabled" melonds_hybrid_small_screen = "bottom" melonds_jit_block_size = "32" melonds_jit_branch_optimisations = "disabled" melonds_jit_enable = "disabled" melonds_jit_fast_memory = "disabled" melonds_jit_literal_optimisations = "disabled" melonds_language = "auto" melonds_mic_input = "microphone" melonds_mic_input_active = "hold" melonds_number_of_screen_layouts = "2" melonds_override_fw_settings = "disabled" melonds_screen_gap = "8" melonds_screen_layout1 = "top-bottom" melonds_screen_layout2 = "top-bottom" melonds_screen_layout3 = "top-bottom" melonds_screen_layout4 = "top-bottom" melonds_screen_layout5 = "top-bottom" melonds_screen_layout6 = "top-bottom" melonds_screen_layout7 = "top-bottom" melonds_screen_layout8 = "top-bottom" melonds_threaded_renderer = "enabled" melonds_touch_mode = "touch" melonds_use_external_bios = "enabled"

Fallback paths in system don't function for DSi NAND

According to the setting description, DSi NAND files can be placed in melonDS or melonDS DS subdirectories in system. Despite that, placing files in either location will result in them not being found. They load correctly from system directly. Tested on Garuda Linux x86_64.

Inability to change core settings when locked into DSi mode without BIOS

The title might not be the best, but will explain.

When you change the mode of the MelonDSDS core from DS->DSi, it checks to make sure you have the BIOS files before launching the core.
However, if you do this and don't have any dsi BIOS, it gracefully prevents you from starting the core.
It also prevents you from making any changes to the core settings to remove yourself from DSi mode, making you essentially stuck.

This might be a mix of user error and core error, so attaching the log files next to hopefully help figure this out.

Touch Mode Joystick Causes Analog to Digital to Not Work

If you use the RetroArch frontend option input, port 1 controls, Analog to Digital Type "Left Analog", it doesn't pass through D-Pad input if you also have Touch Mode set to Joystick in core options. If you set Touch Mode back to off you still won't get left analog input until you restart RetroArch. You can use "Left Analog (Forced)" to get it to work even when Touch Mode Joystick is enabled.

Games do not run without a BIOS

this got repeated [in the attached log file] a few hundred thousand times i think

[libretro WARN] undefined ARM7 instruction E7FFDEFF @ 00000004

oh boy
why is it reading the start of the arm9/arm7.bin and why does it think it's at offset 0

well for starters it should be running code at like
02xxxxxx
unless the bios also starts with E7FFDEFF which i doubt
maybe it's reading the arm9/arm7 binaries as BIOS?

that would have to be the FreeBIOS then, cuz it couldn't locate my ds bios files (which makes sense since i didn't have any inside the system folder)

freebios definitely does not start with the E7FFDEFF thing

cool so it's trying to read something that's completely nonexistent

I think I might be loading the BIOS improperly.

SRAM doesn't load saved data

also loading saves works, but actually saving does not

the game will say that a save was created, but in reality nothing is overwritten

@JesseTG ok what's happening is that retroarch is writing the save to a .srm file, but your core only reads .sav files
so it ends up creating a new .srm file that your core never reads
while the original .sav file is left untouched, leaving the impression that the core didn't actually save anything

Add a "subsystem" for installing a DSiWare game to a NAND image

This would use the subsystem feature, but it wouldn't actually launch any software. When you install a game this way, the core would exit and report a successful installation.

There's no need to add a deletion option, that can be done from within the emulated DSi.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.