[WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
- Rinnegatamante
- VIP
- Posts: 841
- Joined: Sat Mar 26, 2011 10:02 am
- Contact:
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
To get PSP Go support, you need to modify extralibs on sourcecode (due to my mistake
), on next release, i'll fix it.
Advertising
If you want, visit my website: http://rinnegatamante.it 
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
Oh, alrightRinnegatamante wrote:To get PSP Go support, you need to modify extralibs on sourcecode (due to my mistake), on next release, i'll fix it.
Advertising
"Forever in darkness, a guardian devil."
- Rinnegatamante
- VIP
- Posts: 841
- Joined: Sat Mar 26, 2011 10:02 am
- Contact:
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
New sourcecodes available on repository!
Fixxed PSP Go issues, now ef0 is correctly recognized.
Rewrote io Library (due to issues which can give like dofile issues) using sceIo library, new functions are:
System.closeFile(int id) - Close a file
System.writeFile(int id, string string,int size) - Write a text in a file
System.readFile(int id,int size) - Read a text from file
System.seekFile(int id,int offset,int position) - Change pointer position in a file (position must be INIT_FILE, END_FILE, CUR_FILE)
System.openFile(string filename,int mode) - Open a file (mode must be PSP_READ, PSP_WRITE, PSP_APPEND, PSP_CREATE)
A textreader sample will be released on next public release of lpp.prx
Fixxed PSP Go issues, now ef0 is correctly recognized.
Rewrote io Library (due to issues which can give like dofile issues) using sceIo library, new functions are:
System.closeFile(int id) - Close a file
System.writeFile(int id, string string,int size) - Write a text in a file
System.readFile(int id,int size) - Read a text from file
System.seekFile(int id,int offset,int position) - Change pointer position in a file (position must be INIT_FILE, END_FILE, CUR_FILE)
System.openFile(string filename,int mode) - Open a file (mode must be PSP_READ, PSP_WRITE, PSP_APPEND, PSP_CREATE)
A textreader sample will be released on next public release of lpp.prx
If you want, visit my website: http://rinnegatamante.it 
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
Hi, for the sake of everyone, please let svn die already and use git. I'm unable to download the source, apart from that, nice work 
Edit: after downloading each file one by one, I couldn't compile it. There seems to be errors in the source. Do you check to see if it compiles before pushing it?
Edit: after downloading each file one by one, I couldn't compile it. There seems to be errors in the source. Do you check to see if it compiles before pushing it?
- Here's the errors.
"Forever in darkness, a guardian devil."
- Rinnegatamante
- VIP
- Posts: 841
- Joined: Sat Mar 26, 2011 10:02 am
- Contact:
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
Try to add this to the systemctrl.h:
Code: Select all
typedef struct SceModule2
{
struct SceModule *next; // 0
u16 attribute; // 4
u8 version[2]; // 6
char modname[27]; // 8
char terminal; // 0x23
char mod_state; // 0x24
char unk1; // 0x25
char unk2[2]; // 0x26
u32 unk3; // 0x28
SceUID modid; // 0x2C
u32 unk4; // 0x30
SceUID mem_id; // 0x34
u32 mpid_text; // 0x38
u32 mpid_data; // 0x3C
void * ent_top; // 0x40
unsigned int ent_size; // 0x44
void * stub_top; // 0x48
u32 stub_size; // 0x4C
u32 entry_addr_; // 0x50
u32 unk5[4]; // 0x54
u32 entry_addr; // 0x64
u32 gp_value; // 0x68
u32 text_addr; // 0x6C
u32 text_size; // 0x70
u32 data_size; // 0x74
u32 bss_size; // 0x78
u32 nsegment; // 0x7C
u32 segmentaddr[4]; // 0x80
u32 segmentsize[4]; // 0x90
} SceModule2; If you want, visit my website: http://rinnegatamante.it 
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
It works now, thankyou.Rinnegatamante wrote:Try to add this to the systemctrl.h:
Code: Select all
typedef struct SceModule2 { struct SceModule *next; // 0 u16 attribute; // 4 u8 version[2]; // 6 char modname[27]; // 8 char terminal; // 0x23 char mod_state; // 0x24 char unk1; // 0x25 char unk2[2]; // 0x26 u32 unk3; // 0x28 SceUID modid; // 0x2C u32 unk4; // 0x30 SceUID mem_id; // 0x34 u32 mpid_text; // 0x38 u32 mpid_data; // 0x3C void * ent_top; // 0x40 unsigned int ent_size; // 0x44 void * stub_top; // 0x48 u32 stub_size; // 0x4C u32 entry_addr_; // 0x50 u32 unk5[4]; // 0x54 u32 entry_addr; // 0x64 u32 gp_value; // 0x68 u32 text_addr; // 0x6C u32 text_size; // 0x70 u32 data_size; // 0x74 u32 bss_size; // 0x78 u32 nsegment; // 0x7C u32 segmentaddr[4]; // 0x80 u32 segmentsize[4]; // 0x90 } SceModule2;
Edit:
My psp go, gives me the same error but at a different string from last time.
Code: Select all
Error: [string "?"]:7: bad argument number #1 to 'getn' (table expected, got nil)Code: Select all
if (System.getModel == "N1000") then
scripts=System.listDirectory("ef0:/seplugins/script")
else
scripts=System.listDirectory("ms0:/seplugins/script")
end
tot=table.getn(scripts)"Forever in darkness, a guardian devil."
- Rinnegatamante
- VIP
- Posts: 841
- Joined: Sat Mar 26, 2011 10:02 am
- Contact:
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
Try to compile with this extralibs.c and tell me if you get the same error:
http://rinnegatamante.netsons.org/extralibs.c
(I think problem is on System.getModel, if lpp.prx starts correctly, try to write a script just to get your psp model with System.getModel and tell me the result)
http://rinnegatamante.netsons.org/extralibs.c
(I think problem is on System.getModel, if lpp.prx starts correctly, try to write a script just to get your psp model with System.getModel and tell me the result)
If you want, visit my website: http://rinnegatamante.it 
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
Thanks It works now and it displays my psp go as a PS vita lol.Rinnegatamante wrote:Try to compile with this extralibs.c and tell me if you get the same error:
http://rinnegatamante.netsons.org/extralibs.c
(I think problem is on System.getModel, if lpp.prx starts correctly, try to write a script just to get your psp model with System.getModel and tell me the result)
Code: Select all
if (System.isPSP() == 1) then
model = "Model: " .. System.getModel()
else
model = "Model: PS Vita"
endDoesn't System.getModel(4) or System.getModel() == 4, mean its a PSP Go?
"Forever in darkness, a guardian devil."
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
Interesting project you have here...
• PS4 1K 2TB OFW • PS3 3K 1TB OFW • PS3 Slim (2103-B) 500GB 4.82 Rebug • PS3 Slim (2003-B) 250GB 4.84 Habib •
• PSV 1K 32GB 3.60 HENkaku • 3x PSP 2K (TA-085v1) 128GB 6.60 ME-2.3 • 1x PSP 2K (TA-085v2) 32GB 6.60 ME-2.3 •
• PSV 1K 32GB 3.60 HENkaku • 3x PSP 2K (TA-085v1) 128GB 6.60 ME-2.3 • 1x PSP 2K (TA-085v2) 32GB 6.60 ME-2.3 •
- Rinnegatamante
- VIP
- Posts: 841
- Joined: Sat Mar 26, 2011 10:02 am
- Contact:
Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA
Strange, it seems that you have any homebrew/psx game on PSP/GAME (Actually, System.isPSP works in this way).
System.getModel() gets you the psp model (PSVITA is recognized by this function as a PSP FAT (1000) so isPSP is to avoid this thing.
Try to delete the isPSP check so use only this:
and tell me the result. 
P.S. getModel gets you directly the code of your model. Sourcecode:
EDIT: In order to fix System.isPSP() try to edit function in luaSystem.c with this:
System.getModel() gets you the psp model (PSVITA is recognized by this function as a PSP FAT (1000) so isPSP is to avoid this thing.
Try to delete the isPSP check so use only this:
Code: Select all
model = "Model: " .. System.getModel()P.S. getModel gets you directly the code of your model. Sourcecode:
Code: Select all
static int lua_getModel(lua_State *L)
{
char stringa[256];
int argc = lua_gettop(L);
if (argc > 0)
{
return luaL_error(L, "System.getModel() takes no argument");
}
int model;
model = ((kuKernelGetModel() + 1) * 1000);
if (model == 4000){
sprintf(stringa, "N1000");
}else if(model == 10000){
sprintf(stringa, "E1000");
}else{
sprintf(stringa, "%i", model);
}
lua_pushstring(L, stringa);
return 1;
}EDIT: In order to fix System.isPSP() try to edit function in luaSystem.c with this:
Code: Select all
static int lua_ispsp(lua_State *L)
{
int argc = lua_gettop(L);
if (argc != 0) return luaL_error(L, "wrong number of arguments");
SceUID id = sceIoDopen("ms0:/PSP/GAME");
SceIoDirent entry;
memset(&entry, 0, sizeof(SceIoDirent));
int found = 0;
while (sceIoDread(id, &entry) > 0)
{
if ((strcmp(entry.d_name, ".") == 0) || (strcmp(entry.d_name, "..") == 0)){}else{
char subdir[256];
strcpy(subdir,"ms0:/PSP/GAME/");
strcat(subdir,entry.d_name);
strcat(subdir,"/FBOOT.PBP");
if(File_Exist(subdir)){
found = 1;
lua_pushnumber(L,0);
break;
}
}
}
sceIoDclose(id);
if (found==0){
lua_pushnumber(L,1);
}
return 1;
}If you want, visit my website: http://rinnegatamante.it 

