Merry belated Christmas
(to those who celebrate, that is)


As I have received and set up my new laptop, I've been able to work on melonDS some. The goal is still the same: to adapt melonDS for supporting multiple instances within one process.

The frontend is proving to be tricky, because it was largely built without many regards for code quality. Originally, the frontend was just quickly built around the program entry point in main.cpp, as it just needed to provide a means to use the emulator. We had a simple window, a dedicated thread to run the actual emulation, and that was it.

Obviously, over time we added various features to the emulator, rebuilt the frontend around different UI toolkits, piled on more features, and so on. Basically, the frontend code became a mess, and everything was more or less just dumped in the global namespace -- there are some modules which live in their own namespaces, but it's all not very modular, and doesn't lend itself to running multiple instances of melonDS.

I started by splitting main.cpp into separate files. We are far from done with the cleanup, so there's a lot of cruft around, but the basic idea is the following:

* main.cpp just holds the entry point (main()) and global application-related stuff.

* Window.cpp holds the MainWindow code, for managing the emulator window. We may also add support for multiple windows.

* Screen.cpp holds the ScreenPanel code, that is, the panel widget that goes inside the emulator window and handles display and touchscreen input. There are two kinds of ScreenPanel: one that relies on Qt's graphics API, and one that uses OpenGL.

* EmuThread.cpp holds the emulation thread.

From there, each EmuThread would hold its own instance of the emulator core (which we mostly finished porting), and optionally point to one or two windows to display to (or none, in the case of a headless instance).

After laying out this basic separation, I figured it would make sense to integrate the OSD feature into ScreenPanel. The OSD module was a bit of a mess, with having to maintain different code paths for Qt or OpenGL drawing. Now things are a lot cleaner.

There's still quite a bunch of global state and stuff that we need to adapt before the dream of emulating multiple DS's within the same process can come true. But we're getting there, slowly but steadily. This is the perfect occasion to finally clean up and improve our frontend code.
Zyute says:
Dec 28th 2023
Hope you had a Merry Christmas Arisotura as well. Being able to emulate multiple instances would be a game changer for Nintendo DS emulation. When tackling a tricky situation it is best to take ones time so there is no need to rush by you and the melonDS team. Congrats on the new laptop and have a happy New Year!
^.^ says:
Dec 29th 2023
Happy belated holidays I guess๐Ÿ˜… I'm glad things are taking shape :D
Why do you have both Qt and Open GL for the panel? Is it an OS compatibility thing?
Jake says:
Dec 30th 2023
Merry Christmas to you too! :)
Minessota Klei says:
Dec 30th 2023
Hi everyone,

Happy holidays and a happy new year to people who participated and helped in the MelonDS project, and to the entire community that follows the news here on the blog!

Arisotura, you are a good person, it is great to read your reports about the project here on the blog!

Happy 2024 (^o^)//
A says:
Dec 31st 2023
It's Christmas not holidays.
anon says:
Dec 31st 2023
To "A", it's the holidays. Not everyone celebrates Christmas, and 2024 is around the corner. Rather than calling it specifically "Christmas", calling it the holidays makes it flow smoother -- plus that way, everyone has an idea as to what you're talking about.

Don't be a Grinch!
AsPika says:
Jan 2nd 2024
Merry Christmas ๐ŸŽ… and happy new year 2024! ๐ŸŽ‰ Waiting for next version updates! ๐Ÿ˜‡
E says:
Jan 6th 2024
Ok, I understand your point.
me says:
Jan 11th 2024
gg no re
Edu says:
Jan 16th 2024
Congratulations, you are an amazing person who invests your time in creating a wonderful nds emulator that is outperforming the best, I hope soon on the play store and great successes in 2024
A says:
Jan 27th 2024
Hi, i don't think you are gonna read this but, ยฟDo you have Discord?
Arisotura says:
Jan 28th 2024
I do, why?
sonoob132 says:
Jan 29th 2024
I really appreciate your emulator and what you have done here (and I don't even know if this is the best place to ask but, eh) but I have a problem. For some reason, using OpenGL in the video settings really corrupts everything.
From weird misaligments to pixels outright corrupting. This isn't really the emulators fault because this happens on every OpenGL emulator I've tried up to this point (Yuzu, mGBA etc...)
I am using an RX 6600 and reaching out to AMD... they didn't even probably read my emails, I reached out to the mGBA devs and they really don't know too except a "
So I wonder if there is anything to be done about this problem because I am not the only person who've experienced this as far as the mGBA devs told me
.a. says:
Jan 30th 2024
hello. I am using the emulator well, but I have one request. It would be great if you added a feature that allows you to separate the screens when using dual monitors.
Arisotura says:
Jan 31st 2024
sonoob132: you should come over to our Discord: https://discord.gg/NdfMUGWDPJ

.a.: this is in the plans :)
Post a comment
Name:
DO NOT TOUCH