The Arcades Project
From BenningtonWiki
aka Pimp my Robotron 2084
The 80s gave us The Empire Strikes Back and Pretty in Pink, the Eurythmics and LiveAid – and Pac-Man and Donkey Kong. Coin-operated games occupied hallowed places inside pubs, restaurants, movie theaters and video arcades. Kids (i.e., I) saved their quarters to spend hours in dimly lit arcades testing reflexes and wits against tiny CPU-powered gorillas, aliens, centipedes and ghosts. These arcade machines, often designed by hobbyists and built from parts you could get at Radio Shack, were the marvelous technological precursors to today’s personal computers. This course is about learning how a microcomputer works by studying every inch of one such classic arcade machine, Williams Electronics’ Robotron. We’ll study its real-time operating system, learn assembly language and document the game code, pore over schematics and conduct experiments on its electronics.
Let's learn every single thing about how it works.
Contents |
Notes
To get started:
- Read what Wikipedia has to say about Robotron.
- Read the interview with Eugene Jarvis, Robotron's creator. Read what Wikipedia has to say about him.
- Read Sean Riddle's FAQ.
- Get a binder. Be prepared to put lots of schematics and notes in it.
- Robotron sources
- Robotron manuals
- Robotron ROMs
- Audio presentation by Eugene Jarvis on the making of Robotron, 2006
- Williams games
- WikiProject on Computer and video games — We should contribute to the Robotron article.
- A good primer to soldering. Are we going to be soldering?
Topics
- Reading schematics
- Digital (TTL) electronics
- Assembly language
- Binary, hex, decimal
- Opcode chart, mnemonics
- Address bus
- Graphics formats
- Emulation
- Analog video
- Inputs
- Audio synthesis
- History
- Eugene Jarvis interview
- Early video games (Space Invaders, Space War, Asteroids, Defender, Stargate, Robotron)
- Computer architecture
- Compare schematics to other computers at the time (Apple II, Altair)
- Interrupt-based OS
- Memory management
Binder
- 6809 manual
- Robotron schematics and manual
- Robotron sources (Also, an experiment in putting the Robotron sources on the wiki. Help!)
Books?
- The Art of Electronics by Paul Horowitz and Winfield Hill, ISBN 978-0521370950. Perhaps it's enough to have a copy of this in the classroom for reference.
Club Officers
(...of the yet-to-be-specified time period)
- Adam Freed, First Tiger/President, as of 2/27/2007
- Mary Casserly, Secretary
- Gabe Meyers, Treasurer
What We Did
February 27
- Looked at a half-broken "Robotron: 2084" machine, heard some sounds, and even advanced a level
- Elected club officers
- Rejected the name "Vid Kidz"
March 6
- We discussed the Eugene Jarvis interview from Halcyon Days.
- We talked about the video game culture at the time.
- I played a slew of old video games via MAME on the overhead projector in Tishman auditorium. I will always enjoy doing this.
- Hex / dec / bin conversion contest.
- Assignment: Download MAME, "Asteroids," "Space Invaders," "Space War," "Defender," "Stargate," and "Robotron: 2084," and play each game for at least 15 minutes.
March 13
- We finally got down to fixing the monitor. It's dead. But the video coming off the motherboard is fine, so we juried up an external analog monitor. It actually works.
- Is this the week we looked at every single 6809 op code? When Gabe's head hurt at the end of class?
- We drew a giant memory map on the blackboard.
- We talked about memory-mapped I/O. Soft switches.
- We had another hex/dec/bin double elimination game show. Rebekah won.
March 20
- On a whim, we hunted down the battery-backed CMOS RAM on the schematics.
- We learned about reading schematics.
- We had the last(?) of our hex/dec/bin conversion contests.
March 27
- We looked at the Init Color Table routine ($????) and dissected it, as a gateway to understanding 6809 assembly.
- This led to a conversation about color tables, and the graphical layout of Robo.
- We looked at an EPROM under a microscope. Nifty how it has a window. And oh, those tiny solder joints.
- We all swore to never refer to the page numbers in the disassembly, but use the hex addresses instead. Always.
April 3
- President and First Tiger Adam began class by dropping not one but two quarters into the coin changer. Since this is a two-credit class. PLAYER 1 START.
- We talked about reverse engineering. NOPs in Alien Typhoon.
- We did some ad hoc reverse engineering of Robo code. Identifying data from code, what kind of data is it? Shape tables.
- We looked at shape tables in memory. The shapes themselves (always a multiple of two wide), the tables that point to the shapes, the vectors in lo mem that point to the tables.
- We talked a lot about collision testing. Rebekah wrote pseudocode on the board for a rect overlap check (with a bug -- but I didn't say what the bug was).
- This got us talking about how much can happen in a single 1/60 second frame of Robo. We figured last week that a 1MHz 6809 can do 4000 ADD operations per frame. Bounds check is 16 CMPs.
- We made a list of the things that collide: Player vs. everything, hulks vs. humans, grunts vs. electrodes. Others?
- We imagined a linear check (player vs. everything) and an exponentional check (hypothetical grunts vs. grunts).
- We talked about the standard heartbeat or event loop in games.
- The amazing thing about Robo is how it completely throws away the event loop, and uses interrupts for each object that moves.
- We watched the grunts moving, noticed that a single grunt moves on average once per second.
- So instead of 60 grunts moving 60 times a second, you really have 60 grunts moving on average every second, spread out over the 60 frames.
- We talked about multitasking operating systems. How each task gets to feel special for a microsecond.
- We talked about object-oriented programming, and Java nazis and C++ fascists and Ruby hippies.
- I imagined a hand-drawn real-time version of Robo, with a cadre of artists responsible for every element on the screen. Drawing on graphics tablets, composited together. Gabe wants to act it out, to which Adam declared to his amazement that he'd just heard something even more pathetic than LARPing, and he didn't think there was anything more pathetic than LARPing.
- We looked at the thread dispatcher.
- We looked at the interrupt vectors and walked through a bit of the RESET code.
- We looked at the IRQ code.
- We fixed the green analog signal from the game to the external monitor. It had fallen off and Robo was very red and blue.
- We discussed what it would take to connect Robo to a projector. Several people look like they're going to figure this out.
- We discussed how the front panel joysticks work, physically, and how diagonals are made. We used the diagnostics to watch the button presses.
- Gabe and Reid stayed after for some free play.
April 10
- Joe showed everyone how to get over 500,000 points.
- Dearest First Tiger Adam, had left our club to fend for itself this week. Luckily, Second Tiger Max (who had upon him a quarter) was able to start the meeting for a two-credit course.
- Today was our first day writing code in assembly language--how do we write loops?
<source lang="asm"> 0000 LDA #10 0002 NOP 0003 DECA 0004 BNE 0002 0006 </source>
- 6809's contribution to microprocessor evolution was to combine the A register and the B register to be the 16-bit D register. However, having only two (or one) registers did not make it easy to minimize the amount of cycles instructions would take.
- Addressing--immediate, extended, relative
- Two's Compliment, how relative addressing can point to an address before it.
April 17
- Adam inserted a quarter. Class began.
- More about writing basic 6809 assembly. We make a NOP do its thing 17 times.
- A discussion about counting up vs. counting down.
- A short review of 2's complement numbers. I made a list to verify to myself that F9 is -7. And I played Missy Elliott, because her flow is flippin' supreme, yo.
- We counted cycles.
- The three measures of code worthiness: correctness, speed, size. On the 6809, speed means cycles and size means bytes.
- On the speed scale, Joe's list of 17 NOPs wins. On the size scale, everyone else's loops win.
- We discussed unrolling loops.
- Also, everyone else's loops are better if you want to dynamically change the number of times the NOP happens.
- Adam made up a "NOP NOP" joke. "Who's there?" "NOBODY".
- We looked at the thread dispatcher, and talked about indexed addressing modes.
- I gave a mostly correct recollection of the development of multithreaded programming. Max noted that on my Mac at that moment there were 227 threads active.
- We looked at the code to move an enforcer bullet.
- "Homework" if I can call it that is to bring something in to share / show off from the Robo code next week.
April 24
- Looked over Joe's Curriculum worksheet, Curriculuminati
- Midterm discussion without Joe, then with Joe.
- we need more reinforcement/support in discovering bits of Robotron on our own
- Joe talked to us about 80% versus actually doing it--people take responsibility for jobs and commit to a deadline
- Joe gave us a program for the class
IF (500,000 high score OR plexiglass case OR 6502 computer OR
find the code for the hulks or donuts and explain completely in English)
THEN pass the course.
- Post up the schematics. Rebekah will do. by next week.
- Alex is heading up the plexiglass effort (he's a more intense visual arts guy).
- Alex and Adam are working on hooking this up to a projector. by next week.
- Show off the Robotron at Sunfest? Must talk to Lindsay. Who? When?
- Start 6502 thousand, find specs.
- Max and Gabe, unzip Robotron ROM, and mod it. Make sure everything fits, and NOP the ROM checks.
May 1
(Plan day)
- Determined that there are two sets of ROMs in the robo.zip file. Red and yellow. We've been disassembling the yellow, and so it's necessary to copy some files around, because MAME is using the Reds.
May 8
Everyone worked on their projects:
- Rebekah put the schematics and parts list up on the wall
- Reid, Mary, Max, and "Wire Bitch" Gabe added 74244's to their 6502 thousand
May 15
Everyone worked on their projects:
- Joe, Adam, and Alex Connected the game to the projector--but we're missing red and blue!
- Reid showed off his pretty wires.
- Rebekah and Max pored over the disassembly looking for bad guy routines.
May 18 (non-class)
Joe, Reid, and Max met to work on the 6502 thousand.
- The LED's for the address bus were doing funky things.
- Joe explained to Reid what a stack and stack pointer were. Then Max walked in and asked what a stack was.
- Max added a single-step.
- Joe and Reid fixed a small wire switch on the address bus.
- Took another Apple II's 6502--it WORKED!!
- Joe threw the old 6502 at the wall across the room, and then smashed it with his foot.
- Modified the 555 set-up to go faster. It ran correctly (see 6502 thousand for details).
May 22
- Talked about we had to look cool while playing video games. and if only Guitar Hero actually taught us how to play guitar.
- Joe explained ROMS, PROMS, EPROMS, AND EEPROMS. Mary wants the EEPROM eraser oven that Joe had at Adobe. Joe said EEPROMS are easy to program.
- Reid made logic that wasn't used. (Joe was to become more efficient with a de-multiplexer.)
- Everyone else hooked up the Apple II keyboard to our 6502. We changed the power source to the one in the Apple II.
May 29
Last class.
- SEPC (It's anonymous, yo!)
- We reflected.
- Joe made a jump rope with the cables.
- We kicked Adam out. ("I want a fortune cookie that works!" --Mary)
- We left to play Robotron. Reid approached an automatic pass with a 413,000 and secured his standing as second place. ("You dodge all those bullets but you run into a hulk??" --Alex)
