Git Product home page Git Product logo

lpp-vita's Introduction

Build Status

Description

Lua Player Plus Vita is the first lua interpreter made for the Sony PlayStation Vita.

The interpreter currently runs under LuaJIT 2.1 with slight additions from Lua 5.2.4 (for example the bit32 lib for bitwise operations). It has also a debug FTP server to correct your errors in runtime.

Official documentation: http://rinnegatamante.github.io/lpp-vita/

Features

Graphics
  • Advanced 2D Graphics Rendering (GPU).
  • Basic 3D Graphics Rendering (GPU).
  • Native support to OBJ models.
  • Native support to TTF/PGF/PVF/OTF fonts.
  • Native support to BMP/PNG/JPG images.
  • Native support to GIF animated images.
  • Built-in rescaler to perform portings from lpp-3ds easily.
Multimedia
  • Complete sound system with support for:
    • WAVEform audio files (.wav) with PCM8/PCM16/ADPCM codecs.
    • Audio Interchange File Format audio files (.aif/.aiff) with PCM8/PCM16 codecs.
    • Moving Picture Expert Group-1/2 Audio Layer 3 audio files (.mp3) with MPEG-1 Audio Layer III/MPEG-2 Audio Layer III codecs.
    • Musical Instrument Digital Interface audio files (.midi).
    • Ogg Media audio files (.ogg/.opus) with Vorbis/Opus codecs.
  • Native support to MP4 video files with support for .srt and .vtt subtitles files.
Controls
  • Controls system with full console support.
  • Support to dualshock rumble feature for PSTV.
  • Support to home button locking/unlocking.
  • Support to lightbar color change for PSTV.
  • Support to gyroscope and accelerometer reading.
  • Support to both touchpads reading.
Network
  • Built-in debug FTP server.
  • Complete sockets system support.
  • Native support to HTTP requests.
  • Support to SSL (HTTPS) for file downloading.
System
  • Access to a lot of Sony syscalls.
  • I/O access for any filesystem.
  • Native support to ZIP archives.
  • Native support to SFO file descriptors.
  • Native support to SQLite databases.
  • Native support to apps installation/uninstallation.
Utilities
  • Timer system.
  • Advanced arithmetical functions support (math library).

Nightly Builds

We offer an automated builder service for our nightly builds powered by Azure Pipelines CI. Nightly builds are automatically updated at each new commit. To take advantage of this service, you can find a proper release here on GitHub with the Nightly tag.

Showcase

Here are some PSVITA homebrews made using Lua Player Plus Vita:

Games
Utilities
Emulators
Engines & Interpreters

Compiling the source

To correctly compile lpp-vita you'll need vitasdk installed and correctly set in your PATH environment variable. You'll also need the following libraries: zlib, libmpg123, libogg, libvorbis, libsndfile, vita2d, libftpvita, libpng, libjpeg-turbo, freetype, libspeexdsp, libopus, lua-jit, libdl. You can install most of them with vita-portlibs and EasyRPG Vita toolchain.

Lua Player Plus Vita supports different flags to enables some features:
-DSKIP_ERROR_HANDLING disables error handling for faster code execution.
-DPARANOID enables extra internal error handling.

Credits

  • vitasdk contributors.
  • xerpi for vita2d and debug FTP code.
  • gnmmarechal for testing the interpreter.
  • hyln9 for vita-luajit.
  • frangarcj for the help during 3D rendering feature addition.
  • TheFloW for some snippets i used and some ideas i borrowed.
  • Misledz for the Lua Player Plus logo.
  • Arkanite for providing a sample for sceAvPlayer used to implement the Video module.
  • EasyRPG Team for the Audio Decoder used for Sound module.
  • lecram for gifdec usd for animated GIFs support.

lpp-vita's People

Contributors

coderobe avatar creckeryop avatar dleovl avatar fatihdgn avatar gnmmarechal avatar rinnegatamante avatar rrhyacinth avatar sharkwouter avatar sonicmastr avatar svennd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lpp-vita's Issues

trying add download

hi I'm trying to download a file using this

-- Checking if connection is available
if Network.isWifiEnabled() then

