i want to make a prx that can hold files inside of the prx so that they arent loaded in the main eboot and can be loaded and unloaded but i cant get it to work and someone make an example of this and the prx needs to be kernel
my problems:
when i compile i get no lib.stub found (kernel prx) what does this mean and how do i fix it also same
user prx: when i try to load one period it either crashes the program or says no memory for prx so i'm think there isnt any memory for it because my heap size is PSP_HEAP_SIZE_MAX() in the main EBOOT so how do i fix this and i dont really get heap stack and some of the other phrases what are those
Prx troubles
I made a small example of a user prx for someone else. You might look for it. Use PSP_HEAP_SIZE_KB(val); instead of MAX. "val" would be the number of kB... make the value NEGATIVE and it represents all the memory EXCEPT for that many KB. So -256 means use all the memory for the heap except for 256 KB. Make the negative value larger enough that the user prx will fit in what you leave left over.
Set a smaller heap size in your EBOOT like J.F. said.
You can embed files in a PRX using the bin2o or bin2c tools.
bin2c will output a header file with a char array containing your file.
If your embedded file is another module, then you can load it straight from the char array in memory using that sce load module function that supports buffer (forgot the name).
You can embed files in a PRX using the bin2o or bin2c tools.
bin2c will output a header file with a char array containing your file.
If your embedded file is another module, then you can load it straight from the char array in memory using that sce load module function that supports buffer (forgot the name).
This is because you have no imports...when i compile i get no lib.stub found (kernel prx) what does this mean and how do i fix it also same
Anyway, haven't understand your question , some time ago I've writed a module that I'm using for images and I've exported memory addresses to use the images inside the main program..
If you want I can write down a simple example...
Get Xplora!
Sorry, I've tried to upload the file but I can't get "Browse" button working... -.-
This is the code:
main.c:
Makefile:
exports.exp
This is the code:
main.c:
Code: Select all
#include <pspkernel.h>
#include <malloc.h>
PSP_MODULE_INFO("Xplora_images", 0x1000, 1, 8);
static unsigned char* data;
extern unsigned char mouse_start[];
extern unsigned int mouse_size;
int unsstrcopy(unsigned char* string, unsigned int sizeof_string, unsigned char* data)
{
int i=0;
for(;i<(int)sizeof_string; i++)
{
data[i]=string[i];
}
return i;
}
unsigned char* GetMouse(unsigned int* barra_size)
{
*barra_size = mouse_size;
data = (unsigned char*)malloc(*barra_size);
unsstrcopy(mouse_start, *barra_size, data);
return (unsigned char*)(((int)data)&~0x80000000);
}
int module_start(SceSize args, void *argp)
{
return 0;
}
int module_stop(SceSize args, void *argp)
{
return 0;
}
Code: Select all
TARGET = X_images
OBJS = main.o data/img/img_mouse.o
BUILD_PRX = 1
PRX_EXPORTS = exports.exp
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS) -c
LIBS = -lpspmodulemgr_kernel
LDFLAGS = -mno-crt0 -nostartfiles
include $(PSPSDK)/lib/build.mak
all:
psp-build-exports -s exports.exp
rm -f $(TARGET).elf
rm -f *.o
psp-packer -s $(TARGET).prx $(TARGET).prx
data/img/img_mouse.o: data/mouse.png
bin2o -i data/mouse.png data/img/img_mouse.o mouse
Code: Select all
PSP_BEGIN_EXPORTS
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC_HASH(module_start)
PSP_EXPORT_VAR_HASH(module_info)
PSP_EXPORT_END
PSP_EXPORT_START(Xplora_images, 0, 0x4001)
PSP_EXPORT_FUNC(GetMouse)
PSP_EXPORT_END
PSP_END_EXPORTS
Get Xplora!