Repository navigation
Quick Start
OpenLua Bot edited this page Nov 11, 2026
·
1 revision
This page gets a minimal script running on a PSP or in PPSSPP.
Follow Installation. You need at least:
PSP/GAME/OpenLua/EBOOT.PBP
PSP/GAME/OpenLua/script.lua
PSP/GAME/OpenLua/assets/ (if your script loads assets)
OpenLua runs exactly one script: script.lua in the app directory. A minimal
frame loop looks like this:
local bg = color.new(16, 24, 48)
local red = color.new(255, 0, 0)
local font = font.new("assets/font.png", 8, 16)
screen.font(font)
while true do
screen.clear(bg)
draw.fillrect(20, 20, 120, 4, red)
screen.print(20, 40, "Hello PSP")
screen.flip()
endImportant points:
-
screen.flip()presents the frame and pumps audio and timing. A loop without it will not display anything properly. -
color.new(r, g, b)builds a color value. -
font.new(path, cellW, cellH)loads a fixed-cell PNG sheet. If you omit a font, the engine uses its built-in 5x7 font. - Paths are relative to the app directory, not to the script file.
Copy the assets/ folder from the repository next to EBOOT.PBP. The example
uses assets/font.png.
- PSP: launch OpenLua from the Game menu.
-
PPSSPP: open
EBOOT.PBPor point PPSSPP at the app folder. Use a desktop GPU backend; software rendering can be slow or unstable.
local pad = buttons.read()
if pad & buttons.CROSS then
-- X is held
end
if pad & buttons.CIRCLE then
-- O is held
endSee API Reference → buttons for the full mask list.
local img = image.load("assets/test_sheet.png", 64, 64)
image.reset(img)
image.blitsprite(img, 60, 80, 0)
image.fliph(img, true)
image.blitsprite(img, 140, 80, 1)Image functions work both as module calls (image.getw(img)) and as methods
(img:getw()).
-
font.new(path, cellW, cellH)+ PNG sheet: works everywhere. -
sfont.load(path): works everywhere. -
font.load("flash0:/font/ltn0.pgf"): returnsnilin the standard PSP build. PGF support is present in host and opt-in builds only, becausesceLibFontis a per-game user module on real firmware. See Troubleshooting → PGF.
For new projects, bundle a PNG font or use the built-in font.
- API Reference — every module and function.
- Demos — runnable examples for each subsystem.
- Hardware Test Menu — validate the engine on a console.