-- Download 
Network.downloadFile("
-- Loading image in memory and deleting it from storage
img = Graphics.loadImage("ud0:/")

I have the other things sort but when I run it gives me error line 2 is there a different line to download a file

'System.executeUri' prompts for confirmation to close app under certain conditions

Hi,

I've encountered a potential issue with the 'System.executeUri' command when using it in RetroFlow.

For users with a large library of games (over 2,000), after the app executes the 'System.executeUri' command to load a game, they are prompted to accept closing the app.

"The following application will close, Cancel / Okay"

If the game library is smaller there is no message about the app closing.
Any help would be appreciated, not sure if it's related to how much resource the app is using with larger game libraries.

Retroflow launch command for reference:
System.executeUri("psgm:play?titleid=RETROVITA" .. "&param=" .. (def_core_name) .. "&param2=" .. rom_location)
System.exit()

Vita launcher cpp command in case it helps:
char uri[512];
// I've removed an if statement as it's probably not relevant
sprintf(uri, "psgm:play?titleid=%s&param=%s&param2=%s", RETROARCH_TITLE_ID, retro_core, game_path.c_str());
sceAppMgrLaunchAppByUri(0xFFFFF, uri);
sceKernelDelayThread(1000);
sceKernelExitProcess(0);

Thanks

OSK numpad causes flickering bug

How to reproduce ?
Run script in which keyboard is shown, then press the numpad icon, you will see flicker just over the "symbols" keypad. I'm pretty sure it happens with lpp-vita keyboard sample code as well.

Versions affected ?
R6 as well as nightly dating of september 28 2017, I'm using safe eboot.

[Feature Request] Debug Telnet REPL

A built-in Telnet server that exposes interactive mode for the session (debug.debug()) would be useful for development & debugging, in a similar way to the current built-in FTP server that exposes source code & data files for the session.

[Feature Request] SceIoStat functions

Functions that deal with file status (declared in VitaSDK's File Status Library, <psp2/io/stat.h>) are not exposed by LPP, specifically the functions dealing with SceIoStat: sceIoGetstat(), sceIoGetstatByFd(), sceIoChstat(), and sceIoChstatByFd(). (The ByFd variants would likely fold into LPP's handle interface, provided from functions like System.getFile).)

These functions are useful for implementing file managers at least.

Video playback not looping

Hi,

Using the video sample, adding true to Video.open on line 7 the video stops at the end of playback.

Not sure if I'm using the command incorrectly or it is a bug

Using most recent nightly build

HTTP Requests

The 3ds version supports http will the vita version?

Nightlies stopped

Hello!

It looks like the nightlies stopped being released somewhere around the start of 2020. I've tried to build a version of lpp-vita myself but I'm not absolutely sure of everything I'm doing and got tripped up by luajit. I'm not a C person, recent builds would be enormously helpful

Undeletable Apps

About 50% of the apps that I generate from my lua code can't be deleted from the psvita. Not even rebuilding the database will solve this issue.

Disk I/O error

Hi @Rinnegatamante I was hoping you could help me. This is really not an issue of lpp but really I literally can't think of any other place to ask this.

Im using the Custom Live Area app that uses your lua player, and I'm getting disk I/O error on line 22 of a certain lua file:
imagen
I tried messing with the code but couldn't make it to work. Could you have any clue of what is happening?

On line 18 it should enter 74 times, those are the customized app names I have and the number of folders/item on that path. If I reduce it to 70, it works. Also, the app finds 170 titles so the general loop should repeat 170 times.

Also, tried to different SDs. I even tried without SD2VITA, directly on real internal storage.

I've opened an issue on the app's GH but it is unlikely to have an answer: AntHJ/Custom-LiveArea#4

I would appreciate any kind of comment or suggestion regarding this matter.

Thanks in advance.

Graphics.drawPixel not working

in this sample below, drawPixel() does nothing:

while true do
  Graphics.initBlend()
  Screen.clear()  
  Graphics.drawLine(10, 25, 100, 250, Color.new(25, 200, 120))
  Graphics.fillRect(260, 275, 350, 500, Color.new(25, 200, 120))
  Graphics.drawPixel(5, 5, Color.new(25, 200, 120))
  Graphics.termBlend()
  Screen.flip()  
  if Controls.check(Controls.read(), SCE_CTRL_TRIANGLE) then
    System.exit()
  end
end

Static Audio

