warren robinett (rev. by a. di blas, ucsc, for cmpe112) 1 warren robinett university of north...

53
1 Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) (Rev. by A. Di Blas, UCSC, for CMPE112) Warren Robinett Warren Robinett University of North Carolina at Chapel University of North Carolina at Chapel Hill Hill Department of Computer Science Department of Computer Science (Used with permission and revised by Andrea Di Blas, UCSC, for (Used with permission and revised by Andrea Di Blas, UCSC, for CMPE112-Computer and Game Console Architecture) CMPE112-Computer and Game Console Architecture) Design of the First Design of the First Action-Adventure Video Action-Adventure Video Game: Game: Adventure Adventure for the Atari for the Atari 2600 2600

Upload: brittney-oneal

Post on 16-Dec-2015

223 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

1Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Warren RobinettWarren RobinettUniversity of North Carolina at Chapel HillUniversity of North Carolina at Chapel Hill

Department of Computer ScienceDepartment of Computer Science(Used with permission and revised by Andrea Di Blas, UCSC, for(Used with permission and revised by Andrea Di Blas, UCSC, for

CMPE112-Computer and Game Console Architecture)CMPE112-Computer and Game Console Architecture)

Warren RobinettWarren RobinettUniversity of North Carolina at Chapel HillUniversity of North Carolina at Chapel Hill

Department of Computer ScienceDepartment of Computer Science(Used with permission and revised by Andrea Di Blas, UCSC, for(Used with permission and revised by Andrea Di Blas, UCSC, for

CMPE112-Computer and Game Console Architecture)CMPE112-Computer and Game Console Architecture)

Design of the FirstDesign of the FirstAction-Adventure Video Game:Action-Adventure Video Game:

AdventureAdventure for the Atari 2600 for the Atari 2600

Page 2: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

2Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Atari 2600Atari 2600

Page 3: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

3Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Page 4: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

4Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

OverviewOverview

• Early History of AtariEarly History of Atari

• Architecture of the Atari 2600 Video GameArchitecture of the Atari 2600 Video Game

– Architecture of the 6502/6507 microprocessorArchitecture of the 6502/6507 microprocessor

• Programming the Atari 2600: Programming the Atari 2600:

– How Video Games Were Made in the Late 1970’sHow Video Games Were Made in the Late 1970’s

• Design of AdventureDesign of Adventure

• Early History of AtariEarly History of Atari

• Architecture of the Atari 2600 Video GameArchitecture of the Atari 2600 Video Game

– Architecture of the 6502/6507 microprocessorArchitecture of the 6502/6507 microprocessor

• Programming the Atari 2600: Programming the Atari 2600:

– How Video Games Were Made in the Late 1970’sHow Video Games Were Made in the Late 1970’s

• Design of AdventureDesign of Adventure

Page 5: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

5Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

History of AtariHistory of Atari

• Atari invented the arcade video game Atari invented the arcade video game

– Pong, 1971, coin-opPong, 1971, coin-op

• Atari 2600 hooked up to home TV, 1977Atari 2600 hooked up to home TV, 1977

– Games on ROM cartridgesGames on ROM cartridges

– 18 million consoles sold, 500 game carts developed18 million consoles sold, 500 game carts developed

• Creation of game genresCreation of game genres

– shooters, driving, sports, adventure, side-scrollershooters, driving, sports, adventure, side-scroller

• Atari invented the arcade video game Atari invented the arcade video game

– Pong, 1971, coin-opPong, 1971, coin-op

• Atari 2600 hooked up to home TV, 1977Atari 2600 hooked up to home TV, 1977

– Games on ROM cartridgesGames on ROM cartridges

– 18 million consoles sold, 500 game carts developed18 million consoles sold, 500 game carts developed

• Creation of game genresCreation of game genres

– shooters, driving, sports, adventure, side-scrollershooters, driving, sports, adventure, side-scroller

Page 6: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

6Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Atari 2600 SpecsAtari 2600 Specs

• 4K bytes of ROM4K bytes of ROM

