home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1996
/
ARCHIVE_96.iso
/
discs
/
mag_discs
/
volume_2
/
issue_06
/
fontaid
/
DLASPOOL
< prev
next >
Wrap
Text File
|
1989-02-13
|
5KB
|
190 lines
>LIST
10 REM > DLASource
20
30 REM Archimedes Font Downloader module
40 REM (for FontAid font files)
50
60 REM (C) Richard Averill, January 1989.
70
80 IF MODE <18 THEN MODE 0 ELSE MODE 18
90 PRINT TAB(15) "Archimedes FontAid font downloader module generator"'
100 PRINT TAB(25) "(C) Richard Averill, 1989."'
110 PRINT TAB(10) "(from Archive magazine, March 1989 (Volume 2 Number 6))"'
120
130 DIM code% 4000
140 PRINT "Assembling code ...";:PROCassemble:PRINT '
150 INPUT "Filename to save module under (Return=""FontModule"") : " module$
160 IF module$="" THEN module$="FontModule"
170 SYS "OS_File",&0A,module$,&FFA,0,code%,O%
180 PRINT "Module saved as """;module$;""""
190
200 END
210
220 DEF PROCassemble
230 sp=13 : link=14 : pc=15:XWriteI%=&20100
240 FOR opt%=4 TO 6 STEP 2
250 P%=0:O%=code%
260 [ OPT opt%
270 equd 0
280 equd ptrinit
290 equd 0
300 equd 0
310 equd strtitle
320 equd strhelp
330 equd tblcommands
340 equs STRING$(20,CHR$(0))
350
360 .strtitle FNstr("FontDownLoader")
370
380 .strhelp FNstr("FontDownLoader"+CHR$(9)+"1.00 ("+MID$(TIME$,5,11)+") (C) Richard Averill, January 1989.")
390
400 .ptrinit
410 stmfd (sp)!, {link}
420
430 mov r0, #6
440 mov r3, #8192
450 swi "XOS_Module"
460
470 bvs init_exit
480
490 str r2, [r12]
500 mov r2, #0
510 add r2, r2, #7168
520 str r0, [r2]
530
540 swi "XOS_WriteS"
550 FNnla( "Font-DownLoader v1.00 (C) Richard Averill, January 1989, installed.")
560
570 .init_exit ldmfd (sp)!, {pc}
580
590 .dla
600 ldr r2, [r12]
610 cmp r2, #0
620 moveqs pc, link
630
640 stmfd (sp)!, {link}
650 stmfd (sp)!, {r2}
660 ldrb r2, [r0]
670 tst r2, #&20
680 biceq r2, r2, #&20
690 cmp r2, #ASC("P")
700 bne not_proportional
710 ldrb r2, [r0, #1]
720 cmp r2, #32
730 bgt not_proportional
740
750 .jumpover_loop
760 ldrb r2, [r0], #1
770 cmp r2, #32
780 ble jumpover_loop
790
800 stmfd (sp)!, {r0}
810 adr r0, proportional_codes
820 swi "XOS_Write0"
830 ldmfd (sp)!, {r0}
840 sub r1, r1, #1
850
860 .not_proportional
870 ldmfd (sp)!, {r2}
880 cmp r1, #0
890 bne havetoload
900
910 ldr r2, [r12]
920 add r2, r2, #7168
930 ldr r2, [r2]
940 cmp r2, #0
950 adreq r0, msg_nofont
960 ldmeqfd (sp)!, {link}
970 orreq link, link, #(1<<28)
980 moveqs pc, link
990 b download
1000
1010 .havetoload
1020 mov r1, r0
1030 mov r0, #&40
1040 mov r2, #0
1050
1060 swi "XOS_Find"
1070
1080 cmp r0, #0
1090 adreq r0, msg_nofont
1100 ldmeqfd (sp)!, {link}
1110 orreq link, link, #(1<<28)
1120 moveqs pc, link
1130
1140 .file_found
1150 mov r1, r0
1160 mov r0, #3
1170 ldr r2, [r12]
1180 mov r3, #6144
1190 mov r4, #0
1200
1210 swi "XOS_GBPB"
1220
1230 mov r0, #1
1240 ldr r1, [r12]
1250 add r1, r1, #7168
1260 str r0, [r1]
1270
1280 .download
1290 swi XWriteI%+2
1300
1310 adr r1, pre_dla
1320 add r2, r1, #14
1330 .pre_loop
1340 ldrb r0, [r1], #1
1350 swivc XWriteI%+1
1360 swivcs "XOS_WriteC"
1370 bvs dlaexit
1380 cmp r1, r2
1390 blt pre_loop
1400
1410 ldr r1, [r12]
1420 add r2, r1, #6144
1430 .dla_loop
1440 ldrb r0, [r1], #1
1450 swis XWriteI%+1
1460 swivcs "XOS_WriteC"
1470 bvs dlaexit
1480 cmp r1, r2
1490 blt dla_loop
1500
1510 .dlaexit
1520 swi XWriteI%+3
1530 LDMFD (sp)!, {pc}
1540
1550 .pre_dla equd &251B281B : equd &521B0001 : equd &261B00 : equd &7F00
1560
1570 .proportional_codes equd &011B0102 : equd &03010170 : equd 0
1580
1590 .msg_nofont
1600 equd &D6 : FNstr("Font file not found")
1610
1620 .tblcommands
1630 FNstr("DLA")
1640 equd dla : equd &20100 : equd syndla : equd hlpdla : equd 0
1650
1660 .hlpdla
1670 equs "Font-DownLoader, (C) Richard Anthony Averill, January 1989."+CHR$(13)+CHR$(13)
1680 equs "*DLA downloads FontAid font files to Canon-type NLQ printers."+CHR$(13)
1690 equs "The P prefix, when present, causes proportional spacing to be enabled."+CHR$(13)
1700 equs "If no font file is given, the previous downloaded font will be re-downloaded."+CHR$(13)
1710 .syndla
1720 FNstr("Syntax: *DLA [P] [<font file>].")
1730 ]
1740 NEXT opt%
1750 ENDPROC
1760
1770 DEF FNstr(str$)
1780 [ OPT opt% AND &E
1790 equs str$ + CHR$(0)
1800 align
1810 ] :=opt%
1820
1830 DEF FNnla(str$)
1840 [ OPT opt% AND &E
1850 equs str$ + CHR$(10) + CHR$(13) + CHR$(0)
1860 align
1870 ] :=opt%
>*SPOO.L