Homebrew A7800DS - Improved

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Okay, I got the A7800DS emulator rocking and rolling again. The original ran about 42 FPS on the DSi (and 23 FPS on the DS-LITE).

I've made some speed improvements to get the emulator running at 68 FPS max on Donkey Kong (one of the slower games) which renders it completely playable. Sound is not quite as good as I'd like - and that's not a strong area for me but I'll do my best to improve it. My favorite Atari 7800 Homebrew is Meteor Shower which runs at 50 FPS so my goal will be to get that closer to 60 and call it done.

Unfortunately, the 7800 didn't have a ton of games - something like 75 and almost all were arcade ports. But there are some great games on the system... the version of Asteroids is among the best and easiest to enjoy on a handheld. A few great homebrews as well - though a few don't yet run as I don't have their cart types worked out yet.

It will take a filename as a "command line" parameter so in theory it would work fine within TWL++ for .a78 games - should RobZ want another emulator mouth to feed :D

I want to upload the .NDS and the fixed source code - and am unsure if I should just add a new personal project/repository on GitHub but I think it would be better served to put it under Robz's DS-Homebrew area... though I couldn't figure out how to do that :P

upload_2020-12-8_7-54-46.png


Edit: As promised: https://github.com/wavemotion-dave/A7800DS
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
seems you started on an emulator update binge, colecods?
The built-in S8DS emulator (for SMS games) plays colecovision games perfectly with beautiful on-screen touch controller. Hard to improve upon perfection!

Not to volunteer Robz's time, but if he made it launch .col games it should work perfectly. The only possible gotcha is that it does require coleco.rom as a BIOS. I launch an SMS game then use the in-game rom selector to pick a Colecovision game.
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
As promised: https://github.com/wavemotion-dave/A7800DS

Version 1.1 with major speed improvement to the point of being useful.
I removed all the frameskip stuff - we now run all frames all the time. I may revisit that decision on a few games that are stubbornly refusing to run at full speed.
Most commercial games run full frame rate. A few of the 320 mode games run down around 50 FPS but still playable.
Some homebrews work... specifically Meteor Shower which is beyond excellent clone/spiritual cousin to Astrosmash on the Intellivision.
Some of the homebew 320 games (Froggie and Space Invaders) are really hard to render correctly given the 320 pixels vs 256... I've done my best to scale but some pixels are going to be missing.
Sound is... functional. I'm not happy with it - keep the volume low so you get the sounds but you don't hear the background crackle that I'll need to work on (this was in the original version I started with).

Place the .NDS file anywhere and run it via UNLAUNCH or TWL++. Click cart slot to load ROM.

If it gets added to TWL++ it should take a command line filename to load and run.

Optimizing this was frustrating - it was really hand-tuned C code... it came down to finding just a few places where they did 4 byte loads vs a single 32-bit read and that one change produced a massive 30% speed improvement. All the other efforts I did only got another 10% or so...

Enjoy!
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Version 1.2 released: https://github.com/wavemotion-dave/A7800DS

Got the sound improved. It's significantly better but not perfect. Unfortunately this ancient hardware used even more ancient 2-channel TIA sound processing and it's not great... but at least now you don't have to have the volume turned all the way down to enjoy the emulator :)

Most of the games I'd want to play work fine now... and to be honest, I'm not finding as much excitement in improving this one as I did StellaDS ... mostly because the 7800 ProSystem just didn't have the selection of great original games that the venerable 2600 did. And it's made worse by the fact that many of the great 7800 games were remade for the NES which are perfectly playable already on a DSi via NESDS.

Still... it's another emulator working with a few exclusives and some worthwhile homebrews. I'm sure all 3 people that ever play the thing will be happy :D
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
A few more improvements checked in (but not enough to do another full release - but you can grab the nightly build).

Found a way to improve the RIOT timing so great homebrew games like BEEF DROP (Burgertime clone) will work at very close to full speed now. Fixed some glitchy keyboard detection mostly on showing FPS and enabling Full Speed (X and Y buttons). A few other improvements as time permitted.

The core of A7800DS uses ProSytem which was always a little glitchy in it's emulation... and it was abandoned in 2009 in favor of the 7800 Emulation in MESS. Someone picked up the mantle for ProSystem in 2015 for a few short weeks and did patch in some timing improvements that I'll try to backport into A7800DS but otherwise we're stuck with an emulator that will likely not run all games perfectly (and some games will never run). But what it does run, it runs rather well!
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Version 1.3 released: https://github.com/wavemotion-dave/A7800DS

Fixed Beefdrop, Froggie and BonQ homebrews so they are playable and at full speed and in the right region . Back ported some of the emulation timing fixes in the Wii version of the 7800 emulator which renders a few more games playable.

Pac-Man Collection (both original version and the 40th Anniversary Edition which just came out this year in the homebrew scene) are supported and they are amazing!

Edit: updated to 1.3a ... got Kung Fu Master working and, more importantly, Astro Blaster and Astro Fighter are both working now!! Astro Blaster is beyond excellent. Baby Pac-Man works! Double Dragon half-works... but is so slow as to be unplayable.
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Version 1.4 released: https://github.com/wavemotion-dave/A7800DS

