Homebrew A7800DS - Improved

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
Believe it or not, I'm already doing a 50% frameskip even on the DSi just to get the speed we have... this emulator is a beast - by far the most CPU intensive of the 6 emulators I've worked on. Over the course of a few months I got the original 42FPS framerate on Donkey Kong up to about 80FPS on the DSi and that was pulling every trick I could think of (including the aforementioned 50% frameskip). The DS-LITE never ran more than just a handful of simple games like Asteroids or Centipede.

In order to make this emulator really playable on the DS-LITE, it needs about 25-30% speed boost which would be like squeezing water from the proverbial stone. I'll go back over the code again to see if there is something obvious I've missed - maybe a DMA memory transfer or similar that could help... but even with a lightning-strike of luck, we're not likely to get more than another 10% out of this thing. The best bet might be to start over with another emulator core that might be more efficient and/or better suited to the DS. But there just isn't enough gas left in my tank to take that job on :)
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
Didn't this have it's LITE version removed some time ago, or was it another emulator?
Correct. I had a stripped-down DS-LITE version that really wasn't very good - it did things that I'm not proud of to get some play-ability out of the games. In the more recent "unified" A7800DS builds, I've incorporated a check for DSi vs DS-LITE/PHAT and perform many of the same tricks.

With 3.1 the speed is such that only about a half-dozen simple games run full-speed on the DS-LITE: Asteroids, Galaga, Joust, etc. The emulator really needs the CPU speed of the DSi to make it really worth using. Even on the DSi, it's taken a pretty big effort to get enough juice to play most games correctly. The 7800 Pro System has something called "cycle stealing" which allows the video processor to stall out the CPU to get even more processing done than it should otherwise be allowed - and this emulation wrecks havoc on poor A7800DS :D
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
Okay, @CrashMidnick - this one is for you :)

Just checked in 3.1b with a couple hours of re-optimizations. I didn't get much - about 1 or 2 frames extra on the DS but I also pulled out the hacks I was using so that it now has much better compatibility on the DS-LITE.

With this version, the following games run at (or near enough to) 60FPS with reasonably proper sound on the older DS-LITE:

  • Asteroids
  • Asteroids Deluxe
  • Astro Blaster (voice even works! Be sure to check out this awesome homebrew)
  • Astro Fighter
  • Centipede
  • Galaga
  • Joust
  • Moon Cresta
  • Pole Position II
  • Space Duel
  • Space Invaders
It's not a ton of games - but it's an improvement. I will do my best to see if I can squeeze a couple other iconic games onto this list. I would love to get Meteor Shower on here... but it's only at 53FPS right now (if you press X when loading you can play it without sound but that kinda sucks)

As a bonus, the DSi got a 2 frame boost as well - Alien Brigade is now up to 53FPS and is playable and Ninja Golf is sustaining 60FPS.

Edit: Just checked in 3.1c with another couple of frames of boost for the venerable DS-LITE. Meteor Shower is now running at 55FPS - if I can get another couple of frames, it will be fully playable on the older hardware!
 
Last edited by wavemotion,

CrashMidnick

Well-Known Member
Member
Joined
Jul 22, 2015
Messages
728
Trophies
0
Age
41
XP
2,842
Country
France
Okay, @CrashMidnick - this one is for you :)

Just checked in 3.1b with a couple hours of re-optimizations. I didn't get much - about 1 or 2 frames extra on the DS but I also pulled out the hacks I was using so that it now has much better compatibility on the DS-LITE.

With this version, the following games run at (or near enough to) 60FPS with reasonably proper sound on the older DS-LITE:

  • Asteroids
  • Asteroids Deluxe
  • Astro Blaster (voice even works! Be sure to check out this awesome homebrew)
  • Astro Fighter
  • Centipede
  • Galaga
  • Joust
  • Moon Cresta
  • Pole Position II
  • Space Duel
  • Space Invaders
It's not a ton of games - but it's an improvement. I will do my best to see if I can squeeze a couple other iconic games onto this list. I would love to get Meteor Shower on here... but it's only at 53FPS right now (if you press X when loading you can play it without sound but that kinda sucks)

As a bonus, the DSi got a 2 frame boost as well - Alien Brigade is now up to 53FPS and is playable and Ninja Golf is sustaining 60FPS.

Edit: Just checked in 3.1c with another couple of frames of boost for the venerable DS-LITE. Meteor Shower is now running at 55FPS - if I can get another couple of frames, it will be fully playable on the older hardware!

This is truely amazing, thank you so much Dave !
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
You're quite welcome... just checked in 3.1d with two more frames of speed!

Meteor Shower is now running at 57 FPS and it's playable... would like to get 1 more frame just to be safe.

