Jump to content
IGNORED

Any info on StellaDS?


AgentOrange96

Recommended Posts

Over the summer, I'd hacked my DSi and among other things installed StellaDS. It hasn't been updated since 2012 and I've noticed a couple of improvements that could be made.

 

First, it seems like it runs slow. I tried the Mr. Caterpillar demo, which due to my NTSC VCS, I don't really get to fully experience. (Plus the video signal cuts out on occasion) However, on StellaDS it seems very slow. I don't think it's the difference between 50Hz/60Hz, but then I really can't say for sure. I'm used to running on the wrong hardware after all.

Second, and this is more a concern for me, is the ability to play DPC+ games. I've used this for both homebrews I've worked on, and am kind of disappointed to find that this version of Stella doesn't support it. (From what I understand, this requires emulation of the micro-controller in the Harmony Cart, which modern Stella does.)

I'm wondering then if anyone knows where to find source code or better yet, but much less likely, a version of StellaDS that's been updated more recently than 2012. Otherwise, I'd also be interested to hear anyone's thoughts. I'm not expecting too much, but I figured it's worth posting. Thanks!

Link to comment
Share on other sites

It's extremely unlikely to get any more speed from that port.  If you're already experiencing slowdowns with that port on old ROMs, it will be impossible to get it to run new DPC+/CDF ROMs, which require emulating an ARM CPU too.

 

I know that Stella 6.1 (whenever it's released) will be available for RetroArch, and that someone got it running on some Nintendo systems.  But that may have been the Switch, or the 3DS.  I don't know if the regular DS was updated.  Long story short, I suspect it's impossible to get it to work.  Modern Stella (with cycle-exact emulation and ARM emulation) just requires more powerful hardware to run.

Link to comment
Share on other sites

  • 2 years later...

Well... not too bad of a necro-bump!

After 2 years and more than 350 development hours, I've just released version 5.6 of StellaDS (based on the original Alek Maul 1.1 version).

 

It's 250% faster across the board - just about every bank switching scheme is supported with the exception of CDFJ/CFFJ+ and BUS.  It also adds in SaveKey support, all the popular controller types and high-score saving. I just added the DPC+ emulation with a streamlined Thumbulator... the poor DS is absolutely maxed out with not a spare CPU cycle in sight... but it will run most DPC+ games full speed on the DSi. One notable holdout is Space Rocks which runs about 54 fps though but is still quite enjoyable.

As always, you can find the newest release here:  https://github.com/wavemotion-dave/StellaDS 

Many thanks to Stephen and the entire Stella team past and present for their amazing work of which this is based. I apologize for any butchering of the code during optimization ... the original DS runs at 67MHz and some sacrifices had to be made :)

image.thumb.png.f6bd6eb7636f7f07259dc50b49837d07.png

  • Like 7
  • Thanks 4
Link to comment
Share on other sites

On 10/14/2022 at 6:51 AM, llabnip said:

Well... not too bad of a necro-bump!

 

After 2 years and more than 350 development hours, I've just released version 5.6 of StellaDS (based on the original Alek Maul 1.1 version).

 

That is way cool!

 

Would this run on a 3DS?  I have an XL that I haven't played in quite some time. Only other piece of Nintendo hardware I have is a Virtual Boy.

 

Quote

Known Issues:

  • DPC+ games are supported but are complex enough and most use ARM assisted code so you really need a DSi running with TWL++ or Unlaunch to get the faster 2X CPU speed.

 

In case it matters, I have no idea what TWL++ or Unlaunch are.

  • Like 1
Link to comment
Share on other sites

Hey Darrell - thanks for the follow-up and all the great games over the years!

Yes, this will run on a 3DS or 2DS (XL or normal).  There are 2 ways...

The first involves a flashcart (think of this like a Harmony cart for the DS) and they are cheap (about US$25 for an R4 clone card - available on Amazon or eBay).  You put your software on the R4 card and off you go.
The second involves installing custom firmware on your 3DS so that it will launch homebrew software via the SD card slot on your 3DS/2DS.

