| 139 | #endif |
| 140 | |
| 141 | void SystemInit() { |
| 142 | #ifdef HW_RVL |
| 143 | L2Enhance(); |
| 144 | |
| 145 | u32 ios = IOS_GetVersion(); |
| 146 | |
| 147 | if(!SupportedIOS(ios)) |
| 148 | { |
| 149 | s32 preferred = IOS_GetPreferredVersion(); |
| 150 | |
| 151 | if(SupportedIOS(preferred)) |
| 152 | IOS_ReloadIOS(preferred); |
| 153 | } |
| 154 | #else |
| 155 | ipl_set_config(6); // disable Qoob modchip |
| 156 | #endif |
| 157 | |
| 158 | USBGeckoOutput(); |
| 159 | __exception_setreload(8); |
| 160 | |
| 161 | InitializeVideo(); // Initialize video |
| 162 | InitialiseSound(); |
| 163 | |
| 164 | #ifdef HW_RVL |
| 165 | // Wii Power/Reset buttons |
| 166 | __STM_Close(); |
| 167 | __STM_Init(); |
| 168 | __STM_Close(); |
| 169 | __STM_Init(); |
| 170 | SYS_SetPowerCallback(ShutdownCB); |
| 171 | SYS_SetResetCallback(ResetCB); |
| 172 | |
| 173 | WiiDRC_Init(); |
| 174 | isWiiVC = WiiDRC_Inited(); |
| 175 | WPAD_Init(); |
| 176 | WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB); |
| 177 | DI_Init(); |
| 178 | USBStorage_Initialize(); |
| 179 | #else |
| 180 | DVD_Init (); // Initialize DVD subsystem (GameCube only) |
| 181 | #endif |
| 182 | |
| 183 | SetupPads(); |
| 184 | InitDeviceThread(); |
| 185 | MountAllFAT(); // Initialize libFAT for SD and USB |
| 186 | |
| 187 | #ifdef HW_RVL |
| 188 | InitMem2Manager(); |
| 189 | #endif |
| 190 | |
| 191 | InitFreeType((u8*)font_ttf, font_ttf_size); // Initialize font system |
| 192 | } |
| 193 | |
| 194 | static void ExitCleanup() |
| 195 | { |
no test coverage detected