Emulation Homebrew melonDS for Switch — continuation part 2

Deleted member 671446

Well-Known Member
Newcomer
Joined
Sep 8, 2023
Messages
82
Reaction score
144
Trophies
0
XP
555
Hi. I'm Giorgio, online known as Gheovgos, I recently decided to take the old work on melonDS by @catlover007 (aka RSDuck) to add new features and enhancements as I think the stand alone emulator is amazing. The first feature I've always wanted is support for RetroAchievements. I'm creating this thread because I finally managed to integrate rcheevos' library to the emulator, releasing a new version of melonDS that allows login and unlock achievements.

There will be a lot of work to be done, both in terms of QoL (for example, you now have to log in every time, since credentials are not saved in any way) and in terms of emulation (some users have reported to me some DSi-related errors caused by my modifications). I will use this thread to update you and to gather as much feedback as possible. You can find the link to the new version here.

Release 7.2

You can also see the prerelease build for some bug fixes and/or new feature, BUT it will be probably unstable:

Nightly build

At the moment, hardcore achievements are disabled by default, as you have to make a request to the RetroAchievements admins. I'm already working on it.

I am leaving the original catlover thread as a copy.


melonDS is a Nintendo DS emulator mainly developed by Arisotura (@StapleButter). It was first ported to the Switch by @Hydr8gon. I'm responsible for several optimisations and the current port. Depending mostly on whether a game utilises the 3D hardware of the DS a lot of games already reach fullspeed without overclocking.

The last few releases of my continuation where done in Hydr8gon's thread which quickly resulted in a lot of confusion.

Setup​



For those coming from older versions of my port, using the /melonds directory located at the sd card root is still possible.

Since Release 5 the JIT recompiler isn't enabled by default, so make sure to enable (under Emulation Settings), since the interpreter is pretty slow.

Atmosphere title replacement to launch the hbmenu is the only supported method of running melonDS!
If you don't know what that means: press R while starting any game from the Switch's main menu to enter the hbmenu, don't use the album!


  • Download the latest release from here: https://github.com/RSDuck/melonDS/releases
  • Extract the release onto your sd card, so that there's /switch/melonds folder melonds.nro and some other files inside it.
  • NAND, BIOS and firmware files go into /switch/melonds as well
  • ROM files can be placed anywhere on the sd card
For DS mode the following files are necessary (in parantheses is how they should be named for melonDS to recognises them):

  • ARM9 BIOS (bios9.bin)
  • ARM7 BIOS (bios7.bin)
  • DS mode firmware (firmware.bin)
For DSi mode the following files are necessary (in parantheses is how they should be named for melonDS to recognises them):

  • DSi ARM9 BIOS (biosdsi9.rom)
  • DSi ARM7 BIOS (biosdsi7.rom)
  • DSi mode firmware (firmware_dsi.bin)
  • NAND dump (nand.bin)
For information on how to dump those files from your own DS or DSi see here: http://melonds.kuribo64.net/faq.php

Release notes​

Release 7.2:
- Added mastery notification
- Improvements regarding save slots for RAs
- Added the ability to turn off the notifications
- Improved notification system
- Added remapping buttons
- Bug fixes and generale QoL improvements

Release 7.1:
- Added the ability to switch fast forward from hold to toggle and vice versa (requested by @martinlvm). You can check this option under Input Settings
- Fixed issue where notifications were not being rendered if the screen was in different rotations
- General improvements to notifications, but there is still more to be done
- When the game is paused and you are logged in to the RA servers, you can see the list of achievements in the appropriate section. Note that at the moment the request is synchronous, so the system will freeze for a few seconds and then resume once the complete list is obtained. To make it asynchronous
- Automatic Login support, just log in once and your credentials will be stored in melonds.ini
- Added support for the leaderboard entries
- Added support for leaderboard trackers, challange and progress indicators. However, these need to be improved and tested: I would be glad if you had tests reported in the issues so that I can investigate in the future


