Homebrew Stella-DS Improved

plasturion

temporary hermit
Member
Joined
Aug 17, 2012
Messages
1,216
Trophies
2
Location
Tree
XP
3,508
Country
Poland
Wonderful emulator, greatful thanks. :bow: Now i just can't stop to play seaquest, very addictive game. I got 52fps on regular ds lite and is very playable. Games without ending has own unique charm. I wonder if there's a way to stretch image vertical same like horizontal in case to remove black sidebars for some games or to be more close to recive kind of perfect pixel effect.
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
Wonderful emulator, greatful thanks. :bow: Now i just can't stop to play seaquest, very addictive game. I got 52fps on regular ds lite and is very playable. Games without ending has own unique charm. I wonder if there's a way to stretch image vertical same like horizontal in case to remove black sidebars for some games or to be more close to recive kind of perfect pixel effect.

Thanks for the kind feedback. Yeah, recent versions of StellaDS have come close to full speed on the old DSLITE/DSPhat ... on the DSi just about every game runs full speed.

You can stretch the vertical by using the shoulder buttons and the D-Pad.

The Left Shoulder Button plus UP or DOWN will bump the display output by 1 pixel.
The Right Shoulder Button plus UP or DOWN will stretch the display.

However, Seaquest is already running at full resolution - so you can't stretch it beyond 1:1 (I could allow it but all it would really do is take a few random pixel lines and repeat them... which isn't very useful).
 

plasturion

temporary hermit
Member
Joined
Aug 17, 2012
Messages
1,216
Trophies
2
Location
Tree
XP
3,508
Country
Poland
Ok... I mistook, I meant oposite direction, to stretch horizontal. Yeah, It would be nice to use Left shoulder button plus left and right on dpad. And it seems it is stretched above 1:1 already in this axis, cause atari has 160 pixel in line. So i guess the only one best effect is to display 2:1 (320px) and set center with Right shoulder button, so it's probably hard to recive on 256px display without cut off part of screen, but anyway... it still looks great.
 
  • Like
Reactions: wavemotion

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
Ok... I mistook, I meant oposite direction, to stretch horizontal. Yeah, It would be nice to use Left shoulder button plus left and right on dpad. And it seems it is stretched above 1:1 already in this axis, cause atari has 160 pixel in line. So i guess the only one best effect is to display 2:1 (320px) and set center with Right shoulder button, so it's probably hard to recive on 256px display without cut off part of screen, but anyway... it still looks great.
Good point - yeah, I will add the ability to stretch things horizontally to help fill in the borders on some games and it would make it a bit more "pixel perfect" though the 160 horizontal native Atari VCS resolution kinda sucks for the DS (you either repeat pixels or you make the image really small).
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
So bolstered by the closing gap on full speed for the older DS models (DS-Lite, DS-Phat)... I've taken to a few more optimizations and reduced the sound quality from 22KHz to 11KHz when running in older (slower) DS mode... this gets about 5% speed boost and renders many games very close to full speed now on the older DS systems. Space Invaders is 55+ and gets up to 60FPS very quickly once a few aliens are cleared out. Seaquest is up to 54 bordering on 55FPS. Adventure is now 60FPS. Frogger is now 60FPS. Spider Fighter is now 60FPS. Pheonix is now 60FPS. Many more games are now playable or at least borderline playable. Some of the more graphically intense games like Pitfall still fall short of 50FPS - but it's steps in the right direction.

Of course, on the DSi running in 133MHz mode - the games all run at or near full speed.

Not ready for a new release, but if you're using StellaDS on an older DS-Lite or DS-Phat, you can grab the nightly StellaDS.nds build from: https://github.com/wavemotion-dave/StellaDS
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
Another nightly check-in with another frame of speed squeezed out and corrected the lag in older DS sound output.

I've hit another wall... until the next breakthrough I'm mostly just moving things around trying to find another half of a percent speed gain. Seaquest now runs at 55FPS with bursts up to 56 on the older DS hardware. Many of the more basic VCS games are now playable on the older DS hardware. You might even be able to get away with turning on flicker free on a few games to make them visually better on the older DS screens. If I could just find another 10% boost somewhere - but at this point, I feel like I'm just going over the same old bottlenecks.

