;----------------------------+›; FONT DATA WRITER :›; VERSION 4.0 :›;Final modifications: 5/04/87:›; By: Edward SKRECKY :›;----------------------------+››MODULE›TYPE SIOCB=[BYTE IOCOMMAND,IOSTATUS› CARD IOBUFADR,IOPUTADR,› IOBUFLEN] ›TYPE NAMENUM=[BYTE NUMS]›BYTE LOOP=[0],LOOP1=[0] , OFFSET=1,› NAMESIZE=[25] , CHBAS=756 , CH=764,› DINDEX=$57 , DISK_BLANK=[0]›CARD SC=88›CARD POINTER NAMEPTR , SECNUM›NAMENUM POINTER NEWRECORD›BYTE ARRAY CHARNAME1(20) , CHARNAME2(20)="D1:",› CHARNAME3(20) , NUMMATCH(1),› CHARSET(1024) , FILES(9000),› KEYNUM= [31 30 26 24 29 27 51 53 48],› CSET=›[›0 0 0 0 0 0 0 0 ›48 48 48 48 0 0 48 0 ›108 108 108 0 0 0 0 0 ›108 108 254 108 254 108 108 0 ›24 126 96 126 6 126 24 0 ›0 102 108 24 48 102 70 0 ›28 54 28 56 111 102 59 0 ›24 24 48 0 0 0 0 0 ›24 48 48 48 48 48 24 0 ›48 24 24 24 24 24 48 0 ›0 102 60 255 60 102 0 0 ›0 24 24 126 24 24 0 0 ›0 0 0 0 0 24 24 48 ›0 0 0 126 0 0 0 0 ›0 0 0 0 0 24 24 0 ›0 6 12 24 48 96 192 0 ›124 198 206 214 230 198 124 0 ›24 56 24 24 24 24 126 0 ›60 102 6 12 24 48 126 0 ›126 12 24 12 6 102 60 0 ›12 28 60 108 126 12 30 0 ›126 102 96 124 6 102 60 0 ›60 102 96 124 102 102 60 0 ›126 102 12 24 48 48 48 0 ›60 102 102 60 102 102 60 0 ›60 102 102 62 6 12 56 0 ›0 48 48 0 48 48 0 0 ›0 24 24 0 24 24 48 0 ›6 12 24 48 24 12 6 0 ›0 0 126 0 0 126 0 0 ›96 48 24 12 24 48 96 0 ›60 102 6 12 24 0 24 0 ›60 102 102 110 110 96 62 0 ›48 120 204 252 204 204 238 0 ›252 102 102 124 102 102 252 0 ›124 198 192 192 192 198 124 0 ›252 102 102 102 102 102 252 0 ›254 102 96 120 96 102 254 0 ›254 102 96 120 96 96 240 0 ›124 198 192 192 206 198 124 0 ›238 204 204 252 204 204 238 0 ›126 90 24 24 24 90 126 0 ›30 12 12 12 12 204 120 0 ›115 54 60 56 60 54 115 0 ›120 48 48 48 48 54 126 0 ›198 238 254 214 198 198 231 0 ›204 236 252 220 204 204 238 0 ›124 198 198 198 198 198 124 0 ›252 102 102 102 124 96 224 0 ›124 198 198 198 198 204 118 0 ›252 102 102 124 120 108 230 0 ›124 198 192 124 6 198 124 0 ›255 153 24 24 24 24 60 0 ›238 204 204 204 204 204 120 0 ›238 204 204 204 204 120 48 0 ›231 198 198 214 254 238 198 0 ›195 102 60 24 60 102 195 0 ›238 204 204 120 48 48 120 0 ›254 198 12 24 48 102 254 0 ›30 24 24 24 24 24 30 0 ›0 192 96 48 24 12 6 0 ›120 24 24 24 24 24 120 0 ›0 8 28 54 99 0 0 0 ›0 0 0 0 0 0 255 0 ›0 54 127 127 62 28 8 0 ›24 24 24 31 31 24 24 24 ›3 3 3 3 3 3 3 3 ›24 24 24 248 248 0 0 0 ›24 24 24 248 248 24 24 24 ›0 0 0 248 248 24 24 24 ›3 7 14 28 56 112 224 192 ›192 224 112 56 28 14 7 3 ›1 3 7 15 31 63 127 255 ›0 0 0 0 15 15 15 15 ›128 192 224 240 248 252 254 255 ›15 15 15 15 0 0 0 0 ›240 240 240 240 0 0 0 0 ›255 255 0 0 0 0 0 0 ›0 0 0 0 0 0 255 255 ›0 0 0 0 240 240 240 240 ›0 28 28 119 119 8 28 0 ›0 0 0 31 31 24 24 24 ›0 0 0 255 255 0 0 0 ›24 24 24 255 255 24 24 24 ›0 0 60 126 126 126 60 0 ›0 0 0 0 255 255 255 255 ›192 192 192 192 192 192 192 192 ›0 0 0 255 255 24 24 24 ›24 24 24 255 255 0 0 0 ›240 240 240 240 240 240 240 240 ›24 24 24 31 31 0 0 0 ›120 96 120 96 126 24 30 0 ›0 24 60 126 24 24 24 0 ›0 24 24 24 126 60 24 0 ›0 24 48 126 48 24 0 0 ›0 24 12 126 12 24 0 0 ›0 24 60 126 126 60 24 0 ›0 0 60 6 62 102 62 0 ›0 112 96 124 102 102 124 0 ›0 0 60 96 96 96 60 0 ›0 14 6 62 102 102 62 0 ›0 0 60 102 126 96 60 0 ›0 14 24 62 24 24 60 0 ›0 0 62 102 102 62 6 124 ›0 112 96 124 102 102 119 0 ›0 24 0 56 24 24 60 0 ›0 12 0 28 12 12 12 120 ›0 112 96 108 120 108 102 0 ›0 56 24 24 24 24 60 0 ›0 0 102 127 127 107 99 0 ›0 0 124 102 102 102 102 0 ›0 0 60 102 102 102 60 0 ›0 0 124 102 102 124 96 112 ›0 0 62 102 102 62 6 14 ›0 0 124 102 96 96 96 0 ›0 0 62 96 60 6 124 0 ›0 24 126 24 24 24 14 0 ›0 0 102 102 102 102 62 0 ›0 0 102 102 102 60 24 0 ›0 0 99 107 127 62 54 0 ›0 0 102 60 24 60 102 0 ›0 0 102 102 102 62 12 120 ›0 0 126 12 24 48 126 0 ›0 24 60 126 126 24 60 0 ›24 24 24 24 24 24 24 24 ›0 126 120 124 110 102 6 0 ›8 24 56 120 56 24 8 0 ›16 24 28 30 28 24 16 0 ›]›››PROC CIO=$E456(BYTE AREG,XREG)›[]›››PROC BLOCKIO(BYTE CHANNEL,IOCMD, › BYTE ARRAY BUFFER› CARD LENGTH)›› SIOCB POINTER A› A=$342+CHANNEL*16› A.IOCOMMAND=IOCMD› A.IOBUFADR=BUFFER› A.IOBUFLEN=LENGTH› CIO(0,CHANNEL LSH 4)››RETURN›››PROC GETBIN(BYTE CHANNEL, › BYTE ARRAY BUFFER› CARD LENGTH)› BLOCKIO(CHANNEL,7,BUFFER,LENGTH)››RETURN›››PROC DISKDIR()›› BYTE FILE_NUM=[1]› BYTE ARRAY CHECK1(25) , CHECK2="FREE SECTORS"›› DISK_BLANK=0 LOOP=0 FILE_NUM=1› DINDEX=$0› POSITION(8,14)› PRINTE("READING THE DIRECTORY...")› DINDEX=$1 › CLOSE(1)› OPEN(1,"D1:*.*",6,0)› DO› NEWRECORD=FILES+(LOOP*NAMESIZE)› NEWRECORD.NUMS=FILE_NUM› NAMEPTR=NEWRECORD+OFFSET› INPUTSD(1,NAMEPTR) › IF LOOP=0 THEN› SCOPYS(CHECK1,NAMEPTR,5,17)› IF SCOMPARE(CHECK1,CHECK2)=0 THEN› DISK_BLANK=1 › FI› FI› LOOP==+1› IF FILE_NUM=9 THEN FILE_NUM=1› ELSE FILE_NUM==+1› FI› UNTIL EOF(1)› OD› NAMEPTR=NEWRECORD-24› SECNUM=NAMEPTR› NEWRECORD=FILES+(LOOP*NAMESIZE)› NEWRECORD.NUMS=0› ZERO(SC+560,40)››RETURN›››PROC DISK_LIST()›› BYTE INC=[11] , AUDCTL=$D208› CARD COUNTER1=[0] , COUNTER2=[0]› › ZERO(SC+220,180)› AUDCTL=$1› COUNTER1=39› WHILE COUNTER1>1› DO› SOUND(0,10,12,COUNTER1/3)› COUNTER1==-1› FOR COUNTER2=1 TO 1000 DO OD› OD› SOUND(0,0,0,0)› INC=11› IF DISK_BLANK=1 THEN POSITION(3,15)› PRINTDE(6,"DISK IS BLANK!")› ELSE› DO› NEWRECORD=FILES+(LOOP1*NAMESIZE)› POSITION(0,INC)› PRINTBD(6,NEWRECORD.NUMS)› NAMEPTR=NEWRECORD+OFFSET› POSITION(3,INC)› PRINTDE(6,NAMEPTR)› INC==+1› LOOP1==+1› UNTIL NEWRECORD.NUMS=9 OR LOOP1=LOOP-2› OR NEWRECORD.NUMS=0› OD› FI› CH=255››RETURN› ››PROC LOAD_FONT()› › CLOSE(1)› OPEN(1,CHARNAME1,4,0)› GETBIN(1,CHARSET,1024)› CLOSE(1)››RETURN›››PROC BASIC_INIT(CARD SIZE,INITNUM)›› CARD ROMSET=[0]›› ROMSET=57344+SIZE› PRINTCD(1,INITNUM)› INITNUM==+10› PRINTDE(1," REM ÉÎÉÔ ÒÏÕÔÉÎÅ")› PRINTCD(1,INITNUM)› INITNUM==+10› PRINTDE(1," POKE 756,224:MEMTOP=PEEK(106)*256")› PRINTCD(1,INITNUM)› INITNUM==+10› PRINTD(1," CHBASE=MEMTOP-2048:ROMSET=")› PRINTCDE(1,ROMSET)› PRINTCD(1,INITNUM)› INITNUM==+10› IF SIZE<1023 THEN› PRINTD(1," FOR I=CHBASE+")› PRINTCD(1,SIZE)› PRINTD(1," TO CHBASE+1023")› PRINTDE(1,":POKE I,PEEK(ROMSET):ROMSET=ROMSET+1:NEXT I")› PRINTCD(1,INITNUM)› INITNUM==+10› FI› PRINTD(1," FOR I=CHBASE TO CHBASE+")› PRINTCD(1,SIZE)› PRINTDE(1,":READ A:POKE I,A:NEXT I:POKE 756,CHBASE/256")››RETURN ›››PROC ACTION_INIT(CARD SIZE)›› PUTDE(1) PUTDE(1)› PRINTDE(1,"PROC INIT()")› PUTDE(1)› PRINTDE(1,"BYTE CHBAS=756")› PUTDE(1)› PRINTDE(1,"MOVEBLOCK(32768,57344,1024)")› PRINTD(1,"MOVEBLOCK(32768,CSET,")› PRINTCD(1,SIZE+1)› PRINTDE(1,")")› PRINTDE(1,"CHBAS=128")› PUTDE(1)› PRINTDE(1,"RETURN")››RETURN›››PROC WRITE_FONT(BYTE ARRAY NAME BYTE WHICH,› INIT_ROUTINE CARD SIZE,› LINENUM,INITNUM)›› BYTE COUNTER2=[1] , COUNTER3=[0],› BLANKS=[0]› CARD INDEX=[0] , COUNTER1=[0]›› COUNTER2=1› CLOSE(1)› OPEN(1,NAME,8,0)› IF WHICH=30 THEN› PRINTDE(1,"BYTE ARRAY CSET=")› PRINTDE(1,"[")› FI› IF WHICH=31 AND INIT_ROUTINE=43 THEN BASIC_INIT(SIZE,INITNUM) FI› FOR COUNTER1=0 TO SIZE› DO› IF WHICH=30 THEN› IF CHARSET(COUNTER1)<10 THEN BLANKS=3› ELSEIF CHARSET(COUNTER1)>9 AND CHARSET(COUNTER1)<100 THEN BLANKS=2› ELSE BLANKS=1› FI› ELSEIF COUNTER2=1 THEN› PRINTCD(1,LINENUM) LINENUM==+10› PUTD(1,32)› PRINTD(1,"DATA")› PUTD(1,32)› FI› PRINTBD(1,CHARSET(COUNTER1))› IF WHICH=30 THEN› FOR COUNTER3=1 TO BLANKS DO PUTD(1,32) OD› ELSEIF COUNTER2<8 THEN PUTD(1,',)› FI› IF COUNTER2=8 THEN COUNTER2=1› PUTDE(1)› ELSE COUNTER2==+1› FI› OD› IF WHICH=30 THEN› PRINTDE(1,"]")› FI› IF WHICH=30 AND INIT_ROUTINE=43 THEN› ACTION_INIT(SIZE)› FI› CLOSE(1)››RETURN›››PROC READY_FILENAME()› › BYTE N=[0] , CHECK=[0]›› N=0 CHECK=0› SCOPYS(CHARNAME1,NAMEPTR,3,14)› SASSIGN(CHARNAME2,CHARNAME1,4,14)› WHILE CHECK<>1› DO› N==+1› IF CHARNAME2(N)=32 THEN CHECK=1› ELSEIF N=12 THEN CHECK=1› FI› OD› IF CHARNAME2(12)<>32 THEN› SCOPYS(CHARNAME1,CHARNAME2,1,N-1)› SCOPYS(CHARNAME3,CHARNAME2,12,14)› SASSIGN(CHARNAME1,".",N,N)› SASSIGN(CHARNAME1,CHARNAME3,N+1,N+3)› ELSE SCOPY(CHARNAME1,CHARNAME2)› FI ››RETURN›››PROC CHECK_INPUT(BYTE LOSAV,NEW,TOG)›› BYTE LEAVE=[0] , CHNUM=[0] , CONSOL=53279,› TEST=[0] , TOGGLE=[0]› CARD COUNTER=[0]›› LEAVE=0› WHILE LEAVE=0› DO› FOR COUNTER=1 TO 9000 DO OD› IF CONSOL=6 OR NEW=0 THEN› NEW=1› LOOP1=0› DISKDIR()› DISK_LIST()› POSITION(2,21)› PRINTDE(6,SECNUM)› ELSEIF CONSOL=5 AND DISK_BLANK=0 THEN› IF LOOP1=LOOP-2 OR NEWRECORD.NUMS=0› THEN LOOP1=0 FI› DISK_LIST()› ELSEIF CONSOL=3 AND TOG=1 THEN› IF TOGGLE=1 THEN MOVEBLOCK(32768,CSET,1024)› TOGGLE=0 CHBAS=128› ELSE TOGGLE=1 MOVEBLOCK(32768,CHARSET,1024)› CHBAS=128› FI› FI› CHNUM=CH› IF CHNUM<>255 AND LOSAV=0 AND DISK_BLANK=0 THEN› FOR COUNTER=0 TO 8› DO› IF KEYNUM(COUNTER)=CHNUM AND› (COUNTER+1)<=NEWRECORD.NUMS THEN› TEST=NEWRECORD.NUMS-(COUNTER+1)› NAMEPTR=(NEWRECORD+OFFSET)-25*TEST› LEAVE=1› FI› OD› FI› IF (CHNUM=28 OR CHNUM=33) AND LOSAV=1 THEN LEAVE=1 FI› OD› LEAVE=0››RETURN›››PROC WRITE_INFO()›› BYTE WHICH=[0] , INIT_ROUTINE=[0]› CARD SIZE=[0] , LINENUM=[0] , INITNUM=[0] , SIZENUM=[0]› BYTE ARRAY FILENAME1(20) , FILENAME2(20)›› LINENUM=40000 INITNUM=40000 SIZE=128› CH=255› ZERO(SC+480,80)› POSITION(4,12)› PRINTDE(6,"Write data for? 1)BASIC 2)ACTION")› WHILE CH<>31 AND CH<>30 DO OD› WHICH=CH› CH=255› POSITION(0,12)› PRINTDE(6,"CHARSET SIZE? 1)Full 2)Half 3)Own value")› WHILE CH<>31 AND CH<>30 AND CH<>26 DO OD› IF CH=30 THEN SIZE=64› ELSEIF CH=26 THEN› DO› CH=255› ZERO(SC+480,80)› POSITION(1,12)› PRINTDE(6,"NUMBER OF CHARACTERS TO SAVE TO DISK?")› POSITION(1,13)› PUTD(6,'>)› SIZE=INPUTC()› UNTIL SIZE<129 AND SIZE<>0› OD› FI› CH=255› ZERO(SC+480,80)› POSITION(0,12)› PRINTD(6,"SIZE=")› PRINTCDE(6,SIZE)› SIZE=(SIZE*8)-1› SIZENUM=SIZE*10› CH=255› IF WHICH=31 THEN› WHILE LINENUM>32767-SIZENUM› DO› ZERO(SC+520,80)› POSITION(1,13)› PRINTDE(6,"Starting line number for writing DATA?")› POSITION(1,14)› PUTD(6,'>)› LINENUM=INPUTC()› POSITION(9,12)› PRINTD(6,"DATA line=")› PRINTCDE(6,LINENUM)› OD› FI› CH=255› ZERO(SC+520,80)› POSITION(6,13)› PRINTDE(6,"WRITE THE INIT ROUTINE? Y/N")› WHILE CH<>43 AND CH<>35 DO OD› INIT_ROUTINE=CH› CH=255› IF WHICH=31 AND INIT_ROUTINE=43 THEN› WHILE INITNUM>32737 OR (INITNUM>(LINENUM-5) AND INITNUM<=(LINENUM+SIZENUM))› DO› ZERO(SC+520,80)› POSITION(1,13)› PRINTDE(6,"Starting line number for INIT ROUTINE?")› POSITION(1,14)› PUTD(6,'>)› INITNUM=INPUTC()› OD› POSITION(25,12) › PRINTD(6,"INIT line=")› PRINTCDE(6,INITNUM)› FI› CH=255› ZERO(SC+520,80)› POSITION(2,13)› PRINTDE(6,"Please type in the desired FILENAME")› POSITION(0,14)› PRINTD(6,"==> D1:")› INPUTS(FILENAME2)› SCOPY(FILENAME1,"D1:")› SASSIGN(FILENAME1,FILENAME2,4,16)› ZERO(SC+520,80)› POSITION(8,13)› PRINTD(6,"FILENAME: ")› PRINTDE(6,FILENAME1)› POSITION(6,14)› PRINTDE(6,"Writing data to the disk...")› WRITE_FONT(FILENAME1,WHICH,INIT_ROUTINE,SIZE,LINENUM,INITNUM)››RETURN›››PROC SET_UP()›› BYTE CRSINH=752 , SDLSTL1=560,› SDLSTL2=561 , COUNTER=[0]› BYTE POINTER PTR›› GRAPHICS(0)› › SETCOLOR(2,0,0)› MOVEBLOCK(32768,CSET,1024)› CHBAS=128› CRSINH=1› PTR=SDLSTL1+SDLSTL2*256+4› PTR==+2 PTR^=7› PTR==+1 PTR^=6› PTR==+3 PTR^=6› FOR COUNTER=1 TO 13 DO PTR==+1 PTR^=6 OD› PTR==+1 PTR^=2› PTR==+1 PTR^=2› PTR==+1 PTR^=2› PTR==+1 PTR^=2› PTR==+1 PTR^=65› PTR==+1 PTR^=SDLSTL1› PTR==+1 PTR^=SDLSTL2› PRINTE(" ")› DINDEX=$2› POSITION(2,2)› PRINTDE(6,"FONT DATA WRITER")› DINDEX=$0› POSITION(1,2)› PRINTE("By Edward Skrecky Nov 1986 to Feb 1987")› POSITION(3,3)› PRINTE("Written in Action! Victoria, B.C.")› DINDEX=$1› POSITION(3,9)› PRINTDE(6,"äéóë äéòåãôïòù")››RETURN›››PROC MAIN()›› BYTE LOSAV=[0] , NEW=[0] , TOG=[0]› CARD COUNTER=[0]› › › SET_UP()› DO› DINDEX=$0› POSITION(0,12)› PRINTE("START: Dir SELECT: Page OPTION: Toggle")› DINDEX=$1› LOSAV=0 NEW=0› CHECK_INPUT(LOSAV,NEW,TOG)› CH=255› READY_FILENAME()› LOAD_FONT()› DINDEX=$0› POSITION(0,13)› PRINTDE(6,"ABORT: Hit ESC WRITE DATA: Hit Spacebar")› DINDEX=$1› LOSAV=1 TOG=1 NEW=1› CHECK_INPUT(LOSAV,NEW,TOG)› DINDEX=$0› IF CH=33 THEN WRITE_INFO()› ZERO(SC+480,120)› POSITION(9,14)› PRINTDE(6,"Mission Accomplished!")› ELSE ZERO(SC+520,80)› POSITION(12,14)› PRINTDE(6,"Mission aborted!")› FI› FOR COUNTER=1 TO 46000 DO OD› ZERO(SC+520,80)› DINDEX=$1› CH=255› OD››RETURN››