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
/
TOOLS1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-11
|
7KB
|
141 lines
{*************************************************************************}
procedure charcolor(style:integer); {..select color of charactors to use}
{.....................................style=0 is black, style=1 is white }
begin
inline($0E/$0D/ {ld c,13 select function }
$2A/style/ {ld hl,(nn) select style }
$EF ); {rst 28h go for it }
end;
{*************************************************************************}
{*************************************************************************}
procedure CharGraph(message : screenline); {..write on the graphics screen}
{ This produces a charactor string on the screen beginning at the }
{ current curser position and in the current charcolor. The position }
{ of the curser is not up dated. Use charcolor (charactor color) of }
{ white when writing on a dark background }
var long:integer;
byte:char;
counter:integer;
register:integer;
begin
long := length(message);
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/long/ {ld DE,(nn) get the size }
$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) }
$22/register ); {ld (nn),HL save the register }
for counter := 1 to long do
begin
byte := copy(message,counter,1);
inline (
$2A/register/ {ld HL,(nn) get the register }
$3A/byte/ {ld A,(nn) get the byte }
$77/ {ld (HL),A put it in array }
$23/ {inc HL }
$23/ {inc HL full word }
$22/register ); {ld (nn),HL save the register }
end;
inline ($0E/$06/ {ld C,6 select function }
$EF ); {rst 28h call }
end;
{*************************************************************************}
{*************************************************************************}
procedure initgraph; {.........................initalize graphics }
begin
inline ( $0E/$01/ { LD C,1 ;initialize graphics mode }
$EF ); { RST 28H }
end;
{*************************************************************************}
{*************************************************************************}
procedure cleargraph; {.......................clear grapics screen }
begin
inline ( $0E/$02/ { LD C,2 ;clear the graphic screen }
$EF ); { RST 28H }
end;
{*************************************************************************}
{*************************************************************************}
procedure setline(style:integer); {................set the line style}
begin
inline ( $0E/$0B/ { LD C,11 ;set the line style }
$2A/style/ { LD HL,style ;refer below for styles }
$EF ); { RST 28H }
{.........................................................................
The line style refered to here has eight types..
style := 1 solid lines are drawn
style := 2 dashed lines are drawn
style := 3 dotted lines are drawn
style := 4 lines are dash-dot
style := 5 lines are long-dash
style := 6 lines are short-dash
style := 7 lines are dot-dot-dash
style := 8 lines are long-dot
..........................................................................}
end;
{*************************************************************************}
{*************************************************************************}
procedure linecolor(color:integer); {..........switch visible/invisible }
begin
inline ( $0E/$0C/ { LD C,12 ;set line color }
$2A/color/ { LD HL,color ; 1 = white 0 = black }
$EF ); { RST 28H }
end;
{*************************************************************************}
{*************************************************************************}
procedure writemode(mode:integer); {....set logical mode for writing }
begin
inline ( $0E/$0E/ { LD C,14 ;set write mode }
$2A/mode/ { LD HL,mode ;refer below for logic }
$EF ); { RST 28H }
{.........................................................................
There are two ways of understanding this stuff, people with flip/flops for
brain cells may look to the left, everyone else can look to the right...
1) replace writing = color choosen and style
2) logical (or) writing = both color or style, fills in overlapping holes
3) (xor) writing = exclusively color or style
4) (not) writes where you tell it not to write
ie: white = black, black = white
5) compliment then replace
6) compliment then logical (or)
7) compliment then exclusive or (xor)
8) compliment then not
To compliment is to reverse the logic. This gets
a little messy to think about. If you want to understand
it you had best talk to an assembly language hacker.
Trying to understand by just playing around with modes
3,5,6,7, and 8 will probably just lead to increased
confusion. Keeping with mode #1 will lead to the
results you would normally expect.
..........................................................................}
end;
{*************************************************************************}