home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
UTILITYS
/
PUDD.ARC
/
TOOLS3.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-11
|
5KB
|
83 lines
{*************************************************************************}
{********** The following are all procedures to operate the crosshair **}
{*************************************************************************}
procedure xhair(size,mode,centerX,centerY:integer);
var x1,x2,y1,y2:integer; {... same as used in TeleVideo System Reference }
begin
y1 := centerY - size;
if y1 < 0 then y1 := 0;
y2 := centerY + size;
if y2 > 239 then y2 := 239;
x1 := centerX - 2*size;
if x1 < 0 then x1 := 0;
x2 := centerX + 2*size;
if x2 > 639 then x2 := 639;
inline ($21/$00/$FF/ {ld hl,0ff00h put addr of addr in hl }
$5E/ {ld E,(HL) get half of the address }
$23/ {inc HL point to second half }
$56/ {ld D,(HL) get other half }
$EB/ { ex DE,HL switch }
{ ........HL now has the address of the array }
{....now enter the size of the array into the array }
$ED/$5B/centerY/ {ld DE,(nn) get the integer }
$73/ {ld (HL),E put in array }
$23/ {inc HL }
$72/ {ld (HL),D and the high byte }
$23/ {inc HL (it's done in words) }
$ED/$5B/x1/ {ld DE,(nn) get the integer }
$73/ {ld (HL),E put it in array }
$23/ {inc HL }
$72/ {ld (HL),D both parts }
$23/ {inc HL full word }
$ED/$5B/x2/ {ld DE,(nn) get the mode }
$73/ {ld (HL),E put in array }
$23/ {inc HL }
$72/ {ld (HL),D and the high byte }
$23/ {inc HL (it's done in words) }
$ED/$5B/centerX/ {ld DE,(nn) get the integer }
$73/ {ld (HL),E put it in array }
$23/ {inc HL }
$72/ {ld (HL),D both parts }
$23/ {inc HL full word }
$ED/$5B/y1/ {ld DE,(nn) get the mode }
$73/ {ld (HL),E put in array }
$23/ {inc HL }
$72/ {ld (HL),D and the high byte }
$23/ {inc HL (it's done in words) }
$ED/$5B/y2/ {ld DE,(nn) get the integer }
$73/ {ld (HL),E put it in array }
$23/ {inc HL }
$72/ {ld (HL),D both parts }
$2A/mode/ {ld HL,nn get the mode }
$0E/$08/ {ld C,8h get the function }
$EF ); {rst 28h }
end;
procedure movXhair(size,xpoz,ypoz:integer); {........used after init or reInit }
begin
inline($21/$00/$00/ {ld HL,nn get the mode }
$0E/$08/ {ld C,8h get the function }
$EF ); {rst 28h }
xhair(size,1,xpoz,ypoz);
end;
procedure initXhair(size,xpoz,ypoz:integer); {.................. use this first }
begin
xhair(size,0,xpoz,ypoz);
end;
procedure reInitXhair(size,xpoz,ypoz:integer); {.. use after any other graphics }
begin
xhair(size,0,xpoz,ypoz);
xhair(size,1,xpoz,ypoz);
end;
procedure offXhair(size,xpoz,ypoz:integer); {...........turns off the crosshair }
begin
xhair(size,1,xpoz,ypoz);
end;
{*************************************************************************}