A bit of a status update
I've been taking a bit of a break from melonDS lately... mental health reasons, a silly side project, the usual stuff.

Regardless, I've been rethinking my plans for melonDS.


I think I might postpone the timing work to melonDS 1.3. It's bigger than anticipated. I want to address some other issues, most notably finishing the new OpenGL renderer, and release melonDS 1.2. There's also some codebase cleanup I want to do.


Regarding the timing work, it's going to take some planning, and possibly a larger rework.

As I've said, the ARM7 is simple enough. Things are pretty much sequential, and the only extra complexity comes from main RAM burst termination delays.

The ARM9 is where it gets hard. We deal with mechanics like cache streaming, write buffering, ability to keep running code while the bus is in use... All sorts of mechanics which highlight the limits in melonDS's current model.


For example, take the LDM and STM instructions. They do multiple consecutive memory accesses in a row. They're commonly used to push registers to the stack and pop them back, or to quickly clear or copy large blocks of memory.

There are several issues arising from this. Depending on the base address, a LDM/STM instruction might cross the boundary between two memory regions, or two MPU regions on the ARM9. STM, when accessing I/O registers, might also cause a bus stall between two memory writes (for example, if it starts a DMA transfer...).

melonDS was built on top of a plain old interpreter. We read one instruction word from memory, we use a lookup table to figure out what we should do, we do it, then we move on to the next instruction, and so on. This model treats individual instructions as atomic: there is no way to account for all possibilities with LDM and STM, for example. Or atleast, not easily.


So an idea I have in mind is to try a different model for CPU emulation. A sort of cached interpreter.

The idea is to turn DS code into an intermediate representation which not only enables faster execution, but also gives us more freedom. For example, the aforementioned LDM/STM could be turned into discrete memory accesses, or optimized into larger accesses if possible.

Another reason would be timing calculations. Some of them, like interlocks, can be annoying to resolve, but only really need to be resolved once, so a cached interpreter could have them precalculated.

At this stage, this is only a basic idea, but it's something I want to experiment with.
mrjfilippo says:
Apr 26th 2026
As you know, this is a marathon, not a sprint. Thanks for the update, keep up the good work.
Zyute says:
Apr 26th 2026
In order to put out a quality product you got to put quality time into yourself so I'm all for you taking as long as needed. You are cooking with that idea to get melonds to have faster execution and timings precalculated so i hope that works out for you. Good Luck Arisotura and thanks for hanging in there 😎.
ronniespector says:
Apr 27th 2026
take all the time you need! you've done incredible work so far!!!!
mkyo says:
Apr 27th 2026
Just wanted to say thanks for providing a way to let us play our DS games on a PC! No matter where the winds take you just know you've already made great contributions on this Earth.
jotarito says:
Apr 28th 2026
When will they add support for retroarchives?
jotarito says:
Apr 28th 2026
Sorry, I hadn't read it properly. Take your time, bro.
jasrada says:
Apr 28th 2026
Take your time homie and thanks for all you've done. Also in 1.3 will you be looking into any graphical implementations, on every display option i notice a lot of textures flicker in game and the black lines still appear (a lot less but still 100% evident) this strictly occurs on the Mario and Pokemon games from my testing so far
New Fan says:
Apr 29th 2026
U da coding goat don't sweat it
jk1 says:
Apr 30th 2026
Hang in there projects like this are what makes the internet great! Thank you!
Zeshax says:
May 1st 2026
Arisotura, let me tell you that even though you might not see it right now, you've managed to unite many communities across the globe. You've contributed immensely for just one person. Rest, take your time, focus on one thing at a time, don't put pressure on yourself, and don't overexert yourself. You'll definitely find the answer. Sending you a big hug, and I hope the ideas keep flowing. I'm a huge fan of your work. Good luck!
Arisotura says:
May 2nd 2026
Thank you all!
Post a comment
Name:
DO NOT TOUCH