| 147 | #endif |
| 148 | |
| 149 | void SystemInit() { |
| 150 | #ifdef USE_VM |
| 151 | VM_Init(ARAM_SIZE, MRAM_BACKING); // Setup Virtual Memory with the entire ARAM |
| 152 | #endif |
| 153 | |
| 154 | #ifdef HW_RVL |
| 155 | L2Enhance(); |
| 156 | |
| 157 | u32 ios = IOS_GetVersion(); |
| 158 | |
| 159 | if(!SupportedIOS(ios)) |
| 160 | { |
| 161 | s32 preferred = IOS_GetPreferredVersion(); |
| 162 | |
| 163 | if(SupportedIOS(preferred)) |
| 164 | IOS_ReloadIOS(preferred); |
| 165 | } |
| 166 | #else |
| 167 | ipl_set_config(6); // disable Qoob modchip |
| 168 | #endif |
| 169 | |
| 170 | USBGeckoOutput(); |
| 171 | __exception_setreload(8); |
| 172 | |
| 173 | InitVideo(); // Initialize video |
| 174 | InitialiseAudio(); |
| 175 | |
| 176 | #ifdef HW_RVL |
| 177 | // Wii Power/Reset buttons |
| 178 | __STM_Close(); |
| 179 | __STM_Init(); |
| 180 | __STM_Close(); |
| 181 | __STM_Init(); |
| 182 | SYS_SetPowerCallback(ShutdownCB); |
| 183 | SYS_SetResetCallback(ResetCB); |
| 184 | |
| 185 | WiiDRC_Init(); |
| 186 | isWiiVC = WiiDRC_Inited(); |
| 187 | WPAD_Init(); |
| 188 | WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB); |
| 189 | DI_Init(); |
| 190 | USBStorage_Initialize(); |
| 191 | #else |
| 192 | DVD_Init (); // Initialize DVD subsystem (GameCube only) |
| 193 | #endif |
| 194 | |
| 195 | SetupPads(); |
| 196 | InitDeviceThread(); |
| 197 | MountAllFAT(); // Initialize libFAT for SD and USB |
| 198 | |
| 199 | #ifdef HW_RVL |
| 200 | InitMem2Manager(); |
| 201 | #endif |
| 202 | |
| 203 | InitFreeType((u8*)font_ttf, font_ttf_size); // Initialize font system |
| 204 | } |
| 205 | |
| 206 | static void ExitCleanup() |
no test coverage detected