The following games are now running at 60 FPS on the DS-LITE:
  • Robotron (with the twin firing!)
  • Food Fight
Time Salvo homebrew is at 56... it's close. The original Pac Man Collection is at 57. Uniwar-S and Galaxian (both using the same homebrew engine) are at 53.

Many of the games on my original bullet list above are now capable of running at 63 or 64FPS which means they have CPU to spare - this makes them run very smoothly on the DS-LITE.

On the DSi front, Alien Brigade is now at 56 FPS :)
 
Last edited by wavemotion,

CrashMidnick

Well-Known Member
Member
Joined
Jul 22, 2015
Messages
728
Trophies
0
Age
41
XP
2,842
Country
France
You're quite welcome... just checked in 3.1d with two more frames of speed!

Meteor Shower is now running at 57 FPS and it's playable... would like to get 1 more frame just to be safe.

The following games are now running at 60 FPS on the DS-LITE:
  • Robotron (with the twin firing!)
  • Food Fight
Time Salvo homebrew is at 56... it's close. The original Pac Man Collection is at 57. Uniwar-S and Galaxian (both using the same homebrew engine) are at 53.

Many of the games on my original bullet list above are now capable of running at 63 or 64FPS which means they have CPU to spare - this makes them run very smoothly on the DS-LITE.

On the DSi front, Alien Brigade is now at 56 FPS :)
Quality check passed :)
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
I'm... so.... close....

Meteor Shower is reaching gusts of 58 FPS but every change I make is lateral or regresses at this point.

1643758620296.png
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
https://github.com/wavemotion-dave/A7800DS

V3.2 : 1-Feb-2022 by wavemotion-dave
  • 5-8% Speedup across the board using as many optimizations as I could manage.
A number of games are now playable on the DS-LITE with improved speed and compatibility.
The DSi got a nice boost as well... Alien Brigade has been one of the real holdouts in terms of running at full speed... previously the fastest I've gotten that to run was 52 FPS but this version will reach 56 FPS and it's very playable. Almost every other 7800 game is full speed on the DSi - to the point where I'll probably start backing off the frameskip on the DSi to get smoother screen rendering.

In the end, Meteor Shower run around 58 FPS on the DS-LITE with rare peaks to 59. And it's playable!
 
Last edited by wavemotion,

CrashMidnick

Well-Known Member
Member
Joined
Jul 22, 2015
Messages
728
Trophies
0
Age
41
XP
2,842
Country
France
https://github.com/wavemotion-dave/A7800DS

V3.2 : 1-Feb-2022 by wavemotion-dave
  • 5-8% Speedup across the board using as many optimizations as I could manage.
A number of games are now playable on the DS-LITE with improved speed and compatibility.
The DSi got a nice boost as well... Alien Brigade has been one of the real holdouts in terms of running at full speed... previously the fastest I've gotten that to run was 52 FPS but this version will reach 56 FPS and it's very playable. Almost every other 7800 game is full speed on the DSi - to the point where I'll probably start backing off the frameskip on the DSi to get smoother screen rendering.

In the end, Meteor Shower run around 58 FPS on the DS-LITE with rare peaks to 59. And it's playable!
This version is very welcome, in less than 2 days you managed to have +10fps average on older HW. It can reach, sometimes, around 50fps and more on some titles like Tower toppler (Nebulus). It is like having an extra easy mode but enjoyable. Thanks for our beloved DS-lite and Fat :) and thanks for your time.
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
https://github.com/wavemotion-dave/A7800DS

V3.3 : 4-Feb-2022 by wavemotion-dave
  • Squeezed out another frame of performance.
  • Super Skateboardin' graphics fixed.
  • DSi eliminates frameskip on 80% of the library.
  • Updated 50 entries in the internal database - more new homebrews run.
Okay... I came up a little short on my goal but Meteor Shower is sustained 59FPS with gusts to 60 on the DS-LITE (DSi is, of course, full speed). That's as close as I can get it - it's really like 59.5 frames per second and is about 1% off "true speed" - you won't notice it. Crank that baby up to 'HARD' mode and watch the sprites fly! Pac-Man Collection and Time Salvo also join the playable list on the DS-LITE. Overall I've got at least 1 extra frame of performance on this build - in some cases 2 frames depending on the game and the graphics modes it uses. This frame came at a great expenditure of effort and I'm kinda burnt out for now.

Big update for the DSi users as well - about 80% of the 7800 library now runs without frameskip. It makes a nice difference in the smoothness of rendering - and games like Scramble (homebrew) won't flicker when you drop bombs anymore and the meteors drop smooth as butter on Meteor Shower.

I also took this opportunity to refresh the internal database - about 20 new games added and 30+ games patched up to make them look better on screen. This includes a bunch of updated and new homebrews from the past 2 years. Please seek out Bob's Galaxian and UniWarS as some great games to try.