The second method is free but requires some tinkering. The first method is easy but has a major drawback... as far as I know, all flashcarts will run in DS mode meaning you will be running the CPU at 67MHz which is fine for most 4K/8K and some 16K games but the more complicated bankswitching schemes will not keep up. And even some "complex" (meaning they hit the emulation in exactly the wrong ways) 4K/8K games won't run full speed (Elevators Amiss is the most notorious... I can run it full speed on my DSi but in DS-mode it will only get to about 30fps).

When you install custom firmware, you get the benefit of the 2x faster CPU (134MHz) and 4x RAM.  The emulation doesn't need the extra RAM but the 2x CPU is really what's required to make 98% of the library run full speed.  

If you go either route you will also get access to the other emulators I've worked on:  ColecoDS, Nintellivision, A7800DS, A5200DS and XEGS-DS (really a generic Atari 8-bit emulator).  Surprisingly enough, only the 7800 emulator is more CPU taxing than StellaDS.  ColecoDS and Nintellivision will both run really well even on an older DS (or a 3DS running a flashcart ... such as an R4 card).

As an aside, I've almost managed to get Space Rocks running full speed on my DSi... it's averaging 57 fps with gusts up to 60 and it drops down a couple of frames if there are lots of rocks floating about. But still very playable and "feels" just about right when compared to running it on my Harmony/Atari. 

  • Like 2
Link to comment
Share on other sites

11 minutes ago, llabnip said:

When you install custom firmware, you get the benefit of the 2x faster CPU (134MHz) and 4x RAM.  The emulation doesn't need the extra RAM but the 2x CPU is really what's required to make 98% of the library run full speed.  

 

That sounds like the route to take then as I'd like to be able to play my games.  I imagine there's numerous guides around on how to do this, any suggestion on the best to use to get started?

 

Thanks!

Link to comment
Share on other sites

Most of is use the guide here. It covers different DS models including the 3DS. I’ve done the DSi install several times with no problems but have not worked through the 3DS install. 
 

https://wiki.ds-homebrew.com/twilightmenu/ 
 

If you struggle with a step I’ve got some friends who did the install on a 3DS and I can relay help. 
 

You should be aware that your ARM assisted games are among the most requested for this emulator but I only recently got the DPC+ driver fast enough. Although Space Rocks is just about perfect, Stay Frosty 2 struggles with background music and turning that off via the difficulty switch will bring it up to playable speed. You’re pushing the limits 🤓🤪😁

Edited by llabnip
  • Like 1
Link to comment
Share on other sites

On 10/16/2022 at 4:56 PM, llabnip said:

Most of is use the guide here.

 

Thanks!

 

My 3DS is running 11.9.0-42U, per this I need to update it to 11.16.0.

 

WiFi wasn't working. Back in May I received a couple Eero Pro 6 mesh units with my new gigabit fiber connect. Those replaced my Apple Airports. I set them up with the same ID and password and most things automatically reconnected, but the 3DS did not so I had to delete then re-add the network.

 

System's now Ver 11.16.0-49U

 

Anyway that's enough for today, will continue on this process during the week.

  • Like 1
Link to comment
Share on other sites

Well.. you're half-way there! 

 

When you do get to the point of having the system running homebrew, be sure you grab the daily build from https://github.com/wavemotion-dave/StellaDS

 

