A Nybble .On the Apple
Total Page:16
File Type:pdf, Size:1020Kb
A Nybble .on the Apple capabilities, I suggested that we sit down and implement a "Color Eater" algorithm with Apple-II's integer BASIC interpreter with color graphics extensions. I had first seen the Color Eater program demonstrated in an advanced graphics research laboratory late in 1975 (the idea of the program is not original with me, and I will provide the source upon request). The Color Eater always lives in the matrix in the color TV display at some point. The Color Eater is a very simple animal. It looks at its nearest neighbors in the color matrix, searching in a clockwise direction for its current "digestible" color. If it finds this color, it moves its location to the matrix position oJ that color, digests it into a new color, and reiterates its search. Occasionally, the Color Eater becomes a very frustrated little animal. It eats itself into a corner and no longer is able to find any digestible colors . When this catastrophe happens, it throws a fit and turns itself into another variety of Color Eater which can eat itself out of the frustration point. The result is a constantly changing random color pattern on the screen, illustrated in one state in this photo made with the Apple-II computer's output to a standard color television. That evening last November, Steve Jobs, Steve Wozniak and I sat down and Notes by Carl Helmers proceeded to use the Apple-II BASIC (which is a 5 K interpreter with 16 bit integer arithmetic) to program the Color Eater Next month, we'll have an article by Steve game. After perhaps 30 to 45 minutes, we Wozniac, designer of the App le-II computer, had a working BASIC langu age version describing this beautiful new conception of which used the Apple-II's graphics facilities. the small computer. As a taste of the Since it was done interpretively, the program Apple-II, here is one frame of the "Color ran a bit slow in this version, but it certainly Eater," an interesting program which illus illustrated the concept. Later, Steve Wozniak trates the faci liti es of the Apple-II. recoded the program using the 6502 The Apple-II , whi ch is to be introduced in processor's assembly language facil ity as April at the first West Coast Computer Faire implemented in the Apple-II, and reports in San Francisco, may be the first product to that the Color Eater now runs like lightning, fully qualify as the "appliance computer." wh ich is its normal mode of operation these An "appliance computer" is by definition a days as a demonstration program for the completed system which is purchased off the Apple-II. retail shelf, taken home, plugged in and If you attend the first West Coast used . I first saw the Apple-lion November Computer Faire, stop by the Apple Com 20 1976 when Stephen Wozniak and puter booth and take a look at this Stephen Jobs stopped by a motel room in interesting ·processor; if you don't see it in Palo Alto where I was staying at the time. person, then you'll have to wait until next They brought along the prototype Apple-II month's BYTE for a more complete to give a demonstration. description of the design concepts of the To serve as an interesting challenge to its machine as explained by Steve Wozniak.- 10 Photo 7: A color test chart showing the 75 shades of hue available fro m the Apple-II as presented on a typical commercial color set, using one of several RF modulators available on the mar/?et. Th e Apple BASIC program used to generate this color is shown in the text portion of this split screen (graphics and text) System Description display. Stephen Wozniak Apple Computer Co The Apple-II 20863 Stevens Creek Blvd B3-C Cupertino CA 95014 To me, a perso nal co mputer should be space for 8 K bytes of 4 K dynamic memory small, reli abl e, co nven ient to use an d in ex chips, and its shared video generation and pensive. dynami c memory refresh logi c. App le- I was Th e Apple-I, my first video oriented so ld as a completely asse mbl ed and tested single board computer, was des igned late in processor board with a price under $7 00 at 1975 and sold by word of mouth through the retail level. out California and later nationwid e through The latest result of my design activities is retail computer stores. I think that the the Apple-II which is the main subject of Apple-I co mputer was the first micropl"Oces th is system description article. The Apple-II sor system pl"Odu ct on the market to co m builds upon this idea by providing a co m pl etely integrate the display generation cir puter with more memory capability, a read cuitry, microprocessor, memory and power only memory (ROM) BASIC in terpreter, supply on the same board. Thi s mea nt that color video graphics as well as point graphics its owner could run the Apple BASIC and character graph ics, and extended sys inter preter with no add itional electroni cs tems software. other than a keyboard and video mon itor. The Apple-I video co mputer board was originally intended as a television terminal Integral Graphics product which could also operate in a stand A key part of the Apple-II design is an alone mode with out much in the way of integral vid eo displ ay generator which di memory, although it did have a processor, ~ec tly accesses the system's programmabl e 34 memory. Screen formatting and cursor co n maril y by the software sc rollin g routines in tro ls are rea li zed in my design in the form of th e system read on ly memory, about 200 bytes of read onl y memory whi ch Since the App le- II incorporates this di s are bu ilt into the Appi e-Il's mask pro play ge nerator as a part of its des ign, its text grammed 8 K bytes of read only memory. A mode beco mes the term in al for the system. 'I K byte segment of th e processor's main The displ ay has 24 rows of 40 characters memory is dedicated to the display ge ner disp layed on an ordinary bl ac k and wh ite or ator, although it is also accessibl e to pro color telev ision sc ree n. Eac h character in the gra ms , The di spl ay transfe r rate is th e time it Apple-II des ign is a 5 by 7 dot matrix, so the takes to fu ll y define the contents of th is present version of the system only imple segment of memory, and averages about ments upper case characters of the 6 bit 1000 characters per second, limi ted pri- ASCI I sub set, as we ll as the usual numbers ------, I V IDEO GENERATOR / MEMORY / PROCESSOR T IMING AND CON TROL I I <PI' ROW OR + + I CO LUMN SELECT +( I I ~ PHASE CO L OR VIDEO I GEN I--- ADDR* -~ PROGRAMMABLE SHIFTER GENERATOR MEM MEMORY 8 .J ADDR ADDRESS -- MU X (4 K TO 4 8 K BYTE S) 16 PR OC ESSOR I ADDR* COLOR - VIDEO ! -~ SIGNAL CHARACTER SERIALIZER MEMORY GENERATOR * ROW AND COLUMN DATA 8 A DDRESSES 8 IN SERIAL SERIAL VIDEO 8 MEMORY A VIDEO (C HAR) ./ DATA OUT (GRAPHICS) PROCESSOR BIDIRECTIONAL SYSTEM BUS ( SERIALIZER V 8 8 "MUX"o MULTIPLEXER SOFTWARE / VIDEO MODE CONTROL ~ CONTROLLED VIDEO MUX _____ ..J tlAVIDEO OUT TIMING : . <po l !"s . 6502 PROCESSOR'S <PI CLOCK SHOW ING WHEN AND BY WHOM MEMORY IS ACCESSED ~ ~ V IDEO ACCESS PROCESSOR AND MEMORY ACCESS AND REFRESH PROGRAM EX ECUTION Figure 1: A block diagram of the Apple- I I display generator. The generator sneaks into memory on the externally unused phase of the 6502 processor's 2 phase clock. The output of the memory is processed (after a I clock cycle delay) to produce a net video output through a software controlled video multiplexer. The three major modes of operation are: Color graphics, in which each 4 bit nybble of the byte is treated as a color definition code by the color generator. Character generation in which the 8 bit code is processed with a read only memory to generate a dot matrix pattern which is serialized and sent to the video multiplexer. Blacl?-white point graphics in which the 8 bit word from memOlY is used to control the contents of a segment of a 280 by 160 point grid. The timing diagram shows how the basic I iJ.S processor cycle period is split up into a video memory cycle and a microprocessor me mOlY cycle. Since the processor is engaged in in ternal house/?eeping operations during the first (high level) half of a ipl period, this segment of time can be used by the video generator to sneak into memory. Since all of memory is continuously being scanned by the low order bits out of video generator, the entire 48 K byte field (maximum) of dynamic memory is refreshed by the video portion of the cycle. (Refreshing of dynamic memory means scanning through all possible low order addresses to recharge the internal memory capacitors of the chips.) 35 Photo 2: This series of photos shows the steps in writing an animated BASIC game using the Apple-II com puter's BASIC interpreter.