Player-Missile Design Aid
Tom Gurak
Player/Missile Design Aid (PMDA) is a program which aids you in designing your own player/missile graphics. Player/missile graphics are a powerful tool provided by Atari for designing games. However, designing and encoding each player/missile character can be a time-consuming process. Further, using the normal method of designing these players on graph paper, the designer is never sure exactly how the player/missile graphic will look when displayed on the screen.
Player/Missile Design Aid was written to facilitate this process and allow the designer to see the player/missile graphic he is designing while he is working on it.
Whenever PMDA is awaiting your direction, it shows a blinking cursor on the screen. To move the cursor, simply push the joystick in the direction you wish to move the cursor. The cursor will continue to move in that direction until you release the joystick or push it in a different direction.
To start, LOAD the PMDA program and type RUN. PMDA will then display a title screen and begin setting up. Once setup is complete, PMDA displays a screen containing an 8 x 24 bit map which will be used to design your player graphic.
Note that a bit which is off (0) is displayed as a plus sign (+) and a bit which is on (1) is displayed as a solid white block. To the immediate left of the bit map is a column of line numbers and to the right is the decimal POKE value for each line. Initially, this latter field is all zeroes. As bits are turned on, however, this will change to correspond to the new value of the line (byte).
On the right side of the screen is a list of commands, a status line, and a prompt line which indicates the action to be taken.
Some explanation of the status line is in order. The first item is the current player/ missile mode (M=nn). The two digits are the actual decimal value which is POKEd at SDMCTL (559) to produce the desired mode. M=46 indicates that you are in double-line mode (the default); M=62 indicates that you are in single-line mode.
The second item is the player size or width (W=n). The digit following is the desired value to be POKEd in the player size register (in this case, SIZEP0 (53256)). W=0 indicates single width (the default); W=1 indicates double width; and W=3 indicates quadruple width. The last item is the color/luminance for the player/missile graphic (COLOR). The digits following are the actual decimal POKE value in the player/missile color register (in this case, PCOLR0 (704)).
I would like to point out that I am not attempting to explain player/missile graphics as there has been much information published already on this subject. I am merely attempting to present enough information to enable you to understand the operation of the Player/Missile Design Aid.
Finally, we are ready to begin designing our player/missile graphic. Using the joystick, position the blinking cursor to the bit position in the map which is to be changed. Pushing the fire button on the joystick will cause the bit to be flipped from off to on, or vice-versa. As bits are turned on, the actual player/missile graphic will begin to take shape in the area between the bit map display and the command list.
It is also possible to "draw" a line in any direction. To accomplish this, position the cursor to the desired starting position of the line, press and hold the fire button, and push the joystick in the desired direction. Remember that if you pass over a bit position which is already on, it will be turned off.
To use the commands (each of which is described later), position the cursor to the first character of the desired command and press the fire button. The command list may be reached by moving the cursor to the left or right until it leaves the bit map display. To return the cursor to the bit map, simply move the joystick left or right.
When the player/missile graphic is completed and all options (mode, width, and color) are set correctly, you can either write down the status line settings and the decimal values for each line (byte) of the player/missile graphic or you can use the Save Data command to save this data. The data saved takes the form of a Basic language DATA statement which may be added to your own player/missile graphic program by using the Atari ENTER command. This eliminates the need for a run-time subroutine to load the data. The format of the DATA statement is explained later.
Tank. |
Commands
Shift All (Up Arrow): Shifts all 24 lines of the graphic up one line and leaves a blank (0) line at line 23.
Shift All (Down Arrow): Shifts all 24 lines of the graphic down one line and leaves a blank (0) line at line 0.
Shift All (Right Arrow): Shifts all 24 lines of the graphic right one bit position and leaves a blank (0) column of bit positions at the extreme left.
Shift All (Left Arrow): Shifts all 24 lines of the graphic left one bit position and leaves a blank (0) column of bit positions at the extreme right.
Shift Line (Up Arrow): Shifts all lines from the line you indicate to line 23 up one line and leaves a blank line (0) at line 23. Select the first line to be shifted by positioning the cursor on the desired line and pressing the fire button when prompted by the program.
Shift Line (Down Arrow): Shifts all lines from the line you indicate to line 23 down one line and leaves a blank (0) line at the line selected. Line selection is the same as described for Shift Line (Up Arrow) above.
Shift Line (Right Arrow): The single line which you select is shifted right one bit position and a 0 bit is left at the extreme left of the line. Line selection is the same as for Shift Line (Up Arrow).
Shift Line (Left Arrow): The single line which you select is shifted left one bit position and a 0 bit is left at the extreme right of the line. Line selection is the same as for Shift Line (Up Arrow).
Blank All: All bit positions are set to 0. Before proceeding, you will be asked to confirm your request by pressing the fire button. If you do not want the command to proceed, push the joystick in any direction.
Blank Line: The single line which you select will have all its bit positions set to 0. Line selection is as described for Shift Line (Up Arrow).
Blank Column: The bit position which you select will be set to 0 in all lines. Select the bit position by moving the cursor to the desired position and pressing the fire button when prompted by the program.
Change Mode: This changes the mode from double-line (M=46) to single-line (M=62) and vice-versa.
Change Width: This changes the player/ missile graphic width from single (W=0) to double (W=1); double to quadruple (W=3); or quadruple to single.
POKE P/M: This allows the user to enter a previously-defined character when only the POKE values are known. Use the keyboard to enter the value for each line when prompted by the program. The Return key must be pressed after each value. Enter three nines (999) followed by Return to indicate that you are done.
Set Color: This sets the color of the player/missile graphic only. Using the keyboard, enter the Atari color value (0-15) followed by Return, then enter the luminance value (0-14, even numbers only) also followed by Return. These values will be converted to the corresponding color register value and POKEd into PCOLR0 to change the color of the player/missile graphic displayed.
POKE Color: This sets the color of the player/missile graphic only. Using the keyboard, enter the decimal value to be POKEd into the player/missile color register.
Save Data: This saves the player/missile data as a Basic language DATA statement. The format on this statement is described later. Prior to beginning the operation, you are asked to confirm your intent by pushing the fire button. To cancel the operation, push the joystick in any direction. The data saved include the mode, width, and color settings followed by the POKE values for each line from 0 to the last non-zero line.
Load Data: This loads previously-saved player/missile data. Before beginning the operation, you are asked to confirm your intent by pressing the fire button. To cancel the operation, push the joystick in any direction. Upon confirmation, a Blank All operation will be performed. The player/ missile graphic will be loaded and displayed with the same mode, width, and color as were in effect when it was saved.
Messages
Color?: Use the keyboard to enter the Atari color value and press the Return key.
Enter POKE Values: Use the keyboard to enter the POKE values for a player/missile graphic. Press Return after each one and use 999 followed by Return to indicate you are finished.
Luminance?: Use the keyboard to enter the Atari luminance value and press Return.
No P/M Data to Save: The Save Data command was selected but there are no non-zero bits in the bit map. No action is required.
POKE Color?: Use the keyboard to enter the POKE value for the player/missile color register and press the Return key.
Pos Cursor for Blank: Position the cursor to the line/column to be blanked and press the fire button to complete the Blank command.
Pos Cursor for Shift: Position the cursor to the appropriate line for the Shift operation and press the fire button to complete the Shift command.
Processing...: A long-running command is executing. No action is required.
Push FIRE to Change: The cursor is located within the bit map and pressing the fire button will cause the bit at the cursor position to be flipped.
Push FIRE to Confirm: A Blank All, Save Data, or Load Data command has been selected and pressing the fire button will cause the command to continue. The command may be cancelled by pushing the joystick in any direction.
Push FIRE to Select: The cursor is located within the command list and pressing the fire button will cause the command at which the cursor is positioned to be executed.
Ready Tape Recorder: Insert a cassette tape, press Play or Record and Play depending on the operation selected, and press the console Return key.
Save Data Format
The Save Data command produces a Basic language DATA statement which has the following format:
Lineno DATA mode, width, color, data0, data 1,...datan,-1
Lineno is the line number. The first save will create a statement with a line number of 32000. For each subsequent save, the line number is incremented by 10.
DATA is written as shown to identify the Basic language statement type.
Mode is the POKE value for the player/ missile mode (double-line or single-line).
Width is the POKE value for the player/ missile size register.
Color is the POKE value for the player/ missile color register.
Data0 is the POKE value needed to create line 0 of the player/missile graphic.
Data1 is the POKE value needed to create line 1 of the player/missile graphic.
Datan is the POKE value needed to create line n of the player/missile graphic. The last line saved is the last non-zero line found in the bit map. Leading zero lines and any zero lines within the body of the player/missile graphic will be saved.
-1 is written as shown to indicate the end of the player/missile data.
5 TRAM=PEEK(106)-8:POKE 106,TRAM 10 GRAPHICS 2+16:SETCOLOR 4,9,4:? #6:? #6:? #6;" PLAYER/MISSILE":? #6 20 ? #6;" DESIGN AID":? #6:? #6:? #6;" -BY-":? #6:? #6;" TOM GURAK" 30 K0=0:K1=1:K2=2:K5=5:K7=7:K8=8:K10=10:K12=12:K13=13:K15=15:K19=19:K22=22:K23=23:K27=27:K256=256:K512=512 40 ATRACT=77:SDMCTL=559:PCOLR0=704:CRSINH=752:HPOSP0=53248:SIZEP0=53256:GRACTL=53277:PMADR=54279 70 PMBASE=TRAM*K256+K512 80 FOR Y=PMBASE TO PMBASE+768:POKE Y,K0:NEXT Y 90 POKE PMADR,TRAM:PMBASE=PMBASE+34 100 DIM B$(1),I$(1),S$(6),A$(4),L$(5),C$(6):B$="+":I$=" ":S$="Shift ":A$="All ":L$="Line ":C$="Blank " 110 SN=31990:WD=0:MS=46 120 DIM P$(13),Q$(15),T$(7):P$="Push FIRE to ":Q$="Pos Cursor for " 140 FOR W=K0 TO K256*K10:NEXT W 150 GRAPHICS K0:SETCOLOR K2,K0,K0:SETCOLOR K1,K12,K12:POKE CRSINH,K1:? " "; 160 POKE SDMCTL,MS:POKE PCOLR0,K12:POKE GRACTL,3:POKE HPOSP0,119 170 GOSUB 1000 200 POKE ATRACT,K0:LOCATE X+K5,Y,OC:H=128:CC=OC+H 210 POSITION X+K5,Y:? CHR$(CC);:H=-H:CC=CC+H:FOR W=K0 TO K23:NEXT W:P=STICK(K0):T=STRIG(K0) 215 IF P=K15 AND T THEN 210 220 POSITION X+K5,Y:? CHR$(OC);:IF T THEN 300 222 IF CSW THEN GOTO CRT 225 IF X=K22 THEN 400 230 CC=ASC(B$):IF OC=CC THEN CC=ASC(I$) 240 POSITION X+K5,Y:? CHR$(CC);:A=PMBASE+Y:PM=PEEK(A):WM=INT(K2^(K7-X)+0.5):IF OC=ASC(B$) THEN PM=PM+WM:GOTO 260 250 PM=PM-WM 260 WY=Y:GOSUB 800 270 IF P<>K15 THEN 300 280 P=STICK(K0):IF NOT STRIG(K0) THEN 270 300 XC=K0:YC=K0:IF P>K8 AND P4 AND P =K0 THEN 365 350 IF X=K22 THEN 380 355 IF X=21 OR X=K23 THEN X=K0:Y=K0:GOSUB 1100:GOTO 200 357 IF NOT STRIG(K0) THEN 357 360 X=K22:Y=K2:GOSUB 1150:GOTO 200 365 IF Y>K23 THEN Y=K0:GOTO 200 370 IF Y K19 THEN Y=K2 395 GOTO 200 400 A=Y-K1:ON A GOTO 410,420,430,440,450,460,470,480,490,500,510,2300,2200,1500,900,1600,1700,1900 410 GOSUB 1200:YS=K0:YE=K23:YI=K1:GOTO 700 420 GOSUB 1200:YS=K23:YE=K0:YI=-K1:GOTO 700 430 GOSUB 1200:YS=K0:YE=K23:XS=K7:XE=K0:XI=-K1:GOTO 750 440 GOSUB 1200:YS=K0:YE=K23:XS=K0:XE=K7:XI=K1:GOTO 750 450 YI=K1:GOSUB 580:YS=YE-K1:YE=K23:GOTO 700 460 YS=K23:YI=-K1:GOSUB 580:GOTO 700 470 XS=K7:XE=K0:XI=-K1:GOSUB 580:YS=YE:GOTO 750 480 XS=K0:XE=K7:XI=K1:GOSUB 580:YS=YE:GOTO 750 490 GOSUB 2500:GOSUB 1200:GOSUB 1000:GOTO 200 500 GOSUB 590:GOTO 650 510 X=K0:Y=K0:T$=C$(K1,K5):GOSUB 1160:CSW=K1:CRT=515:GOTO 200 515 Y=K0:IF NOT T THEN 530 520 IF X>K7 THEN X=K0:GOTO 200 525 IF X =K256 THEN PM=PM-K256 780 GOSUB 800:NEXT WY:GOTO 570 800 POKE A,PM:POSITION 14,WY:? PM;" ";:RETURN 900 GOSUB 990:? "Color";:GOSUB 1400:IF P K15 OR P<>INT(P) THEN 900 910 A=P*16 920 GOSUB 990:? "Luminance";:GOSUB 1400:IF P 14 OR P<>INT(P/K2)*K2 THEN 920 930 A=A+P:POKE PCOLR0,A 940 GOSUB 950:GOTO 570 950 A=PEEK(PCOLR0):POSITION 28,21:? "COLOR=";A;" ";:RETURN 990 POSITION K19,K23:? " ";:POSITION K19,K23:RETURN 1000 FOR Y=K0 TO K23:POSITION K2,Y:? Y;:FOR X=K0 TO K7:POSITION X+K5,Y:? B$;:NEXT X 1010 A=PMBASE+Y:PM=K0:WY=Y:GOSUB 800:NEXT Y 1020 POSITION K27,K0:? "COMMANDS:"; 1030 POSITION K27,K2:? S$;A$;"";:POSITION K27,3:? S$;A$;""; 1040 POSITION K27,4:? S$;A$;"";:POSITION K27,K5:? S$;A$;""; 1050 POSITION K27,6:? S$;L$;"";:POSITION K27,K7:? S$;L$;""; 1060 POSITION K27,K8:? S$;L$;"";:POSITION K27,9:? S$;L$;""; 1070 POSITION K27,K10:? C$;A$;:POSITION K27,11:? C$;L$;:POSITION K27,K12:? C$;"Column";:LX=0:LY=0:X=0:Y=0 1072 POSITION K27,K13:? "Change Mode"; 1075 POSITION K27,14:? "Change Width";:POSITION K27,K15:? "Poke P/M"; 1080 POSITION K27,16:? "Set Color";:POSITION K27,17:? "Poke Color"; 1090 POSITION K27,18:? "Save Data";:POSITION K27,19:? "Load Data";:GOSUB 2400:GOSUB 2250:GOSUB 950 1095 IF CSW THEN RETURN 1100 T$="Change ":GOTO 1160 1150 T$="Select ":GOTO 1160 1160 POSITION K19,K23:? P$;T$;:GOSUB 1300 1170 SOUND K0,K0,K0,K0:RETURN 1200 POSITION K19,K23:? "Processing";:FOR W=K1 TO K10:? ".";:NEXT W:SOUND K0,250,6,K2:RETURN 1300 SOUND K0,50,K12,4:FOR W=K0 TO K23:NEXT W:SOUND K0,K0,K0,K0:RETURN 1400 P=K0:W=K0:OPEN #1,4,0,"K:":GOSUB 1300:POKE CRSINH,K0:? "?"; 1410 GET #1,W:IF W=155 THEN 1490 1420 IF W=126 THEN P=INT(P/K10):? " ";:GOTO 1410 1430 IF W>47 AND W<58 THEN P=P*K10+(W-48):? CHR$(W);:GOTO 1410 1440 ? "}";:GOTO 1410 1490 CLOSE #1:POKE CRSINH,K1:? " ";:RETURN 1500 POSITION K19,K23:? "Enter Poke Values ";:FOR WY=K0 TO K23 1510 POSITION K13,WY:GOSUB 1400:IF P=999 THEN 1590 1520 IF P =K256 THEN 1510 1530 PM=P:GOSUB 2100 1560 POSITION K13,WY:? " ";:NEXT WY:GOTO 570 1590 A=PMBASE+WY:PM=PEEK(A):GOSUB 800:POSITION K13,WY:? " ";:POP :GOTO 570 1600 GOSUB 990:POSITION K19,K23:? "Poke Color";:GOSUB 1400:IF P =K256 OR P<>INT(P/2)*2 THEN 1600 1610 A=0:GOTO 930 1700 FOR YE=K23 TO K0 STEP -K1:IF PEEK(PMBASE+YE)<>K0 THEN 1720 1710 NEXT YE:POSITION K19,K23:? "No P/M Data to Save ";:FOR W=K0 TO K512:NEXT W:GOTO 570 1720 POP :GOSUB 2500:GOSUB 1790:A=K0 1730 OPEN #1,8,0,"C:":SN=SN+K10:T$=STR$(SN):GOSUB 1810:T$=" DATA ":GOSUB 1810:T$=STR$(MS):GOSUB 1810 1735 T$=STR$(WD):GOSUB 1800:T$=STR$(PEEK(PCOLR0)):GOSUB 1800 1740 FOR WY=K0 TO YE:PM=PEEK(PMBASE+WY):T$=STR$(PM):GOSUB 1800 1760 NEXT WY:T$="-1":GOSUB 1800:PUT #1,155:CLOSE #1:GOTO 570 1790 POSITION K19,K23:? "Ready Tape Recorder ";:RETURN 1800 PUT #1,44 1810 FOR WX=K1 TO LEN(T$):PUT #1,ASC(T$(WX,WX)):NEXT WX:RETURN 1900 GOSUB 2500:GOSUB 1200:CSW=K1:GOSUB 1000:CSW=K0:SOUND 0,0,0,0 1905 GOSUB 1790:OPEN #1,4,0,"C:":FOR WX=K0 TO K10:GET #1,A:NEXT WX 1910 GOSUB 2000:MS=PM:GOSUB 2400:GOSUB 2000:WD=PM:GOSUB 2250:GOSUB 2000:POKE PCOLR0,PM:GOSUB 950 1920 FOR WY=K0 TO K23:GOSUB 2000:IF P=45 THEN POP :GOTO 1990 1930 P=PM:GOSUB 2100:NEXT WY 1990 CLOSE #1:GOTO 570 2000 PM=K0:FOR WX=K0 TO 4:GET #1,P:IF P=44 THEN POP :GOTO 2090 2010 IF P=45 THEN POP :GOTO 2090 2020 PM=PM*K10+VAL(CHR$(P)):NEXT WX 2090 RETURN 2100 A=128:FOR WX=K0 TO K7:POSITION WX+K5,WY:IF PK15 THEN POP :GOTO 570 2540 RETURN
Tom Gurak, 24 North St., W. Albany, NY 12205.
Table of Contents
Previous Section: Graphics Seven Plus
Next Section: Animath