segment drivers; const {$I iso.cst} {$I soft.cst} cnorm = 'q'; cinv = 'p'; cunder = 'r'; cxunder = 'u'; xesc = 27; type {$I pcw.typ} {$I iso.typ} {$I soft.typ} scrf = ARRAY[0..80, 0..25] of byte; var zcol, zrow: byte; nat, sin, sout: text; cesc, curr_s: char; curr_f : boolean; scr : scrf; high : highlight; FUNCTION cstat: boolean; external; FUNCTION memavail: integer; external; FUNCTION auxit: byte; external; FUNCTION auxic: byte; external; FUNCTION auxot: byte; external; PROCEDURE auxoc(n: byte); external; {$CONTINUE WITH MDRV:Z.EXT RETURN} {$CONTINUE WITH MDRV:ZK.EXT RETURN} {$CONTINUE WITH MDRV:ZL.EXT RETURN} {$CONTINUE WITH MDRV:ZS.EXT RETURN} function ZLRDY: boolean; begin if auxot = 0 then zlrdy := false else zlrdy := true; end; procedure ZLPUT(c:character); begin auxoc(c); end; procedure ZSWAIT(n: integer); var i, j: integer; begin for i := 1 to n do j := i; end; procedure ZLBRK ; begin end; procedure ZSPUT(i: byte); begin write(chr(i)); scr[zcol, zrow] := i; zcol := zcol+1; end; function ZSCOL: byte; begin zscol := zcol; end; procedure ZSUPDT(b: boolean); begin end; function ZKDATA: boolean ; VAR c : char; begin zkdata := cstat; end; function ZKGET : character; var key: char; s: string[4]; begin REPEAT if eoln(nat) then begin key := chr(13); readln(nat); {clear eol flag} END ELSE read(nat, key); UNTIL ord(key) > 0; s := 'a'; if ord(key) = 3 then s := copy(s, 1, 4); zkget := ord(key); end; function zsrow: byte; begin zsrow := zrow; end; procedure ZSGOXY(col, row: byte); begin write(chr(1bh), 'Y', chr(row+20h), chr(col+20h)); zcol := col; zrow := row; if zcol > 79 then zcol := 79; if zrow > 24 then zrow := 24; end; procedure ZSWIN (left, right, top, bottom: byte); begin write(cesc, 'X', chr(32+top), chr(32+left), chr(32+bottom-top), chr(32+right-left), cesc, 'Y', chr(zrow+20h), chr(zcol+20h)); end; procedure ZSERAL; begin write(cesc, 'K'); end; function ZSSETG (i: byte): boolean; var c1, c2: char; b : boolean; begin case i of { ISO Graphics rendition codes } DEFAULTREND: c2 := cnorm; BOLD : c2 := ' '; FAINT : c2 := ' '; ITALICISED : c2 := ' '; UNDERSCORED: c2 := cunder; {can do!} SLOWBLINK: c2 := ' '; RAPIDBLINK: c2 := ' '; NEGATIVEIMAGE:c2 := cinv; CONCEALED: c2 := ' '; CROSSEDOUT: c2 := ' '; end; if c2 <> ' ' then begin b := true; write(cesc, c2); if c2 = cnorm then write(cesc, cxunder); high := i; end else b := false; zssetg := b; end; procedure ZSCLR ; begin write(chr(1bH)); write('E'); zsgoxy(0, 1); end; function ZKSETK (i,j: byte): boolean; begin zksetk := true; end; function ZLSPD (i,j:word; b:boolean): boolean; begin {set the line transmit rate} zlspd := b; end; procedure ZSTITL(title: string80); begin zsgoxy(0, 0); write(title); end; procedure zsinfo(display : boolean; col : byte; s : string10); begin zsgoxy(col, 0); write(s); end; procedure ZDESC (VAR stitle: string10); begin stitle := 'AmstradPCW'; end; procedure ZSBELL ; begin write(chr(7)); end; procedure ZSINIT ; begin zsclr; assign(nat, 'KBD:'); reset(nat); {scr_inv := concat(chr(1bh), 'p');} {scr_nor := concat(chr(1bh), 'q'); } {set screen into inverse and normal} zrow := 0; zcol := 0; cesc := chr(xesc); zsgoxy(0,27); write(memavail); zswait(1000); high := DEFAULTREND; end; procedure ZKINIT; begin end; procedure ZLINIT ; begin curr_f := false; curr_s := '?'; end; procedure ZLEND ; begin end; procedure ZKEND ; begin end; procedure ZSEND ; begin write(cesc, 'y'); end; procedure ZLXCTL (n: boolean); var i: byte; begin write(chr(7)); {should be put xon-xoff on and off!} end; function ZLDATA : boolean; begin if auxit = 0 then zldata := false else zldata := true; end; function ZLGET : character; begin zlget := auxic; end; function ZSGET(col, row : word) : byte; begin ZSGET := scr[row, col]; end; procedure ZSFLSH(b:boolean; i:word); begin end; function KBREAK: character; begin kbreak := 141; end; procedure ZSUPSC(n: word); VAR i : byte; begin {scroll window up n lines} for i := 1 to n do writeln; end; function ZSGSET: highlight; begin zsgset := high; end; procedure ZSDNSC( n : word); var i : byte; begin for i := 1 to n do write(cesc, 'L'); end; procedure ZSINS(n : word); var i : byte; begin {insert n spaces in the line} for i := 1 to n do write(' '); end; procedure ZSDEL(i : word); begin write(cesc, 'N'); end; begin end.