Skip to content

Commit

Permalink
improve peops
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 26, 2023
1 parent f17dde9 commit 92c0aad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
13 changes: 6 additions & 7 deletions extras/modules/peops/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ enum InterpolationType{

enum SPU_UpdateMode{
SPU_WAITVBLANK = 0,
SPU_DELAY2 = 1,
SPU_DELAY20 = 2,
SPU_DELAY = 100,
};

enum SPU_Priorities{
SPU_PRIORITY_VERY_LOW = 0,
SPU_PRIORITY_LOW = 1,
SPU_PRIORITY_MEDIUM = 2,
SPU_PRIORITY_HIGH = 3,
SPU_PRIORITY_VERY_HIGH = 4,
SPU_PRIORITY_VERY_LOW = 17,
SPU_PRIORITY_LOW = 24,
SPU_PRIORITY_MEDIUM = 32,
SPU_PRIORITY_HIGH = 40,
SPU_PRIORITY_VERY_HIGH = 48,
};

#endif
22 changes: 2 additions & 20 deletions extras/modules/peops/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@

PSP_MODULE_INFO("peops", 0x0007, 1, 0);

int spuupdatemode = SPU_WAITVBLANK;
int sputhreadpriority = SPU_PRIORITY_VERY_LOW;

void (*previous)(void*);

void (* spuWriteRegister)(int reg, int val, int type);
Expand All @@ -39,20 +36,7 @@ xa_decode_t cdr_xa;

void SPUwait()
{
switch(spuupdatemode)
{
case SPU_WAITVBLANK:
sceDisplayWaitVblankStart();
break;

case SPU_DELAY2:
sceKernelDelayThread(2 * 1000);
break;

case SPU_DELAY20:
sceKernelDelayThread(20 * 1000);
break;
}
sceKernelDelayThread(SPU_DELAY);
}

int spu_thread(SceSize args, void *argp)
Expand All @@ -71,9 +55,7 @@ void sceMeAudioInitPatched(int (* function)(), void *stack)
SPUinit();
SPUopen();

static int priorities[] = { 17, 24, 32, 40, 48 };

SceUID thid = sceKernelCreateThread("spu_thread", spu_thread, priorities[sputhreadpriority % (sizeof(priorities) / sizeof(int))], 0x4000, 0, NULL);
SceUID thid = sceKernelCreateThread("spu_thread", spu_thread, SPU_PRIORITY_VERY_HIGH, 0x4000, 0, NULL);
if(thid >= 0) sceKernelStartThread(thid, 0, NULL);
}

Expand Down

0 comments on commit 92c0aad

Please sign in to comment.