- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
procedure WriteCharXY(_bx,by:integer; ch:char; tcol:word);
var buf:array[1..18,1..12] of word;
XOfs:longint;
x,y,px,py:integer;
begin
XOfs:=GetCharOffset(ch);
if xofs=0 then fillchar(buf,sizeof(buf),200) else
fromXMS(XOfs,addr(buf),432);
for y:=1 to 18 do
for x:=1 to 12 do begin
if buf[y,x]=0 then begin
   px:=_bx+x; py:=by+y;
   asm
   mov   bx,px;  add   bx,actviewport.x1;  cmp   bx,fillviewport.x1;
   jl    @end;  cmp   bx,fillviewport.x2; jg    @end;
   mov   cx,currentmode.scanline;  cmp   bx,cx;  jnb   @end;
   mov   ax,py;  add   ax,actviewport.y1;  cmp   ax,fillviewport.y1;
   jl    @end;  cmp   ax,fillviewport.y2;  jg    @end;
   add   ax,pageadd;  mul   cx;  add   bx,bx;
   add   ax,bx;  adc   dx,0;  mov   si,ax;
   cmp   dx,lastbank;  je    @next;  push  dx;
   call  nearsetbank2;  @next:  mov   es,[currentmode.writeptr];
   mov   ax,tcol;  {cmp   writemode,0;  jne   @doxor;}
   mov   es:[si],ax;  {jmp   @end;  @doxor: xor   es:[si],ax;}  @end:
   end;
end;
end;
end;
procedure WriteStringXY(x,y,maxx:integer; s:string; col:word);
var tx,ty:integer; i:word;
begin tx:=x; ty:=y;
for i:=0 to length(s) do begin
writecharXY(tx,ty,s[i],col);
inc(tx,GetCharWidth(s[i]));
if (tx>=maxx) and (s[i]=' ') then begin inc(ty,18); tx:=x; end;
end;
end;
procedure Write5Strings(x,y,maxx:integer; col:word; s1,s2,s3,s4,s5:string;
letterdelay:byte);
var tx,ty:integer; t,i:word;
st:array[1..5] of string;
begin tx:=x; ty:=y;
st[1]:=s1; st[2]:=s2; st[3]:=s3; st[4]:=s4; st[5]:=s5;
for t:=1 to 5 do begin
if length(st[t])=0 then exit;
   for i:=1 to length(st[t]) do begin
   writecharXY(tx,ty,st[t][i],col);
   if letterdelay>0 then pdel(letterdelay);
   inc(tx,GetCharWidth(st[t][i]));
   if (tx>=maxx-100) and (st[t][i]=' ') then begin
   inc(ty,18); tx:=x; end;
   end;
end;
end;