IEEE Consumer Society : Video Computer System – Bring the story home

Joe Decuir, IEEE Fellow IEEE CES Board of Governors 2015-2017 CES Distinguished Lecturer 2013-2016 IEEE Consumer Electronics Society

Agenda

Bring the story home Early video games The market problem to solve in 1976 How the 6502 changed things Turning a prototype into a product : Tank Brilliant game designers What we learned Resources

2 IEEE Consumer Electronics Society Entertainment: in the network, and then at home IEEE Consumer Electronics Society Entertainment in 1970 When I started the college, the stories were all controlled by the public media companies: Movie companies made films and showed them in theaters TV networks provided news and assorted shows, punctuated by commercials, which we could at home Musicians recorded songs, which we could listen to on the radio or on vinyl records at home – I was lucky enough to see some of them in concert A few of us also made it to live theaters (with actors) We – the customers - did not control the story

4 IEEE Consumer Electronics Society First Video Games Ralph Baer was a pioneer, recognizing that it was possible to bring entertainment home. He imagined a machine which allowed electronic gaming on a “Brown Box” in a family home. Ralph was unlucky – he worked in defense Ralph Baer His employer licensed his in his basement design to Magnavox – as lab, 2014 the Odyssey

5 IEEE Consumer Electronics Society Video Games in arcades Video games were known from experiments on university computers Entrepreneurs like experimented with bringing the gaming experience to arcades, starting with Nolan was lucky to witness a demonstration of the original (Brown Box) Al Alcorn re-implemented the game idea as an , named – This was wildly successful In 1975, they brought out a home version – another success

6 IEEE Consumer Electronics Society Revolution In the mid-, computers were large and expensive – Recommend: visit Computer History Museum Major steps: – Big computers became commercial – IBM et al – Digital Equipment et al created ‘mini-computers’ 1971: the first microprocessor appeared – Intel 4004 handled 4 bits at a time, 50kHz bus – A 4004 + a 4001 (ROM & IO) = minimum system 1974: we had the Intel 8008, w/8 bit memory 1975: added the and the Motorola 6800

7 IEEE Consumer Electronics Society The Problem to Solve IEEE Consumer Electronics Society

Atari’s Market Problem

They had been leading the arcade game business, starting with Pong They had extended their position with complex arcade games, like Tank They had succeeded competing with Magnavox for home games The clear next move: bring complex games home Atari knew they had competition everywhere

9 IEEE Consumer Electronics Society

Implementation Choices Design new custom application specific (ASIC) for each game – Pong for home use is an example Design a programmable system, using a new microprocessor, and an ASIC to drive the screen and the audio In 1974-1975, and memory were expensive!

10 IEEE Consumer Electronics Society

A bit mapped design

Graphic systems at the time would have a bit map or character map. A common graphics terminal would have a 64x16 character array, backed by a ROM for character graphics. – A 1K byte character RAM cost close to $10. A pure bit map would become prohibitively expensive. On a monochrome monitor, 512x256 would be 16K in DRAM.

11 IEEE Consumer Electronics Society

The default screen map design

Given the processors and memory in mid- 1975, a programmable architecture looked too expensive. A display of 160 x 96 x 2 bits would need a 4K x 8 DRAM array, perhaps $25 dollars. – Not much RAM left for game variables. A processor like the 6800 was quoted around $25 in large quantity. An ASIC would be needed to manage the RAM and generate the display.

12 IEEE Consumer Electronics Society Then MOS Technology changed the analysis IEEE Consumer Electronics Society

6502 introduction

A team led by Chuck Peddle left Motorola and teamed up with MOS Technology to build a better microprocessor Big changes: – Replace enhancement mode NMOS by depletion load NMOS – Adjust the register architecture to define better memory addressing – Adjust the architecture for little-endian address arithmetic pipelining

14 IEEE Consumer Electronics Society

How this changed the analysis

The 6502 was priced at $25 per sample – I bought one in September 1975 at Wescon – So did Wosniak and Ron Milner of Atari MOS Technology quoted $5/each in large quantities Depletion load NMOS made the parts fast enough for 1-2 MHz memory. – Median 6800s could handle 500 kHz memory The architecture changes were decisive

15 IEEE Consumer Electronics Society

Address arithmetic Data processing involves manipulating addresses The 8080 had a 16 bit H and L register pair – Computing an address was intensive The 6800 has some address computation – It was limited, a 16 bit X register was offset with an immediate 8 bit value The 6800 had a nice trick: the first 256 ‘zero page’ memory locations could be addressed with shorter instructions

16 IEEE Consumer Electronics Society

6502 memory addressing

There were two innovative standard addressing modes for most ALU instructions:  Indexed indirect addressing • 8 bit X register added to 8 bit zero page offset. This selects a 16 bit memory address.  Indirect indexed addressing • 8 bit zero page offset selects a 16 bit memory address. The 8 bit Y register is added to that 16 bit memory address (next slide).

