Homebrew A7800DS - Improved

MarioKartFan

Well-Known Member
Member
Joined
Aug 27, 2019
Messages
596
Trophies
0
XP
2,319
Country
Algeria
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".

That’s a great story. Fingers crossed that you have a warm spot in your heart for some other classic consoles.
 

cloudstr

Active Member
Newcomer
Joined
Apr 11, 2019
Messages
27
Trophies
0
Age
33
XP
156
Country
Vietnam
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!

I knew there was little hope here, but I just checked further and found Alekmaul's second email via his PayPal donate page, which can be access by clicking a yellow “Faire un don” button on this page: https://www.portabledev.com/contact/

And the result is ... [email protected]

It might be a wise idea to contact him again through the Gmail e-mail :unsure: :)
 
Last edited by cloudstr,

Indy13

Well-Known Member
Member
Joined
Jan 26, 2017
Messages
602
Trophies
0
Age
45
XP
1,278
Country
France
I found a bug on version 1.6a which was already present on version 1.6. This happens when you exit the emulator with the "power" option without launching roms. If we do not launch a game, the emulator does not seem to want to return to HBMenu and we get an error message like this:

IMG_2400.JPG
IMG_2402.JPG


Edit : Also tested on 1.6b for the same result.
 
Last edited by Indy13,

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,341
Country
United States
Interesting Indy!
I'm not able to reproduce with TWL++ or directly through UNLAUNCH.
I was able to reproduce this only with HBMENU and my DS-LITE
I can't see anything obvious that would be different about loading a rom - my initial guess was that some memory was never allocated (for the cartridge) and was trying to be released when quitting... But the A7800DS code doesn't use C++ nor dynamic memory.
I'll keep looking!
 

wavemotion

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

Big update! Full Pokey Support at both 0x450 and 0x4000 which was no small feat. RAM supported at 0x4000 for games that require it (Serpentine works now). Undocumented OP Codes for the Sally processor now implemented so games like Popeye will run fine. Other tweaks and improvements as time permitted. The full Pokey Support comes at a cost of CPU time - but fortunately we've gotten ahead of the 60FPS on most games so the loss here won't matter. It does drop Froggie down to 58 FPS but it's not noticeable in gameplay.

Unfortunately, play on a DS-LITE gets worse and worse as the processor just can't cope like the DSi can. I might build a special DS-LITE version that strips off most of the accuracy and bells/whistles to at least render some of the basic games (Astroids, Joust, Centipede) playable.
 

Alexander1970

XP not matters.
Member
Joined
Nov 8, 2018
Messages
14,973
Trophies
3
Location
Austria
XP
2,497
Country
Austria
Hello.1111xmas_wink.gif
Thank you for your Updates and your further Development.bravo.gif clap.gif

Unfortunately, play on a DS-LITE gets worse and worse as the processor just can't cope like the DSi can. I might build a special DS-LITE version that strips off most of the accuracy and bells/whistles to at least render some of the basic games (Astroids, Joust, Centipede) playable.

If you maybe need Testing Help for DS Lite,you know where to find....:D
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,341
Country
United States
Spent my vacation day optimizing the CPU core emulation and got back almost 10% speed boost!

We're now running at about 2x the original emulator speed (with a lot more core functionality) and most games are running at 60FPS perfectly.

So good are the improvements that I made a stripped down version for the DS-LITE that is actually playable. It only handles the smaller games like Asteroids, Centipede, Joust, Meteor Shower (awesome homebrew!), Asteroids Deluxe, Moon Cresta and similar small games... don't try to run any of the larger/newer homebrews on it - it will crash with the streamlining I did. But what does run on the DS-LITE will now run very close to full speed. I had to turn the sampling on sound way down so it's not the best sounding emulator - but it's the first Atari 7800 emulation that has come close to being very playable on the original DS hardware. It even supports high scores if you use the highscore.rom file!

If you're running on the DSi or better, please do NOT use the DS-LITE version - the full A7800DS.NDS has much better compatibility and on the faster DS hardware will run fine. Even the most stubborn games like Popeye will run at 52FPS.

I'm not ready to release 1.8 yet... need another day of optimizations but you can get the nightly builds here:

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

cloudstr

Active Member
Newcomer
Joined
Apr 11, 2019
Messages
27
Trophies
0
Age
33
XP
156
Country
Vietnam
WOOOO! great day guys. After all the despair, I tried my last luck by contacting Alekmaul's discord account and I got lucky!

Alekmaul PMed me and shared the source code of A5200DS to my email address! This looks like the full source code of latest version (1.6) instead of the old version (1.0) which once available on Portabledev website, so, double awesome!!:D

