1000 ! * MOUNT.BAC 1005 INTEGER : EXTEND 1010 ; '** Mount utility **' 1020 ; ' Ver X.03, 1985-04-24' 1030 ; ' Copyright 1984 Dataindustrier AB' 1040 ; 1050 ! * Written by Benny L|fgren 1060 ! ** ** ** ** ** ** ** ** ** ** ** 1070 ! * 1080 ! * Ver date / Ver nb / Sign / Note 1090 ! * 84-06-18 / X.00 / BL / Main 1100 ! * 84-06-21 / X.01 / BL / Activate flag in right register 1110 ! * 85-02-26 / X.02 / GN / DCWAI -> NETCALL 1120 ! * 85-04-24 / X.03 / BL / Accessible from DOS, FNStartpar$ handling 1130 ! * 1140 ! ** ** ** ** ** ** ** ** ** ** ** 1150 ! * 1160 ! EJECT 1170 ! ******************************** 1180 ! * 1190 ! * Main routine 1200 ! * 1210 A$=FNStartpar$ : IF LEN(A$) GOTO 1230 1220 INPUT "Drive: "A$ : IF A$="" GOTO 1250 1230 A=FNDrsel(A$) : IF A=0 ; "Invalid drive." : GOTO 1220 1240 IF FNTalknet(14,10,0,A,128,0) ; "Trap during mount." 1250 ; FNExit 1260 ! 1270 ! ********************************* 1280 ! * 1290 ! * Scan device table for disk 1300 ! * 1310 DEF FNDrsel(A$) LOCAL I,Dr$=15,Ptr 1320 IF RIGHT$(A$,LEN(A$))=":" Dr$=LEFT$(A$,LEN(A$)-1) ELSE Dr$=A$ 1330 Dr$=FNCaps$(Dr$) : WHILE LEN(Dr$)<3 : Dr$=Dr$+" " : WEND 1340 Ptr=PEEK2(65403) 1350 WHILE Ptr : I=0 1360 WHILE I<3 : I=I+1 1370 IF PEEK(Ptr+1+I)<>ASCII(RIGHT$(Dr$,I)) GOTO 1390 1380 WEND : GOTO 1410 1390 Ptr=PEEK2(Ptr) 1400 WEND : RETURN 0 ! Drive not found 1410 I=PEEK(Ptr+7) : IF I>3 RETURN I 1420 RETURN PEEK(PEEK2(24683)) ! DR_: conversion 1430 FNEND 1440 ! 1450 ! ********************************* 1460 ! * 1470 ! * Convert lower case to caps 1480 ! * 1490 DEF FNCaps$(A$) LOCAL I,Str$=160,Char$=1 1500 WHILE I'_' AND Char$<'' Char$=CHR$(ASCII(Char$)-32) 1520 Str$=Str$+Char$ 1530 WEND : RETURN Str$ 1540 FNEND 1550 ! 1560 ! ********************************* 1570 ! * 1580 ! * Do communication with net central. 1590 ! * 1600 DEF FNTalknet(Fc,Sfc,B,C,D,E) LOCAL Z 1610 IF PEEK(PEEK2(24616))=201 RETURN -1 ! This is not a Lux-net!!! 1620 POKE 64798,255 ! 0FFH -> BSAVE. => TFT. fake (use DOSBUF0). 1630 POKE 64961,Fc ! FC -> MSG.FC (Function code). 1640 POKE 64962,Sfc ! SFC -> MSG.SFC (Subfunction code). 1650 POKE 64963,C,B ! MSG.PDN, MSG.ERRB (BC register to/from central). 1660 POKE 64965,E,D ! Register DE to/from central. 1670 Z=CALL(24615) ! NETCALL => Talk to the central. 1680 RETURN PEEK(64962) 1690 FNEND 1700 ! 1710 ! ********************************* 1720 ! * 1730 ! * Check if user entered from DOS or BASIC 1740 ! * 1750 DEF FNChkdos LOCAL I 1760 I=PEEK2(65302)-160 1770 WHILE I<160 : IF PEEK2(I)=-212 RETURN -1 1780 IF PEEK(I)<>13 I=I+1 : WEND 1790 RETURN 0 1800 FNEND 1810 ! 1820 ! ********************************** 1830 ! * 1840 ! * Get start parameter string (if any) 1850 ! * 1860 DEF FNStartpar$ LOCAL Cmdsp,I,Cmd$=160 1870 Cmdsp=PEEK2(65302)-160 1880 WHILE I<160 : I=I+1 : IF PEEK(Cmdsp+I-1)=44 GOTO 1910 1890 IF PEEK(Cmdsp+I-1)=13 RETURN '' ! No startpar string 1900 WEND : RETURN '' ! No startpar string 1910 IF PEEK(Cmdsp+I)=255 I=I+1 ! Skip DOS-entry flag 1920 WHILE I<160 : IF PEEK(Cmdsp+I)=13 GOTO 1950 1930 IF PEEK(Cmdsp+I)<32 OR PEEK(Cmdsp+I)>127 RETURN '' 1940 Cmd$=Cmd$+CHR$(PEEK(Cmdsp+I)) : I=I+1 : WEND 1950 RETURN Cmd$ 1960 FNEND 1970 ! 1980 ! ************************************* 1990 ! * 2000 ! * Exit to DOS or BASIC 2010 ! * 2020 DEF FNExit LOCAL A$=21,A 2030 IF FNChkdos=0 GOTO 2080 ELSE CLOSE ! We MUST close ALL files!!! 2040 A$='CMDINT SYS'+CHR$(14,255,205,27,96,216,195,3,193) 2050 A=VARPTR(A$) 2060 IF CALL(A+11,A) ; "Can't load CMDINT.SYS, press any key for RESET!"; 2070 GET A$ : IF CALL(0) REM Just a miracle would get through here... 2080 END ! End to get out of a function is ugly but... 2090 FNEND