Repository navigation
Demos
OpenLua Bot edited this page Nov 11, 2026
·
1 revision
Small scripts that exercise the public Lua API. They are deliberately
standalone: the engine loads a single script.lua from its working directory.
The authoritative index is
demos/README.md.
-
Build or install the engine (see Building or Installation).
-
Copy a demo to the app directory as
script.lua:cp demos/smoke.lua /path/to/PSP/GAME/OpenLua/script.lua
-
Copy
assets/next toscript.lua, or run from the repository root whereassets/already exists.
All paths in the demos are relative to the working directory, not the demo file.
| Demo | What it shows | Assets |
|---|---|---|
smoke.lua |
Minimal boot check: clear, fill, outline, line | none |
flip.lua |
image.fliph / image.flipv, sprite frames, source rects |
assets/test_sheet.png |
pgf.lua |
PGF font through font.load/font.setdefault (opt-in builds) |
flash0:/font/ltn0.pgf |
font.lua |
Fixed-cell font loading, screen.print, tint, text width |
assets/font.png |
sfont.lua |
Classic variable-width SFont and fixed-font header |
assets/sfont.png, assets/font.png
|
math.lua |
math.minmax clamping and bitwise helpers |
none |
battery.lua |
Read-only batt.* telemetry |
none |
power.lua |
power.*: AC status, switch lock/unlock, tick |
none |
os.lua |
os.* system info and non-run destructive calls |
none |
hardware.lua |
hw.* identity, firmware, volume/mute, audio route |
none |
sound.lua |
WAV load/loop/volume, audio pumped by screen.flip
|
assets/beep.wav |
transforms.lua |
Rotation, scale, tint, pivot | assets/test_sheet.png |
3d.lua |
Textured rotating OBJ cube and 3D→2D HUD switch | assets/3d/* |
splash.lua |
splash.show/old/oldschool, single images and slideshow |
assets/splash*.png |
osk.lua |
osk.init with a 20-character limit and English mode |
assets/font.png |
game.lua |
Read-only PBP metadata and ICON0/PIC0/PIC1 extraction |
assets/sample.pbp, assets/font.png
|
cam.lua |
GO! CAM lifecycle, live render and snapshot | assets/font.png |
peripherals.lua |
UMD, USB, SIO/IR availability | assets/font.png |
network.lua |
WLAN, loopback socket, HTTP failure paths, FTP, adhoc | assets/font.png |
storage.lua |
files, os.infoms0/infoef0, savedata, cleanup |
assets/font.png |
tester.lua |
Full on-device test menu | all of assets/
|
tester.lua is the self-contained menu used to exercise the whole engine on a
PSP-1000, PSP-2000/3000, PSP-E1000 and PSP Go. It is documented separately:
Quick deploy:
bash tools/package_tester.shThen copy the generated PSP/ tree to ms0: or ef0:.
| File | Size | Regenerate with |
|---|---|---|
assets/font.png |
ASCII 0x20..0x7E, 8x16 cells | python3 tools/gen_font.py |
assets/sfont.png |
Classic SFont, magenta separators | python3 tools/gen_font.py |
assets/beep.wav |
2 s, 440 Hz mono tone | python3 tools/gen_tone.py |
assets/test_sheet.png |
4-frame 64x64 sprite sheet | checked in |
assets/3d/cube.obj |
Original 8-vertex textured cube | python3 tools/gen_3d_assets.py |
assets/3d/cube.mtl |
Cube material | python3 tools/gen_3d_assets.py |
assets/3d/checker.png |
Original 128x128 checker texture | python3 tools/gen_3d_assets.py |
assets/splash*.png |
Splash screens, 480x272 | python3 tools/gen_splash.py |
assets/sample.pbp |
Synthetic PBP with SFO and artwork | python3 tools/gen_pbp.py |
- Image functions accept both module-call and method forms.
- Transforms are per-surface state; reset flips/angle/scale/tint between draws.
-
screen.printrequires a font; load a PNG/SFont in the standard PSP build. - 3D demos must use
amg.begin(), return withamg.mode2d(1)before 2D calls, and present withamg.update()instead ofscreen.flip(). -
splash.*andosk.initare blocking; use them before the main loop. -
cam,umd,usb,sio,irand networking demos are safe without the hardware and show the documented fallback paths.