– for game program and datafor game program and data

• 128 bytes of RAM128 bytes of RAM

– for game variables and stackfor game variables and stack

• 1.2 MHz 8-bit processor (6502/6507)1.2 MHz 8-bit processor (6502/6507)

• Custom chip (TIA)Custom chip (TIA)

– ““Television Interface Adaptor” -- codename StellaTelevision Interface Adaptor” -- codename Stella

– generated video signal to drive TVgenerated video signal to drive TV

• 4K bytes of ROM4K bytes of ROM

– for game program and datafor game program and data

• 128 bytes of RAM128 bytes of RAM

– for game variables and stackfor game variables and stack

• 1.2 MHz 8-bit processor (6502/6507)1.2 MHz 8-bit processor (6502/6507)

• Custom chip (TIA)Custom chip (TIA)

– ““Television Interface Adaptor” -- codename StellaTelevision Interface Adaptor” -- codename Stella

– generated video signal to drive TVgenerated video signal to drive TV

Page 7: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

7Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Atari 2600 System DiagramAtari 2600 System Diagram

ProcessorProcessor65076507 ROMROM

TVTVTIATIA

chipchip

RAMRAM

I/OI/O65326532

joysticksjoysticks

Atari 2600 ConsoleAtari 2600 ConsoleGame CartGame Cart

video video + +

soundsound

paddlespaddles

Page 8: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

8Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Other 6502-based systemsOther 6502-based systems

Apple IApple I Apple IIApple II

Commodore VIC 20Commodore VIC 20

Commodore 64 (6210)Commodore 64 (6210)

Page 9: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

9Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

65026502 Memory map Memory mapx0000x0000

TRAP vector table

x00FFx00FF

x0100x0100 Exception vector tablex017Fx017F

x0180x0180 INTERRUPT vector tablex01FFx01FF

x0200x0200OS and

Supervisor Stackx2FFFx2FFF

x3000x3000USER program and User Stack

xFDFFxFDFF

xFE00xFE00DEVICE registers

xFFFFxFFFF

x0000x0000Zero Page

x00FFx00FF

x0100x0100System Stack

x01FFx01FF

x0200x0200

USER memory, device registers

xFFF9xFFF9

xFFFAxFFFA NMI handler addressxFFFBxFFFB

xFFFCxFFFC Power-On Reset handler addressxFFFDxFFFD

xFFFExFFFE BRK Interrupt handler addressxFFFFxFFFF

LC-3LC-3 Memory map Memory map

Page 10: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

10Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

65026502 Memory map Memory mapx0000x0000

Zero Pagex00FFx00FF

x0100x0100System Stack

x01FFx01FF

x0200x0200

USER memory, device registers

xFFF9xFFF9

xFFFAxFFFA NMI handler addressxFFFBxFFFB

xFFFCxFFFC Power-On Reset handler addressxFFFDxFFFD

xFFFExFFFE BRK Interrupt handler addressxFFFFxFFFF

0x00000x0000Stack

0x00FF0x00FF

0x01000x0100 4KB System Memory0x0FFF0x0FFF

0x10000x1000User Area

0x7BC00x7BC0

0x7BC10x7BC1 User Interrupt vector jump

table0x7BFF0x7BFF

0x7C000x7C00I/O ports

0x7FFF0x7FFF

0x80000x8000 Internal 64-byte register

block0x803F0x803F

0x80400x8040 External ROM(system code)0xFFFF0xFFFF

HC11HC11 Memory map Memory map

Page 11: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

11Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Atari 2600’s Atari 2600’s 65076507

• Same as the 6502, but:Same as the 6502, but:–13-bit address bus instead of 1613-bit address bus instead of 16

–No external interruptsNo external interrupts

• Cheaper 28-pin package, instead of Cheaper 28-pin package, instead of 6502’s 40-pin package6502’s 40-pin package

• Same as the 6502, but:Same as the 6502, but:–13-bit address bus instead of 1613-bit address bus instead of 16

