PSP Slim RAM partitions
Is anybody updating this page
http://wiki.ps2dev.org/psp:memory_map
on RAM partion for S&L too?
Thanks, by best to all
http://wiki.ps2dev.org/psp:memory_map
on RAM partion for S&L too?
Thanks, by best to all
And they shouldn't call "kernel partition" to the volatile one too :pmypspdev wrote:Is anybody updating this page
http://wiki.ps2dev.org/psp:memory_map
on RAM partion for S&L too?
Thanks, by best to all
User modules can be loaded there while kernel ones can't, so it is not definitely an appropiate name.
I'm trying to investigate on, just as an exercise:
But it doesn't work properly.
Could please anyone check whet's wrong? thanks in advance
Code: Select all
void check_RAM()
{
int i;
PspSysmemPartitionInfo pinfo;
for(i = 0; i < 6; i++)
{
memset(&pinfo, 0, sizeof(pinfo));
pinfo.size = sizeof(pinfo);
sceKernelQueryMemoryPartitionInfo(i + 1, &pinfo);
printf( "%u 0x%08x 0x%08x 0x%08x 0x%08x 0x%x", i + 1, pinfo.memsize, pinfo.startaddr, sceKernelPartitionTotalFreeMemSize (i + 1), sceKernelPartitionMaxFreeMemSize (i + 1), pinfo.attr);
}
}
Could please anyone check whet's wrong? thanks in advance
Solved:
#step 1 Create a prx under 1.50 kernel
#step 2: create a main program 3.xx calling RAMprx:
#step 1 Create a prx under 1.50 kernel
Code: Select all
#include <pspsdk.h>
#include <pspkernel.h>
#include <pspctrl.h>
#include <string.h>
#include <pspsysmem_kernel.h>
PSP_MODULE_INFO("MyRAMPRX", 0x1006, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
int PTotFreeMemSize(int i)
{
u32 k1;
k1 = pspSdkSetK1(0);
int pttfms=sceKernelPartitionTotalFreeMemSize(i);
pspSdkSetK1(k1);
return pttfms;
}
int PMaxFreeMemSize(int i)
{
u32 k1;
k1 = pspSdkSetK1(0);
int ptmfms=sceKernelPartitionMaxFreeMemSize(i);
pspSdkSetK1(k1);
return ptmfms;
}
PspSysmemPartitionInfo RAMpinfo(int i)
{
u32 k1;
k1 = pspSdkSetK1(0);
PspSysmemPartitionInfo pinfo;
memset(&pinfo, 0, sizeof(pinfo));
pinfo.size = sizeof(pinfo);
sceKernelQueryMemoryPartitionInfo(i, &pinfo);
pspSdkSetK1(k1);
return pinfo;
}
int module_start(SceSize args, void *argp)
{
return 0;
}
int module_stop()
{
return 0;
}
Code: Select all
#include <pspsdk.h>
#include <pspkernel.h>
#include <pspctrl.h>
#include <string.h>
#include <pspsysmem_kernel.h>
PSP_MODULE_INFO("MyRAMPRXLoader", 0, 1, 0);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
PSP_HEAP_SIZE_KB(2500);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Functions imported from prx:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int PMaxFreeMemSize(int i);
int PTotFreeMemSize(int i);
PspSysmemPartitionInfo RAMpinfo(int i);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Globals:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Main:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main(){
SceUID modid;
pspDebugScreenInit();
pspDebugScreenPrintf("Eboot test\n");
modid = pspSdkLoadStartModule("MyRAMPRX.prx", PSP_MEMORY_PARTITION_KERNEL);
if (modid < 0){
pspDebugScreenPrintf("Error 0x%08X loading/starting MyRAMPRX.prx.\n", modid);
sceKernelDelayThread(5*1000*1000);
return -1;
}
pspDebugScreenPrintf("Module ID %08X\n", modid);
int i=0;
for (i=1;i<7;i++)
{
int k=PTotFreeMemSize(i);
pspDebugScreenPrintf("Total Free Mem Size - Partition %u 0x%08x ", i, k);
pspDebugScreenPrintf(" \n");
int pmfms=PMaxFreeMemSize(i);
pspDebugScreenPrintf("Max Free Mem Size - Partition %u 0x%08x ",i , pmfms);
pspDebugScreenPrintf(" \n");
PspSysmemPartitionInfo pinfo;
pinfo=RAMpinfo(i);
pspDebugScreenPrintf( "Partition %u - memsize: 0x%08x start addr: 0x%08x attr: 0x%x", i, pinfo.memsize, pinfo.startaddr, pinfo.attr);
pspDebugScreenPrintf(" \n");
}
pspDebugScreenPrintf("Press X to quit\n");
SceCtrlData pad;
while(1){
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS){
break;
}
}
sceKernelExitGame();
return 0;
}
-
- Posts: 86
- Joined: Thu Aug 17, 2006 3:27 am