home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 19
/
019.d81
/
headliner
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
2KB
|
81 lines
10 print chr$(147):print:print"choose printing mode"
11 print" 1: regular upper case"
12 print" 2: upper & lower case"
13 print" 3: reversed characters"
20 getk$:ifk$<>"1"andk$<>"2"andk$<>"3"then 20
21 ifk$="1"then sa=53248:open4,4:tp=15:printchr$(142):goto 30
22 ifk$="2"then sa=55296
23 ifk$="3"then sa=56320
25 printchr$(14):open4,4,7:tp=17
30 printchr$(147):print" one moment please....":gosub 6000
40 forx=1to4:read mx(x):next
42 data 10,20,80,40
50 print chr$(8);chr$(147):printtab(15)"headliner"
55 if sa=56320 thenprint"reverse mode"
60 print:print:print" choose a size":print
71 print" 1: 10 characters per line"
72 print" 2: 20 characters per line"
73 print" 3: standard size"
74 print" 4: standard double width"
75 print" 5: quit program"
80 getk$:ifk$=""then80
85 if asc(k$)<49 or asc(k$)>53 then 80
90 k=val(k$)
95 ifk=5 then close4:printchr$(9):goto5995
100 print:print:print" do you want it centered? (y/n)"
105 getc$:ifc$<>"y"andc$<>"n"then105
110 print#4,chr$(15);chr$(tp);
115 ifk=2then print#4,chr$(8);
120 ifk=4then print#4,chr$(14);
200 print chr$(147):print" size";k:nl=1
205 print" a maxiumn of";mx(k);"letters per line"
210 input" how many lines of this size";nl:ifnl=0 then50
220 print"type a \ for menu":print:print
225 for l=1 to nl
230 print"line";l;:w$(l)="":input w$(l)
232 if w$(l)="\"then50
235 if len(w$(l))>mx(k) then print "last line too long":goto 230
240 next
251 if k=1 then d=1:gosub 6200
252 if k=2 then d=0:gosub 6200
253 ifk=3 or k=4 then gosub 300
260 goto 50
300 for l=1 to nl:print#4,
310 t=40-len(w$(l))/((k=3)*-1+1)
320 a%=t/10+48:b%=t-(a%-48)*10+48
330 ifc$="y"then print#4,chr$(16)chr$(a%)chr$(b%);
340 print#4,w$(l):next
350 return
5995 load"hello connect",8
5999 rem*** the headliner subroutines
6000 rem peek into rom character set
6010 dim p(7,21),b%(7,128),l$(21),s$(1),w$(30)
6020 l$(0)="":s$(0)="":s$(1)=" "
6030 forx=1to3:l$(0)=l$(0)+chr$(255):next
6040 forx=1to3:s$(0)=s$(0)+chr$(128):next
6049 rem turn keyboard off & switch in character rom
6050 poke56334,peek(56334)and254:poke1,peek(1)and251
6070 for c=0 to 127:for x=0 to 7
6080 b%(x,c)=peek(sa+x+c*8):next:next
6099 rem switch in i/o & turn keyboard back on
6100 poke1,peek(1)or4:poke56334,peek(56334)or1
6130 b%(1,49)=56:b%(2,49)=24
6140 return
6200 rem prints big letters
6210 for wd=1to nl:w$=w$(wd)
6212 ifw$=""then 6355
6230 for y=1to len(w$)
6240 l$(y)=mid$(w$,y,1):c=asc(l$(y))
6250 if c>64 then c=c-64:if c>127 then c=c-64
6260 forx=0to7:p(x,y)=b%(x,c):next:next
6270 t=40-len(w$)*(2+2*d):a%=t/10+48:b%=t-(a%-48)*10+48
6290 forx=0to7:print#4,
6300 ifc$="y"then print#4,chr$(16)chr$(a%)chr$(b%);
6310 fory=1to len(w$)
6320 forpw=7to 0 step-1
6330 if p(x,y)<>(p(x,y)or2^pw) then print#4,s$(d);:next:goto6350
6340 print#4,l$(y*d);:next
6350 next:next
6355 print#4,:print#4,:next
6360 return