Highscore Support! Using the "official" highscore.rom (place in same folder as your ROMs and name it exactly as you see... same case).

This will enable high-score support for all games that use it. Put the 4k highscore.rom (don't ask) where your ROMs live. If found, it will enable saving of high scores on all 9 original games (Asteroids, Joust, Centipede, Xevious, Dig Dug, Galaga, Food Fight, Ms Pac-Man and Robotron) as well as most of the newer homebrews.

A cool thing about the high score cart add-on is that it lets you personalize your cartridge... so you can put in a name. When you go to save your high score in an enabled game (below I'm using Asteroids), you can see the personalization along with the high score entry area. Scores are, obviously preserved across power cycles of the DS.

upload_2020-12-13_10-40-54.png

upload_2020-12-13_10-41-24.png
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
And another 1.4b patch release... after playing with the High Score saving for a day, I'm not happy. Although there is some common code in the highscore.rom, some games access it more frequently than is needed (for example, as your score bypasses the old high score) and I was finding that we were snap-shotting the SD card too often and it was too noticeable.

After a lot of head scratching, I've decided to punt on this a bit... so now, you MUST press the new HSC button if you want to snap the Saved Scores out to the flash card. It's not something I want to do as the game runs... so you must do it... the high scores will also auto-save if you quit the emulator or select a new game.

It's a trade-off for now until I can get a better handle on it.

upload_2020-12-13_18-47-38.png


The new HSC button is in the middle of the bottom row. Tap it and you will see a brief "SAVING" message that takes about a half second as the SRAM is saved to your SD card. The SRAM will automatically save if you quit the emulator or if you switch to a new game - so those cases are covered and you are not likely to miss saving your best score on Centipede :)

Lastly, I've got one hidden hotspot on the screen - the Atari Logo (to the left of the word ATARI middle of screen). If you are on the High Score board for any game that supports the High Score saving, pressing this will enter the highscore.rom Maintenance Mode where you can change your save cart name, erase high scores, etc.
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Okay... last night I ran through about 60 games to see how they performed. Sometimes you need to poke your head above the trees to see if what you've done has any merit! I'm pretty happy with the performance - a few stubborn games refuse to run at full speed but most are working fine. A few small graphical glitches as well - likely as a result of the heavy optimizations. But what works plays really well.
upload_2020-12-14_12-55-27.png
 
Last edited by wavemotion,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Version 1.5 released: https://github.com/wavemotion-dave/A7800DS

I enhanced the X/Y scaling to make more games look pixel-perfect. This was especially true of the 320p games which tend not to use the full screen width and so they look much nicer - though slightly out of their normal aspect ratio. More cleanup and stability improvements - this release is really solid!
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Version 1.6 - rebranded PHOENIX EDITION (to match the work I did on StellaDS). https://github.com/wavemotion-dave/A7800DS

That's pretty much a wrap - I've advanced the goalposts forward and the source is out there for anyone that wants to improve it further!

I've contacted Alekmaul to see if he would release his A800DS and A5200DS source code for me to enhance. No response after a week. I'm not going to badger the man - so StellaDS and A7800DS will have to do for now!

@Robz8 if you could include this 1.6 version going forward, that would be swell. Thanks for your hard work!
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
515
Trophies
1
XP
3,486
Country
United States
Still cannot believe that 9.5 years after the last update a wizard with no emulation background came and pushed two emulators into excellent shape in the course of three weeks. Thanks a lot. I hope you turn your attention and skills to some other classic consoles!
You're quite welcome.

It's purely selfish reasons - I love the Atari consoles and was disappointed that we didn't have a fully functional emulator for the DS. My main concern was that it didn't allow changing the 'difficulty switches' so I couldn't play some of my games properly ... and the slowdown was pretty bad. So rather than complain, I saw that the source was available and although I have no emulator experience - I know code and can debug as well as anyone. So I figured I'd take a stab at improving things... when you look at the changes done to A7800DS, it's really rather minimal. There was a couple of places where they read out 4 bytes in a row - but the DS core is a 32-bit machine and so I switched it to reading 32-bits (all 4 bytes simultaneously). This rendered an amazing speedup - almost 30% instantly. But it took a few days to find that spot... that's where the real work happens: in the debugging and investigation.

My engineering mentor once told me a story that I hope is true. It's about the railroad industry back at the turn of the last century. The train had stopped and nobody could figure out how to get it going. An engineer came up and said he could fix it for $100 - a rather large sum of money at the time. The railroad owner reluctantly agreed and the man went and tapped on a single pin which got the train running. The owner scoffed at paying $100 for such a simple fix. "It only took you 30 seconds to fix it?!" and the engineer replied, "No. It took me 30 years of experience to know what pin to tap".
 
Last edited by wavemotion,
General chit-chat
Help Users
    ClancyDaEnlightened @ ClancyDaEnlightened: https://www.youtube.com/watch?v=8f4knQVdBT0