GimliDS

  • Thread starter Thread starter wavemotion
  • Start date Start date
  • Views Views 13,335
  • Replies Replies 125
  • Likes Likes 31
https://github.com/wavemotion-dave/GimliDS

V0.8: 27-Apr-2025 by wavemotion-dave
  • First public beta release!
  • Be sure you've read the readme.md file on the github page

1745765218633.png


As near as I can tell, this version is roughly twice as fast as any version of FrodoDS that exists 'out there' and is more accurate across the board. Improved sound. Improved graphics. Improved keyboard and key map handling. And on the DSi, it doesn't skip a single frame...
 
https://github.com/wavemotion-dave/GimliDS

V0.8: 27-Apr-2025 by wavemotion-dave
  • First public beta release!
  • Be sure you've read the readme.md file on the github page

View attachment 501028

As near as I can tell, this version is roughly twice as fast as any version of FrodoDS that exists 'out there' and is more accurate across the board. Improved sound. Improved graphics. Improved keyboard and key map handling. And on the DSi, it doesn't skip a single frame...
I hope you work on 3DS in future that will be AWESOME!
 
@wavemotion

You says in the Readme about the old hardware that it won't run at good FPS except with heavy FS but I tested about 10 games on fat DS/DSLITE and they seems to be running fullspeed ! (R-Type, Rick 1 & 2, Robocop, bombjack...). Did you already put your magic in this emu ?
 

Attachments

  • IMG_0431.jpeg
    IMG_0431.jpeg
    3 MB · Views: 29
@wavemotion

You says in the Readme about the old hardware that it won't run at good FPS except with heavy FS but I tested about 10 games on fat DS/DSLITE and they seems to be running fullspeed ! (R-Type, Rick 1 & 2, Robocop, bombjack...). Did you already put your magic in this emu ?
I’ve pulled some fast memory tricks to get it running fairly well on the older DS units but it’s not quite perfect. I haven’t done much testing on anything other than the DSi XL but I’m glad to hear it’s holding up. But I’m sure games like Batman the Movie or Wizball will struggle on the Lite until I can find more magic.

Love seeing all the posts! Almost makes it worth the effort of long nights and early mornings.

Almost.

😅
 
Thank you so much for doing this, this is what DSi needed!
It's great to have scalling options, Strike Force Cobra can be run with 1:1 pixel ratio. btw, best siren bgm ever. : )
It would be nice to assign keyboard keys to a,b,x,y,L,R buttons like in zx emu.
 

Attachments

  • 20250427_232018.jpg
    20250427_232018.jpg
    253.4 KB · Views: 28
Last edited by plasturion,
Just checked in a daily build 0.8a with improvements to the SID filtering so games like Space Taxi voice are now heard!

But even more useful is another 10% speedup across the board in graphics rendering. And there was a bug in the DS-Lite/Phat handling that would make the frames "uneven" (meaning some frames were drawn faster than others). I've corrected this - and reduced the frameskip for the DS-Lite/Phat. We are now drawing 34 out of 50 frames (yes, strange number... don't ask). And I don't skip any frames for the CPU or SID music - so you should get silky smooth gameplay on the Lite/Phat. While it may seem a tiny bit slower than the 0.8 version, trust me, it's much closer to an actual C64.

The older FrodoDS would skip 2 out of every 3 frames - essentially drawing about 17 frames per second. And even then it had slowdown and audio problems. GimliDS is now double the frame rate with no CPU/SID slowdown (so you're actually playing the game at the right speed). I'm hopeful to get this up to about 80% drawn frames which, to the human eye will be indistinguishable from full C64 frame rate.

Anyone using a DS-Lite or R4 card would do well to try the new daily build at: https://github.com/wavemotion-dave/GimliDS

(and, of course, DSi/XL/LL users will get improved SID quality)
 
It would be nice to assign keyboard keys to a,b,x,y,L,R buttons like in zx emu.

Yes, I'll add this. I've reserved room for 256 possible key maps per button - at least for ABXY. L/R I'm keeping reserved for scaling which is desperately needed on this emulator (but less so on SpeccySE where the screen resolution fits nicely so I can spare those keys).

Thanks Dave. Top stuff 👍👍👍
Appreciate your help on the early versions, djl. I know some of them were a bit rough around the edges :)

I used to post more technical details and kinda fell out of that habit. I'll endeavor to put some thoughts down here:

The version of FrodoDS that I started with was a bit of a mess... that's not the fault of the original porter(s) who did an admirable job of cobbling in the DS infrastructure nor of the original Frodo emulator author who has provided a nice clean base. It's just that those versions didn't really play to the strengths of the DS. Having four years of experience under my belt, I could see immediately some missing elements. Here is the main things I did for speedup:
  • Moved the entire CPU emulation handler into ITCM fast memory. This alone gives an almost 10-12% speedup.
  • Moved a ton of buffers (especially VIC and SID memory) into DTCM fast memory. This gained another 5%.
So with just those two simple things, we get 15% speedup with no other changes to the code.

