; Support library for LOGIN and LOGOUT. ; .z80 ; tdos equ 50h ; cseg ; ; hang up ; fnhalt:: ld c,28 ;signal end of print call tdos ld c,14 ;play it safe - log off ld de,0ffffh call tdos ld c,17 ;enable autoload ld e,0ffh call tdos ld hl,0 ;do some waiting ld b,8 fnhl: dec hl ld a,h or l jr nz,fnhl djnz fnhl ld c,39 ;drop DTR (let cd routine handle reboot) ld e,0 ld d,e call tdos rst 0 ;(if we get that far) ; ; put info away (store login time in DRI format and acl) ; entered with HL=access level ; fnputi::ld hl,80h zerl: ld (hl),0 inc l jr nz,zerl ld de,80h ;set DMA address to 80H ld c,26 call 5 ld de,82h ld c,105 ;get current time call 5 ld (86h),a pop hl ex (sp),hl ld a,(hl) and 7fh ld d,a inc hl ld e,(hl) inc hl ;point to acl ld a,(hl) inc hl and 0fh ld (80h),a ld a,77h ;flag byte ld (81h),a ld bc,90h ;save area=16 bytes 90h..9fh svlp: ld a,(hl) ld (bc),a inc hl inc bc dec de ld a,d ;see if string end or e jr z,svdn ;yes - done ld a,c cp 9fh jr nz,svlp svdn: xor a fllp: ld (bc),a inc c jr nz,fllp ld bc,41 ;execute save parameter call ld h,90h jp tdos ; ; check if already logged ; fnchk:: ld bc,41 ld h,91h call tdos ld hl,0 ld a,(81h) ld l,a ret ; ; trap abort attempts ; fnsup:: ld c,8 ld de,retn call tdos retn: ret ; ; write string @HL to status line ; fnstat:: pop hl ex (sp),hl ld a,h or l ret z ld e,27 ;ESC ; for ATL-004 call putc ld e,';' call putc ld a,(hl) inc hl and 7fh ld d,a ld e,(hl) loop: push de inc hl ld e,(hl) call putc pop de dec de ld a,d or e jr nz,loop ld e,1dh ;GS code (end of message) call putc ld e,27 ;enable cpu message line call putc ld e,'1' ;ESC 1 for ATL-004 putc: push hl ld c,36 ld d,1 call tdos pop hl ret ; ; purge modem buffer ; fnpurg:: ld c,34 ld d,0 call tdos or a ret z ld c,35 ld d,0 call tdos jp fnpurg ; ; get console # ; fncons:: ld c,12 call 5 ex de,hl ld h,0 ret ; ; get baud rate code ; fnbaud:: ld c,38 ld d,0 ;modem channel call tdos and 0fh ld l,a ld h,0 ret ; ; chain to CBBS ; fncbbs:: ld de,cbbs chn: ld c,18 call tdos rst 0 ; cbbs: db 10,'\RBBS',0 ; ; chain to user area ; fnulog:: ld a,l LD C,'0'-1 ;(ASCII 0)-1 DECLP: INC C SUB 10 JR NC,DECLP ADD A,10+'0' ;make A units (tens in C) ld (uu),a LD A,C ;get tens ld (ut),a ld de,ulog jr chn ; ulog: db 4 ut: db '0' uu: db '5' db 'A:' end