int music_init(void) { pspTime tm; cache_init(); xrRtcGetCurrentClockLocalTime(&tm); srand(tm.microseconds); xr_lock_init(&music_l); #ifdef ENABLE_MPC mpc_init(); #endif #ifdef ENABLE_WAV wav_init(); #endif #ifdef ENABLE_TTA tta_init(); #endif #ifdef ENABLE_APE ape_init(); #endif #ifdef ENABLE_MP3 mp3_init(); #endif #ifdef ENABLE_FLAC flac_init(); #endif #ifdef ENABLE_OGG ogg_init(); #endif #ifdef ENABLE_WMA wmadrv_init(); #endif #ifdef ENABLE_WAVPACK wv_init(); #endif #ifdef ENABLE_AT3 at3_init(); #endif #ifdef ENABLE_M4A m4a_init(); #endif #ifdef ENABLE_AAC aac_init(); #endif #ifdef ENABLE_AA3 aa3_init(); #endif memset(&g_list, 0, sizeof(g_list)); g_list.first_time = true; g_shuffle.first_time = true; stack_init(&played); g_music_thread = xrKernelCreateThread("Music Thread", music_thread, 0x12, 0x10000, 0, NULL); if (g_music_thread < 0) { return -EBUSY; } xrKernelStartThread(g_music_thread, 0, 0); return 0; }
int music_init(void) { u32 seed; cache_init(); seed = sctrlKernelRand(); if (seed == 0x8002013A) { pspTime tm; sceRtcGetCurrentClockLocalTime(&tm); seed = tm.microseconds; } srand(seed); xr_lock_init(&music_l); #ifdef ENABLE_MPC mpc_init(); #endif #ifdef ENABLE_WAV wav_init(); #endif #ifdef ENABLE_TTA tta_init(); #endif #ifdef ENABLE_APE ape_init(); #endif #ifdef ENABLE_MP3 mp3_init(); #endif #ifdef ENABLE_FLAC flac_init(); #endif #ifdef ENABLE_OGG ogg_init(); #endif #ifdef ENABLE_WMA wmadrv_init(); #endif #ifdef ENABLE_WAVPACK wv_init(); #endif #ifdef ENABLE_AT3 at3_init(); #endif #ifdef ENABLE_M4A m4a_init(); #endif #ifdef ENABLE_AAC aac_init(); #endif #ifdef ENABLE_AA3 aa3_init(); #endif musiclist_init(&g_music_list); memset(&g_list, 0, sizeof(g_list)); g_list.first_time = true; stack_init(&g_played); g_music_thread = sceKernelCreateThread("Music Thread", music_thread, 0x12, 0x10000, 0, NULL); if (g_music_thread < 0) { return -EBUSY; } sceKernelStartThread(g_music_thread, 0, 0); return 0; }