17 IEEE Consumer Electronics Society

Indirect indexed addressing Bus Address bus Data Bus Description clock 1 PC Op code Load instruction using indexed indirect

2 PC+1 ZPA 8 bit value pointing to a base address in zero page 3 ZPA DAL Fetch the Data Address Low byte

4 ZPA + 1 DAH Fetch the Data Address High byte

5 DAH:DAL + Y -data- Add the Y index register to the DAL+DAH to generate the effective address

18 IEEE Consumer Electronics Society

Consequence of 6502 speed

The 6502 was fast enough to compute and write graphics on a line-by-line basis. IT DID NOT NEED A FRAME BUFFER! – This saved a lot of money. The 6502 could run at 1.2 MHz, for 76 memory cycles per TV horizontal line. – This would be maybe 25 instructions/line. Ron Milner and Steve Mayer of Atari build a prototype (next slide) – Great luck: I was hired to debug it

19 IEEE Consumer Electronics Society

Atari VCS proof of concept

Computer History Museum

20 IEEE Consumer Electronics Society Generating a Product IEEE Consumer Electronics Society

Assembling the team The prototype and I were sent to Los Gatos I was apprenticed to Jay Miner (next slide) Jay worked for Bob Brown, who in turn worked for Al Alcorn – engineering VP We assembled a team to build the system: Wade Tuma, Neils Strohl, etc. We had ASIC chip designers and testers We needed game designers. We hired Larry Wagner. Larry in turn hired Dave Crane, Al Miller, and .

22 IEEE Consumer Electronics Society

Jay Miner

23 IEEE Consumer Electronics Society General plan We looked at the prototype as an existence proof. As Brooks wrote (Mythical Man-Month) we ‘plan to throw the first one away’ We did a new system design, with a CPU, an ASIC, a combo device with memory and IO and an external ROM on a cartridge. – We had decided that having RAM to load a program would cost to much We designed a depletion load NMOS design Then we emulated that design with 74LS TTL

24 IEEE Consumer Electronics Society

System fundamentals

We kept the essentials: 1. A 6507, a cost reduced 6502 in a 28 pin package, losing some functionality, but saving 50 cents. 2. A 6532, with 128 bytes of RAM, 16 IO ports and a programmable timer 3. The “Television Interface Adaptor”, with video, audio and six extra specialized input ports 4. A 2K or 4K byte ROM on an inserted cartridge.

25 IEEE Consumer Electronics Society

Atari VCS system diagram

26 IEEE Consumer Electronics Society

Sound circuits Two sound circuits, one per player Three components for each: 1. frequency divider – Start with 2x horizontal rate ~ 31 kHz – Add a 5 bit prescaler 2. noise generator: 4 bit, 5 bit and 9 bit polynomial counters – 4 bit poly counter made tank noises – 9 bit poly counter made jet noises 3. multiplying 4 bit A/D converter

27 IEEE Consumer Electronics Society

Parallel IO

 5 6532 IO ports for the game console controls: game start, game select, difficulty (left and right) and color/BW. The 6th switch was power.  4 6532 IO ports each for the two controllers  2 TIA paddle port inputs for each of the two controllers; we could play 4 player pong games.  1 TIA trigger port for each of the two controllers; they could also support a light gun

28 IEEE Consumer Electronics Society

HW Optimization: collision registers In games, objects ‘collide’ with other objects Detecting collisions in software is difficult. The program needs to construct the outline of each object and compare locations. It was much easier to add a set of 15 hardware collision registers – simple RS FF The programmer reads and clears them. The hardware sets them if any pair of objects and playfield overlap.

29 IEEE Consumer Electronics Society

SW Optimization: CHRST device driver

Atari designs used low resolution ‘playfield’ and high resolution moving ‘players’ (sprites) Players and ‘missiles’ could have their horizontal positions reset, and be moved a few pixels; they did not have binary position registers and comparators. We created a standard subroutine called “compute horizontal reset”. The game designer called it with a sprite index and an 8 bit offset. The subroutine positioned the sprite.

30 IEEE Consumer Electronics Society

31 IEEE Consumer Electronics Society

Game controllers Bundled with the machine:  Two-axis digital with a fire button  Dual potentiometer controllers, each with 1 button Shipped with special games:  Grey coded 360 degree rotary controllers, bundled with a driving game.  Keyboard controllers: 3 x 4 key array, bundled with a Basic Math cartridge.

32 IEEE Consumer Electronics Society

Program flow In vertical blank time: Processing console controls Detecting and processing collisions detecting any other changes (e.g. timeouts) update game status. In display time: Driving the TV display on a line-by-line basis, in what we called the ‘kernel’ In a following illustration, there are two: score and game field

33 IEEE Consumer Electronics Society

Game state  Shape of the playfield  Location, orientation and shape of two complex (8 bit wide) moving objects: ‘players’  Location and orientation of 3 simple (1 bit) moving objects: ‘missiles’ and ‘ball’.  Current settings for 2 sound channels  Other displays, e.g. score for each player