On more positive news - the games running in DSi mode (via TWL++ or similar) are pretty much all full-speed now. Even the stubborn Midnight Magic is running at 59FPS and is now indistinguishable from the game playing on a real console.

Not ready for a new release, but if you're using StellaDS on an older DS-Lite or DS-Phat, you can grab the nightly StellaDS.nds build from: https://github.com/wavemotion-dave/StellaDS
 
Last edited by wavemotion,

plasturion

temporary hermit
Member
Joined
Aug 17, 2012
Messages
1,216
Trophies
2
Location
Tree
XP
3,508
Country
Poland
Nice, I tried to add few tweeks and I recived few more fps, I'm not sure what's going on there yet, but I wonder if collision check emulation consume much cpu, does all the subroutines "compute*" are called every in the main loop before every frame? I wonder if is possible to add some minor tweeks to omit several if- else, or replace aritmetics by bit rotation (is faster than divide by 4) in example here:
Code:
void TIA::computePlayfieldMaskTable()
{
  Int32 x;

  // Compute playfield mask table for non-reflected mode
  for(x = 0; x < 16; ++x)
  {
      int tmp = 0x00001 << (x >> 2);
      ourPlayfieldTable[0][x] = tmp;
      ourPlayfieldTable[1][x] = tmp;
  }
  for(; x < 48; ++x)
  {
      int tmp = 0x00800 >> ((x - 16) >> 2);
      ourPlayfieldTable[0][x] = tmp;
      ourPlayfieldTable[1][x] = tmp;
  }
  for(; x < 80; ++x) 
  {
      int tmp = 0x01000 << ((x - 48) >> 2);
      ourPlayfieldTable[0][x] = tmp;
      ourPlayfieldTable[1][x] = tmp;
  }
...
also i replaced if-else chain to switch case in few places, and some other stuff, few games recived few more fps like river raid or skiing. However i wonder what devkit pro version are you using, when i compile it loose few fps and file is bigger than already compiled.
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
Okay... if I just optimize for the standard 4k games without bankswitching, I can get 60+ FPS (full speed) on my DS-LITE!

upload_2021-8-9_10-54-59.png



Now the question is... how to incorporate this into the main build (rather than a special DS only build). I'd also like to incorporate standard F8 bankswitching so that both 4K and 8K games (a large number of games fall into these categories) run smoothly on the DS-Lite / DS-PHAT.

@plasturion cool! Those computations are a bit slow - but those are only executed once at startup to pre-compute the look-up tables.

The collision detection stuff is REALLY SLOW and is called almost continually as the POKEs to the TIA cause us to need to update the line to get a current snapshot of collisions before we make alterations to any of the TIA registers. It's been painful but that stuff has been hand-optimized to the point of exhaustion for me.

I'm running the Linux devkitpro-pacman version 1.0.2
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
Ok... still not ready for a build but nightly checking 4.2c

https://github.com/wavemotion-dave/StellaDS

is available with new speedup for non-bank-switching games (2K and 4K). This means that tons of games are now playable on the older DS hardware - Space Invaders, Chopper Command, Spider Fighter, Cosmic Commuter, Vanguard, Adventure, Demon Attack, Haunted House, Breakout, Kaboom!, Laser Gates, Defender, Centipede, Megamania, and loads more will all run at or near enough to full speed. Missile Command and Yars Revenge will run sufficiently fast enough that you can turn on Flicker-Free mode to play them properly (otherwise the 30Hz shield generation on Yars will cause your eyes to bug out). Even Pitfall is close to playable... somewhere around 53FPS.

This also means that on the DSi any non-bankswitched games are now into the stratosphere... Adventure which had previously maxed out at 151FPS (unthrottled) can now run at 175FPS. Yes, that's a 15% gain in speed :)

I think I may have broken FE bankswitching (only a few games) but I'll be sure to get that repaired before an official 4.3 release.

Have fun!
 
Last edited by wavemotion,

plasturion

temporary hermit
Member
Joined
Aug 17, 2012
Messages
1,216
Trophies
2
Location
Tree
XP
3,508
Country
Poland
Seaquest with full stable 60 fps without any framedrop.. yeah! Perfect! I'm totally into this! River ride now with 55fps works very smoothly but it looks like with scanlines because of that refresh speed on ds lite screen?, Keysotne Kapers around 55fps nice, sometimes still slowdowns here and there, mostly on escalators, all famous classics running close to perfect on ds lite. Even Stampede boosted up. This is it! Good to see that things on older hardware! Thanks for these improvements!
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
Thanks for the kind words, @plasturion !

I'm now tweaking just a handful of classic games on an individual level... I've got River Raid running at a full 60FPS - no slowdown anymore. I've got Pitfall running at 59 with bursts up to 60 - it's indistinguishable from full speed. Yars Revenge with Flicker-Free mode is 57+ and plays perfectly. Keystone Kapers is 57 with bursts up to 60... except for the Escalators :)

