Exemple #1
0
int main(void)
{
	short old = Blitmode(-1);
	printf( "Blitter %d\n", old );
	if (old & 2) {
		Blitmode( 3 /*old | 1*/ );
		printf( "Blitter enabled\n" );
	} else {
		printf( "Sorry no blitter\n" );
	}
	old = Blitmode(-1);
	printf( "Blitter is now %d\n", old );
	return(0);
}
Exemple #2
0
int init_display()
{
	unsigned short loop,yr;
	unsigned short k,i;

	screen_buffer_backup_aligned=(unsigned char*)malloc(16*1024);

	SCREEN_YRESOL=200;
	NUMBER_OF_FILE_ON_DISPLAY=19-5;// 19-5 //19 -240

	old_physical_adr=(unsigned long)Physbase();
	screen_buffer=(unsigned char*)malloc((32*1024) + 256);
	memset(screen_buffer,0,(32*1024) + 256);
	screen_buffer_aligned = (unsigned char*)(((unsigned long)screen_buffer| 0xff)+1);

        screen_buffer_backup=(unsigned char*)malloc((8*1000) + 256);
	memset(screen_buffer_backup,0,(8*1000) + 256);
	screen_buffer_backup_aligned = (unsigned char*)(((unsigned long)screen_buffer_backup| 0xff)+1);

	Blitmode(1);
	
    Setscreen( -1, screen_buffer_aligned, 1 );
	color=0;
    Supexec(initpal);

	init_buffer();
}
Exemple #3
0
void get_set_video (int set){ /* 0=get, 1=set, 2=set & change rez */

	long
#ifdef _OVSCAN
		s,						/* sup.stack p.        */
#endif
		logb,       			/* logical screen base  */
		phyb;       			/* physical screen base */

#ifdef _OVSCAN
	char
		*acia;

	static int ov_max_h, ov_max_w;

	int std_x[4] = {320,640,1280,0};
	int std_y[4] = {200,400,800,0};
	int idi;
#endif

	/* Where is the screen ? */

	logb = xbios(3); 				/* Logbase();  */
	phyb = xbios(2);				/* Physbase(); */

	if ( set == 0 ){ /* get data */

		/* Find about video hardware (shifter; will be 0xffffffff without cookie */
		
		vdo = find_cookie( '_VDO' );
		
		/* Try to find out about a couple of overscan types */
		
#ifdef _OVSCAN		
		if (   ( (over = find_cookie('OVER')) != - 1 )
		    || ( (over = find_cookie('Lace')) != - 1 ) )
		{

			ovrstat = 0;
			for ( idi = 0; idi < 3; idi++ )
				if ( max_h > std_y[idi] && max_h < std_y[idi + 1] )
				{
					ov_max_w = max_w;
					ov_max_h = max_h;
					ovrstat = 1;
					break;
				}

			if ( ovrstat != 0 )
				options.V2_2.vprefs |= VO_OVSCAN;
			else
				options.V2_2.vprefs &= ~VO_OVSCAN;
		}
		else
			over  = 0xffffffffL;
#endif

		/* Get current blitter state; insert into options  */
  
		if ( get_tosversion() >= 0x104 ) 
			bltstat = Blitmode(-1);   /* Function known only to tos >= 1.4 ? */
		else
			bltstat = 0;
		if ( bltstat & 0x0001 ) 	
			options.V2_2.vprefs |= VO_BLITTER; 
		else
			options.V2_2.vprefs &= ~VO_BLITTER;
    		
		/* Which is the current standard resolution ? */
	
		currez = xbios(4); /* Getrez() */   	
		
		options.V2_2.vrez = currez; 

	}
	else /* set data */
	{	
		/* Set blitter, if present */
	
		if ( bltstat & 0x0002 )
		{
			if ( options.V2_2.vprefs & VO_BLITTER ) 
				bltstat |= 0x0001;	
			else
				bltstat &= ~0x0001;
			bltstat = Blitmode ( bltstat );
		}

#ifdef _OVSCAN
		/* 
		 * Set overscan (Lacescan, in fact)
		 * that which is below is ok but not enough !!!!
		 * therefore disabled for the time being
		 */

		if ( (over != 0xffffffffL ) && ( (vprefsold^options.V2_2.vprefs) && VO_OVSCAN) )
		{

			menu_bar ( menu, 0 ); 

			s = Super (0L );
			(long)acia = 0xFFFC00L; /* address of the acia chip reg  HR 240203 (long) */

			if ( options.V2_2.vprefs & VO_OVSCAN )
			{
				*acia = 0xD6; /* value for the acia reg- switch overscan ON */
				ovrstat = 1;
				max_h = ov_max_h;
				max_w = ov_max_w;
			}
			else
			{
				*acia = 0x96; /* value for the acia reg- switch overscan OFF */
				ovrstat = 0;
				max_w = std_x[idi];
				max_h = std_y[idi];
			}

			/* 
			 * An attempt to change resolution (to the same one) will 
			 * provoke Lacescan to adapt 
			 */

			xbios(5, logb, phyb, currez); 	/* Setscreen (logb,phyb,currez); */ 

			Super ( (void *) s );

			wind_set(0, WF_NEWDESK, desktop, 0); 

			/* 
			 * For some reason desktop doesn't get redrawn correctly here
			 * after overstat switch unless menu_bar is called TWICE
			 * (possibly at first call it is too long and corrupts
			 * part of the screen?)
			 */
			menu_bar(menu, 1); 
			dsk_draw(); 
			menu_bar(menu, 1); 

/*			wd_attrib();		*/
            wd_fields();		/* HR 050303 */
		}	
			
#endif

		/* Change resolution */
		/* xbios(...) produces slightly smaller code */
		
		if ( set > 1 )
		{
			/*
			 * This will actually (almost) reset the computer
			 */

			shel_write( 5, currez + 2, 0, NULL, NULL ); /* DjV 007 110203 */

			/* DjV 007 290103: is no good, so disabled for the time being */

			xbios(5, logb, phyb, currez); 	/* Setscreen (logb,phyb,currez); */ 

		}
	}
}