コード例 #1
0
ファイル: Main.c プロジェクト: PocketInsanity/wolf3d
int WolfMain(int argc, char *argv[])
{
	WaitTick();			/* Wait for a system tick to go by */
	playstate = (exit_t)setjmp(ResetJmp);	
	NumberIndex = 36;	/* Force the score to redraw properly */
	IntermissionHack = FALSE;
	if (playstate) {
		goto DoGame;	/* Begin a new game or saved game */
	}
	JumpOK = TRUE;		/* Jump vector is VALID */
	FlushKeys();		/* Allow a system event */
	Intro();			/* Do the game intro */
	for (;;) {
		if (TitleScreen()) {		/* Show the game logo */
			StartSong(SongListPtr[0]);
			ClearTheScreen(BLACK);	/* Blank out the title page */
			BlastScreen();
			SetAPalette(rBlackPal);
			if (ChooseGameDiff()) {	/* Choose your difficulty */
				playstate = EX_NEWGAME;	/* Start a new game */
DoGame:
				FadeToBlack();		/* Fade the screen */
				StartGame();		/* Play the game */
			}
		}
		/* TODO: demos or whatever here */
	}
	
	return 0;
}
コード例 #2
0
ファイル: MainMenu.c プロジェクト: EnricoGiordano1992/Tesi
/*---------------------------------------------------------------------------*
 * Routine:  MainMenu
 *---------------------------------------------------------------------------*
 * Description:
 *      Present the main menu
 *---------------------------------------------------------------------------*/
void MainMenu(void)
{
    T_uezDevice lcd;
    T_pixelColor *pixels;

    // Open the LCD and get the pixel buffer
    if (UEZLCDOpen("LCD", &lcd) == UEZ_ERROR_NONE)  {
        UEZLCDGetFrame(lcd, 0, (void **)&pixels);

#if (!FAsT_STARTUP)
        // Clear the screen
        TitleScreen();
        //while(1);
        PlayAudio(523, 100);
        PlayAudio(659, 100);
        PlayAudio(783, 100);
        PlayAudio(1046, 100);
        PlayAudio(783, 100);
        PlayAudio(659, 100);
        PlayAudio(523, 100);

        // Force calibration?
        Calibrate(CalibrateTestIfTouchscreenHeld());

        UEZTaskDelay(1000);
#else
        UEZLCDBacklight(lcd, 255);
        Calibrate(FALSE);
#endif
        AppMenu(&mainmenu);
        UEZLCDClose(lcd);
    }
}
コード例 #3
0
ファイル: MainMenu.c プロジェクト: EnricoGiordano1992/Tesi
/*---------------------------------------------------------------------------*
 * Routine:  MainMenu
 *---------------------------------------------------------------------------*
 * Description:
 *      Present the main menu
 *---------------------------------------------------------------------------*/
