Exemplo n.º 1
0
static bool psp_audio_start(void *data)
{
    psp_audio_t* psp = (psp_audio_t*)data;

#if defined(VITA)
    SceKernelThreadInfo info;

    info.size = sizeof(SceKernelThreadInfo);

    if (sceKernelGetThreadInfo(
                psp->thread, &info) < 0) /* Error */
        return false;

    if (info.status != PSP2_THREAD_STOPPED)
        return false;

#else
    SceKernelThreadRunStatus runStatus;

    runStatus.size    = sizeof(SceKernelThreadRunStatus);

    if (sceKernelReferThreadRunStatus(
                psp->thread, &runStatus) < 0) /* Error */
        return false;
    if (runStatus.status != PSP_THREAD_STOPPED)
        return false;

#endif

    psp->running = true;

    sceKernelStartThread(psp->thread, sizeof(psp_audio_t*), &psp);

    return true;
}
Exemplo n.º 2
0
static bool psp_audio_start(void *data)
{
   SceKernelThreadRunStatus runStatus;
   psp1_audio_t* psp = (psp1_audio_t*)data;

   runStatus.size = sizeof(SceKernelThreadRunStatus);

   if (sceKernelReferThreadRunStatus(
            psp->thread, &runStatus) < 0) /* Error */
      return false;
   if (runStatus.status != PSP_THREAD_STOPPED)
      return false;

   psp->running = true;

   sceKernelStartThread(psp->thread, sizeof(psp1_audio_t*), &psp);

   return true;
}
Exemplo n.º 3
0
static bool psp_audio_stop(void *data)
{
   SceKernelThreadRunStatus runStatus;
   SceUInt timeout = 100000;
   psp1_audio_t* psp = (psp1_audio_t*)data;

   runStatus.size = sizeof(SceKernelThreadRunStatus);

   if (sceKernelReferThreadRunStatus(
            psp->thread, &runStatus) < 0) /* Error */
      return false;
   if (runStatus.status == PSP_THREAD_STOPPED)
      return false;

   psp->running = false;
   sceKernelWaitThreadEnd(psp->thread, &timeout);

   return true;
}
Exemplo n.º 4
0
static bool psp_audio_stop(void *data)
{
    SceUInt timeout   = 100000;
    psp_audio_t* psp = (psp_audio_t*)data;

#if defined(VITA)
    SceKernelThreadInfo info;

    info.size = sizeof(SceKernelThreadInfo);

    if (sceKernelGetThreadInfo(
                psp->thread, &info) < 0) /* Error */
        return false;

    if (info.status == PSP2_THREAD_STOPPED)
        return false;

#else
    SceKernelThreadRunStatus runStatus;

    runStatus.size    = sizeof(SceKernelThreadRunStatus);

    if (sceKernelReferThreadRunStatus(
                psp->thread, &runStatus) < 0) /* Error */
        return false;

    if (runStatus.status == PSP_THREAD_STOPPED)
        return false;

#endif

    psp->running = false;
#if defined(VITA)
    sceKernelWaitThreadEnd(psp->thread, NULL, &timeout);
#else
    sceKernelWaitThreadEnd(psp->thread, &timeout);
#endif

    return true;
}