In RetroFlow/HexFlow/etc there's an issue with the "click" sound. Use the analog stick to move while spamming the "R" button is an easy way to get it: the audio overlaps and causes a super loud glitch sound. You might say "well that's easy, don't hold analog stick and spam R button" but once you have enough apps installed, it happens very often with just using analog stick. I've tried many things to fix it like checking whether the audio is playing before playing the sound again, setting a timer of minimum time before next click is allowed... these solutions ALMOST worked but still sometimes (admittedly less often though) there was the super loud glitch sound. What worked was making the click audio into a .mp4 file and using "Video.jumpToTime(0)" and "Video.resume()" and it will act exactly how I want it: no more super loud glitch sound from overlapping .mp3 audio.

...but there's just 1 issue. Having it as a video causes lag in the app

Can you please add this command? Sound.jumpToTime(click, 0)

It's just an example. In this case, it's assuming the audio file has been loaded to variable "click" by using this feature that already exists: Sound.open("app0:/DATA/click2.wav")

I just need to be able to jump to a time in the audio so 2 sound.play() of the same audio don't glitch out please.

Thank you Rinne for all your good code!!!!! And thanks if you can help figure this out.

Can't draw image...

Hello I'm on LPP Vita v4 and I can't draw iamges.
It's work with the "image sample" but no with my image. I use jpg, png nothing work.
It's give me that error : (C2-12828-1)
Saved Core File Succeeded
ux0:data/psp2core-1472001169-0x0000283fdb-eboot.bin.psp2dmp

And that's my code:

white = Color.new(255,255,255,255)
fond = Graphics.loadImage("ux0:/app/CALC00001/medias/fond.png")
while true do
Graphics.initBlend()
Screen.clear()
Graphics.debugPrint(850, 5, "version 0.1", white)
Graphics.debugPrint(10, 5, "Calculatrice", white)
Graphics.drawImage(50, 50, fond)
Graphics.termBlend()
Screen.flip()
if Controls.check(Controls.read(), SCE_CTRL_START) then
System.exit()
end
end

Mod Sound support [Feature Request]

I'm converting/upgrading my older Lua PSP game to your lpp-vita library. I have some Amiga MOD files used for audio.. I have them converted to mp3 currently. The space savings for MOD files are huge in comparison.. (I don't know how to incorporate the feature)

Just a wishful request. Thank you!

Sound.openMod (has a nice ring to it, no? ;) )

sound.term() crashes app

Perhaps this is an invalid bug, but when using Sound.term() the game crashes. The workaround is simple : don't use it :)

Asynchronous tasks

Would be nice to have asynchronous versions for certain functions that can stall for several seconds. In the specific:

  • System.extractZIP
  • System.extractFromZIP
  • Network.downloadFile
  • Network.requestString
  • Render.loadObject

Error: library routine out of sequence

scheme of the project:

local db = Database.open("file.db")
function a()
  Database.execQuery(db, "CREATE TABLE ....;")
end
function b()
  Database.execQuery(db, "INSERT ....;") --> "error appears here"
end

Maybe i'm stupid but, drawLine()

Can't draw " / " line. if i draw " / " line i am getting " \ " line.
Maybe it's because you're switching y1 and y2 (if y2 < y1) in LuaGraphics.cpp (127 - 131) Lines
last nightly build

LPP doesn't build unless Vita2d extra headers are copied

As the title says, a fresh make won't build as it would throw the following error:

source/luaGraphics.cpp:31:10: fatal error: utils.h: No such file or directory
   31 | #include <utils.h>
      |          ^~~~~~~~~
compilation terminated.

This was tested in three different machines, on fresh installs, installing the VitaSDK with vdpm and immediately trying to build lpp-vita:

  • Windows 10 WSL2 w/Ubuntu 20.04
  • Raspbian something
  • MacOS 12.6

What is missing is the extra step as done by the Github actions:

git clone https://github.com/xerpi/libvita2d
sudo -E cp libvita2d/libvita2d/include/utils.h $VITASDK/arm-vita-eabi/include/utils.h

By doing this, the build finished successfully.

Screen.getPixel()

How to use this function?

This sample is correct?

px = 0
while true do
	Graphics.initBlend()
	Screen.clear(Color.new(255,204,0))
	Graphics.debugPrint(200, 5, px, Color.new(255,255,255) )
       Graphics.termBlend()
	Screen.flip()
	px = Screen.getPixel(10,10)
end

I'm getting only negative values

if I put above Screen.flip(), I have the same result