–No external interruptsNo external interrupts

• Cheaper 28-pin package, instead of Cheaper 28-pin package, instead of 6502’s 40-pin package6502’s 40-pin package

Page 12: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

12Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Atari 2600’s Atari 2600’s 65076507 Memory Map Memory Map

• 00 - 2C: TIA chip registers00 - 2C: TIA chip registers

• 80 - FF: RAM80 - FF: RAM

• 280 - 281: Joystick port280 - 281: Joystick port

• 282 - 283: Console switches282 - 283: Console switches

• 284 - 297: Interval timer284 - 297: Interval timer

• F000 - FFFF: Game cartridge F000 - FFFF: Game cartridge ROMROM

• 00 - 2C: TIA chip registers00 - 2C: TIA chip registers

• 80 - FF: RAM80 - FF: RAM

• 280 - 281: Joystick port280 - 281: Joystick port

• 282 - 283: Console switches282 - 283: Console switches

• 284 - 297: Interval timer284 - 297: Interval timer

• F000 - FFFF: Game cartridge F000 - FFFF: Game cartridge ROMROM

x0000x0000

Zero Page

x00FFx00FF

x0100x0100System Stack

x01FFx01FF

x0280x0280

x0297x0297External I/O

Not Used

xF000xF000Game Cartridge

ROMxFFFFxFFFF

Page 13: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

13Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

6502 6502 ArchitectureArchitecture

• Accumulator Accumulator architecturearchitecture

• Multi-cycle Multi-cycle implementationimplementation

• 13 addressing 13 addressing modesmodes

• Accumulator Accumulator architecturearchitecture

• Multi-cycle Multi-cycle implementationimplementation

• 13 addressing 13 addressing modesmodes

Page 14: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

14Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Atari 2600 -- The Bad NewsAtari 2600 -- The Bad News

• No frame bufferNo frame buffer

• No cacheNo cache

• No floating-point mathNo floating-point math

• No multiply or divide instructionsNo multiply or divide instructions

– Adding two 8-bit integers: 10 Adding two 8-bit integers: 10 secsec

• Must generate a new video frame 60 times per Must generate a new video frame 60 times per secondsecond

– Using 5000 machine instructions per frameUsing 5000 machine instructions per frame

• No frame bufferNo frame buffer

• No cacheNo cache

• No floating-point mathNo floating-point math

• No multiply or divide instructionsNo multiply or divide instructions

– Adding two 8-bit integers: 10 Adding two 8-bit integers: 10 secsec

• Must generate a new video frame 60 times per Must generate a new video frame 60 times per secondsecond

– Using 5000 machine instructions per frameUsing 5000 machine instructions per frame

Page 15: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

15Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Atari 2600 -- The Good NewsAtari 2600 -- The Good News

• TIA chip – Television Interface AdapterTIA chip – Television Interface Adapter

• Hardware support for video gamesHardware support for video games

– SpritesSprites

– Collision detectionCollision detection

– Audio synthesisAudio synthesis

– Interval timerInterval timer

• TIA chip – Television Interface AdapterTIA chip – Television Interface Adapter

• Hardware support for video gamesHardware support for video games

– SpritesSprites

– Collision detectionCollision detection

– Audio synthesisAudio synthesis

– Interval timerInterval timer

Page 16: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

16Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Video standardsVideo standards

Page 17: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

17Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Horizontal resolution: 228 pixelsHorizontal resolution: 228 pixels

263 odd scan 263 odd scan lines in 1/60lines in 1/60thth secondsecond

Video FrameVideo Frame

NTSC standardNTSC standard

262 even scan 262 even scan lines in 1/60lines in 1/60thth secondsecond

525 scan lines 525 scan lines in 1/30in 1/30thth secondsecond

Page 18: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

18Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

228 pixels = 63.5 228 pixels = 63.5 secsec = 76 machine cycles= 76 machine cycles

262 scan lines262 scan lines

= 1/60 sec = 1/60 sec

Video FrameVideo Frame

