APPLE IIGS SUPPLEMENT TO THE PROTON COMMAND SYSTEM Written by Brian Campbell For Apple II GS Computer Systems Apple, Apple IIGS, and ProDOS are registered trademarks of Apple Computer, Inc. Copyright 1994 Brian D. Campbell. All rights reserved. No part of this manual may be reproduced, transmitted, or stored in a data retrieval system in any form or by any means, electronic, mechanical, or otherwise, including photocopying or recording without the written permis- sion of Brian D. Campbell. Printed in the United States of America. Page - 2 Apple IIGS Supplement to the Proton Command System OVERVIEW This supplement describes commands that are included as part of the GS ver- sion of the Proton Command Shell (PCS). For more information about the PCS, refer to the Proton Command Shell Reference Manual. For information about writing programs that use the IIGS Toolbox, refer to the Proton Pro- gramming Language Reference Manual (in particular, refer to the TOOL state- ment). To use these commands, copy them to the CMDS directory (or whatever direc- tory you have elected to specify on the CMDPATH parameter). For example, to use the VIEWPNT and VIEWSHR commands, enter: COPY GS.CMDS/VIEWPNT CMDS/VIEWPNT COPY GS.CMDS/VIEWSHR CMDS/VIEWSHR Alternatively, you can go to the GS command directory, and specify full path names for the file parameters (where files are specified). For exam- ple: PREFIX GS.CMDS VIEWSHR /MYDISK/DIR/GREAT.PIC Page - 3 Apple IIGS Supplement to the Proton Command System Warning: If the FINDER is active, you may need to use the FREESHR command before using the commands listed in this Reference. Page - 4 Apple IIGS Supplement to the Proton Command System SUMMARY OF GS PROTON COMMANDS Parameters are for commands that support them. Brackets [] are used to denote optional parameters. EXPANDGIF - Convert a GIF file to the Expanded Graphic format EXPANDGIF gif.file exp.file FREESHR - Free the Super High Res screen from the IIGS Finder MAKEPNT - Convert an Expanded Graphic file to a paint file MAKEPNT [-ca] exp.file pnt.file PRINTSHR - Prints the SHR screen to an Epson printer PRINTSHR shr.file RETSHR - Return the Super High Res sceen to the IIGS Finder SHOWSHR - Display several SHR pictures in sequence SHOWSHR seq.file Page - 5 Apple IIGS Supplement to the Proton Command System SLIDESHR - Take an SHR picture and make a "sliding" puzzle SLIDESHR shr.file VIEWPNT - Display a paint file (PNT) and convert it to a SHR file VIEWPNT pnt.file [shr.file1 ... shr.filen] VIEWSHR - Display a Super High Res (SHR) file on the screen VIEWSHR shr.file Page - 6 Apple IIGS Supplement to the Proton Command System GS PROTON COMMAND DESCRIPTION EXPANDGIF gif.file exp.file This command takes a GIF format file and produces an expanded format file (a larger file with a simpler format). GIF (Graphics Interchange Format) is a standard for storing graphics information in a compressed format that can be shared among computers. The expanded format consists of two binary words (containing the image width and height in pixels), a color map, followed by the pixel image data. The color map consists of a byte (say n) that represents the number of colors (less one) used in the image, followed by an array of n + 1 color values. Each color value consists of three bytes, where each byte represents the intensity of the color's Red, Green, and Blue components on a scale of 0 to 255. The image data consists of width times height bytes where each byte represents a pixel. The value of each byte represents an index into the color map array. The image data bytes are ordered left to right first, then top to bottom. Page - 7 Apple IIGS Supplement to the Proton Command System See also the MAKEPNT command. FREESHR This command must be run prior to executing any PCS commands that use the Super High Resolution (SHR) Screen, but only if the PCS was invoked from the IIGS finder. The Apple IIGS finder ordinarily keeps the SHR screen locked up. But this command frees it up for use by PCS commands that dis- plays data on the SHR via the Quick draw II tool box. It is not harmful to run this command when the finder is not active, although it has no effect. See also the RETSHR command. MAKEPNT [-ca] exp.file pnt.file This command takes an expanded graphics formatted file (like one produced by EXPANDGIF) and converts it to a PNT file. By default, MAKEPNT creates a gray scale image (if the input image has more than 16 colors), using all of the pixels in the original image. Page - 8 Apple IIGS Supplement to the Proton Command System Adding the option -c creates a color dithered image instead of a gray scale one. Adding the -a option eliminates every sixth pixel scanline to create an im- age that has a 1 to 1 aspect ratio on the IIGS screen (to compensate for the fact that IIGS SHR pixels are not quite 1 to 1). That is, if the original image does not have a distorted aspect ratio, use -a to create an image that will not appear distorted on the IIGS screen. Both options may be combined as -ca. See also VIEWPNT. Note that you can defer the use of the aspect ratio op- tion -a by using a feature in VIEWPNT. Note: If the expanded graphics image contains 16 colors (or less) in the color table, the PNT image will contain all color information represented in the file. If the image has more colors, then some color information will be lost because the image will be coerced to 16 color values. The command will translate the image colors to one of 16 gray levels (if -c is Page - 9 Apple IIGS Supplement to the Proton Command System omitted), or will translate pairs of pixels to a dithered pair that approx- imates the original color information (if -c is given). PRINTSHR shr.file This command prints a SHR file on an EPSON FX-80 compatible printer con- nected via an Apple compatible parallel card. It uses multiple passes to simulate a black and white half tone image. (Printing with this command may take a long time.) RETSHR This command returns the SHR screen back to the Finder. It must be run prior to returning the IIGS finder, if the FREESHR command was previously executed. See also the FREESHR command. SHOWSHR seq.file Page - 10 Apple IIGS Supplement to the Proton Command System This command displays a series of SHR files in succession. The SHR files are listed in the input file seq.file. Each line of the text file seq.file should start with a number, be followed by one or more blanks and then the name of an SHR file. The number represents how many 1/10ths of a second (approximately) that the adjacent SHR file will be displayed on the screen. For example, to display the three SHR files TITLE, IMAGE1 and IMAGE2 for 5 seconds each, put the following in the file named by seq.file: 50 TITLE 50 IMAGE1 50 IMAGE2 SLIDESHR shr.file This amusing command displays an SHR file and awaits for you to click on one corner of the image. When you do, it divides the screen into a 4x4 grid, removes the selected corner and scrambles the remaining pieces. What Page - 11 Apple IIGS Supplement to the Proton Command System results is a 15-piece puzzle for you to solve by sliding the pieces around to their original position. Click on a square to move it to the adjacent empty square. If you click on the empty square, it's color changes to another color in the image's color palette. Clicking on an image square that is not adjacent to the empty square has no effect. Recommendation: Use an image that has distinct patterns in every area of the image. VIEWPNT pnt.file [shr.file1 ... shr.filen] This command displays either a PNT (paint file) created by the MAKEPNT com- mand, or a Deluxe Paint II compatible PNT file. Optionally, the command will capture the displayed image and copy it to an SHR file. To display an existing PNT file, simply give the name of the file as the first argument to the VIEWPNT command. It will be displayed to the screen. Page - 12 Apple IIGS Supplement to the Proton Command System The escape key may be pressed to terminate the command. If the PNT image is bigger than the screen, the upper left portion will be displayed ini- tially. However, the hand shaped cursor may be dragged by the mouse to ex- pose other portions of the image. A large image may be reduced by pressing one of the numeric keys 2,3,4, or 5; the image is reduced by that factor. The space bar may be pressed to temporarily fix an image that appears vertically elongated. In other words, if an image is intended for a dis- play with square pixels (the IIGS screen pixels are not quite square) try the space bar to remove the distortion. This feature eliminates every six- th scan line from the display. Pressing the space bar again restores the original image. The space bar toggles the feature on and off. One or more output files may be added to the VIEWPNT command. A copy of the screen image will be copied to the first output file, when the ENTER key is pressed. Each subsequent press of the ENTER key copies the screen to subsequent files, if given. Specifying more than one output file is useful if you want to capture different parts of a PNT image that is larger than the screen; simply drag to desired portions of the image between Page - 13 Apple IIGS Supplement to the Proton Command System RETURN key presses. If the ENTER key is pressed after all output file pa- rameters have been exhausted, the key will be ignored. VIEWSHR shr.file This command simply takes an SHR file and displays it on the screen. An SHR file is simply a memory dump of the SHR memory mapped area; so an SHR image is no larger or no smaller than what is displayed on the screen. Press the escape key to terminate the command. Page - 14 Apple IIGS Supplement to the Proton Command System DESCRIPTION OF DEMO PROGRAMS This section describes additional demo programs that are available on the Proton disk. Just go to the GS demo directory (with the PREFIX command), and execute these program files as commands. DRAWSHR This program allows you to draw simple pictures with a mouse. Click on a the palette on the right to choose a pen color. Use the up and down arrow keys to choose a pen size. Drag the mouse to draw. Use the CLEAR key to clear the screen, and use ESC to exit the program. FRACTALWORLD This program prompts you for a number and then generates a map of an alien world. It uses a technique based on fractal theory. Lighter areas dis- played represent a higher elevation. When the map is complete, press the Page - 15 Apple IIGS Supplement to the Proton Command System ENTER key to tint the land yellow and activate the following features: The up and down arrow keys add or remove water on the world and the left and right arrow keys horizontally scroll the world. Each time you run this program, use a different number to get a different world, or use the same one for the same world. MASTERMIND This program is based on a popular peg board game. You try to guess the color of 4 pegs hidden under the rectangle at the top of the screen. The pegs can be any of the colors in the palette at the bottom of the screen. You have ten tries. For each try, click on a color on the palette and then click on a peg just left of the palette. After you do this for each of the four pegs, the program will show how well you did with the four tiny pegs at the far left. Each tiny black peg means that you have guessed a large peg exactly right. Each tiny white peg means you have guessed a peg with a correct color, but it sits in the wrong location. Naturally, when you get four tiny black pegs, you win. Page - 16 Apple IIGS Supplement to the Proton Command System There are two things you can do to modify the game before you start a game. Press the either side of the "<>" box by the palette to add or remove colors from the palette. Press the hidden pegs at the top to guarentee that they they will all have different colors. MAZE3D This program puts you inside a maze with 3-D perspective. The maze is built with colorful panels. The program will prompt you for two numbers for the size of the maze (in units equal to one panel). The goal is to find the exit. After the maze is constructed and displayed, push the arrow keys to move forward (one panel length), turn left, turn right, or turn 180 degrees around. If you need help press RETURN to show a map (this is cheating) and press a key to restore the 3-D view. If you find the EXIT and step through it, a colorful display results. Press ESC to end the game at any time. MINESWEEPER [field.size [number.of.bombs]] Page - 17 Apple IIGS Supplement to the Proton Command System This program creates (by default) an 8x8 playing field with 10 hidden bombs. Your job is to mark every square containing a bomb with a yellow flag and expose every free square (denoted by a green background). Click once to mark a square, and click again to expose it. Watch out! If you expose a bomb, all of the bombs blow up (shown by red) and you lose. The numbers on exposed squares are clues. They denote the number of bombs that are adjacent to the square (above, below, left, right, and diagonal). A numberless green square has no adjacent squares with bombs. The program automatically exposes some squares for you at the start of the game. Also, when you expose a numberless green square, the program con- veniently exposes all other connecting numberless green squares, and the numbered green squares adjacent to them. If you mark a potential bomb with a yellow flag, and then decide you are not sure what it is, click on the square with the SHIFT key down. The square will return to its original gray state. Page - 18 Apple IIGS Supplement to the Proton Command System You can change the size of the playing field and number of bombs with a button on the screen. You can also set the default size and number of bombs with parameters on the command. A size of 8 with 10 bombs is a good beginner combination. For intermediate play, try 16 and 40. For advanced play, try the maximum values 24 and 99. SCROLLCOLORS This program randomly creates thousands of horizontal blended color lines (it takes a couple of minutes to do this). It then displays them on the screen, scrolling down, then up, then down, etc. SPACE2001 This program is similar to SCROLLCOLORS. However, it sends you flying be- tween two colorful parallel planes, not unlike the famous scene in that landmark 1968 sci-fi movie (you know which one I mean). Page - 19 Apple IIGS Supplement to the Proton Command System END OF DOCUMENT Page - 20