Then I looked for the obvious 'wins'. From having optimized 9 other emulators, the first few took very little time:
  • Look for places where we write 1 byte at a time when we could be doing 2/4 bytes at a time.
  • Look for times when we're drawing blocks of the same color - especially when we're drawing the background color and just blast those out 32-bits at a time. These last two bullet points probably gained 10% speed.
  • Look for memory copies that don't need to happen... the biggest gain here was in sprite rendering. Some games don't use sprites at all... and many games that use them, don't utilize them on every raster line. So we were clearing this (relatively) big buffer of sprite collisions on every raster line when we really only needed to do so on lines where sprites were enabled. This gained almost 15% speed gain.
  • Look for any Flush memory operations - which are done so we don't try to render screen data that has been cached via DMA. The easiest trick here is to actually render the NEXT line coming up which is roughly 1 frame behind the current drawing algorithm... that scanline is never going to be cached because so much memory has been read/written since it was last drawn (1/50th of a second earlier) and so the flush can be skipped. And memory flushes are expensive. I later switched to drawing portions of the screen directly to the LCD (borders mostly) such that I don't have to double-buffer anything. The best thing you can do is not move big blocks of memory... but the next best thing is to not move it more than once.

Once those six things were done above, we had almost a 2x improvement in rendering speed. I was able to turn off the frameskip on the DSi and above (FrodoDS was skipping 50% of fames) and greatly reduced the frameskip on the DS-Lite/Phat (was rendering 1/3 of all frames and still had slowdown... now rendering 2/3 of all frames with almost no slowdown).

I've backported a lot of fixes and improvements from the more recent versions of FrodoDS - so the accuracy is much better. More games should run more closely to correct. There are still some graphical glitches and some games that hit the virtual hardware in ways that are difficult to emulate correctly - but I'll keep making improvements.
 
https://github.com/wavemotion-dave/GimliDS

Version 0.9 release 30-Apr-2025 by wavemotion-dave
  • New and improved key mapping - including the new Slide-n-Glide joysticks handling.
  • SID filtering improved for better audio rendering (Space Taxi voice heard!).
  • Faster across the board - even the DS-Lite/Phat is now running at (or close to) full speed.
  • Fixed joystick handling so we sample at the correct rate - smoother motion on screen.
A nice little upgrade here... had to rework the entire configuration to include better key mapping options for the D-Pad and NDS buttons so your old configs will be upgraded. My new patented Slide-n-Glide (formally CHUCKIE-EGG MODE - I'll be changing the name on SpeccyDS soon) allows for smoother transitions on/off ladder climbing games.

More importantly I got more speed - the DSi is bullet fast but now the DS-Lite/Phat should hold its own for most games. Still a few hard-hitting games that will slow down slightly but generally everything is playable on the older hardware.

Next up is some improvements to the disk handling... trying to backport some fixes and accuracy updates from future mainline Frodo but it's a bit messy on my end.

Edit: almost forgot! Autofire is no longer a global option - it's now one of the options for any key map. So you can set one button to be normal fire and another button to be auto-fire. This is quite helpful for games like R-Type where you mostly want to auto-fire but sometimes want to press and hold normal fire to build up a charge-pulse.
 
Last edited by wavemotion,
Thanks for the Quit button. Work's a charm
No problem. Those are such easy requests :)

I'm trying to work on bringing the accuracy up... struggling a bit. I'm brining in things that are clearly closer to real HW but they don't have much effect. Things that worked perfectly still work perfectly. Things that didn't work correctly still don't work correctly.

Simple games... like Chuckie Egg for the C64 (though I'd rather play the Speccy version!!). It loads fine - has nothing unusual that I can see... but I can't get the damn game to start. I feel like it's stuck waiting for an interrupt that never comes... or some timer to tick... Seems broken on 4.2 Frodo - and I can't find a Windows or Ubuntu Linux build for 4.3 or later to see if it was ever 'fixed'. This is the long grindy stuff I hate working on.
 
No problem. Those are such easy requests :)

I'm trying to work on bringing the accuracy up... struggling a bit. I'm brining in things that are clearly closer to real HW but they don't have much effect. Things that worked perfectly still work perfectly. Things that didn't work correctly still don't work correctly.

Simple games... like Chuckie Egg for the C64 (though I'd rather play the Speccy version!!). It loads fine - has nothing unusual that I can see... but I can't get the damn game to start. I feel like it's stuck waiting for an interrupt that never comes... or some timer to tick... Seems broken on 4.2 Frodo - and I can't find a Windows or Ubuntu Linux build for 4.3 or later to see if it was ever 'fixed'. This is the long grindy stuff I hate working on.
Have you tried different game files?
 
  • Like
Reactions: wavemotion
Have you tried different game files?
Oh yes... many. With and without True Drive. I'm somewhat of an "expert" now at knowing that some cracks/hacks/flapjacks are not as good as others.

But in this case I think it's a problem with the emulation itself. Still digging in - I don't give up too easily.
 

Site & Scene News

Popular threads in this forum