Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

lr-atari800, 5200, artifacting, BASIC, and other guidance



  • EDIT: There is now a script, found about five replies below, which will:

    • Automatically launch PAL games in PAL.
    • Automatically enable BASIC for games that require it.
    • Let you choose from the four NTSC artifacting modes at the runcommand menu by setting an emulator for a specific rom.
    • Automatically launch games that requires OSa or OSb with the correct settings

    If you want an authentic Atari 8-bit experience with minimal fuss, give it a try. Original posts follow:

    As those of you who have tried to get Atari 8-bit computers and Atari 5200 going at the same time know, the Atari emu can be picky.

    Here's what's going on:

    The lr-atari800 core has a tiny handful of options implemented in the GUI reached by pressing Select+X. These change the following:

    • Whether to boot from cassette (almost certainly no, any roms you have in .CAS format should also be available in one of the various disk formats).
    • Whether to poll the keyboard (yes)
    • NTSC or PAL (to taste, but I'm going to make a case for NTSC as your default setting)
    • Internal resolution, leave it as is
    • SIO acceleration (turn this on, it speeds game loading from all disk formats. Occasionally, you may hit something that won't load with it on, but I haven't).
    • System (either one of the 8 bit models, or the 5200). You almost certainly want to select a system with greater than 16K RAM, so don't pick the 400 or the 600XL.
    • Whether internal BASIC is disabled. For most things, you want this set to disabled. See below.
    • Autodetect 5200 cart. There are like 8 different types of 5200 carts, and you may have seen the menu that pops up asking you to identify what your cart is. I would leave this disabled, and follow the instructions below.
    • Artifacting: this enables or disables a core-wide setting to replicate a quirk of the Atari's NTSC signal which allowed it to display more colors than two when in high-res mode.

    All of these are stored in /opt/retropie/configs/all/retroarch-core-options.cfg. But these are a TINY FRACTION of the options that the emulator lets you set. The bulk of them are set via the emulator's internal menu which is accessed by pressing F1 (and which is also mapped by default to the right shoulder button).

    Any options set in Retroarch will always override the options set in the emulator's internal menu. It's quite common to look at the two menus and see that they don't at all match.

    Many of the options that are present on the emulator menu are critical, and not implemented in Retroarch. Among the key bits of functionality you may want:

    • Load a palette. Atari800 supports .act files that are carefully built color palettes that more closely mimic actual Atari colors. These don't seem to be installed on the Pi anywhere, but these can easily be found by downloading the Windows version of the emu, and then can be placed somewhere (I keep mine in /opt/retropie/configs/atari800/act and prefer Real.act with some additional adjustments for vibrancy).
    • Play multi-disk games, which are quite common, including the ability to create and format blank disks for player or map data (Ultima games, Seven Cities of Gold, and many more require the latter). You can do this via the Disk Management menu.
    • Side note: for multidisk games, you may get your hopes up that "Disk Sets" could let you load up all the disks at once direct from the gamelist. Alas, this is not the case. There is no way to load a disk set from the command line in Atari800 standalone, and definitely not in the libretro method of loading libraries. You can make disk sets, but you'd have to come to this menu to load them by hand.
    • Convert pesky 5200 carts. See below in the 5200 section.
    • If you mess about, you may find that you have a cart attached at the same time you have a disk attached. The cart will win. You can use the Cartridge Management menu to eject the cart.

    All of these options are NOT saved in any retroarch config. Instead, they are saved in a file called atari800.cfg which in the libretro version is located in /opt/retropie/configs/atari800. This is also symlinked from ~\.atari800.cfg (so you'll need to ls -a to see it).

    Further, this is the ONLY COPY of this file, which means any settings in it will apply equally to both the Atari 8 bit games AND the Atari 5200.

    GETTING 5200 WORKING

    Fortunately, the biggest thing you want to change between platforms is which machine you are emulating, and this is present in both the atari800.cfg and in the RGUI settings which go in retroarch-core-options.cfg. If you have a a core options file in your atari5200 directory, it will let you have separate settings for just the 5200 system.

    Make sure you have a file called /opt/retropie/configs/atari5200/retroarch-core-options.cfg with this in it:

    atari800_artifacting = "enabled"
    atari800_cassboot = "disabled"
    atari800_internalbasic = "disabled"
    atari800_keyboard = "poll"
    atari800_ntscpal = "NTSC"
    atari800_opt1 = "disabled"
    atari800_opt2 = "disabled"
    atari800_resolution = "336x240"
    atari800_sioaccel = "enabled"
    atari800_system = "5200"
    

    Next problem is "cart types." Often when you boot an Atari 5200 game, it gets stuck at the Atari logo, or just crashes, or it asks you to specify a cart type. There's a bunch of kinds, and they all have to do with how much memory was embedded in the cart, and how many chips that memory was using, and what order the banks were in, etc. There is supposed to be a header on the cart that tells the machine how to interpret it, but lots of cart dumps don't have the header.

    The emulator, though, has the facility to create carts, and this can add the missing header back in. Then you'll never see this menu again. Do this by going to Cartridge Management, Extract ROM from cartridge, save it, then Create Cartridge from ROM image, and select the file you just created. You will be asked which cart type to use. A handy list gathered by forum members is here: https://retropie.org.uk/forum/topic/16556/cartridge-type-code-list-for-atari-5200-games. Be sure to test after making your choice; if it doesn't work, just try another one. Go through the entire 5200 library (it's not that big!) and you'll never get the choose cart menu again. Be sure to have a backup of all your 5200 roms, of course.

    ...and your Atari 5200 stuff should work as well as it can in a 3.1.0 build of Atari800. In particular, don't expect Missile Command, Gorf, and other games that use analog absolute position to work correctly. Atari800 emulates these using a mouse, and I have not been able to get that to work in the libretro core. Let me know if you have (there's also the older build made by @future-child which did a bunch of work on getting Atari 5200 controls working better, but i think it's not actively maintained anymore).

    OK, now on to stuff that non-Atarians probably don't know, which I will post in replies.



  • BASIC

    The Atari 400 and 800 systems ran a Memo Pad when you turned the machine on without loading a program or having a cartridge inserted. The BASIC cart was packed into the box.

    All the XL and XE models came with BASIC built into the machine. This meant that when booting the system, you had to tell the machine "the BASIC cart isn't actually plugged in" whenever you wanted to load anything else. This was accomplished by holding down the Option key while booting (this does not seem to work in lr-atari-800). If you didn't load anything, you ended up instead in a self-test mode. Lastly, carts always disabled BASIC automatically.

    • 400/800 with BASIC: Blue screen with READY. This is BASIC.
    • 400/800 with cart: the cart.
    • 400/800 without BASIC: Memo Pad.
    • 400/800 with .atror .bin or .xex etc: the program
    • XL/XE with BASIC: Blue screen with READY.
    • XL/XE without BASIC: Self-test.
    • XL/XE with cart: the cart.
    • XL/XE with .atror .bin or .xex: likely a crash
    • XL/XE with .atror .bin or .xex and BASIC disabled: the program
    • 5200 without cart: nothing but Atari logo.
    • 5200 with cart: the game.

    Most games you will find for the Atari are machine language, and require that BASIC be disabled. But there were MANY commercial games that were written partially or wholly in BASIC, including many classics.

    Among them:

    • Crush Crumble and Chomp and most other early Epyx games
    • all of the Dunjonquest aka Apshai games
    • lots of SSI turn-based strategy games like Panzer-Jagd
    • the Fantasyland series
    • Floyd of the Jungle
    • Hellcat Ace
    • all the Sierra Hi-Res adventures (Dark Crystal, etc)
    • All the Marc Benioff Artworx adventures, like Gwendolyn
    • A huge pile of games from ANALOG and ANTIC magazines
    • the always-charming "insult AI" Abuse

    These will give you "The Atari computer has crashed!!!" or worse when you try to boot them.

    In the standalone emu, you handle this with a -nobasic command line argument. There are no command line arguments in Retroarch, AFAIK, so instead you need to create game specific option files. Fortunately, disabling and enabling BASIC is a retroarch core option, so you can do this from the GUI. Hit Select-X and navigate to Options, set BASIC to disabled, then use the top line of that screen "save game options file" to save a config file just for that game. Then exit the emu entirely (you can't just restart from the RGUI menu choice). EDIT: if you use the script below, you don't need to do this, all filenames with BASIC in the name will just work. In fact, you might save a game options file that has the wrong value in it by accident, and baffle yourself -- I did it while testing! I would suggest that if you use this script, you NOT save any game overrides.

    (You CAN also enable BASIC via the F1 emulator menu and restart the game, but then you can't save a per-game override.)

    The resulting config file will be saved in /opt/retropie/configs/all/retroarch/config/Atari800 nowhere near your other configs. :) What's more, it will actually basically be a complete copy of your retroarch-core-options.cfg rather than just the one line change.

    That said, I have tested and verified that all you actually need is for the file to have the Atari specific settings in it:

    gamefilename.opt

    atari800_artifacting = "enabled"
    atari800_cassboot = "disabled"
    atari800_internalbasic = "enabled"
    atari800_keyboard = "poll"
    atari800_ntscpal = "NTSC"
    atari800_opt1 = "disabled"
    atari800_opt2 = "disabled"
    atari800_resolution = "336x240"
    atari800_sioaccel = "enabled"
    atari800_system = "130XE (128K)"
    

    Many Atari 8 bit software collections will helpfully tag files that require BASIC for you in the filename. Maybe someone will be inspired to make a little shell script that generates all the .opt files for an Atari800 rom collection based on the filename including the substring... EDIT: not needed anymore if you use the runcommand script below

    TYPICAL FILE FORMATS

    • .atr: an Atari disk image. Typically needs BASIC disabled. You load these from the gamelist, basically you boot the Atari with this in the drive.
    • .dcm and .xfd are two other disk formats that lr-atari800 can read.
    • .cas is an Atari cassette image. It's not listed on the Retropie page, but I'd be surprised if the emu couldn't load it. You can actually boot from a cassette.
    • .rom and .bin are typically cartridges. Note that you can have a disk in the drive AND a cart in the cartridge slot at the same time. Carts always take precedence over disks. Also note that these formats are not the same as a .car file.
    • .a52 and .car are typically Atari 5200 cartridges, but you can find .car Atari 8 bit carts as well. These have header information, because there are over a dozen cart formats with added banks of memory, etc. See "5200" above for how to convert a cart to a bin and back in order to put the right header info on the cart.
    • .bin and .xexare executables. You may also see .com. These are just binary executables, but not entire disk images. You can load these from the gamelist, or from the Disk Operating System, which on an Atari was a menu. Boot a disk with DOS on it (and there were like a dozen different DOSes you could use, often with incompatible disk formats) and you can use the menu to launch the executable. Game compilation disk images often have collections of these.
    • .bas is a BASIC file. You cannot run these directly from the gamelist. You have to load them from disk while in BASIC (use LOAD "D:FILENAME.EXT" and once it loads, type RUN.) Many games consist of a disk image with DOS (a directory listing of the disk contents will show DOS.SYS and DUP.SYS), a BASIC program, and a little executable named AUTORUN.SYS. This basically makes the disk bootable and runs the .BAS program directly. These end up being .atr images that require BASIC.

    See here for way more formats than you would have thought possible: http://www.atarimania.com/faq-atari-400-800-xl-xe-what-file-formats-for-entire-disks-tapes-cartridges-are-there_106.html

    Note that the emu lets you fully manipulate disks! You can accidentally reformat your rom, and it will look the same from the outside. Many games require you to have a blank disk to save player state on. Don't mess up and save your player file over the game! Similarly, quite a lot of "player disks" and "scenario disks" and the like out there actually have people's saved games on them.



  • ARTIFACTING INTRODUCTION

    High resolution graphics mode on Atari 8 bits was a one-color, two luminance mode. You could have one color for the background, and the same color at a different brightness for the pixels drawn.

    However, similar to the Apple II, the Atari supported what is called artifacting. This is a literal "artifact," a graphical glitch, caused by the way the chroma circuits in the original hardware worked. There are some great explanations of why and how it works on AtariAge and similar forums, but suffice it to say:

    Draw one white pixel in an even column next to an empty pixel in an odd column, and it'd come out as color 1.

    Draw one white pixel in an odd column next to an empty pixel in an even column, and it'd come out as color 2.

    Draw two white pixels next to each other, and they'd come out as the true color.

    Draw specific sorts of dithered patterns, and pull tricks with background colors (since the artifact colors blended), and you could get even more colors.

    BUT -- this only worked this way on NTSC. On PAL, the chroma logic is different. There are some PAL artifacts, but by and large, artifacting this way doesn't work on PAL.

    Bottom line? You may have seen a lot of Atari 8 bit games that look like this screenshot from archive.org:

    d9ba5274-5e51-4878-bdaa-0f9073dcfad8-image.png

    But on an NTSC screen on actual hardware, it likely looks like this image from MobyGames:
    451e2582-89a8-46a5-92cc-ccf53fdc83d8-image.png

    The list of games that uses artifacting to get colors is HUGE and includes classics like Lode Runner, Flight Simulator II, the Ultima series, and more.

    NTSC AND PAL

    lr-atari800 defaults to PAL. Which is why the Internet is full of images like the black & white first one, rather than color ones like the second one. These are all generated on emulators set to PAL or with artifacting turned off, by people who have never seen the games on actual hardware.

    Now, there are PAL games that were created in Europe and therefore assumed there wasn't any artifacting. Two good examples are 180, the darts game, and Head Over Heels.

    Here's 180 without artifacting on, the way it was meant to be:
    752e90cb-1ef2-40a8-95af-98050e78fe37-image.png

    And with it on, which is much worse:
    26ef4794-4fe7-419e-ab24-19bd59f88cfe-image.png

    Technically, to get the right version, we should also be in PAL. Here's Head Over Heels in NTSC with artifacting in the emu:

    51d6d410-0fac-4722-a782-27b6ca059450-image.png

    Here it is in NTSC with no artifacting:
    7a075c68-46f4-4179-a450-6e41c43c3600-image.png

    And here it is in PAL with accurate PAL blending turned on:

    49861e7a-7601-4062-b2b9-7a5dfe3c70fc-image.png

    Note the different aspect ratio. If you, like me, have used overlays and a custom viewport size, you won't see an aspect ratio difference, most likely.

    So, not only do we have two different video systems to worry about, but games coded for one will tend to look wrong on the other. The first thing to do is set your lr-atari800 RGUI option to NTSC; the vast majority of well-known games that use this monochrome high-res graphics mode are NTSC games, not PAL games. Just like how BASIC is usually noted in the filename, PAL is also usually noted in the filename, so you can find PAL games and save options just like you did for BASIC games, because PAL vs NTSC is an RGUI option. EDIT: I recommend not doing this, and using the script below instead.

    But here's the bad news.

    THE FOUR ARTIFACTING MODES

    The chroma circuit on the Atari 8 bits evolved a lot over the course of the decade plus that the computers were sold. They started out with a CTIA graphics chip. Then they went to a GTIA graphics chip. Then the circuit itself changed more than once.

    The artifact colors are different on every single one of these.

    In fact, there's even an actual knob to turn on the actual hardware that lets you adjust the tint of the artifacts.

    lr-atari800's core supports

    NTSC:

    • no artifacting
    • blue-brown 1
    • blue-brown 2 (which should actually be called brown-blue)
    • GTIA
    • CTIA

    PAL:

    • no artifacting
    • simple PAL blending
    • accurate PAL blending

    But these detailed options are not available in the RGUI. The libretro core is hardcoded to only use blue-brown 1, I checked the source.

    However, you can use the in-game menu accessed via F1, go to Display Settings, and select

    Video artifacts: old NTSC artifacts
    NTSC artifacting mode: blue/brown 1 (or blue/brown 2, or GTIA, or CTIA).
    

    And these will be saved in /opt/retropie/configs/atari800/atari800.cfg as

    ARTIFACT_NTSC=NTSC-OLD
    ARTIFACT_NTSC_MODE=1
    

    where

    ARTIFACT_NTSC_MODE=0  // off
    ARTIFACT_NTSC_MODE=1  // blue/brown 1
    ARTIFACT_NTSC_MODE=2  // blue/brown 2
    ARTIFACT_NTSC_MODE=3  // GTIA
    ARTIFACT_NTSC_MODE=4  // CTIA
    

    (Sorry, haven't done the same experiment for PAL to get the index numbers, but I suggest you just set those to on and accurate because they look fine that way).

    Now, here's the problem. First of all, you'll have to change this by hand every time you put in a different game. And secondly...

    • CTIA gives, more or less, green and blue-to-purple depending on your tint.
    • GTIA gives, more or less, the reverse: what was green is blue, what was blue is green.
    • Blue/brown 2 and blue/brown 1 are likewise inverse of one another. And brown is a misnomer; on a well-saturated screen, it looked closer to red.

    The fact of the matter is that on real hardware, you don't know what you will get, but at the same time, at given periods of the hardware existing, developers clearly assumed one set of artifacting colors or the other.

    Ultima III with artifacting off, or in PAL:
    b78d3986-04ca-4416-815d-92fd977e4f6e-image.png

    CTIA, note the green flame from the dragon:
    3e212af3-ec6a-4ab0-991b-7aeb6bbff6c6-image.png

    GTIA, now the flame is purplish red:
    b5f8ee65-6279-422c-b07f-0ff1c44b0ab3-image.png

    Brown/blue 2, flame is blue:
    991184a1-4eb3-4306-89f0-a491f7318a02-image.png

    Brown/blue 1, flame is red:
    9b214cf7-8d31-4f0b-a1fb-fe706b009b6b-image.png

    If you want an accurate experience that is closest to what the developers intended, you need to know what it was meant for. Luckily, we can compare to games on other platforms, screenshots on the box, or even cover art, to figure that out in many cases. For example, It's safe to say that in 3D Red Baron, the enemy plane is probably supposed to be red. In Ultima games, we probably want to aim for blue water and green grass, which is what the developers intended, but it's hard to get that setting with what we have exposed in lr-atari800.

    OTHER COLOR ADJUSTMENTS

    There are several video adjustment settings presented in the emulator menu, and all of them are broken. Again, the ones to not mess with even in config files: "New NTSC artifacts" renders incorrectly in all modes. "NTSC full filter" likewise renders incorrectly, and also doesn't properly read and write settings to the atari.cfg file when you make adjustments under "NTSC filter settings."

    However, things that do work, sorta:

    • The various "color preset" sliders are all broken; when you make a choice, they will jump to -1 or 1, which will be wrong. (Again, you can use Restore Default Colors to put these back). But you can edit the atari.cfg file, put in values, and they will be read correctly. There have been various posts around the forums on what makes for good values there. Note that the GTIA value here is, more or less, the same knob for adjusting the chroma circuit that the full NTSC filter provides. However, it interacts with the Tint slider in somewhat unpredictable ways.

    • There are also a few default configs: Vibrant, deep black, and standard. vibrant is more saturated, deep black does what it says. Both are quite nice though a tad ahistorical, particularly when coupled with a palette.

    • External palettes DO work, and will affect artifacting colors. Just note that the "Also adjust external palette" option needs to be set if you want to use both a palette and these controls at the same time.

    One option for messing with the sliders and seeing what you are doing is to launch the standalone emulator, where these functions do work, and once you have found something you like, paste the values in. Alas, this does not work for the full NTSC filter, which is what we would totally all be using if we could.



  • NTSC FILTER and "NEW ARTIFACTING

    There are additional options for artifacting visible in the F1 emulator menu. They don't work in lr-atari800. The "new artifacting" settings simply render wrong. The "NTSC filter" settings have sliders that don't work, turning it on will blow out the colors. (You can fix this by going to Display Settings->Restore Default Colors). Even though the NTSC filter settings will be written to the config, editing them there will still not work, so you should not bother turning this on.

    What the standalone emu can do (version 4.1.0, though I am unsure when the full NTSC filter was implemented) is bypass the hacky "four choices of artifact settings" and go to a true analog system that emulates NTSC circuitry. This means it gains an analog slider called burst phase, which is the equivalent of that knob that adjusted the colors.

    Its defaults are weird:
    853e3152-47ac-432b-a3a2-2dab4d8b7824-image.png

    Supposedly, burst filter around -1, -.5, .5, and 1 are reasonable typical values. But by running the NTSC filter, I can get what Richard and Chuck probably actually meant for U3 by setting burst phase to around -0.76, which gives me green grass and blue water. It's close to what we get with mode 1 (blue/brown 1).

    10b8a2b5-7ef3-4d06-9e8c-b6cb5c4b5c0b-image.png

    The four settings we can use in lr-atari cannot, alas, quite replicate this.
    Off:
    9f83b762-3793-4806-9dc6-193019f4ac38-image.png
    mode 1: 458e01a1-4986-4ff3-b4cc-243fbb0de955-image.png
    Mode 2: 4bbff3df-52b9-49bd-ba5a-6a630f3e238f-image.png
    GTIA: 64d1df4e-e359-4f3a-923c-7cb6e87f7c58-image.png
    CTIA: 81609d0c-67fe-49e4-ab06-fd07bbd20517-image.png

    CHOOSING THE RIGHT ARTIFACTING MODE

    As a rule of thumb, you'll find that most games are either mode 1 or GTIA. The CTIA chip was not around for very long. Some of the very early games, like The Dark Crystal, actually show you an artifacted square and ask you what color you see, and change their artifacting based on your answer.

    You will also find that some games have hacks to make them color by changing them to use a graphics mode 15 that only existed on XL/XE machines. Among the games you can find with this hack are Lode Runner, Choplifter, and Drol. Frankly, they don't look as good, because they have half the horizontal resolution. But they tell us what the colors ought to be like.

    Here's my best stab at what you should pick from what's available in lr-atari800:

    Default for all games should be artifacting off, because having it on will mess up text display in color games. This is not at all how it was on the original hardware. This would affect games like

    • Archon
    • M.U.L.E.

    Some games that you might think use artifacting but will look better with it off include

    • Caverns of Callisto
    • The Nightmares
    • Transylvania (check out that font at the bottom!)

    Where hi res text mode was used mixed in with the graphics.

    Hi res PAL games should have game options files with PAL set, and accurate PAL blending on (mode 2).

    • 180
    • Head Over Heels

    Artifacting games should have a game options file with artifacting turned on at the RGUI level, set to NTSC. In the atari800.cfg, you should have

    ARTIFACT_NTSC=NTSC-OLD
    ARTIFACT_NTSC_MODE=1
    

    ...and use the .opt file to turn artifacting on and off, which will leave these settings intact. EDIT: If you use the script below, this is not required anymore. This will cover most games looking right, such as

    • AE by Broderbund
    • Choplifter by Broderbund (cart and disk; the cart by Atari uses 4-color Gr. 15)
    • Crossfire (disk version)
    • Dark Crystal
    • Das U Boot pinball
    • David's Midnight Magic by Atari (cart.)
    • David's Midnight Magic by Broderbund (disk)
    • Diamond Mine
    • Dragon's Keep
    • Drol
    • Escape From Vulcan's Island
    • Gwendolyn
    • Hard Hat Mack
    • High Rise by Joe Calabrese (not the other one)
    • Lode Runner by Atari
    • Lode Runner by Broderbund (disk)
    • Lunar Leeper
    • Malpass
    • Mission Asteroid
    • Ogre
    • Pensate
    • Pinball Construction Set (and all pinballs created with it!)
    • Pool 1.5
    • Pool 400
    • The Wizard and the Princess
    • Ultima 2
    • Ultima 3
    • Ultima 4
    • Ulysses and the Golden Fleece

    Unfortunately, there's no way I know of to save alternate atari800.cfg files for the games that look better in other modes. EDIT: The script below basically creates this alternate file on the fly.

    Correct in mode 2:

    • 221B Baker St (the bottom display uses artifacting; it's correct when Sherlock's colors here match his colors in the iso map above).
    • 3d Red Baron (assuming you are fighting the Red Baron, his plane should be red not blue)
    • Flight Simulator II (the control panel uses artifacting, and the level gauge is the clearest use of it; the sky in the level gauge should be blue)
    • Fooblitzky (I went off the color of the roads and crosswalks)
    • Marauder (based on box shots and other platforms)
    • Mr. Do (Only for EXTRA and at bottom of screen -- should match the color graphics parts of the screen)
    • Night Mission Pinball (based on screenshots and box images)
    • Threshold (based on screenshots from other platforms)

    Correct in GTIA:

    • AutoDuel (other platforms show the blocked hexes as red)
    • Aztec (bit of a guess here based on the release date and the color on other platforms)
    • Bug Off (green stems for the flowers)
    • Twerps (the alien on the box is green; if you have the version with the title screen, you get a large full screen alien, and this is only mode he's green in).
    • Jawbreaker could go either GTIA or CTIA, I'm unsure.

    CTIA:

    • Micro League Baseball is supposed to have a green baseball field, not purple, red, or blue.

    ADDING THE MISSING ARTIFACTING OPTIONS

    A request: if anyone can come up with a clever solution for changing the value of ARTIFACT_NTSC_MODE as part of the loading process for the game, please let me know. I tried setting up separate emulators for it, but they all end up referencing the same atari.cfg file. I suspect that the only fix might be to actually back up the old file, copy in one with the one line change (or maybe sed it in?) in a runcommand shell script. EDIT: done, see below

    Otherwise, I think the only other choice is to hope that developers on the upstream lr-atari800 core add this specific option line to the RGUI interface. It's currently there, but basically ignored and hardcoded, in the block starting at line 302 in libretro-atari800/libretro/libretro-core.c.

       var.key = "atari800_artifacting";
       var.value = NULL;
    
       if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
         {
           if (strcmp(var.value, "enabled") == 0)
    	 {
    	   if (Atari800_tv_mode == Atari800_TV_NTSC)
    	     {
    	       ARTIFACT_Set(ARTIFACT_NTSC_OLD);
    	       ARTIFACT_SetTVMode(Atari800_TV_NTSC);
    	     }
    	   else if (Atari800_tv_mode == Atari800_TV_PAL)
    	     {
    	       ARTIFACT_Set(ARTIFACT_NONE); // PAL Blending has been flipped off in config for now.
    	       ARTIFACT_SetTVMode(Atari800_TV_PAL);
    	     }
    	 }
           else if (strcmp(var.value, "disabled") == 0)
    	 {
    	   if (Atari800_tv_mode == Atari800_TV_NTSC)
    	     {
    	       ARTIFACT_Set(ARTIFACT_NONE);
    	       ARTIFACT_SetTVMode(Atari800_TV_NTSC);
    	     }
    	   else if (Atari800_tv_mode == Atari800_TV_PAL)
    	     {
    	       ARTIFACT_Set(ARTIFACT_NONE);
    	       ARTIFACT_SetTVMode(Atari800_TV_PAL);
    	     }	   
    	 }
    }```
    
    Anyway... time for bed here, hope this is helpful to anyone else getting Atari 8 bit emulation going on their Retropie setups.


  • OSa AND OSb

    I neglected to mention OSa and OSb. Suffice to say, you'll see this on some filenames too. It basically means that it will or will not work on an XL/XE. Try swapping the machine to the other (from 800 to 130XE perhaps, or the other way around). Once again, you can save custom game options from RGUI for this, because this is an option saved in retroarch-core-options.cfg.

    In short, the original OS (OSa) had some bugs. Many later games will have issues on OSa. However, there's a tiny handful of games that don't work without the bugs. Hence OSb. There's also the 1200XL OS, which has additional minor incompatibilities, and the 5200 OS. On top of that, several of these exist in NTSC and PAL formats.

    Atari released a Translator Disk that actually allowed you to overwrite the differences in RAM before loading a game, so you could get older games to run on newer hardware.

    lr-atari800 doesn't even support all the different BIOSes known to exist, fwiw, but it covers enough of a spread that you should be able to get stuff working.



  • I just want to say that while I was not an Atari owner during those days - I started with the ZX Spectrum - this was an awesomely thorough read. Thank you for putting this together!



  • @pjft you're welcome. I hope it helps out anyone struggling with these platforms in Retropie, or at the least lets them experience some of the key games that otherwise would be confusingly hard to launch.

    It's a pity we don't have the 4.1.0 version in libretro... There'd be over 400 commits to integrate to bring lr-atari800 up to date, but it looks like a lot of them are pretty minor. Still a lot of work.

    Patching the lack of the artifacting settings is probably very doable. Unfortunately, work is swallowing me whole, else I'd be very tempted to take a stab at it.

    Making a script to generate .opt files for games that should be PAL or need BASIC is small enough I am tempted to do it one of these evenings.

    I wonder, if I had four alternate emus, each with a runcommand script to basically

    sed 'ARTIFACT_NTSC_MODE=./ARTIFACT_NTSC_MODE=1/g' atari800.cfg 
    

    ... then it's an emu-specific launch operation. One for each of the four modes, plus the default emu would replace with 0. Then you can just pick an emu at the usual runcommand menu and save per rom configs. Hmm.



  • I have this working. It’s a runcommand-onstart script that modifies retroarch-core-options.cfg and atari800.cfg before launching the emu, based on what emu you selected. I just added four new names to atari800/emulators.cfg and now you can pick one of the four artifacting modes from the runcommand launch menu and assign it to a given rom. They all launch the same emu, but with different config options.

    I wish I didn’t have to modify the core options file, but it overrides atari.cfg. You can in theory turn artifacting on and off via a game options file, and then use this method for the artifacting mode, but it seems cleaner to just do it all one way.

    On the other hand, doing it this way means that you can in theory change any of the options, basically restoring the ability to do command line switches, as long as you are willing to create a separate emulator.cfg line per combination of switches.

    Still testing but I will post it once I feel confident in it.



  • The following script will:

    • Automatically launch PAL games in PAL.
    • Automatically enable BASIC for games that require it.
    • Let you choose from the four NTSC artifacting modes at the runcommand menu by setting an emulator for a specific rom.
    • Automatically set the system to OSa for games that require it.

    INSTALLATION

    1. Back up these files, or live dangerously. No warranties express or implied, don't blame me, etc.
    • /opt/retropie/configs/atari800/atari800.cfg
    • /opt/retropie/configs/all/retroarch-core-options.cfg
    • /opt/retropie/configs/atari800/emulators.cfg
    1. Edit opt/retropie/configs/atari800/emulators.cfg so that it has four new emulators. Mine now looks like this. The names matter.
    lr-atari800 = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-atari800/atari800_libretro.so --config /opt/retropie/configs/atari800/retroarch.cfg %ROM%"
    lr-atari800-ctia = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-atari800/atari800_libretro.so --config /opt/retropie/configs/atari800/retroarch.cfg %ROM%"
    lr-atari800-gtia = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-atari800/atari800_libretro.so --config /opt/retropie/configs/atari800/retroarch.cfg %ROM%"
    lr-atari800-artifacting1 = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-atari800/atari800_libretro.so --config /opt/retropie/configs/atari800/retroarch.cfg %ROM%"
    lr-atari800-artifacting2 = "/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-atari800/atari800_libretro.so --config /opt/retropie/configs/atari800/retroarch.cfg %ROM%"
    default = "lr-atari800"
    
    1. Ensure that your Atari 8-bit roms follow the naming convention where you see (PD)(GB)[k-file][BASIC] etc in the filenames. For example:
    Dreadnought Megastars (1990)(Byte Back)(PAL)(GB)[k-file].atr  // this game will launch in PAL
    
    Beer Shot (1994)(Bednar, Kamil)(PD)[BASIC].atr // this game will enable BASIC
    
    Head over Heels (19xx)(Hit Squad)(GB)[h Homesoft][k-file].atr // this game will run with default of no BASIC and NTSC
    
    Ice Cap (19xx)(MacIlwee, Steven)(GB)[req OSa].atr  // this game will run on a 400/800 with OSa
    
    Galactic Quest (1981)(Crystalware)(US)[req OSa][BASIC].atr // this game will set the system to 400/800 OSa, and will also set BASIC to Rev. A 
    
    1. Obtain a copy of the BIOS for Atari BASIC Revision A. This is needed for games that require OSa and happen to be in BASIC. Revision A BASIC has an md5 of a4dc52536d526ecc51ea857b9fa2b90f and is not typically called ATARIBAS.ROM. Place it in ~/RetroPie/BIOS -- be sure to give it a different filename than the normal Atari BASIC BIOS. Either add this filename to atari.cfg like this:
    ROM_BASIC_A=/home/pi/RetroPie/BIOS/BASIC Revision A (19xx)(Atari)(400-800).rom
    

    Or go into the emulator menu and search the ROM system directory again, and then save the configuration file. Verify that on the menu, you are able to select Basic Rev. A.

    1. Edit /opt/retropie/configs/all/runcommand-onstart.sh to include the script found at https://github.com/raphkoster/lr-atari800-runcommand-onstart. Note that if you already have this script, you only need to insert the part starting at # apply Atari 8-bit specific patches...

    2. Test!

    • Try a game like Crush, Crumble and Chomp. It normally would not load because it requires BASIC to be enabled. Now it will. It might need you to hit the fire button when it first starts and sits at the blue screen.
    • But it looks ugly! Yup, it needs artifacting.
    • Exit the game, and relaunch it. Now enter the runcommand menu by tapping space bar or a button.
    • Leave option 1, "Select default emulator for atari800," set at lr-atari800.
    • Select option 2, "Select emulator for ROM." You should have several new options there. Select lr-atari800-artifacting1
    • Exit without launching (if you just launch, the setting won't apply until the next time, for some reason)
    • Launch the game again... you have blue water!
    • Try Drol, also set to artifacting1. You should have red scorpions.
    • Try Lode Runner with artifacting1. You should have blue bricks.
    • Try Choplifter (not "Choplifter!" which is the color XE cart, but the original Broderbund one), with artifacting1. Dark blue sky, green ground.
    • Try Micro League Baseball set to lr-atari800-ctia... the outfield should be green.
    • Try Mr. Do! set to artifacting2. Your lives at the bottom of the screen should be red just like your guy in the playfield.
    • Try Bug Off using lr-atari800-gtia. The flower stems and leaves will be green.
    • Try Head Over Heels. This PAL game should be crisp and clear with no artifacts.
    • Try Clonus, Micro Chess, TwoGun, IceCap, or another OSa game. The game should boot.
    • Try Eggnapper or other OSb games, they should boot regardless of your machine settings.

    Enjoy the more authentic Atari 8-bit experience!



  • PS, in theory, we could also detect [OSb] or [OSa] and launch with the appropriate machine. There are a few disk images out there that only work with OSb or OSa. It's late though, and I have to stop for today. But it would work the same way, only you need to switch machines to 400/800.

    Also -- the above script can be hacked to work with atari800 as well. You need to remove all the sed lines that affect the core options file, retaining only those that affect atari800.cfg. Probably need to change the path to ~/.atari.cfg, IIRC. And of course, change the emulator name from lr-atari800 to just atari800.



  • I know I'm the only one adding to this thread pretty much, but I just edited a bunch of the preceding, and included new sections explaining OS revisions, the multiplicity of confusing file formats, and a bunch of other things.

    This is far too much to go on the Wiki, but maybe a link to here would be appropriate?



  • @rkoster are you sure this wouldn't deserve its own section in the documentation? It's as detailed as it gets and comparable in depth to things like the xboxdrv mapping guide that @mediamogul wrote at one point, for instance.

    Certainly a link would be good, but your call, really.



  • @pjft Oh, I’m fine with it being in the wiki. Don’t know what the process is for that though!



  • @rkoster I believe it's all on GitHub, but I imagine someone who's actually documented their own RetroPie contributions (shame on me) would be able to advise better :)

    https://github.com/RetroPie/RetroPie-Setup/wiki/Atari-2600



  • @pjft Well, I added a pile of stuff to the Wiki, including stuff that isn't in the thread (BIOS info mostly).



  • The script has been updated to handle automatically providing the correct settings for OSa games [edit: and OSb games]. This involves setting both the system to Rev. A 400/800, and setting the BASIC revision to A. You will need to find the BASIC Rev. A rom file and place it in the BIOS folder for that part to work correctly; the instructions above have been amended to walk you through that and provide the correct md5 hash for that version of BASIC.

    If you installed the usual recommended ATARIOSB.ROM, you don't need to install anything for the OSb games.

    It's also now on github at https://github.com/raphkoster/lr-atari800-runcommand-onstart



  • I fixed a bug (typo, really) with the handling of OSb games. Updated script is on github.



  • @rkoster wow this is great. Thanks. Haven’t read it through completely yet as I’m away on business. But what about games like, one of my favourites, Spelunker that require some keyboard commands like space bar for phantom blaster and keys to launch flares and dynamite. Can that be set on say my shanwan ps3 controller to use it? Basically all others work fine as Atari Joystick. I do have a Logitech wireless keyboard with mouse pad so I could use that in front of me as well for extra commands. But would be fiddly if could all be done with the controller.



  • @PCKid Well, it's a big ask to get a computer to work fully with a controller, of course. There's no way to cover every possible mapping. The most common keys that you tend to run into include the number keys (ex: setting difficulty in Jumpman), space bar (Spelunker, as you mention), and Enter, but something like Star Raiders of course demands that you play with the keyboard, never mind all the text adventures or even just games that require that you type your name.

    The mappings in lr-atari800 are:

    L3 NA
    R3 NA
    L2 KEY SPACE
    R2 KEY ESCAPE
    L CONSOL_OPTION
    R TOGGLE UI
    SEL CONSOL_SELECT
    STR CONSOL_START
    A FIRE1/KEY RETURN IN GUI
    B KEY RETURN
    X FIRE2/KEY ESCAPE IN GUI
    Y VKBD ON/OFF

    So you do in theory have two keys free where you could put a couple more mappings without stomping something else. I haven't tried this, but you could go to the RGUI (Select-X) and mapping L3 and R3 to the extra keys you need, and then saving a Game Remap file (not a Core Remap, as that will map those keys for all games). But I haven't tried this to see if it works with the lr-atari800 core.

    You're almost certainly still going to need a keyboard attached for a lot of games.



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.