MP3 file corrupted, but the mp3 plays fine.

I was coding for my PSVITA, and when i was implementing sound, it wouldn't play and would display the error. I have played the song in VitaShell and on my computer and it works fine. Any help?

EDIT - I didnt use sound.Init()

Sound.open does not detect audio file format

I am definitely using a working mp3, it plays fine inside VitaShell, but when I try to open it with Sound.open I just get this error:

unknown audio file format.

This is my code, am I doing something wrong?

local white = Color.new(255,255,255)

Sound.init()

local snd = Sound.open("ux0:/audio.mp3")
Sound.play(snd, LOOP)

while true do
	local pad = Controls.read()
	if Controls.check(pad, SCE_CTRL_CIRCLE) and Sound.isPlaying(snd) then
		Sound.pause(snd)
	elseif Controls.check(pad, SCE_CTRL_SQUARE) and not Sound.isPlaying(snd) then
		Sound.resume(snd)
    end

	Graphics.initBlend()
	Screen.clear()
	Graphics.debugPrint(5, 20, "Press CIRCLE to pause sound.", white)
	Graphics.debugPrint(5, 40, "Press SQUARE to resume sound.", white)
	Screen.flip()

end

Any help is appreciated, thanks :)

document issue's

Just a few typo's :

  • under Graphics > drawPartialImage two times the link, while one should be drawImageExtended
  • under Network > requestStringAsync shows an example of Network.requestString()

Graphics.fillEmptyRect does not draw its lines properly.

In the function lua_emptyrect in C++, the function vita2d_draw_line is used to draw the outline of the defined rectangle.

vita2d_draw_line expects x1, y1, x2, y2, color as arguments.
but in lua_emptyrect the following arguments are given

(x1), (y1), (difference between x2 and x1), (y1), color
(x1), (y2), (difference between x2 and x1), (y2), color
(x1), (y1), (x1), (difference between y2 and y1), color
(x2), (y1), (x2), (difference between y2 and y1), color

example:
if i want to draw a empty Rect from the coordinates
x: 927, y: 64,
to
x: 959, y: 96

It will draw the following lines:
x1: 927, y1: 64, x2: 32, y2: 64
x1: 927, y1: 96, x2: 32, y2: 64
x1: 927, y1: 64, x2: 959, y2: 32
x1: 959, y1: 64, x2: 959, y2: 32

Resulting in something, that locks like the attached ScreenShot
the yellow rectangle in the picture are the same coordinates, but called with fillRect, instead of fillEmptyRect.
2017-10-13-054011

trying to display progress bar

hi man sorry about before in the other one I was trying to rush I will explain better this sorry please help me this is my code below

-- Starting progressbar message
System.setMessage(".\nPlease wait...", true)
if System.doesFileExist("app0:/ud0_files.zip")==true then
System.deleteDirectory("ud0:/")
System.extractZIP("app0:ud0_files.zip", "ud0:/")

as you can see I'm trying to display a progress showing me when extracting the bar doesn't show but when I change if System.doesFileExist("app0:/ud0_files.zip")==true then to ==false then it display the progress bar but nothing gets extracted of course I think its a bug I'm not sure
hopefully you can help me sorry one again about before

General Issues with OBJ loading / Rendering

  • Attempting to load non-existent OBJ results in LPP crashing
  • Buggy Rendering on some Textures
  • Won't render OBJ sub-meshes (individual parts have to be exported into a separate mesh)

Problem with Graphics.fillEmptyRect

Using latest build, unsafe eboot

index.lua:

switch_grey = Color.new(57, 50, 44)

while true do

    Graphics.initBlend()
    Screen.clear()

    Graphics.fillRect(0, 960, 0, 544, switch_grey)

    Graphics.fillEmptyRect(10, 50, 100, 250, Color.new(25, 200, 120))

    Graphics.termBlend()

    Screen.flip()

end

2018-01-31-230842

.vpk download

Unable to open file for writing

Hi,

Not sure if it's a bug or i'm not using the command properly,

When using System.open with FWRITE, FRDWR, FCREATE gives error: cannot open requested file.
the issues doesn't appear when using FREAD

sample:

toWrite = "Hello world"
local fh = System.openFile("app0:/file.txt", FRDWR)
System.writeFile(fh, toWrite, #toWrite)
System.closeFile(fh)

error line 2

using Latest nightly build

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.