




/*
procedure InitCharEffect2();
begin
	vscroll:=250;
	setscreenlocation($1000);
	setcharsetlocation($1400);
	decrunch(wavesetc);
	memcpy(^$1400,0,^$0400, 8*8);
	memcpy(^$1400+^64,0,^$0400+^64, 8*8);
	decrunch(charsetc);
	


	memcpy(^$0400,0,^$1400+^$80*^8, 8*8);
	memcpy(^$0400+^64,0,^$1400+^64+^$80*^8, 8*8);

	//animShift:=128;
	ignoreColor:=0;
	dy:=23;
	dx:=22;
	SCREEN_TEXT_HEIGHT:=dy*2;
	SCREEN_TEXT_WIDTH:=dx;
	fill(^$9400,BLACK,0);
	fill(^$9500,BLACK,0);
	SCREEN_BG_COLOR:=PURPLE*16 + PURPLE+8;
//	RenderChars();
	RenderCharEffectBackground2();



	dx:=1;
//	InitCharset();

	textP:=textCredits;
	scroll:=10;
end;
*/
procedure InitSineEffect();
begin
	setscreenlocation($1000);
	setcharsetlocation($1400);
	fill(^$9400,BLACK,0);
	fill(^$9500,BLACK,0);
	SCREEN_TEXT_WIDTH:=0;
	zp:=$1400;
	for i:=0 to 255 do begin
		for j:=0 to 4 do zp[2*j]:=%10101010;
		for j:=0 to 4 do zp[2*j+1]:=%01010101;
		zp:=zp+8;
	end;
	memcpy(^$1400,0,^$1500,0);
	for i:=0 to 0 do begin
		j:=sine[i]/32+1;
		poke(^@table2, i, j);
	end;
	upper:=timeStamps[currentPos+2];
	lower:=timeStamps[currentPos+3];

	b:=100;
	aa:=98;

	if (PAL_OR_NTSC[0]<>12) then 
	begin
		b:=90;
		aa:=88;
	end;

end;


procedure RenderSineEffect();
begin
	SCREEN_BG_COLOR:=upper;
	if (transition=0) then begin
		if (aa<>0) then aa:=aa-2;
	end
	else
	begin
		if (b<>0) then 
			b:=b-2; 

	end;

	k:=time*2;
	l:=32+aa;
	n:=0-time*3;
	if (b<>aa) then 
	for i:=aa to b do begin
		k:=k+7;
		n:=n+11;
		val:=peek(^@table2,k)+peek(^@table2,n);
		waitforraster(l);
		SCREEN_BG_COLOR:=bcolors[val/2];
		SCREEN_TEXT_WIDTH:=val;
		
		inc(l);
	end;
	SCREEN_BG_COLOR:=lower;

end;


/*procedure RenderCharEffect2();
begin
	vscroll:=vscrollTarget;


	RightBitShift(^$1400,8);
	RightBitShift(^$1400+^40*^8,8);

end;

*/