wavemotion-dave / A8DS

A8DS An Atari 8-bit Computer Emulator for the DS/DSi and includes virtually anything the Atari 8-bit computers can run.
GNU General Public License v2.0
25 stars 2 forks source link

A8DS

A8DS is an Atari 8-bit computer emulator for the DS/DSi. It targets the 800XL / 130XE systems and various hardware extensions to increase the memory. The stock 800XL had 64KB of RAM. The default A8DS configuration is an XL/XE machine with 128KB of RAM which will run most of the 8-bit library. Other memory configurations are available from 48K up to 1088K which is enough to run nearly the entire 8-bit line up of games on the DS/DSi.

The emulator runs cart dumps (ROM or CAR types), executable images (XEX) or disk images (ATR or ATX) which are the most popular "ROM" types for emulators. The goal here is to make this as simple as possible - point to the 8-bit Atari game/program you want to run and off it goes!

A8DS

Features :

Optional BIOS ROMs

There is a built-in Altirra BIOS (thanks to Avery Lee) which is reasonably compatible with many games. However, a few games will require the original ATARI BIOS - and, unfortunately, there were many variations of those BIOS over the years to support various Atari computer models released over a span of a decade.

A8DS supports 3 optional (but highly recommended) Atari BIOS and BASIC files as follows (with their CRC32):

You can use other versions of these BIOS files, but these are the ones that I'm testing/running with.

You can install zero, one or more of these files and if you want to use these real ROMs they must reside in the same folder as the A8DS.NDS emulator or you can place your BIOS files in /roms/bios or /data/bios) and these files must be exactly so named as shown above. These files are loaded into memory when the emulator starts and remain available for the entire emulation session. Again, if you don't have a real BIOS, a generic but excellent one is provided from Avery Lee who made Altirra which is released as open-source software. Also optional is ataribas.rom for the 8K basic program. If not supplied, the built-in Altirra BASIC 1.58 is used.

I've not done exhaustive testing, but in many cases I find the Altirra BIOS does a great job as a replacement for the Atari OS/BASIC roms. However, for maximum compatibility, it is recommended you find the above OS/BASIC roms.

Do not ask me about rom files, you will be promptly ignored. A search with Google will certainly help you.

Copyright:

A8DS - Atari 8-bit Emulator designed to run on the DS/DSi is Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)

Copying and distribution of this emulator, its source code and associated readme files, with or without modification, are permitted in any medium without royalty provided this full copyright notice (including the Atari800 one below) is used and wavemotion-dave, alekmaul (original port), Atari800 team (for the original source) and Avery Lee (Altirra OS) are credited and thanked profusely.

The A8DS emulator is offered as-is, without any warranty.

Since much of the original codebase came from the Atari800 project, and since that project is released under the GPL V2, this program and source must also be distributed using that same licensing model. See COPYING for the full license but the original Atari800 copyright notice is retained below:

Atari800 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Atari800 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Atari800; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Credits:

Additional Details :

Games generally run full-speed with just a handful of exceptions - most notably on the older DS hardware or when running from a flash cart (R4 or similar) which won't give you access to a DSi 2X CPU mode. If you load a game and it doesn't load properly or you get a message at the bottom of the screen after loading - it usually means that the game requires some other hardware configuration to run. See the Troubleshooting guide further below for more tips to try and get a game running. I'll try to improve compatibility as time permits. Not every game runs with this emulator - but 90% will given a little elbow-grease to configure things right.

The emulator supports multi-disk games. When you need to load a subsequent disk for a game, just use the Y button to disable Boot-Load which will simply insert the new disk and you can continue to run. Not all games will utilize a 2nd disk drive but D2: is available for those games that do. It's handy to have a few blank 90K single-sided disks available on your setup which you can find easily online - these can be used as save disks.

The .ATR disk support handles up to 360K disks (it will probably work with larger disks, but has not been extensively tested beyond 360K).

The emulator has the built-in Altirra BASIC 1.58 which is a drop-in replacement for the Atari Basic Rev C. Normally you can leave this disabled but a few games do require the BASIC cart to be present and you can toggle this with the START button when you load a game. Be aware that the Altirra BASIC is faster than normal ATARI BASIC and so games might run at the wrong speed unless you're using the actual ATARI REV C rom.

A8DS emulates a Real-Time clock mostly used for SpartaDOS X.