Timing of Video FrameTiming of Video Frame

HorizHoriz

BlankBlank

Vertical Blank (Vertical Blank (VBLANKVBLANK interr.) interr.)

OverscanOverscan

192 192 lineslines

Page 19: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

19Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Frame TimingFrame Timing

• Kernel (display loop synced with scan beam)Kernel (display loop synced with scan beam)

– Vertical Blank: 30 scan linesVertical Blank: 30 scan lines Game playGame play

– 192 scan lines192 scan lines DisplayDisplay

– Overscan: 37 scan linesOverscan: 37 scan lines Game playGame play

– Vertical Sync: 3 scan linesVertical Sync: 3 scan lines

• Kernel (display loop synced with scan beam)Kernel (display loop synced with scan beam)

– Vertical Blank: 30 scan linesVertical Blank: 30 scan lines Game playGame play

– 192 scan lines192 scan lines DisplayDisplay

– Overscan: 37 scan linesOverscan: 37 scan lines Game playGame play

– Vertical Sync: 3 scan linesVertical Sync: 3 scan lines

Page 20: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

20Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Q: No Frame Buffer?Q: No Frame Buffer?How do you display anything?How do you display anything?

• A: There is a buffer that can hold one scan-lineA: There is a buffer that can hold one scan-line

– The processor keeps changing what’s in it as the The processor keeps changing what’s in it as the scan beam moves down the screen. scan beam moves down the screen.

• Unless the processor changes something, it Unless the processor changes something, it generates the same line again and againgenerates the same line again and again

– Vertical stripes when the processor crashes. Vertical stripes when the processor crashes.

• A: There is a buffer that can hold one scan-lineA: There is a buffer that can hold one scan-line

– The processor keeps changing what’s in it as the The processor keeps changing what’s in it as the scan beam moves down the screen. scan beam moves down the screen.

• Unless the processor changes something, it Unless the processor changes something, it generates the same line again and againgenerates the same line again and again

– Vertical stripes when the processor crashes. Vertical stripes when the processor crashes.

Page 21: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

21Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

TIA chip’s Scan-line Buffer:TIA chip’s Scan-line Buffer:6 “bit-planes” + background6 “bit-planes” + background

BackgroundBackground

Missile 1 1 bitMissile 1 1 bit

Player 0 8 bitsPlayer 0 8 bits

Missile 0 1 bitMissile 0 1 bit

Player 1 8 bitsPlayer 1 8 bits

Ball 1 bitBall 1 bit

Playfield 20 bitsPlayfield 20 bits

Page 22: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

22Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

• Sprite (P0)Sprite (P0)

– Move horizontallyMove horizontally

– Change graphicsChange graphics

– Change colorChange color

– Change widthChange width

– ReplicateReplicate

• Sprite (P0)Sprite (P0)

– Move horizontallyMove horizontally

– Change graphicsChange graphics

– Change colorChange color

– Change widthChange width

– ReplicateReplicate

Things sprites could doThings sprites could do

Page 23: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

23Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Kernel ProgrammingKernel Programming

• Kernel loop synchronized with scan beam.Kernel loop synchronized with scan beam.

– 76 machine cycles per scan-line.76 machine cycles per scan-line.

• Two-line kernels were usual.Two-line kernels were usual.

– 2 x 76 = 152 cycles for the loop2 x 76 = 152 cycles for the loop

• If it took one too many cycles, timing failed and If it took one too many cycles, timing failed and the TV screen rolled. the TV screen rolled.

• Kernel loop synchronized with scan beam.Kernel loop synchronized with scan beam.

– 76 machine cycles per scan-line.76 machine cycles per scan-line.

• Two-line kernels were usual.Two-line kernels were usual.

– 2 x 76 = 152 cycles for the loop2 x 76 = 152 cycles for the loop

• If it took one too many cycles, timing failed and If it took one too many cycles, timing failed and the TV screen rolled. the TV screen rolled.

Page 24: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

24Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Cycle CountingCycle Counting

