-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added proheaparea, no longer need heaparea2.prx from OFW
- Loading branch information
Showing
7 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
TARGET = proheaparea | ||
OBJS = main.o imports.o | ||
|
||
CFLAGS = -Os -G0 -Wall -I. -I ~/635PRO/Common -I ~/635PRO/include -fno-toplevel-reorder -nostartfiles | ||
PSP_FW_VERSION=635 | ||
BUILD_PRX=1 | ||
|
||
PRX_EXPORTS = exports.exp | ||
|
||
PSPSDK = $(shell psp-config --pspsdk-path) | ||
include $(PSPSDK)/lib/build.mak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Define the exports for the prx | ||
PSP_BEGIN_EXPORTS | ||
|
||
PSP_EXPORT_START(syslib, 0, 0x8000) | ||
PSP_EXPORT_FUNC_HASH(module_start) | ||
PSP_EXPORT_FUNC_HASH(module_stop) | ||
PSP_EXPORT_VAR_HASH(module_info) | ||
PSP_EXPORT_END | ||
|
||
PSP_EXPORT_START(scePafHeaparea, 0x0011, 0x0001) | ||
PSP_EXPORT_FUNC_NID(scePafHeaparea_F50AAE41, 0xF50AAE41) | ||
PSP_EXPORT_FUNC_NID(scePafHeaparea_ACCE25B2, 0xACCE25B2) | ||
PSP_EXPORT_END | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.set noreorder | ||
|
||
#include "pspstub.s" | ||
|
||
STUB_START "SysMemUserForUser",0x40000011,0x00010005 | ||
STUB_FUNC 0x2A3E5280,sceKernelQueryMemoryInfo | ||
STUB_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#include <pspsdk.h> | ||
#include <pspsysmem.h> | ||
|
||
PSP_MODULE_INFO("PROPafHeaparea_Module", 0x0000, 1, 0); | ||
|
||
SceUID g_fpl = -1, g_fpl2 = -1; | ||
void *g_fpl_address = NULL, *g_fpl_address2 = NULL; | ||
|
||
extern int sceKernelQueryMemoryInfo(int *addr, int *memid, int unk); | ||
|
||
u32 system_heap_size = 0x00230000; | ||
u32 paf_heap_size = 0x00030000; | ||
|
||
void scePafHeaparea_F50AAE41(void **address, u32 *size) | ||
{ | ||
*address = g_fpl_address; | ||
*size = system_heap_size; | ||
} | ||
|
||
void scePafHeaparea_ACCE25B2(void **address, u32 *size) | ||
{ | ||
*address = g_fpl_address2; | ||
*size = paf_heap_size; | ||
} | ||
|
||
int module_start(SceSize args, void* argp) | ||
{ | ||
int memid = 0, ret; | ||
int unk = 0x05000001; | ||
|
||
ret = sceKernelQueryMemoryInfo(&unk, &memid, 0); | ||
|
||
if(ret < 0) { | ||
return ret; | ||
} | ||
|
||
g_fpl = sceKernelCreateFpl("ScePafSystemHeaparea", memid, 0, system_heap_size, 1, NULL); | ||
|
||
if(g_fpl < 0) { | ||
return g_fpl; | ||
} | ||
|
||
sceKernelTryAllocateFpl(g_fpl, &g_fpl_address); | ||
|
||
g_fpl2 = sceKernelCreateFpl("ScePafLonglifeHeaparea", memid, 0, paf_heap_size, 1, NULL); | ||
|
||
if(g_fpl2 < 0) { | ||
return g_fpl2; | ||
} | ||
|
||
sceKernelTryAllocateFpl(g_fpl2, &g_fpl_address2); | ||
|
||
return 0; | ||
} | ||
|
||
int module_stop(SceSize args, void* argp) | ||
{ | ||
sceKernelFreeFpl(g_fpl, g_fpl_address); | ||
sceKernelDeleteFpl(g_fpl); | ||
sceKernelFreeFpl(g_fpl2, g_fpl_address2); | ||
sceKernelDeleteFpl(g_fpl2); | ||
|
||
return 0; | ||
} |