Apple II Computer Graphics 1983
From the originals
13 scansMachine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.
These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.
Image 1
APPLE II COMPUTER GRAPHICS Ken Williams • Bob Kernaghan • Lisa Kernaghan
A book cover with a large blue glass-like apple silhouette behind the title and four computer-generated graphics panels showing a spaceship cockpit, a perspective grid corridor, a green dragon with a silhouetted figure, and a pie chart.
Reading notes: Author names are printed in smaller text near the bottom; the spelling 'Kernaghan' is as printed in the image and may be a variant of the name in other sources.
- Printed product names
- Apple II
- Languages
- English
PDF page 1
APPLE II COMPUTER GRAPHICS Ken Williams • Bob Kernaghan • Lisa Kernaghan
A book cover with a glossy blue apple silhouette on a dark background, framed by four low-resolution computer graphic images: a spaceship cockpit view, a wireframe corridor, a green dragon confronting a figure with a sword, and a pie chart.
Reading notes: Author names are small and legible but the bullet separators are rendered as dots; transcribed as printed.
- Printed product names
- Apple II
- Languages
- English
PDF page 2
APPLE II COMPUTER GRAPHICS
APPLE II COMPUTER GRAPHICS Ken Williams Bab Kernaghan Lisa Kernaghan illustrations by Gregory Paul Steffen Robert J. Brady Ca. A Prentice-Hall Publishing and Communications Campany Bowie, MD 20715
Reading notes: Transcript intentionally left empty per instructions; fields were filled from the supplied copy only. Headline is inferred from the stacked title lines APPLE II / COMPUTER / GRAPHICS and their line breaks. Visual layout and artwork could not be confirmed; the description relies on the supplied text. Names 'Ken Williams', 'Bab Kernaghan', 'Lisa Kernaghan', 'Gregory Paul Steffen', 'Robert J. Brady Ca.' and publisher line were not added to productNames because they are credits rather than advertised products. Supplied copy spells 'Campany' and 'Ca.' as printed; possible OCR or typographic errors in the source are not verified.
- Printed product names
- Apple II
- Languages
- English
PDF page 3
Executive Editor: David T. Culverwell Production Editor/Text Designer: Michael J. Rogers Art Director: Bernard Vervin Typesetting: Creative Communications Corporation Cockeysville, MD Typefaces: Eurostile (display); Optima (text) Printed by: R.R. Donnelley & Sons Company Harrisonburg, VA Cover Design: Don Sellers Indexer: Leah Kramer Apple 11 Computer Graphics Copyright© 1983 by Robert J. Brady Company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, in- cluding photocopying and recording, or by any information storage and retrieval system, without permission in writing from the publisher. For information, address Robert J. Brady Co., Bowie, Maryland 2071 5 Library of Congress Cataloging in Publication Data Williams, Ken, 1938- Apple 11 computer graphics. Includes index. 1. Apple II (Computer)-Programming. 2. Computer graphics. I. Kernaghan, Bob. 11. Kernaghan, Lisa. 111. Steffen, Gregory Paul. IV. Title. V. Title: Apple 2 computer graphics. VI. Title: Apple Two computer graphics. QA76.8.A662W54 1983 001.64'43 83-3871 ISBN 0-89303-315-4 Prentice-Hall International, Inc., London Prentice-Hall Canada, Inc., Scarborough, Ontario Prentice-Hall of Australia, Pty., Ltd., Sydney Prentice-Hall of India Private Limited, New Delhi Prentice-Hall of Japan, Inc., Tokyo Prentice-Hall of Southeast Asia Pte. Ltd., Singapore Whitehall Books, Limited, Petone, New Zealand Editora Prentice-Hall Do Brasil LTDA., Rio de Janeiro Printed in the United States of America 83 84 85 86 87 88 89 90 91 92 93 10 9 8 7 6 5 4 3 2 1
Reading notes: Product name appears as 'Apple 11' in the copyright line and title, while the cataloging data gives 'Apple 2' as a variant title; spelling preserved as printed.
- Printed product names
- Apple 11 Computer Graphics
- Printed dates
- 1983 · 83-3871 · 1938-
- Languages
- English
PDF page 4
Contents 1 Introduction 1 2 Computer Physiology 3 3 System Monitor-Memory Tricks 13 4 APPLESOFT Extensions 21 5 Graphics Modes and Soft Switches 31 6 Text and Low-Res 39 7 Preserving Your Pictures 53 8 Hi-Res Graphics 65 9 Hi-Res Color 81 10 Shaping Up 99 11 Graphs and Charts 119 12 Byte-Move Shapes 135 13 Advanced Moves 147 14 Collision Course 157 Appendix 1: Decimal, Hex, and Binary 165 Appendix 2: Character Codes: ASCII vs APPLE 175 Appendix 3: Memory Maps 177 Glossary 181 Index 186 iii
Reading notes: Chapter titles contain irregular spacing from extraction; some words may be split or misaligned
- Languages
- English
PDF page 5
Foreword The introduction of the Apple II computer marked a revolution in com- puters. For the first time there was a fully functional computing machine available which was priced affordably for home users. In addition to its powerful data processing capabilities, APPLESOFT had the first set of BASIC extensions which allowed the programmer true power and conven- ience when working with graphics. The six-color high resolution mode with the HCOLOR and HPLOT commands were "state of the art," and the SHAPE construct and associated DRAW, XDRAW, SCALE, and ROTate functions were ahead of their time. When I acquired my first Apple, the Low-Res "Little Brick Out" was considered a very good game, and Bob Bishop's "Applevision" demo was, and still is, awe-inspiring. But with literally millions of people seeing and using the Apple, advances in style and technique came rapidly as program- mers and "hackers" accepted and surmounted one challenge after an- other in their attempt to "do it better." The manuals state that only six colors are available on the High-Res screen, but Sierra On-Line soon developed over 100 colors. It was not supposed to be possible to put text on the High-Res screen, but doing so is now commonplace. The power, ingenuity, and persistence of the human mind has extended the capabilities of the Apple further than anyone had imagined possible. Like most of the current software companies, Sierra On-Line was born in long and solitary hours of developing newer, faster, and better methods of producing graphics on the Apple. In writing this book, it is my hope to introduce you to those advanced techniques such as Byte-Move, animation, and collision detection, as well as the standard Apple graphics. With the aid of my co-authors, who are professional teachers in addition to being experts in the field of home computers, I have tried to present those ideas in a manner which is clear and understandable, and which relies only on a knowledge of BASIC. I hope you find this book enjoyable to read as well as useful in your own program development. Ken Williams The author and publisher of this book have used their best efforts in preparing this book and the programs contained in it. These efforts include the development, research, and testing of the theories and pro- grams to determine their effectiveness. The author and publisher make no warranty of any kind, expressed or implied, with regard to these pro- grams or the documentation contained in this book. The author and publisher shall not be liable in any event for incidental or consequential damages m connection with, or arising out of, the furnishing, perfor- mance, or use of these programs. iv
Reading notes: OCR-style spacing irregularities in places; 'm connection' likely should read 'in connection'
- Printed product names
- Apple II · APPLESOFT · Little Brick Out · Applevision · Sierra On-Line
- Languages
- English
PDF page 6
1 Introduction The level of graphics for the Apple II has risen considerably since the early days when Little Brick Out was considered a major accomplishment. The industry standards now virtually require that good graphics be multi- colored and high resolution, and that the animation be smooth, clean, and fast, and collision detection quick and accurate. If you are at all familiar with the remarkable graphics effects on the market today, you have probably become curious about the methods used to generate them. This text will detail those aspects of Apple II graphics which are currently in common use; particularly with regard to Hi-Res, Low-Res, and Text Mode graphics, color generation, animation, and colli- sion detection. All subjects are presented for use by the APPLESOFT pro- grammer, but have extensions for the assembly and machine language programmers. In using this text, it is necessary to have the following equipment handy and ready to use: Apple II, Apple II+, or Apple lie computer Color Monitor or TV One or more disk drives and disks or A tape recorder and tapes Lots of paper A printer is helpful for graphics, but not necessary. This book is not written for the beginning BASIC programmer; it is neces- sary that the user of this book have some knowledge of BASIC program- 1
- Printed product names
- Apple II · Apple II+ · Little Brick Out · APPLESOFT
- Languages
- English
PDF page 7
2 APPLE II COMPUTER GRAPHICS
2 APPLE II COMPUTER GRAPHICS ming. The user should be familiar with the following commands: GR, COLOR, PLOT, HUN, VLIN, SCRN, HGR, HGR2, HCOLOR, HPLOT, DRAW, and XDRAW. If you are unfamiliar with APPLESOFT BASIC or these commands, please review the APPLESOFT Reference Manual before continuing. Before starting our journey into the world of graphics, it is prudent to arm ourselves with some relatively technical, often frustrating, but quite essential material. We assume you have a rudimentary knowledge of APPLESOFT BASIC and your Apple II system. So, let us begin with a discussion of the binary, decimal, and hexadecimal systems of numeration. The time has come, the walrus said To speak of many things. Of bits and bytes and peeks and pokes ...
Reading notes: Opening and closing lines of the source text are cut off mid-sentence, so the full reading order is uncertain. The verse at the end may be a quoted or decorative passage rather than instructional copy.
- Printed product names
- APPLE II · APPLESOFT BASIC · APPLESOFT Reference Manual
- Languages
- English
PDF page 8
Computer Physiology
2 Computer Physiology Objectives After reading Chapter 2 you should be able to: • Convert binary numbers to hexadecimal numbers and back. • Convert hexadecimal to decimal. • Understand the idea of memory addressing. • Use the post office box model for computer memory. Most beginning programmers work exclusively with the software phases of computing, and are content to leave the concern for such things as circuitry, memory allocation, and video display to computer engineers. But when one tries to work with microcomputer graphics using only the con- structs and commands available to BASIC or other high-level languages, he or she finds the going slow and awkward. To effectively utilize the graph- ics capabilities of your machine, you need at least a rudimentary concep- tual understanding of what is happening within the beast. To gain that necessary understanding, you will need a working knowl- edge of the binary, decimal, and hexadecimal systems of numeration. Decimal is the common base ten system which you ordinarily use, binary is the base two system which your computer uses, and hexadecimal, or hex, is the base sixteen system which is a useful compromise serving as the system of communication between you and your computer. Although your computer is capable of "speaking" BASIC and perhaps other languages, good graphics effects often require you to deal directly with system memory and use some machine level routines. Working at the 3
- Printed product names
- BASIC
- Languages
- English
PDF page 9
APPLE II COMPUTER GRAPHICS
4 APPLE II COMPUTER GRAPHICS machine's level means learning something about how the computer stores and processes data. Digressing ta Digital All of today's microcomputers use two-state digital circuitry. In relation to computers, digital circuitry means, in very loose terms, that all information is represented within the computer as a discreet state of a circuit-usually either off or on. The power light on your Apple is a good example; the light is either off or on, and by looking at the light, you can infer the state of your machine. There are analog computers whose basis for processing is not the pres- ence or absence of voltage, but instead the amount of voltage present in a circuit. However, it is operationally much easier to test for the presence or absence of voltage in a circuit than it is to determine the precise amount of voltage. You can imagine the complexity and accuracy required of a com- puter circuit to correctly and reliably represent a number such as 36,741 by analyzing only the amount of the voltage. For that reason the memory of your computer is digital, and consists of thousands of two-state microcir- cuits, where each circuit can be set either on or off. Since each circuit maintains or "remembers" the on or off state to which it was set, these circuits can be used to store all of the information which the machine is supposed to remember. RAM and ROM Your Apple II has two types of memory: RAM and ROM. ROM stands for Read Only Memory. The information contained in ROM is essentially per- manent and unalterable. You may read the information from ROM, but you cannot write to it or change it in any way (that is why it is termed "Read Only"). Your version of BASIC is stored in ROM, as are most of the other instructions which make your system operate. That is what makes the Apple II "intelligent" since its operating system is "on board" or "ROM resident." RAM is short for Random Access Memory; RAM is the working memory for your Apple. Whether you are writing, editing, or running a program, that program resides in RAM, as do all of the variables and other data you use. RAM is of great interest in graphics because the video output is simply displaying data from a secton of the RAM. The use of graphics then be- comes mostly a matter of putting the correct data into the proper place in memory. To make it easier to visualize, memory within the computer may be thought of as a great many switches, each of which is either on or off at any given time. Those memory switches are commonly called "bits," and
Reading notes: Running page header 'APPLE II COMPUTER GRAPHICS' is inferred as the primary heading rather than a clearly marked title Word 'secton' appears to be a typographical error for 'section' in the source copy
- Printed product names
- Apple · Apple II · BASIC
- Languages
- English
PDF page 10
CHAPTER 2-COMPUTER PHYSIOLOGY
CHAPTER 2-COMPUTER PHYSIOLOGY 5 ONE BIT ~ TWO CHOICES 21 TWO BITS FIRST BIT SECOND BIT ON ON ON OFF OFF ON OFF OFF FOUR CHOICES 22 THREE BITS FIRS! BIT SECOND BIT THIRD BIT ON ON ON ON OFF OFF OFF OFF ON ON OFF OFF ON ON OFF OFF EIGHT CHOICES 23 ON OFF ON OFF ON OFF ON OFF Figure 2-1. Bit combinations. once each RAM bit is set on or off, it remains in that state until altered by a command, or until the computer is turned off. (At which time the values in RAM are lost.) All of the computer's impressive capabilities rely on the lowly bit. One bit is quite a long way from making a computer, just as one grain of sand is a long way from being a beach. A bit, like a grain of sand, has little meaning individually, but when grouped with thousands of other bits, together they are able to take on meaning and form. Making It Happen with Ones and Zeros As stated earlier, each bit will take on only one of two states, on or off. In order to facilitate discussion, if a bit is on, it is said to have a value of 1; a bit which is off has a value of 0. Since each bit may only be 1 or 0, each bit conveys a very limited amount of information. In the example of your
Reading notes: Figure 2-1 table text is column-fragmented, so reading order of bit combinations may be uncertain. "FIRS!" appears to be an OCR error for "FIRST" in the source.
- Languages
- English
PDF page 11
6 APPLE II COMPUTER GRAPHICS computer's power light, you know only that the power is on or off, and nothing more. Two bits in a group combine in one of four (2 2 ) combina- tions: 00, 01, 10, and 11. (10 and 11 are interpreted as one-zero and one- one, respectively, not as ten and eleven.) Using the computer's power light together with the "in use" light of the disk drive can illustrate how two digital circuits can convey four pieces of information: If both lights are off, neither unit is operating. If the power light is on and the disk light is off, the computer is on but not the disk drive. If the power light is off but the disk light is on, the disk is operating but not the computer!?!!? (time to call the repairman). If both lights happen to be on, then both units are operat- ing. Similarly, a group of three bits allows for eight (2 3 ) combinations, and a group of four bits allows for sixteen (2 4 ). The number of possible combi- nations continues to increase exponentially as does the number of bits used. Figure 2-1 illustrates the possible combinations for one, two, and three bits. Bits in a Bag Your computer contains hundreds of thousands of bits. As we have seen, however, they must be grouped together in order to convey any significant information. Most microcomputers, including your Apple, group eight bits into a unit called a "byte." A byte is the fundamental unit of memory. The size of memory is usually discussed in terms of kilobytes ("K" for 1,000), or megabytes ("M" or Meg, for 1,000,000). A single eight-bit byte can represent any one of 256 possible values (2 8 = 256). Having 256 combinations works out conveniently to allow any letter or digit be assigned to one of those 256 combinations and repre- sented by it; the computer stores the character by storing the numeric code. If bits were only grouped six at a time, for example, you would only be able to form 64 (2 6 ) distinct combinations. However, the computer needs to have more than 64 distinct bit patterns available in order to uniquely represent each of the required characters, including all the keys on the computer keyboard-both upper and lower case, the special char- acters such as & and *, and the control codes such as CTRL-C. When you press a key, the computer actually receives an eight bit pat- tern; when you press "A" your Apple sees the pattern 11000001, and when you press the "*" key, the computer sees 10101010. Each character has its own unique bit pattern. After you press a key, the computer stores that particular bit pattern in a byte of memory. But now that the informa- tion is stored, the computer has to be able to locate it when it is needed, which leads us to .... Addressing Each byte in the Apple's memory is numbered sequentially, and that num-
Reading notes: Running page header 'APPLE II COMPUTER GRAPHICS' and page number 6 appear at top; no primary headline identified. Some words in source appear with broken or spaced characters (e.g., '2 2', '2 8', 'CTRL-C') that may reflect OCR spacing rather than original notation.
- Printed product names
- Apple · Apple II · Apple II Computer
- Languages
- English