Cartridge support was added with A8DS 3.1 and later. You can load .CAR and .ROM files (using the XEX button).

The following cartridge layouts are supported:

If you're using cartridge files, it is suggested you use .CAR files which contain type information to properly load up the cartirdge. Bare .ROM files have ambiguities that are not always auto-detected by the emulator and as such will not always load correctly. You can go into the GEAR/Options menu to force a cartridge type and save it for that game.

Missing :

The .ATX support is included but not fully tested so compatibility may be lower. In order to get proper speed on the older DS-LITE and DS-PHAT hardware, there is a Frame Skip option that defaults to ON for the older hardware (and OFF for the DSi or above). This is not perfect - some games will not be happy to have frames skipped as collisions are skipped in those frames. Notably: Caverns of Mars, Jumpman and Buried Bucks will not run right with Frame Skip ON. But this does render most games playable on older hardware. If a game is particularly struggling to keep up on older hardware, there is an experimental 'Aggressive' frameskip which should help... but use with caution.

Remember, emulation is rarely perfect. Further, this is a portable implementation of an Atari 8-bit emulator on a limited resource system (67MHz CPU and 4MB of memory) so it won't match the amazing output of something like Altirra. If you're looking for the best in emulation accuracy - Altirra is going to be what you're after. But if you want to enjoy a wide variety of classic 8-bit gaming on your DS/DSi handheld - A8DS will work nicely.

Known Issues :

Troubleshooting :

Most games run as-is. Pick game, load game, play game, enjoy game.

If a game crashes (crash message shows at bottom of screen or game does not otherwise run properly), check these in the order they are shown:

  1. Try turning BASIC ON - some games (even a handful of well-known commercial games) require the BASIC cartridge be enabled. If the game runs but is too fast with BASIC on, use the Atari Rev C Basic (slower but should run at proper speed).
  2. If BASIC ON didn't do the trick, turn it back off and switch from the ALTIRRA OS to the real ATARI XL OS (you will need atarixl.rom in the same directory as the emulator). Some games don't play nice unless you have the original Atari BIOS.
  3. Next try switching from NTSC to PAL or vice-versa and restart the game.
  4. A few older games require the older Atari 800 48k machine and Atari OS-B. If you have atariosb.rom where your emulator is located, you can try selecting this as the OS of choice.
  5. Lastly, try switching the DISKS SPEEDUP option to OFF to slow down I/O. Some games check this as a form of basic copy-protection to ensure you're running from a legit disk.

With those tips, you should be able to get most games running. There are still a few odd games will not run with the emulator - such is life!

Installation :

DS vs DSi vs DSi XL/LL :

The original DS-Lite or DS-Phat require an R4 card to run homebrews. With this setup you will be running in DS compatibility mode and emulator will default to a moderate level of frameskip. For the DSi or DSi XL/LL we can run just about everything full speed without frameskip. The XL/LL has a slightly slower decay on the LCD and it more closely mimics the phosphor fade of a TV. This helps with games that use small bullets - something like Centipede can be a little harder to see on the original DSi as the thin pixel shot fades quickly as it moves. You can somewhat compensate for this by increasing your screen brightness. For the DSi, I find a screen brightness of 4 to offer reasonably good visibility. The XL/LL will generally operate just as well with a brightness of 2 or 3.

Screen resolution on a DS/DSi/XL/LL is always fixed at 256x192 pixels. The Atari 8-bit resolution tends to be larger - usually 320 horizontally and they often utilize a few more pixels vertically depending on the game. Use the Left/Right shoulder buttons along with the D-Pad to shift/scale the screen to your liking. Once you get the screen where you want - go into the GEAR icon and press START to save the options (including the screen position/scaling) on a per-game basis.

Configuration :

Global Options can now be set - before you load a game, use the GEAR icon to set and save your options that will be applied to new games going forward (you can still override on a per-game basis).

Using the X button, you can go to a second menu of options mostly for key handling. This menu allows you to map any DS key to any of the A8DS functions (joystick, keyboard, console switches and a few 'meta' commands such as smooth scrolling the screen some number of pixels).

Screen Scaling and Smooth Scrolling :

