home *** CD-ROM | disk | FTP | other *** search
- 10 rem vls hypertext beta 2.4
- 11 rem
- 12 rem design/program : t.parker
- 13 rem (c) 1996 sirius cybernetics
- 14 rem corporation
- 40 rem
- 42 rem life, the universe, and everything
- 43 rem
- 49 rem code starts here
- 50 clr:poke56,96:poke788,52:clr
- 53 gosub900
- 55 rem file default (null,$,fname)
- 56 f$=""
- 57 rem idriver default (1=mouse 0=joy)
- 58 z=1
- 63 rem load/init modules
- 65 sys57812"toolbox c000",dv,1:poke780,0:sys65493
- 67 systb+30,"vmx.ml",dv,24576
- 68 systb+30,"vls.charset",dv,2048:cb=18:sys57812"pointer.spr",dv,1:poke780,0
- 69 sys65493:goto71
- 70 poke788,52:gosub900:z=1:cb=18:rem debug restart
- 71 rem initialize objects
- 72 gosub800:gosub3020:gosub3600:gosub3700
- 73 gosub5000:gosub8300:gosub5500:gosub1000
- 74 c=7:gosub1300:gosub850
- 75 iff$=""then79
- 76 iff$="$"thensystb+18,s1:goto210
- 77 systb+18,s1:pn=0:xf$=f$:goto700
- 79 gosub850:goto100
- 80 rem full redraw
- 81 ifnottvthengv=0:gf=0:rf=0:gq=0
- 82 gosub5500:c=7:gosub1300:gosub3000:gosub3600:poke199,0
- 90 rem quick redraw
- 92 gosub5500:iftvthengosub3100
- 94 gosub3700
- 100 rem main loop
- 101 poke198,0:gosub5600:gosub5100:c=7:ifnottvandlt$(0)<>""then4000
- 102 ifnotbdthen600
- 103 ify<>0then 490
- 104 systb+18,s1:gosub1400:ifsm=0then110
- 105 gosub5100:gosub1500:ifmi=0then110
- 106 onsmgoto200,300,400
- 110 systb+21,s1:gosub3060:goto100
- 200 rem file menu
- 202 onmigoto210,205,220,9500,205,240,250,260,205,270
- 205 goto110
- 210 rem load
- 211 gosub 6000:gosub6100:iff$=""then110
- 213 pn=0:xf$=f$:goto700
- 220 ifnotrfthenol=ln-ws:rem save text
- 221 ifnottvthen110
- 222 p$=" File:":l=16:gosub1900:ifw$=""then230
- 223 open3,dv,3,w$+",p,w":ln=sl:gosub2200:gosub226:gosub5400:ifval(e$)=0then225
- 224 close3:m0$="Error saving text":gosub6800:ifmi=1then223
- 225 goto230
- 226 m0$="Saving":m1$=w$:l=0:bc=4:gosub1800
- 227 gosub5300
- 228 ifln>elthenprint#3,chr$(0):close3:systb+42,"",dv:systb+21,s2:return
- 229 sysgl:ln=ln+1:sys27264:goto228
- 230 ifnotrfthenln=ol:goto80
- 231 ifrfthen110
- 240 rem dos command
- 242 p$=str$(dv)+">":l=35:gosub1900:gosub5300:systb+42,w$,dv:gosub5400
- 243 m0$="Disk status":m1$=e$:l=1:i$(1)="OK":bc=13:c=3:gosub1800:goto110
- 250 rem change dv
- 251 gosub5500:l=0:fori=8to29:open2,i,2:close2:ifst=>0thenl=l+1:i$(l)=str$(i)
- 252 next:gosub5600:xp=12:yp=0:gosub1600:gosub5100:gosub1700
- 254 ifmi=0then110
- 255 dv=val(i$(mi))
- 256 goto110
- 260 i$(1)="Joystick":i$(2)="Mouse":l=2:xp=10:yp=8:gosub1600:gosub5100:gosub1700
- 262 ifmi=0then110
- 264 z=mi-1:gosub5000:goto256
- 270 dv=-dv:w$="hello connect":m0$="Exit"::systb+21,s1:goto581
- 300 rem link menu
- 301 ifgf or nottvthen110
- 303 ifmi<10then350
- 310 rem new path
- 311 gosub5500:x$=lt$(0):y$=lf$(0):q=lp%(0)
- 315 gosub4000:lt$(0)=x$:lf$(0)=y$:lp%(0)=q:ifpn>0thengosub4100
- 317 gosub4200
- 320 goto110
- 350 rem interp menu
- 353 xf$=lf$(mi-1):ifxf$=""then110
- 355 ifxf$=lf$thenxf$=""
- 357 pn=lp%(mi-1):hp=-1:li=mi-1:rf=0:goto700
- 400 rem option menu
- 402 onmigoto410,430,460,405,480
- 405 goto110
- 410 rem prefs
- 413 ifrfthen110
- 415 gosub8000:gosub2800:ln=ln-ws:goto80
- 430 bc=7:c=8:rem search
- 431 if(nottv)orrfthen110
- 432 ifsf>-1then455
- 435 p$=" Find:":l=32:gosub1900:ifw$=""then110
- 436 sf=sl:gosub452
- 437 fori=1tolen(w$):poke26495+i,asc(mid$(w$,i,1)):next:poke26592,len(w$)-1
- 440 ol=ln-ws:ln=sf:gosub2200
- 442 ln=ln+1:sysgl:sys26720:ifpeek(26593)=128then450
- 444 ifln<=elthen442
- 446 systb+21,s2:m1$="String not found":i$(1)="OK":l=1:gosub1800:sf=0
- 448 sf=-1:ln=ol:goto80
- 450 sf=ln-1:ln=ol:ifsf<tlorsf>blthenln=sf-int(ws/2)
- 451 goto80
- 452 m0$="Searching":m1$="Please Wait":l=0:gosub1800:gosub5500:return
- 455 m0$="Search document":m1$="Same search again?":i$(1)="Yes":i$(2)="No"
- 456 l=2:gosub1800
- 457 ifmi=1thensf=sf+1:goto440
- 458 sf=-1:goto435
- 460 rem bookmark
- 461 ifnottvthen110
- 462 xp=20:yp=6:c=7:i$(1)="Mark position":i$(2)="Go to mark":l=2
- 463 gosub1600:gosub5100:gosub1700:ifmi=0then110
- 464 ifmi=1andrf=0thengosub9000:goto110
- 465 ifmi=2thengoto9100
- 467 goto110
- 480 rem help
- 481 gosub5300:poke198,0:systb+51,"vls.help",dv
- 482 gosub5400:goto110
- 489 rem click handle
- 490 u=-1:ifnottvthen100
- 500 ifrfthen540
- 501 ifx=0andy=23thengosub3200:gosub590:ifa=0thenu=0:goto501
- 502 ifx=0andy=3thengosub3300:gosub590:ifa=0thenu=0:goto502
- 503 ln=bl:ifu=0thengosub3700
- 504 ifx=38andy=23thengosub3400:gosub590:ifa=0then504
- 506 ifx=38andy=3thengosub3500:gosub590:ifa=0then506
- 508 ifx=39andy>2andy<24andnotdbthengosub3800:goto90
- 510 ify<>3then550
- 512 ifx<>8then520
- 514 li=li-1:ifli<0thenli=0:goto100
- 516 mi=li+1:goto350
- 520 ifx<>14then530
- 522 li=li+1:ifli>8orlt$(li)=""thenli=li-1:goto100
- 524 mi=li+1:goto350
- 530 ifx<>11thengoto537
- 535 mi=1:goto350
- 537 ifx<25orx>28ornotgvthen100
- 538 goto4500
- 540 ifrfandgfthen4600
- 550 ifrfandnotgfthen563
- 551 ify<4ory>22orx>38then100
- 552 l=peek(lm+x+y*40):ifl=255then100
- 553 gosub5500:gosub2700
- 555 ifm$<>"t"then560
- 556 gosub558:pn=a:goto700
- 558 pokear,asc(p$):syscv:a=peek(ar):return
- 560 ifm$<>"m"then570
- 561 gosub730:gosub558:pn=a:gosub740:goto100
- 563 if(bd=-1andy=b)ora$=chr$(13)thengoto700
- 565 goto100
- 570 ifm$<>"g"then580
- 575 lg=-1:gosub558:gp=a:goto4500
- 580 systb+18,s1:w$=xf$:m0$="Launch Program":ifm$<>"p"then100
- 581 m1$="Are you sure?":i$(1)="Yes":i$(2)="No":l=2
- 582 bc=5:c=13:gosub1800:ifmi=2thendv=abs(dv):goto110
- 583 goto9800
- 590 a=(peek(56320+z)and16):return
- 600 u=-1:ifnottvorrfthen650
- 601 ifa$=""thengosub3200:gosub690:ifa=0thenu=0:goto601
- 602 ifa$=""thengosub3300:gosub690:ifa=0thenu=0:goto602
- 603 ln=bl:ifu=0thengosub3700
- 604 ifa$=""thengosub3400:gosub690:ifa=0then604
- 606 ifa$=""thengosub3500:gosub690:ifa=0then606
- 608 ifa$=""andnotdbtheny=3:gosub3800:goto90
- 609 ifa$=""andnotdbtheny=23:gosub3800:goto90
- 620 ifa$="v"andgvthen4500
- 640 ifa$=","ora$="<"thengoto514
- 641 ifa$="."ora$=">"thengoto522
- 642 ifa$="_"thengoto535
- 650 ifa$="I"thenz=1-z:gosub5000:gosub3060:goto100ory>22orx>38then100
- 651 ifa$<>"#"then660
- 652 gosub5300
- 653 dv=dv+1:ifdv=30thendv=8
- 654 open 2,dv,2:close2:ifst<0then653
- 655 gosub3060:gosub5400:ifdcthenreturn
- 656 goto100
- 660 ifrfandnotgfthen563
- 662 ifrfandgfthen4600
- 689 goto100
- 690 a=(peek(197)=64):return
- 700 rem main login
- 701 ifxf$="*"thenxf$=""
- 702 ifxf$=""orrfthen705
- 703 f$=xf$:lf$=xf$:gosub6200:ifnottvthengosub4000:goto80
- 705 m0$="Scanning Document":m1$="Please Wait":bc=14:l=0:ifrfthenpn=op:hp=-1
- 706 gosub5500:gosub1800:sf=-1
- 710 gosub2000:gosub2100:gosub2800:ln=sl:gosub3600
- 711 ifhpthengosub4200:goto714
- 712 ifpn=0thengosub4000:li=-1
- 713 gosub4100
- 714 systb+21,s2:ifgqthenreturn
- 715 ifrf or bmthenln=ol:rf=0:bm=0
- 720 hp=0:goto80
- 730 rem suspend current
- 733 op=pn:rf=-1:sf=-1
- 735 ol=ln-ws:ifol<slthenol=sl
- 737 return
- 740 rem message box
- 743 m0$="Scanning Document":m1$="Please Wait":bc=14:l=0
- 745 gosub5500:gosub1800:ov=rv:oc=c0:c0=val(xf$)
- 747 gosub2000:gosub2100:gosub2800:ln=sl::gosub2200:a=el-sl:t=int(12-a/2-1)
- 748 systb+21,s2:b=int(12+a/2+1):ifnotgqthensystb+72,0,39,1,23
- 750 rv=-1:systb+15,0,39,t,b,160,val(xf$):systb+72,0,39,t,t:systb+72,0,39,b,b
- 752 poke646,peek(55296+40*t):systb+27,t,""+pt$
- 753 systb+27,b,"Click here to Exit"
- 755 r=t+1:fori=sltoel:gosub2400:r=r+1:next:rv=ov:c0=oc
- 760 return
- 800 rem title page
- 805 poke53281,0:poke53280,0:print"":poke53272,cb
- 807 systb+27,6,"Welcome to the"
- 809 systb+27,8,"VLS HYPERTEXT SYSTEM"
- 815 systb+27,12,"Designed and Programmed by T. Parker"
- 819 systb+27,15,"Copyright 1996 J&F Publishing
-
- 820 systb+27,18,"Initializing, please wait..."
- 849 return
- 850 systb+27,18," "
- 851 systb+27,18,"To get started:"
- 852 systb+27,19,"Click on FILE, then OPEN,"
- 853 systb+27,20,"and select a document."
- 899 return
- 900 rem define addresses/constants
- 905 dim lf$(8),lt$(8),lp%(8):h$(0)="Normal ":h$(1)="Boldface "
- 906 h$(3)="Underline":h$(2)="Italic "
- 910 tb=49152:up=25088:s1=53248/256:s2=55296/256:dv=peek(186):ifdv<8thendv=8
- 915 c0=15:c1=14:c2=10:c3=13:c4=7:p1=1:p2=2:p3=3:rv=-1:hp=0:sf=-1
- 999 return
- 1000 rem menu handler object module
- 1001 rem initialize handler
- 1005 read a,b:mi=a:dim m$(a,b),w%(a),l%(a),sp%(39),sm%(a):dim i$(21)
- 1015 fori=1toa:read m$(i,0),l%(i):w%(i)=0:forj=1tol%(i):readm$(i,j)
- 1020 l=len(m$(i,j)):ifl>w%(i)thenw%(i)=l
- 1025 next:next
- 1100 rem menu data
- 1105 data 3,10
- 1110 data "File",10
- 1120 data "Open",,"Save text","Print",,"DOS command","Disk Device"
- 1125 data "Input device",,"Exit"
- 1130 data "Link",10
- 1135 data,,,,,,,,,"New Path"
- 1136 data "Options",5
- 1140 data "Preferences","Find text","Bookmark",,"Help!"
- 1200 rem create menu string/map
- 1210 mb$=" ":fori=1tomi:mb$=mb$+m$(i,0)+" ":next
- 1215 fori=len(mb$)to39:mb$=mb$+" ":next
- 1220 p=0:fori=0to38
- 1225 ifmid$(mb$,i+1,1)=" "thenp=p+1:j=i+1:goto1235
- 1230 sp%(i)=p:sm%(p)=j
- 1235 next
- 1240 return
- 1300 rem display menu bar
- 1310 poke646,c:systb+24,0,0,""+mb$+""
- 1320 return
- 1400 rem disp submenu
- 1410 sm=0:i=sp%(x):ifi=0thenreturn
- 1415 sm=i
- 1420 a=sm%(i):systb+72,a,a+1+w%(i),1,l%(i)+3
- 1423 ifa>2thensystb+72,0,a-2,0,0
- 1425 systb+72,a+1+len(m$(i,0)),39,0,0
- 1430 systb+15,a-1,a+w%(i),1,l%(i)+2,160,c
- 1435 poke646,c
- 1440 forj=1tol%(i):systb+24,a,j+1,""+m$(i,j):next
- 1450 return
- 1500 rem interpret submenu
- 1505 a=sm%(sm):mi=0
- 1510 ifx<a-1orx>a+w%(sm)thenreturn
- 1513 ify>l%(sm)+1ory<2thenreturn
- 1515 mi=y-1:fori=1tol%(sm)+2:ifi=ythen1530
- 1520 systb+72,a-1,a+w%(sm),i,i
- 1530 next
- 1599 return
- 1600 rem disp imm submenu
- 1610 w=0:fori=1tol:iflen(i$(i))>wthenw=len(i$(i)):next
- 1615 ifdbthenxp=xp-w:rem handle db pos
- 1620 systb+72,xp+1,xp+2+w,yp+1,yp+l+2
- 1630 systb+15,xp,xp+w+1,yp,yp+l+1,160,c
- 1635 poke646,c
- 1640 forj=1tol:systb+24,xp+1,yp+j,""+i$(j):next
- 1650 return
- 1700 rem interpret imm submenu
- 1705 mi=0
- 1710 ifx<xporx>xp+w+1thenreturn
- 1713 ify>yp+lory<yp+1thenreturn
- 1715 mi=y-yp:fori=yptoyp+l+1:ifi=ythen1730
- 1720 systb+72,xp,xp+w+1,i,i
- 1730 next
- 1799 return
- 1800 rem standard message/dialog box
- 1803 systb+18,s2
- 1805 l0=len(m0$):l1=len(m1$):a=l0:ifl1>athena=l1
- 1810 a=a/2:x1=18-a:x2=22+a:systb+72,x1+1,x2+1,11,15
- 1815 systb+15,x1,x2,10,14,160,bc:poke646,bc
- 1820 print"";:systb+27,11,m0$
- 1825 print"";:systb+27,13,m1$
- 1830 ifl=0thenreturn
- 1840 yp=14:xp=x2:db=-1:gosub1600:db=0
- 1850 gosub5600:gosub5100:gosub1700:ifmi=0then1850
- 1860 systb+21,s2:return
- 1900 rem bottom line entry
- 1901 gosub5300:poke198,0
- 1905 a=len(p$)+l:systb+15,0,a,24,24,32,0:systb+24,0,24,""+p$
- 1910 systb+66,7,1,l:gosub5400:return
- 2000 rem vls kernal routines
- 2010 rem initialize vmx
- 2020 iv=25856:ld=iv+3:jl=iv+6:gl=iv+9:pl=iv+16:cl=iv+19:rc=iv+22:rt=iv+25
- 2022 cv=iv+32:sd=26624
- 2024 ct=28416:lm=31744
- 2026 row=182:lc=247:hc=lc+1:ls=249:hs=ls+1:ar=780
- 2028 pokels,0:pokehs,0:sysiv
- 2029 a=1:poke26237,a:poke26362,a:poke26370,a:poke26265,37:rem margins
- 2030 ifpn=0thengosub2300:hp$=w$
- 2040 fori=0to2:poke26316+i,234:next
- 2050 ln=0:return
- 2100 rem log in document
- 2105 pokear,pn:pokerow,0:sysld
- 2110 sl=peek(ls)+peek(hs)*256:el=peek(lc)+peek(hc)*256:el=el-2
- 2115 ln=sl-1:gosub2200:gosub2300:pt$=mid$(w$,4,40)
- 2120 syscl:return
- 2200 rem jump to line
- 2205 syscl
- 2210 hb=int(ln/256):lb=ln-hb*256
- 2215 pokels,lb:pokehs,hb:sysjl
- 2220 gosub2250:return
- 2250 rem return curlin value
- 2255 ln=peek(hc)*256+peek(lc)
- 2260 return
- 2300 rem return line in w$
- 2307 sysgl
- 2310 print"";
- 2315 a=peek(646):poke1018,peek(ar):systb+3697:poke646,a
- 2320 return
- 2400 rem get/print line
- 2401 pokect+255,c0:ifln=sfthenpokect+255,c4
- 2403 ifrvthensystb+15,0,38,r,r,160,c0
- 2404 poke199,-rv:ifln=sfthenpoke199,1
- 2405 poke row,r:sysgl:syspl:poke199,0
- 2415 return
- 2500 rem get link code
- 2505 poke ar,l:sysrc:gosub2310
- 2510 return
- 2600 rem get link text
- 2605 poke ar,l:sysrt:gosub2310
- 2610 return
- 2700 rem interpret link
- 2710 gosub2500:c$=w$:ifc$=""thenreturn
- 2715 gosub2600:t$=w$
- 2720 m$=mid$(c$,3,1):p$=mid$(c$,4,1):xf$=mid$(c$,6,40)
- 2730 pokear,asc(p$):syscv:p=peek(ar)
- 2740 return
- 2800 rem set up lct
- 2810 pokect+255,c0:poke24997,c1:poke25003,c2:poke25009,c3:sys24976:return
- 3000 rem vls screen handler
- 3010 systb+15,0,39,3,24,32,0
- 3015 tl=0:bl=0:ws=22-4
- 3020 rem
- 3025 systb+69:systb+24,0,3,"{CBM--}":systb+24,0,23,"~"
- 3027 systb+24,38,3,"{CBM-*}":systb+24,38,23,"{CBM-K}"
- 3030 systb+24,8,3,"{CBM-I} {CBM-G} {CBM-T}"
- 3032 ifgvthensystb+24,25,3,"VIEW"
- 3043 ifnottvthensystb+15,0,39,1,2,32,0:goto3060
- 3045 systb+15,0,39,1,1,160,3:systb+15,0,39,2,2,160,13
- 3050 print"";:systb+27,1,hp$:print"";:systb+27,2,pt$
- 3060 rem status
- 3061 systb+15,0,39,24,24,32,0:iff$<>""thenxf$=f$
- 3062 systb+24,0,24," File: "+xf$:systb+24,25,24,"Device:"+str$(dv)
- 3063 ifz=0thensystb+24,37,24,"J"
- 3064 ifz=1thensystb+24,37,24,"M"
- 3099 return
- 3100 rem new location
- 3103 gosub5500
- 3104 a=32:ifrvthena=160
- 3105 systb+15,0,38,4,22,a,c0
- 3107 ifln<slthenln=sl
- 3110 tl=ln:bl=ln+ws:gosub2200
- 3115 ifbl>elthenbl=el
- 3125 r=4:forln=tltobl:gosub2400:r=r+1:next:ln=bl:gosub3700
- 3150 return
- 3200 rem scroll next
- 3205 if bl=elthenreturn
- 3207 ifuthengosub2250
- 3210 systb+36,0,38,4,22,0:systb+39,32,0
- 3215 systb+54,lm+40*5,lm+40*24,lm+40*4
- 3220 tl=tl+1:bl=bl+1:ln=ln+1:r=22
- 3230 ifln<>blthenln=bl:gosub2210
- 3240 gosub2400:ifuthengosub3700
- 3250 return
- 3300 rem scroll prev
- 3305 iftl=slthenreturn
- 3307 ifuthengosub2250
- 3310 systb+36,0,38,4,22,1:systb+39,32,0
- 3315 syssd
- 3320 tl=tl-1:bl=bl-1:r=4
- 3325 ln=tl:gosub2210
- 3330 gosub2400:ifuthenln=bl:gosub3700
- 3350 return
- 3400 rem page fwd
- 3405 ifbl=elthenreturn
- 3410 ln=bl:ifln+18>elthenln=el-18
- 3415 gosub3100:return
- 3500 rem page back
- 3505 iftl=slthenreturn
- 3510 ln=tl-18:ifln<slthenln=sl
- 3515 gosub3100
- 3540 return
- 3600 rem init scrollbar
- 3605 n=el-sl:bi=n/(ws+3):bp=0
- 3610 ifbi=0thenbi=1
- 3699 return
- 3700 rem calc new pos
- 3710 a=int((ln-sl-ws+1)/bi)
- 3720 db=0:ifa<0thena=0:db=-1
- 3750 rem draw scrollbar
- 3760 systb+24,39,3,"{CBM-M}":systb+24,39,23,"{CBM-POUND}":systb+15,39,39,4,22,105,7
- 3761 ifnottvthenprint"";:systb+27,23,"No Document in Memory":return
- 3763 bp=a:systb+24,39,3+bp,"{CBM-N}"
- 3770 if nottvthenreturn
- 3771 print"";:systb+15,1,37,23,23,32,0
- 3772 systb+27,23,str$(ln-sl)+" of"+str$(el-sl)
- 3773 return
- 3799 return
- 3800 rem set scrollbar
- 3803 a=y-3:gosub3750:ln=int((bp*bi)+sl)
- 3805 ifln>el-wsthenln=el-ws
- 2018 return
- 4000 rem link path/menu handler
- 4005 rem reset path
- 4007 fori=0to8:lt$(i)="":lf$(i)="":lp%(i)=0:next
- 4010 li=0:gosub4200:return
- 4100 rem new entry
- 4103 li=li+1:ifli>8thenli=8
- 4105 lt$(li)=pt$:lf$(li)=lf$:lp%(li)=pn
- 4200 rem upd menu
- 4202 l=len(m$(2,10))
- 4203 fori=0to8:a$=" ":if(i=li)andtvthena$="{CBM-N}"
- 4205 m$(2,i+1)=a$+left$(lt$(i),31):a=len(m$(2,i+1)):ifl<athenl=a
- 4207 next:w%(2)=l:return
- 4500 ifnotgqthengosub730:rem graphic handler
- 4551 f$=xf$:xf$="13":pn=gp:gosub740:tc=peek(646)and15
- 4561 ifnotlgthen4577
- 4565 systb+15,0,39,b,b,160,tc:m0$="Loading Graphic":gosub6700:gosub5300
- 4570 systb+30,f$,dv,31744:systb+21,s2
- 4573 gosub5400:gosub5500:ifval(e$)=0thengv=-2:goto4577
- 4574 m0$="Error loading graphic":gosub6800
- 4575 ifmi=1then4565
- 4576 goto 4700
- 4577 gf=-1:systb+15,0,39,b,b,160,tc:poke646,tc:gosub5600
- 4578 ifgqthenreturn
- 4579 systb+27,b,"Click here to exit - any key to view":ifnotlgthen100
- 4580 systb+18,s1:gosub7000:goto4640
- 4600 rem gfx click handler
- 4620 if a$=chr$(13)or(bdandy=b)then4700
- 4630 systb+18,s1:gosub7200
- 4640 gosub590:ifa=0then4650
- 4645 gosub690:ifa=0then4650
- 4647 goto4640
- 4650 gosub7300:systb+21,s1:goto100
- 4700 rem reload
- 4701 gf=0:ifnotlgthen700
- 4703 systb+15,0,39,b,b,160,tc:poke646,tc
- 4705 systb+27,b,"Reloading document - Please wait"
- 4710 xf$=lf$:lg=0:goto703
- 5000 rem input driver object module
- 5010 id=24576:sp=2040
- 5060 ifpeek(789)<>234thensysid+6
- 5070 poke53248,180:poke53249,148:poke2040,13:poke53287,1:poke53264,0
- 5080 poke53269,1:ifz=1thensysid
- 5090 ifz=0thensysid+256
- 5095 return
- 5100 rem get x y wait for click/key a$
- 5105 poke198,0
- 5110 if(peek(56320+z)and16)<>0thenbd=0:goto5180
- 5120 ifbdthen5110
- 5130 bd=-1
- 5140 x=peek(53248)+(peek(53264)and1)*256-20:y=peek(53249)-48
- 5150 ifx<0orx>320ory<0ory>199then5110
- 5160 x=int(x/8):y=int(y/8)
- 5170 a$="":return
- 5180 a=peek(197):ifa=60ora=64then5110
- 5190 geta$:return
- 5200 rem get x y bd direct return
- 5210 bd=-1:if(peek(56320+z)and16)<>0thenbd=0
- 5220 x=peek(53248)+(peek(53264)and1)*256-20:y=peek(53249)-48
- 5230 x=int(x/8):y=int(y/8)
- 5240 return
- 5300 rem suspend driver
- 5310 poke53269,0
- 5315 sysid+6
- 5320 return
- 5400 rem resume driver
- 5405 poke53269,1:gosub5600
- 5460 ifz=1thensysid
- 5470 ifz=0thensysid+256
- 5480 return
- 5500 rem wait pointer
- 5510 pokesp,14:return
- 5600 rem normal pointer
- 5700 pokesp,13:return
- 6000 rem vls hypertext file handler
- 6030 wc$="$:vh.*":fv=0:up=25088
- 6035 dl=57344
- 6050 return
- 6100 rem read directory
- 6105 systb+18,s2
- 6110 gv=0
- 6113 gosub5300
- 6115 systb,wc$,dv,dl,10,7,10,3,1
- 6117 gosub5400
- 6120 iff%>0then6150
- 6130 m0$="Error reading directory":ifnotf%thenm0$="No documents found"
- 6135 gosub6800
- 6140 ifmi=1thengoto6100
- 6150 systb+21,s2:return
- 6200 rem load document
- 6205 gv=gv+1:ifgv>0thengv=0
- 6210 gosub5300:tv=0:systb+18,s2
- 6215 m0$="Loading document":gosub6700
- 6220 sysup,f$,dv,32768:systb+21,s2
- 6230 gosub5400
- 6235 systb+42,"",dv
- 6240 ifval(e$)=0thentv=-1:return
- 6243 m0$="Error loading document":gosub6800
- 6245 ifmi=1thengoto6210
- 6247 return
- 6700 rem activity message
- 6710 m1$=f$:bc=3:l=0
- 6720 gosub1800:return
- 6800 rem error message dialog
- 6806 m1$=str$(dv)+"> "+e$:bc=2:c=10
- 6810 i$(1)="Retry":i$(3)="Cancel":l=3:i$(2)="Device":ifddtheni$(2)=""
- 6814 gosub1800:rem error db
- 6815 ifmi=2andddthen6814
- 6816 ifmi=2thendc=-1:gosub652:dc=0:goto6814
- 6817 ifmi=3thenmi=2
- 6818 return
- 7000 rem vls hypertext graphic/print handler
- 7015 gosub5500
- 7020 poke251,124:poke252,224:poke253,184:sys26880
- 7025 poke53281,0:poke53280,0
- 7030 if(peek(53265)and32)=0thensys26880+3:goto7030
- 7035 rem save color memory (cm rom in)
- 7040 gm=peek(53270):gb=peek(53281):systb+60,55296,56320,48128
- 7060 rem hi res on
- 7065 gosub5300
- 7070 poke56576,0:poke53265,27+32:poke53270,gm:poke53272,96+8:poke53281,gb
- 7075 rem restore data
- 7080 systb+54,47104,48127,55296
- 7085 sys25728:rem custom bc00 to cm xfer
- 7090 return
- 7095 rem hi res off
- 7100 gosub5400
- 7105 poke56576,3:poke53265,27:poke53270,200:poke53272,cb:poke53281,0
- 7110 return
- 7115 rem medres print
- 7130 pokepd+163,224:pokepd+179,184:pokepd+186,4:rem secondary
- 7135 syspd-16:rem $01 handler entry pt
- 7136 open4,4,4:fori=1to5:print#4:next:close4
- 7140 return
- 7145 rem hires print
- 7160 syspd,4,4,0,0,0,39,24,224,75,35,65,8,0
- 7161 open4,4,4:fori=1to5:print#4:next:close4
- 7165 return
- 7199 rem ux interface
- 7200 goto7060:rem hires on
- 7300 goto7095:rem hires off
- 7400 goto7115:rem mprint
- 7500 goto7145:rem hprint
- 8000 rem prefrences
- 8005 systb+72,0,39,0,23:systb+15,5,34,5,17,102,12:systb+15,6,33,6,16,32,0
- 8007 systb+27,5,"Preferences":systb+27,17,"Click here to Exit"
- 8010 systb+24,8,7,"{CBM-T}{CBM-T}{CBM-T}{CBM-T}{CBM-T}":systb+24,22,9,"{CBM-T}{CBM-T}{CBM-T}{CBM-T}"
- 8020 systb+24,8,15,"{CBM-T}Save {CBM-T}Load {CBM-T}Default"
- 8050 poke646,c0:systb+24,9,7,"Text Color":poke646,c1:systb+24,9,9,"Text Link"
- 8053 poke646,c2:systb+24,9,10,"Graphic Link":poke646,c3
- 8055 systb+24,9,11,"Program Link":poke646,c4:systb+24,9,13,"Find Bar"
- 8057 systb+24,23,9,""+h$(p1)+""+h$(p2)+""+h$(p3)
- 8058 a$="Normal Text ":ifrvthena$="Inverse Text"
- 8059 systb+24,20,13,a$
- 8100 gosub5100:ifx<6orx>33ory<6ory>17then8100
- 8103 ify=17thenreturn
- 8110 ifx<>8then8120
- 8112 ify=7thenc0=(c0+1):ifc0=16thenc0=1
- 8113 ify=9thenc1=(c1+1):ifc1=16thenc1=1
- 8114 ify=10thenc2=(c2+1):ifc2=16thenc2=1
- 8115 ify=11thenc3=(c3+1):ifc3=16thenc3=1
- 8116 ify=13thenc4=(c4+1):ifc4=16thenc4=1
- 8120 ifx<>22then8130
- 8123 ify=9thenp1=(p1+1):ifp1=4thenp1=0
- 8124 ify=10thenp2=(p2+1):ifp2=4thenp2=0
- 8126 ify=11thenp3=(p3+1):ifp3=4thenp3=0
- 8130 ifx=19andy=13thenrv=notrv
- 8135 ify<>15then8150
- 8136 ifx=8thengosub8200
- 8137 ifx=16thengosub8300
- 8138 ifx=24thengosub910
- 8150 goto8050
- 8200 rem save prefs
- 8201 gosub5300
- 8205 systb+42,"i",dv:systb+42,"s0:vp.config",dv:open2,dv,2,"vp.config,s,w"
- 8210 print#2,c0","c1","c2","c3","c4","p1","p2","p3","rv:close2
- 8220 gosub5400:return
- 8300 rem load prefs
- 8301 gosub5300:systb+42,"i",dv
- 8305 open2,dv,2,"vp.config"
- 8307 input#2,c0,c1,c2,c3,c4,p1,p2,p3,rv:close2
- 8310 systb+42,"",dv:ifval(e$)<>0thengosub910
- 8320 gosub5400:return
- 9000 rem save mark
- 9010 w$="vb."+mid$(lf$(0),4,13) :gosub5300
- 9015 systb+42,"s0:"+w$,dv:open2,dv,2,w$+",s,w"
- 9020 fori=0to8:print#2,lt$(i)","lf$(i)","lp%(i):next
- 9030 print#2,li","ln-ws
- 9040 close2:gosub5400:return
- 9100 rem load mark
- 9110 w$="vb."+mid$(lf$(0),4,13):gosub5300:systb+42,"r0:"+w$+"="+w$,dv:gosub5400
- 9112 ifval(e$)=63then9115
- 9113 m0$="Document not Marked":gosub6800:ifmi=1then9110
- 9114 goto110
- 9115 gosub5300:open2,dv,2,w$
- 9120 fori=0to8:input#2,lt$(i),lf$(i),lp%(i):next
- 9130 input#2,li,ol:close2:gosub5400
- 9140 mi=li+1:bm=-1:goto350
- 9500 rem print handler
- 9505 ifnottvthen110
- 9507 ifnotrfthenol=ln-ws
- 9508 iflgthengq=-1:systb+21,s1:gosub4700:gosub4500:gq=0
- 9510 open4,4,0:close4:ifst>=0then9550
- 9520 m0$="Printer not found":m1$="Make sure printer is on line"
- 9530 bc=2:c=10:dd=-1:gosub6810:dd=0
- 9535 ifmi=1then9510
- 9540 ifmi=2then110
- 9545 systb+18,s1
- 9550 ifgfthengosub9700:systb+21,s1
- 9553 open5,4,5:print#5,chr$(27)chr$(50);:close5
- 9555 gosub9600:gosub5400:gosub2800:systb+21,s1:goto230
- 9560 rem load driver
- 9562 bc=3:l=0:m0$="Loading print driver":systb+18,s2:m1$=w$:gosub1800
- 9564 gosub5300:systb+30,w$,dv,27392:systb+21,s2:gosub5400
- 9566 ifval(e$)=0thenpd=27392:mi=0:return
- 9570 m0$="Error loading driver":gosub6800:ifmi=1then9560
- 9575 return
- 9600 rem text print
- 9601 w$="tdrv6b00":gosub9560:ifmi<>0thenreturn
- 9602 gosub5300:pokect+255,0:poke24997,p1:poke25003,p2:poke25009,p3:sys24976
- 9603 m0$="Printing":m1$="Please Wait...":bc=15:l=0:gosub1800
- 9605 open4,4,7:open5,4,5:pg=0:ln=sl:gosub2200
- 9610 pp=4:pg=pg+1:bk=0:ifln>elthenclose4:close5:return
- 9611 cr=-1:ifpg=1thencr=0
- 9612 print#4:print#5,chr$(27)chr$(45)chr$(1);:print#4,hp$" - "pt$:print#4
- 9613 print#5,chr$(27)chr$(45)chr$(0);:print#4," ";
- 9620 ifcrthenprint#4:print#4," ";:pp=pp+1
- 9621 ifln>slandpeek(513)<>94thensyspd
- 9622 pokerow,24:syscl:sysgl:systb+15,0,39,24,24,32,0:sys26261
- 9624 cr=notcr:a=peek(513)
- 9625 ifa=32thencr=-1
- 9626 ifbk=0anda=13thenbk=-1:print#4:pp=pp+1
- 9627 if(a<>13)andbkthenbk=0:cr=-1:ln=ln+1:goto9621
- 9628 ifa=13thencr=-1
- 9635 ifln>elthena=pp:pp=61:ifnotrfthenfori=atopp:print#4:next
- 9636 if(pp>60)andcrthensys27480:print#4
- 9637 ln=ln+1:if(pp>60)andrfthenprint#4,chr$(12):goto9610
- 9640 if(pp>60)andcrthenprint#4:print#4,pgspc(60)f$:print#4,chr$(12);:goto9610
- 9650 goto9620
- 9700 rem graphics print
- 9705 w$="hdrv6b00":ifgm=216thenw$="mdrv6b00"
- 9710 gosub9560:ifmi<>0thenreturn
- 9715 gosub5300
- 9720 ifgm=216thengosub7200:gosub7400:gosub5400:gosub7300:return
- 9730 gosub7200:gosub7500:gosub5400:gosub7300:return
- 9800 rem exit/program link
- 9810 gosub5300:ifdv>0then9900
- 9815 dv=7
- 9820 dv=dv+1:ifdv=30thenpoke186,8:w$="":goto9900
- 9830 open2,dv,2:close2:ifst<0then9820
- 9840 systb+42,"r0:"+w$+"="+w$,dv:ifval(e$)<>63then9820
- 9900 print"":poke53272,23:print"pO44,8:pO56,160:pO2048,0:new"
- 9910 print"";:ifw$<>""thenprint"load"chr$(34)w$chr$(34)","dv:a=3
- 9930 ifw$=""thenprint"?chr$(147)chr$(5)":a=2
- 9935 print"run"
- 9940 print"";:fori=1toa:poke630+i,13:next:poke198,a
- 9950 end
- 10000 @"s0:vls.main":@:_"vls.main
-
- 10010 verify"vls.main
-
- 10020 end
-