Alekmaul also wrote that he already replied to "wavemotion" mail including the source code file, but for some reasons "wavemotion" did not received it .. Check Spoiler :P

-------- Message transféré --------
Sujet : Re: A5200DS
Date : Sat, 12 Dec 2020 07:43:02 +0100
De : Alekmaul <[email protected]>
Pour :
Hello,

Great news, Could you share with me the new source code / nds files ?

Also,

You will find in attachment the 5200 emulator, I removed the build dir & file for an smaller zip file.

Tell me if it's ok.

Regards and be well and safe too !

Alek



Le 11/12/2020 à 18:08, a écrit :
Hi Alek,

You don't know me but I recently took your amazing StellaDS and A7800DS emulators and polished them up for the new Twilight Menu++

StellaDS got more than 100% speed improvement and A7800DS saw more than 70% speed boost. Most of this was in better memory handling in the rendering scanline areas. For the A7800DS about 30% of the speedup came in just converting 4 byte read/writes to U32 equivalents.

I've also added touch inputs for paddles and keyboard plus a flicker-free mode which blends the last 2 frame to make games like Yars Revenge and Asteroids look really nice.

Anyway, more to the point: your emulators are amazing and I'm happy to have made some slight improvements. I'd like to make similar improvements to A5200DS but there was no site in which I could find the source code.

Would you be willing to let me have the source code for an attempt? If you would rather not, that's fine too. Be well and be safe!

Anyway, the A5200DS source code file attached to my message. Enjoys!
 

Attachments

  • A5200DS.zip
    287.4 KB · Views: 188
Last edited by cloudstr,

Alexander1970

XP not matters.
Member
Joined
Nov 8, 2018
Messages
14,973
Trophies
3
Location
Austria
XP
2,497
Country
Austria
Hello.1111xmas_wink.gif

Wow! Great day indeed!

And version 1.8 of A7800DS is released as well!

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

That's in really good shape. I'll get the GitHub repository links to Alek so he can see the butcher job I've done to his code :)

And I'll get started on A5200DS improvements soon!



I am pretty sure,no one expected the "Rebirth" from the Atari Emulators for the DS/DS Lite/DSi.
Really awesome,that @alekmaul responded to you.

Has a little of a "Christmas Wonder".xmas_thumbsup.png
 

cloudstr

Active Member
Newcomer
Joined
Apr 11, 2019
Messages
27
Trophies
0
Age
33
XP
156
Country
Vietnam
Wow! Great day indeed!

And version 1.8 of A7800DS is released as well!

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

That's in really good shape. I'll get the GitHub repository links to Alek so he can see the butcher job I've done to his code :)

And I'll get started on A5200DS improvements soon!

Pretty sweet gift for Christmas. :yaynds:

On a side note, had you thought about creating a Discord account and chatting with Alex's nick, in order to discuss and exchange knowledge with him? I think a collaboration between you two would be great for the DS scene. :)
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,341
Country
United States
Couldn't checks for DSi mode be implemented, instead of making a separate build for DS consoles?
Yes but unfortunately the checks are deep in the core CPU emulation. It's in this area that we're trying to shave off one DS CPU cycle if possible because the emulation core is called millions of times per second. To put that kind of check in would defeat the speedups.

I could do the checks at a much higher level and have 2 copies of the core emulation - and then do the check only at the highest level... but that might be more pain than value.

The normal build will run on a DS-LITE. It just won't run fast.
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,341
Country
United States
I'm not ready for another release just yet (working on A5200DS) but finally realized that Robotron was designed to use twin-sticks (figured that out since it's done that way on the 5200 version).

So I patched in the Twin Stick support. Use A,B,X,Y as the firing direction while normal D-Pad controls Robotron. Awesome gameplay! You can grab the nightly build (not the released version) if you want to try it. https://github.com/wavemotion-dave/A7800DS
 

wavemotion

Benign Geek
OP
Member
Joined
Nov 23, 2020
Messages
916
Trophies
1
XP
7,341
Country
United States
The screen scaling on this seems off. It cuts off the bottom and top of my screen by a few pixels.
It's true. The DS has 192 pixels of vertical resolution. The Atari 7800 has up to 260 (but not all games use the full resolution - most use between 220 and 240). So in order to not lose pixels in the playfield, I had to force a few pixels on the top and bottom to be outside the view area. You can use the Left and Right shoulder buttons to scroll up and down but 99% of the time there isn't any useful information in those pixels. So I sacrifice those pixels in order to display more "useful pixels" in the gameplay area. Otherwise pixels go missing in the middle of the play-field (laser shots just "disappear", etc) and that's not fun.

It's always a series of tradeoffs when the resolutions don't mesh.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Maximumbeans @ Maximumbeans: butte