Let me finish this post with a clear declaration: this emulator sucks :) It really does... It's based on ProSystem which is known to not be very accurate - and I've complicated things by all kinds of ill-advised tricks and techniques to get it to render as best I can. The screen resolution is wrong in both directions... 160 or 320 x 240... none of those maps well to the DSi screen (which is 256x192). And yet, despite almost everything being wrong here... there is still a ton of fun to be had here. Last night I kicked back with some twin-stick Robotron action and a few runs on Scramble. Food Fight remains one of the best home conversions on a quirky fun game. And Meteor Shower is just plain fun.
 
Last edited by wavemotion,

Cris1997XX

Well-Known Member
Member
Joined
Oct 31, 2021
Messages
470
Trophies
0
Age
23
XP
1,262
Country
Italy
Would it be possible to squish the vertical resolution (AKA 240p), and 320 mode -When games use it- so that they can fit the DS's screen without cutting graphics out?
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
Would it be possible to squish the vertical resolution (AKA 240p), and 320 mode -When games use it- so that they can fit the DS's screen without cutting graphics out?
Already done. I default to cutting out bottom areas that don't matter much... but you can re-adjust using the Left/Right Shoulder Button + DPAD to Scale / Offset change every aspect of the display.
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
I'm not ready for a new build but I did just check in 3.3a with one a one-line improvement... but what an improvement it is!

I found it! When using frameskip (mostly for the DS-LITE now) - there was a graphics write happening to a frame buffer that was not being output (since we're doing frameskip, the buffer simply goes unused). There is no reason to write the graphics to a buffer that isn't going to be used for that frame. I added 1 line of code and on the DS-LITE gained 10 extra frames of performance!!

It's an incredible gain... and the number of games that are playable at full-speed more than doubled. Here is a list of all games that play nearly perfectly on the DS-LITE:

  • Asteroids
  • Asteroids Deluxe
  • Astro Blaster
  • Astro Fighter
  • Baby Pac-Man (yes!)
  • b*nQ (yes!)
  • Ballblazer (with 6 channel sound using Pokey!)
  • Centipede
  • Choplifter!
  • Crazy Brix
  • Dark Chambers
  • Dig Dug
  • Donkey Kong
  • Donkey Kong Jr
  • Donkey Kong XM (yes!)
  • Dragon's Descent
  • Food Fight
  • Frenzy (with Berzerk) - plays fine, cutscene voice very slow
  • Galaxian
  • Galaga
  • Joust
  • Meteor Shower
  • Moon Cresta
  • Morf
  • Ms. Pac-Man
  • Pac-Man Collection
  • Pac-Man Collection - 40th Anniversary (yes! Seek this out!)
  • Pole Position II
  • Robotron
  • Scramble (yes!)
  • Space Duel
  • Space Invaders
  • Time Salvo
  • UniwarS (yes!)
  • Wizard's Dungeon
  • Xevious

There are probably others that play perfectly - just haven't tried everything yet. And there are other games that are running 55+ which is almost playable with hints of slowdown (mostly noticeable on sound rendering). I'd estimate roughly half the small 7800 library is now playable at full speed on the DS-LITE/PHAT.

As a bonus, the few games on the DSi that wouldn't play full speed (Alien Brigade, Realsports Baseball) are all pretty much at 60FPS now except maybe during "cutscenes" which don't affect play.

@CrashMidnick - enjoy :)
 
Last edited by wavemotion,

CrashMidnick

Well-Known Member
Member
Joined
Jul 22, 2015
Messages
728
Trophies
0
Age
41
XP
2,842
Country
France
I have found those tiltes that are 60fps 99% of the time (except Plutos, see below ).

Crack'ed
Crossbow
Desert falcon
Hat trick
Karateka
Mario bros.
Mat mania challenge
Pit fighter
Planet smasher
Plutos (56-59fps)
Rampage
Summer games
Super skateboardin'
Tank command
Water ski
Winter games

As you said Dave, many games are now in the range 50-55 fps. Very nice ! Ikari Warirors and Commando are almost playable on the old HW. Again, thanks for your hard work !
 
Last edited by CrashMidnick,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,350
Country
United States
Version 3.5 has been released: https://github.com/wavemotion-dave/A7800DS

V3.5 : 12-Feb-2022 by wavemotion-dave
  • Across the board cleanup of code. Copyright notice added.
  • Fixed High-Score save on Time Salvo
  • Slight memory optimization for reduced memory footprint.
A few tweaks and fixes but mostly just a clean-up pass to get things in a good state. I'm going to move on to some other projects and let this one stand as-is for now.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    The snack that smiles back, Ballsack!
    SylverReZ @ SylverReZ: @AncientBoi