JIT beta builds and introducing myself
After all so much time has passed, it's finally time to do a release of JIT beta builds!

As Arisotura has stated in her last post, there's now another head working on melonDS. I'm Generic on IRC and RSDuck on Github.

For some reason I started messing with DeSmuME a bit more than a year ago, trying to write a JIT recompiler targetting ARM64, to improve performance on the Switch. After many struggles something working came to be, but it missed it's original goal of being fast for several reasons (see the link if you're interested).

After recovering from the disappointment I put my hopes into melonDS, but since it lacked any JIT compiler (besides the abandoned attempt by Arisotura herself) I wanted to start with a x64 recompiler. Skip forward a bit and the JIT started take on form. After taking everything apart and putting things more cleanly back together around the beginning of last summer things only got better, with most instructions being recompiled and the opening of the pull request on Github, which later got merged.

At this time the ARM64 backend was started this time avoiding my previous mistakes. With autumn it reached a similar level of completion as the x64 backend while both backends received some optimisations. Until this point we were catching up to DeSmuME but at this point started to surpass it. Here is where I want to thank all developers of open source emlulators whose dynarec I was eable to look into and especially the developers of the JIT of Dolphin. We're not only using their code emitter but they also gave me some great advice on IRC!

With some further optimisations of the 2D GPU emulation using ARM NEON instructions, most 2D games already run at fullspeed on the Switch, while most 3D games run at fullspeed with overclocking. The ARM64 JIT and the GPU optimisations are currently located in my own fork and are distributed by me in binary form on Gbatemp in an admittedly chaotic way.

I am very grateful to Arisotura for creating the emulator in the first place, as well as trusting in me and my work. For the future the already mentioned GPU optimisations are my current focus. I'm currently rewriting the old ARM NEON optimisations to be more clean and adding some additional ones which hopefully increase the performance a bit more. The logical step following would be a NEON 3D GPU backend. I have some more plans lying around, e.g. there is still one major JIT optimisation we're missing out on (fastmem).

So but now enough storytelling, here are the builds:

Note:

These builds are my JIT branch (generic_jit) merged with master into a separate branch.

The JIT recompiler has to be enabled in Settings -> Emulation. The default maximum block size is 10, this is a very conservative number, as I don't know of any game which breaks with high maximum block size. If you experience any bugs which can't be reproduced with JIT disabled, please try lowering the maximum block size and disabling one or both of the options Literal Optimisations and Branch Optimisations and let me know. Though there already has been some testing through people building from source themselves and the semiofficial Switch builds, both uncovered some bugs.

melonDS 0.8.3 JIT beta for x64 Windows
melonDS 0.8.3 JIT beta for x64 Linux
isa says:
Dec 7th 2019
Maybe now we can see better DSi compatibility.
Arisotura says:
Dec 7th 2019
re: 3D NEON optimizations

assuming you're talking about the software renderer, that one needs a rewrite, it's kind of a mess atm.

otherwise, well, we need to get our shit together collectively and get the OpenGL renderer working decently on the Switch.
Sorer says:
Dec 7th 2019
Now that stuff from 0.8.3 got merged i think that my issue with the microstutters/framerate is gone.
MelonMan says:
Dec 7th 2019
Cool! Keep up the good work!
They says:
Dec 7th 2019
What JIT improves? Overall speed or 3d or something else?
kevincrans says:
Dec 7th 2019
This is a brilliant milestone for DS emulation! I don't wanna bother you, but recently I've seen some Youtuber do Mario Kart Waluigi pinball in 4K(UHD) with terrible ground tearing, I have seen no ground tearing in MelonDS, so if it's possible to run MelonDS at 4K resolution, boom, you'll mark the spot. Just wanted to point that you are already beating Desmume by having no major graphical bugs lol.
Generic aka RSDuck says:
Dec 7th 2019
> What JIT improves? Overall speed or 3d or something else?

it improves CPU emulation speed. Which affects most games.

> Just wanted to point that you are already beating Desmume by having no major graphical bugs lol.

I should have made that clearer, I meant beating desmume's JIT implementation. In almost every other aspect melonDS of course has been for years (insert further emulator chauvenism).
GalacticPirate says:
Dec 7th 2019
Amazing milestone and congrats for the good work
Every step towards putting DeSmuME in the trashcan it belongs in is appreciated
kevincrans says:
Dec 8th 2019
A recycling trashcan, we Melons have our standards! Remember the good UX Desmume had back in the days, looking almost as good as MelonDS! About beating Desmume's JIT implementation, you have done an awesome job, like I said. Teaming up with Dolphin was indeed an amazing idea. Speaking about Dolphin, No emulator has ever done DS <-> Wii connection before, so hopefully they allow that in the future. Cheers!
Generic aka RSDuck says:
Dec 8th 2019
I certainly don't want to sympathise with the general sentiment against desmume and it's developers, they are the target of enough hate, regardless of what they have archieved. Let's not forget that we wouldn't be here without desmume.

> Teaming up with Dolphin was indeed an amazing idea. Speaking about Dolphin, No emulator has ever done DS <-> Wii connection before, so hopefully they allow that in the future. Cheers!

Teaming up is a bit of an exeggeration. Regarding the DS <-> Wii connection, afaik it would require implementing big endian mode which is on the todo list. In theory that would not be so hard, in practice there are lot of places where this can go wrong. Since it isn't used by many games it has very low priority.
Arisotura says:
Dec 8th 2019
I doubt DS/Wii connection makes use of big-endian mode on the ARM CPU. it's just going to be a wifi thing, either bog-standard wifi or something nifi-like depending on what was possible on the Wii side.
Generic aka RSDuck says:
Dec 8th 2019
my bad, I based my claim on this: https://github.com/Arisotura/melonDS#todo-list-for-later
Adi says:
Dec 8th 2019
Loading ROMs through shortcuts doesn't work in this build (Windows).
kevincrans says:
Dec 8th 2019
I was just joking about Desmume lol. But to be sure, I wasn't talking about DS/Wii connection, but more about MelonDS/Dolphin connection of course, sorry if I was unclear. Thank you a lot for your response and Good Luck!
Miarfe says:
Dec 9th 2019
Why people hate Desmume so much?
Post a comment
Name:
DO NOT FILL