An NTSC Atari 800 uses a video chip that outputs 320 x 192 (nominal). Many games utilize the overscan and underscan areas. Further, PAL systems utilize more scanlines. This is unfortunate for our hero the DS/DSi which has a fixed resolution of 256x192. As such, the system must scale the video image down - losing pixel rows and columns as it does so. A8DS allows for some help in this department - you can use the Gear/Settings to tweak the scaling and offsets to get as many usable pixels onto the screen (for example, some games may utilize a "sky" or "ground" area that isn't critical for gameplay and can safely be off-screen).

One other trick is the use of Smooth Scroll. You can assign to any DS key (I usually use the X and Y keys) one of the following 'meta' functions:

This really helps games where there might be some score other infrequently referenced information at the top/bottom of the screen. Witness here Caverns of Mars which I've mapped to show the entire screen minus the bottom row of text... using VERTICAL+ I can press the X button to quickly glance at the bottom line and let it scroll back up during gameplay.

Caverns of Mars Caverns of Mars

Lastly - if a game was released for both NTSC and PAL and does not utilize the same number of visible scanlines, you're usually better off with the NTSC versions on the DS handheld. The reason is simple: you are less likely to have to scale and drop pixel rows with an NTSC output. However, with the use of scaling and smooth scrolling, you should be able to get workable versions of games in either TV standard.

Default Controller Mapping :

Buttons can be re-configured in the Options (GEAR icon... press X for the keyboard map area)

Tap the XEX icon or the Disk Drive to load a new game or the Door/Exit button to quit the emulator.

Saving and Restoring Emulator State :

A8DS has the ability to save memory/cpu and restore it so you can snap out a save state and restore it back. Use the icons on the main screen. The DOWN arrow icon saves state (with confirmation). The UP arrow icon restores state (with confirmation). The .sav files have the same name as the game/rom you are playing and are stored in the 'sav' folder under where you keep your game roms. Note: the emulator does not save startup information so you should let any game come up to the natural title screen before trying to restore state.

Compile Instructions :

I'm using the following:

I use Ubuntu and the Pacman repositories (devkitpro-pacman version 6.0.1-2). I'm told it should also build under Windows but I've never done it and don't know how.

If you try to build on a newer gcc, you will likely find it bloats the code a bit and you'll run out of ITCM_CODE memory. If this happens, first try pulling some of the ITCM_CODE declarations in and around the Antic.c module (try to leave the one in CPU as it has a big impact on performance).


History :

V3.8a : 12-Jan-2024 by wavemotion-dave

V3.8 : 03-Jan-2024 by wavemotion-dave

V3.7a : 17-June-2023 by wavemotion-dave

V3.7 : 04-June-2023 by wavemotion-dave

V3.6a : 30-May-2023 by wavemotion-dave

V3.6 : 29-May-2023 by wavemotion-dave

V3.5 : 22-May-2023 by wavemotion-dave

V3.4 : 16-May-2023 by wavemotion-dave

V3.3 : 15-May-2023 by wavemotion-dave

V3.2 : 13-May-2023 by wavemotion-dave

V3.1 : 08-May-2023 by wavemotion-dave

V3.0 : 05-May-2023 by wavemotion-dave

V2.9 : 12-Dec-2021 by wavemotion-dave

V2.8 : 30-Nov-2021 by wavemotion-dave

V2.7 : 04-Nov-2021 by wavemotion-dave

V2.6 : 11-Jul-2021 by wavemotion-dave

V2.5 : 08-Apr-2021 by wavemotion-dave

V2.4 : 02-Apr-2021 by wavemotion-dave

V2.3 : 31-Mar-2021 by wavemotion-dave

V2.2 : 25-Mar-2021 by wavemotion-dave

V2.1 : 21-Mar-2021 by wavemotion-dave

V2.0 : 19-Mar-2021 by wavemotion-dave

V1.9 : 06-Mar-2021 by wavemotion-dave

V1.8 : 25-Feb-2021 by wavemotion-dave

V1.7 : 18-Feb-2021 by wavemotion-dave

V1.6 : 13-Feb-2021 by wavemotion-dave

V1.5 : 10-Feb-2021 by wavemotion-dave

V1.4 : 08-Feb-2021 by wavemotion-dave

V1.3 : 08-Feb-2021 by wavemotion-dave

V1.2 : 06-Feb-2021 by wavemotion-dave

V1.1 : 03-Feb-2021 by wavemotion-dave

V1.0 : 02-Feb-2021 by wavemotion-dave

V0.9 : 31-Jan-2021 by wavemotion-dave

V0.8 : 30-Jan-2021 by wavemotion-dave