@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@P!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED065 FREE SECTORS COPYING---D2:READPIC.DOCl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 170ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8PuR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8PuLRS:H` B V`BDEhK)I JLVUVT`H 2` BHIhLV }}~ɛ  ;} 2T} ` RUN"D:MENU*.*"  \`bU}b U*.*"  \`b{ [ +'0@@A0@@[0@@2'!(} W}Π$('(POL(DThis Disk is full of ACTION! files marked with the Extender .O(ZHE(=Note: ACTION! is re X}quired to access these disk files.H(d--(%Also, there are several documentationna^(Vfiles marked with the Exten Y}der that you will want to read and/or print out.a(x,,($So... get out your ACTION! cartridge((( and start t Z}o examine these greatRO(Groutines so that you can begin to use them in your own programming.R(-*("Type to be [}gin using this disk!-(D:MENUso that you can begin to use them in your own programming.R(-*("Type to be &; FADE2.ACT; Copyright 1983 by Action Computer Services; All Right Reserved; last modified September 22, 1983;INC]}LUDE "SYS.ACT"DEFINE STRING = "CHAR ARRAY"DEFINE TAX = "$AA", CLC = "$18", RORX = "$7E", ; addr16,X INX = "$E8", BNE =^} "$D0", RTS = "$60", ROLX = "$3E", ; addr16,X DEX = "$CA"CHAR CH=764BYTE CONSOL=$D01FCHAR shrinkH, shrinkV, centerBY_}TE line, tics, spacing, nlinesCARD dltop, fontBase, delayBYTE ARRAY topCARD ARRAY chars(40)CARD POINTER dl, nextBYTE ARR`}AY ChCvt(0)=$490BYTE ARRAY charBase(2048)CARD ARRAY text(128)CHAR ARRAY text_space(2560)INCLUDE "FADE2.DAT"PROC Righta}=*(BYTE X)[ TAX CLC RORX $0$0 ; address is filled in INX BNE $FA ; -6, goes to RORX instr. RTS]PROC Left=*(Bb}YTE X)[ TAX CLC ROLX $0$0 ; address is filled in DEX BNE $FA ; -6, goes to RORX instr. RTS]PROC MoveUp() Bc}YTE i, k, sl, X, w, b, t CARD j, addrR=Right+3, addrL=Left+3 CHAR ARRAY p BYTE ARRAY buf BYTE ARRAY m1(0)=[$80$C0$E0$d}F0$F8$FC$FE$FF] BYTE ARRAY m2(0)=[$7F$3F$1F$F$7$3$1$0] BYTE ARRAY m3(0)=[$FF$7F$3F$1F$F$7$3$1] BYTE ARRAY m4(0)=[$0$80$e}C0$E0$F0$F8$FC$FE]; freeze display if START key down WHILE (CONSOL&1)=0 DO delay = 3000 OD; check for screen dumf}p IF (CONSOL&2)=0 THEN Close(1) Open(1,"P:",8) PrintDE(1,"L019T16[") top = dltop + 4 FOR i = 0 TO g}191 STEP 8 DO PrintD(1,"S0320") FOR j = 0 TO 319 DO next = top t = 0 w = j RSH 3 h} b = $80 RSH (j & $7) FOR k = 0 TO 7 DO buf = next^ next = next + 3 t = t RSH 1 i} IF buf(w) & b THEN t = t % $80 FI OD PutD(1, t) OD PutDE(1) top = j}next OD Close(1) FI sl = 0 next = dltop + 4 IF shrinkV#'n THEN; add +30 to next offset if top space tik}cs = tics + 1 IF tics>7 THEN tics = 0 sl = 80 next = next + 240 ELSEIF tics=4 THEN sl = 40 l} next = next + 120 ELSEIF tics=1 THEN sl = 20 next = next + 60 ELSEIF tics=5 THEN sl = 10 m}next = next + 30 FI FI; delay to make text more readable; Oh well! I guess I made it too fast! FOR j = 1 TO delayn} DO OD top = next^; top space; FOR i = sl TO 9 DO; dl = next; next = next + 3; dl^ = next^; OD FOR i = sl o}TO 159 DO dl = next next = next + 3 buf = next^ IF shrinkH#'n THEN w = word(i) b = bit(i) p}t = buf(w) IF w<20 THEN X = 255 - w addrR = buf - X Right(X) buf(w) ==& m1(b) % (t & m2q}(b)) ELSE X = 40 - w addrL = buf + w - 1 Left(X) buf(w) ==& m3(b) % (t & m4(b)) Fr}I ELSE FOR t = 1 TO 8 DO OD FI dl^ = buf OD; bottom space; end = 21 if top space FOR i = 1 TO 31 DOs} dl = next next = next + 3 dl^ = next^ OD IF line<8 THEN FOR i = 0 TO 39 DO p = chars(i) top(t}i) = p(line) OD ELSE Zero(top, 40) FI next^ = topRETURNPROC Fade() BYTE n, ATRACT=$4D, large; get the tu}ext ReadMsg() Init() n = 0 delay = 0 WHILE CH=$FF DO IF n>=nlines THEN n = 0 delay = 0 v} FOR line = 8 TO 199 DO MoveUp() IF CH#$FF THEN EXIT FI OD FI; turn off attact mode, we're; chaw}nging the screen anyway ATRACT = 0 large = StrCvt(text(n)) FOR line = 0 TO spacing DO MoveUp() IF lax}rge THEN MoveUp() FI IF CH#$FF THEN EXIT FI OD n = n + 1 OD CH = $FF Graphics(0)RETURNp() IF lan; FADE2.DAT; Copyright 1983 by Action Computer Services; All Right Reserved; data for FADE2.ACT; last modified Sez}ptember 22, 1983BYTE ARRAY word(0)=[7 24 11 20 11 22 18 27 9 2614 29 17 24 11 22 14 29 18 2114 27 16 23 15 24 12 30 19 {}2219 29 8 26 16 24 17 22 14 2619 22 10 27 9 30 10 20 19 2211 33 7 30 16 22 12 26 13 2715 29 19 26 13 20 12 30 11 2510 30|} 6 23 7 32 13 34 11 289 27 18 34 14 21 7 33 16 208 34 4 32 12 32 5 21 17 345 22 14 34 16 35 10 26 9 2718 30 18 25 12 32 3}} 20 14 2717 32 2 31 16 29 5 21 5 267 25 12 30 6 32 7 22 11 2616 35 16 25 13 20 18 26 10 304 35 7 33 5 25 15 30 2 22]BY~}TE ARRAY bit(0)=[$2 $4 $2 $2 $0 $5 $3 $4 $3 $4$5 $6 $0 $2 $5 $4 $1 $7 $5 $2$4 $2 $4 $2 $6 $1 $2 $2 $3 $1$1 $2 $3 $6 $0 $5} $0 $3 $7 $3$6 $0 $7 $6 $3 $5 $4 $6 $3 $7$0 $0 $6 $1 $7 $0 $0 $4 $5 $4$7 $2 $4 $0 $7 $1 $2 $1 $6 $2$7 $6 $2 $3 $0 $6 $4 $}3 $3 $6$0 $3 $1 $2 $2 $7 $3 $0 $0 $0$1 $7 $3 $4 $4 $3 $1 $3 $0 $7$3 $0 $3 $1 $6 $7 $2 $6 $6 $7$2 $3 $4 $1 $5 $3 $4 $7 $1 }$4$3 $7 $6 $4 $1 $1 $1 $3 $6 $6$7 $5 $5 $3 $0 $4 $2 $6 $5 $0$6 $5 $7 $0 $6 $6 $2 $4 $3 $0$5 $6 $5 $1 $1 $5 $0 $7 $2 $0]}PROC Init() BYTE i, j, n, pad, bits CARD RAMTOP=$69, SDMCTL=$22F CARD SDLST=$230, DMACTL=$D400 CARD DLIST=$D402, CH}BAS=$2F3 BYTE POINTER screen, p, c BYTE ARRAY x2(0)=[$0 $3 $C $F $30 $33 $3C $3F $C0 $C3 $CC $CF $F0 $F3 $FC $FF] tics} = 0; shrinkV = 'y; shrinkH = 'y; center = 'y; setup our screen Graphics(24) SetColor(1,12,4) SetColor(2,12,14) }SetColor(4,12,14) SDMCTL = 0 ; turn off display DMACTL = 0 screen = (RAMTOP-$2000)&$FF00 dltop = screen - $C00 Ze}ro(screen, $2000) dl = dltop dl^ = $7070 dl(1) = $70 dl ==+ 3 FOR i = 0 TO 191 DO dl^ = $4F ; command dl ==}+ 1 dl^ = screen ; address dl ==+ 2 screen ==+ 40 IF i=100 THEN ; handle 4K boundary screen = (screen+}$400) & $F000 FI OD dl^ = $41 ; JMP, wait vblank dl ==+ 1 dl^ = dltop SDLST = dltop DLIST = dltop SDMCTL =} $22 ; turn display back on; get character set fontBase = CHBAS & $FF00; in case cart. not inited yet ChCvt(0) = $40 } ChCvt($20) = $0 ChCvt($40) = $20 ChCvt($60) = $60; get a 2x FONT FOR i = 0 TO 7 DO ; scan line p = charBase + i} c = fontBase + i FOR j = 0 TO 127 DO ; character bits = c^ p(8) = x2(bits & $F) bits = bits RSH 4 } p^ = x2(bits) p = p + 16 c = c + 8 OD ODRETURNPROC ReadMsg() STRING msg Close(1) Open(1,"E:}FADE2.MSG",4) ; spacing-1 for each message line; should be a multiple of 4 but; doesn't have to be. Minimum is 8; for }normal letters. spacing = InputBD(1) IF spacing<8 THEN spacing = 7 ELSE spacing = spacing - 1 FI cent}er = GetD(1) shrinkV = GetD(1) shrinkH = GetD(1) InputSD(1, text_space) msg = text_space FOR nlines = 0 TO 127 DO} IF EOF(1) THEN EXIT FI InputSD(1, msg) text(nlines) = msg msg = msg + msg(0) + 1 OD Close(1)RETURNBY}TE FUNC StrCvt(STRING s) BYTE i, n, c, pad, j, max, large CARD t BYTE POINTER font n = s(0) IF n#0 AND s(1)=', T}HEN max = 41 large = 0 font = fontBase ELSE max = 20 large = 1 font = charBase FI IF n>max T}HEN n = max FI j = 0 IF center#'n THEN ; center text pad = ((max+1) - n) RSH 1 IF pad#0 THEN FOR i = 0 TO }pad-1 DO chars(j) = font j = j + 1 IF large THEN chars(j) = font+8 j = j + 1 } FI OD FI FI FOR i = 2-large TO n DO c = s(i) t = ChCvt(c & $60) % (c & $9F) t = t LSH 3 } IF large THEN t = t LSH 1 FI chars(j) = font + t j = j + 1 IF large THEN chars(j) = font + t + 8 }j = j + 1 FI OD FOR j = j TO 39 STEP 1+large DO chars(j) = font IF large THEN chars(j+1) = font+8 }FI ODRETURN(large)MODULE ; for rest of program DO chars(j) = font IF large THEN chars(j+1) = font+8 58 ; spacingyyy ; center, shrinkV, shrinkHActionComputerServices,presents:A C T I O N !ACTION! is a high-lev}el language for6502-based computersSpeeds of 100 to 200 times faster thanBASIC are standardin ACTION! programs.},EDIT WITH EASE ,,thanks to ACTION!'s built in screen,,editor which compares favorably to even,,the best} word processors. ,PRODUCE MORE CODE,,faster and easier using ACTION!'s,,program monitor and }built in library of,,support routines. ,ACTION! is a trademark,,of,,Action Computer Services},(ACS)library of,,support routines. ,ACTION! is a trademark,,of,,Action Computer Services ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FORK.ACT - Foreground/background; multi-tasking for ACTION!;;;;;;;;;;;;;;;;;;;};;;;;;;;;;;;;;;;;;;; by Mark Rose; this version: 4/25/85; Usage: Call the ACTION! procedure; Fork with the address o}f the; background routine you want to; run as the parameter. The Switch; procedure will be invoked as a; vertica}l blank interrupt routine; to schedule between the two; processes. By default, each; routine will get 10 jiffies of}; time before swapping will occur.; If you want to change these times,; set the appropriate value in the; TimeSli}ce array.; Restrictions: Both processes can; NOT perform I/O at the same time; since operating system device; han}dlers are not reentrant. Also,; neither process can monopolize; too much stack space, or one; process will crash. }The latter; should not be a problem since; ACTION! is non-recursive. Also,; the fore- and background routines; C}ANNOT call common ACTION! sub-; routines, except the cartridge; library. The reason is that any; parameters to ACTI}ON! PROCs and; FUNCs are not saved by the Switch; routine, so the subroutine may; get confused.;;;;;;;;;;;;;;;;;};;;;;;;;;;;;;;;;;;;;;; Global variables and definitions:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DEFINE MainPid = "0", ; P}rocess ID of foreground routine. ForkPid = "1" ; " " " background routine.BYTE CurPid, ; ID of currently e}xecuting routine. Done, ; Flag to indicate background is finished. Timer, ; Jiffy timer for context switch. } SaveSP ; Temp to hold stack pointer of sleeping process.; Definitions of temps to save and; storage for them.BYTE A}RRAY Temps(16) = $A0, Ptrs(16) = $80, MathTemps(16) = $C0, SaveTemps( 16 ), } SavePtrs( 16 ), SaveMath( 16 ); Number of jiffies in each time slice; for foreground and background process}es.BYTE ARRAY TimeSlice(2)= [ 10 10 ]; Deferred VBI vector and temp to; save old value.CARD VBIVec = $224, Ol}dVBI; Critical I/O flag (non-zero = critical)BYTE Critic=$42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Switch - Decrem}ent jiffy timer and; switch contexts to alternate; process, if time slice is over.; If contexts are switched, swap;} the contents of the 3 temporary; areas for ACTION! with the saved; values for the other process.;;;;;;;;;;;;;;;;;;};;;;;;;;;;;;;;;;;;;;PROC Switch() [ ; Do we need to change context? $CE Timer ; dec Timer $F0 3 ;} beq *+3 $6C OldVBI ; jmp (OldVBI) ; Yes, change context by swapping ; stack pointers and temps. $BA } ; tsx $8A ; txa $AE SaveSP ; ldx SaveSP $9A ; txs $8D SaveSP ; sta SaveSP $A}2 15 ; ldx #15 $B5 Temps ;l1: lda Temps,x $A8 ; tay $BD SaveTemps ; lda SaveTemps,x $95} Temps ; sta Temps,x $98 ; tya $9D SaveTemps ; sta SaveTemps,x $B5 Ptrs ; lda Ptrs,x $A8 } ; tay $BD SavePtrs ; lda SavePtrs,x $95 Ptrs ; sta Ptrs,x $98 ; tya $9D SavePtrs ;} sta SavePtrs,x $B5 MathTemps ; lda MathTemps,x $A8 ; tay $BD SaveMath ; lda SaveMath,x $95 MathT}emps ; sta MathTemps,x $98 ; tya $9D SaveMath ; sta SaveMath,x $CA ; dex $10 $D9 }; bpl l1 ; If running process was background ; routine, and Done flag was set, ; then stop this VBI routine, thus ; }giving foreground full CPU again. $AC CurPid ; ldy CurPid $F0 $11 ; beq l2 $AD Done ; lda Done }$F0 $0C ; beq l2 $AD OldVBI ; lda OldVBI $8D VBIVec ; sta VBIVec $AD OldVBI+1 ; lda OldVBI+1 $8D} VBIVec+1 ; sta VBIVec+1 $98 ;l2 tya $49 1 ; eor #1 $8D CurPid ; sta CurPid ; Set next }time slice $A8 ; tay $B9 TimeSlice ; lda TimeSlice,y $8D Timer ; sta Timer $6C OldVBI ; jmp} (OldVBI) ];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; StartFork - Begin execution of the; background process. Set }the Done; flag when that routine returns.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PROC ForkVec()PROC StartFork() F}orkVec() Done = 1 Timer = 1DO OD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Fork - Invoke a background process.; } The parameter is the name of the; ACTION! routine which is to be; executed in the background.; Remember, the foreg}round and; background processes cannot; perform I/O at the same time.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PROC Fo}rk( CARD address ) CARD temp BYTE status, i, addrLow = temp, addrHi = temp+1 BYTE ARRAY sysStac}k(0)=$100 ; Get current stack level and status. [ $BA ; tsx $8E SaveSP ; stx SaveSP $08 ; ph}p $68 ; pla $8D status ; sta status ] temp = StartFork ForkVec = address ; Leave 100 bytes fre}e for main process SaveSP ==- 100 ; and push background process address ; (StartFork) on stack with current ; stat}us value. sysStack(SaveSP+5) = addrLow sysStack(SaveSP+6) = addrHi sysStack(SaveSP+4) = status ; Get current v}alues of temps as ; initial values for background ; process. FOR i = 0 TO 15 DO SaveTemps(i) = Temps(i)} SavePtrs(i) = Ptrs(i) SaveMath(i) = MathTemps(i) OD ; Set initial context and time-slice ; (for}eground), and set background ; status to NOT COMPLETED. CurPid = MainPid Timer = TimeSlice(0) Done = 0 ; No}w set up scheduler as VBI routine. Critic = 1 OldVBI = VBIVec VBIVec = Switch Critic = 0RETURNMODULE ; Nox; SORTSCRN.ACT - Form two identical; windows on mode 7 screen with; random data. Then, sort the; left-hand window u }sing QuickSort,; and the righ-hand window using; BubbleSort. In order to do this; simultaneously, we will employ; } the multitasking routines in; FORK.ACT.; by Mark Rose; this version: 4/25/85INCLUDE "FORK.ACT" ; NOTES: Bot }h of the sorting methods; are not written to be as efficient; as possible. In particular, both; sorts can be made f }aster by taking; out the calls to compare and swap; routines, and inserting in-line; code, instead. In this demo,; } however, I have chosen clarity; over efficiency since the ; superiority of QuickSort is still; quite apparent. }; Define the number of rows and; columns on the two screen areas; to be sorted.; Also, SortSize = NRows*NCols; and Right }Col is the offset in bytes; of the right-hand screen window; from the left edge of the screen.DEFINE NCols = "19", } NRows = "80", SortSize = "1520", RightCol = "21"; Arrays of pointers to screen data; for QuickSort (Q }Data) and BubbleSort; (BData), respectively.CARD ARRAY BData( SortSize ), QData( SortSize ); MakeArray - fo }rm the list of pointers; to screen memory.PROC MakeArray() CARD row, col, index, screen = $58 BYTE POIN }TER qAddr, bAddr BYTE c index = 0 FOR col = 0 TO NCols-1 DO qAddr = screen + col bAddr = q }Addr + RightCol FOR row = 0 TO NRows-1 DO c = Rand( 255 ) qAddr^ = c bA }ddr^ = c QData( index ) = qAddr BData( index ) = bAddr qAddr ==+ 40 bAddr ==+ } 40 index ==+ 1 OD OD ; At this point, index shoul equal ; SortSize. In the spirit of a ; }simplistic demo, however, no ; check will be performed.RETURN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Bubble sort rou }tines:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BCompare - Compare two bytes.BYTE FUNC BCompare( CARD i, j ) BYTE POI }NTER p1, p2 p1 = BData( i ) p2 = BData( j ) IF p1^ < p2^ THEN RETURN( 1 ) FIRETURN( 0 ); BSwap }- Interchange two sort; elements.PROC BSwap( CARD i, j ) BYTE POINTER p1, p2 CARD temp p1 = BData( i ) }p2 = BData( j ) temp = p1^ p1^ = p2^ p2^ = tempRETURN; Bubble - Sort list by bubble sort; algorithm. Use } BSwap to inter-; change out-of-order elements.PROC Bubble() INT passes, index BYTE POINTER p1, } p2 FOR passes = 0 TO SortSize-2 DO index = SortSize-1 WHILE index>passes DO } IF BCompare( index, index-1 ) THEN BSwap( index-1, index ) FI index ==- 1 } OD ODRETURN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; QuickSort routines:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; };;;;;;MODULECARD ListSizeCARD ARRAY List( 64 ) ; Big enough for 64K sort elements; QCompare - Compare two bytes.B }YTE FUNC QCompare( CARD i, j ) BYTE POINTER p1, p2 p1 = QData( i ) p2 = QData( j ) IF p1^ < p2^ THEN } RETURN( 1 ) FIRETURN( 0 ); QSwap - Interchange two sort; elements.PROC QSwap( CARD i, j ) BYTE POINTER p1, } p2 CARD temp p1 = QData( i ) p2 = QData( j ) temp = p1^ p1^ = p2^ p2^ = tempRETURN; AddList - }Add a partition to the listPROC AddList( CARD low, high ) IF high+1 > low+1 THEN List( ListSize ) = low } ListSize ==+ 1 List( ListSize ) = high ListSize ==+ 1 FIRETURN; GetFirst - Retrieve last low,high; } pair from list of partitions.PROC GetFirst( CARD POINTER lowP, highP ) ListSize ==- 1 highP^ = List( ListSize ) } ListSize ==- 1 lowP^ = List( ListSize )RETURN ; Partition - Divide sort array into; two partitions.CARD FU }NC Partition( CARD low, high ) CARD i, j, pivot, mid ; Find median of 1st,middle,and last ; elements to use as pivot } for partitioning. mid = (low+high) RSH 1 IF QCompare( mid, low ) THEN QSwap( low, mid ) FI IF QCompa }re( high, low ) THEN QSwap( low, high ) FI IF QCompare( mid, high ) THEN QSwap( mid, high ) FI } ; Found pivot, now partition array. pivot = high i = low j = high WHILE i < j DO WHILE QCompar }e( i, pivot ) DO i ==+ 1 OD WHILE (QCompare(j,pivot)=0) AND (j>i) DO } j ==- 1 OD IF i < j THEN QSwap( i, j ) FI OD QSwap( i, high )RETURN( i } ); Quick - Sort using the QuickSort; algorithm.PROC Quick() CARD low, middle, high, i ListSize = 0 Add }List( 0, SortSize-1 ) WHILE ListSize > 0 DO GetFirst( @low, @high ) middle = Partition( low, high ) } ; Put larger partition onto stack first ; in order to decrease maximum stack size. IF (middle-low) > (hi }gh-middle) THEN AddList( low, middle-1 ) AddList( middle+1, high ) ELSE AddList( }middle+1, high ) AddList( low, middle-1 ) FI ODRETURN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; } Main routine - Calls Quick and; Bubble to sort both halves of; screen.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PROC Ma }in() DEFINE startKey = "1" BYTE console = $D01F ; Set up graphics data to sort. Graphics( 7 ) MakeArray() } Print( " QuickSort " ) PrintE( " BubbleSort" ) ; Start quicksort as background ; process with fore- a }nd background ; time slices of 1 jiffy TimeSlice( 0 ) = 1 TimeSlice( 1 ) = 1 Fork( Quick ) ; Start bubble so }rting. Bubble() PrintE("Finished - press START ") ; Now loop until START key pressed. WHILE console & startKe }y DO OD Graphics( 0 )RETURNess START ") ; Now loop until START key pressed. WHILE console & startKe -; Chain - ACTION! program loader; by Mark Rose - February, 1985PROC LoadFile=*( BYTE x ) CARD goAddr = $2E2, %} startAddr = $6F0, endAddr = $6F2 BYTE rtn = $6F4 [ $0A $0A $0A $0A $AA $A9 $60 $8D rtn $%}A9 $80 $8D goAddr $A9 $06 $8D goAddr+1 $A9 $F0 $A0 4 $9D $344 $A9 $06 $9D $345 $98 $9D $348 $A9 0 $9D $349 $A9 7 %}$9D $342 $20 $E456 $10 3 $6C goAddr $AD startAddr $C9 $FF $D0 23 $4D startAddr+1 $D0 18 $AD endAddr $8D start%}Addr $AD endAddr+1 $8D startAddr+1 $A9 $F2 $A0 2 $D0 $C4 $AD endAddr $38 $ED startAddr $9D $348 $AD endAddr+1 $ED%} startAddr+1 $9D $349 $FE $348 $D0 3 $FE $349 $AD startAddr $9D $344 $AD startAddr+1 $9D $345 $A9 7 $9D $342 %}$20 $E456 $10 $8F $98 $4C Error ]PROC LoadEnd=*()PROC Chain( BYTE ARRAY fileName ) Close( 1 ) Open( 1, fil%}eName, 4, 0 ) MoveBlock( $600, LoadFile, LoadEnd-LoadFile ) LoadFile( 1 )RETURN; From your ACTION! program, call t%}he; procedure Chain with the name of; the ACTION! program to which you; want to chain as the parameter.; For example,; %} Chain( "D:NEXTPROG.COM" ); would cause "NEXTPROG.COM" to be; run as a binary file. The desired; file MUST have been wri% }tten to disk; using the "W" command from the; ACTION! monitor.MODULE binary file. The desired; file MUST have been wri$I;KBUF.ACT;A 100-CHARACTER KEYBOARD BUFFER; uses page 6 to $6F4 (or so).;Also uses 204, 205 ($CC, $CD).;Object code) } from COMPUTE! magazine.;Set up for ACTION! by W.D.Aycock.;Last modified 12-17-85.;***********************************;) }NotLuL#m$H#m$H8$$H$$HLL#H#H$H$HHHHH 5HH 'LMLL*** FIL) }E TOO LARGE ***L &' 'LLOnly first %U bytes read.%E%EHHL *)LBML+MFile %S read, %U bytes.%E#HHM)} *)$$HILvM$$$$$mH$$mH$LM$$H$H$## m* 3'`TLM 'LM Write a file.M)} &'#Ϣ# m*LM%Ecurrent file: %S#M *)#L NLN(none)M &'LN '#LvNL1NWrite to current file? N 9')} {'$$ -$$ ' '$IYLkNLNLvN$IXLvN`LNFilename or ? Ny 9'# Z'# /#LN`# '0LM)}MLNAppend to current file? N 9' {'$$ -$$ ' '$IYLO MLO$IXLO` 'MIL=OL3OWrite)}O- 9'LNOLGOAppendO@ 9'LZO to %S? #OQ *) {'$$ -$$ ' '$IYLOM# &$$)}## 5 3'## m*&$%$ &'`OLO$ $LPLO%E%E%S%Eq$p$O *)` 7#m$#m$OL.P (%U) is %B)} $O$P" *)O 6O 6LbP :change to? PU 9' M+)?ILPX ' '`# Z'# /#LPLPLP$)}$$M$ $M$LP$$LP# -OOIXLP`LCSO =+L*Q#m$#m$HH# (hh$$)}LCSOI$LiQ#m$#m$HH# t4hh$$LCSOI'LQ#ILQ#m$#m$ LQ#m$#m)}$#$$LCSOI+L R# ,# 4OO$mO$mO$$LR$mO$$mO$LR7$6$ &'LCS)}OI-LwR# ,# 4OO$O$OLkR8$O$$O$LtR7$6$ &'LCSOI/LS# ,# /#LR#)}OOI/LR8$$$$LR# 4OOO$O$LRO$O$LR7$6$ &'LS$$LCSOI?LS 7LCSL list from cursorS &'L1T% numb)}er list from specific placeT &'LUT cursor pos: %U (%H)%E$$$$T; *)LT end of file: %U (%H)%E8$)}$8$$Tq *)LT List from? T 9' M+)?ILTX ' '`# Z'# /#L U$aS$`SL5U)}# -IXL$U`L5U# 4aS`SaS$`S$bSbSLVbS $e`S$iaS`S$aS$LULU!End of fil)}e reached at %U (%H).%E8$$8$$U *)LVLU%UaS`SU *) b5cScSL&V`SmcSaSi) }#e#e C7cSLU ' b5cScSLmV`SmcSaSi#e#e 6cSL3V ' b5cScSLV)!}`SmcSaSi#e#e 6cSLzV 'bSLJU`Si$aSi$$$$$L W0$$LW8$0$$$L W)"}$$LS` WLW8$$W$$WRLNW%Ecursor at: %U (%H)%E$$$$W7 *)LWfile size: %U (%H) by)#}tes%E$$$$Wj *)LWfree mem : %U (%H) bytesWWWWW *)d$$ B&WW B&)$}WWLX (%B%%)%E%EWWX *)RLGXUtilities: hit a key to chooseX( &'LhX X exit to Main MenuXQ &'LX C ch)%}ange the file sizeXr &'LX S set a block to a valueX &'LX M move a block within fileX &'LY T transfer two )&}equal blocksX &'L%Y U unlock a disk fileY &' 'LEY Your choice? Y7 9'R {'$$ -$$ ' '$IX)'}L|Y`LY$ICLY j9LY$ISLY ?LY$IMLY S;LY$ITLY ALY$IULY ELY`LW`LY####8#$#)(}$$$## )%$~%$F%F~%$$$$# R ' ' HL]Z%E%EӠ%E%E%EZC *)R 'LZ))}A Byte-Oriented File EditorZn &'R ' ' 'LZFree memory: %U (%H) bytes.%E%E$$$$Z *)R 'L [%This p)*}rogram is in the public domain.Z &'L9[$W.D.Aycock ** Novatari ** Jan.86[ &'Li[%Documentation is in file EDBYTES.DOC)+}.[C &' ' 'L[Type a letter...[y &'R 3' 3'L[K:[ & <6 '#L[L[ file in memory: %S%E%),}E#Ϣ[ *)L \ lear ead rite[ &'L?\# dit ist tilities eit ? \ 9' {'$$ -$)-}$ ' '$IXL\ 'L\Quit for sure (Y or N)? \y 9' {'$$ -$$ ' '$IYL\Ly]Lv]$ICL\ HLv]$).}IRL\ HLv]$IWL\ MLv]$IEL ] OLv]$ILL] dSLv]$IUL,] WLv]LF]%E Invalid command.%E]/ *)Lo] Type C, R)/}, W, E, L, U, or X.]P &'L[ 3' 3'R$%$~%``YL,] WLv]LF]%E Invalid command.%E]/ *)Lo] Type C, R(BMODULE ; SECTIO.ACT; The following routines perform; direct sector access to a disk; drive.PROC SIO=$E459()MODULETYP-1}E DCBREC = [ BYTE devID, driveNum, driveCmd, stat CARD buf, timeOut, c-2}ount, sect ]DCBREC POINTER DCBSET DCB = $300; SectIO - Call SIO to perform a read; or write of a single -3}sector; parameters: drive drive #; sector sector #; buffer address of buffer;-4} density 1,2 = sgl,dbl; returns: SIO error codeBYTE FUNC SectIO( BYTE drive, CARD sector, buffer, B-5}YTE density ) DCB.devID = '1 DCB.driveNum = drive DCB.buf = buffer DCB.timeOut = 15 DCB.sect -6} = sector ; Set byte count for proper density IF (density = 1) OR (sector <= 3) THEN DCB.count = 128 ELS-7}E DCB.count = 256 FI SIO() ; Call SIO to perform operationRETURN( DCB.stat ); ReadSector - Call SIO to -8}read a; sector from a disk drive.; parameters: drive drive #; sector sector #; -9}buffer address of buffer; density 1,2 = sgl,dbl; returns: SIO error codeBYTE FUNC ReadSector( -:}BYTE drive, CARD sector, buffer, BYTE density ) DCB.driveCmd = 'R DCB.stat = $40 SectIO( drive, sector, buffe-;}r, density )[ $60 ]; WriteSector - Call SIO to read a; sector from a disk drive.; parameters: drive drive #-<}; sector sector #; buffer address of buffer; density 1,2 = sgl,dbl; -=} returns: SIO error codeBYTE FUNC WriteSector( BYTE drive, CARD sector, buffer, BYTE density ) DCB.driveCmd = 'W ->} DCB.stat = $80 SectIO( drive, sector, buffer, density )[ $60 ]MODULE ; For usernsity ) DCB.driveCmd = 'W ,];STUFF.ACT - new stuff not installed;WDA 12-14-85;block moves:; MVE_RT(to,from,size); BlockMove(to,from,size);val1@}ue of an ASCII hex string:; BYTE FUNC H_sub(char); BYTE FUNC HValB(string); CARD FUNC HValC(string); CARD FUNC Ca1A}rdFromString(string); (needs CHARTEST.ACT);move GR.0 cursor on screen:; Tab(col);scroll colors until a key is hit:1B}; Scroll_colors();*************************************;Move block of memory from top down.;Use if toad>fromad AND blo1C}cks overlap;(library routine doesn't work right);FROM:"6502 Asmbly Lang Subrtns",p.201; Leventhal&Saville,McGraw-Hill,1981D}2;written for Action! by WDA, 12-85;(54 bytes relocateable code);*************************************PROC MVE_RT=*(BYTE1E} POINTER toadr,fromad CARD blklen ) [ 133 160 134 161 132 162 165 165 24 101 163 133 163 165 165 24 101 161F}1 133 161 164 164 240 9 136 177 162 145 160 192 0 208 247 166 165 240 16 198 163 198 161 136 177 162 145 160 192 1G}0 208 247 202 208 240 96 ];*************************************;Move a block of memory even if blocks;overlap. (calls 1H}MoveBlock or MVE_RT);*************************************PROC BlockMove(BYTE POINTER toadr,fromad CARD blkl1I}en ) IF ( (blklen + fromad) > toadr ) AND ( toadr > fromad ) THEN MVE_RT(toadr,fromad,blklen) ELSE MoveBlock(1J}toadr,fromad,blklen) FIRETURN;*************************************;*************************************;return val1K} (0-15) of single hex digit;note - letters A-F must be uppercase!;*************************************BYTE FUNC H_sub(CH1L}AR c) BYTE r r=0 IF (c>='0) AND (c<='9) THEN r=c-'0 ELSEIF (c>='A) AND (c<='F) THEN r=10+(c-'A) FIRETURN(r1M});*************************************;return CARD value of a hex string; letters A-F must be uppercase!;**************1N}***********************CARD FUNC HValC(CHAR ARRAY str) CARD result BYTE i,j,T CHAR ARRAY leg="0123456789ABCDEF" i=S1O}FindAny(str,leg) IF i=0 THEN RETURN(0) FI result=H_sub(str(i)) FOR j=1 TO 3 DO IF (i+j) > str(0) THEN EXIT FI T=s1P}tr(i+j) IF InString(T,leg)=0 THEN EXIT ELSE result==LSH 4 result==+H_sub(T) FI ODRETURN(res1Q}ult);*************************************;return BYTE value of a hex string;*************************************BYTE 1R}FUNC HValB(CHAR ARRAY str) BYTE result result=HValC(str)RETURN(result);*************************************;return a1S} CARD value of any string;string is either $hex or decimal;*************************************CARD FUNC CardFromString(1T}CHAR ARRAY str) BYTE i,j CARD temp temp=0 i=SFindAny(str,"0123456789") j=CharPos(str,'$) IF (str(0)=0) OR ( (i=0)1U} AND (j=0) ) THEN RETURN(0) FI IF (j#0) AND ( (i>j) OR (i=0) ) THEN temp=HValC(str) ;hex ELSE SRemove(str,1V}1,i-1) ;decimal temp=ValC(str) FIRETURN(temp);*************************************;************************1W}*************;move to column 0-39 on Gr.(0) screen;*************************************PROC Tab=*(BYTE c) [ 201 40 1441X} 7 56 233 40 144 247 176 245 133 85 169 0 133 86 96 ];*************************************;*************************1Y}************;scroll colors until any key is hit;(from DOS3TO2.ACT);*************************************PROC Scroll_colo1Z}rs()BYTE wsync=54282, vcount=54283, clr=53272, ctr, chgclr, incclr, ch=764 ch=255 ;clear keypress DO FOR ctr=1 TO 4 1[} DO incclr=chgclr ; set base color to increment DO wsync=0 ; wait for end of scan line clr=incclr ; chang1\}e displayed color incclr==+1 ; change luminance UNTIL vcount&128 ; end of screen test OD OD chgc1]}lr==+1 UNTIL CH<>$FF ODRETURN;*********************************;********************************* OD OD chgc0i; GetArgs - Pull arguments from CP; buffer into temporary area and; return the number of arguments; as the function 5_}value and the; addresses of strings containing; the arguments in the CARD ARRAY; argv.INT FUNC GetArgs( CARD ARRAY5`} argV BYTE maxArgs ) DEFINE CPBuf = "$3F", NewLine = "$9B", Space = "$20", Null = "0"5a} BYTE nArgs, ; num args encountered bufOffset, ; CP buffer offset argPtr, ; arg " " 5b} curArg, ; offset of start of this arg argLen, ; length of this arg c ; temp character 5c} BYTE ARRAY ArgSpace( 128 ) BYTE POINTER cmdBuf CARD dosVec = 10 ; Initialize our variables nArgs = 0 5d} argPtr = 0 bufOffset = CPBuf cmdBuf = dosVec DO ; skip leading spaces WHILE cmdBuf(bufOffset)=S5e}pace DO bufOffset ==+ 1 OD ; save start of this argument curArg = argPtr 5f} argPtr ==+ 1 argLen = 0 ; Now copy characters up to whitespace DO c = cmdBuf( bufOf5g}fset ) IF (c = Space) OR (c = NewLine) OR (c = Null) THEN EXIT 5q}b%DOS SYSb*)DUP SYSbSAUTORUN SYSbVMENU b\FADE2 ACTb yFADE2 DATbFADE2 MSGb/FORK ACTb1SORTSCRNACTb CHAIN ACTb& KBUF ACTb0SECTIO ACTb?STUFF ACTb^GETARGS ACTb uGETARGS DOCbSCRNDMP1ACTbSCRNDMP2ACTbSCRNDMP3ACTbnPSPIC3 ACTb @PSPIC3 DOCb`CHNGDIR DOCb=pCHNGDIR ACTbREADME DOC FI argSpace( argPtr ) = c bufOffset ==+ 1 argPtr ==+ 1 argLen ==+ 1 5r} OD ; If this argument empty, at end of arg list IF argLen = 0 THEN EXIT FI 5s} ; Now add argument to list argSpace( curArg ) = argLen argV( nArgs ) = argSpace+curArg nArgs ==+5t} 1 UNTIL nArgs >= maxArgs ODRETURN( nArgs )MODULEFile cmd (S,R,D,U,W,?,or Q) argSpace+curArg nArgs ==+4\ *** GETARGS.ACT ***NOTE: This routine is ONLY useful if you are using DOS XL or OS/A+. Other DOS'9v}s do not have the capability of command-line arguments!Description: The GetArgs functionin the file GETARGS9w}.ACT allows anACTION! program to pull argumentsoff of the DOS XL or OS/A+ commandline. For example, if you compiledan AC9x}TION! program into an objectfile called PROG.COM and then ranthe program from DOS XL with thefollowing command line: 9y} PROG arg1 arg2 arg3the GetArgs routine, when called,would look at that command lineand put the four strings "PROG","9z}arg1", "arg2", and "arg3" intomemory and return pointers to them.It would also return the number ofarguments on the line, 9{}4 in thiscase. Note that the name of theprogram on the command line IScounted as an argument by GetArgs.Usage: An exam9|}ple of how to callGetArgs is found in the fileECHO.ACT. In this case, the mainroutine of ECHO.ACT calls GetArgsand just 9}}prints the arguments onseparate lines. You must rememberto pass GetArgs the maximum numberof arguments you want to allow,9~} andthe name of a CARD ARRAY which hasbeen dimensioned to that length.Upon return, the CARD ARRAY willcontain the address9}es of normalACTION! strings which contain thearguments.File cmd (S,R,D,U,W,?,or Q)he CARD ARRAY willcontain the address8W; Horizontal screen dump for EPSON printer; prepared on 30 Apr 84 by Jim Watson; Use par of Clinton Parker's PLOT; routin=}e from ANALOG No.18, Apr84BYTE row=[40],y=[1],x=[1],j,k, Cvalue,LTR,INVFLGBYTE ARRAY SCRNstring(420)BYTE ARRAY d=}iv8(320)BYTE POINTER posCARD ARRAY Line(192)CARD col=[0],i,l, ctr,start=[1],end=[59500], Screen=88,Offset,Cha=}rsetBYTE FUNC ASCtoGR8(BYTE Ltr) IF Ltr>127 THEN Ltr==-128 FI IF Ltr<32 T=}HEN RETURN(Ltr+64) ELSEIF Ltr<97 THEN RETURN(Ltr-32) FIRETURN (Ltr)PROC Gr8Txt()=} y=125 x=20 Offset=Screen+y*40+x INVFLG=(') LTR=ASCtoGR8(INVFLG) Charset=57344+Ltr*8 FOR j==}0 TO 7 DO Cvalue=Peek(charset+j) IF INVFLG>127 THEN Cvalue== ! 255 FI =} PokeC(Offset+j*40,Cvalue) ODRETURNPROC Frame() Plot (2,2) DrawTo (318,2) DrawTo (318,190) =} Drawto (2,190) Drawto (2,2) Plot (4,4) Drawto (316,4) Drawto (316,188) Drawt=}o (4,188) Drawto (4,4)RETURNPROC Isometric() PLOT (12+col,18+row) DRAWTO(39+col,3+row) DRAWTO(78+col,27=}+row) DRAWTO(51+col,42+row) DRAWTO(12+col,18+row) PLOT (78+col,27+row) DRAWTO(78+col,57+row) DRAWTO(51+col,72+row) =}DRAWTO(12+col,48+row) DRAWTO(12+col,18+row) PLOT (51+Col,42+Row) DRAWTO(51+col,72+row)RETURNPROC Cabinet() PLOT (=}21+col,30+row) DRAWTO(39+col,18+row) DRAWTO(69+col,18+row) DRAWTO(51+col,30+row) DRAWTO(21+col,30+row) PLOT (69+col,=}18+row) DRAWTO(69+col,48+row) DRAWTO(51+col,60+row) DRAWTO(21+col,60+row) DRAWTO(21+col,30+row) PLOT (51+Col,30+Row)=} DRAWTO(51+col,60+row)RETURNPROC TwoPoint() PLOT (15+col,18+row) DRAWTO(37+col,13+row) DRAWTO(75+col,24+row) DRAWT=}O(51+col,36+row) DRAWTO(15+col,18+row) PLOT (75+col,24+row) DRAWTO(75+col,50+row) DRAWTO(51+col,66+row) DRAWTO(15+co=}l,36+row) DRAWTO(15+col,18+row) PLOT (51+Col,36+Row) DRAWTO(51+col,66+row)RETURNPROC Dumpinit() BYTE POINTER LineL=}oc LineLoc=Screen FOR i=0 TO 191 DO Line(i)=LineLoc LineLoc==+40 OD FOR i=0 TO 319 DO d=}iv8(i)=i/8 ODRETURNPROC Makestring(BYTE vertpos) BYTE vline BYTE ARRAY TEMP(6) FOR i=0 TO 319 DO k=(i&7=}) vline==LSH 9 FOR j=0 TO 5 DO pos=line(j+vertpos)+div8(i) Temp(j)=pos^ Temp(j)===}LSH k Temp(j)==RSH 7 vline==% Temp(j) IF j<5 THEN vline==LSH 1 FI =} OD SCRNstring(50+i)=vline ODRETURNPROC SCRNdmp() BYTE ctr,t,vertpos=[0] FOR i=0 TO 420 DO SC=}RNstring(i)=' OD Dumpinit() Close(3) OPEN(3,"P:",8) PrintDE(3,"A") FOR ctr=0 TO 31 DO MakeSTRING(vert=}pos) PrintD(3,"K") FOR i=1 to 420 DO PutD(3,SCRNstring(i)) OD PutDE(3) vertpos=}==+6 OD PrintDE(3,"@") CLOSE(3)RETURNPROC Main() GRAPHICS(24) SetColor(2,8,0) SetColor(4,3,0) color=1 Fr=}ame() col=10 TwoPoint() col=115 Isometric() col=220 Cabinet() Gr8Txt() FOR ctr=start TO end DO ;****** nul=}l statement OD SCRNdmp()RETURN metric() col=220 Cabinet() Gr8Txt() FOR ctr=start TO end DO ;****** nul<(; Side screen dump for EPSON printer; prepared on 30 Apr 84 by Jim Watson; Use part of Clinton Parker's PLOT; routine fromA} ANALOG No.18, Apr84BYTE row=[40],y=[1],x=[1],j, Cvalue,LTR,INVFLGBYTE ARRAY SCRNstring(420)BYTE ARRAY div8(320)A}BYTE POINTER posCARD ARRAY Line(192)CARD col=[0],i, ctr,start=[1],end=[59500], Screen=88,Offset,CharsetBYA}TE FUNC ASCtoGR8(BYTE Ltr) IF Ltr>127 THEN Ltr==-128 FI IF Ltr<32 THEN RETURN(LtrA}+64) ELSEIF Ltr<97 THEN RETURN(Ltr-32) FIRETURN (Ltr)PROC Gr8Txt() y=125 x=20 Offset=Screen+yA}*40+x INVFLG=(') LTR=ASCtoGR8(INVFLG) Charset=57344+Ltr*8 FOR j=0 TO 7 DO Cvalue=Peek(charset+j) IA}F INVFLG>127 THEN Cvalue== ! 255 FI PokeC(Offset+j*40,Cvalue) ODRETURNPROC Frame() Plot (2A},2) DrawTo (318,2) DrawTo (318,190) Drawto (2,190) Drawto (2,2) Plot (4,4) Drawto (3A}16,4) Drawto (316,188) Drawto (4,188) Drawto (4,4)RETURNPROC Isometric() PLOT (1A}2+col,18+row) DRAWTO(39+col,3+row) DRAWTO(78+col,27+row) DRAWTO(51+col,42+row) DRAWTO(12+col,18+row) PLOT (78+col,27A}+row) DRAWTO(78+col,57+row) DRAWTO(51+col,72+row) DRAWTO(12+col,48+row) DRAWTO(12+col,18+row) PLOT (51+Col,42+Row) A}DRAWTO(51+col,72+row)RETURNPROC Cabinet() PLOT (21+col,30+row) DRAWTO(39+col,18+row) DRAWTO(69+col,18+row) DRAWTO(5A}1+col,30+row) DRAWTO(21+col,30+row) PLOT (69+col,18+row) DRAWTO(69+col,48+row) DRAWTO(51+col,60+row) DRAWTO(21+col,6A}0+row) DRAWTO(21+col,30+row) PLOT (51+Col,30+Row) DRAWTO(51+col,60+row)RETURNPROC TwoPoint() PLOT (15+col,18+row)A} DRAWTO(37+col,13+row) DRAWTO(75+col,24+row) DRAWTO(51+col,36+row) DRAWTO(15+col,18+row) PLOT (75+col,24+row) DRAWTA}O(75+col,50+row) DRAWTO(51+col,66+row) DRAWTO(15+col,36+row) DRAWTO(15+col,18+row) PLOT (51+Col,36+Row) DRAWTO(51+coA}l,66+row)RETURNPROC Dumpinit() BYTE POINTER LineLoc LineLoc=Screen FOR i=0 TO 191 DO Line(i)=LineLoc A} LineLoc==+40 OD FOR i=0 TO 319 DO div8(i)=i/8 ODRETURNPROC SCRNdmp() CARD t FOR i=0 TO 420 DA}o SCRNstring(i)=' OD Dumpinit() Close(3) OPEN(3,"P:",8) PrintDE(3,"A") FOR t=0 TO 319 STEP 8 DO A} FOR j=0 to 191 DO pos=line(j)+div8(t) SCRNstring(254-j)=POS^ OD PrintD(3,"K") FOR i=A}1 TO 420 DO PutD(3,SCRNstring(i)) OD PutDE(3) OD PrintDE(3," ") PrintD(3,"@") CLOSE(3)RA}ETURNPROC Main() BYTE jifclock=[0] GRAPHICS(24) SetColor(2,8,0) SetColor(4,3,0) color=1 Frame() col=10 TwoPoA}int() col=115 Isometric() col=220 Cabinet() Gr8Txt() j=jifclock FOR ctr=start TO end DO ;****** null statemA}ent OD SCRNdmp() PrintF("%E %U Jiffies",j)RETURN j=jifclock FOR ctr=start TO end DO ;****** null statem@< ; Horizontal screen dump for EPSON; printer. Prepared on 30 Apr 84; by Jim Watson.; Use part of Clinton Parker's PLOTE}; routine from ANALOG No.18, Apr84; ; | modified for®îծӮ by |; | P.L.DellE}'Era |; BYTE row=[84],y=[1],x=[1],j,k, Cvalue,LTR,INVFLG,EOL=[$9B]BYTEE} ARRAY SCRNstring(420)BYTE ARRAY div8(320)BYTE POINTER posCARD ARRAY Line(192)CARD col=[0],i,l, ctr,start=[1],endE}=[59500], Screen=88,Offset,CharsetBYTE FUNC ASCtoGR8(BYTE Ltr) IF Ltr>127 THEN Ltr==-128 E} FI IF Ltr<32 THEN RETURN(Ltr+64) ELSEIF Ltr<97 THEN RETURN(Ltr-32) E} FIRETURN (Ltr)PROC Gr8Txt() LTR=ASCtoGR8(INVFLG) Charset=57344+Ltr*8 FOR j=0 TO 7 DO CvalE}ue=Peek(charset+j) IF INVFLG>127 THEN Cvalue== ! 255 FI PokeC(Offset+j*40,CE}value) ODRETURNPROC Frame() Plot (2,2) DrawTo (318,2) DrawTo (318,190) Drawto (2,190) E} Drawto (2,2) Plot (4,4) Drawto (316,4) Drawto (316,188) Drawto (4,188) DE}rawto (4,4)RETURNPROC Isometric() PLOT (12+col,18+row) DRAWTO(39+col,3+row) DRAWTO(78+col,27+row) DRAWTO(51+col,42+E}row) DRAWTO(12+col,18+row) PLOT (78+col,27+row) DRAWTO(78+col,57+row) DRAWTO(51+col,72+row) DRAWTO(12+col,48+row) E}DRAWTO(12+col,18+row) PLOT (51+Col,42+Row) DRAWTO(51+col,72+row)RETURNPROC Cabinet() PLOT (21+col,30+row) DRAWTO(3E}9+col,18+row) DRAWTO(69+col,18+row) DRAWTO(51+col,30+row) DRAWTO(21+col,30+row) PLOT (69+col,18+row) DRAWTO(69+col,4E}8+row) DRAWTO(51+col,60+row) DRAWTO(21+col,60+row) DRAWTO(21+col,30+row) PLOT (51+Col,30+Row) DRAWTO(51+col,60+row)E}RETURNPROC TwoPoint() PLOT (15+col,18+row) DRAWTO(37+col,13+row) DRAWTO(75+col,24+row) DRAWTO(51+col,36+row) DRAWTE}O(15+col,18+row) PLOT (75+col,24+row) DRAWTO(75+col,50+row) DRAWTO(51+col,66+row) DRAWTO(15+col,36+row) DRAWTO(15+coE}l,18+row) PLOT (51+Col,36+Row) DRAWTO(51+col,66+row)RETURNPROC Dumpinit() BYTE POINTER LineLoc LineLoc=Screen E} FOR i=0 TO 191 DO Line(i)=LineLoc LineLoc==+40 OD FOR i=0 TO 319 DO div8(i)=i/8 ODRETURNE}PROC Makestring(BYTE vertpos) BYTE vline BYTE ARRAY TEMP(6) FOR i=0 TO 319 DO k=(i&7) vline==LSH 9 E} FOR j=0 TO 5 DO pos=line(j+vertpos)+div8(i) Temp(j)=pos^ Temp(j)==LSH k Temp(j)=E}=RSH 7 vline==% Temp(j) IF j<5 THEN vline==LSH 1 FI OD SCRNstriE}ng(50+i)=vline ODRETURNPROC SCRNdmp() BYTE ctr,t,vertpos=[0] FOR i=0 TO 420 DO SCRNstring(i)=' OD E} Dumpinit() Close(3) OPEN(3,"P:",8) PrintDE(3,"A") FOR ctr=0 TO 31 DO MakeSTRING(vertpos) PrintD(3,"KE}") FOR i=1 to 420 DO PutD(3,SCRNstring(i)) OD PutDE(3) vertpos==+6 OD PrintDE(E}3,"@") CLOSE(3)RETURNPROC PrintFile() BYTE w,XX CARD SAVE SAVE=Screen close(3) open(3,"D:SE}CRNDMP3.ACT",4) y=0 x=0 FOR XX=0 TO 10 DO FOR W=2 TO 38 DO Offset=Screen+W E} INVFLG=GetD(3) IF INVFLG=$9B THEN EXIT FI Gr8Txt() E} OD Screen==+320 OD Screen=SAVE Close(3)RETURNPROC Main() GRAPHICS(24)E} SetColor(2,8,0) SetColor(4,3,0) color=1 PrintFile() Frame() col=10 TwoPoint() col=115 Isometric() col=220 CabE}inet() y=178 x=20 Offset=Screen+y*40+x INVFLG=(') Gr8Txt() SCRNdmp()RETURN sometric() col=220 CabDeraphic Library ;File conversion utility;by Mike Collins;ver. 3;10/13/85;Š٠͠ˮ;ŠΠI}ŠŮBYTE ramtop=106, hitop, lotop,picflag=[0], over, margin=82, vtab=84,htab=85BYTE ARRAY fname, filename, I} vtocsec(128), vtoc, mask=[128 64 32 16 8 4 2 1], dirbuf(129), psid=['P 'R 'I]CARD smem=88, screen, I}dlhi, xpos, yposTYPE directory=[BYTE n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,na,nb,nc,nd,ne,nfCARD startsec, PA, bytes]directory POI}INTER file;************************************;Burst (Block) I/O routines to do;quick disk I/O, utilizing a call to;CIOI};************************************PROC CIO=$E456(BYTE areg,xreg);************************************CARD FUNC BurstI}(BYTE chan,mode, CARD addr,buflen) TYPE IOCB=[BYTE id,num,cmd,stat CARD badr,padr,blen I} BYTE a1,a2,a3,a4,a5,a6] IOCB POINTER iptr chan==&$07 iptr=$340+(chan LSH 4) iptr.cmd=mode iptr.blen=buflenI} iptr.badr=addr CIO(0,chan LSH 4)RETURN(iptr.stat);************************************CARD FUNC BGet(BYTE chan I} CARD addr,len) CARD temp temp=Burst(chan,7,addr,len)RETURN (temp);************************************BYTE FUI}NC BPut(BYTE chan CARD addr,len)BYTE stat stat=Burst(chan,11,addr,len)RETURN(stat);********************I}****************PROC DISKINV=$E453();************************************BYTE FUNC resdisk(BYTE drv, cmd I} CARD buf, sec)TYPE DCB=[BYTE sbi, dnum, com, stat CARD addr, to, cnt, secnum]DCB POINTER diskdisk=$300disk.dnI}um=drvdisk.com=cmddisk.addr=bufdisk.secnum=secDISKINV() RETURN(disk.stat) ;*********************I}***************BYTE FUNC GetSec(BYTE drv CARD buf, sec)BYTE statstat=resdisk(drv, 'R, buf, sec)RETURN(stI}at);************************************BYTE FUNC PutSec(BYTE drv CARD buf, sec)BYTE statstat=resdisk(drI}v, 'W, buf, sec)RETURN(stat);************************************PROC shift(CARD buffer)PokeC($CB,buffer)[24 160 0 8 I} 40 177 203 106 145 203 8 200 192 12 208 244 40]RETURN;************************************PROC overlay(CARD to, frI}om, length)BYTE POINTER pointto, pointfromCARD countFOR count=0 TO length-1DOpointto=count+to pointfrom=count+frompointI}to^=pointto^ OR pointfrom^ODRETURN;************************************PROC vdelay()BYTE jiffy, clock=20jiffy=clock I} ;This loop ensuresDO ;that 1 vbl interuptUNTIL jiffy#clock;will occur. All OD ;hardware regiI}stersRETURN ;will be updated.;************************************BYTE FUNC uppercase(BYTE chr)IF chr>='a AND cI}hr<='z THEN RETURN(chr-$20)FIRETURN(chr);************************************PROC nobreak() ;disable break keyPoke(16I},64) Poke(53774,64)RETURN;************************************PROC ercheck(BYTE ernum)IF ernum#1 ;error check routineTHI}EN ;if ernum<>1 then reportramtop=lotop ;error to userGraphics(0) nobreak()vdelay()Position(8,11) Print("ERROR #")I}PrintBE(ernum)Position(8,13) Print("Press any key")ernum=1GetD(7)FIRETURN;************************************PROC prI}omptps()ramtop=lotopGraphics(0) nobreak()Put(253) ;bellPosition(4,8) Print("Please remove disk from drive 1")Position(4,I}10) Print("and insert PRINT SHOP data disk.")Position(12,12) PrintE("")GetD(7)RETURN;**********************I}**************PROC promptpic()ramtop=lotopGraphics(0) nobreak()Put(253) ;bellPosition(4,8) Print("Please remove disk froI}m drive 1")Position(9,10) Print("and insert .PIC disk.")Position(12,12) PrintE("")GetD(7)RETURN;**********I}**************************PROC init()vtoc=vtocsec+32Close(7)Open(7,"K:",4,0)hitop=ramtopGraphics(24) nobreak()screen=sI}memlotop=Peek(561)-1 dlhi=PeekC(560)Error=ercheckfilename="D1: "RETURN;************************************PI}ROC showscreen(BYTE option)BYTE mode, jiffy, clock=20;clear screen if option=0ramtop=hitop ;set ramtop for gr.8IF option=I}clear THEN Graphics(24) nobreak() picflag=0 ;erase pictureELSEPokeC(560,dlhi)FIvdelay()RETURN;**********************I}**************PROC makename(BYTE ARRAY name)BYTE x, i, tempname(0)=14name(1)='D name(2)=':name(15)=155name(14)=name(13)I}name(13)=name(12)name(12)=name(11)name(11)='.FOR x=1 TO 10 DO WHILE name(x)=' DO FOR i=x TO 15 DO nI}ame(i)=name(i+1) OD OD ODFOR x=1 TO 14DO IF name(x)=155 THEN name(0)=x-1 FIOD IF name(name(0))='. THEN name(I}0)==-1 FI IF name(10)='. AND name(11)=' THEN name(0)=9 FIRETURN;************************************BYTE FUNC dataI}_disk()BYTE xx=GetSec(1,dirbuf,361)IF x#1THEN RETURN(x)FI FOR x=0 TO 2 DO IF dirbuf(x)#psid(x) THEN RETURN(adisk)I} FI ODRETURN(pdisk);************************************BYTE FUNC menu()BYTE selectionramtop=lotop ;put menu under scrI}eenGraphics(0) nobreak()margin=11Position(8,0)Print("")Position(13,1)Print("򮠳")I}Position(13,2)Print("ͮǮ")Position(13,3)PrintE("")vtab=9PrintE("1. Load PS File")PrintE("2. I}Load Atari File")PrintE("3. Save PS File")PrintE("4. Save Atari File")DOvtab=14 htab=marginPrint("Select(1-4):")selectiI}on=GetD(7) selection==&127Put(selection)UNTIL selection>'0 AND selection<'5ODmargin=2RETURN(selection);****************I}********************CARD FUNC psdir()BYTE x, stat, dstat CARD sectordstat=data_disk()IF dstat=pdiskTHENramtop=lotopJ}Graphics(0) nobreak()PrintE(" for next file, to load") PutE() htab=6 PrintE("Filename File Type") PutJ}E() FOR sector=362 TO 393 DO ;read stat=GetSec(1,dirbuf+1,sector);directory IF stat#1 THEN ercJ}heck(stat) EXIT FI fname=dirbuf FOR x=1 TO 4 DO IF fname(1)=0 THEN RETURN(0) FI fname(0)=15 file=fnameJ}+1 htab=6 Print(fname) ;print filenames Print(" ") IF file.bytes<641 THEN PrintE("Graphic") ELSE PrintE(J}"Screen Magic") FI IF GetD(7)=155 THEN filename(1)='D filename(2)=': filename(0)=15 MoveBlock(fiJ}lename+3,fname+1,8) RETURN(file.startsec) FI fname==+32 OD ODELSEIF dstat=adiskTHENpromptps()ELSE erchecJ}k(dstat)FIRETURN(0);************************************CARD FUNC dir()BYTE dstatBYTE ARRAY name(20)dstat=data_disk()J}IF dstat=adiskTHENGraphics(0) nobreak()PrintE(" for next file, to load") PutE()Close(1)Open(1,"D:*.*",6,0) J};read directoryDOInputSD(1,name) IF name(14)='O THEN EXIT FIhtab=10PrintE(name) IF GetD(7)=155 THEN makename(name) EJ }XIT FIODClose(1)ELSEIF dstat=pdiskTHENpromptpic()ELSE ercheck(dstat)FIRETURN(name);*********************************J }***BYTE FUNC getcoord()BYTE optionramtop=lotopGraphics(0) nobreak()xpos=0 ypos=0Position(8,5) Print("This is a graphic J }file.")DOPosition(6,7) Print("Enter X coordinate(0-232): ~~~~~~")xpos=InputC()UNTIL xpos<233ODDOPosition(6,9) PriJ }nt("Enter Y coordinate(0-140): ~~~~~~")ypos=InputC()UNTIL ypos<141OD IF picflag=1 THEN DO Position(6,11) Print("J }lear or xisting Screen?: ~~~~") option=GetD(7) option==&127 option=uppercase(option) UNTIL option='C OR option='E OD J}Put(option) IF option='E THEN DO Position(6,13) Print("Overlay(Y/N)?:") over=GetD(7) over==&127 over=uppercase(ovJ}er) UNTIL over='Y OR over='N OD Put(over) FI ELSE option='C over='N FI IF option='C THEN option=clear ELSEJ} option=intact FIRETURN(option);************************************BYTE FUNC loadps(CARD sector) ;return error #BYTE J}statCARD offset, seccntoffset=0showscreen(clear)FOR seccnt=1 TO 61DOstat=GetSec(1,screen+offset,sector) IF stat#1 THEJ}N EXIT FIoffset==+126sector=PeekC(screen+offset);sector linkIF sector=0 OR sector>720THEN EXIT FIODercheck(stat)picflaJ}g=1GetD(7)RETURN(stat);************************************BYTE FUNC gfxload(CARD sector, option) ;return error #BYTE stJ}at, wait, bak=710, point=709, i, bitsBYTE ARRAY gfxbuf(640), shiftbuf(12)CARD offset, seccntoffset=0showscreen(optioJ}n) bak=8 point=0vdelay()FOR seccnt=1 TO 5DO stat=GetSec(1,gfxbuf+offset,sector) IF stat#1 THEN EXIT FI offset==+126 sJ}ector=PeekC(gfxbuf+offset);sector link IF sector=0 OR sector>720 THEN EXIT FIODercheck(stat)picflag=1bits=xpos&7 xpJ}os== RSH 3 FOR offset=0 TO 51 DO IF bits#0 THEN shiftbuf(11)=0 MoveBlock(shiftbuf,gfxbuf+offset*11,11) FOR i=1 TO J}bits DO shift(shiftbuf) OD IF over='Y THEN overlay(screen+offset*40+xpos+40*ypos,shiftbuf,12) ELSE J} MoveBlock(screen+offset*40+xpos+40*ypos,shiftbuf,12) FI ELSE IF over='Y THEN overlay(screen+offset*40+xpos+40J}*ypos,gfxbuf+offset*11,11) ELSE MoveBlock(screen+offset*40+xpos+40*ypos,gfxbuf+offset*11,11) FI FI ODGetD(7) J};wait for keypressRETURN(stat);************************************PROC loadpic(BYTE ARRAY name)showscreen(clear)Close(3J})Open(3,name,4,0)BGet(3,screen,7680)Close(3)picflag=1GetD(7)RETURN;************************************CARD FUNC get_J}directory_sector()BYTE xCARD index FOR index=362 TO 393 ;start DO ;reading GetSec(1,dirbuf,index) J};directory file=dirbuf FOR x=1 TO 4 ;search name field DO ;of each sector IF file.n0=0 ;for a zeroJ} THEN RETURN(index) FI file==+32 OD ODRETURN(0) ;directory full;************************************BYTE FUNC sJ }ec_stat(CARD sector)BYTE status ;return sector statusBYTE POINTER memmem=vtoc+(sector RSH 3)status=mask(sector&7) AND memJ!}^ IF status#free THEN status=taken FIRETURN(status);************************************CARD FUNC free_sectors()CARD seJ"}ctors, xsectors=0FOR x=1 TO 720DO IF sec_stat(x)=free THEN sectors==+1 FIODRETURN(sectors);*************************J#}***********PROC take_sector(CARD sector)BYTE POINTER memmem=vtoc+(sector RSH 3)mem^=mask(sector&7) OR mem^RETURN;******J$}******************************CARD FUNC next_free_sector()CARD numFOR num=1 TO 721DO IF sec_stat(num) is free THEN EXITJ%} FIOD IF num=721 THEN num=0 FIRETURN(num);************************************PROC saveps() ;save in print shopBYJ&}TE x, status ;formatCARD mem, firstsec, sector, sector_link, dirsecBYTE ARRAY secbuf(128), psname(20)ramtop=lotopGrJ'}aphics(0) nobreak()IF picflag THEN IF data_disk()=pdisk THEN x=filename(0) SCopyS(psname,filename,3,x) psname(0)=x-2 J(}Position(15,8) Print("Print Shop Save") Position(8,10) Print("Insert Print Shop Data Disk") Position(8,12) Print("Enter filJ)}ename or .") Position(8,14) Print(psname) Position(8,14) Print("") InputS(psname);this is the start of the save J*};routine;************************************;check vtoc and make sure there are;at least 61 available sectors GetSec(1J+},vtocsec,361) ;read vtoc IF free_sectors()<61 THEN ercheck(162) ;disk full RETURN FI ;******************************J,}******;find first free entry in ps directory dirsec=get_directory_sector() IF dirsec=0 THEN ercheck(169) ; directoryJ-} full FI;************************************ showscreen(intact);this is the main loop to write;the data sectors and VJ.}TOC mem=screen firstsec=next_free_sector() ;first FOR x=1 TO 61 ;sector DO sector=next_free_sector() J/};main MoveBlock(secbuf,mem,126) ;loop take_sector(sector) sector_link=next_free_sector() PokeC(secbuf+126,sectorJ0}_link)status=PutSec(1,secbuf,sector) IF status#1 THEN ercheck(status) RETURN FI mem==+126 ODJ1} vtocsec(16)=$E0status=PutSec(1,vtocsec,361) ;write VTOC IF status#1 THEN ercheck(status) RETURN FI;**J2}**********************************;enter filename into directory SetBlock(file,16,32) ;fill with spaces file.PA=$4150 x=pJ3}sname(0) MoveBlock(file,psname+1,x) file.startsec=firstsec file.bytes=7680status=PutSec(1,dirbuf,dirsec) IF status#J4}1 THEN ercheck(status) RETURN FI;************************************ ELSE promptps() FIELSEPut(253J5})Position(8,10) Print("No Picture in Memory!")Position(11,12) Print("Press any key")GetD(7)FIRETURN;*******************J6}*****************PROC savepic()BYTE statramtop=lotopGraphics(0) nobreak()IF picflagTHEN IF data_disk()=adisk THEN PJ7}osition(15,8) Print("Save Screen") Position(8,10) Print("Insert disk with Atari DOS") Position(8,12) Print("Enter filename J8}or .") Position(8,14) Print(filename) Position(8,14) Print("") InputS(filename) showscreen(intact) Close(2) ;justJ9} in case Open(2,filename,8,0) stat=BPut(2,screen,7680) IF stat#136 THEN ercheck(stat) FI Close(2) ELSE promptpic() FIJ:} ELSE Put(253) Position(8,10) Print("No Picture in Memory!") Position(11,12) Print("Press any key") GetD(7)FIJ;}RETURN;************************************PROC main()BYTE choice, statCARD start, optioninit()DO choice=menu() IF cJ<}hoice='1 THEN start=psdir() ;get first sector IF start#0 THEN IF file.bytes<641 THEN option=getcoord() J=} gfxload(start,option);load graphic ELSE loadps(start);load picture FI FI ELSEIF choice='2 THEN fJ>}ilename=dir() ;get file name IF filename(14)#'O AND filename(1)='D THEN loadpic(filename) FI ELSEIF choice=J?}'3 THEN saveps() ELSEIF choice='4 THEN savepic() FI ODRETURN THEN loadpic(filename) FI ELSEIF choice=HL Print Shop File Converter version 3.0 _________________________ by Mike Collins NA} SYSTEM REQUIREMENTS --------------------ATARI 400/800/XL/XE 48K Ram-Disk Drive-PrintNB} Shop, by Broderbund-ACTION! Cartridge INTRODUCTION ------------The Print Shop File Converter isNC} agraphics utility written inACTION!. It will allow you toconvert Print Shop's SCREEN MAGICfiles into standard 62 sectoND}r DOSfiles and vice versa. With the Print Shop File Converter, youcan use Print Shop's fancy text andgraphics with other NE}programs, oruse Print Shop to dump any 62sector picture to your favorite printer. There is also a provisionwhich allows yNF}ou to overlay anyhi-resolution screen with filesfrom Print Shop's GRAPHIC LIBRARY. COMPILING THE PRINT SHOP FILE CONVNG}ERTER -----------------------------Since the Print Shop File Converter is ACTION! source code, you must have the ACTIONNH}! cartridgeto use it. The source code must becompiled directly from disk and theACTION! compiler must be in the case-sensNI}itive mode (see ACTION!manual). After compilation iscompleted, type 'R'(run) and youwill see the menu. LOADINNJ}G FILES -------------There are three types of files thatcan be load into memory:1. Print Shop SCREEN MAGICfiNK}les.2. Print Shop GRAPHIC files.3. 62 sector picture files (GraphicMaster, Micro Painter, etc..)To load a file, insertNL} theappropriate files disk into drive 1and press either <1>(Print Shopload) or <2>(Atari DOS load),depending on the typeNM} of file youwish to load. The program willinform you if you try to load aPrint Shop file from a DOS disk or vice versa. YNN}ou can use the spacebar to step through the files.When you step through the files ona Print Shop disk, each file willbe NO}identified as either a SCREENMAGIC file or a GRAPHIC file. Whenyou see the file you want, press , and the file wilNP}l beloaded into memory.When you load a Print Shop graphicfile, the following things willhappen.1. You will be asked foNQ}r the X andY coordinates which will be used toplace the graphic on the screen.Typing in response toeither promptNR} will set thatcoordinate to zero.2. If you have already loaded oneor more files into memory, you willsee the followingNS} prompt: "Clearor Existing screen?" Typing 'C'will erase the screen in memorywhile typing 'E' will not.3. If you respondNT} with 'E', youwill see another prompt. "Overlay(Y/N)?" Responding with 'N' willerase the area under the graphic when theNU} graphic is loaded. Typing'Y' will not.4. The graphic will be placed onthe screen at the specifiedcoordinates. Press anyNV} key toreturn to the menu. SAVING FILES ------------To save a screen, type <3>(Print Shop) or NW}<4>(Atari) from the menu. Make sure you have the correct datadisk in drive 1. Again, you will beinformed if you have inserNX}ted thewrong data disk. The name of thelast file you have loaded will be positioned under the cursor. Youcan enter a neNY}w filename or type to use the name of thelast file loaded. SOME TIPS ---------Print SNZ}hop file names may containcharacters which are not allowedin Atari filenames. Make sure todelete any such characters whenN[} saving files under Atari DOS. Also,the Print Shop File Converter does not check for duplicate file nameson Print Shop diN\}sks, so be careful when naming your files. Print Shopfiles with duplicate names can be accessed by the Print Shop FileConN]}verter, but not by Print Shop. FINALLY -------I hope you find this program asuseful as I havN^}e. If you have any comments or suggestions, pleaseleave me a message. -Mike N_} 74005,475comments or suggestions, pleaseleave me a message. -Mike LOVERVIEW:CHNGDIR.ACT is a utility written inACTION to allow you to renamefilenames with illegal characters andspaces. Ra}The program accomplishesthis by reading and writing thedirectory sectors using the operatingsystem SIO routine.Each fileRb}name is referenced bynumber. A sector is only rewrittenif necessary. The program alsoadjusts for double density disketteRc}sby looking for the double densityflag in sector one of the diskette.If the value found is not standard(ie. - neither onRd}e (1) nor two (2))then single density is assumed.Changes will only occur in files thatare currently intact. DeletedfilenRe}ames, though still present inthe directory, are ignored as theDisk Operating System does.This routine has two main functiRf}ons.One is to create a customizeddirectory file list. The other is torecover from naming two files withthe same name. IRg} have stupidly donethis myself on rare occasions withfrustrating results.OPERATION:Load in the program into the ACTIONRh}editor and compile if you have anACTION cartridge. Alternately I haveprovided a compiled version that willrun without thRi}e ACTION cartridge.You will then be prompted for theDrive number where the diskette tochange resides.When the diskette iRj}s successfullyfound the program then reads thedensity of the diskette and displaysthe first directory sector. You aretheRk}n prompted to indicate if you wantto change any filenames. If you wantto type in the number of the filenameto change, andRl} then type in the newfilename. After you finish with eachdirectory sector (with up to eightfiles per sector) the sector wRm}ill berewritten back to the diskette ONLYif a change has occurred. When a"zeroed" filename entry has beenfound the progrRn}am assumes that thedirectory has ended. At this pointyou will be asked whether to restartwith the beginning of the directRo}ory,or leave the program.y has ended. At this pointyou will be asked whether to restartwith the beginning of the directP;CHNGDIR.ACT - program to modify; directories;BY Phillip R. Poulos;MODULEBYTE ARRAY BUFADR=$8000,WKAREA(88)BYTE DNSFVq}LG=$800ECARD TEMP;;Machine Language Subroutine SECRW; ;This routine reads/writes a specified; sector from a disk;;CAVr}LLING SEQUENCE:; A=SECRW(SECTOR,BUFADR,DENSITY,RW,DRIVE);;WHERE: SECRW is defined as an INT FUNC; SECTOR....secVs}tor addressed; BUFADR....buffer address; DENSITY...density of disk (1 or 2); RW........READ/WRITE flag (Vt}0=read 1=write); DRIVE.....Drive Number;;; The INTEGER A is returned as either:; NEGATIVE ERROR NUMBER; Vu} or; ACTUAL # Bytes READ/WRITTEN;;INT FUNC SECRW= *(CARD SECTOR,BUFADR BYTE DENSITY,RW,DRIVE) [ $8Vv}D$0A$03 ;SECRW STA DAUX1 $8E$0B$03 ; STX DAUX2 $8C$04$03 ; STY DBUFLO $A5$A3 ; Vw} LDA $A3 $8D$05$03 ; STA DBUFHI $A5$A4 ; LDA $A4 $C9$02 ; CMP #2 Vx} $F0$0C ; BEQ DBLDENS $A9$80 ; LDA #$80 $8D$08$03 ; STA DBYTLO $A9$00 Vy} ; LDA #0 $8D$09$03 ; STA DBYTHI $F0$09 ; BEQ CONT01 $A0$00 ;DBLDENS LDYVz} #0 $8C$08$03 ; STY DBYTLO $C8 ; INY $8C$09$03 ; STY DBYTHI $A5$A5 V{} ;CONT01 LDA $A5 $C9$01 ; CMP #1 $D0$0C ; BNE READSEC $A9$57 ; LDAV|} #'W $8D$02$03 ; STA DCOMND $A9$80 ; LDA #$80 $8D$03$03 ; STA DSTATS $D0V}}$0A ; BNE CONT02 $A9$52 ;READSEC LDA #'R $8D$02$03 ; STA DCOMND $A9$40 ; V~} LDA #$40 $8D$03$03 ; STA DSTATS $A5$A6 ;CONT02 LDA $A6 $8D$01$03 ; STA DUNITV} $A9$31 ; LDA #$31 $8D$00$03 ; STA DDEVIC $A9$07 ; LDA #$07 $8D$06$03 V} ; STA DTIMLO $20$59$E4 ; JSR SIOV $30$0B ; BMI ERROR $AD$08$03 ; LDAV} DBYTLO $85$A0 ; STA $A0 $AD$09$03 ; LDA DBYTHI $85$A1 ; STA $A1 $60 V} ; RTS $38 ;ERROR SEC $A9$00 ; LDA #0 $ED$03$03 ; SBC DSTATSV} $85$A0 ; STA $A0 $A9$FF ; LDA #$FF $85$A1 ; STA $A1 $60 ; V} RTS ];;Short ERROR routine to ignore; record truncate errors (#137);PROC BADNEWS(BYTE CODE) IF CODE<>137 V}THEN ERROR=TEMP [$4C ERROR] FIRETURN;;This routine READS a directory sector ; indicated by the parameters SEV}CTOR,; DENSITY, and DRIVE #.;All valid filenames (ie. - not deleted); are stored in a workarea;;Either the number of fV}ilenames read; (0-8) or the ERROR number on SECTOR; READ is returned.;BYTE FUNC READDIR(CARD SECTOR BYTE DENSITY,DRIVEV})INT ERR BYTE X ERR=SECRW(SECTOR,BUFADR,DENSITY,0,DRIVE) IF ERR<0 THEN RETURN(-ERR) FI DRIVE=0 FOR DENSITY=V}0 TO 7 DO X=BUFADR(16*DENSITY) IF X=0 THEN EXIT FI IF X<$80 THEN MOVEBLOCK(WKAREA+(11*DRIVE),BUFADR+5+(16*DV}ENSITY),11) DRIVE==+1 FI ODRETURN(DRIVE);;This routine writes a Directory sector; indicated by the paramV}eters SECTOR,; DENSITY, and DRIVE.;WORKAREA contains the new filenames.;Either a ZERO (0) is returned for success; or tV}he ERROR number is returned.;BYTE FUNC WRITEDIR(CARD SECTOR BYTE DENSITY,DRIVE)INT ERRBYTE X,Y,Z Z=0 FOR X=0 TO 7 DOV} Y=BUFADR(16*X) IF Y=0 THEN EXIT FI IF Y<$80 THEN MOVEBLOCK(BUFADR+5+16*X,WKAREA+11*Z,11) Z==+1 V} FI OD ERR=SECRW(SECTOR,BUFADR,DENSITY,1,DRIVE) IF ERR<0 THEN RETURN(-ERR) FIRETURN(0);;This routine returns the fV}ile number; requested to change. Invalid requests; are ingnored.;BYTE FUNC RECNUM(BYTE CNT,START)BYTE X DO POSITIONV}(2,19) PRINT("Which one? ") X=INPUTB() IF X>START-1 AND X255 THEN POSITION(13,6) CT=GETD(7) PUTD(6,CT) V} RETURN(CT) FI FOR X=0 TO 100 DO OD OD POSITION(13,6) IF (Z MOD 2)=0 THEN PUTD(6,CT) ELSE PUV}TD(6,' ) FI Z==+1 OD POSITION(13,6) Y=GETD(7) PUTD(6,Y)RETURN(Y);PROC MAIN()INT ERRBYTE ARRAY FILNMV}E(13)BYTE X,Y,CNT,DENSITY,DRIVE, FLG,START,COLOR1=710CARD SECTOR=[361] GRAPHICS(18) POSITION(0,6) PRINTD(6,"DRIVE NV}UMBER:") DO DRIVE='_ DRIVE=GETC(DRIVE) IF DRIVE>'0 AND DRIVE<'5 THEN DRIVE==-48 EXIT FI OD;;SectV}or #1 is read from the specified; drive to determine the density of; that drive for further READS/WRITES; ERR=SECRW(1,V}BUFADR,1,0,DRIVE) IF ERR<0 THEN ERR=-ERR POSITION(0,6) PRINTD(6,"?ERROR NUMBER:") PRINTID(6,ERR) FOR ERR=0 V}TO 30000 DO OD FOR ERR=0 TO 30000 DO OD FOR ERR=0 TO 30000 DO OD RETURN FI DENSITY=DNSFLG;A disk without aV} standard DOS (eg. -; a MICRODOS XL disc) will not have; the density flag properly set. IF; a value other than 1 or 2 V}is found,; SINGLE density is assumed.;To change a NONSTANDARD disk, the; DENSITY must be set, NOT read: eg.; DENSITY=2V} GRAPHICS(0) COLOR1=0 TEMP=ERROR ERROR=BADNEWS SECTOR=361 DO START=1 DO CNT=READDIR(SECTOR,DENSITY,DRIVE) V} IF CNT=0 THEN EXIT FI IF CNT>8 THEN GRAPHICS(0) POSITION(2,12) PRINTF("?ERROR #%U%E",CNT) V} ERROR=TEMP RETURN FI PUT('}) POSITION(11,4) PRINT("# F-NAMEEXT") POSITION(1V}1,5) PRINT(" ") FLG=0 DO POSITION(2,7) PLIST(CNT,START) POSITION(2,19) V} IF FLG=0 THEN PRINT("Want to change a record ? ") ELSE PRINT("Another change ? ") V}FI DO X=GETD(7) IF X<>'N AND X<>'Y AND X<>'n AND X<>'y THEN PUT(') EV}LSE PUT(X) EXIT FI OD IF X<>'Y AND X<>'y THEN EXIT FI X=RECNUM(CNT,STARV}T) POSITION(2,19) PRINT("NEW filename/ext:") POSITION(20,20) PRINT(" ") POV}SITION(19,19) PUT(' ) SETBLOCK(FILNME,13,$20) INPUTMD(0,FILNME,12) Y=FILNME(0)+1 FILNV}ME(Y)=$20 POSITION(20,20) PRINT(" ") FLG=1 MOVEBLOCK(WKAREA+11*(X-1),FILNME+1,11) V} OD START==+CNT IF FLG THEN CNT=WRITEDIR(SECTOR,DENSITY,DRIVE) IF CNT THEN GRAPHIV}CS(0) POSITION(2,12) PRINTF("?ERROR #%U%E",CNT) ERROR=TEMP RETURN FI V} FI SECTOR==+1 IF SECTOR>368 THEN EXIT FI OD POSITION(2,19) PRINT("Any more changes ? ") V} X=GETD(7) IF X<>'Y AND X<>'y THEN EXIT FI SECTOR=361 ODERROR=TEMPGRAPHICS(0)RETURNore changes ? ") Te CONTENTS=====================================FADE2.ACT The 'STAR WARS' type textFADE2.DAT effect.(OSZ}S BBS)FADE2.MSGFORK.ACT This module allows one to simulate multitasking by executing two ACTIOZ}N! routines for assigned time intervals.(OSS BBS)SORTSCRN.ACT This program demonstraZ}tes the use of FORK.ACT by doing 2 different sorts on identical arrays at what Z} looks like the same time. (OSS BBS)CHAIN.ACT Allows the chaining of two ACTION! programs. Z} (OSS BBS)KBUF.ACT A keyboard buffer. (Bill Aycock - NOVATARI)SECTIO.ACT Allows access of specifZ}ic disk sectors from ACTION!. (OSS BBS) STUFF.ACT Some general purpose routines. Z} (Bill Aycock - NOVATARI)GETARGS.ACT Get arguments/parametersGETARGS.DOC from DOSXL command line. (OSZ}S BBS)SCRNDMP1.ACT Horizontal screen dump for an EPSON printer.SCRNDMP2.ACT Sideways version of Z} SCRNDMP1.ACT.SCRNDMP3.ACT SCRNDMP1.ACT modiifed. (All 3 SCRNDMPs from an ANTIC PD disk)PSPICZ}3.ACT The source code forPSPIC3.DOC converting pictures to and from a format compatible Print Shop - fZ}or example 'PSF' files found in many places. (Compuserve)CHNGDIR.DOC This program allows oneCHNGDIRZ}.ACT to give their diskfiles illegal names by modifying the directory. (ANALOG TCS)---Z}---------------------------------- illegal names by modifying the directory. (ANALOG TCS)---X#