void MainMenu(void)
{
    T_uezDevice lcd;
    T_pixelColor *pixels;

    // Open the LCD and get the pixel buffer
    if (UEZLCDOpen("LCD", &lcd) == UEZ_ERROR_NONE)  {
        UEZLCDGetFrame(lcd, 0, (void **)&pixels);

#if (!FAsT_STARTUP)
        // Clear the screen
        TitleScreen();
		//while(1);
        PlayAudio(523, 100);
        PlayAudio(659, 100);
        PlayAudio(783, 100);
        PlayAudio(1046, 100);
        PlayAudio(783, 100);
        PlayAudio(659, 100);
        PlayAudio(523, 100);

        // Force calibration?
        Calibrate(CalibrateTestIfTouchscreenHeld());

        UEZTaskDelay(1000);

#else
        UEZLCDBacklight(lcd, 255);
        Calibrate(FALSE);
#endif
        
        // Set the screen saver icon
        BouncingLogoSS_Setup(
            (TUInt8 *)G_uEZLogo,
            UEZ_ICON_WIDTH,
            UEZ_ICON_HEIGHT,
            DISPLAY_WIDTH,
            DISPLAY_HEIGHT);
        
        AppMenu(&mainmenu);
        UEZLCDClose(lcd);
    }
}
コード例 #4
0
ファイル: MainMenu.c プロジェクト: EnricoGiordano1992/Tesi
void MainMenu(void)
{
    T_uezDevice lcd;
    T_pixelColor *pixels;
    T_uezQueue queue;

    // Setup queue to receive touchscreen events
    if (UEZQueueCreate(1, sizeof(T_uezTSReading), &queue) == UEZ_ERROR_NONE) {
        // Open the LCD and get the pixel buffer
        if (UEZLCDOpen("LCD", &lcd) == UEZ_ERROR_NONE)  {
            UEZLCDGetFrame(lcd, 0, (void **)&pixels);
            UEZLCDOn(lcd);

#if (!FAST_STARTUP)
            // Clear the screen
            TitleScreen();

            PlayAudio(523, 100);
            PlayAudio(659, 100);
            PlayAudio(783, 100);
            PlayAudio(1046, 100);
            PlayAudio(783, 100);
            PlayAudio(659, 100);
            PlayAudio(523, 100);                


#if DKTS_BUTTON_SLIDE_SHOW_DEMO // show emwin on button 1, auto slideshow on buttons 2-4
#include <uEZButton.h>
#include <GUIDEMO.h>

            T_uezDevice ButtonBank;
            TUInt32 buttonsActive = 0x0F; // buttons 1-4
            TUInt32 ButtonsPressed;
            T_slideshowDefinition aDef;
            aDef.iDrive = 1;
            if (UEZButtonBankOpen("ButtonBank0", &ButtonBank) == UEZ_ERROR_NONE) {
                // the device opened properly
                if (UEZButtonBankSetActive(ButtonBank, buttonsActive) == UEZ_ERROR_NONE) {
                    // set active successful
                }
                if (UEZButtonBankRead(ButtonBank, &ButtonsPressed) == UEZ_ERROR_NONE) { // got buttons pressed
                    if (ButtonsPressed == 14) { // button 1 pressed
                        const T_choice aChoice = {0};
                        emWin(&aChoice);
                    }
                    else if (ButtonsPressed == 13) { // button 2 pressed
                        char str1[] = {'F','D','I',' ','O','v','e','r','v','i','e','w','\0'};
                        memcpy(aDef.iName,str1,strlen(str1)+1);
                        char str2[] = {'F','D','I','\0'};
                        memcpy(aDef.iDirectory,str2,strlen(str2)+1);
                        SingleSlideshowMode(&aDef);
                        
                        // change to Speedometer Demo here
                        
                    }
                    else if (ButtonsPressed == 11) { // button 3 pressed
                        char str3[] = {'u','E','Z','G','U','I',' ','F','a','m','i','l','y','\0'};
                        memcpy(aDef.iName,str3,strlen(str3)+1);
                        char str4[] = {'U','E','Z','G','U','I','\0'};
                        memcpy(aDef.iDirectory,str4,strlen(str4)+1);
                        SingleSlideshowMode(&aDef);
                    }
                    else if (ButtonsPressed == 7) { // button 4 pressed
                        char str5[] = {'D','e','m','o','n','s','t','r','a','t','i',
                        'o','n',' ','P','i','c','t','u','r','e','s','\0'};
                        memcpy(aDef.iName,str5,strlen(str5)+1);
                        char str6[] = {'D','E','M','O','P','I','C','S','\0'};
                        memcpy(aDef.iDirectory,str6,strlen(str6)+1);
                        SingleSlideshowMode(&aDef);
                    }
                    else{ }
                }
                if (UEZButtonBankClose(ButtonBank) != UEZ_ERROR_NONE) {// error closing button bank
                }
            } else {// an error occurred opening Button Bank
            }
            Calibrate(CalibrateTestIfTouchscreenHeld()); // turn touchscreen back on since touchscreen present on KOE
#else
            // Force calibration?
            Calibrate(CalibrateTestIfTouchscreenHeld());
#endif
            //UEZTaskDelay(1000);
#else
            UEZLCDBacklight(lcd, 255);
#endif
            UEZTaskDelay(10000);

            AppMenu(&mainmenu);
            UEZLCDClose(lcd);
        }
    }
}