Advertising (This ad goes away for registered users. You can Login or Register)

[WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Most of the homebrews discussed in this forum can be downloaded here
User avatar
Joel16
Posts: 912
Joined: Wed Oct 12, 2011 8:47 pm

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Joel16 » Tue Jun 03, 2014 7:31 pm

I'm busy with exams at the moment but I managed to squeeze in some time for testing. I won't be able to starting from tomorrow. And I've tried both with and without the modifications of lua system.c with the isPSP bit removed in the script, it just displays as, "model: 5000" Lol.
Advertising
"Forever in darkness, a guardian devil."

User avatar
Rinnegatamante
VIP
Posts: 841
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Rinnegatamante » Tue Jun 03, 2014 7:47 pm

System.getModel patched. With isPSP modification, your PSP must be recognized as a PSP. What the function does is to search in your PSP/GAME a folder which contains an FBOOT.PBP (on PSVITA, EBOOT.PBP are renamed as FBOOT.PBP due to Sony limitations), if it found a FBOOT.PBP so it return 0, if not, it return 1.

Patched getModel source:

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 || model == 5000){
    sprintf(stringa, "N1000");
    }else if(model == 10000){
	sprintf(stringa, "E1000");
	}else{
    sprintf(stringa, "%i", model);
    }
    lua_pushstring(L, stringa);
    return 1;
}
Advertising
If you want, visit my website: http://rinnegatamante.it :D

User avatar
Joel16
Posts: 912
Joined: Wed Oct 12, 2011 8:47 pm

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Joel16 » Tue Jun 03, 2014 8:14 pm

I'll have a look later, whenever I get some free time.
"Forever in darkness, a guardian devil."

User avatar
Rinnegatamante
VIP
Posts: 841
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Rinnegatamante » Sat Jun 07, 2014 10:55 am

Little update:
Added System.startPSX (start a PBP file with POPS) and Kernel.loadWord (porting of _lw C function).
Improved PSP GO support.
If you want, visit my website: http://rinnegatamante.it :D

saiyan x
Posts: 79
Joined: Mon Oct 31, 2011 1:17 pm
Contact:

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by saiyan x » Sat Jun 07, 2014 10:58 am

Great project but what happened to LPP?

User avatar
Rinnegatamante
VIP
Posts: 841
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Rinnegatamante » Sat Jun 07, 2014 11:13 am

NaNNi was working on the latest LPP version (lpp-c++ trunk) but he currently stopped to update it. Probably, it will be updated in future with new functions like PMF support, 3D model support (OBJ) and other stuffs.
If you want, visit my website: http://rinnegatamante.it :D

User avatar
Rinnegatamante
VIP
Posts: 841
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Rinnegatamante » Sun Jul 06, 2014 5:17 pm

Finally finished my school exams.

Added two new functions:

Code: Select all

System.restart() - Restart interpreter
System.getFileSize(string filename) - Get size in bytes of a file
Moved Kernel class to luaKernel.c

I decided also to publish a new official release so here you are:
http://rinnegatamante.netsons.org/lpp_204.rar

List of functions:

Code: Select all

