| 292 | } |
| 293 | |
| 294 | void callbackException(OSError p1, OSContext * p2, u32 p3, u32 p4) |
| 295 | { |
| 296 | haltRumble(); |
| 297 | mspDisplay->startFadeIn(0); |
| 298 | #ifndef DEBUG |
| 299 | JUTException::getManager()->setGamePad((JUTGamePad *)-1); // set to -1 to reset all controllers? |
| 300 | JUTException::waitTime(2000); |
| 301 | |
| 302 | u16 exceptionInputs[] = { |
| 303 | PAD_BUTTON_A, PAD_BUTTON_B, PAD_BUTTON_X, PAD_BUTTON_Y, |
| 304 | PAD_TRIGGER_L, PAD_TRIGGER_R, PAD_TRIGGER_Z, 0x0 |
| 305 | }; |
| 306 | |
| 307 | u32 pressedButton; |
| 308 | for (int i = 0; exceptionInputs[i] != 0;) // keep looping on this until the right button sequence has been pressed |
| 309 | { |
| 310 | JUTException::waitTime(100); |
| 311 | JUTException::getManager()->readPad(&pressedButton, nullptr); |
| 312 | if (pressedButton != 0) |
| 313 | { |
| 314 | i = (pressedButton == exceptionInputs[i]) ? ++i : 0; // if current button doesn't match what's expected, reset i to 0 to restart the sequence |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | JUTException::getManager()->setGamePad(nullptr); |
| 319 | #endif |
| 320 | } |
| 321 | |
| 322 | #ifdef DEBUG |
| 323 | void haltRumble() { |
nothing calls this directly
no test coverage detected