Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 24, 2023
1 parent 89c759c commit 0c26d42
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 22 deletions.
22 changes: 12 additions & 10 deletions core/systemctrl/src/loadercore.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,28 @@ static void checkArkPath(){
// Init Start Module Hook
int InitKernelStartModule(int modid, SceSize argsize, void * argp, int * modstatus, SceKernelSMOption * opt)
{
char modname[32];
SceModule2* mod = (SceModule2*) sceKernelFindModuleByUID(modid);
strncpy(modname, mod->modname, sizeof(modname));

int result = -1;

// Custom Handler registered
if(customStartModule != NULL)
{
// Forward to Handler
result = customStartModule(modid, argsize, argp, modstatus, opt);
}

// VSH replacement
if (strcmp(mod->modname, "vsh_module") == 0){
if (strcmp(modname, "vsh_module") == 0){
if (ark_config->recovery || ark_config->launcher[0]){ // system in recovery or launcher mode
exitLauncher(); // reboot VSH into custom menu
}
}

// load settings and plugins before starting mediasync
if (!pluginLoaded && strcmp(mod->modname, "sceMediaSync") == 0)
if (!pluginLoaded && strcmp(modname, "sceMediaSync") == 0)
{
// Check ARK install path
checkArkPath();
Expand All @@ -240,15 +249,8 @@ int InitKernelStartModule(int modid, SceSize argsize, void * argp, int * modstat
// Remember it
pluginLoaded = 1;
}

// Custom Handler registered
if(customStartModule != NULL)
{
// Forward to Handler
result = customStartModule(modid, argsize, argp, modstatus, opt);
}

// Default start module
// start module
if (result < 0) result = sceKernelStartModule(modid, argsize, argp, modstatus, opt);

return result;
Expand Down
26 changes: 26 additions & 0 deletions extras/modules/peops/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,32 @@
ptr = (void *)patch_buffer; \
}

enum ReverbType{
REVERB_OFF = 0x0000,
REVERB_ROOM = 0x007D,
REVERB_STUDIO_SMALL = 0x0033,
REVERB_STUDIO_MEDIUM = 0x00B1,
REVERB_STUDIO_LARGE = 0x00E3,
REVERB_HALL = 0x01A5,
REVERB_SPACE_ECHO = 0x033D,
REVERB_ECHO_DELAY = 0x0001,
REVERB_HALF_ECHO = 0x0017,
};

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

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,
};

typedef struct
{
/* PEOPS SPU configuration */
Expand Down
22 changes: 11 additions & 11 deletions extras/modules/peops/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@

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

PeopsConfig config;
PeopsConfig config = {
.enablepeopsspu = 1,
.volume = 3,
.reverb = 0,
.interpolation = 2,
.enablexaplaying = 1,
.changexapitch = 0,
.spuirqwait = 1,
.spuupdatemode = SPU_WAITVBLANK,
.sputhreadpriority = SPU_PRIORITY_VERY_LOW,
};

void (*previous)(void*);

Expand Down Expand Up @@ -165,16 +175,6 @@ void PeopsOnModuleStart(SceModule2 * mod){
int module_start(SceSize args, void *argp)
{

config.enablepeopsspu = 1;
config.volume = 3;
config.reverb = 1;
config.interpolation = 2;
config.enablexaplaying = 1;
config.changexapitch = 1;
config.spuirqwait = 1;
config.spuupdatemode = 0;
config.sputhreadpriority = 0;

// Register Module Start Handler
previous = sctrlHENSetStartModuleHandler(PeopsOnModuleStart);

Expand Down
2 changes: 1 addition & 1 deletion extras/modules/peops/psp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

void *malloc(size_t size)
{
SceUID uid = sceKernelAllocPartitionMemory(11, "", PSP_SMEM_High, size + 8, NULL);
SceUID uid = sceKernelAllocPartitionMemory(PSP_MEMORY_PARTITION_USER, "", PSP_SMEM_Low, size + 8, NULL);
if(uid >= 0)
{
unsigned int *p = (unsigned int *)sceKernelGetBlockHeadAddr(uid);
Expand Down

0 comments on commit 0c26d42

Please sign in to comment.