Customizing BASIC Key Functions (BASICKEY.BAS)
Customizing BASIC Key Functions, by Mike Fleischmann, 66
Description
Customizing BASIC Key Functions, by Mike Fleischmann, 66
From the Antic disk of September 1984 (Vol. 3 No. 5).
From the Antic Software Archive at atarimagazines.com. The program remains the property of its author and publisher.
What is in this file
Atari BASIC program · 3.7 KB
- Dialect
- Atari BASIC
- Lines
- 88
- Variables
D,Q$,CT,S$,CTH,CTL,I,A$,FLAG
BASIC listing (88 lines)
50 REM BASIC 2 KEY CREATE PROGRAM
60 REM BY MIKE FLEISCHMANN
70 REM ANTIC MAGAZINE
100 DIM S$(128),A$(1)
110 ? "↰↓↓↓":? " BASIC 2 KEY CREATE PROGRAM"
120 ? " THE OBJECT CODE IS IN AUTORUN FMT"
130 ? :? "DO YOU WANT THE COMMANDS TO BE PRINTED"
140 INPUT A$
150 IF A$="Y" THEN FLAG=1:REM FLAG=1 ->SEND TO P: FLAG=0 -> SEND TO SCREEN
160 REM
170 REM Need to find out how long the ML program is. So we count
180 REM the bytes in the data statements.
190 READ D
200 IF D<0 THEN 220:REM The -1 is a terminator
210 CT=CT+1:GOTO 190
220 READ S$:REM Now we count the # of bytes in the commands
230 CT=CT+LEN(S$)
240 IF S$(1,1)="@" THEN 310:REM Looking for the 5 '@' signs at end
250 REM Since we have to read the commands anyway may as well print
260 REM them out in readable form. Note: leave '@' sign so
270 REM we know if there are any blanks at the end of command.
280 IF FLAG<>1 THEN PRINT " CTRL ";S$(1,1);" = ";S$(2)
290 IF FLAG=1 THEN LPRINT " CTRL ";S$(1,1);" = ";S$(2)
300 GOTO 220
310 CT=CT+7424-6:REM Add in starting addr. of ML code - the header
320 REM for a ML boot file.
330 CTH=INT(CT/256):CTL=CT-CTH*256:REM Compute the low and high
340 REM Now wait for the user.
350 ? "Press return when the disk you want "
360 ? " is in drive 1 ":INPUT A$
370 OPEN #3,8,0,"D:AUTORUN.SYS":REM Get ready to output.
380 RESTORE :REM Set pointer to top of data.
390 READ D
400 IF D<0 THEN 460:REM Look for -1
410 REM 500 & 501 are flags to tell prgm where to put end addr.
420 IF D=500 THEN D=CTL
430 IF D=501 THEN D=CTH
440 PUT #3,D
450 GOTO 390
460 REM ML program output. Now we output the command set.
470 READ S$
480 FOR I=1 TO LEN(S$):REM Output string byte by byte.
490 D=ASC(S$(I,I))
500 IF D=ASC("\") THEN D=ASC(",")
510 PUT #3,D
520 NEXT I
530 IF S$(1,2)="@@" THEN 550:REM Look for the 5 '@' signs.
540 GOTO 470
550 REM The program & data set are out. Now output the autoload appendage.
560 FOR I=1 TO 7:READ D:PUT #3,D:NEXT I
570 CLOSE #3:STOP :REM DONE
10000 REM
10010 REM Below is the data for the machine language program.
10020 REM DO NOT MODIFY!!!!!!
10030 REM
10040 DATA 255,255,0,29,500,501,234,160,1,173,8,2,153,182,29,200,173,9,2,153,182,29,169,44,141,8,2,169,29
10050 DATA 141,9,2,169,500,141,231,2,24,105,112,169,501,141,232,2,105,1,133,15,96,88,142,192,29,140,193
10060 DATA 29,173,9,210,72,41,128,208,4,104,24,144,113,169,3,133,245,169,30,133,246,104,41,63,170,189
10070 DATA 195,29,201,255,240,94,133,247,160,0,177,245,197,247,240,24,201,64,240,80,200,177,245,201,64
10080 DATA 208,249,200,24,152,101,245,133,245,144,228,230,246,208,224,230,245,208,2,230,246,174,22,228
10090 DATA 172,23,228,232,208,1,200,142,187,29,140,188,29,160,0,177,245,201,64,240,13,140,194,29,32,186
10100 DATA 29,172,194,29,200,24,144,237,169,0,133,77,169,48,141,43,2,174,192,29,172,193,29,104,64,174
10110 DATA 192,29,172,193,29,76,0,80,0,76,0,80,69,58,155,0,0,0,76,74,59,255,255,75,43,42,79,255,80,85
10120 DATA 255,73,45,61,86,255,67,255,255,66,88,90,52,255,51,54,27,53,50,49,44,32,46,78,255,77,47,255
10130 DATA 82,255,69,89,255,84,87,81,57,255,48,55,255,56,60,62,70,72,68,255,255,71,83,65,-1
20000 REM
20010 REM BELOW IS THE COMMAND TABLE
20020 REM THE FORMAT OF THE TABLE IS
20030 REM (KEY)(COMMAND)[:COMMAND:...:COMMAND](@) WHERE THE
20040 REM '@' SYMBOL IS THE TERMINATOR
20050 REM The set must end with 5 '@' signs.
20060 REM Only capital letters and numbers can be used!!! for (KEY)
20070 REM
20080 REM
20090 REM
20100 DATA ACOLOR @,CCHR$(@,DDATA @,FFOR @,GGOTO @
20110 DATA HGOSUB @,IINPUT @,JDRAWTO @,KGRAPHICS @,LLIST @
20120 DATA MLPRINT @,NNEXT @,OPADDLE(@,PPLOT @,QPOS. @
20130 DATA RRETURN @,SSO. @,TTHEN @,UREAD @,VSE. @,WSTICK(@
20140 DATA XSTRIG(@,YSTR$(@,2LOAD "D:@,3SAVE "D:@
20150 DATA 4LIST "P:"@,5LIST "D:@
20160 DATA 0DEC=(HEX$(I\I)<="9")*(ASC(HEX$(I\I))-48)+(HEX$(I\I)>="A")*(ASC(HEX$(I\I))-55)@
20170 DATA 6ENTER "D:@,@@@@@
30000 REM
30010 REM
30020 REM
30030 REM Below is the appendage for an autorun file.
30040 DATA 0,224,2,225,2,0,29
