Exemplo n.º 1
0
screenin(char (* pic)[160], char *text)
	{
	int	a,x,y,yy,v;

	tw_setsplit(400);
	tw_clrscr();
	tw_setstart(160*200);
	dis_waitb();
	tw_setpalette(&pic[0][16]);
	pic=&pic[0][784];

	y=16;while(*(text=prtc(160,y,text))) y+=FONAY+10;

	for(x=0;x<160;x++) for(y=0;y<100;y++) tw_putpixel(400+x,400+y*2,pic[y][x]+16);

	for(y=200*128;y>0;y=y*12L/13)
		{
		dis_waitb();
		tw_setsplit(y/128+200);
		yy=320-y/80;
		for(a=0;a<10000;a++);
		tw_setstart(160*200+(yy/4));
		asm	{
			mov	dx, 0x3c0
			mov	al, 0x33
			out	dx, al
			mov	ax, yy
			and	ax, 3
			shl	ax, 1
			out	dx, al
			}
		}

	for(a=0;a<200 && !dis_exit();a++) dis_waitb();

	for(y=0,v=0;y<128*200;y=y+v,v+=15)
		{
		dis_waitb();
		tw_setsplit(y/128+200);
		yy=320+y/80;
		for(a=0;a<10000;a++);
		tw_setstart(160*200+(yy/4));
		asm	{
			mov	dx, 0x3c0
			mov	al, 0x33
			out	dx, al
			mov	ax, yy
			and	ax, 3
			shl	ax, 1
			out	dx, al
			}
		}
	}
Exemplo n.º 2
0
main()
	{
	int	aa,b,c,x,y,f;

	asm	mov	ax, 3
	asm	int	10h

	init();


	while(dis_sync()<1 && !dis_exit());

	prtc(160,120,"A");
	prtc(160,160,"Future Crew");
	prtc(160,200,"Production");
	dofade(fade1,fade2); wait(300); dofade(fade2,fade1); fonapois();

	while(dis_sync()<2 && !dis_exit());

	prtc(160,160,"First Presented");
	prtc(160,200,"at Assembly 93");
	dofade(fade1,fade2); wait(300); dofade(fade2,fade1); fonapois();

	while(dis_sync()<3 && !dis_exit());

	prtc(160,120,"in");
	prtc(160,160,"�");
	prtc(160,179,"�");
	dofade(fade1,fade2); wait(300); dofade(fade2,fade1); fonapois();

	while(dis_sync()<4 && !dis_exit());

	memcpy(fadepal,fade1,768);
	cop_fadepal=picin;
	cop_dofade=128;
	for(a=1,p=1,f=0,frame_count=0;cop_dofade!=0 && !dis_exit();)
		do_scroll(2);

	for(f=60;a<320 && !dis_exit();)
		{
		if(f==0) {
			cop_fadepal=textin;
			cop_dofade=64;
			f+=20;
			}
		else if(f==50) {
			cop_fadepal=textout;
			cop_dofade=64;
			f++;
			}
		else if(f>50 && cop_dofade==0) {
			cop_pal=palette; do_pal=1; f++;
			memset(tbuf,0,186*320);
			switch(tptr++) {
			case 0:
				addtext(160,50,"Graphics");
				addtext(160,90,"Marvel");
				addtext(160,130,"Pixel");	// sucks
				ffonapois();
				break;
			case 1:
				faddtext(160,50,"Music");
				faddtext(160,90,  "Purple Motion");
				faddtext(160,130, "Skaven");
				ffonapois();
				break;
			case 2:
				faddtext(160,30,"Code");
				faddtext(160,70,  "Psi");
				faddtext(160,110, "Trug");
				faddtext(160,148, "Wildfire");
				ffonapois();
				break;
			case 3:
				faddtext(160,50,"Additional Design");
				faddtext(160,90, "Abyss");
//				faddtext(160,110,"Useless Design");
				faddtext(160,130, "Gore");
				ffonapois();
				break;
			case 4:
				ffonapois();
				break;
			default:
				faddtext(160,80, "BUG BUG BUG");
				faddtext(160,130, "Timing error");
				ffonapois();
				break;
				}
			while(((a&1) || dis_sync()<4+tptr) && !dis_exit() && a<319)
				do_scroll(0);
			aa=a;
			if(aa<320-12) fmaketext(aa+16);
			f=0;
			}
		else	f++;
		do_scroll(1);
		}
	if(f>63/SCRLF){
		dofade(palette2,palette);
		}
	fonapois();
	close_copper();
	}
