{Display a tif file, for portfolio, uses turbo6.0 by G.W.Rutten, 06 mar 1998 Boekel. Note : The TIF file must be stored in B/W in UNCOMPRESSED format!! Test on PC if constant portfolio = false, and on portfolio if constant portfolio = true; } uses dos; var F:file; i,lines,bytesinline,tag,typ,number_of_fields,block,ofset, start,aantal_blocks:integer; c:char; videoadres,byteorder,version:word; bytesinscanline,adres,startadres,width,height,ifdoffset,count,offset:longint; data:byte; name:string; x,y,shiftx,shifty:integer; const portfolio=true; var regs:registers; stop:boolean; FUNCTION ReadKey : char; VAR reg : registers; BEGIN {wait until key is pressed} reg.ah := 7; Intr($21,reg); ReadKey := chr(reg.al); end; procedure textmode; begin regs.ax:=7; intr($10,regs); end; procedure refresh; const lcddata=$8010; lcdcontrol=$8011; var i:integer; source:byte; begin if not portfolio then exit; {refresh the pofo lcd screen} { this is the official but sloooooow routine regs.bx:=0; regs.ax:=$1200; intr($61,regs); } port[lcdcontrol]:=10; port[lcddata]:=0; port[lcdcontrol]:=11; port[lcddata]:=0; port[lcdcontrol]:=12; for i:=0 to 1920 do begin source:=mem[$b000:i]; asm mov al,source shr al,1 rcl ah,1 shr al,1 rcl ah,1 shr al,1 rcl ah,1 shr al,1 rcl ah,1 shr al,1 rcl ah,1 shr al,1 rcl ah,1 shr al,1 rcl ah,1 shr al,1 rcl ah,1 not ah mov source,ah end; port[lcddata]:=source; end; end; procedure hires; begin regs.ax:=$0000; if portfolio then intr($61,regs); {initiliaze int 61} regs.bx:=0; regs.ax:=$0006; intr($10,regs); end; begin if paramstr(1) ='' then name:='portlogo.tif' else name:=paramstr(1); assign(f,name); reset(f,1); blockread(f,byteorder,2); blockread(f,version,2); blockread(f,ifdoffset,4); seek(f,ifdoffset); blockread(f,number_of_fields,2); for i:=1 to number_of_fields do begin blockread(f,tag,2); blockread(f,typ,2); blockread(f,count,4); blockread(f,offset,4); case tag of 256:width:=offset; 257:height:=offset; 273:start:=offset; end; {case} end; {now the data can be displayed} if portfolio then begin videoadres:=$b000; bytesinline:=30; lines:=64; end else begin videoadres:=$b800; bytesinline:=80; lines:=100; end; hires; shiftx:=0; shifty:=0; stop:=false; seek(f,start); blockread(f,startadres,4); bytesinscanline:=1+(width div 8); repeat {now display lines of data on screen} adres:=startadres+shiftx+(bytesinscanline)* (shifty); for y:=0 to lines-1 do begin {put the filepointer on the 1st data byte to display} seek(f,adres); adres:=adres+bytesinscanline; {move of data to video memory} blockread(f,mem[videoadres:y*bytesinline],bytesinline); end; refresh; {now read cursor keys and prepare for scroll} c:=readkey; if ord(c)=27 then c:=readkey; case ord(c) of 75:if shiftx >=1 then shiftx:=shiftx-1; 77:if shiftx*8 <= (width-(240)) then shiftx:=shiftx+1; 72:if shifty <= (height-72) then shifty:=shifty+8; 80:if shifty >=8 then shifty:=shifty-8; 27:stop:=true; end; until stop; close(f); textmode; end.