void Init() { PWR_Init(); CLOCK_Init(); UART_Initialize(); printf("Start\n"); Initialize_ButtonMatrix(); SPIFlash_Init(); //This must come before LCD_Init() for 7e LCD_Init(); CHAN_Init(); SPITouch_Init(); SOUND_Init(); BACKLIGHT_Init(); BACKLIGHT_Brightness(1); AUTODIMMER_Init(); SPI_FlashBlockWriteEnable(1); //Enable writing to all banks of SPIFlash PPMin_TIM_Init(); #ifdef MODULAR //Force protocol to none to initialize RAM Model.protocol = PROTOCOL_NONE; PROTOCOL_Init(1); #endif #if HAS_RTC RTC_Init(); // Watchdog must be running in case something goes wrong (e.g no crystal) #endif }
static void Load(MDFNFILE* fp) { try { std::vector<std::string> SongNames; ssf_loader = new SSFLoader(fp->stream()); SongNames.push_back(ssf_loader->tags.GetTag("title")); Player_Init(1, ssf_loader->tags.GetTag("game"), ssf_loader->tags.GetTag("artist"), ssf_loader->tags.GetTag("copyright"), SongNames, false); SOUND_Init(); EmulatedSSFPlay.fps = 75 * 65536 * 256; EmulatedSSFPlay.MasterClock = MDFN_MASTERCLOCK_FIXED(44100 * 256); Reset(); } catch(...) { Cleanup(); throw; } }