34 IEEE Consumer Electronics Society

Translate the state for the kernel The program would then compute new values to display, and locations. It would set up the zero page pointers that the kernel would use to drive the display after the vertical blank time ended. The program would poll the hardware timer to know when to halt game state changes and enter kernel execution. The efficiency of the 6502 to compute addresses into the ROM on the fly was crucial for the kernel.

35 IEEE Consumer Electronics Society Program flow Horizontal Line – 228 color clocks

Horizontal Blank – 68 cc Horizontal Display – 160 color clocks

Vertical Blank processing: Vertical - Process user inputs Blank & Sync: - Detect and process collisions 54 lines - Compute new game state, including score

Lines Vertical Display:

262 208 lines

kernel processing:

- compute game Frame graphics pointers, - load TIA registers

Vertical - [option: poll potentiometer inputs]

36 IEEE Consumer Electronics Society

Prepare for introduction The TIA ASIC worked the first time. We built many more prototyping systems to keep the game designers tooled up. We had to do a system design, with RFI shielding (aluminum casting) We had to tool up with a new factory We needed production test equipment and tooling One of the reasons we sold out to Warner: we needed the money to afford all this

37 IEEE Consumer Electronics Society

Launch game titles - 1977 Air Sea Battle (Kaplan) Basic Math (Palmer) – keyboard controllers (Whitehead) (Decuir & Wagner) – bundled game Indy 500 (Riddle) – driving controllers Starship (Whitehead) Street Racer (Kaplan) Surround (Miller) (Decuir)

38 IEEE Consumer Electronics Society Competition:

This machine was developed at the same time as the Atari VCS It illustrated problems with bit mapped design. All graphics were in a 128 x 64 pixel bitmap All moving objects were drawn in the common bit map – Object graphics were very crude – Motion was also crude, and slow Total production is estimated as 250K units

39 IEEE Consumer Electronics Society Production history and lessons learned IEEE Consumer Electronics Society

We were nicely surprised The game designers turned out to be much more creative than the system designers anticipated. We made the hardware cheap, to be economically feasible in 1977. To do so we moved functionality from the hardware to the firmware. The game designers then took advantage of the ability to ‘follow the beam’ and redefine the display on the fly.

41 IEEE Consumer Electronics Society Explosion in games Over a thousand game cartridges were defined for this game console system. The most important ports from arcade games were Pac-Man, , and Asteroids. The list of original games is very long My highlight set includes Adventure (Robinett), Pitfall (Crane), (Shaw) and Yars’ Revenge (Warshaw).

42 IEEE Consumer Electronics Society

Production history Production stared in July 1977, with 250,000 units Production stopped in 1989 (Atari VCS jr), with over 30 million units shipped – the NES replaced the Atari as the leading console. You can still buy them today! – The Flashback 2.0 is based on a new merged design, and 40 built in games. – The Flashback 5.0 is based on an emulator, with 92 built in games

43 IEEE Consumer Electronics Society 1977 ‘heavy sixer’ & 2014 Flashback 5.0

44 IEEE Consumer Electronics Society

New program development

At Classic Games conferences, companies like AtariAge support new cartridge development. – Several new games are created every year. In 2010, , contributor to the X- Box game console, created 2600 for the Atari. – 33 years after the machine was first shipped The graphics are a lot simpler, given the hardware, but the essence of the game play survives.

45 IEEE Consumer Electronics Society

Lessons learned We put the definition of the display in the hands of the game designers, who were smarter than we hardware designers expected. Our conclusion was that our second system should not simply be a bit map and a processor. We had created a platform for the art of others, and we planned to build on that for the next system. We thought we needed to move fast. The Atari PCS came out two years later, in 1979.

46 IEEE Consumer Electronics Society Resources IEEE Consumer Electronics Society To learn more MIT Press published a Platform Series book on the Atari VCS, titled . It covers , Combat, Adventure, Pac-Man, Yars’ Revenge, Pitfall, Star Wars (game) and the first video game crash. The book Atari: Business is Fun is the definitive social history of Atari at the time the VCS was developed. It covers the arcade side of the business as well. Warren Robinett is working on a book about game design, titled “The Annotated Adventure”. For more technical information the Atari VCS, see the TIA Schematics and the Stella Programming Manual. I wrote an article with much more detail in the July 2015 issue of Consumer Electronics Magazine

48 IEEE Consumer Electronics Society

My contact information Joe Decuir Issaquah, WA USA IEEE: [email protected] IEEE Fellow IEEE CES Board of Governors: 2015-2017 IEEE Global Humanitarian Technology Conference: chair 2015, ieeeghtc.org Work: [email protected] Standards Architect, CSR Technology Chair: Internet Working Group Vice chair: Smart Environment Study Group

49 IEEE Consumer Electronics Society

Questions?

50