home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PARADIS1
/
VIDTRIK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-01-30
|
2KB
|
70 lines
(10734) Tue 18 Jun 91 22:59
By: Sten Kalenda
To: Jan Feijes
Re: Different video segment trick
St:
---------------------------------------------------------------------------
@MSGID: 2:512/29.999 285ed6ac
In a message to All <14 Jun 91 17:36> Jan Feijes wrote:
JF> Hello "All",
JF> When you want to make programs desqview aware you should use a
JF> different vedeo segement. (Anyway different than $B800 or $B000
JF> (for medieval hercules users))
JF> Is there a way to trick turbo pascal, for example by means of
Yes, there is. Try the following code:
type
t_video = array[1..25,1..80] of record c : char; a : byte; end;
var
Cur_vm : byte absolute $0040:$0049; { Current Video mode }
scr : ^t_video;
DesqView: boolean;
Function ksMakeFarPtr(Seg,Ofs : word ) : pointer;
begin
inline($8B/$46/$08/ { MOV AX,[BP+8] ; get seg from stack }
$89/$46/$FE/ { MOV [BP-2],AX ; and move it to pointer }
$8B/$46/$06/ { MOV AX,[BP+6] ; get offset from stack }
$89/$46/$FC); { MOV [BP-4],AX ; and move it to pointer }
end;
procedure ChkVideo;
var regs : registers;
begin
with regs do begin { Under DesqView?}
AX:=$2B01;
CH:=Ord('D');
CL:=Ord('E');
DH:=Ord('S');
DL:=Ord('Q');
Intr($21,regs);
if AL <> $FF then begin { YO! so behave..}
DesqView:=true;
if cur_vm = 7 then AX:=$B000
else AX:=$B800;
ES:=AX; { and get the... }
DI:=0; { DV screen Adr. }
AH:=$FE; { pointer and... }
Intr($10,regs);
scr:=ksMakeFarPtr(ES,DI); { set DV videoAdr}
end
else begin
DesqView:=false;
if cur_vm = 7 then scr:=ksMakeFarPtr($B000,0000) { herc.B000:0000}
else scr:=ksMakeFarPtr($B800,0000); { else B800:0000}
end;
end;
ScrBase:=Seg(scr^);
end; { ChkVideo }
The code is untested but should work fine.
ByBy and gegroet,
S10
--- XRS! 4.00
* Origin: **** This is a QMX-user from RCC-BBS node 512/29 (RAX 2:512/29.999)
@PATH: 30027/999 512/29 39 0 1007