| 377 | } |
| 378 | |
| 379 | void waitForTick(u32 p1, u16 p2) { |
| 380 | if (p1 != 0) { |
| 381 | static s64 nextTick = OSGetTime(); |
| 382 | s64 time = OSGetTime(); |
| 383 | while (time < nextTick) { |
| 384 | JFWDisplay::getManager()->threadSleep((nextTick - time)); |
| 385 | time = OSGetTime(); |
| 386 | } |
| 387 | nextTick = time + p1; |
| 388 | } |
| 389 | else { |
| 390 | static u32 nextCount = VIGetRetraceCount(); |
| 391 | u32 uVar1 = (p2 == 0) ? 1 : p2; |
| 392 | OSMessage msg; |
| 393 | do { |
| 394 | if (!OSReceiveMessage(JUTVideo::getManager()->getMessageQueue(), &msg, OS_MESSAGE_BLOCK)) { |
| 395 | msg = 0; |
| 396 | } |
| 397 | } while (((int)msg - (int)nextCount) < 0); |
| 398 | nextCount = (int)msg + uVar1; |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | void JFWThreadAlarmHandler(OSAlarm *p_alarm, OSContext *p_ctx) { |
| 403 | JFWAlarm *alarm = static_cast<JFWAlarm *>(p_alarm); |
no test coverage detected