Skip to content

Commit

Permalink
added proheaparea, no longer need heaparea2.prx from OFW
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimfaxi committed Jun 30, 2011
1 parent edbc48b commit 7d1e7d2
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 2 deletions.
3 changes: 3 additions & 0 deletions popsloader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ EXTRA_OPTIONS += DEBUG=1
endif

all:
make $(EXTRA_OPTIONS) -C proheaparea
make $(EXTRA_OPTIONS) -C loader
make $(EXTRA_OPTIONS) -C core
@mkdir dist || true
@cp -f loader/popsloader.prx dist
@cp -f core/popscore.prx dist
@cp -rf modules dist
@cp -f proheaparea/proheaparea.prx dist/modules
make $(EXTRA_OPTIONS) clean -C popcorn
make $(EXTRA_OPTIONS) CONFIG_302=1 -C popcorn
@cp -f popcorn/popcorn.prx dist/modules/302/
Expand Down Expand Up @@ -91,6 +93,7 @@ all:
@cp -f popcorn/popcorn.prx dist/modules/639/

clean:
make clean -C proheaparea
make clean -C popcorn
make clean -C loader
make clean -C core
2 changes: 1 addition & 1 deletion popsloader/core/replace_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static int replace_module(int modid, SceSize argsize, void *argp, int *modstatus
if(pops_fw_version <= FW_400) {
char path[128];

sprintf(path, "%sheaparea2.prx", get_module_prefix());
sprintf(path, "%s%sproheaparea.prx", is_ef0() ? "ef" : "ms", MODULE_PATH);
load_start_module(path);
}
}
Expand Down
1 change: 0 additions & 1 deletion popsloader/modules/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Here are the file list you need to run popsloader:
/kd/pops_0*g.prx(>= 6.00) or /kd/pops.prx(<= 5.51)
/kd/impose.prx(<=4.00)
/kd/resource/impose.rsc(<=4.00)
/vsh/module/heaparea2.prx(<=4.00)
/vsh/module/common_util.prx
/vsh/module/pafmini.prx
/vsh/module/libpspvmc.prx(>=3.40)
Expand Down
11 changes: 11 additions & 0 deletions popsloader/proheaparea/Makefile
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
14 changes: 14 additions & 0 deletions popsloader/proheaparea/exports.exp
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

7 changes: 7 additions & 0 deletions popsloader/proheaparea/imports.S
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
64 changes: 64 additions & 0 deletions popsloader/proheaparea/main.c
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;
}

0 comments on commit 7d1e7d2

Please sign in to comment.