int main(int argc, char ** argv) { // General initializations PA_Init(); PA_InitVBL(); PA_InitRand(); #ifndef DEBUG // Sound init to play mp3 and/or sfx PA_InitASLibForMP3(AS_MODE_MP3 | AS_MODE_SURROUND | AS_MODE_16CH); #endif // Initialize the Wifi handler l_wifi.initialize(); #ifndef DEBUG // Set the sound settings AS_SetDefaultSettings(AS_PCM_8BIT, 44100, AS_SURROUND); #endif // Initialize the background transitions PA_InitBgTrans(0); PA_BgTransDiag(0, TRANSITION_TYPE, 0, 1, 0); // Load sprite palettes PA_LoadSpritePal(1, PALETTE_NB_CASTLE, (void*)castle_Pal); PA_LoadSpritePal(1, PALETTE_NB_ITEM, (void*)item_Pal); // Enable alpha blending at the bottom and top screens PA_EnableSpecialFx(0, SFX_ALPHA, 0, SFX_BG0 | SFX_BG1 | SFX_BG2 | SFX_BG3 | SFX_BD); PA_SetSFXAlpha(0, 7, 15); PA_EnableSpecialFx(1, SFX_ALPHA, 0, SFX_BG0 | SFX_BG1 | SFX_BG2 | SFX_BG3 | SFX_BD); PA_SetSFXAlpha(1, 7, 15); // Main menu object CMenu l_menu; while(1) { // Display the menu l_menu.displayMenu(); } return 0; }
// Function: main() int main(int argc, char ** argv) { PA_Init(); // Initializes PA_Lib PA_InitVBL(); // Initializes a standard VBL PA_InitText(1, 0); PA_EasyBgLoad(0, 1, pasplash); // Load your backgrounds... PA_InitBgTrans(0); // Init BgTransition system, uses background 0 but little memory... // If you want it to hide your sprites, set your sprites' priorities to 1 or more... u8 transtype = 0; s8 i; u8 vflip; // Infinite loop to keep the program running while (1) { vflip = PA_Rand()&1; // random transtype = PA_Rand()%5; // random PA_OutputText(1, 8, 8, "Transition : %d ", transtype); PA_OutputText(1, 10, 9, "Vflip : %d ", vflip); // Transition out... for (i = 0; i <= TRANS_LENGTH; i++) { // Fade length... PA_BgTransUpDown(0, // screen transtype, // fade type, from 0 to 4, test them out ! vflip, // vertical flip i); // Time, 0 being the screen completely visible, 32 completely out PA_WaitForVBL(); // To slow down the fades, we wait a frame... } vflip = PA_Rand()&1; // random transtype = PA_Rand()%5; // random PA_OutputText(1, 8, 8, "Transition : %d ", transtype); PA_OutputText(1, 10, 9, "Vflip : %d ", vflip); // Transition back in... for (i = TRANS_LENGTH; i >= 0; i--) { // Fade length... PA_BgTransUpDown(0, // screen transtype, // fade type, from 0 to 4, test them out ! vflip, // vertical flip i); // Time, 0 being the screen completely visible, 32 completely out PA_WaitForVBL(); // To slow down the fades, we wait a frame... } PA_WaitForVBL(); } return 0; } // End of main()
/** **Splash init function **/ void Menu::init(){ PA_Init8bitBg(0,0); //Init backgrounds PA_InitBgTrans(0); PA_LoadGif( 0, (void*)main_image); // Gif File //Give backgrounds time to load for(uint i = -5; i <= 0; i++){ PA_WaitForVBL(); } }