• 33 LDALDA LINE_COUNTLINE_COUNT

• 22 SECSEC

• 33 SBCSBC P1_Y_COORDP1_Y_COORD

• 22 BPLBPL *+10*+10

• 33 LDYLDY P1_INDEXP1_INDEX

• 44 LDALDA (P1_PTR),Y(P1_PTR),Y

• 33 STASTA GRP1GRP1

• 22 BEQBEQ *+2*+2

• 55 INCINC P1_INDEXP1_INDEX

• 27 cycles total27 cycles total

• 33 LDALDA LINE_COUNTLINE_COUNT

• 22 SECSEC

• 33 SBCSBC P1_Y_COORDP1_Y_COORD

• 22 BPLBPL *+10*+10

• 33 LDYLDY P1_INDEXP1_INDEX

• 44 LDALDA (P1_PTR),Y(P1_PTR),Y

• 33 STASTA GRP1GRP1

• 22 BEQBEQ *+2*+2

• 55 INCINC P1_INDEXP1_INDEX

• 27 cycles total27 cycles total

Page 25: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

25Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Screen ShotsScreen Shots

• You could do a lot with this hardware.You could do a lot with this hardware.

• Every cart had a different kernel.Every cart had a different kernel.

• You could do a lot with this hardware.You could do a lot with this hardware.

• Every cart had a different kernel.Every cart had a different kernel.

Page 26: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

26Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Screen ShotsScreen Shots

Page 27: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

27Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Screen ShotsScreen Shots

Page 28: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

28Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Screen ShotsScreen Shots

Page 29: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

29Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Screen ShotsScreen Shots

Page 30: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

30Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Collision Detection:Collision Detection:Detects Video OverlapDetects Video Overlap

Collision when pair of “On” pixels Collision when pair of “On” pixels overlapoverlap

BackgroundBackground

Missile 1 Missile 1

Player 0 Player 0 Missile 0 Missile 0 Player 1 Player 1

Ball Ball Playfield Playfield

• 6 graphic objects (5 sprites + Play Field)6 graphic objects (5 sprites + Play Field)

– 15 possible pairs for collisions15 possible pairs for collisions

– 15 1-bit collision registers15 1-bit collision registers

• 6 graphic objects (5 sprites + Play Field)6 graphic objects (5 sprites + Play Field)

– 15 possible pairs for collisions15 possible pairs for collisions

– 15 1-bit collision registers15 1-bit collision registers

Page 31: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

31Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Sound GeneratorsSound Generators

• 2 sound generators (only 1 used in Adventure)2 sound generators (only 1 used in Adventure)

– 1-bit wide, 30 kHz sound signal1-bit wide, 30 kHz sound signal

– 4 bit volume control (16 volume levels)4 bit volume control (16 volume levels)

• Generates pseudo-random sequences Generates pseudo-random sequences

– 4-bit sound type register (16 sound timbres)4-bit sound type register (16 sound timbres)

– 5-bit frequency register (32 pitches)5-bit frequency register (32 pitches)

• Processor could change sound parametersProcessor could change sound parameters

• 2 sound generators (only 1 used in Adventure)2 sound generators (only 1 used in Adventure)

– 1-bit wide, 30 kHz sound signal1-bit wide, 30 kHz sound signal

– 4 bit volume control (16 volume levels)4 bit volume control (16 volume levels)

• Generates pseudo-random sequences Generates pseudo-random sequences

– 4-bit sound type register (16 sound timbres)4-bit sound type register (16 sound timbres)

– 5-bit frequency register (32 pitches)5-bit frequency register (32 pitches)

• Processor could change sound parametersProcessor could change sound parameters

Page 32: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

32Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Design of Atari 2600 AdventureDesign of Atari 2600 Adventure

• Directly inspired by the original text adventure Directly inspired by the original text adventure by Willie Crowther and Don Woods.by Willie Crowther and Don Woods.

• Main problems: Main problems:

– How to do in a 4K video game program what took How to do in a 4K video game program what took hundreds of K on a mainframe computer?hundreds of K on a mainframe computer?