Exemplo n.º 3
0
main()
{
	int	a,b,x,y;
	int	zimz;
	initvideo();
	readp(palette,-1,hzpic);
	for(y=0;y<256;y++)
	{
		readp(rowbuf,y,hzpic);
		lineblit(y+64,rowbuf);
	}
	for(y=0;y<32;y++)
	{
		readp(font[y],y+300,hzpic);
		for(a=0;a<640;a++) 	
		{
			switch(font[y][a])
			{
			case 0x40 : b=0xc0; break;
			case 0x41 : b=0x80; break;
			case 0x42 : b=0x40; break;
			default : b=0;
			} 
			font[y][a]=b;
		}
	}
	for(y=0;y<768;y+=3)
	{
		if(y<64*3) ;
		else if(y<128*3) 
		{
			palette2[y+0]=palette[0x42*3+0];
			palette2[y+1]=palette[0x42*3+1];
			palette2[y+2]=palette[0x42*3+2];
		}
		else if(y<192*3) 
		{
			palette2[y+0]=palette[0x41*3+0];
			palette2[y+1]=palette[0x41*3+1];
			palette2[y+2]=palette[0x41*3+2];
		}
		else
		{
			palette2[y+0]=palette[0x40*3+0];
			palette2[y+1]=palette[0x40*3+1];
			palette2[y+2]=palette[0x40*3+2];
		}
	}
	for(y=192;y<768;y++)
	{
		palette[y]=palette[y-192];
	}
	for(x=0;x<64;x++)
	{
		for(y=0;y<576;y++)
		{
			fade1[x][y]=(palette2[y+192]*x+palette[y+192]*(63-x))/63;
			fade2[x][y]=(palette2[y+192]*x)/63;
		}
	}

	for(x=0;x<640 && *fonaorder;)
	{
		while(x<640)
		{
			for(y=0;y<32;y++) if(font[y][x]) break;
			if(y!=32) break;
			x++;
		}
		b=x;
		while(x<640)
		{
			for(y=0;y<32;y++) if(font[y][x]) break;
			if(y==32) break;
			x++;
		}
		//printf("%c: %i %i\n",*fonaorder,b,x-b);
		fonap[*fonaorder]=b;
		fonaw[*fonaorder]=x-b;
		fonaorder++;
	}
	fonap[32]=640-20;
	fonaw[32]=16;
	setpalarea(fade2[0],64,192);

	for(;;)
	{	
		prtc(160,140,"A");
		prtc(160,180,"Future Crew");
		prtc(160,220,"production");
		dofade2(300);
		if(kbhit()) break;
	
		prtc(160,140,"First presented at");
		prtc(160,220,"Assembly NoNumbers");
		dofade2(300);
		if(kbhit()) break;
		
		dofadef();
		if(kbhit()) break;
	
		prtc(100,140,"Graphics");
		prtc(100,200,"Pixel");
		prtc(100,240,"Marvel");
		dofade(300);
		if(kbhit()) break;
	
		prtc(100,140,"Music");
		prtc(100,200,"Purple Motioon");
		prtc(100,240,"Skaven");
		dofade(300);
		if(kbhit()) break;
	
		prtc(100,140,"Code");
		prtc(100,200,"Trug");
		prtc(100,240,"Wildfire");
		prtc(100,280,"Psi");
		dofade(300);
		if(kbhit()) break;
	}
	getch();
	deinitvideo();
}
Exemplo n.º 4
0
/* driver to test cpoly */
int main()
{
  int fail;
  double p[50],pi[50],zr[50],zi[50];

  int i;

  printf("Example 1.  polynomial with zeros 1,2,...,10.\n");
  p[0]=1L;
  p[1]=-55L;
  p[2]=1320L;
  p[3]=-18150L;
  p[4]=157773L;
  p[5]=-902055L;
  p[6] = 3416930L;
  p[7]=-8409500L;
  p[8]=12753576L;
  p[9]=-10628640L;
  p[10]=3628800L;
  for (i=0;i<11;i++)
    pi[i]=0;
  prtc(11,p,pi);
  fail = cpoly(p,pi,10,zr,zi);
  if(fail)
    printf("cpoly has failed on this example\n");
  prtz (10,zr,zi);
  printf("Example 2. zeros on imaginary axis degree 3.\n");
  p[0]=1;
  p[1]=0;
  p[2]=-10001.0001L;
  p[3]=0;
  pi[0]=0;
  pi[1]=-10001.0001L;
  pi[2]=0;
  pi[3]=1;
  prtc(4,p,pi);
  fail = cpoly(p,pi,3,zr,zi);
  if (fail) 
    printf("cpoly has failed on this example\n");
  prtz(3,zr,zi);
  printf("Example 3. zeros at 1+i,1/2*(1+i)....1/(2**-9)*(1+i)\n");
  p[0]=1.0;
  p[1]=-1.998046875L;
  p[2]=0.0;
  p[3]=.7567065954208374L;
  p[4]=-.2002119533717632L;
  p[5]=1.271507365163416e-2L;
  p[6]=0;
  p[7]=-1.154642632172909e-5L;
  p[8]=1.584803612786345e-7L;
  p[9]=-4.652065399568528e-10L;
  p[10]=0;
  pi[0]=0;
  pi[1]=p[1];
  pi[2]=2.658859252929688L;
  pi[3]=-7.567065954208374e-1L;
  pi[4]=0;
  pi[5]=p[5];
  pi[6]=-7.820779428584501e-4L;
  pi[7]=-p[7];
  pi[8]=0;
  pi[9]=p[9];
  pi[10]=9.094947017729282e-13L;
  prtc(11,p,pi);
  fail = cpoly(p,pi,10,zr,zi);
  if (fail) 
    printf("cpoly has failed on this example\n");  
  prtz(10,zr,zi);
  printf("Example 4. multiple zeros\n");
  p[0]=1L;
  p[1]=-10L;
  p[2]=3L;
  p[3]=284L;
  p[4]=-1293L;
  p[5]=2374L;
  p[6]=-1587L;
  p[7]=-920L;
  p[8]=2204L;
  p[9]=-1344L;
  p[10]=288L;
  pi[0]=0;
  pi[1]=-10L;
  pi[2]=100L;
  pi[3]=-334L;
  pi[4]=200L;
  pi[5]=1394L;
  pi[6] =-3836L;
  pi[7]=4334L;
  pi[8]=-2352L;
  pi[9]=504L;
  pi[10]=0;
  prtc(11,p,pi);
  fail = cpoly(p,pi,10,zr,zi);
  if (fail)
    printf("cpoly has failed on this example\n");
  prtz(10,zr,zi);
  printf("Example 5. 12 zeros evenly distributed on a circle of radius 1. centered at 0+2i.\n");
  p[0]=1L;
  p[1]=0;
  p[2]=-264L;
  p[3]=0;
  p[4]=7920L;
  p[5]=0;
  p[6]=-59136L;
  p[7]=0;
  p[8]=126720L;
  p[9]=0;
  p[10]=-67584L;
  p[11]=0;
  p[12]=4095L;
  pi[0]=0;
  pi[1]=-24L;
  pi[2]=0;
  pi[3]=1760L;
  pi[4]=0;
  pi[5]=-25344L;
  pi[6]=0;
  pi[7]=101376L;
  pi[8]=0;
  pi[9]=-112640L;
  pi[10]=0;
  pi[11]=24576L;
  pi[12]=0;
  prtc(13,p,pi);
  fail = cpoly(p,pi,12,zr,zi);
  if(fail)
    printf("cpoly has failed on this example\n");
  prtz(12,zr,zi);
  return 0;
}