Monday, September 25, 2017

Sega Space Tactics

Sega Space Tactics - One of those arcade games which most people have never heard of - but it brings back a feeling of nostalgia for me.

The day before the grand opening of my local Chuck E. Cheese's - sometime in the early 1980's - my brother and I got a chance to visit this new "pizza arcade" concept.  Arcade technicians were scurrying between shiny new cabinets, each with the coin door open, making sure they all worked fine for opening day.

The "Space Tactics" sit-down cabinet was big - the two of us could fit inside side by side.  It was sort of a "3D space invaders", with weird analog sounds, electro-mechanical controls, and a first-person space shooter perspective.  It was a remarkable day, but something about that particular immersive environment stuck with me, at least for a while.  It was like we were "flying our own starship," just for the day.  Eventually though, I forgot all about it.

The game didn't catch on.  Or maybe it was just too complicated, and prone to breakage.  In any case, as the 1980's went on it was fairly quickly replaced with newer, more conventional games.

Fast forward to the late 1990's. I am having a blast working as a new MAME developer, and looking through a list of unemulated titles.  In the days before "flyer archives"...something about the name "Space Tactics" jogs a memory.  I ask about it.  I'm told "It's electro-mechanical and very complicated - but the schematics are in the service manual posted here if you're really interested...".  I still can't remember the game, but I think "maybe if I start working on the emulation I will remember..."

It takes a special kind of masochist to emulate a beast like this one.  All the standard arcade hardware, plus worm gears, limit switches, encoder wheels.  I started writing code a little at a time...just the graphics...the text...the scrolling of the playfield...eventually adding the LED arrays as best I could remember - and a rudimentary score display.  I remember now!  I wish I could remember exactly how it looked, but at least the driver is playable now.

A trip to Cedar Point amusement park - sometime in near the turn of the century.  The have two actual Space Tactics games! One working, one not (probably for parts I think.)  I take a few pics, and wonder how much longer they will be there.

Space Tactics Gameplay

Mid 200x.  "eBay - L@@k - Sega Space Tactics game for $50 - local pickup only - in upstate New York".  I decide to rent a truck and drive with a friend to pickup the game, driving from the midwest. (This deserves it's own blog entry)  The game is complete, except for a coinbox door and a reinforcing rod to add rigidity to the seating area.

Inside Sega Space Tactics

It is amazingly complicated on the inside.  Pixels were expensive in 1981, so making an immersive experience was tricky.  Sega's solution?  Mount the monitor on a rotatable chassis with a movable mirror.  The playfield appears to slide up-down-left-right as you move the flight yoke.  Against this moving background provide stationary 'beams' of fixed LED's in the foreground, which light up in sequences when you fire.  Finally, add some fluorescent graphics, a black-light bulb, LED score indicators and lighted buttons, analog sound, and you've got something!

Now the sad interlude...It's fun and works, but I never get it completely setup where my kids and I can play it.  It stays in my garage.

2010ish.  Against my better judgement, I decide to get rid of Space Tactics because it is taking up too much room!

And the happy ending...

Last week - 2017.  A local collector is selling a Space Tactics...more than $50, but not too high...just as I'm buying a new house with a walkout basement.  A quick trip, and I have a nicer one than I had before!  Still missing a coinbox door but otherwise complete.  I haven't powered it up yet but I will follow up this post with a video.


Current MAME gameplay

2017 MAME status - still work to do! - Others have added nicer rendering of the score display. Sound emulation is not complete, because of the analog stuff.  (No reason why it can't be completed now, though.)  Also, notice the laser beam rendering is still "angled up" and pixellated - unlike the real thing.  This is still the best I could remember when I first wrote the driver, and I used the low-resolution playfield rendering (which forces the pixellation) to add it.  It should be updated to use the proper MAME rendering subsystem (would look great) and aligned like the real game to be roughly horizontal.

Friday, June 02, 2017

Atari Starship 1

After a "short break"...I'm working on MAME again. :) After all the excitement about the discovery of an Easter Egg in Starship 1 earlier this year, I decided to take a look at some of the shortcomings of this driver.

The first issue relates to the way the spaceships explode.  In MAME 0.185, the ships "get brighter" and then disappear in MAME, but in the original game they appear to flip around as well.  Strangely, the wrong sprite is sometimes used when the flipping occurs, so a hack was placed in the driver to stop the flipping.  I honestly don't remember who added the hack - it might have been me :)  (Back in the day there were no handy Youtube videos of the actual gameplay available - like this great one from Arcade Jason)  In any case I removed this hack for MAME 0.186.

In the Easter Egg article, they mention the "Fast/Slow" throttle controller.  It looks like the kind of controller which should toggle, but apparently it actually goes back to Slow if you let go of it.  This is a trivial fix, and I have it in my github already.  See the original controller on the right here:

The next issue relates to the speed of the emulation.  The schematics for Starship 1 are buggy, and the video timing really doesn't make sense.  I used a combination of reference videos and photos of the PCB to conclude that the video timing circuit is very much the same as Atari Destroyer, and Super Breakout.  The Horizontal Line rate (rate to draw one scanline) is 15750Hz and the Frame rate is 60.114Hz, when using a crystal of 12.096Mhz. This also makes the game timings correct. (the game runs for a "certain time" instead of a certain number of lives).  This is fixed in my github as well.

Now, there are two issues left that I know of.  The planets that get created always originate "centered on the screen", which seems to make the MAME version much harder than the actual - I need to look into this, but I think it relates to the calibration procedure of the original game, which was required at setup time and is described in the manual.  This needs more analysis.

And finally - the scaling of the spaceship sprites.  Atari used a patented circuit involving analog circuitry to scale these images.  The patented circuit actually creates sprites which are "directly proportional" to the size that the game requests.  In other words, there is a simple scale factor to sort out.  Unfortunately, it's tough to sort it out definitively, without access to the real hardware, or building up a circuit yourself.  To make matters slightly worse, the real circuit used in the game is slightly simpler, which means there is a more complex relation between what the game commands and the actual size of the sprite on the screen.  I will most likely need to build the circuit and measure it at some point.  For now, the approximation in the code seems to work pretty well.

I created the first driver for Starship 1 way back when, and Stefan Jokisch updated it and submitted to MAME back in the early 2000's.  I put in the one fix for MAME 0.186 and at least the next two fixes should make it for 0.187.  This should be enough to close out the corresponding bug report on mametesters.  Aside from Starship 1, and I have a few more ambitious emulation projects...but I'll save them for the next update.

Fun with FPGAs - recreating the Atari TIA, Part 1

I have been playing with recreating the Atari TIA chip as used in the original 2600 in an FPGA.  I know this has been done a few times alrea...