– How to adapt the adventure game idea to the video How to adapt the adventure game idea to the video game medium?game medium?

– My boss told me it was impossible, and not to work My boss told me it was impossible, and not to work on it.on it.

• Directly inspired by the original text adventure Directly inspired by the original text adventure by Willie Crowther and Don Woods.by Willie Crowther and Don Woods.

• Main problems: Main problems:

– How to do in a 4K video game program what took How to do in a 4K video game program what took hundreds of K on a mainframe computer?hundreds of K on a mainframe computer?

– How to adapt the adventure game idea to the video How to adapt the adventure game idea to the video game medium?game medium?

– My boss told me it was impossible, and not to work My boss told me it was impossible, and not to work on it.on it.

Page 33: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

33Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Crowther & Woods Text AdventureCrowther & Woods Text Adventure

Welcome to Adventure!! Would you like instructions?YES

Somewhere nearby is Collosal Cave, where others have found fortunes in treasure and gold, though it is rumored that some who enter are never seen again. Magic is said to work in the cave. I will be your eyes and hands. Direct me with commands of l or 2 words.

You are standing at the end of a road before a small brick building. Around you is a forest. A small stream flows out of the building and down a gully.

Page 34: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

34Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Picking up ObjectsPicking up Objects

ENTER BUILDINGYou are inside a building, a well house for a large spring.There are some keys on the ground here.There is a shiny brass lamp nearby.

TAKE KEYSOK

TAKE LAMPOK

Page 35: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

35Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Carrying ObjectsCarrying Objects

LEAVE BUILDINGYou're in front of building.

INVENTORYYou are currently holding the following:Set of keysBrass lantern

Page 36: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

36Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Moving from Place to PlaceMoving from Place to Place

GO SOUTHYou are in a valley in the forest beside a stream tumbling along a rocky bed.

GO SOUTHAt your feet, all the water splashes into a 2-inch slit in the rock. Downstream the streambed is bare rock.

Page 37: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

37Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

ObstaclesObstacles

GO SOUTHYou are in a 20-foot depression floored with bare dirt. Set into the dirt is a strong steel grate mounted in concrete. A dry streambed leads into the depression.The grate is locked.

GO DOWNYou can't go through a locked steel grate!You're outside grate.The grate is locked.

Page 38: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

38Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Using ObjectsUsing Objects

USE KEYSThe grate is now unlocked.

GO DOWNYou are in a small chamber beneath a 3x3 steel grate to the surface. A low crawl over cobbles leads inward to the west.The grate is open.

GO WESTYou are crawling over cobbles in a low passage. There is a dim light at the east end of the passage. There is a small wicker cage discarded nearby.

Page 39: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

39Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Another ObstacleAnother Obstacle

GO WESTIt is now pitch dark. If you proceed you will likely fall into a pit.

LIGHT LAMPYou are in a debris room filled with stuff washed in from the surface. A low wide passage with cobbles becomes plugged with mud and debris here, but an awkward canyon leads upward and west. A note on the wall says "MAGIC WORD XYZZY".A three-foot black rod with a rusty star on an end lies nearby.

Page 40: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

40Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

CreaturesCreatures

GO WESTYou are in a splendid chamber thirty feet high. The walls are frozen rivers of orange stone. An awkward canyon and a good passage exit from east and west sides of the chamber.

There is a threatening little dwarf in the room with you!One sharp nasty knife is thrown at you!

It misses!

Page 41: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

41Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

How to Adapt Adventure Game Idea to How to Adapt Adventure Game Idea to Video Game Format?Video Game Format?

• How to display rooms?How to display rooms?

• How to display objects?How to display objects?

• How to display your own location?How to display your own location?

• How to move from room to room?How to move from room to room?

• How to display rooms?How to display rooms?

• How to display objects?How to display objects?

• How to display your own location?How to display your own location?

• How to move from room to room?How to move from room to room?

