Posts tagged theseus

Posted 4 months ago

Arduino XSVF Player?

I want to program a Xilinx XC9572XL and refuse to buy a $50 dongle to do so. Keywords in my research so far: xapp058, XSVF, SVF, JTAG, arduiggler. There is an FT232-based version that seems very close to what I want, but it’s written in Visual Basic, of all things, and probably won’t work on a modern non-FTDI Arduino.

If you’re reading this and do contract programming in exchange for karma, please write it in Python to avoid cross-platform issues!

Posted 4 months ago

This is the version of the Papilio One as built by SeeedStudio. It’s possible that versions built by other manufacturers are slightly different; it’s open-source hardware, so in theory many people might build it. These notes are for Linux (Ubuntu 11.10 in my case).

  • The headers arrive separate from the board. You’ll need to cut off sections with wire cutters, and you should expect and plan to sacrifice one pin per cut. Then if you’re at all aesthetically motivated, sand down the rough edge with garnet sandpaper before soldering to the board.
  • Attaching to a VGA monitor and USB is easy enough; no surprises there. But you’ll immediately wish you had a DB9-friendly joystick (buy an old Atari 2600 joystick on eBay if you want the intended hardware).
  • The first thing you’ll want to do is put something on the Papilio/Arcade Wing. The GitHub repository contains the stuff you need, but if you want it to work on Linux, start with my fork.

The following instructions assume you’re using my fork and are trying to get Pac-Man to run on your new Papilio Arcade Wing.

  1. cd pacman_rel004_sp3e_papilio. All the remaining directories are relative to that one.
  2. cd romgen_source and build the executable: g++ romgen.cpp -o romgen
  3. Find Pac-Man ROMs matching those described in the top of the file scripts/merge_roms_pacman. You want the bootleg version that runs on Galaxian hardware, called Puckman. Put them in roms/.
  4. cd scripts
  5. ./merge_roms_pacman

Now you’ve created a Xilinx bitfile that will run Pac-Man, and the next set of instructions loads it.

  1. Download the loader (that’s a fragile link, sorry). We’ll assume that you’ve managed to put papilio-prog into your path (look in the zipfile in Helper_App/linbin).
  2. sudo apt-get install libftdi-dev. This lets papilio-prog talk to the FTDI USB chip on the Papilio.
  3. Make sure your Papilio is plugged via USB and the VGA monitor it’s connected to is on.
  4. papilio-prog -f bit_files/pacman_on_pacman_hardware_p1_500K.bit
  5. Within about 1500 milliseconds your VGA monitor will start running Pac-Man.
Posted 4 months ago

Board design improvements

As I improve the board design in my head, I think I can eliminate the EEPROM and downgrade the ATmega to an ATtiny. The design will now read files off an SD card instead. The ATtiny will populate a bank of the SRAM and present that to the 6809 as ROM, using the CPLD as a stand-in for a series of ‘595s. The ‘tiny will also load the FPGA, both from files on the SD card. I’m assuming that Xilinx FPGAs can be loaded with SPI or something similarly pin-frugal. This feels like a better, more modern approach. Moreover, I wasn’t looking forward to reflashing the EEPROM throughout development.

Also, an amendment to my component count estimate: I forgot about power. So we need to add a few SOT-23 LDOs for the various voltages (1.8, 3.3, 5.0). But it’ll still be a very small board.

Posted 4 months ago

Board sent off to the factory

No, not the replacement for the Mess O’ Wires. This is the Dangerous Prototypes XC9500XL CPLD Breakout Board. I’ve ordered from DorkbotPDX, and my batch should be going to the fab today. (As a side note, I don’t feel too bad about depriving DP of revenue. I own one of approximately every other thing they’ve sold, and I couldn’t wait for the many-week shipment time from SeeedStudio.)

As I investigate (naively) the capabilities of this device, I’m pretty sure I ought to be able to duplicate all of Joust with the following:

  • A Xilinx Spartan of some kind to reproduce the main chips (6809E, two 6821s, a 6808 for sound, and the “special” SC2) and a lot of the glue among them.
  • One of these little CPLDs for things like the Q/E clock generator and other glue that might not fit on the Spartan. (Actually, I doubt it’ll be necessary at all, but I’m rationalizing it now so I can start working on programmable logic before the Spartan arrives.)
  • An SRAM.
  • An EEPROM to hold the game code.
  • The 4MHz oscillator.
  • An ATmega of some kind to load up the Spartan and maybe manage resets.
  • A bunch of resistors for video, and capacitors for power decoupling.

Unless I’m missing something major, this will be a pretty tiny board, compared to the original five Joust boards!

Posted 4 months ago

Theseus

In the middle of a great email exchange with Sean Riddle (the all-time PageRank leader for Williams hardware and software), and the Ship of Theseus came up. It’s an old philosophical puzzle where a ship sails around the world, in the process having broken and worn-out parts replaced as needed. By the time it arrives back in its home port, every part has been replaced. Question: is it still the same ship?

Now there’s a project code name! So here’s the proposal: 8821 is project to understand how a 6809 works in the year 2012. Theseus is the project to resurrect an old Joust while keeping its identity as a Joust. File your objections with the Review Board within five business days.

Update 2/1/2012: This name didn’t stick. It sounds too much like “thesis,” and I avoided grad school precisely so I’d never have to work on one of those.

Posted 4 months ago

Joust still broken: video and sound dead

