@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@W!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr MODULE ; BOUNCE from ANALOG magazine ; Issue #15 ; in GTIA Mode 11 BYTE key=764,x,y,console=53279,attract=77 CARD ct}r INT A,B PROC wallchex() IF x>78 THEN x=78 FI IF y>190 THEN y=190 FI IF x<1 THEN x=1 FI IF y<1 THEN y=1 FI }RETURN PROC menu() PrintE("BOUNCE from Analog Issue #15") PrintE(" in GTIA mode 11") PrintF("%E* Use stick t}o draw walls,%E") PrintF("* Hold trigger to erase,%E") PrintF("* Hit ESC to clear screen,%E") PrintE("* Hit SPACE to bo}unce.") PrintE("* ARROWS control ball speed") Print("Press any key to continue.") key=255 While key=255 DO OD key= }255 RETURN PROC drawscreen() BYTE curs=752 Graphics (0) curs=1 Menu() Graphics(11) curs=1 SetColor(4,0 },4) ;SetColor(4,0,0) Color=15 Plot(0,0) DrawTo(79,0) DrawTo(79,191) Drawto(0,191) DrawTo(0,0) RETURN PROC }flash() color=9 Plot(x,y) FOR ctr=0 to 300 DO OD color=0 Plot(x,y) FOR ctr=0 to 300 DO OD RETURN PROC b }ounce() BYTE fate=53770,L=[0],PA,PB,G, kolor=[1],time=[32] color=9 A=1 B=1 Plot(x,y) DO IF key=33 T }HEN key=255 RETURN FI WHILE Locate(x+A,y+B)<15 DO color=kolor Plot(x,y) x==+A y==+B wallch}ex() color=9 Plot(x,y) L==+1 FOR ctr=0 to 5*time DO OD OD IF key=7 THEN key=255 time}==-32 FI Sound(0,L*4+20,10,8) PA=Locate(x+A,y) PB=Locate(x,y+B) FOR ctr=0 to 100 DO OD SndRst() L=0 I}F PA>2 AND PB>2 THEN A=-A B=-B ELSEIF PA>2 AND PB<3 THEN A=-A color=2 Plot(x,y) y=y+B color=9 } Plot(x,y) ELSEIF PB>2 AND PA<3 THEN B=-B color=2 Plot(x,y) x=x+A color=9 Plot (x,y) ELSEIF }fate>127 THEN B=-B ELSE A=-A FI kolor==+1 IF kolor>14 THEN kolor=1 FI attract=0 OD RETURN } PROC draw() BYTE qq drawscreen() x=40 y=95 DO IF key=28 THEN key=255 drawscreen() ELSEIF key}=33 THEN key=255 bounce() FI IF Stick(0)=15 THEN flash() ELSEIF Stick(0)=7 THEN x=x+1 EL}SEIF Stick(0)=6 THEN x=x+1 y=y-1 ELSEIF Stick(0)=14 THEN y=y-1 ELSEIF Stick(0)=5 THEN x=x+1} y=y+1 ELSEIF Stick(0)=11 THEN x=x-1 ELSEIF Stick(0)=10 THEN x=x-1 y=y-1 ELSEIF Stick(0)}=13 THEN y=y+1 ELSEIF Stick(0)=9 THEN x=x-1 y=y+1 FI wallchex() IF Strig(0)=0 THEN co}lor=0 flash() ELSE color=15 FI Plot(x,y) IF Stick(0)<>15 THEN qq=Strig(0) Sound(0,(20}0-x-y)*qq,8+2*qq,4) FOR ctr=0 to 1000 DO OD SndRst() FI OD RETURN ?( 0(C.` E Z; Dump - Print the contents of binary ; files in hexadecimal and ATASCII ; by Mark Rose - February, 1985 ; A few useful} definitions: DEFINE ChunkSize = "8", Escape = "$1B", NewLine = "$9B", File = "1" ; Print }out a byte as two hexadecimal ; digits. PROC HexByte(BYTE c) BYTE ARRAY HexDig(16)= ['0 '1 '2 '3 '4 '5 '6 '7 } '8 '9 'A 'B 'C 'D 'E 'F] Put(HexDig(c RSH 4)) Put(HexDig(c&15)) RETURN ; Print out a two-byte value as 4 ; hexad}ecimal digits by calling ; HexByte. PROC HexWord(CARD i) HexByte(i RSH 8) HexByte(i & 255) RETURN ; Read in the nex}t few bytes of the ; file (the desired number is chosen ; by the value of "ChunkSize"). BYTE FUNC ReadChunk( BYTE ARRAY buf  }) BYTE nBytes, c nBytes = 0 DO c = GetD( File ) IF EOF( File ) THEN EXIT !} FI buf( nBytes ) = c nBytes ==+ 1 UNTIL nBytes = ChunkSize OD RETURN( nBytes ) ; Put a cha"}racter to screen. If char ; is an ATASCII return, put period, ; instead, so display isn't messed up. PROC PutChar( BYTE c )#} IF c # NewLine THEN Put( Escape ) Put( c ) ELSE Put( '. ) FI RETURN ; Print hex and A$}TASCII of chars read ; by ReadChunk. PROC DumpChunk( CARD offset, BYTE n, BYTE ARRAY buf ) BYTE i HexWord( offset )%} Print( ":" ) FOR i = 0 TO n-1 DO HexByte( buf( i ) ) Put( ' ) OD FOR i = i TO Chunk&}Size-1 DO Print( " " ) OD FOR i = 0 TO n-1 DO PutChar( buf( i ) ) OD PutE()'} RETURN ; Dump a file to screen. PROC Dump() BYTE ARRAY fName( 50 ) CARD offset BYTE size BYTE ARRAY buf((} ChunkSize ) ; First, get file to dump. Print( "File: " ) InputS( fName ) Close( File ) Open( File, fname )},4 ,0 ) ; Until end-of-file, read a few chars ; and dump them to screen. offset = 0 DO size = ReadChun*}k( buf ) IF size = 0 THEN EXIT FI DumpChunk( offset, size, buf ) offset ==+ size +} OD Close(1) RETURN ooooooooooooooooo8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.32000 REM PROGRAM DUMPGR6.LST 32001 REM BY Glen G. Hosey 32003 REM . .Tacoma WA 98433 32006 REM ------------------------}--- 32007 REM Program to dump GRAPHICS 6 32008 REM screens to printer in full- 32009 REM page size (6.4x10 inches). 32010.} REM Program requires 3426 bytes 32011 REM of memory including the 32012 REM string (with all REMs out). 32013 REM Program/} will dump screen in 32014 REM 2 minutes and 20 seconds. 32015 REM Use 'GOTO 32100' to access 32016 REM routine. Routine 0}will not 32017 REM alter screen display. 32018 REM --------------------------- 32100 DIM AA$(1536):RESTORE 32200:ZZ=0:FOR 1}XX=0 TO 188:READ YY:POKE 1536+XX,YY:ZZ=ZZ+YY:NEXT XX 32105 IF ZZ<>21873 THEN ? "DATA ERROR":END 32110 SCREEN=PEEK(88)+256*2}PEEK(89):SCREEN=SCREEN+20*95 32120 TRAP 32190:CLOSE #5:OPEN #5,8,0,"P:":LPRINT CHR$(27);"A";CHR$(8) 32130 FOR XX=SCREEN TO 3}SCREEN+19:AA$=CHR$(0):AA$(1536)=CHR$(0):AA$(2)=AA$ 32140 YY=USR(1536,XX,ADR(AA$)) 32150 ? #5;CHR$(7);"K";CHR$(128);CHR$(1);4}AA$(1,384):? #5;CHR$(27);"K";CHR$(128);CHR$(1);AA$(385,768) 32160 ? #5;CHR$(27);"K";CHR$(128);CHR$(1);AA$(769,1152):? #5;CHR5}$(27);"K";CHR$(128);CHR$(1);AA$(1153,1536) 32170 NEXT XX 32180 GOTO 32180 32190 ? "ERROR #";PEEK(195):END 32200 DATA 1046},14,133,204,104,133,203,104,133,206,133,208,104,133,205,133,207,160,0,162,97,202,208,49,96 32210 DATA 169,240,145,207,200,147}5,207,200,145,207,200,145,207,160,0,96,177,207,9,15,145,207,200,145,207 32220 DATA 200,145,207,200,145,207,160,0,96,24,165,28}07,105,128,133,207,165,208,105,1,133,208,96,177,203 32230 DATA 133,209,41,128,240,3,32,25,6,165,209,41,64,240,3,32,41,6,32,59}9,6,165,209,41,32 32240 DATA 240,3,32,25,6,165,209,41,16,240,3,32,41,6,32,59,6,165,209,41,8,240,3,32,25 32250 DATA 6,165,20:}9,41,4,240,3,32,41,6,32,59,6,165,209,41,2,240,3,32,25,6,165,209,41 32260 DATA 1,240,3,32,41,6,56,165,203,233,20,133,203,165,;}204,233,0,133,204,24,165,205,105,4,133,205 32270 DATA 133,207,165,206,105,0,133,206,133,208,76,21,6 .SYSERROR - NOT VERSIOf32000 REM GRAPHICS 7 SCREEN DUMP 32001 REM DUMPS IN FULL-PAGE FORMAT 32002 REM By Glen G. Hosey 32003 REM ...Tacoma, WA 98 =}433 32006 REM --------------------------- 32007 REM This routine will dump a 32008 REM GRAPHICS 7 screen to printer 32009 >} REM in 2 minutes 20 seconds. 32010 REM Print size is Width = 6.4" 32011 REM ..............Height=10.0" 32012 REM Printing ?} is done sideways 32013 REM on the paper and will 32014 REM fill a full-size page. 32015 REM This routine will print in 3 @}2016 REM three different shades for 32017 REM the three colors in GR. 7 32018 REM COLOR 0 -- blank lines 32019 REM COLOR A}-- checkerboard 32020 REM ......... pattern 32021 REM COLOR -- vertical lines 32022 REM COLOR -- horizontal lines 32023 B} REM The rotine requires 3417 32024 REM bytes f memory, including 32025 REM the Mahine Language 32026 REM stringand the tw C}o print 32027 REM string (with all the REMs 32028 REM remove). 32029 REM This rutine will work as-is 32030 REM on GEMNI 1 D}0X/15X printers. 32031 REM Other rinters may require 32032 REM change to print statements 32033 REM in lins 32120 and 3215 E}0. 32034 REM --------------------------- 32035 REM This rutine is relocatable 32036 REM and wil modify itself 32037 REM a F}ccordng to the location 32038 REM of thestrings. 32039 REM ---------------------------- 32040 REM Use "GO 32100" to access G} 32041 REM this rutine. 32042 REM --------------------------- 32100 DIM ML$(42),AA$(384),BB$(384):ZZ=0 32110 RESTORE 3220 H}0:FOR XX=1 TO 421:READ YY:ML$(XX)=CHR$(YY):ZZ=ZZ+YY:NEXT XX:SCREEN=PEEK(88)+256*PEEK(89) 32111 IF ZZ<>61689 THEN ? "DATA ERR I}OR":END 32120 SCREEN=SCREEN+40*95:TRAP 32180:CLOSE #5:OPEN #5,8,0,"P:":? #5;CHR$(27);"A";CHR$(8) 32130 FOR XX=SCREEN TO SC J}REEN+39:AA$=CHR$(0):AA$(384)=CHR$(0):AA$(2)=AA$:BB$=AA$ 32140 YY=USR(ADR(ML$),ADR(ML$(421,421)),ADR(ML$(46,46)),XX,ADR(AA$), K}ADR(BB$)) 32150 ? #5;CHR$(27);"K";CHR$(128);CHR$(1);AA$:? #5;CHR$(27);"K";CHR$(128);CHR$(1);BB$ 32160 NEXT XX 32170 GOTO 3 L}2170 32180 ? "ERROR #";PEEK(195):END 32200 DATA 104,104,133,206,104,133,205,160,0,104,145,205,198,205,165,205,201,255,208, M}2,198,206,104,145,205 32210 DATA 104,133,204,104,133,203,104,133,206,104,133,205,104,133,208,104,133,207,162,97,202,208,1,96 N},177 32220 DATA 203,133,209,41,192,208,17,169,0,145,205,200,145,205,200,145,205,200,145,205,160,0,240,65,201 32230 DATA 192 O},208,21,169,240,145,205,200,200,145,205,169,0,136,145,205,200,200,145,205,160,0,240,40,201 32240 DATA 128,208,17,169,160,145 P},205,200,145,205,200,145,205,200,145,205,160,0,240,19,169,192,145,205,200 32250 DATA 200,145,205,136,169,48,145,205,200,200, Q}145,205,160,0,165,209,41,48,240,70,201,48,208,14,177 32260 DATA 205,9,15,145,205,200,200,145,205,160,0,240,52,201,32,208,25, R}177,205,9,10,145,205,200,200 32270 DATA 145,205,136,177,205,9,10,145,205,200,200,145,205,160,0,240,23,177,205,9,12,145,205,2 S}00,200 32280 DATA 145,205,136,177,205,9,3,145,205,200,200,145,205,160,0,165,209,41,12,208,17,169,0,145,207 32290 DATA 200,1 T}45,207,200,145,207,200,145,207,160,0,240,65,201,12,208,21,169,240,145,207,200,200,145,207 32300 DATA 136,169,0,145,207,200,2 U}00,145,207,160,0,240,40,201,8,208,17,169,160,145,207,200,145,207,200 32310 DATA 145,207,200,145,207,160,0,240,19,169,192,145 V},207,200,200,145,207,136,169,48,145,207,200,200,145 32320 DATA 207,160,0,165,209,41,3,240,70,201,3,208,14,177,207,9,15,145,2 W}07,200,200,145,207,160,0 32330 DATA 240,52,201,2,208,25,177,207,9,10,145,207,200,200,145,207,136,177,207,9,10,145,207,200,20 X}0 32340 DATA 145,207,160,0,240,23,177,207,9,12,145,207,200,200,145,207,136,177,207,9,3,145,207,200,200 32350 DATA 145,207,1 Y}60,0,24,165,205,105,4,133,205,165,206,105,0,133,206,24,165,207,105,4,133,207,165 32360 DATA 208,105,0,133,208,56,165,203,233 Z},40,133,203,165,204,233,0,133,204,76,255,255  !";`POKE209,255:RUN"D:MENU; -9   /32000 REM PROGRAM: DUMPGR8.LST 32001 REM BY: Glen G. Hosey Tacoma, WA 98433 32002 REM DUMP YOUR SC\}REEN TO PRINTER IN FULL-PAGE SIZE FORMAT 32003 REM This routine will dump a GRAPHICS 8 screen to the printer in ab]}out 3 minutes 20 seconds 32004 REM The upper left of the printout is the lower left of the screen; 32005 REM The upper righ^}t of the printout is the upper left of the screen. 32006 REM Width=6.4", Height=10.0" 32007 REM The total memory requiremen_}t of this routine is 2019 bytes (including the strings) with REMs removed. 32008 REM Use "GOTO 32100" to access the routine.`} The routine will not alter screen display in any way. 32009 REM Variables used: AA$, BB$, XX, YY, ZZ, SCREEN 32010 REM Ta}he resulting printout will be dark and well defned. Each bit of the original screen memory will now 32011 REM occupy four bb}its in the resulting printout. 32012 REM This routine will run as-is on GEMINI 10X/15X printers. Other printers may requirec} changes to the 32013 REM printer control codes in lines 32140 and 32170 32014 REM RAM used other that strings: 32015 REM d}$CB-$D2 (203-210) 32016 REM $0600-$06AB (1536-1707) 32017 REM 32100 DIM AA$(384),BB$(384) 32110 RESTORE 32200:ZZ=0:FOR Xe}X=0 TO 171:READ YY:POKE 1536+XX,YY:ZZ=ZZ+YY:NEXT XX 32111 IF ZZ<>21538 THEN ? "DATA ERROR":END 32120 SCREEN=PEEK(88)+256*Pf}EEK(89):SCREEN=SCREEN+(40*191) 32130 TRAP 32190:CLOSE #5:OPEN #5,8,0,"P:" 32140 ? #5;CHR$(27);"A";CHR$(8):FOR XX=SCREEN TO g}SCREEN+39 32150 AA$=CHR$(0):AA$(384)=CHR$(0):AA$(2)=AA$:BB$=AA$ 32160 ZZ=USR(1536,XX,ADR(AA$),ADR(BB$)) 32170 LPRINT CHR$(h}27);"K";CHR$(128);CHR$(1);AA$:LPRINT CHR$(27);"K";CHR$(128);CHR$(1);BB$ 32175 NEXT XX 32180 GOTO 32180 32190 ? "ERROR #";Pi}EEK(195):END 32200 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205,104,133,208,104,133,207,160,0,162,193,202,208 j}32210 DATA 1,96,177,203,133,209,41,128,133,210,165,209,74,41,96,5,210,133,210,165,209,74,74,41,24 32220 DATA 5,210,133,210,1k}65,209,74,74,74,41,6,5,210,133,210,165,209,74,74,74,74,41,1,5,210 32230 DATA 145,205,200,145,205,165,209,41,1,133,210,165,20l}9,10,41,6,5,210,133,210,165,209,10,10,41 32240 DATA 24,5,210,133,210,165,209,10,10,10,133,209,41,96,5,210,133,210,165,209,10m},41,128,5,210 32250 DATA 145,207,136,145,207,56,165,203,233,40,133,203,165,204,233,0,133,204,24,165,205,105,2,133,205 32260n} DATA 165,206,105,0,133,206,24,165,207,105,2,133,207,165,208,105,0,133,208,76,23,6 6-?:Sta}rt THEN DEST(0)=(End-Start) FOR I=1 to DEST(0) DO DEST(I)=SOURCE(Start+I-1) OD ELSE DEST(0)=0 DEST(1)=155 } FI RETURN ; ; Find delimiter: returns next occurrence ; of space char in SOURCE ; BYTE FUNC FindLim(BYTE Start, BYTE End) }IF End>Start THEN FOR I=Start TO End DO IF SOURCE(I)=32 THEN EXIT FI OD ELSE I=0 FI RETURN(I) ; ;} Test for lower case character ; BYTE FUNC IsLower(BYTE c) IF (c>='a) AND (c<='z) THEN RETURN(1) FI RETURN(0) ; ; Shift }to upper case if lower ; BYTE FUNC ToUpper(BYTE c) IF IsLower(c) THEN c==-$20 FI RETURN(c) ; ; Force substring to upper }case just ; in case you forgot... ; PROC SubUp() BYTE c FOR I=1 to DEST(0) DO c=DEST(I) DEST(I)=ToUpper(c) OD RETURN } ; Test Positive indent; examine DEST ; for match with positive keyword ; BYTE FUNC TestPos() BYTE Match Match=0 FOR I=1 T}O POS(0) DO KEYWORD=POS(I) IF SCompare(DEST,KEYWORD)=0 THEN Match=Indent FI OD RETURN(Match) ; ; Test Negative in}dent; examine DEST ; for match with negative keyword ; BYTE FUNC TestNeg() BYTE Match Match=0 FOR I=1 to NEG(0) DO KEYW}ORD=NEG(I) IF Scompare(DEST,KEYWORD)=0 THEN Match=Indent FI OD RETURN(Match) ; ; Test for Reset; cancel any ; outsta}nding pos/neg indents ; BYTE FUNC TestRes() BYTE Match Match=0 FOR I=1 to RES(0) DO KEYWORD=RES(I) IF Scompare(DEST,K}EYWORD)=0 THEN Match=Indent FI OD RETURN(Match) ; ; Test for Temporary reset; back up ; line one space to emphasize wo}rd. ; BYTE FUNC TestTemp() BYTE Match Match=0 FOR I=1 to TEMP(0) DO KEYWORD=TEMP(I) IF Scompare(DEST,KEYWORD)=0 THEN } Match=Indent FI OD RETURN(Match) ; ; Test for 'leader' word, e.g., complex ; expression such that keyword may follow ;} BYTE FUNC TestLead() BYTE Match Match=0 FOR I=1 to LEAD(0) DO KEYWORD=LEAD(I) IF SCompare(DEST,KEYWORD)=0 THEN Ma}tch=1 FI OD RETURN(Match) ; ; File handler; ; ; Opens Foo.ACT as input and ; Foo.FCT as output. Default ; filename is "T}EST". ; PROC FOpen(BYTE ARRAY FName) BYTE ARRAY INAME(16) ;Input file name BYTE ARRAY ONAME(16) ;Output file BYTE ARRAY }IEXT=".ACT" BYTE ARRAY OEXT=".FCT" IF FName(0)=0 THEN Scopy(Fname,"D:TEST") FI FOR I=1 TO FName(0) DO INAME(I)=FNa}me(I) ONAME(I)=FName(I) OD FOR I=FName(0)+1 TO FName(0)+4 DO INAME(I)=IEXT(I-FName(0)) ONAME(I)=OEXT(I-FName(0)}) OD INAME(0)=FNAME(0)+4 ONAME(0)=FNAME(0)+4 OPEN(2,INAME,4,0) ;Input is read only OPEN(3,ONAME,8,0) ;Output is} write only RETURN ; ; Process Record; inputs a line from ; Foo.ACT, strips it, tests for leading ; keywords, adjusts indent}ation, and ; outputs to Foo.FCT. PROC ProcRec() InputSD(2,SOURCE) ;Get record Strip() ;Delete leading spa}ces IF SOURCE(0)>0 THEN ;Skip blank lines CurPos=FindLim(1,SOURCE(0)) ;Find delimiter SubStr(1,CurPos) ;extract s}ubstring SubUp() ;Upper case IF TestLead() THEN ;Complex expression? LastPos=Curpos+1 CurPos=FindLim}(LastPos,Source(0)) ;Get next word SubStr(LastPos,Curpos) ;Extract SubUp() ;Upper case FI IF TestRes()#}0 OR SOURCE(1)='; THEN Spaces=Indent TempSpace=-Indent FI Spaces==-TestNeg() NextSpace=TestPos() TempSpace==-Te}stTemp() CurPos=Spaces+TempSpace+1 FOR I=1 TO 254 ;Blank target line DO DEST(I)=32 OD DEST(0)=254 DE}ST(255)=155 SAssign(DEST,SOURCE,Curpos,SOURCE(0)+CurPos) ScopyS(SOURCE,DEST,1,SOURCE(0)+Curpos) TempSpace=0 FI PrintD}E(3,SOURCE) ;Write record Spaces==+NextSpace RETURN PROC Main() BYTE ARRAY File(20) CLOSE(2) CLOSE(3) GRAPHICS(0) } ;CLEAR SCREEN POSITION(10,2) PRINTE("Action! Formatter") POSITION(2,4) PRINTE("Formats Action! source files with}") POSITION(2,5) PRINTE("indented DO-OD, IF-FI, etc. pairs.") POSITION(2,7) PRINTE("Specify input file as Dn:mumble") PO}SITION(2,8) PRINTE("Input extension of .ACT is assumed.") POSITION(2,9) PRINTE("Output file will be Dn:mumble.FCT") Posit}ion(2,11) PRINT("Input: ") INPUTS(File) FOpen(File) Setup() WHILE EOF(2)=0 DO ProcRec() OD CLOSE(2) CLOSE(3) POSI}TION(2,13) PRINTE("DONE!") RETURN $(171)=>:@4,7Aq<A,>:@4,W Apq(@ 32200 RETURN,%476) x66ɸfɮAɕ^ɗZɒ8ɯ /66i07 6L47Lx6L6p 6 6 } h2GH 6!@ YG GLI6EcE ?7G7E<7;76:76ɒL5G }ȱGL56 &76 x6<7 67:76 x6 :7;7Gԍ=7ȱGՍ>7 ؠȱ67)6767 x6N>7n=7j****}jH=7i h1EEE8E;7Ȍ;7L4<7:7 芢&7 x66ɗMEFh 6 6<75#7 `<7}i 6 66ɕO7 6 6L4 6B D7E HIKJ V6 660L4ԩ ؠ 7ȱ 7) }77 x6L4DEHI BLVp BLV   16`y YhhLI6/ } mt DOS oth ero lr uitD1:DOS.SYSError #128Bad sectors :  78w T }BDE(HI VLNo DOS.SYS: press Ԡ to re-boot44===========================================}========================ŠҠҠӠҮZZ6.Phhhhhhhh*h)h,h+آ ;********************************;* ŠӠΠ *;* FROM 1ST BOOK OF ATARI GAMES *;* ACTION! Translati }on by *;* Stephen S. MacKenzie *;********************************SET $000E=$3000SET $0491=$3000INCLUDE "D:SYS }LIB.ACT"INCLUDE "D:SYSIO.ACT"INCLUDE "D:SYSGR.ACT"INCLUDE "D:SYSMISC.ACT"MODULEDEFINE ENDFOR="OD",ENDWHILE="OD"BYTE ARR }AY data=[ 3 56 124 174 174 254 186 68 56 4 56 124 234 234 254 186 68 56 5 56 8 }4 214 254 254 186 68 56 6 56 124 254 214 214 186 68 56 1 255 255 255 255 255 255 2 }55 255 127 16 24 28 30 30 28 24 16 0]INT ARRAY adim(4),dir(4)INT a,b,chset,ppos,sc,sec,tpos,zp }CARD w,sensitivityBYTE chr,dp,i,j,st,x,device=$B7BYTE FUNC read() dp==+1 RETURN(data(DP))PROC setupchset() chset=( }Peek(106)-8)*256 FOR i=0 TO 7 DO Poke(chset+i,0) ENDFOR dp=$FF DO i=read() IF i=0 THEN RETURN FI FOR j=0 TO 7 D }O x=read() Poke(chset+i*8+j,x) ENDFOR OD RETURNPROC setupscreen() Graphics(17) Poke(756,chset RSH 8 }) sc=PeekC(88) SetColor(2,0,0) a=sc+21 FOR i=1 TO 21 DO PrintDE(6,"") ENDFOR Poke(a,5) DO j=Ra }nd(4) x=j DO b=a+adim(j) WHILE Peek(b)=129 DO Poke(b,j+1) Poke(a+adim(j)/2,0) a=b } j=Rand(4) x=j b=a+adim(j) ENDWHILE IF j<3 THEN j==+1 ELSE j=0 FI UNTIL j=x OD j=Peek(a }) Poke(a,0) IF J<5 THEN a=a-adim(j-1) FI UNTIL J>=5 OD RETURNPROC main() device=0 adim(0)=2 adim(1)=-40 } adim(2)=-2 adim(3)=40 dir(0)=20 dir(1)=21 dir(2)=19 dir(3)=1 Print("Sensitivity (500=High/6000=Low)? ") sensit }ivity=InputC() DO Graphics(17) setupchset() setupscreen() ppos=sc+230 Poke(ppos,5) Poke(20,0) Poke( }19,0) DO FOR i=0 TO 3 DO zp=ppos+dir(i) IF Peek(zp)=129 THEN Poke(zp,65) FI zp=ppos-dir(i) } IF Peek(zp)=129 THEN Poke(zp,65) FI ENDFOR st=Stick(0) tpos=ppos IF st=13 THEN tpos== }+20 chr=6 ELSEIF st=14 THEN tpos==-20 chr=5 ELSEIF st=7 THEN tpos==+1 chr }=4 ELSEIF st=11 THEN tpos==-1 chr=3 ELSE chr=5 FI IF STrig(0)=0 THEN ;User "peek" at }maze via "Fire" SetColor(2,0,14) FOR w=1 TO 60000 DO ENDFOR SetColor(2,0,0) FOR w=1 TO 60000 }DO ENDFOR WHILE STrig(0)=0 DO ENDWHILE FI IF Peek(tpos)=0 THEN Poke(ppos,0) Poke(tpos,chr }) ppos=tpos FI FOR w=0 TO sensitivity DO ENDFOR UNTIL ppos=sc+21 OD FOR i=1 TO 50 DO FOR j= }0 TO 3 DO w=Peek(53770) Poke(708+j,w) ENDFOR ENDFOR Graphics(18) PrintDE(6,"") } sec=(Peek(19)*256+Peek(20))/60 PrintD(6,"IN ") PrintID(6,sec) PrintDE(6," SECONDS.") PrintDE(6,"") Pri }ntDE(6,"press to") PrintDE(6,"play again") WHILE STrig(0)<>0 DO w=Peek(53770) Poke(711,w) ENDWH }ILE OD RETURNHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHeeL>(ee KMODULEBYTE ARRAY disp(800), work(800)CARD px, lptrINT base=[40], xptr, yptr, cntr, x, yBYTE none=[0], live=[1], born=[3$}], dead=[2], temp, py, inp INCLUDE "D:SYS.ACT"PROC Banner ()CHAR ansGraphics (0)Poke (101$}6,1)Poke (710,$C3)Position (2,3)PrintE (" New Life 1.0 (Life revisited)")PrintE (" Copyright (c) 1986 by Dan Rhea")$}PrintE ("This program is in the Public Domain")Position (0,9) PrintE (" This Program Was Written Using ACTION!")PrintE$} (" ACTION! is a Trademark of ")PrintE (" Action Computer Services")PrintE (" ")PrintE (" Portions of this pr$}ogram are")PrintE (" Copyright (c) 1984, A.C.S")Position (0,22)Print (" to continue")InputS (ans)$}RETURNPROC Look()cntr=0IF x>0 THEN cntr=cntr+work(lptr-1) ; WFIIF x>0 AND y>0 THEN cntr=cntr+work(lptr-1-base) ;$} NWFIIF y>0 THEN cntr=cntr+work(lptr-base) ; NFIIF x<39 AND y>0 THEN cntr=cntr+work(lptr+1-base) ; NEFIIF x<39 TH$}EN cntr=cntr+work(lptr+1) ; EFIIF x<39 AND y<19 THEN cntr=cntr+work(lptr+1+base) ; SEFIIF y<19 THEN cntr=cntr+wo$}rk(lptr+base) ; SFIIF x>0 AND y<19 THEN cntr=cntr+work(lptr-1+base) ; SWFIIF cntr=2 THEN ; Life IF work(lptr)=live $}THEN disp(lptr)=live ELSE disp(lptr)=none FIELSEIF cntr=3 THEN ; Birth IF work(lptr)=live THEN di$}sp(lptr)=live ELSE disp(lptr)=born FIELSE ; Death IF work(lptr)=live THEN disp(lptr)=dead ELSE $} disp(lptr)=none FIFIRETURNPROC Init()Graphics (0)Poke (710,$C3)PrintE (" ")PrintE ("$} ")PrintE (" ")PrintE (" 報ᠠ ")PrintE (" $} ")PrintE ("")PrintE (" ")PrintE (" ")PrintE (" This is basicly$} your standard Life")PrintE (" program except that this one will ")PrintE (" show births in green and deaths ")PrintE ("$} in red. The empty cells are the ")PrintE (" black ones and the live cells are ")PrintE (" yellow. The initial groth will$} be ")PrintE (" random. But you have some control ")PrintE (" over distribution by giving each ")PrintE (" cell a 50% cha$}nce (1) to less ")PrintE (" than 10% (9) by selecting 1-9 for ")PrintE (" the cell distribution. ")DO $} Position (2,22) Print (" Enter 1 to 9 for Distribution :") inp=InputB() IF inp<10 AND inp>0 THEN EXIT FIOD RETU$}RNPROC Plop ()px=x py=yPlot(px,py)RETURNPROC Main()Banner()DOInit()Graphics (3)Poke (708,$DA) ; YellowPoke (7$}09,$34) ; RedPoke (710,$C6) ; GreenPoke (752,1) PrintE ("Commands: to re-run program")PrintE (" You must $} to freeze screen")Print (" hold key to exit program")FOR yptr=0 TO 19 DO FOR xptr=0 TO 39 DO lpt$}r=yptr*base lptr=lptr+xptr temp=Rand(inp+1) IF temp=1 THEN disp(lptr)=live wor$}k(lptr)=live ELSE disp(lptr)=none work(lptr)=none FI color=disp(lptr) x$}=xptr y=yptr Plop () ODODDO FOR yptr=0 TO 19 DO FOR xptr=0 TO 39 DO lptr=yptr*base $}lptr=lptr+xptr y=yptr x=xptr Look () color=disp(lptr) Plop () OD OD FOR lptr=$}0 TO 800 DO IF disp(lptr)=dead THEN work(lptr)=none ELSEIF disp(lptr)=born THEN work(lptr)=live$} ELSE work(lptr)=disp(lptr) FI disp(lptr)=work(lptr) OD FOR yptr=0 TO 19 DO FOR xptr=0$} TO 39 DO lptr=yptr*base lptr=lptr+xptr color=disp(lptr) y=yptr x=xptr Plop ()$} OD OD IF Peek(53279)=5 THEN DO UNTIL Peek(53279)=7 OD FI IF Peek(53279)=6 THEN DO UNTIL Peek(53$}279)=7 OD EXIT FI IF Peek(53279)=3 THEN DO UNTIL Peek(53279)=7 OD inp=99 EXIT FIODIF inp=9$}9 THEN EXIT FIODBreak()::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::6-+$,'+%, 6-$%$`n8EMfP FM '((' (c)1983 Action Computer Services  B JKIH(}iDiELV`L8 8 BLV`nL"99l L9 &` Fj`8冨(}凪` X9EӅӥ X9`ʆǪƩ Ɛee` i9ƦʆǢ &Ɛeǐ 9 (}9LT9 i9'&&&8儨児祂*LT9&&*ń8&<9 9`hihiHHȱȱ(}L,9c !#3`L9JJJJ`H ,9h`Hȩh 8Lz: 9Lz: 8L(}z: 8Lz: 8H8`HhHh :Lz: BHI V䅠Lz: L; 8Lz:(} ؠPIPP` T;P 8Lz: v;L<; T;L{; ;LJ;H- E;8塪墨hL; ;L<; (};LJ; T;ȹP`텠8堨塪 T;芨Oȩ-`PP ;P棩 Ѥģ0(}-ģ6000:,80H & &ehe&eģ0ʥ 8堅塅`$ >;&*i0:0i >;Ʀ`(}¢ 护°ڱ%ȱ%E >;L<担CS :L`@0)ӈJJJJ)`Ѕ`ȱ`(}` >ȥ`HhƣĢ`ƥĤ`Ѣ I?`(}ѢĦ`膡``ťƤe8夰L_? Ƥ8`Ŧe(}Ѡe桊Lc?nL? = >â > =L@! New Life 1.0 (Life revisited)? :LH@! Copyright (c) (}1986 by Dan Rhea@& :Lw@$This program is in the Public Domain@R : =L@' This Program Was Written Using ACTION!@(} :L@ ACTION! is a Trademark of @ :LA Action Computer Services@ :LA A :L=A Portions of this (}program areA :LgA Copyright (c) 1984, A.C.SAG : =LA to continueAz :? :`LA(}88͂880LA8x8y8r8es8e8q88i8͂880LOB̈́880LOB8x8y88z8{8(}r8es8e8q88i8̈́880LB8x8z8y8{8r8es8e8q88i88'80LB̈́8(}80LBx8iy8i8z8{8r8es8e8q88i88'80L/Cx8iy8ir8es8e8q(}88i88'80LC880LCx8iy8imz8m{8r8es8e8q88i8880LCx8mz8(}y8m{8r8es8e8q88i8͂880L-D880L-D8x8y8mz8m{8r8es8e8)}q88i88I 8ILDr8mx8s8my8M8LtDn8mx8o8my88LDn8mx8o8my88L9E8I 8IL)}Dr8mx8s8my8M8LDn8mx8o8my88LDn8mx8o8my88L9Er8mx8s8my8M8L#En8mx8o8my8)}8L9En8mx8o8my88`L=E =â >LPE EN :L~E# EZ :LE# )} E :LE# 報ᠠ E :LF# E :L6F#)}F :LBF F@ :LNF FL :L|F# This is basicly your standard LifeFX :LF# program e)}xcept that this one will F :LF# show births in green and deaths F :LG# in red. The empty cells are the F :L)}4G# black ones and the live cells are G :LbG# yellow. The initial groth will be G> :LG# random. But you have some con)}trol Gl :LG# over distribution by giving each G :LG# cell a 50% chance (1) to less G :LH# than 10% (9) by )}selecting 1-9 for G :LHH# the cell distribution. H$ : =L|H Enter 1 to 9 for Distribution :H[ : ) }<88 LH͌8LHLHLOH`LH8w88v8888w8v8 =`LH ? :E =ڢ >4 >Ƣ > >LI!Comm) }ands: to re-run programH :LKI! You must to freeze screenI) :LvI hold key to exit programIU :) }8~8~88LJ}8|8'|8}8LJ{8z88~8 9x8y8x8m|8x8y8m}8y88i *>88IL&Jn8mx8) }o8my88r8mx8s8my88LTJn8mx8o8my88r8mx8s8my88n8mx8o8my8}88|88) }88~88 H|8}8LI~88LI8~8~88LEK}8|8'|8}8L:K{8z88~8 9x8y8x8m|8x8y8m}8)}y888~88}88|88 An8mx8o8my8 H|8Ј}8LJ~88LJy8x8 x8y8LLn8mx8o8my8M)}8LKr8mx8s8my88LKn8mx8o8my8M8LKr8mx8s8my88LKr8mx8s8my8n8mx8o8my8n8)}mx8o8my8r8mx8s8my8x8y8LMK8~8~88LL}8|8'|8}8LL{8z88~8 9x8y8x8m)}|8x8y8m}8y8n8mx8o8my888~88}88|88 H|8Ћ}8L>L~88L'LЩ >ILLЩ >ILLЩ )}>ILMЩ >ILLL2MЩ >IL/MЩ >ILMc8L2MLJ8IcL?MLBMLH ,9`Hddddddddddddddddddddddddddd)}dě//(@>:@',>:@Q,>:@,6-%A$@@-@96-%%-@A(MODULE; RAMXL.ACT ;------------------------------------- ; Copyright 1985 by Daniel L. Moore. ; RAMXL may not be sold, but-} may be ; freely copied and distributed. ;------------------------------------- ; Last modified on 03/30/85 ;-------------}------------------------- ; Support routines for the "extra" ; 14K of RAM in XLs that is located ; under the OS ROM. -} ; When an interrupt occurs and the OS ; is banked out, the RAMXL will bank ; the OS in, and then call the ROM OX ; inte-}rrupt handler. When control ; returns from the ROM OS, the OS is ; banked out, and control is returned ; to the original-} program. ; Only the NMI and IRQ vectors are ; supported, since the XL hardware banks ; the OS ROM in automatically -}when a ; chip reset occurs (the RESET button). DEFINE INT_VECTOR = "$FFF0" CARD NMI_Vector = $FFFA, RES_-}Vector = $FFFC, IRQ_Vector = $FFFE, Return_Addr BYTE PortB = $D301, NMIEN = $D4-}0E, X_Storage PROC OS_In=*() ; ROM OS resident [$AD PortB ; LDA PortB $09 $01 ; ORA #$01 toggle OS -}bit to ON $8D PortB ; STA PortB $60] ; RTS PROC OS_Out=*(); ROM OS not resident [$AD PortB ; LDA Por-}tB $29 $FE ; AND #$FE toggle OS bit to OFF $8D PortB ; STA PortB $60] ; RTS PROC JMP_Vector=*() -} [$4C $FFFF] ; JMP $FFFF PROC Handle_Interrupt=*() ; Handle the interrupt that just occured. [$8E X- }_Storage ; STX X_Storage $AA ; TAX A=the interrupt number $20 OS_In ; JSR OS_In ; Get-!} the address of the desired interrupt routine $BD INT_VECTOR ; LDA INT_VECTOR,X $8D JMP_Vector+1 ; STA JMP_VECTOR -"} $BD INT_VECTOR+1 ; LDA INT_VECTOR,X $8D JMP_Vector+2 ; STA JMP_VECTOR+1 ; Setup the stack to fake an interrupt and cal-#}l ; the OS ROM interrupt code. ; First the return address $AD Return_Addr+1; LDA Return_Addr+1 $48 ; P-$}HA $AD Return_Addr ; LDA Return_Addr $48 ; PHA ; Then the proccessor status register $58 -%} ; CLI enable IRQs, for Stage 2 VBLANK $08 ; PHP $4C JMP_Vector] ; JMP JMP_Vector PROC Retur-&}n_Here=*() ; Return here after the ROM OS interrupt code runs ; Bank the OS out, the return to the ; original program. [-'}$20 OS_Out ; JSR OS_Out $AE X_Storage ; LDX X_Storage $68 ; PLA from NMI.Handler or IRQ.Handle-(}r $40] ; RTI PROC NMI_Handler=*() ; Handle NMIs that occur while the OS is ; banked out. Save the A reg,-)} then get ; the vector number and call Handle_Interrupt. [$48 ; PHA $A9 $0A ; LDA #$0A $4C Ha-*}ndle_Interrupt]; JMP Handle_Interrrupt PROC IRQ_Handler=*() [$48 ; PHA $A9 $0E ; LDA #$0A $4-+}C Handle_Interrupt]; JMP Handle_Interrrupt ;------------------------------------- ; End of actual interrupt code. ; All -,}that is left is installing ; the vectors to the routines. ;------------------------------------- PROC Install_CharSet(--}) ; Copy the ROM char set at $E000 to $E3FF ; to the RAM bank, so that characters do ; not flicker when the RAM is accesse-.}d. ; If this is done, do not use the RAM ; from $E000 to $E3FF (57344 to 58367). BYTE POINTER where BYTE temp FOR -/}where=$E000 TO $E3FF DO OS_In() temp=where^ OS_Out() where^=temp OD OS_In() RETURN PROC Install_Interru-0}pts() Return_Addr=Return_Here; Set the return address pointer NMIEN=0 ; Turn all NMI interrupts off. [$78] ; SE-1}I Turn all IRQ interrupts off. OS_Out() ; Install the new interrupt routines ; vectors at $FFFA to $FFFF under the -2}; OS ROM. NMI_Vector = NMI_Handler IRQ_Vector = IRQ_Handler OS_In() [$58] ; CLI Turn IRQs back on. NMIEN=$4-3}0; Turn NMIs back on. Install_CharSet() RETURN ;------------------------------------- ; Now the routine that lets yo-4}u get to ; the RAM that is under the OS. ; There are actually 2 memory areas ; present: ; 4K at $C000 to $CFFF, 49152-5} to 53247 ; 10K at $D800 to $FFFF, 55296 to 65535 ; ; The last 6 bytes of the 10K area are not ; usable, since that is -6}where the interrupt ; routines are located. Therefore do not ; use any RAM above $FFF9 (65529) or you ; will crash the sy-7}stem. ;------------------------------------- PROC MoveBlockXL(BYTE POINTER dest,source, CARD size) ; This is a version -8}of MoveBlock that lets ; you use the extra RAM in XLs. OS_Out() FOR dest=dest TO dest+size DO dest^=source^ -9} source==+1 OD OS_In() RETURN MODULE; For user. B BHBB۩Bhi BBک捷BBFffڥۍB,AH H. /$%H&HXL :.h@H h`H)h`hAx :ԩՠ / :Ԉ1;}@XLhh:hhh :ԑԑԅL/]]]]]]]]]]]]]]]]]]]]]]]]]]]]]1<}]]]]]]8̽E@BN@ejnBD%eݥ8 @e̥8 @LVC̥e I@8 I@LVCe0MODULE ;RELGEN.ACT ;COPYRIGHT 1984, QMI, JS DeMar ;REV. 1.1, March 20, 1984 ;OBJECT CODE RELOCATION GENERATOR for ;AC5>}TION! compiled binary-load files. ;WARNING!!! This program requires ;four OPEN files simultaneously. ;Be sure that DOS i5?}s configured for ;this. With DOS 2.0, set $709 equal ;to at least 4, rewrite DOS and ;reboot. ;Requires the second file5@} compiled ;at any even page increment higher ;than the first file, for example: ;$3000 and $3100. ;Generates a table of5A} the locations ;that require relocating and saves ;it in a ".GEN" file in ACTION!. ; The ".REL" file is the original ;ob5B}ject code with an origin of "0". ;The actual relocator is compiled ;from the generic relocator source ;called "RELOC.ACT"5C} merged with the ;".GEN" file generated here. Append ;".REL" file to that code and it ;will load and relocate to MEMLO. 5D} DEFINE in1="1", in2="2", out1="3", out2="4" BYTE abrt ;--------------------------------- PR5E}OC MyError(BYTE a,x,y) IF y=170 THEN PrintE("ERROR File not found!") ELSE Print("ERROR! ") PrintBE(y) FI abrt=5F}1 RETURN ;--------------------------------- PROC Ferror() BYTE t,clock=$14 PrintE("ERROR in Output filespec!") t=5G}clock-$80 DO UNTIL t=clock OD RETURN ;--------------------------------- PROC Main() CARD start1,start2,end1,end2 5H}CARD offsets,offsete,i,count,hits CARD test1,test2,old1,old2,old3,old0 BYTE x,z,j,wnum,d1,d2, sthigh BYTE ARRAY fn5I}ame1(18),fname2(18), fnameout1(18),fnameout2(18) DO PrintE("} Relocation Code Generator ") PrintE(" 5J} JS DeMar 3/84 ") PutE() PrintE(" Requires two code files compiled") PrintE(" with an offset of $0100.") PutE5K}() Print("Filespec for code A >") InputMD(device,fname1,18) PutE() Print("Filespec for code B >") InputMD(device,fna5L}me2,18) PutE() Scopy(fnameout1,fname1) SCopy(fnameout2,fnameout1) j=1 IF fnameout1(1)#'D OR fnameout1(0)<4 THE5M}N Ferror() ELSEIF fnameout1(2)=': THEN z=0 ELSEIF fnameout1(3)=': THEN z=1 FI DO x=fnameout1(j) j==+1 5N}IF x=$20 THEN EXIT ELSEIF x='. THEN EXIT ELSEIF j>fnameout1(0) THEN j==+1 EXIT ELSEIF j>11+z THE5O}N Ferror() FI OD fnameout1(j-1)='. fnameout1(j)='G fnameout1(j+1)='E fnameout1(j+2)='N fnameout1(0)=j+2 j=5P}1 IF fnameout2(1)#'D OR fnameout2(0)<4 THEN Ferror() ELSEIF fnameout2(2)=': THEN z=0 EXIT ELSEIF fnameout5Q}2(3)=': THEN z=1 EXIT FI OD DO x=fnameout2(j) j==+1 IF x=$20 THEN EXIT ELSEIF x='. THEN EXIT 5R} ELSEIF j>fnameout2(0) THEN j==+1 EXIT ELSEIF j>11+z THEN Ferror() EXIT FI OD fnameout2(j-1)=5S}'. fnameout2(j)='R fnameout2(j+1)='E fnameout2(j+2)='L fnameout2(0)=j+2 Print("Generation file = ") PrintE(fnameout1)5T} Print("Relocation file = ") PrintE(fnameout2) Error=MyError abrt=0 Close(in1) Close(in2) Close(out1) Close(out2) 5U}Open(in1,fname1,4) Open(in2,fname2,4) IF abrt=1 THEN Close(1) Close(2) RETURN FI Open(out1,fnameout1,8) Open(o5V}ut2,fnameout2,8) x=GetD(in1) ;throw away two $FF's. x=GetD(in1) PutD(out2,$FF) PutD(out2,$FF) x=GetD(in1) PutD(out2,x5W}) start1=x ;start addr of file1. x=GetD(in1) PutD(out2,x) start1==+(x*256) x=GetD(in1) PutD(out2,x) end1=x x=GetD(5X}in1) PutD(out2,x) end1==+(x*256) ;end addr of file1. x=GetD(in2) ;throw away two $FF's. x=GetD(in2) x=GetD(in2) start5Y}2=x ;start addr of file2. x=GetD(in2) start2==+(x*256) x=GetD(in2) end2=x x=GetD(in2) end2==+(x*256) ;end addr of fi5Z}le2. offsets=start2-start1 sthigh=start1/256 offsete=end2-end1 PrintDE(out1,"MODULE") PrintD(out1,";For file ") P5[}rintDE(out1,fnameout2) PrintDE(out1,"") Print("Code starts at ") PrintD(out1,"CARD start=[") PrintCE(start1) PrintCD(out5\}1,start1) PrintDE(out1,"]") Print(" and ends at ") PrintD(out1,"CARD finish=[") PrintCE(end1) PrintCD(out1,end1) Prin5]}tDE(out1,"]") Print("Compile offset was ") PrintCE(offsets) IF offsete#offsets THEN PrintE("Diferrent size files!") 5^} PrintE("ABORTED!") ELSE PrintDE(out1,"") PrintD(out1,"CARD ARRAY otable=[") wnum=0 hits=0 count=0 WHILE 5_}EOF(in1)=0 DO d1=GetD(in1) d2=GetD(in2) IF d1#d2 THEN IF count<(end1-start1)-5 THEN hits==5`}+1 IF wnum=0 THEN PrintD(out1," ") Print(" ") ElSE PrintD(out1," ") 5a} Print(" ") FI PrintCD(out1,count) Print(" ") PrintC(count) wnum==+1 5b} IF wnum>4 THEN PrintDE(out1,"") PrintE("") wnum=0 FI FI old0=d1 5c} test1=old0*256 test1==+old1 test2=old2*256 test2==+old3 IF test1>=start1 AND test1<=end1 TH5d}EN IF test2=$02E3 OR test2=$02E1 THEN PrintDE(out1,"]") PrintE("]") PrintD(out1,"CA5e}RD hits=[") PrintCD(out1,hits) PrintDE(out1,"]") PrintDE(out1,"") Print("CARD hit5f}s=[") PrintC(hits) PrintE("]") PrintE("") PrintD(out1,"CARD runaddr=[") 5g} Print("CARD runaddr=[") test1==-start1 PrintCD(out1,test1) PrintC(test1) PrintD5q} BBOUNCE ACTBDUMP ACTB,DUMPG6 LSTB<DUMPG7 LSTB[DUMPG8 LSTBoDUMPS DOCB0tFORMAT ACTB FORMAT XMOBHIDMAZ ACTB!NULIFE ACTB,NULIFE XMOB&RAMXL ACTB:RAMXL XMOB.=RELGEN ACTBtRELGEN DOCBSNOW ACTBSNOW TXTBSNOW XMOB SORT ACTB SORT BINB(SORT DOCB4ST ACTB$ST DOCB)SUPERK ACTB?SUPERK XMOB7OTUMBLE ACTB*TUMBLE XMOE(out1,"]") PrintE("]") wnum=0 FI FI old3=old2 old2=old1 old1=d1 5r} d1==-sthigh ELSE old3=old2 old2=old1 old1=d1 FI PutD(out2,d1) count==+1 OD5s} FI PrintE("") PrintDE(out1,"") Close(in1) Close(in2) Close(out1) Close(out2) PrintE("Finished!}") RETURN (@4t Instructions for: RELGEN.ACT:== Relocation Generator & REOCAT.ACT:== Run-time Relocator These programs were inte9u}nded to create a self-relocating object file from either an ACTION! compiled program or an Assembled program. The origina9v}l object file must be a single-stage boot with only one origin except for the trailing run or init address. The following9w} instructions detail the steps to make the target object file. This file may be appended to other binary load files and ma9x}y have other binary files appended to it. The program will load at the next possible page boundary (increment of 256) aft9y}er MEMLO. Because RELGEN compares two versions of you object file, you may want to init all variables to zero to keep the9z} relocation table at a minimum. Stray data in the uninitialized variables may be interpreted as machine code that needs r9{}elocating. 1) Compile (or Assemble) your code at a convenient area but not conflicting with DOS. In ACTION!, use 9|}the following commands to force the program's origin to a specified value ($3000 for example): SET 14=$3000 S9}}ET $491=$3000 2) Re-Compile your code at $100 higher than the first. For the above example, this would be at $3109~}0. 3) From the ACTION! monitor, RUN the program RELGEN.ACT. It will prompt you for the filenames for the two object cod9}e files that you compiled above. Remember to give the Dn: prefix to the filenames. The program will compare the two object9} files and note their differences as offsets into the file. This information is saved in ACTION! form in a file with the 9}original name and a ".GEN" extention. This will be used in the next step. Also, the program creates an object file image o9}f the original but with an origin of zero. This is done to make the relocation process easier and this file, with a ".REL"9} extention will be used in step 5. Note: RELGEN.ACT requires four open DOS files simultaneously. By default, DOS usua9}lly has buffers for only 3. You must use the command: SET $709=4 in the ACTION! monitor and type D for DOS. Rewrite9} DOS to the disk and reboot. Now, DOS will allow the four files to be opened. 4) Now, Read the program RELOC.ACT into t9}he ACTION! Editor. This is a "generic" run-time relocator. The file generated with the RELGEN.ACT program (with the ".GEN"9} extention) must be merged into this program with the editor Read function. Position the cursor where instructed and read9} in the file. Compile this code but be sure that it is SET to compile above the expected end of YOUR program's target loca9}tion. Save this object code to disk and go to DOS. 5) Using the DOS Copy command, append the ".REL" file generated in 9}RELGEN.ACT, to the merged relocator file saved in step 4. For example: C Copy from,to: TEST.REL,AUTORUN.SYS/A This a9}ssumes that you saved the file in Step 4 as AUTORUN.SYS. 6) Finally, the appended file can be loaded from DOS or named A9}UTORUN.SYS as above for permanent applications. If you have question, send E-Mail to: John DeMar 71066,337 on Compuser9}ve or leave a message on the ACE-BASE BBS at (315)451-7747. Good Luck! l08JPROC MAIN() BYTE RND=53770 BYTE ARRAY DLST= [112 68 00 $90 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 =}4 4 4 4 4 4 4 4 4 4 4 4] BYTE POINTER L CARD DL=560 L=712 L^=0 L=708 L^=4 L=709 L^=8 L==}710 L^=12 L=53768 L^=0 L=53775 L^=3 L=53760 L^=3 L=53761 L^=15 L=756 L^=$80 L=559 L^=35 DL=DLST F=}OR L=$9000 TO $9600 DO L^=RND&63 OD DO FOR L=$8000 TO $8200 DO L^=RND OD OD RETURN <z __________________________________ COMMENTS ON THE "SNOW.ACT" PROGRAM __________________________________ I was veA}ry happy to read yourprogramming challenge, because thesnow problem was one I solved a fewmonths ago! In a couple of hoursA}, myACTION! cartridge and I managed toproduce an illusion that was goodenough to fool everyone: people whodidn't know aboA}ut the program thoughtmy TV was on the fritz, and the othersthought I was pulling their leg! The basic idea is simpliciA}ty itself. I created an oversize displayto eliminate the black border; eachline is in GR.8 mode with the LMSoption set; tA}his way, I can instantlychange all 320 pixels on a line bypointing its address somewhere else.I created a 304-byte array, A}filledwith values taken from the Atari'srandom number generator at 53770.To make a totally different display,I simply havA}e to modify the randomarray and reload each line with a newaddress, pointing somewhere insidethat array. This is easy enouA}gh forACTION! to do once each 1/60th of asecond, so that the end result is aconstantly-changing display. Compareto the noA}rmal method of putting randombytes at random locations onscreen:that method would update the displayonly partially before A}the TV scanprocess caught up with the processor,giving a much less dynamic display.(Reason: only part of each screenwouldA} be different from the previousone, and your eye wouldn't be fooled) Now that I've explained what goeson behind the sceA}nes, the programitself is quite easy to read, evenif you haven't seen ACTION! codebefore. I dimension three arrays andsetA} their location in memory so as tobe sure they don't get split by a 4Kboundary (a no-no with the ANTIC chip).Same thing goA}es for other variableslike 'vcount' and 'dlist'; referencingsuch variables makes a program muchmore readable than using stA}raightaddresses. The PROCedure MAKE_FLAKES stuffsrandom values in the 'flakes' array.Notice I loop from 0 to 151, storA}ingtwo values in each pass: this isfaster than going 304 times througha single store. When you want toupdate the screen eA}very frame, you'vegot to watch those machine cycles! MAKE_DISPLAY builds a customdisplay list from scratch. Each linewA}ill point to the address (flakes+random). Since 'random' returns anumber between 0 and 255, each linewill then seem to havA}e its own set ofrandom pixels. Nothing will preventtwo consecutive lines from pointing tothe same address, but since we reA}buildour display each 1/60 of a second theeffect will go by unnoticed. Once the display list is done, wetell ANTIC wheA}re it's located andchange the colors to have a nice,high-contrast black-and-white display.Setting ANTIC to "wide playfieldA}" mode,along with having 228 lines of data,effectively removes the border from theTV picture. (The effect is much betteroA}n a TV screen than on a monitor)The main program sets everything up,turns on a white noise-type sound, andstarts changing A}the screen every TVframe. Notice how easy it was to dothe vertical roll bar: if a line isinside the bar, I simply point toA} 48bytes of blanks instead of 48 bytes ofrandom data. This adds almost noprocessing time, yet greatly increasesthe realisA}m of the simulation. There you have it folks, yet anothershining example of the Atari supremacyin the graphics field! WA}e managed tohave our faithful, unexpanded 8-bit dotricks that only a $999+ computer (STor Amiga) can! Not bad for a 7-yearA} oldmachine, eh? \ Charles Blaquiere(can you typeset the accent A}in my name?I'd be sooo grateful!)LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLH67@,.Y67@,.6c#@W-.pD-]LF-B-ȍA-A-B-B-čA-A-B-B-ōA-A-B-E}B-ƍA-A-B- ҍB-A-A-B-ҍB-A-A-B-ҍB-A-A-B-ҍB-A-A-B-E}B-A-A-B-B-/A-A-B-#@-1?-0B-A-A-B-L{.A-B- )?A-B-LN.B-AE}-A-B-L.A-B- ҠA-B-L.L{.``C-......................................................................E}............:,29 THEN maxArgs=29 FI DO ;skip leading spaces WHILE cmdBuf(bufOffset)=$20 DO bu^5}fOffset ==+ 1 OD ;check for end of buf (60 + $3F offset) IF bufOffset>123 THEN EXIT FI ;save start of this arg^6}ument curArg = argPtr argPtr ==+ 1 argLen = 0 ;copy chrs up to whitespc or comma DO c = cmdBuf( buf^7}Offset ) IF (c=' ) OR (c=$9B) OR (c=0) OR (c=',) THEN EXIT F^8}I argspace( argPtr ) = c bufOffset ==+ 1 argPtr ==+ 1 argLen ==+ 1 OD ;If this ^9}arg empty, at end of arg list IF argLen=0 THEN EXIT FI ;Now add argument to list argspace( curArg ) = argLen ^:} argV( nArgs ) = argspace+curArg nArgs ==+ 1 UNTIL nArgs >= maxArgs OD RETURN( nArgs ) ;------------------------^;}------------- PROC ChangeDAT(BYTE ARRAY desired,at) BYTE i FOR i=1 TO desired^ DO at^=desired(i) at==+1 OD RETURN PROC ^<}FixAndGo() CARD ARRAY argaddrs(4) BYTE POINTER exten GetArgs(argaddrs,3) exten=argaddrs(1) IF exten^=0 ;use .DAT a^=}s default THEN RETURN FI IF exten^>3 ;exten too long THEN exten^=3 FI ChangeDAT(exten,$53CA) ;file nam^>}e ChangeDAT(exten,$5498) ;not-ok msg RETURN ;---end of SUPERK.ACT----------------- r spiral or sweep dissolvesof any gra\WROO`QT QэRx2R XQ \`/Q*Q RyQQQL/RHQ+ b@}*R# P RˍR̍RQhh@h  ɟ IM+h@˩Pi˥ibA}` Q QӅ Q $0R%1R Q` S0 KS RzT:T S`T{T Sl QQQR RR$R+R.R6RBRORTRYR^RbB}cRRRRRRRRJSP8JSISSS 8ISJSΩͩ˩P̠ˑΥR`HDEbC}I BLVD:PFKEYS.DAT@iRBHIDSEJK V0!RBDPE˝HI V0RH bD}B Vh` SuperKEY! Processor Installed (c) 1987 Orion Micro Systems@ Unable to Load File PFKEYS.DAT! SuperKEY! Ԡ bE}Installed...@@C (c)1983 Action Computer Services  B JKIHiDiEbF}LV`L9@ 9@ BLV`L@@l L@ &` Fj`8冨凪` @bG}EӅӥ @`ʆǪƩ Ɛee` @ƦʆǢ &Ɛeǐ A AL@ @'&&bH}&8儨児祂*L@&&*ń8&&L@ WA`hihiHHȱȱLbI}@c !#3` BLB AAAA?A B BAL=BA BmA BiI L^BAL=bJ}B{ALkBLCAAAA BmA BiAAI AIA AI,LBLBAAAAAALyBALBLCAAAbK}A mA*(mAmAAiAAAL=BA`&LC ACCCCDCDCCLsCCCCmCbL}CiCCCL9C`CL~CvCuC B muC*(mvCzCyCyCzCLC`yCzCѮLCyCbM}zCSʮzCyC CTzCyC C``{CbN} edit. (ANTIC disk, 6/85, JC mods)13. PENCILS. A sharp GTIA demo! (GreggTrav`-MODULE; Tumble 1.0; Copyright (c) 1985 by Dan Rhea; Program is in the public domain; This program uses graphics modes 3fP}; 5 7 9 10 11 and 15 (users choice) ; to create a "tumbling" line effect; The program is at; most an intresting demo and fQ}at the; very least entertaining for a few; moments.DEFINE YES="1", ; Logical true NO ="0" ; Logical falseINT AfR}RRAY xmax=[0 39 79 159 79 79 79 159], xmin=[0 0 0 0 0 0 0 0], ymax=[0 23 47 95 191 191 191 191], fS} ymin=[0 0 0 0 0 0 0 0], cmax=[0 4 4 4 16 9 16 4]INT x1, ; x coord 1 x2, ; x coord 2 x, ; fT}temp x y1, ; y coord 1 y2, ; y coord 2 y, ; temp y sx, ; temp stx sy, ; temp sty maxfU} ; temp max CARD cx1, ; card x coord 1 cx2, ; card x coord 2 i ; tempBYTE mode, ; GR. mode 3 5 7 9 10 1fV}1 15 dir1, ; direction 1 dir2, ; direction 2 stx1, ; movement factor x1 stx2, ; movement factor x2 sfW}ty1, ; movement factor y1 sty2, ; movement factor y2 new, ; if YES reset lc, ; last color d, ; tempfX} dirc by1, ; byte y coord 1 by2, ; byte y coord 2 glue, ; if YES coords connect t ; temp CHfY}AR a ; Y/N inputsPROC Setup (); Get run parameters or id START key; is pressed re-start with current; parameters fZ} IF PeekC (53279)<>6 THEN Graphics (0) ; clear screen; Get Graphics mode DO Position (2,1) f[} PrintE ("Tumble 1.0 by Dan Rhea 10/22/85") PrintE (" ") PrintE ("1 - Use Graphics mode 3") f\} PrintE ("2 - Use Graphics mode 5") PrintE ("3 - Use Graphics mode 7") PrintE ("4 - Use Graphics mode f]}9 (GTIA only)") PrintE ("5 - Use Graphics mode 10 (GTIA only)") PrintE ("6 - Use Graphics mode 11 (GTIA onf^}ly)") PrintE ("7 - Use Graphics mode 15 (xl/xe only)") PrintE (" ") PrintE ("Note: for thisf_} menu") PrintE (" to freeze display") PrintE (" to re-start drawing") Prinf`}tE (" ") Print ("Select:") mode = InputB() UNTIL mode < 8 AND mode > 0 OD; See if next pfa}attern starts where; the last one left off glue=99 DO Position (2,17) Print ("Connectedfb} Segments? (Y/N):") a = GetD(0) IF a='Y THEN glue=YES ELSEIF a='y THEN glufc}e=YES ELSEIF a='N THEN glue=NO ELSEIF a='n THEN glue=NO ELSE gfd}lue=99 FI UNTIL glue<>99 OD FI; Set up basic run parameters x1=Rand(xmax(mode)+1) ; Start x 1fe} x2=Rand(xmax(mode)+1) ; Start x 2 y1=Rand(ymax(mode)+1) ; Start y 1 y2=Rand(ymax(mode)+1) ; Start y 2 new=NO ; Usff}e inital values lc=0 ; Set "last" color; Set up Graphics mode required IF mode=1 THEN Graphics (3+16) ELSfg}EIF mode=2 THEN Graphics (5+16) ELSEIF mode=3 THEN Graphics (7+16) ELSEIF mode=4 THEN Graphics (9) fh} ELSEIF mode=5 THEN Graphics (10) t=$00 Poke(704,t) ;Black (back) t=$33 Poke(705,t) ;Dark Red t=$2fi}8 Poke(706,t) ;Orange t=$58 Poke(707,t) ;Purple t=$74 Poke(708,t) ;Dark Blue t=$7A Poke(709,t) ;Light Bluefj} t=$C5 Poke(710,t) ;Green t=$DA Poke(711,t) ;Almost Yellow t=$0F Poke(712,t) ;White; || +------fk}>Color regs; |+------------->Luminance; +-------------->Color ELSEIF mode=6 THEN Graphics (11) fl} Setcolor (8,0,0) ELSEIF mode=7 THEN Graphics (15+16) ELSE Setup() FIRETURNPROC Move ()fm}; Move the x and y coordinates in the; desired direction and apply the ; applicable step value IF d=1 THEN ; nefn} x=x+sx y=y-sy ELSEIF d=2 THEN ; e x=x+sx ELSEIF d=3 THEN ; se x=x+sx y=y+sy ELSEIF d=fo}4 THEN ; s y=y+sy ELSEIF d=5 THEN ; sw x=x-sx y=y+sy ELSEIF d=6 THEN ; w x=x-sx ELSEIF d=7 fp}THEN ; nw x=x-sx y=y-sy ELSEIF d=8 THEN ; n y=y-sy ELSE ; nowhere x=x y=y Ffq}I RETURN PROC Clamp (); Make sure we don't try to plot off; the edge of the screen (this is ; also why most xy stfr}uff is INT, we; need to be able to detect negative; values IF xxmax(mode) THEN x=xmax(mode) new=YES FI IF yymax(mode) THEN y=ymax(mode) new=YES FIRETURN PROC Main(); Run forever DO fu}; Initialize Setup () DO ; Set current color DO color=Rand(cmax(mode)) UNTIL color<>lc fv} OD ; Set last color, directions and; x y coords if needed lc=color dir1=Rand(8)+1 dir2=Rafw}nd(8)+1 IF glue=NO THEN x1=Rand(xmax(mode)+1) x2=Rand(xmax(mode)+1) y1=Rand(ymax(mode)+1) fx} y2=Rand(ymax(mode)+1) FI ; Set stepping values for each; coordinate point DO tfy}=0 stx1=Rand(4) stx2=Rand(4) sty1=Rand(4) sty2=Rand(4) t=stx1+stx2+sty1+sty2 fz} UNTIL t<>0 OD; Set maximum loop value IF xmax(mode) > ymax(mode) THEN max=Rand(xmax(mode)+1)+1f{} ELSE max=Rand(ymax(mode)+1)+1 FI PokeC (77,1) ; No attract mode; Loop till maxf|} expires, we detect; a START or OPTION, or we hit the; edge of the screen FOR i=0 TO max DO ; f}} Move each coordinate x=x1 y=y1 d=dir1 sx=stx1 sy=sty1 Move () ; move set 1 f~} x1=x y1=y x=x2 y=y2 d=dir2 sx=stx2 sy=sty2 Move () ; move set 2 x2=x y2=y; f} Check edge of screen x=x1 y=y1 Clamp () ; clamp coord x1=x y1=y f} x=x2 y=y2 Clamp () ; clamp coord x2=x y2=y; Plot the suckers cx1=x1 byf}1=y1 cx2=x2 by2=y2 Plot (cx1,by1) DrawTo (cx2,by2); Check for START or OPTION IF PeekC(f}53279)=3 THEN EXIT ELSEIF PeekC(53279)=6 THEN EXIT ELSEIF PeekC(53279)=5 THEN f} DO UNTIL PeekC(53279)<>5 OD FI ; See if we're up against the; wallf} IF new=YES THEN EXIT FI OD new=NO UNTIL PeekC(53279)=3 OR PeekC(53279)=6 ODOf}D````````````````````````````````d"&GK[ (c)1983 Action Computer Services  B JKIHiDiELV`L_Gj} _G BLV`LGGl LG &` Fj`8冨凪` GEӅӥj} G`ʆǪƩ Ɛee` HƦʆǢ &Ɛeǐ &H &HLG H'&&&8儨児j}祂*LG&&*ń8&&LG }H`hihiHHȱȱLGc !#3`j}LGJJJJ`H Gh`Hȩh GLI GLI GGLI OGLI UGH8j}`HhHh ILI BHI V䅠LI LI _GLIԆ ؠPIPP`j} IP OGLI JLI ILJ (JLIH- I8塪墨hL(J AJLI HJLI IȹP`j}텠8堨塪 I芨Oȩ-`PP IP棩 Ѥģ0-ģ6000:,80H j}& &ehe&eģ0ʥ 8堅塅`$ I&*i0:0i IƦ`¢ 护j}°ڱ%ȱ%E ILK担CS tILKI AJLKH