;REMUSR.MAC - T-function 41 support for remote TD system ; (works with SPICPS module) ; 02-22-85 fixed to use tdos parameter area correctly thru ; user of IY register. ; 05-09-85 installed rsp for twix detect/display ; name ('remusr') ; cr equ 0dh lf equ 0ah ; wtsecs equ 180 ; 3 minute timeout timer ; .z80 ; ; If you use this with TurboPlus 1.41, please consult your TurboPlus ; manual. you may have to gen in "USRSUP". ; public usrfcn,uprms,usrnit extrn crproc,alloc,conin ; common /?init?/ ; usrnit: ld a,(conin+3) ld (ci03),a ld a,(conin+1eh) ld (ci1e),a ld a,1 ld (remoff),a ;come up dualio on ld h,0 dly: dec hl ld a,h or l jr nz,dly ld de,twix call crproc## jp usrnt1## ; cseg ; usrfcn: push iy ld iy,(memres##+4) ld a,h cp 90h ;90h = set parameters jp z,setpar cp 91h ;91h = get parameters jr z,getpar cp 92h jp z,gsbk ;92h = set/reset break cp 93h jp z,reb ;93h = reset slave cp 94h jr z,priv ;94h, l=0=nonpr, l=1=priv cp 95h jr z,glob ;95h, l=0=inhibit global, l=1=allow global cp 96h jp z,unrs ;96h = unrestrict user area in L cp 97h jp z,remc ;97h, l=0=dualio off, l=1=dualio on cp 98h jp z,abpr ;experimental xor a dec a ;return with invalid pop iy jp usrfc1## ; popr: pop iy ret ; ; this should make your hair stand up straight and send ; goose bumps up your spine... ; priv: ld a,l or a jr z,npr set 7,(iy+5bh) jr popr ; npr: res 7,(iy+5bh) jr popr ; glob: ld a,l or a jr z,ngl set 5,(iy+5bh) jr popr ngl: res 5,(iy+5bh) jr popr ; getpar: ; the following code must be uncommented for use with no command int! push bc ld hl,(srhdrv##+1) inc hl ld a,(hl) inc hl or a jr nz,nidle ld hl,idlem nidle: ld de,proc ld bc,23 ;up to 23 char of command line ldir xor a ;terminate cl ld (de),a ld hl,uusr ld a,(iy+40h) ld (hl),a inc hl ld a,(iy+3dh) ld (hl),a ld a,(iy+5bh) and 80h ld (privf),a ;store privilege flag pop bc ; end of code for TD-resident CPR ld d,b ;move destination address... ld e,c ;...to de ld hl,uprms movpar: ld bc,128 ldir xor a jr popr ; setpar: ld h,b ld l,c ld de,uprms jr movpar ; gsbk: ld a,l or a jr nz,on ld a,0c9h ld (conin+3),a gsbk1: ld (conin+1eh),a xor a jp popr ; on: ld a,(ci03) ld (conin+3),a ld a,(ci1e) jr gsbk1 ; remc: ld a,l ld (remoff),a jp popr ; reb: di halt ; ; unrestrict a certain user area ; ret with Z = not found, NZ = success ; unrs: ld a,l inc a ld hl,usrtbl ld b,(hl) inc hl ..u: cp (hl) jr z,..us inc hl djnz ..u ld e,0 jp popr ; ..us: ld (hl),0 ld e,0ffh jp popr ; ; command interpreter restriction ; keep caller outta user 0 and whatever ; cmdres:: ld a,(uacl) cp 9 jr z,gocfun ld a,e ;get set/get fcn inc a ;test for set jr z,gocfun ;get user number -- do it push hl ld hl,usrtbl ;point to user # table ld b,(hl) ;get count inc hl ..rl: cp (hl) ;if user # in table... jr z,..rs ;...then restrict inc hl djnz ..rl pop hl gocfun: ld c,32 jp cmdint##+247h ; ..rs: pop hl ret ;restrict = do nothing ; abpr: ld hl,abc inc (hl) jp popr ; ; twix resident process ; twix: call donot ; check and possibly display ld de,60 ; delay 1 second ld c,2 call otntry## ld a,(ulog) cp 77h jr nz,twix ld a,(tomc##) cp 0ffh jr nz,cht ld a,(seccnt) dec a ld (seccnt),a jr nz,twix ld hl,swat call xxot ld de,120 ; delay 2 seconds before doomsday ld c,2 call otntry## di halt ; cht: ld a,wtsecs ld (seccnt),a jr twix ; donot: ld hl,noteon ld a,(hl) inc a ret nz ld (hl),0 inc hl xxot: ld a,(conast##) ld b,a ..l1: ld a,(hl) cp '$' ret z inc hl ld e,2 ld c,a push hl push bc call condra## pop bc pop hl jr ..l1 ; dseg ; usrtbl: db 4 ;number of entries (4) db 1 ;user 0 db 2 ;user 1 db 3 ;user 2 db 32 ;user 31 ds 28 ;room for 32 total ; ci03: db 0 ci1e: db 0 ; remoff::db 0ffh seccnt: db wtsecs swat: db cr,lf,lf,'SWAT!',cr,lf,lf,'$' ; int: db 0 abc:: db 0 ; idlem: db '+++IDLE(8)+++',0 ; timtbl::db 20,10,10,30,60,60,10,10,30,255 ;ACL time ; ACL = 0 1 2 3 4 5 6 7 8 9 ; ; parameter block ; uprms: uacl:: db 0 ;access level ulog:: db 0 ;logged flag uintm:: db 0,0,0,0,0 ;login time/date uusr:: db 0 ;current user udrv: db 0 ;current drive ucurt: db 0,0,0,0,0,0 ;current time (not used here) privf: db 0 ;priv flag (0=nonpr, 80=priv) name: db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;up to 16 chars of name proc: ds 31 ;process noteon::db 0 ;0=empty, ff=64-byte note follows ; ; the following field must be up to 64 char with terminating dollar sign. ; note:: ds 64 end