Table of Contents Copyright Acknowledgments About the Author About the Series Editor Introduction The Significance of Retro Computer Systems You Really Can Learn to Program My Vision for This Book Chapter Bringing Your Retro Machine to Life Setting Up Your TRS-80 Color Computer Color Computer Storage Devices Setting Up Your Atari 400/800 Installation Instructions Installing the Power Supply Connecting the Atari to a Monitor Connecting Your Atari to a TV Installing Your Disk Drive Connecting the Joystick Setting Up Your Commodore 64 Setting Up Your Apple II Chapter Simply Complicated Game Programming Game Systems: Similar but Different Assembly Dialect The Memory Map CPU, Bus, and Memory Characteristics BASIC 101 Principles of BASIC The Variable Principle The Input Principle The Listing Principle The Math Principle The Logic Principle The Screen Mode Principle The Graphics Principle The Branch Principle The Looping Principle Chapter The Early History of Video Games Build It and They Will Come! Noughts and Crosses Willy Higinbotham's Game In a Land Far, Far Away Spacewar! The 1960s Return of the Killer Pong Spot Generators The Odyssey The Syzygy Atari and Pong The Knockoff Big Business The Birth of Vector Graphics Space Wars A New Age of Video Games Space Invaders Conclusion Chapter Assembly Language Understanding Assembly Language Moving Memory Around in Your Computer Understanding Numbers and Math in Assembly Language Addressing Modes Working with the Stack System Flags Logic and Branching Instructions Facing the Code 6502 Programming Sweet 16 Conclusion Chapter A Game Graphics Primer Color What Makes a Picture? Approximating Shapes with Limited Pixels Symbolism Visual Cues Putting Them Together Conclusion Chapter Setting the Video Mode Setting the Video Mode Setting the Video Mode on the COCO Setting the Video Mode on the Apple II Setting the Video Mode on the Atari 400/800 How Does the Display List Interrupt Work? Timing Considerations Multiple Display List Interrupts Create a Generic Display List Find the Location of Your Display List in Memory Find the Start of Video Memory Creating Your New Display List The Load Memory Scan Instruction Inserting the Remaining ANTIC Mode Lines A Look at What You Have So Far Switching Back to Video Memory Polishing Off the Display List And Then There Was Light A More Advanced Display List Creating a Generic Display List Inserting Text Mode Lines What's Next? Writing DLI Interrupts Writing a Display List Writing the Code for Your Display List Interrupt Guarding the Computer's Memory Writing the Actual Heart of the Display List Interrupt Converting Assembly Language Code to Decimal Inserting the Display List into Memory Setting the Video Mode on the Commodore 64 Conclusion Chapter Hacking the Video Buffer Identify the Characteristics of the Current Graphics Mode Video Buffer Hacking 101 Placing Data in the Video Buffer Page Flipping Conclusion Chapter Adding Player Input, Physics, and AI Creating Your Computer's Intelligence Tracking Algorithms Evasion Algorithms Better Tracking and Evasion Algorithms Patterns Random Movement Fuzzy Logic Reading Player Input Modeling Game Physics Thrust Friction Gravity Putting All the Forces Together Conclusion Chapter Sound Effects How Sound Works in the Real World Mimicking Real World Sounds on a Retro Game Machine Computers with Special Sound Hardware The Commodore 64 The Atari 400/800 Basic Sound Command Assembly Sound Programming Conclusion Chapter 10 Putting It All Together: Building Games The Universal Game Structure Initialization The Game Loop Cleanup Programming Text-Based Games What Is a Text-Based Game? Building Your First Text-Based Game The Story The Lay of the Land Creating Things That Go Bump in the Night Tools of the Trade Creating a Language for Your Game Writing the Code for Your Game Mapping Out Your Program Mapping Out Your World Jumping from Text-Based Games to Graphics-Based Games Conclusion Index Copyright © 2005 by Premier Press, a division of Course Technology All rights reserved No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system without written permission from Course PTR, except for the inclusion of brief quotations in a review The Premier Press logo and related trade dress are trademarks of Premier Press and may not be used without written permission Portions of the material in this book are copyright: ©A S Douglas 1952; ©Willy Higinbotham; ©Digital Equipment Corporation; ©Tech Model Railroad Club; ©1967 Ralph Baer; ©1972 Magnavox; ©1976 Fairchild Camera & Instruments; ©Taito, Corp All Rights Reserved.; ©Atari, Pac-Man™ ©Namco Limited, All Rights Reserved.; Donkey Kong™, ©Nintendo Games are the property of their respective owners Nintendo of America, Inc All other trademarks are the property of their respective owners Important: Course PTR cannot provide software support Please contact the appropriate software manufacturer's technical support line or Web site for assistance Course PTR and the author have attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the capitalization style used by the manufacturer Information contained in this book has been obtained by Course PTR from sources believed to be reliable However, because of the possibility of human or mechanical error by our sources, Course PTR, or others, the Publisher does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from use of such information Readers should be particularly aware of the fact that the Internet is an ever-changing entity Some facts may have changed since this book went to press Educational facilities, companies, and organizations interested in multiple copies or licensing of this book should contact the publisher for quantity discount information Training manuals, CD-ROMs, and portions of this book are also available individually or can be tailored for specific needs Library of Congress Catalog Card Number: 2005921081 Printed in the United States of America 05 06 07 08 09 BH 10 Course PTR, a division of Course Technology 25 Thomson Place Boston, MA 02210 http://www.courseptr.com Publisher and General Manager of Course PTR: Stacy L Hiquet Associate Director of Marketing: Sarah O'Donnell Marketing Manager: Heather Hurley Manager of Editorial Services: Heather Talbot Senior Acquisitions Editor: Emi Smith Series Editor: André LaMothe Marketing Coordinator: Jordan Casey Project Editor: Sandy Doell Technical Reviewer: Alex Varanese PTR Editorial Services Coordinator: Elizabeth Furbish Interior Layout Tech: Marian Hartsough Cover Designer: Mike Tanamachi Indexer: Sharon Shock Proofreader: Sara Gullion Dedication Then she said, "I want you to love me as a poet loves his sorrowful thoughts I want you to remember me as a traveler remembers a calm pool in which his image was reflected as he drank its water I want you to remember me as a mother remembers her child that died before it saw the light, and I want you to remember me as a merciful king remembers a prisoner who died before his pardon reached him I want you to be my companion, and I want you to visit my father and console him in his solitude because I shall be leaving him soon and shall be a stranger to him." Kahlil Gibran, Broken Wings To my mother who has passed away This book, like all positive things I do, is dedicated to you and your memory "He was a genius—that is to say, a man who does superlatively and without obvious effort something that most people cannot by the uttermost exertion of their abilities." Robertson Davies, Fifth Business This book is dedicated to all of the legends that made the video game industry, the computer industry, and indeed, the way of life we know today possible Acknowledgments First I must acknowledge my mother, who died so long ago For many years the loss of her tore me apart While other children existed in a state of eternal bliss, my mind strained under the weight of the burden of trying to comprehend the fact that she would never see me, and I would never see her, again Surely it was this that sobered me at such an early age and made me value every minute of every day I was unable to find peace until I realized that as long as I lived my life to the fullest of my ability, she would not be sad If I did something significant with my life, she would be happy So I ran full speed ahead through life trying to accomplish something, anything, that my mother could be proud of Only the faster I ran, the slower I seemed to move through life After years of running and getting nowhere, I crashed and burned There were many who loved me and wanted to help, but who can understand a motherless son? I thank my Grandmother, Hazel Cooper; my Father, Earl Carey; and my Uncle Farion; my aunts; my uncles; my cousins; my sister and brother, Earnessa and Earlin Carey; my teachers; everyone who toiled with me and trained me over the years I know now that it is not easy to raise a man We did not always agree, but in the end, we all have to live on this Earth together We may as well love each other and be done with it I have resolved myself to just that I thank my wife, Mitchlyn Carey When I was in a dark place, she was able to bring me light The two things I always wanted in life were to achieve greatness and to raise my family The path to having my own family always seemed uncertain, because with all of the troubles of this world, I knew I had little control over finding someone I could trust to the extent required for marriage You came and allowed me to find myself, and you helped to bring me from a very dark place I love you and I appreciate you, especially for bearing with me over the years as I moved from one project to the next, still trying to accomplish that one great elusive goal that I could not identify Most of all, I thank you for my son, Zurial Earl Carey Zurial, what was I doing with my life before I had you? I not even remember because it is impossible for me to envision a world without you You give my life new meaning Watching you grow amazes me How could so pure an entity exist? I love you, and whatever positive thing it takes for me to ensure that you reach your full potential will be done I need to thank my boss Kathy Ingraham for being so supportive of me in this venture When I needed time off to work or to recover from a long weekend of labor or even to take a trip to California to go to conferences, I always had full support I need to thank André LaMothe on so many levels Thanks for basically starting the whole game programming book industry Like so many programmers around the world, I gained much knowledge from the books André wrote This game programming series created an opportunity for my voice to be heard He took a chance on me, and I will never forget it Thank you I need to thank my project editor Sandy Doell She was patient and stern at the same time She kept me focused and made sure I got through author review I need to thank Alex Varanese for helping me to keep my facts straight I need to thank my acquisitions editor Emi Smith for her help I need to thank Heather Hurley for helping me with the marketing of this book Special thanks goes out to Mr Ralph Baer who assisted me with accuracy when writing the history section of this book Last, but by no means least, I need to thank all of the legends who created the game industry: Ralph Baer, Willy Higinbotham, Nolan Bushnell, Steve Jobs, Steve Wozniak the list goes on I thank everyone who made computers and their software Everyone who grew up on video games and all who are now growing up on video games All of you have helped to make the game industry what it is today About the Author EARL J CAREY began programming on the TRS-80 color computer at the age of He has created numerous C/C++, Visual Basic®, and assembly programs He now leads a fulfilling career as a computer programmer and graphic artist and is currently the chief graphic artist/programmer of Capital City Marketing in Nassau, Bahamas Carey recently delivered a lecture on Retro Game Programming at the Vintage Computer Festival 7.0 Visit his Web site at http://www.ristudios.net About the Series Editor ANDRÉ LAMOTHE, CEO of Xtreme Games LLC and the creator of the XGameStation, has been involved in the computing industry for more than 27 years He wrote his first game for the TRS-80 and has been hooked ever since! His experience includes 2D/3D graphics, AI research at NASA, compiler design, robotics, virtual reality, and telecommunications His books are best sellers in the game programming genre and his experience is echoed in the Thomson Course Technology PTR Game Development books You can contact André at ceo@nurve.net and www.xgamestation.com Letter from the Series Editor Over 25 years ago in the mid-1970s, there was a "singularity" in the computer industry where in a single moment everything changed This moment was, more or less, the introduction of the "computer" to the masses Now, some historians will argue when this actually occurred Some will say in 1974 when the Altair was released, others will argue it was the release of the Apple II in 1977 Still others will say that the creation of Atari and PONG in 1972 was the big bang Whomever you tend to agree with more, there is no arguing that in a short period of time we had a "punctuated" evolution in the computing industry I was only a boy when this happened, but I can tell you it was the most exciting thing that I have ever been part of Atari, for example, was the fastest growing company in history—period! People literally slept outside of Atari to try and get jobs there And Apple Computer when it went public was the largest public offering in American history Commodore Business Machines, when they acquired the Commodore computer, ended up selling more computers than anyone in history (at the time) making the Commodore C64 the world's best selling computer So what all these companies and historic events have in common? Video games! For example, Nolan Bushnell, founder of Atari in 1972, wanted to create games; specifically, he wanted to create a cheap, high quality version of the Spacewar! game he had played while attending college The results of this were Computer Space and the first steps of Atari Atari was the quintessential, prototypical model of all the Silicon Valley companies to follow Nolan Bushnell was the "rock star" of technology and games and the first Silicon Valley millionaire with the jet and the $25M in change to prove it from the sale of Atari But wait; there's more At the same time Atari was in its heyday in the late 1970s, a young programmer/tech named Steve Jobs was working there Steve had a friend, Steve Wozniak, and together they would create Apple Computer The interesting thing, however, is that the Apple computer and Steve Jobs' experience with customer satisfaction, marketing, and human factors all came from Atari Steve Wozniak, the technical genius behind the Apple I/II, made the Apple simply to play games The stories go on and on, all of them intertwined, but all of them connected to video games in one way or another Even the great duo, John Romero and John Carmack, were Apple programmers first; they turned to IBM PCs later Retro game programming is not only fascinating from a technical standpoint, but the history and stories are even more fascinating to study Entire empires were created because of video games! And the technology we have today has its roots in games, so studying this material and getting into the minds of the early hardware and software developers is a treat that everyone should indulge in This book will introduce you to the brilliance of these early innovators, their machines, and their games With that, please enjoy Retro Game Programming: Unleashed for the Masses as your first step on this incredible journey of discovery Sincerely, André LaMothe 2005 Game Development Series Editor Introduction memory location miscellaneous set/reset shift rotate stack manipulation subroutine transfer instructions 6809 processors, = (equals sign), [A] absolute addressing mode, accumulator addressing mode, addition binary number system decimal numbering system addresses addressing modes absolute accumulator binary number system decimal numbering system hexadecimal numbering system immediate implied indexed indirect indirect absolute indirect indexed LDA instruction example relative zero page zero page indirect top of display lists, reading and changing Adventure for Gamers, AI (artificial intelligence) binary logic evasion algorithms fuzzy logic patterns random movement tracking algorithms Alcorn, Al, 2nd 3rd algorithms evasion tracking American Ephemeris, amplitude, sound, AND command, And Gates, André LeMothe X Game Station, ANTIC command, 2nd 3rd 4th 5th 6th Apple II setup instructions video buffer location and sizes video mode setup arithmetic instructions, 6502 processor instruction sets, Armor Attack, arrays defined multiple dimension single dimension two-dimensional 2nd artifacts, artificial intelligence (AI) binary logic evasion algorithms fuzzy logic patterns random movement tracking algorithms assembly dialect game systems, Assembly, Atari 400/800 installation Atari to monitor connections Atari to TV connections audio transmission channel selection switch chroma transmission disk drives joystick connections luma transmission monitor port power port power supply power switch serial port setup instructions sound effects video buffer location and sizes video mode setup display lists screen modes work area screen shot attack, sound, Attract mode, display lists, AUDC registers, sound effects, [B] B (BRK) system flag, back panel, Commodore 64, Baer, Ralph, 2nd handwritten notes Home TV Game prototype illustration light gun concept Odyssey spot generators (hand drawn schematics) video game and TV integration Barrier, base 10, decimal numbering system, base 2, binary number system, BASIC (Beginner's All-purpose Symbolic Instruction Code) branch principle graphics principle input principle listing principle logic principle looping principle math principle overview principles screen mode principle variable principle Bender, Bill, binary logic, binary number system addition and subtraction addressing modes base two bit masking, blank eight line instruction, blank line instruction, block arrangements, graphic images, BNE command, Bohr atom, boot screen, TRS-80 Color Computer, bouncing ball demonstration, branching instructions, 6502 processor instruction sets branch principle Breakout, BRK (B) system flag, Brown, Bob, buffers keyboard buffers 2nd 3rd video buffers clear screen procedure double buffering locations and sizes page flipping placing data in Bulletin Board System, bus characteristics, game systems, Bushnell, Nolan, 2nd 3rd 4th [C] C (CARRY) system flag, cable arrays, Commodore 64, Campman, Herbert, Capps, Andy, CARRY (C) system flag, cassette port, TRS-80 Color Computer, cassette tapes, TRS-80 Color Computer, Catch, cathode ray tube (CRT), CBS Opening, center screen point, display lists, Central Processing Unit (CPU), 2nd 3rd Channel F video game machine, channel selection switch Atari 800 installation TRS-80 Color Computer chroma transmission, cleanup, universal game structure, clear screen procedure, clear screen procedure, clearing memory, COCO (TRS-80 Color Computer) boot screen cassette port cassette tapes channel selection switch Extended color basis floppy disk drive installation illustration joystick ports power switch REM jack reset switch RF switch ROM cartridge connector serial port storage devices video buffer location size video mode setup Coleco, color COLOR command four-color graphics mode RGB (Red, Green, and Blue) value SETCOLOR command color clock, commands AND ANTIC 2nd 3rd 4th 5th 6th BNE COLOR DATA DIM 2nd DRAWTO END IF example of FOR GOTO GRAPHICS IF IF THEN INY JMP JVB LDD LDX LET LIST LMS 2nd 3rd NAME NEW 2nd 3rd NEXT NMI OR PEEK 2nd 3rd PHA PHP PLA 2nd PLOT PLP POKE 2nd print 2nd 3rd READ 2nd READY RETUN RND RTI 2nd RUN SCRNH SCRNL SETBV SETCOLOR stored letters TAX 2nd TAY THEN WSYNC 2nd Commodore 64 setup instructions sound effects video buffer location and sizes video mode setup complexity levels, game creation, connections Atari to monitor Atari to TV conversions, to decimal numbering system, coordinate systems, PLOT command, Corman, Roger, Cosmic Chasm, course scrolling, CPU (Central Processing Unit), 2nd 3rd Crane, David, Creative Computing magazine, creativity suggestions, game creation, Crossfire, crowbar modulation, CRT (cathode ray tube), cycles, sound, [D] D (DECIMAL MODE) system flag, Dabney, Ted, daisy chains, disks, DATA command, day and night variations, graphic images, Death Race, decay, sound, DECIMAL MODE (D) system flag, decimal numbering system addition and subtraction addressing modes base 10 conversions to discussed decrement instructions, 6502 processor instruction sets, Demon Attack, Dennis, Jack, design time, dialects, assembly, Digital Equipment Corporation (PDP-1), DIM command, 2nd direct memory access (DMA), Disk Basic operating system, disk drives Apple II setup instructions Atari 800 2nd Atari installation display list interrupt (DLI), display lists address, reading and changing to top Atari 400/800 video mode setup Attract mode center screen point creating new in memory, finding location of inserting into memory course scrolling discussed fine scrolling horizontal course scrolling scrolling implementation Jump on Sync instruction load memory scan instruction multiple start of video memory, finding switching back to video memory text editor memory text mode lines, inserting text windows, placing at top of screen timing considerations writing distorted sound effects, dithering, graphic images, division operator (/), DLI (display list interrupt), DMA (direct memory access), dollar sign ($), Doodle, double buffering, Dougherty, Brian, Douglas, A S (Noughts and Crosses), Dr Pong, Drag Race, drawing lines, DRAWTO command, Dvorak, Robert V., [E] Easter egg, Edwards, Dan, Elimination, Eloping, END IF command, environment options, text-based games, equals sign (=), Etlinger, Lou, evasion algorithms, Expensive Planetarium (Peter Samson), Expensive Typewriter (Steve Piner), Extended color basic, TRS-80 Color Computer, [F] fear factors, game creation, female adaptors, Atari to TV connections, fight scenes, game creation, fine scrolling, flag instructions, 6502 processor instruction sets, flags, flat sound, FLIT debugging program, floppy disk drive installation, TRS-80 Color Computer, Flyball, FOR commands, forces friction 2nd gravity 2nd thrust Formula K, four-color graphics mode, friction 2nd Fulop, Rob, fuzzy logic, [G] game loop, game systems assembly dialect bus characteristics CPU memory characteristics memory map gates, generic variables, GOTO command, Graetz, J.Martin, 2nd Grand Theft Auto series, graphics block arrangements and color options day and night variations dithering four-color mode GRAPHICS command graphics principle COLOR command DRAWTO command PLOT command human reconstruction rods and cones screen modes screen resolution symbolism vector graphics, gaming development and visual cues and graphics-based games, gravitational force, 2nd gravity calculations, Greenwich time zone, Grubb, Bill, [H] hackers, half clocks, handwritten notes (Ralph Baer), HAX, Heavy Star, hertz sound measurement, hexadecimal numbering system, high-pitched tones, sound and, Higinbotham, Willy, 2nd Hockey TV, Home TV Game prototype (Ralph Baer), horizontal blank 2nd horizontal course scrolling, horizontal scan line, human anatomy, graphic images, human-computer interaction thesis (A S Douglas), Hyperspace Minskytron, [I] I (IRQ DISABLED) system flag, I/O connectors, disk drive installation, IF command, IF THEN command, immediate addressing mode, implied addressing mode, in line connectors, Atari 800, 2nd increment instructions, 6502 process instruction sets, indexed indirect addressing mode, indirect absolute addressing mode, indirect indexed addressing mode, Indy 800, initialization code, input design time input principle INPUT statement NEW command player runtime installation, Atari 800 Atari to monitor connections Atari to TV connections audio transmission channel selection switch chroma transmission disk drives joystick connections luma transmission monitor port power port power supply power switch serial port instruction sets 6502 processors arithmetic instructions branch instructions decrement instructions flag instructions increment instructions memory location miscellaneous instructions set/reset instructions shift rotate stack manipulation instructions subroutine transfer instructions SWEET 16 interrupts defined DLI (display list interrupt) pre-interrupt state Y2K and INY command, IRQ DISABLE (I) system flag, [J] Jaws, JMP command, Jobs, Steve, joysticks Apple II setup instructions Atari 800 2nd joystick ports, TRS-80 Color Computer Jump on Sync instruction, display lists, JVB command, [K] Kaplan, Larry, Kee Games, 2nd Keenan, Joe, keyboard buffers, 2nd 3rd Kobel, Dennis, Kotok, Alan, [L] Lackoff, Sam, LDA (Load Accumulator), 2nd LDD command, LDX command, LEA (Load Effective Address), Lee, Harold, Lensman, Gray, LET command, life-energy forms, game creation, light gun concept (Ralph Baer), lines drawing text mode listings LIST command program listings LMS command, 2nd 3rd Load Accumulator (LDA), 2nd Load Effective Address (LEA), locations, video buffers, logic instructions logic principle memory maps and long tanks, loops FOR command looping principle nested NEXT command luma transmission, [M] male adapters, Atari to TV connections, Martin, Derry, math principle, mathematical expressions, mathematical operations binary number system addition and subtraction addressing modes base two decimal numbering system addition and subtraction addressing modes conversions to discussed discussed hexadecimal numbering system Meister, William F Von, memory 6502 processor instruction sets clearing display lists in, finding location of DMA (direct memory access) inserting display lists into course scrolling discussed fine scrolling horizontal course scrolling scrolling implementation keyboard buffers 2nd 3rd memory characteristics, game systems safe storage text editor video video mode memory maps discussed logic instruction and video memory and Miller, Alan, Minsky, Marvin, Missile Command, mode lines, monitor port, Atari 800 installation monitors Atari connection receivers and Mortal Kombat, mouse in a maze, movement, random, multiple dimension arrays, multiplication operator (*), [N] N (NEGATIVE) system flag, NAME command, Nautical Almanac, NEGATIVE (N) system flag, nested loops, NEW command, 2nd 3rd NEXT command, night and day variations, graphic images, Night Driver, NMI command, Noughts and Crosses (A S Douglas), [O] Odyssey (Ralph Baer), Opcode, operands, defined, OR command, Or Gates, OS9 operating system, over scan, OVERFLOW (V) system flag, [P] Pac Man, Paddle Ball, page flipping, video buffers, passwords logic and branching instructions password buffer patterns, PDP-1 (Digital Equipment Corporation), PEEK command, 2nd 3rd PHA command, PHP command, Piner, Steve, Ping-Pong, 2nd pitch options, sound effects, PLA command, 2nd player input, player names, game creation, PLOT command, PLP command, POKE command, 2nd POKEY sound chips, 2nd 3rd Pong Cocktail, PONG Doubles, Pong on a chip, Pong Tron II, Pong Tron, Pong, power port, Atari 800 installation, power supply Atari 800 2nd Commodore 64 power switch Apple II Atari 800 installation TRS-80 Color Computer printing print commands 2nd 3rd variables Pro Hockey, program listings, Puppy Pong, [Q] Quadra Doodle, Quadrapong, QUAKE, Quiz Show, [R] RAM (random access memory), 2nd random movement, random number generators, raster video display, READ command, 2nd READY command Rebound, receivers and monitors, reconstruction, Red, Green, and Blue (RGB) color value, register variables, registers defined SWEET 16 instruction set relative addressing mode, release, sound, REM jack, TRS-80 Color Computer, reset switch, TRS-80 Color Computer, resolution, RETUN command, reward system, game creation, RF switch Atari 800 2nd Commodore 64 TRS-80 Color Computer RGB (Red, Green, and Blue) color value, Rip Off, RND command, rods and cones, ROM cartridge connector, TRS-80 Color Computer, Ross, Douglas T., RTI command, 2nd RUN command, runtime, Rusch, Bill, Russell, Stephen R., 2nd [S] S (system) register, safe memory storage, SAM (Synchronous Address Multiplexer), 2nd Samson, Peter (Expensive Planetarium), Saunders, Robert A., scan lines, 2nd screen modes Apple II Atari 400/800 video mode setup screen mode principle screen resolution SCRNH command SCRNL command scrolling course fine horizontal mplementation serial cables, Atari 800, serial ports Atari 800 installation TRS-80 Color Computer set/reset instructions, 6502 instruction sets, SETBV command, SETCOLOR command, setup instructions Apple II Atari 800 Commodore 64 shadows, graphic images, Shark Jaws, shift rotate instructions, 6502 processor instruction sets, Shooting Gallery, side panel, Commodore 64, Simon, sine waves, sound and, single dimension arrays, sizes, video buffers, Smith, Bob, Smith, Edward Elmers, 2nd Soccer, Solar Quest, Soloman, Bob, sound amplitude attack AUDC registers cycles decay distorted flat hertz measurement high-pitched tone example on Atari 400/800 on Commodore 64 pitch options POKEY sound chips 2nd 3rd release sine waves and sources sustain timing mechanisms vibration and voice channels wavelengths 2nd Space Invaders, Space Wars, Spacewar!, 2nd 3rd 4th Spike, spot generators, hand drawn schematics (Ralph Baer), Sprint 8, Sprint II, STA (Store the accumulator), 2nd stack manipulation instructions, 6502 processor instruction sets, stacks, Star Castle, Starhawk, stick figures, human graphics, Stockham, Thomas, storage devices, TRS-80 Color Computer, Store the accumulator (STA), 2nd story lines, text-based games, string variables, subroutine instructions, 6502 instruction sets, subtraction binary number system decimal numbering system Super Bug, Super Death Chase, Super Pong, Super Soccer, sustain, sound, SWEET 16, symbolism, graphic images, Synchronous Address Multiplexer (SAM), 2nd system flags discussed zero flag Syzygy [T] Tailgunner, Tank 8, Tank II, Tank!, 2nd TAX command, 2nd TAY command, Tech Model Railroad Club (TMRC), Tennis for Two, tennis programming, Tennis Tourney, Terminate and Stay Resident (TSR) program, Tetris, text editor memory, text mode lines, text screen modes, text windows, placing at top of screen, text-based games complexity levels creativity suggestions environment options fear factors fight scenes graphics-based games life-energy forms overview player names reward systems story lines weapon choices TF variable, The Manhole, The Minskytron, THEN command, thrust, Tic-Tac-Toe, 2nd tiling systems, timing considerations, display lists, timing mechanisms, sound effects, TMRC (Tech Model Railroad Club), Touch Me, tracking algorithms, transfer instructions, 6502 instruction sets Tremblay, Bob, Tri:Pos Three-Position Display, TRS-80 Color Computer (COCO) boot screen cassette port cassette tapes channel selection switch Extended color basic floppy disk drive installation illustration joystick ports power switch REM jack reset switch RF switch ROM cartridge connector serial port storage devices video buffer location and size video mode setup up TSR (Terminate and Stay Resident) program, TU variable, turn-based games, TV connections, Atari, TV Football, TV Ping-Pong, TV Table Tennis, Twin Racer, two-dimensional arrays, 2nd TX-0, TXTH variable, TXTL variable, [U] U (user) register, Ultra Tank, universal game structure, [V] V (OVERFLOW) system flag, Valentine, Don, variables creating defined dollar signs in generic mathematical expressions printing register string TXTH TXTL variable principle vector graphics, gaming development and, vertical blank, 2nd vibration, sound and, video buffers clear screen procedure double buffering locations and sizes page flipping placing data in video cables Apple II setup instructions Atari 800 2nd Commodore 64 2nd Video Display Generator (VSG), video memory, 2nd video mode Apple II Atari 400/800 display lists screen modes COCO (TRS-80 Color Computer) Commodore 64 horizontal scan line memory controls video buffer visual cues, graphic images, voice channels, VSG (Video Display Generator), [W] Ward, John E., Warrior, wavelengths, sound, 2nd weapon choices, game creation, Whitehead, Bob, Winner, Witanen, Wayne, work area screen shot, Atari 800, Wozinak, Steve, WSYNC command, 2nd [X] XOR Gates, [Y] Y2K, interrupts and, [Z] Z (ZERO) system flag, Zadeh, Lotfi, ZERO (Z) system flag, zero flad, zero page addressing mode, zero page indirect addressing mode, ... Initialization The Game Loop Cleanup Programming Text-Based Games What Is a Text-Based Game? Building Your First Text-Based Game The Story The Lay of the Land Creating Things That Go Bump in the Night... www.ristudios.net for more information and a chance to interact with your fellow retro game programmers around the world The Web site for this book is retrogameprogrammingunleashed.com There you will... things, including the source code for the programs in this book, source code for even more retro games, bonus information, and links to many other sites of interest to the retro game programmer