Release 7:

First support for RetroAchievements. Launch by args, thanks to @Jpe230

Release 6, fix 1:

Just a few bug fixes (the pendulum on the title screen in Chrono Trigger, several things in Mortal Kombat and a freeze in Pokemon Platinum, likely also in Diamond/Perl).

Release 6:

This release is a big one, because we finally hit fullspeed in most games including 3d ones! This is all thanks to the new 2D and 3D renderers which run on your Switch's GPU (which previously was only used for the GUI and putting the video output onto the screen) instead of CPU.

The 3D renderer doesn't use the builtin triangle drawing functionality melonDS's OpenGL renderer does, thus it doesn't have issues like it (https://github.com/Arisotura/melonDS/issues?q=is:open+is:issue+label:OpenGL). Instead it's basically the good old software rasteriser but translated to run on GPUs thus ideally it should have the same pretty amazing compability.

Both the new 2D and the new 3D renderer are implemented using deko3D for minimal CPU usage compared to OpenGL, though I want to port both of them back to OpenGL for desktop melonDS. In the future there's the possibility for some enhancements like high resolution rendering with less issues than the OpenGL renderer currently has (I'm sure yet whether Switch can handle this, so don't get your hopes too high on this).

For older versions look inside the spoiler.

FAQ?​



How can the emulation be paused?

Press ZL and ZR at the same time.

How can I fast forward?

By pressing either ZL or ZR depending which button is used to do a touchscreen click (which depends on whether Left handed mode is enabled in the Input settings). Note that this is not available in gyro mode, because there this button is used for recalibration.

What do the Block Size, Branch Optimisations, Literal Optimisations and Fast Memory settings do?

Ideally they can stay enabled/at maximum all the time because they enable optimisations beneficial for the performance. But if there's an issue with the JIT recompiler it can be tracked down faster. Only touch them if something unexpected happens and mention which (if any) setting makes a difference in bug reports.

I want to play with a Flip Grip. Which settings should I use?

Use the Global Rotation option which rotates the entire GUI. Shout-out here to @uzimakiuchiha who got me a Flip Grip!

I want to play a game where the DS is held side ways (like e.g. Dr Kawashima's Brain Training), which should I do?

For this case it's the best to use the Screen rotation in the Display settings, once a game is launched (it rotates the buttons as well, as if you're holding the DS that way).

How can I quickly switch the focussed screen?

Press down the right stick. There's also an automatic mode where we the main screen is guessed in the display settings.

How can I only display one screen at a time (and for some reason I want it to be stretched across the whole screen ruining all proportions)?

Go into the Display settings. Set Top aspect ratio and Bottom aspect ratio to 16:9 and then set Screen sizing to either Top only or Bottom only.

How do I use gyro control?

First enable it in the Input settings. Press ZL or ZR (depending on whether you enabled Left handed mode in the Input Settings) to calibrate the rotation. Since this utilises the gyroscopes (and not IR like the Wiimote, which gives an absolute position) it's only based on it's rotation, so it needs recentering if you change the way you hold the Switch/Joy-Con.

How can I change the access the DS menu (e.g. for changing the system language)?

Press Boot Firmware or disable the setting Direct boot in the Emulation settings.

Starting a DSiWare dumped as a NDS file doesn't work, what is wrong?

To run DSiWare it needs to be installed on the NAND. If you start it from the filebrowser it will be started as a cartridge and thus fail to load.

How can I give microphone input? (e.g. a lot of games require one to blow into the microphone)

Press down the left stick to simulate a blowing noise. Proper microphone input via an external microphone is currently not supported.
 
Last edited by Deleted member 671446,
Is it just me or does the new retro achievement stuff not work? I mean I'm assuming it's just me but whenever I try to turn it on it just turns it off in a second I see the log in stuff but it doesn't appear to show anything else and it doesn't seem to be showing me as online on the retro achievement website
 
