Lua Player is a script player for the Sony PSP. With it, you can run applications written in the language Lua. Writing Lua code is both faster and easier than writing for the PSP directly.
Included in the distribution you have downloaded is:
- The LuaPlayer application specific for your PSP version
- Several sample applications
Copy the luaplayer and luaplayer% folders to your (memorystick)/PSP/GAME/
Copy the luaplayer folder to your (memorystick)/PSP/GAME/
There's a list of apps and games available at http://www.luaplayer.org/gallery/
To install them, simply drop the app folder into the /PSP/GAME/luaplayer/Applications/ folder.
Lua is an interpreted language. This means that all applications are distributed in source form, which in turn means that you can look at other people's code. Just go to the Applications folder, and then look at the index.lua inside the applications. There's also documentation inside the Documentation folder, and a Samples folder.
To learn the Lua language, read the Lua book at http://www.lua.org/pil/ and use the resources at the Lua Wiki: http://lua-users.org/wiki/
Feel free to drop by at the LuaPlayer forums at http://forums.ps2dev.org/viewforum.php?f=21
This forum is for LuaPlayer- and Lua on PSP-specific questions and discussions, not general Lua questions.
See doc/ for all functions and libraries that are specific to LuaPlayer.
Making your app play nicely with Lowser is very simple:
- The main script file should be called
index.lua. Place it, with all its resources in a folder with the application's name (spaces and everything is allowed; make the name nice: "Foobar's Magical Quest", not "foobar_game") - Instruct your downloaders to install your game in
memorystick:/PSP/GAME/luaplayer/Applications/ - Make your game exitable, please. Just make sure that the end of the file is reachable. Your main loop could look something like this:
while not Controls.read():start() do
-- your app's code
endIf you don't want your application to rely on an already-installed LuaPlayer on your end user's PSP, you might want to create a stand-alone version of LuaPlayer bundling only your LuaPlayer application. This standalone version will not include the file browser/application launcher Lowser. It does, however, require that you are familiar with the unix build system, have the latest PSP toolchain installed, and the dependencies listed below.
Put your lua app files (either a Lowser-compatible folder or package, or just loose files with a main script.lua) in standalone/app folder. Modify the Makefile.psp-standalone makefile to match your app name, change title-icon.png, and run:
make -f Makefile.psp-standalone release10 # for firmware 1.0
# or
make -f Makefile.psp-standalone release15 # for firmware 1.5from the luaplayer directory.
When LuaPlayer starts up, it will look for a script to load in the following locations, and in the following order:
./luaplayer/script.lua./luaplayer/[Application bundle or package]/index.lua./luaplayer/[Application bundle or package]/script.lua./luaplayer/System/system.lua
LuaPlayer can be built as a desktop application on Linux for development and testing.
sudo apt install build-essential cmake \
liblua5.4-dev libfreetype-dev libpng-dev libjpeg-dev \
libmikmod-dev libsdl2-devmkdir build
cd build
cmake ..
makeThe luaplayer executable will be created in the build directory. Run it with a Lua script:
./luaplayer [-scale N] path/to/script.luaOptions:
-scale N: Set display scale factor (1-8, default: 2)
| Key | PSP Button |
|---|---|
| Arrow keys | D-pad |
| A | Select |
| S | Start |
| Q | L Trigger |
| W | R Trigger |
| R | Triangle |
| F | Circle |
| C | Cross |
| D | Square |
| ESC | Exit |
If you want to help out with writing code for the LuaPlayer project, you're reading the right section. Lots of work needs to be done before LP can be considered stable. There's a bunch of undocumented bugs all over the place, for example.
Current maintainers are Frank 'Shine' Buss (fb@frank-buss.de) and Joachim 'Nevyn' Bengtsson (joachimb@gmail.com).
You're welcome to submit code patches, ideas and bug reports to http://forums.ps2dev.org/viewforum.php?f=21
All the dependencies are available at svn://svn.ps2dev.org/
Required to build LuaPlayer:
- A recent version of oopo's PSP toolchain
- zlib, libpng, libjpeg, freetype, liblua, liblualib, mikmodlib
svn checkout svn://svn.ps2dev.org/pspware/LuaPlayer/Build options:
make # Creates the eboot
make kxploit # Creates luaplayer and luaplayer% folders
make release10 # Entire distribution folder with 1.0 binaries
make release15 # ditto for 1.5