The only file you ever need is StellaDS.nds and usually people just copy that to the root directory of the SD card (and put their games in /roms/a2600 or similar - most emulators will default to starting up in /roms so you don't have to hunt too far).

 

The daily build might not be as stable as the last release (though it often is) - but as I'm shaving a few cycles off the Thumbulator each day, that's the one that will give the best performance on DPC+ games.

 

At least until I can't optimize anymore (that day is fast approaching I think - I'm no longer able to get whole frames of increased performance in a coding session and at some point the juice won't be worth the squeeze).

 

Dave

Edited by llabnip
  • Like 2
Link to comment
Share on other sites

1 hour ago, llabnip said:

Well.. you're half-way there! 

 

Been working on another project, so was burnt out on the computer by the time I started looking at that Twilight guide and decided to call it a night.

 

My current 2600 development environment is in a Linux virtual machine running in Virtual Box on my 2013 Mac Pro. The VM runs the ARM compiler we use for the ARM enhanced 2600 games running on the Harmony/Melody.

 

The Mac Pro is long in tooth, and VirtualBox only runs on x86 machines, so would not be compatible with the Apple M1 or M2 CPUs used in new Macs.

 

As covered in Drobo files for bankruptcy topic, I recently purchased a Synology DS1821+ NAS. One of the things I learned was it can run virtual machines

 

On 9/21/2022 at 10:38 AM, SpiceWare said:

Up next is to learn what else I can do with the Synology - apparently you can run Virtual Machines on it 🤔

 

image.thumb.png.7a4699b3cace21782557e7117da9fcd6.png

 

 

 

So I've been experimenting with that, basically installing, testing, and deleting various Linux distributions to see what'll work best for my needs. Yesterday I finally figured out a setup that works for me, mostly being able to log onto the Virtual Machine using Screen Sharing (Apple's built in VNC support) with acceptable GUI performance.  Synology provides a web based setup for accessing the VMs GUI, but it leaves a bit to be desired. Namely the GUI can be sluggish, fuzzy text due to scaling the VM's framebuffer to the browser (no option to set something like a 2x scale factor), and it regularly gets confused about the state of CAPS-LOCK so I'll be typing away when thIS HAPPENS.

 

Once done I'll be resuming work on my framework for writing CDFJ+ games. CDFJ+ supports more ROM(32-512K) and RAM(8-32K) in the cartridge, up from the 32K and 8K of CDFJ.  

 

When I last worked on the framework we'd just discovered an issue with the CDFJ+ driver in that it wouldn't set the clock speed if the ROM was launched from the Harmony's menu. The Harmony and older boards run at 70 MHz, so the Harmony menu startup sequence never needed to set it before. The newer boards run at 60 MHz, so you could end up writing a game that runs fine on the Harmony, as it's clocked at 70 MHz, but has performance issues (resulting in screen rolls) on stand-alone cartridges because on the Melody it gets clocked at 60 MHz.

  • Like 2
Link to comment
Share on other sites

I've been following your tutorials on CDFJ and various posts on CDFJ+ and some hints about your framework (SpiceC?). Anyway - CDFJ is next on my list once DPC+ emulation is solid but right now I'm feeling a little burnt out spending hour after hour trying to optimize another few cycles. I've a funny feeling that CDFJ with it's 4x fast fetchers, fast jumps and more ARM Thumb code is going to break the DS' back. There is a small possibility that it's actually faster than the DPC+ driver if (and it's a big IF) the Atari side of things is relatively "quiet" - meaning that if most of the processing is happing on the ARM side, then the Atari emulation kinda melts into the background which would free up more Nintendo DS cycles for Thumb emulation. By far - the Thumbulator is far more efficient to emulate than the Atari - just simple 16-bit opcode fetches and execution plus R/W to RAM.  But as I said... I'm a little burnt and would hate to port the CDFJ driver to the DS only to find it's not going to run anywhere near the speed needed.  But after a nice rest and some Kaboom... I might try it :)

  • Like 1
Link to comment
Share on other sites

SpiceC will be a separate development framework from CDJF+.

  • CDFJ+ - Programmer writes all code, the 6507 assembly as well as C for the ARM
  • SpiceC - Programmer only writes C code for ARM, like bB a number of 6507 Kernels will be provided, such as:
    • monochrome players
    • multicolor players
    • 128 pixel bitmap display

Both frameworks will use the CDFJ+ bank-switching driver.

  • Like 2
Link to comment
Share on other sites

Thanks CGMR - I appreciate the appreciation.

 

I've just released version 5.7 of StellaDS with every bit of DPC+ optimization I could find.  I got the Thumbulator down to a small enough size that I could squeeze it into the Nintendo DS' "fast instruction memory" (ITCM) which gained another frame of performance. At this point I think it's as fast as I can get it - someone with better ARM9 assembly skills could probably get the Thumbulator faster - but I'm working in C and did the best I could.  Space Rocks will run very close to full speed now - easily hitting 60 fps when there aren't too many rocks floating about... Stay Frosty 2 ended up in the mid 50s and is playable.  The lone culprit that refuses to budge from about 50 fps is Scramble which has invaded the inner recesses of my growingly feeble mind.  The other 40ish DPC+ games run at full speed with no slowdowns (most of them bB games utilizing the DPC+ kernel). 

  • Like 3
Link to comment
Share on other sites

Cool! I mean not the glitches but that you’re up and running. 
 

So I use the older Stella baseline before the big conversion to cycle accurate TIA core. So yes I’m using the cosmic ark and related hacks that look for “illegal” reset of positions during HMOVE. For example in Space Rocks you hit reset on either player 23 cycles after an HMOVE. So I correct these things as I have time to load up the debugger. Yes… not perfect but the cycle accurate new Stella won’t run anything on the old handheld anywhere near fast enough. But it gives me an excuse to keep tinkering! 
 

The cosmic ark starfield handling is unique and I’d have hoped it would show the Stay Frosty and Rabbit Transit stars as well… but alas those don’t fall into the same “hack” patch and my debugging hasn’t shed light on it. Obviously a cycle accurate improvement would make that work but render the games unplayable due to speed. So I’ll keep chipping away. 
 

I did not know about the MM issue. I’ll look into it. Hey - so far all this cost you is some time and I do hope you get some enjoyment from it!

Edited by llabnip
  • Like 2
Link to comment
Share on other sites

Ok... I spent the time examining how Stay Frosty does the stars... did my best at a quick patch to the TIA. Basically a copy of how the Cosmic Ark starfield handling works except HMM1 vs HMM0. I realize this isn't pixel perfect to what I see on the Harmony cart and my Vader... but it will do for now.  Unfortunately Rabbit Transit appears to be still different to both Stay Frosty and Cosmic Ark.  Sigh!

 

image.thumb.png.c44d0c4d71bf4de8d62dd32aba8bf961.png

  • Like 3
Link to comment
Share on other sites

And with a cup of fresh coffee... Rabbit Transit star field is working.  This one was a clear of the horizontal motion registers at cycle 20.  Fortunately someone figured this out in 1997 and the old Stella list is still archived for us VCS-archaeologists to dig through :)

image.png.e0a073a8dd60855966e09b6c45fed772.png

 

I still don't understand the color shift in Medieval Mayham. It's not like any other issue I've seen. To be honest, the effect is kinda cool but obviously I'd like to fix it!

 

 

  • Like 2
Link to comment
Share on other sites

The kings are drawn using Score Mode, set using D1 of CTRLPF.

 

What version of Stella is StellaDS derived from?  Looking at your GitHub page I only see this reference:

Quote

Initial release based on Stella 1.4.2

 

In Stella's Changelog I see this for 4.7:

Quote

Fixed bug in 'Score mode' in TIA emulation; the TIA object colours were correct, but the associated priority was sometimes incorrect.

 

and this for 2.7.5

Quote

Fixed bug in TIA SCORE mode emulation when the Priority bit is also set. This fixes a very noticable graphical glitch in 'Swordquest Waterworld', as well as minor glitches in several other ROMs such as 'Space Shuttle'.

 

  • Like 2
Link to comment
Share on other sites

That's super helpful Darrell!

 

The StellaDS baseline got "upgraded" several times... though not wholesale. I'd say that 80% of the code is 2.6-ish but I pulled in some fixes from later Stella releases as well as the SaveKey support, more advanced bank-switching schemes (pretty much anything up to 512K ROM and 32K RAM) and a few other improvements of my own devices.   But I bet you've hit the nail on the proverbial head and that gives me a massive head start on fixing it. I've done so many DIFFs of Stella versions in the last 2 years :) 

I appreciate the help - and especially the willingness to cover old ground that modern Stella has already fixed. I usually get the "just use Stella 6.7 as your baseline" but the reality is that my hobby is emulators for the venerable DS/DSi where the processor is the equivalent of a 386 SX from the mid 90s!

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...