----------------
Kernel Class
----------------
Kernel.memcpy(u32 addr,u32 source,int size) - Copy block of memory
Kernel.memset(u32 addr,int value,int size) - Fill block of memory
Kernel.memcmp(u32 addr,u32 addr2,int size) - Compare block of memory
Kernel.storeWord(u32 addr,u32 val) - Store Word (Equivalent of _sw C function)
Kernel.loadWord(u32 addr) - Load Word (Equivalent of _lw C function)
----------------
Screen Class
----------------
Screen.debugPrint(int x,int y,string text,u32 color) - Write a text with Debug font
Screen.debugPrintGradient(int x,int y,string text,u32 color1, u32 color2) - Write a gradient text with Debug font
Screen.waitVblankStart(int millisecond) - Wait Display Screen
Screen.clear() - Clear Debug Screen
----------------
Color Class
----------------
Color.new(int R,int G,int B) - Create a new BGR color
Color.getR(int color) - Get R value of a color
Color.getG(int color) - Get G value of a color
Color.getB(int color) - Get B value of a color
----------------
System Class
----------------
System.restart() - Restart interpreter
System.getFileSize(string filename) - Get size in bytes of a file
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)
System.protodofile(string filename) - Temporary dofile/loadmodule replacing - Load a new LUA script restarting interpreter
System.loadModule(string file) - Load and start a PRX module
System.assign(string dev1,string dev2,string dev3) - Assign Device
System.unassign(string dev) - Unassign Device
System.md5sum(string string) - Get crypted MD5 string
System.sha1sum(string string) - Get crypted SHA1 string
System.isPSP() - Check if user is on PSP (1 = PSP, 0 = PSVITA)
System.getModel() - Get PSP Model
System.getTime(int mode) - Get time (mode: 1= hours,2= minutes,3= seconds)
System.getDate(int mode) - Get date (mode: 1= days,2= months,3= years)
System.getFreeSize(string device) - Get free size of selected device
System.getTotalSize(string device) - Get total size of selected device
System.startPBP(string filename) - Start a PBP
System.startPSX(string filename) - Start a PBP with POPS
System.getVersion() - Get firmware version
System.listDirectory() - List a Directory
System.doesFileExist(string file) - Check if file exist
System.renameFile(string file1,string file2) - Rename a File
System.renameDir(string file1,string file2) - Rename a Directory
System.removeFile(string file1,string file2) - Remove a File
System.removeDir(string file1,string file2) - Remove a Directory
System.copyFile(string file1,string file2) - Copy a File
System.copyDir(string file1,string file2) - Copy a Directory
System.createDirectory(string path) - Create a Directory
System.resumeThread() - Resume paused main thread
System.powerIsPowerOnline() - Get Battery status
System.powerIsBatteryExist() - Check if battery exist
System.powerIsBatteryCharging() - Check if battery is in charging
System.powerGetBatteryChargingStatus() - Get charging status
System.powerIsLowBattery() - Check if battery charging status is low
System.powerGetBatteryLifePercent() - Get battery life percent
System.powerGetBatteryLifeTime() - Get battery life time
System.powerGetBatteryTemp() - Get battery temperature
System.powerGetBatteryVolt() - Get battery voltage
----------------
Controls Class
----------------
Controls.read() - Read Controls Buffer
Controls.readPeek() - Peek Controls Buffer
----------------
Controls Methods - Interfacing with PSP buttons
----------------
controls:select
controls:start
controls:up
controls:right
controls:down
controls:left
controls:l
controls:r
controls:triangle
controls:circle
controls:square
controls:home
controls:hold
controls:note
controls:analogX
controls:analogY
controls:buttons
If you want, visit my website: http://rinnegatamante.it :D

User avatar
Rinnegatamante
VIP
Posts: 841
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Rinnegatamante » Sat Oct 11, 2014 11:52 am

Little update:

- Added support to MS on PSP Go (Starting plugin on PSP Go with L + R Triggers now will load main script from MS).
- Added samples in src trunk.
If you want, visit my website: http://rinnegatamante.it :D

krystalgamer
Posts: 34
Joined: Sun Mar 17, 2013 5:35 pm
Location: /boot

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by krystalgamer » Sat Oct 11, 2014 6:00 pm

When I press R I get a black screen.I'm using 6.60 PRO-C.

User avatar
Rinnegatamante
VIP
Posts: 841
Joined: Sat Mar 26, 2011 10:02 am
Contact:

Re: [WIP+RELEASE] lpp.prx - Create PSP/PSVITA plugins in LUA

Post by Rinnegatamante » Sat Oct 11, 2014 8:26 pm

Have you other plugins installed?
Where are you using lpp.prx? (VSH,GAME,POPS)
What revision are you using?
If you want, visit my website: http://rinnegatamante.it :D

Post Reply

Return to “Homebrews”