home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_PAS
/
XLIB_TP5.ZIP
/
DEMO
/
PAL_DEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-12-19
|
2KB
|
96 lines
(* All these Compiler-directives make the EXE smaler , but the error would
be more invisible . *)
{$D-,Y-,R-,S-,O-}
uses X_Const,X_Main,X_Text,X_Keys,crt,X_Mouse,X_Pal,X_Bitmap;
(* Make a BackGround with insive help of palettenrotate. *)
type Trippel = Array[0..2] of Byte;
var Bild:Array[0..14,0..14] of Trippel;
Pal:Palette;
i,j,l,k:Integer;
x,y:Integer;
R:Word;
SinF,CosF:Array[0..359] of Byte;
Pbm_Bild:Array[0..241] of Byte;
begin;
for r:=0 to 359 do
begin;
SinF[r]:=trunc(sin(r*Pi/180)*50)+100;
CosF[r]:=trunc(cos(r*Pi/180)*50)+100;
end;
fillchar(Pal,256*3,0);
(* create some Gray-colors for Text *)
for j:=250 to 255 do fillchar(Pal[j],3,(j-250)*12);
x:=0;y:=0;r:=0;
(* Init Bild True-Color Pictures ! *)
for i:=0 to 14 do
for j:=0 to 14 do
begin;
Bild[i,j][0]:=0;
Bild[i,j][1]:=0;
Bild[i,j][2]:=63-trunc(4*sqrt((7.5-i)*(7.5-i)+(7.5-j)*(7.5-j)));
end;
(* Init Mode X *)
x_set_mode(3,380);
x_text_init;
(* create Sprite *)
for i:=0 to 14 do for j:=0 to 14 do
Pbm_Bild[2+((i mod 4)*60+i div 4)+j*4]:=i+j*15+1;
Pbm_Bild[0]:=4;
Pbm_Bild[1]:=15;
(* fill screen with sprite *)
for l:=0 to 22 do for k:=0 to 15 do x_put_pbm(l*15,k*15,Pbm_Bild);
x_set_font(1);x_put_pal_raw(Pal,256,0,false);
for i:=1 to 7 do for j:=2 to 10 do
E_Write(i*x_Length('Moin '),j*x_font_height,255,253,'Moin ');
X_Write(10,GetMaxY-x_font_height,255,'German >Hallo<');
repeat
r:=r+1;
if r>359 then r:=0;
x:=sinF[r];
y:=cosF[r];
for i:=0 to 225 do
begin;
asm
mov ax,i
mov bl,15
div bl
mov cl,al (* cl = i div 15 *)
mov al,ah
xor ah,ah
add ax,x
div bl
mov Byte(l),ah (* l:=(x+(i mod 15)) mod 15; *)
mov al,cl
xor ah,ah
add ax,y
div bl
mov Byte(k),ah (* k:=((i div 15)+y)mod 15; *)
end;
move(Bild[l,k],Pal[i+1,0],3);
end;
WaitVsyncStart;
x_put_pal_raw(Pal,226,0,false);
until keyspressed;
x_Pal2Dark(Pal);
x_text_mode;
Clear_Buffer;
end.