– One room on screen at a time, using playfield (PF) graphics.One room on screen at a time, using playfield (PF) graphics.– One room on screen at a time, using playfield (PF) graphics.One room on screen at a time, using playfield (PF) graphics.

– Use the Ball sprite. Joystick moves you.Use the Ball sprite. Joystick moves you.– Use the Ball sprite. Joystick moves you.Use the Ball sprite. Joystick moves you.

– P0 and P1 sprites.P0 and P1 sprites.– P0 and P1 sprites.P0 and P1 sprites.

– Move off the edge of screen to adjacent room.Move off the edge of screen to adjacent room.– Move off the edge of screen to adjacent room.Move off the edge of screen to adjacent room.

Page 42: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

42Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

How to Adapt Adventure Game Idea to How to Adapt Adventure Game Idea to Video Game Format?Video Game Format?

• How to pick up objects?How to pick up objects?

• How to drop objects?How to drop objects?

• How to use objects?How to use objects?

• How to do creatures?How to do creatures?

• How to pick up objects?How to pick up objects?

• How to drop objects?How to drop objects?

• How to use objects?How to use objects?

• How to do creatures?How to do creatures?

– Video overlap of Self and Object sprites.Video overlap of Self and Object sprites.– Video overlap of Self and Object sprites.Video overlap of Self and Object sprites.

– Video overlap of two objects.Video overlap of two objects.– Video overlap of two objects.Video overlap of two objects.

– Can carry only one object. Button on joystick drops it.Can carry only one object. Button on joystick drops it.– Can carry only one object. Button on joystick drops it.Can carry only one object. Button on joystick drops it.

– Object with subroutine to make it do things. Object with subroutine to make it do things. – Object with subroutine to make it do things. Object with subroutine to make it do things.

Page 43: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

43Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Network of 30 RoomsNetwork of 30 Rooms

Page 44: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

44Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Secret RoomSecret Room

• I created a secret room and hid my name I created a secret room and hid my name in it.in it.

• This was the first Easter Egg. This was the first Easter Egg.

– ““little hidden surprises”little hidden surprises”

• I created a secret room and hid my name I created a secret room and hid my name in it.in it.

• This was the first Easter Egg. This was the first Easter Egg.

– ““little hidden surprises”little hidden surprises”

Page 45: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

45Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

ObjectsObjects

• 3 Keys: opened castle doors.3 Keys: opened castle doors.

• Sword: killed dragons.Sword: killed dragons.

• Chalice: won the game. Chalice: won the game.

• Magnet: attracts other objects.Magnet: attracts other objects.

• Bridge: crosses maze walls.Bridge: crosses maze walls.

• Dot: gets you into secret room.Dot: gets you into secret room.

• 3 Keys: opened castle doors.3 Keys: opened castle doors.

• Sword: killed dragons.Sword: killed dragons.

• Chalice: won the game. Chalice: won the game.

• Magnet: attracts other objects.Magnet: attracts other objects.

• Bridge: crosses maze walls.Bridge: crosses maze walls.

• Dot: gets you into secret room.Dot: gets you into secret room.

Page 46: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

46Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

CreaturesCreatures

• 3 Dragons: chase you and eat you.3 Dragons: chase you and eat you.

• Bat: steals what you’re carrying, moves objects Bat: steals what you’re carrying, moves objects aroundaround

• BehaviorismBehaviorism

– Each creature had a prioritized list of objects to go Each creature had a prioritized list of objects to go toward or away from. Responded to highest priority toward or away from. Responded to highest priority object in the same room with it. object in the same room with it.

• 3 Dragons: chase you and eat you.3 Dragons: chase you and eat you.

• Bat: steals what you’re carrying, moves objects Bat: steals what you’re carrying, moves objects aroundaround

• BehaviorismBehaviorism

– Each creature had a prioritized list of objects to go Each creature had a prioritized list of objects to go toward or away from. Responded to highest priority toward or away from. Responded to highest priority object in the same room with it. object in the same room with it.

Page 47: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

47Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

State Diagram for DragonState Diagram for Dragon

