Atari 800 FPGA

So I was at my parents recently. My old Atari 800XL was in a cupboard, so I dug it out to see if it still worked. It did, and so I was quickly playing Star Raiders again. I wasn’t much of a gamer when I was younger, but I did spend a lot of time writing 6502 machine code on this system, so I have some fond memories. I even hacked together some weird battery backed ram disk that plugged into the cartridge slot … all because I was too poor to own a disk drive.

Now, I have an Terasic DE1 FPGA board. I originally bought it so I could use the Minimig DE1 port … to turn it into an Amiga, but the DE1 is a very popular  target for other attempts to rebuild older systems purely in a modern FPGA. I wondered if anyone had done an Atari 800 FPGA implementation. Someone has. So there is a very long forum thread on Atariage that is the sorta-kinda project page for this project started by someone called ‘foft’.

I must admit I ended up reading most of the 21 pages of the forum thread to even come close to working out how to get it to go for me. For a while I thought it would never work. I certainly cannot get any of the recent DE1 builds to work. But, yes it did end up working for me. So for my DE1

  • I used the atari800core_20140301.sof file from the scrameta site referenced in the forum thread.. I could not get anything newer to work
  • Get the de1flash tool. You only need the de1flash.sof and de1flash.tcl files from it. Use those to run these commands to write the bin file (from the scrameta site) to the DE1 flash. The DE1 Control Panel is meant to be able to do this, but it never worked for me (and the forum thread suggests this too). I did this from a Windows XP VM where I had Quartus 12.1 installed.
    quartus_pgm -m jtag -o "p;de1flash.sof"
    quartus_stp -t de1flash.tcl write atariroms3.bin@0x0000
  • Put some atr disk images on the root of a SDCard. I always formatted mine in Windows. You may need a few SDCards. And try to format it different ways before it may work. For whatever reasons my newish 4GB card does not work at all, but an older 2GB microsd in an adapter does work for me.
  • I used this combo of switches;sw0 up, sw1 to 3 down. sw4-5 up. sw6 down. sw7 up, sw8 down, sw9 upSW0 is the SDcard enable/disable, so it has to be up. I seemed to think SW0 was the reset (like it is in Minimig), but F12 is generally the reset button.
    SW8 is ntsc/pal (though I could never get PAL mode to work). SW4 is the scan doubler. Chances are you will need the scan doubler. In theory NTSC/PAL determines if you want to go 60Hz or  50Hz. Technically 50Hz is ‘out of spec’ for  the VGA standard (which might be why it does not work for me, though Minimig DE1 in PAL does work on the same monitor).
  • So you should be able to upload your sof file and the DE1 should reboot and you should get a blue Atari BASIC screen with ‘READY’ in the top corner.
  • The rightmost blue button on the DE1 is the OSD display. I find it is very fickle, and only works maybe 1 in 5 or 6 times (debounce problem??). You should see a menu with “Memory”, “Rom bank”, Speed” and “D1”, “D2” …etc. Use the arrow keys to move up and down the list, and right/left to change the settings. Speed is shown in hex so the default of 704 KHz is actually 1796 KHz in decimal. When you move to where it has D1, hit the right Windows key on your keyboard to get to a file listing. I don’t think it lets you traverse into directories, so find an ATR file, and press the right Windows key again. That should return you to the top menu.
  • When you are ready to boot, move the cursor to “Reboot”, hit the right Windows key and as soon as you can press F4 and hold it down. This is the ‘disable BASIC’ key … which you supposedly need to do to load anything from disk.
  • There seem to be several ATR files for Star Raiders floating around the net. Some didn’t work at all. The GB version loads, but has some weird bugs that are annoying, but I did find the version here seems to work perfectly. If you are new to Star Raiders (and Atari), F3 is the OPTION key (cycles through levels), F2 is START. You generally want C for computer, T for tracking and S for shields. Then hit G for the galactic map. The asterisks are your space stations to protect and to refuel from. Generally, move the ‘dot’ in the galactic map to your destination and hit F for front view and H for Hyperwarp. On Novice level don’t touch anything, but on the higher levels you’ll have to wiggle the joystick to keep it centred in hyper warp. I usually hit 4 or 5 (for speed 4 or 5) once you exit Hyperwarp and then just fly around and shoot baddies.