I got the video assembly out of storage, and it’s dead. I know that CRTs use high voltages, and I’m allergic to kryptonite, so I won’t be messing around with that thing. No jousting today. I’m also concerned that the sound board isn’t doing anything, though it’s getting power. I went through the diagnostics in the Joust owner’s manual, and made it through the flowchart to “yep, your machine is busted” in all cases. It’s a safe assumption there are multiple problems with this 30-year-old machine, aside from the ones I’ve fixed so far.

After a break for dinner, I got to thinking. The video output from the CPU board is R, G, B, HSync, and VSync. That sure looks a lot like VGA. Is VGA the same scheme? Do VGA monitors tolerate only certain sync frequencies? Would it… just work?

Posted 4 months ago

Passed all the checks after replacing two 4116s. No sound, though, even when I press the diagnostic button on the sound board. When the video arrives later today I’ll know more.

Posted 4 months ago

I’ve gotten my Joust out of storage. Serial #606900 (or 60690D according to handwritten permanent ink on one of the wooden struts inside). Strictly speaking, doing so is irrelevant to this phase of the project, but having this hulking mass taking up space at home will serve as a constant reminder to finish.

It’s survived the last 10 years of storage in good shape. The backup batteries were still measuring 1.3 volts! I was foolish to leave them in all that time, but no harm, no foul. To be able to lift it and put it in the car, I took out the video assembly out and left it in storage for a second trip. So even if it did still work, I wouldn’t be able to play today.

I plugged it in after wiping it down and checking for spiders. The single 7-segment LED flashed 1… 2… 8. That’s a RAM error, bank 2, chip 8. That’s the most common failure of these old machines.

More photos here.

Posted 4 months ago

Your Amazon.com order of “Williams Arcade Classics” has shipped!

I bought an old CD-ROM of Williams Arcade Classics, which is a collection of ROM images and an emulator that runs on a PC. This means little more than that I’ll be legal to possess copies of the game ROMs (besides Joust, which I already own). Sean Riddle has already written code to extract the ROMs from the PC version, but to be honest, I think it’s easier to type “mame roms” into a search engine and see where that leads me.

Posted 4 months ago

Project 8821

Inspired by Quinn Dunki’s Veronica project to explore the 6502, I’ve decided to build a 6809E-based hardware platform for old Williams coin-op videogames, such as Defender, Robotron, Stargate, Bubbles, Sinistar, and Joust.

Ah, Joust. How many first-period high school classes did I miss because of it in 1982? As a result of a software bug involving lava trolls and pterodactyls, I got hours and hours of experience from a single quarter that should have lasted maybe three minutes in a normal game. Williams quickly fixed the bug with a new ROM revision, but my skills were established. I was the first kid in my county to “turn over” Joust from a score of ten million back to zero again.

Twenty years later, I found a rare cocktail version of the game for sale, and for $800 it was mine. But it didn’t last long; like so many Williams games of its era, its DRAM died and its video burned out. Today it gathers dust in storage. The easy path to playing again (well, other than selling it and downloading MAME) would be to replace the bad components. But that’s no fun. It’d be just a small matter of online shopping. What if instead I started with this:

Motorola MC6809E

and built it into a working Joust system? And as long as I was at it, why not get the other Williams games that ran on near-identical hardware to run, too? It’d be a chance for a software guy like me to get a layer or two lower in the stack, and I’d end up with something presumably more reliable, cooler, and cheaper to run than the early-1980s hardware that John Newcomer and Eugene Jarvis had to work with. Yeah, that’s more like it!

I hereby commence Project 8821 (6809 + 2012… hey, you come up with a better name). Here are the ground rules, subject to change on personal whim:

  • The software portion of the games must remain unchanged. I can use any hardware I want, but the exact bits living in the original ROMs must work on whatever I build. Exceptions: I’ll fix Robotron’s shot-in-the-corner bug using Sean Riddle’s patch, and I might have to change 3 bits in Defender to work with later hardware, which is OK because I actually never liked that game.
  • I’ll start with original hardware, such as the real 6809E that I picked up today from Jameco, but where reasonable for cost, availability, pedagogical, elegance, or sanity reasons, I’ll substitute newer technology, such as SRAM to replace the 24 individual 4116 chips.
  • I have no desire to keep replacing burned-out CRTs, so I’ll change the video to use VGA, possibly using the methodology described by the fine folks over at Lucid Science.
  • This isn’t a reverse-engineering project where I’m pretending to work in a clean room. I fully plan to take advantage of all information available, including anything I get can out of existing similar projects. (Unfortunately, jrok seems to have dropped off the face of the earth, so I’m not sure how much help his work will be.)
  • No processor emulation unless I write the emulator myself. That rules out MAME on a Raspberry Pi, which would otherwise be a very sensible approach to replacement hardware in the original cabinet, if I wanted to complete the project in an afternoon and didn’t care about the educational aspects.

Before you think I’ve gone off the retro deep end, understand that the ultimate goal of this project, once I have a hardware copy running, is to move as much of it as possible to software. That means FPGA, which in my mind counts as hardware and doesn’t break the no-emulation rule. The current Papilio One platform isn’t quite capable enough for this project because of BRAM limits, but the forthcoming Papilio Plus, with a separate SRAM chip, ought to fit everything quite comfortably. When you can buy a generic FPGA development board and download the entirety of this project (minus ROMs for legal reasons) from GitHub, the project will be complete.

This is a big job that’ll probably take a year. But I think it’ll be fun, and I hope you’ll enjoy following along.