static bool ShowTextScreen(TextScreenIntermissionAction *textscreen, bool demoMode)
{
	if(textscreen->TextSpeed)
		Printf("Warning: Text screen has a non-zero textspeed which isn't supported at this time.\n");

	ShowImage(textscreen, true);

	if(textscreen->TextDelay)
	{
		if(WaitIntermission(textscreen->TextDelay) && demoMode)
			return true;
	}

	py = textscreen->PrintY;
	px = textscreen->PrintX;
	for(unsigned int i = 0;i < textscreen->Text.Size();++i)
	{
		FString str = textscreen->Text[i];
		if(str[0] == '$')
			str = language[str.Mid(1)];

		DrawMultiLineText(str, textscreen->TextFont, textscreen->TextColor, textscreen->Alignment, textscreen->Anchor);
	}

	// This really only makes sense to use if trying to display text immediately.
	if(textscreen->FadeTime)
	{
		VL_FadeIn(0, 255, textscreen->FadeTime);
	}

	VW_UpdateScreen();
	return WaitIntermission(textscreen->Time);
}
Beispiel #2
0
void EndScreen (int palette, int screen)
{
	CA_CacheScreen (screen);
	VW_UpdateScreen ();
	CA_CacheGrChunk (palette);
	VL_FadeIn(0,255,grsegs[palette],30);
	UNCACHEGRCHUNK (palette);
	IN_ClearKeysDown ();
	IN_Ack ();
	VW_FadeOut ();
}
void
EndScreen (int palette, int screen)
{
    SDL_Color pal[256];
    CA_CacheScreen (screen);
    VW_UpdateScreen ();
    CA_CacheGrChunk (palette);
    VL_ConvertPalette(grsegs[palette], pal, 256);
    VL_FadeIn (0, 255, pal, 30);
    UNCACHEGRCHUNK (palette);
    IN_ClearKeysDown ();
    IN_Ack ();
    VW_FadeOut ();
}
static void ShowFader(FaderIntermissionAction *fader)
{
	switch(fader->Fade)
	{
		case FaderIntermissionAction::FADEIN:
			ShowImage(fader, true);
			VL_FadeIn(0, 255, fader->Time);
			break;
		case FaderIntermissionAction::FADEOUT:
			// We want to hold whatever may have been drawn in the previous page during the fade, so we don't need to draw.
			VL_FadeOut(0, 255, 0, 0, 0, fader->Time);
			break;
	}
}
Beispiel #5
0
void EndSpear()
{
	EndScreen(END1PALETTE, ENDSCREEN11PIC);

	VL_CacheScreen(ENDSCREEN3PIC);
	VW_UpdateScreen();
	CA_CacheGrChunk(END3PALETTE);
	VL_FadeIn(0, 255, grsegs[END3PALETTE], 30);
	CA_UnCacheGrChunk(END3PALETTE);
	
	fontnumber = 0;
	fontcolor = 0xd0;
	WindowX = 0;
	WindowW = 320;
	PrintX = 0;
	PrintY = 180;
	US_CPrint(STR_ENDGAME1"\n");
	US_CPrint(STR_ENDGAME2);
	VW_UpdateScreen();
	
	IN_StartAck ();
	set_TimeCount(0);
	while ( !IN_CheckAck () && (get_TimeCount() < 700) );

	PrintX = 0;
	PrintY = 180;
	VW_Bar(0,180,320,20,0);
	US_CPrint(STR_ENDGAME3"\n");
	US_CPrint(STR_ENDGAME4);
	VW_UpdateScreen();
	
	IN_StartAck ();
	set_TimeCount(0);
	while ( !IN_CheckAck () && (get_TimeCount() < 700) );

	VW_FadeOut ();

	EndScreen (END4PALETTE, ENDSCREEN4PIC);
	EndScreen (END5PALETTE, ENDSCREEN5PIC);
	EndScreen (END6PALETTE, ENDSCREEN6PIC);
	EndScreen (END7PALETTE, ENDSCREEN7PIC);
	EndScreen (END8PALETTE, ENDSCREEN8PIC);
	EndScreen (END9PALETTE, ENDSCREEN9PIC);

	EndScreen (END2PALETTE, ENDSCREEN12PIC);

	MainMenu[savegame].active = 0;
}
void
EndSpear (void)
{
    SDL_Color pal[256];

    EndScreen (END1PALETTE, ENDSCREEN11PIC);

    CA_CacheScreen (ENDSCREEN3PIC);
    VW_UpdateScreen ();
    CA_CacheGrChunk (END3PALETTE);
    VL_ConvertPalette(grsegs[END3PALETTE], pal, 256);
    VL_FadeIn (0, 255, pal, 30);
    UNCACHEGRCHUNK (END3PALETTE);
    fontnumber = 0;
    fontcolor = 0xd0;
    WindowX = 0;
    WindowW = 320;
    PrintX = 0;
    PrintY = 180;
    US_CPrint (STR_ENDGAME1 "\n");
    US_CPrint (STR_ENDGAME2);
    VW_UpdateScreen ();
    IN_UserInput(700);

    PrintX = 0;
    PrintY = 180;
    VWB_Bar (0, 180, 320, 20, 0);
    US_CPrint (STR_ENDGAME3 "\n");
    US_CPrint (STR_ENDGAME4);
    VW_UpdateScreen ();
    IN_UserInput(700);

    VW_FadeOut ();

    EndScreen (END4PALETTE, ENDSCREEN4PIC);
    EndScreen (END5PALETTE, ENDSCREEN5PIC);
    EndScreen (END6PALETTE, ENDSCREEN6PIC);
    EndScreen (END7PALETTE, ENDSCREEN7PIC);
    EndScreen (END8PALETTE, ENDSCREEN8PIC);
    EndScreen (END9PALETTE, ENDSCREEN9PIC);

    EndScreen (END2PALETTE, ENDSCREEN12PIC);

    MainMenu[savegame].active = 0;
}
Beispiel #7
0
static void ShowBriefing(FString str)
{
    VWB_DrawFill(backgroundFlat, 0, 0, screenWidth, screenHeight);

    switch(alignment)
    {
    default:
        px = 8;
        break;
    case TS_Center:
        px = 160;
        break;
    case TS_Right:
        px = 312;
        break;
    }
    py = 8;

    DrawMultiLineText(str, font, textcolor, alignment, anchor);

    VL_FadeIn(0,255,10);
    IN_Ack();
}
Beispiel #8
0
void ShowArticle (char *article)
#endif
{
	#ifdef JAPAN
	int		snames[10] = {	H_HELP1PIC,
							H_HELP2PIC,
							H_HELP3PIC,
							H_HELP4PIC,
							H_HELP5PIC,
							H_HELP6PIC,
							H_HELP7PIC,
							H_HELP8PIC,
							H_HELP9PIC,
							H_HELP10PIC};
	int		enames[14] = {
							0,0,
							#ifndef JAPDEMO
							C_ENDGAME1APIC,
							C_ENDGAME1BPIC,
							C_ENDGAME2APIC,
							C_ENDGAME2BPIC,
							C_ENDGAME3APIC,
							C_ENDGAME3BPIC,
							C_ENDGAME4APIC,
							C_ENDGAME4BPIC,
							C_ENDGAME5APIC,
							C_ENDGAME5BPIC,
							C_ENDGAME6APIC,
							C_ENDGAME6BPIC
							#endif
							};
	#endif
	unsigned	oldfontnumber;
	unsigned	temp;
	boolean 	newpage,firstpage;

	#ifdef JAPAN
	pagenum = 1;
	if (!which)
		numpages = 10;
	else
		numpages = 2;

	#else

	text = article;
	oldfontnumber = fontnumber;
	fontnumber = 0;
	CA_MarkGrChunk(STARTFONT);
	VWB_Bar (0,0,320,200,BACKCOLOR);
	CacheLayoutGraphics ();
	#endif

	newpage = True;
	firstpage = True;

	do
	{
		if (newpage)
		{
			newpage = False;
			#ifdef JAPAN
			if (!which)
				CA_CacheScreen(snames[pagenum - 1]);
			else
				CA_CacheScreen(enames[which*2 + pagenum - 1]);
			#else
			PageLayout (True);
			#endif
			VW_UpdateScreen ();
			if (firstpage)
			{
				VL_FadeIn(0,255,&gamepal,10);
				// VW_FadeIn ()
				firstpage = False;
			}
		}

		LastScan = 0;
		while (!LastScan)
		;

		switch (LastScan)
		{
		case sc_UpArrow:
		case sc_PgUp:
		case sc_LeftArrow:
			if (pagenum>1)
			{
				#ifndef JAPAN
				BackPage ();
				BackPage ();
				#else
				pagenum--;
				#endif
				newpage = True;
			}
			break;

		case sc_Enter:
		case sc_DownArrow:
		case sc_PgDn:
		case sc_RightArrow:		// the text allready points at next page
			if (pagenum<numpages)
			{
				newpage = True;
				#ifdef JAPAN
				pagenum++;
				#endif
			}
			break;
		}

		#ifndef SPEAR
		if (Keyboard[sc_Tab] && Keyboard[sc_P] && MS_CheckParm("goobers"))
			PicturePause();
		#endif

	} while (LastScan != sc_Escape);

	IN_ClearKeysDown ();
	fontnumber = oldfontnumber;
}
static int DemoLoop(unsigned id)
{
    static int LastDemo = 0;

    switch (id)
    {
    case JE_NONE:
        /* check for launch from ted */
        if (param_tedlevel != -1)
        {
            param_nowait = true;
            EnableEndGameMenuItem();
            NewGame(param_difficulty,0);

            gamestate.episode  = 0;
            gamestate.mapon    = param_tedlevel;
#ifndef SPEAR
            gamestate.episode  = param_tedlevel/10;
            gamestate.mapon   %= 10;
#endif
            return JE_LOOP2;
        }

        /* main game cycle */
#ifndef DEMOTEST

#ifndef UPLOAD

#ifndef GOODTIMES
#ifndef SPEAR
#ifndef JAPAN
        if (!param_nowait)
            NonShareware();
#endif
#else
#ifndef GOODTIMES
#ifndef SPEARDEMO
        extern void CopyProtection(void);
        if(!param_goodtimes)
            CopyProtection();
#endif
#endif
#endif
#endif
#endif

        StartCPMusic(INTROSONG);

#ifndef JAPAN
        if (!param_nowait)
            PG13 ();
#endif

#endif
        return JE_LOOP;
    case JE_LOOP:
        while (!param_nowait)
        {
#ifndef DEMOTEST

#ifdef SPEAR
            LR_Color pal[256];
            /* title page */
            CA_CacheGrChunk (TITLEPALETTE);
            VL_ConvertPalette(grsegs[TITLEPALETTE], pal, 256);

            CA_CacheGrChunk (TITLE1PIC);
            VWB_DrawPic (0,0,TITLE1PIC);
            UNCACHEGRCHUNK (TITLE1PIC);

            CA_CacheGrChunk (TITLE2PIC);
            VWB_DrawPic (0,80,TITLE2PIC);
            UNCACHEGRCHUNK (TITLE2PIC);
            VW_UpdateScreen ();
            VL_FadeIn(0,255,pal,30);

            UNCACHEGRCHUNK (TITLEPALETTE);
#else
            CA_CacheScreen (TITLEPIC);
            VW_UpdateScreen ();
            VW_FadeIn();
#endif
            if (IN_UserInput(TickBase*15))
                break;
            VW_FadeOut();
            /* credits page */
            CA_CacheScreen (CREDITSPIC);
            VW_UpdateScreen();
            VW_FadeIn ();
            if (IN_UserInput(TickBase*10))
                break;
            VW_FadeOut ();
            DrawHighScores ();
            VW_UpdateScreen ();
            VW_FadeIn ();

            if (IN_UserInput(TickBase*10))
                break;
#endif
            /* demo */

#ifndef SPEARDEMO
            PlayDemo (LastDemo++%4);
#else
            PlayDemo (0);
#endif

            if (playstate == EX_ABORT)
                return JE_QUIT;
            VW_FadeOut();
            if(screenHeight % 200 != 0)
                VL_ClearScreen(0);
            StartCPMusic(INTROSONG);
        }

        VW_FadeOut ();

#ifdef DEBUGKEYS
        if (Keyboard[sc_Tab] && param_debugmode)
            RecordDemo ();
        else
#endif
            US_ControlPanel (0);

        if (startgame || loadedgame)
            return JE_LOOP2;
        break;
    case JE_LOOP2:
        id = GameLoop();
        if (param_tedlevel == -1 && id == -1)
        {
            if(!param_nowait)
            {
                VW_FadeOut();
                StartCPMusic(INTROSONG);
            }
        }
        break;
    }

    return JE_LOOP2;
}
Beispiel #10
0
void ShowArticle(signed char *article)
{
	unsigned oldfontnumber;
	boolean newpage, firstpage;


	text = article;
	oldfontnumber = fontnumber;
	fontnumber = 0;
	CA_CacheGrChunk(STARTFONT);
	VW_Bar (0,0,320,200,BACKCOLOR);
	CacheLayoutGraphics();

	newpage = true;
	firstpage = true;

	do
	{
		if (newpage)
		{
			newpage = false;
			PageLayout(true);
			VW_UpdateScreen();
			if (firstpage)
			{
				VL_FadeIn(0,255,gamepal,10);
				firstpage = false;
			}
		}

		LastScan = 0;
		while (!LastScan) IN_CheckAck(); /* update events */

		switch (LastScan)
		{
		case sc_UpArrow:
		case sc_PgUp:
		case sc_LeftArrow:
			if (pagenum>1)
			{
				BackPage ();
				BackPage ();
				newpage = true;
			}
			break;

		case sc_Enter:
		case sc_DownArrow:
		case sc_PgDn:
		case sc_RightArrow:		// the text already points at next page
			if (pagenum<numpages)
			{
				newpage = true;
			}
			break;
		}

		if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
			PicturePause();

	} while (LastScan != sc_Escape);

	IN_ClearKeysDown ();
	fontnumber = oldfontnumber;
}
Beispiel #11
0
// Helphack switches index 11 and 5 so that the keyboard/blaze pics are reversed.
void ShowArticle (const char *article, bool helphack=false)
{
    bool newpage, firstpage;
    ControlInfo ci;

    text = article;
    CountPages();
    if(numpages == 0)
    {
        // No pages?  Show S3DNA style briefing.
        ShowBriefing(article);
        return;
    }

    VWB_Clear(GPalette.BlackIndex, 0, 0, screenWidth, screenHeight);

    newpage = true;
    firstpage = true;
    fontcolor = 255;
    textcolor = CR_UNTRANSLATED;

    do
    {
        if (newpage)
        {
            newpage = false;
            PageLayout (true, helphack);
            VW_UpdateScreen ();
            if (firstpage)
            {
                VL_FadeIn(0,255,10);
                firstpage = false;
            }
        }
        SDL_Delay(5);

        LastScan = 0;
        ReadAnyControl(&ci);
        Direction dir = ci.dir;
        switch(dir)
        {
        case dir_North:
        case dir_South:
            break;

        default:
            if(ci.button0) dir = dir_South;
            switch(LastScan)
            {
            case sc_UpArrow:
            case sc_PgUp:
            case sc_LeftArrow:
                dir = dir_North;
                break;

            case sc_Enter:
            case sc_DownArrow:
            case sc_PgDn:
            case sc_RightArrow:
                dir = dir_South;
                break;
            }
            break;
        }

        switch(dir)
        {
        default:
            break;
        case dir_North:
        case dir_West:
            if (pagenum>1)
            {
                BackPage ();
                BackPage ();
                newpage = true;
            }
            TicDelay(20);
            break;

        case dir_South:
        case dir_East:
            if (pagenum<numpages)
            {
                newpage = true;
            }
            TicDelay(20);
            break;
        }
    } while (LastScan != sc_Escape && !ci.button1);

    IN_ClearKeysDown ();
}
Beispiel #12
0
//------------------------------------------------------------------------
// PreDemo()
//------------------------------------------------------------------------
void PreDemo()
{
#if !SKIP_TITLE_AND_CREDITS
#if TECH_SUPPORT_VERSION

	fontnumber=4;
	SETFONTCOLOR(0,15*3);
	CenterWindow (26,7);
	US_Print(EnterBetaCode);
	VW_UpdateScreen();
	CA_LoadAllSounds();
	PM_CheckMainMem();
	SD_PlaySound(INFORMDEATH2SND);		// Nooooo!
	IN_UserInput(TickBase*20);
	ClearMemory();

#elif BETA_TEST

	boolean param=false;

	for (i=1; i<g_argc; i++)
		switch (US_CheckParm(g_argv[i],MainStrs))
		{
			case 13:
				param=true;
			break;
		}

	if (!param)
	{
		char buffer[15] = {0};

		fontnumber=4;
		CenterWindow (26,7);
		US_Print(EnterBetaCode);
		VW_UpdateScreen();
		SETFONTCOLOR(0,15*3);
		US_LineInput(24*8,92,buffer,buffer,true,14,100);
		if (_fstricmp(buffer,bc_buffer))
			Quit("Bad beta code!");
	}
#endif



#if GAME_VERSION == SHAREWARE_VERSION
#if IN_DEVELOPMENT || GEORGE_CHEAT
	if (!MS_CheckParm("nochex"))
#endif
	{
#if  (!SKIP_CHECKSUMS)
//	CheckValidity("MAPTEMP.",MAPTEMP_CHECKSUM,"LEVELS");
	CheckValidity("MAPTEMP.",MAPTEMP_CHECKSUM);
#endif
	}
#else
#if  (!SKIP_CHECKSUMS)
	if (ChecksumFile("FILE_ID.DIZ",0) != DIZFILE_CHECKSUM)
		gamestate.flags |= GS_BAD_DIZ_FILE;
#endif
#endif

	VL_SetPaletteIntensity(0,255,vgapal,0);

	if (!(gamestate.flags & GS_NOWAIT))
	{
#if (0)				// GAME_VERSION != SHAREWARE_VERSION
//---------------------
// Anti-piracy screen
//---------------------
	// Cache pic
	//
		CA_CacheScreen(PIRACYPIC);

	// Cache and set palette.  AND  Fade it in!
	//
		CA_CacheGrChunk(PIRACYPALETTE);
		VL_SetPalette (0,256,grsegs[PIRACYPALETTE]);
		VL_SetPaletteIntensity(0,255,grsegs[PIRACYPALETTE],0);
		VW_UpdateScreen();

		VL_FadeOut (0, 255, 0, 0, 25, 20);
		VL_FadeIn(0,255,grsegs[PIRACYPALETTE],30);

	// Wait a little
	//
		IN_UserInput(TickBase*20);

	// Free palette
	//
		UNCACHEGRCHUNK(PIRACYPALETTE);

		VL_FadeOut (0, 255, 0, 0, 25, 20);
		VW_FadeOut();

	// Cleanup screen for upcoming SetPalette call
	//
		{
		Uint16 old_bufferofs=bufferofs;

		bufferofs=displayofs;
		VL_Bar(0,0,320,200,0);
		bufferofs=old_bufferofs;
		}
#endif

//---------------------
// Apogee presents
//---------------------
        // ISG --> this fixes intro timing
        IN_UserInput(TickBase*1);
        
	// Cache pic
	//
		CA_CacheScreen(APOGEEPIC);

	// Load and start music
	//
		CA_CacheAudioChunk(STARTMUSIC+APOGFNFM_MUS);

        ::SD_StartMusic(APOGFNFM_MUS);

	// Cache and set palette.  AND  Fade it in!
	//
		CA_CacheGrChunk(APOGEEPALETTE);
		VL_SetPalette (0,256,static_cast<const Uint8*>(grsegs[APOGEEPALETTE]));
		VL_SetPaletteIntensity(0,255,static_cast<const Uint8*>(grsegs[APOGEEPALETTE]),0);
		VW_UpdateScreen();
    
		VL_FadeOut (0, 255, 25, 29, 53, 20);
		VL_FadeIn(0,255,static_cast<const Uint8*>(grsegs[APOGEEPALETTE]),30);

	// Wait for end of fanfare
	//
		if (MusicMode==smm_AdLib)
		{
			IN_StartAck();
			while ((!sqPlayedOnce) && (!IN_CheckAck()));
      }
		else
			IN_UserInput(TickBase*6);

		SD_MusicOff();

	// Free palette and music.  AND  Restore palette
	//
		UNCACHEGRCHUNK(APOGEEPALETTE);

        delete [] audiosegs[STARTMUSIC + APOGFNFM_MUS];
        audiosegs[STARTMUSIC + APOGFNFM_MUS] = NULL;

      // Do A Blue Flash!

      VL_FadeOut (0, 255, 25, 29, 53, 20);
      VL_FadeOut (0, 255, 0, 	0,  0,  30);

//---------------------
// JAM logo intro
//---------------------
	// Load and start music
	//
		CA_CacheAudioChunk(STARTMUSIC+TITLE_LOOP_MUSIC);
        ::SD_StartMusic(TITLE_LOOP_MUSIC);

	// Show JAM logo
	//
		if (!DoMovie(mv_intro,0))
			MAIN_ERROR(PREDEMO_NOJAM);

		if (PowerBall)
      {
      	Sint16 i;

			for (i=0;i<60 && (!DebugOk);i++)
   	   {
      		VL_WaitVBL(1);

            // BBi
            ::in_handle_events();

				if (Keyboard[sc_left_shift] && Keyboard[sc_right_shift])
		      {
					CA_LoadAllSounds();

					SD_MusicOff();

                   ::sd_play_player_sound(SHOOTDOORSND, bstone::AC_ITEM);

		         SD_WaitSoundDone();

				   ClearMemory();
		      	DebugOk = 1;

					CA_CacheAudioChunk(STARTMUSIC+TITLE_LOOP_MUSIC);
                    ::SD_StartMusic(TITLE_LOOP_MUSIC);
      		}
         }
      }

//---------------------
// PC-13
//---------------------
		VL_Bar(0,0,320,200,0x14);
		CacheDrawPic(0,64,PC13PIC);
		VW_UpdateScreen();
		VW_FadeIn();
		IN_UserInput(TickBase*2);

      // Do A Red Flash!

      VL_FadeOut (0, 255, 39, 0, 0, 20);
		VW_FadeOut();
	}
#endif // SKIP_TITLE_AND_CREDITS
}
Beispiel #13
0
static void DemoLoop()
{
    int LastDemo = 0;

//
// check for launch from ted
//
    if (param_tedlevel != -1)
    {
        param_nowait = true;
        EnableEndGameMenuItem();
        NewGame(param_difficulty,0);

#ifndef SPEAR
        gamestate.episode = param_tedlevel/10;
        gamestate.mapon = param_tedlevel%10;
#else
        gamestate.episode = 0;
        gamestate.mapon = param_tedlevel;
#endif
        GameLoop();
        Quit (NULL);
    }


//
// main game cycle
//

#ifndef DEMOTEST

    #ifndef UPLOAD

        #ifndef GOODTIMES
        #ifndef SPEAR
        #ifndef JAPAN
        if (!param_nowait)
            NonShareware();
        #endif
        #else
            #ifndef GOODTIMES
            #ifndef SPEARDEMO
            extern void CopyProtection(void);
            if(!param_goodtimes)
                CopyProtection();
            #endif
            #endif
        #endif
        #endif
    #endif

    StartCPMusic(INTROSONG);

#ifndef JAPAN
    if (!param_nowait)
        PG13 ();
#endif

#endif

    while (1)
    {
        while (!param_nowait)
        {
//
// title page
//
#ifndef DEMOTEST

#ifdef SPEAR
            SDL_Color pal[256];
            CA_CacheGrChunk (TITLEPALETTE);
            VL_ConvertPalette(grsegs[TITLEPALETTE], pal, 256);

            CA_CacheGrChunk (TITLE1PIC);
            VWB_DrawPic (0,0,TITLE1PIC);
            UNCACHEGRCHUNK (TITLE1PIC);

            CA_CacheGrChunk (TITLE2PIC);
            VWB_DrawPic (0,80,TITLE2PIC);
            UNCACHEGRCHUNK (TITLE2PIC);
            VW_UpdateScreen ();
            VL_FadeIn(0,255,pal,30);

            UNCACHEGRCHUNK (TITLEPALETTE);
#else
            CA_CacheScreen (TITLEPIC);
            VW_UpdateScreen ();
            VW_FadeIn();
#endif
            if (IN_UserInput(TickBase*15))
                break;
            VW_FadeOut();
//
// credits page
//
            CA_CacheScreen (CREDITSPIC);
            VW_UpdateScreen();
            VW_FadeIn ();
            if (IN_UserInput(TickBase*10))
                break;
            VW_FadeOut ();
//
// high scores
//
            DrawHighScores ();
            VW_UpdateScreen ();
            VW_FadeIn ();

            if (IN_UserInput(TickBase*10))
                break;
#endif
//
// demo
//

            #ifndef SPEARDEMO
            PlayDemo (LastDemo++%4);
            #else
            PlayDemo (0);
            #endif

            if (playstate == ex_abort)
                break;
            VW_FadeOut();
            if(screenHeight % 200 != 0)
                VL_ClearScreen(0);
            StartCPMusic(INTROSONG);
        }

        VW_FadeOut ();

#ifdef DEBUGKEYS
        if (Keyboard[sc_Tab] && param_debugmode)
            RecordDemo ();
        else
            US_ControlPanel (0);
#else
        US_ControlPanel (0);
#endif

        if (startgame || loadedgame)
        {
            GameLoop ();
            if(!param_nowait)
            {
                VW_FadeOut();
                StartCPMusic(INTROSONG);
            }
        }
    }
}