home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
TESTBLD
/
TESTBEEL.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1992-12-02
|
8KB
|
228 lines
program testbld; (* TESTBEELD eventuele parameters *)
uses DOS, CRT; (* worden in het testbeeld geschreven. *)
(* M.G.Carasso Johan de Wittlaan 25 *)
(* 5631AP Eindhoven Netherlands *)
type PalBes = array[0..15,0..2] of byte; (* 040-816690 *)
const Scala: PalBes =
(( 0, 0, 0), (* grijsladder, zwart *)
( 9, 9, 9), (* ,, *)
(18, 18, 18), (* ,, *)
(27, 27, 27), (* ,, *)
(36, 36, 36), (* ,, *)
(45, 45, 45), (* ,, *)
(54, 54, 54), (* ,, *)
(63, 63, 63), (* ,, , wit *)
( 0, 63, 0), (* links/groot/boven, 3-e blok *)
(32, 32, 63), (* links/klein/boven *)
( 0, 0, 63), (* rechts/klein/boven, 6-e blok *)
(63, 0, 0), (* cir/mid onder,links/gr/ond 5-e blok *)
(63, 63, 0), (* cirkel/links&rechts onder, 1-e blok *)
( 0, 63, 63), (* rechts/groot/boven, 2-e blok *)
(63, 0, 63), (* rechts/groot/onder, 4-e blok *)
(63, 32, 0)); (* links&rechts/klein/onder *)
var i,j,k: integer;
r2i,r2: longint;
pu: registers;
procedure WriteD(x,y: word; color: byte);
(* snelle scherm procedure rond de BIOS*)
(* om. Gebaseerd op PC en PS/2 VIDEO *)
(* SYSTEMEN. Richard Wilton *)
(* Microsoft Press, Kluwer. *)
(* Listingen 4.4 en 5.4 *)
inline($5E/$58/$5B/$8C/$DA/$52/$8A/$CB/$BA/$50/$00/$F7/$E2/$D1/$EB/$D1/
$EB/$D1/$EB/$03/$D8/$83/$C3/$00/$B8/$00/$A0/$8E/$C0/$80/$E1/$07/
$80/$F1/$07/$B4/$01/$D2/$E4/$BA/$CE/$03/$B0/$08/$EF/$B8/$05/$02/
$EF/$B4/$18/$B0/$03/$EF/$26/$8A/$07/$89/$F0/$26/$88/$07/$B8/$08/
$FF/$EF/$B8/$05/$00/$EF/$B8/$03/$00/$EF/$5A/$8E/$DA);
procedure tekst(i,j: integer; st: string);
begin
pu.ah:=$13;
pu.al:=$01;
pu.bl:=$17;
pu.bh:=$00;
pu.cx:=Length(St);
pu.dl:=i;
pu.dh:=j;
pu.es:=Seg(St[1]);
pu.bp:=Ofs(St[1]);
Intr(16,pu)
end;
procedure SetMode(mode,page: byte; extra: boolean);
begin
pu.ah:=$0; pu.al:=mode; Intr(16,pu);
pu.ah:=$5; pu.al:=page; Intr(16,pu);
if extra then
begin
pu.ah:=$11; pu.al:= $23; pu.bl:=$03; Intr(16,pu)
end
end;
procedure SetBorder(kleur: byte);
begin
pu.ah:=$10; pu.al:=$01; pu.bh:=kleur; Intr(16,pu)
end;
procedure palet(reg,r,g,b: byte);
var pu: registers;
rega: byte;
begin
case reg of
00..05: rega:=reg;
06: rega:=20;
07: rega:=7;
08..15: rega:=reg+48;
else
EXIT
end;
pu.ax:=$1010;
pu.bl:=rega;
pu.bh:=$00;
pu.cl:=b;
pu.ch:=g;
pu.dl:=b;
pu.dh:=r;
Intr($10,pu);
end;
procedure PaletLees;
var j: byte;
begin
for j:=0 to 15 do
Palet(j,scala[j,0],scala[j,1],scala[j,2])
end;
procedure invul;
var naam: string;
x,y: word;
color: byte;
begin
for i:=-306 to 306 do
begin
x:=i + 320;
r2i:=i;
r2i:=r2i*r2i;
for j:=-234 to 234 do
begin
y:=j + 240;
r2:=j;
r2:=r2i+r2*r2;
if r2>46656 then
begin
if ((((j+234) mod 36)=0) OR (((i+306) mod 36)=0)) then
color:=7
else
color:=3;
case i of
-269 .. -235: begin
if ((j>-198) and (j<0 )) then color:=8
else
begin
if ((j<198) and (j>=0 )) then color:=11
end
end;
-234 .. -199: begin
if ((j>-198) and (j<-126)) then color:=9
else
begin
if ((j<198) and (j>126)) then color:=15
end
end;
199 .. 234: begin
if ((j>-198) and (j<-126)) then color:=10
else
begin
if ((j<198) and (j>126)) then color:=15
end
end;
235 .. 269: begin
if ((j>-198) and (j<0 )) then color:=13
else
begin
if ((j<198) and (j>=0 )) then color:=14
end
end;
end
end
else
begin
color:=0;
case j of
-234 .. -199: color:=7;
-198 .. -163: if abs(i)>72 then color:=7 else color:=0;
-162 .. -127: begin
if abs(i)>108 then color:=0 else color:=7;
if ((i>-91) and (i<-86)) then color:=0
end;
-126 .. -91: if ((i+225) mod 50)<25 then color:=0 else color:=5;
-90 .. -18: case i of
-234 .. -145: color:= 12;
-144 .. - 75: color:= 13;
-74 .. 0: color:= 8;
1 .. 74: color:= 14;
75 .. 144: color:= 11;
145 .. 234: color:= 10;
end;
-13 .. 13: if ((j=0) or (((i+198) mod 36)=0)) then color:=7;
18 .. 90: case i of
-234 .. -180: color:=0;
-179 .. -108: if(((i+180) mod 18)>8) then color:=0
else color:=7;
-107 .. -36: if(((i+108) mod 10)>4) then color:=0
else color:=7;
-35 .. 36: if(((i+ 36) mod 6)>2) then color:=0
else color:=7;
37 .. 108: if(((i -37) mod 4)>1) then color:=0
else color:=7;
109 .. 180: if(((i-109) mod 2)>0) then color:=0
else color:=7;
181 .. 234: color:=0;
end;
91 .. 126: if i<-180 then color:=0
else begin
if i>179 then color:=7
else color:=((i+180) div 45)
end;
127 .. 162: if abs(i)>108 then color:=7 else color:=0;
else
begin
if j>90 then color:=12 else color:=0;
if abs(i)<18 then color:=11
end
end
end;
if ((abs(j)<54) and (abs(i)<18)) then
begin
color:=0;
if i=0 then color:=7
end;
WriteD(x,y,color)
end
end;
tekst(31,7,' SOUNDBASE Tm. ');
tekst(28,47,' ');
TEKST(28,48,' NEDERLAND 1 ');
naam:='';
if ParamCount>0 then
begin
for i:=1 to ParamCount do naam:=concat(naam,' ',ParamStr(i));
delete(naam,1,1);
tekst(40-(length(naam) div 2),48,naam)
end
end;
begin
SetMode(18,0,true);
PaletLees;
SetBorder(2);
invul;
repeat until KeyPressed;
SetMode(3,0,false);
end.