If I could suggest a feature: Button remapping, or at least flipping ZL and ZR for L and R. I find it more comfortable to use the Z buttons as they are bigger than the tiny L and R bumpers.
 
The achievement prompt doesn't show up on-screen at 90˚ Global rotation.
I'll fix it in the next release
Is it just me or does the new retro achievement stuff not work? I mean I'm assuming it's just me but whenever I try to turn it on it just turns it off in a second I see the log in stuff but it doesn't appear to show anything else and it doesn't seem to be showing me as online on the retro achievement website
My mistake, I realized that error cases are not properly handled in the notifications during login. I have already fixed it, in the next release you should eventually see the error (now is only showed in console, using nxllink). Consider though that if you don't appear in the leaderboard, there is some problem during login. I apologize for the inconvenience, as soon as I know more I will fix it as soon as possible
If I could suggest a feature: Button remapping, or at least flipping ZL and ZR for L and R. I find it more comfortable to use the Z buttons as they are bigger than the tiny L and R bumpers.
I can try, I was thinking about something like this. Atm I only added hold/press once for fastforwarding as requested
 
  • Like
Reactions: kingboxnt
Minor update, here is the complete list of new additions/improvements:

- Added the ability to switch fast forward from hold to toggle and vice versa (requested by @martinlvm). You can check this option under Input Settings
- Fixed issue where notifications were not being rendered if the screen was in different rotations
- General improvements to notifications, but there is still more to be done
- When the game is paused and you are logged in to the RA servers, you can see the list of achievements in the appropriate section. Note that at the moment the request is synchronous, so the system will freeze for a few seconds and then resume once the complete list is obtained. To make it asynchronous
- Automatic Login support, just log in once and your credentials will be stored in melonds.ini
- Added support for the leaderboard entries
- Added support for leaderboard trackers, challange and progress indicators. However, these need to be improved and tested: I would be glad if you had tests reported in the issues so that I can investigate in the future

In the next release (7.2) I will aim to complete the following tasks:
- Any bug fixes/optimizations (for now, still pending firmware boot if in DSi bug)
- Add an upscaler/add new filters
- Add mastery notification
- Support hardcore, although not entirely dependent on me, but also on RA admins' approval. I am already in contact with them to provide hardcore support as soon as possible

I don't know if everything will be implementable, but I will try.

https://github.com/Gheovgos/melonDS/releases/tag/release7.1
 
Thank you so much.
If possible, a request. The newest melonds upstream releases can install dsiware to the nand, without any external tools. Just in case you want and have loads of spare time. If it's a lot of work, don't bother.
 
Thank you so much.
If possible, a request. The newest melonds upstream releases can install dsiware to the nand, without any external tools. Just in case you want and have loads of spare time. If it's a lot of work, don't bother.
I think it is possible to realize, I'll check it. But can't promise to realize that
 
  • Like
Reactions: ber71
Thanks so much for the update! By the way, would it be possible to add the GBA slot?
I think the code is already integrated into the emulator; all that's missing is exposing it to the GUI (I'm not sure).
 
Last edited by angelhp,
Thanks so much for the update! By the way, would it be possible to add the GBA slot?
I think the code is already integrated into the emulator; all that's missing is exposing it to the GUI (I'm not sure).
Yes and no, actually there are some unused code for loading gbas, but I think it was WIP 4 years ago when the catlover was working on it. The code for melonDS emualtor was not update since, I'll try to update also the core emulator, but probably will break things
 
  • Like
Reactions: angelhp
Tested some of my fav ds games and gotta say it's soooooooo much better than the retroarch core! thanks man!

Quick Q and not a big deal if not...

Possibles to remap buttons in future as I like my L&R buttons swapped the Z variants.
 
Is it possible to add an hotkey button to swap between the two LCD, just to play games like pokemon B&W in fullscreen without the second screen
 

Site & Scene News

Popular threads in this forum