Skip to content

Commit

Permalink
Pause for a bit when launching on a VitaTV
Browse files Browse the repository at this point in the history
This should allow the controller to sync (resolves #74)
  • Loading branch information
yifanlu committed Aug 12, 2017
1 parent c8e6e6a commit 5b2c8f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ target_link_libraries(taihen
SceModulemgrForDriver_stub
SceIofilemgrForDriver_stub
SceSblACMgrForDriver_stub
SceSblAIMgrForDriver_stub
SceDebugForDriver_stub
SceCtrlForDriver_stub
)
Expand Down
6 changes: 6 additions & 0 deletions taihen.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
*/
#include <psp2kern/types.h>
#include <psp2kern/ctrl.h>
#include <psp2kern/sblaimgr.h>
#include <psp2kern/kernel/modulemgr.h>
#include <psp2kern/kernel/threadmgr.h>
#include <taihen/parser.h>
#include "error.h"
#include "hen.h"
Expand Down Expand Up @@ -341,6 +343,10 @@ int module_start(SceSize argc, const void *args) {
LOG("HEN patches failed: %x", ret);
return SCE_KERNEL_START_FAILED;
}
if (ksceSblAimgrIsDolce()) {
LOG("VitaTV detected, waiting a couple of seconds for controller to sync...");
ksceKernelDelayThread(300000); // 3 seconds
}
ksceCtrlPeekBufferPositive(0, &ctrl, 1);
LOG("buttons held: 0x%08X", ctrl.buttons);
if (!(ctrl.buttons & (SCE_CTRL_LTRIGGER | SCE_CTRL_L1))) {
Expand Down

0 comments on commit 5b2c8f2

Please sign in to comment.