Page 48: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

48Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Object ListObject List Data StructureData Structure

Ob # 0Ob # 0

Ob # 1Ob # 1

Ob # 2Ob # 2

Ob # 3Ob # 3

Ob # NOb # N

Ptr to locationPtr to location

Ptr graphics #Ptr graphics #

Ptr graphics tblPtr graphics tbl

ColorColor

Ob attributesOb attributes

graphics #graphics #

roomroom

X coordX coord

Y coordY coord

##

Graphics DataGraphics Data

##

##

Page 49: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

49Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Room ListRoom List Data StructureData Structure

Room 0Room 0

Room 1Room 1

Room 2Room 2

Room 3Room 3

Room NRoom N

Ptr to room grxPtr to room grx

ColorColor

Room attributesRoom attributes

RoomRoom

GraphicsGraphics

(21 bytes)(21 bytes)Adjacent NorthAdjacent North

Rooms SouthRooms South

EastEast

WestWest

Page 50: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

50Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Adventure RAM USageAdventure RAM USage

• Kernel variables: 18 bytesKernel variables: 18 bytes

• World state: 49 bytesWorld state: 49 bytes

• Program variables: 34 bytesProgram variables: 34 bytes

• Reserved for Stack: 14 bytes (max stack depth)Reserved for Stack: 14 bytes (max stack depth)

• Unused 13 bytesUnused 13 bytes

– TOTAL 128 bytes of RAMTOTAL 128 bytes of RAM

• Kernel variables: 18 bytesKernel variables: 18 bytes

• World state: 49 bytesWorld state: 49 bytes

• Program variables: 34 bytesProgram variables: 34 bytes

• Reserved for Stack: 14 bytes (max stack depth)Reserved for Stack: 14 bytes (max stack depth)

• Unused 13 bytesUnused 13 bytes

– TOTAL 128 bytes of RAMTOTAL 128 bytes of RAM

Page 51: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

51Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

Adventure ROM UsageAdventure ROM Usage

• Kernel and display code: 751 bytesKernel and display code: 751 bytes

• General adventure game code: 1081 bytesGeneral adventure game code: 1081 bytes

• Code for creatures and objects: 763 bytesCode for creatures and objects: 763 bytes

• Sound code and data: 221 bytesSound code and data: 221 bytes

• Data structures and graphics data: 1263 bytesData structures and graphics data: 1263 bytes

• Unused: 17 bytesUnused: 17 bytes

– TOTAL ROM 4096 bytesTOTAL ROM 4096 bytes

• Kernel and display code: 751 bytesKernel and display code: 751 bytes

• General adventure game code: 1081 bytesGeneral adventure game code: 1081 bytes

• Code for creatures and objects: 763 bytesCode for creatures and objects: 763 bytes

• Sound code and data: 221 bytesSound code and data: 221 bytes

• Data structures and graphics data: 1263 bytesData structures and graphics data: 1263 bytes

• Unused: 17 bytesUnused: 17 bytes

– TOTAL ROM 4096 bytesTOTAL ROM 4096 bytes

Page 52: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

52Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

SummarySummary

• First action-adventure video game.First action-adventure video game.

• Sold 1 million units ($25 retail).Sold 1 million units ($25 retail).

– I (Warren) got paid a salary ($22K/year). I (Warren) got paid a salary ($22K/year).

• First action-adventure video game.First action-adventure video game.

• Sold 1 million units ($25 retail).Sold 1 million units ($25 retail).

– I (Warren) got paid a salary ($22K/year). I (Warren) got paid a salary ($22K/year).

Page 53: Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112) 1 Warren Robinett University of North Carolina at Chapel Hill Department of Computer Science (Used

53Warren Robinett Warren Robinett (Rev. by A. Di Blas, UCSC, for CMPE112)(Rev. by A. Di Blas, UCSC, for CMPE112)

SummarySummary

• From the web: From the web: • From the web: From the web:

Thank you, Warren!Thank you, Warren!Thank you, Warren!Thank you, Warren!