I've got about 25-30 games I will hand-tweak and then I'll release 4.3.

Edit... most of the Activision games are now playable at or near full speed:

https://github.com/wavemotion-dave/StellaDS
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
V4.3 is released: https://github.com/wavemotion-dave/StellaDS

V4.3 :09-Aug-2021 by wavemotion-dave
* Massive overhaul of the non-bank-switched engine so now the older DS-Lite
and DS-Phat will run many games at full speed.

It's been a long time coming - but finally we have the optimizations necessary to render a few hundred of the classic games playable on the older DS hardware (DS-LITE and DS-PHAT). StellaDS is now 100% faster than the original version I started with - but those gains have come very slowly. I feel like it's been 100 one-percent gains - a proverbial slog up the steep slopes of Mt. Doom. But here we are - enjoy the first version that will render most of the classic 4K and 2K non-bankswitched games playable on the older DS platforms as well as a solid handful of 8K games that play similarly well (Asteroids, Centipede, Phoenix, Vanguard, Star Raiders, etc. all run fine). Although defaulted to OFF for maximum speed - be sure to turn on Flicker Free for Missile Command and Yars Revenge to render the screens properly. I'll probably make this mandatory in the next release (in DSi mode, many of the games default to Flicker-Free mode where two fames are blended together to smooth out the 30Hz flicker used in many games - but it comes at a cost in about 20% CPU speed).

Of course, in DSi mode (133Mhz) - everything runs full speed across the board. Enjoy!


upload_2021-8-10_7-10-5.png
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
Not ready for a new build yet... but nightly check-in has the ability to zoom/stretch the image horizontally. Not highly useful - but for the games that don't utilize the full horizontal screen you can zoom in a bit to get a more pixel-perfect rendition of the image.

Use the Left Shoulder Button + DPAD L/R to stretch the image horizontally.

Basically similar to Left Shoulder + DPAD Up/Down to stretch the image vertically.
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
V4.4 is released: https://github.com/wavemotion-dave/StellaDS

V4.4 :22-Aug-2021 by wavemotion-dave
* Minor cleanups across the board. Improved AR cart speed by ~1FPS.
* Added horizontal stretch - use the Left Shoulder + L/R D-Pad.
* The Y button is now auto-fire.

Nothing too exciting - just a bit of cleanup across the board. I don't like to sit on changes too long and would rather get them out there for the 3 people that actually use this emulator :D
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
917
Trophies
1
XP
7,357
Country
United States
V4.5 is released: https://github.com/wavemotion-dave/StellaDS

V4.5 - 05-Nov-2021 by wavemotion-dave
  • Zinger-free sound output!

Well, it only took 11 years (with a 10 year break in-between) but the glorious 2-channel TIA of the Atari 2600 is now humming along nicely without any sound output zingers. I ported over the sound output handling that Nintellivision uses and everything I tried seemed to sound great and there were no more zingers or other loud artifacts in playback.

Enjoy!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    ZeroT21 @ ZeroT21: only ps5 updated to latest firmware can go on psn, jailbroken ones just don't use psn or they...