Example #1
0
swap_screens()                                    /* Commuter ‚crans 1/2 */
{
  if (Logbase () == screen1)
    Setscreen (screen2, screen1, -1);
  else
    Setscreen (screen1, screen2, -1);
}
Example #2
0
init_screens()
{
  screen1 = Logbase();                            /* Adresse de la RAM-Video */
  if ((memory = malloc (32256)) == 0L)            /* Allouer nouvelle m‚moire */
  {
    printf ("La m‚moire est pleine!!!\n");        /* Message d'erreur */
    Crawcin();                                    /* Attendre touche */
    Pterm0();                                     /* Quitter programme */
  }
  screen2 = (memory & 0xffffff00) + 256;         /* doit ˆtre au bord de page */
}
Example #3
0
int InitTank()
{
	int ii;

	/* initialiser cookie */
	InitCookie();

	/* sauvegarder palette des couleurs */
	for ( ii = 0; ii < 16; ii++ )
		SavPalette[ii] = Setcolor(ii,-1);

	/* aller en basse resolution */
	SavRez = Getrez();
	if ( SavRez > 1 )
		return (1);

	/* mise en place des ecrans de travail */
	_SavLogScreen = (char *)Logbase();
	_SavPhyScreen = (char *)Physbase();

	_Screens[0] = (char *)malloc(32256L);
	_Screens[1] = (char *)malloc(32256L);
	if ( _Screens[0] == 0 || _Screens[1] == 0L )
		return (2);
	_Screens[0] = _ShowScreen = (char *)((long)(_Screens[0] + 255) & 0xFFFFFF00L);
	_Screens[1] = _HideScreen = (char *)((long)(_Screens[1] + 255) & 0xFFFFFF00L);
	MemClear(_Screens[0],32000L);
	MemClear(_Screens[1],32000L);

	Setpalette(BlackPalette);

	if ( ShipSetUp(0) == 0 )
		return (2);
	if ( MiscSetUp() == 0 )
		return (2);
	if ( StarSetUp() == 0 )
		return (2);
	if ( AstSetUp() == 0 )
		return (2);
	if ( ExplSetUp() == 0 )
		return (2);

	Setscreen(_Screens[0],_Screens[0],0);

	TTSpl = ((Cookies.snd & 2) != 0);
	SplOn._proc = _SplOnProc[ TTSpl ];
	SplOff._proc = _SplOffProc[ TTSpl ];

	NStars = (Cookies.cpu > 10) ? 32 : 16;

	return (0);
}