Lua Player Plus Vita
Documentation of lpp-vita
System

Module that handles system related utilities. More...

Enumerations

enum  IOFlags { FREAD , FWRITE , FRDWR , FCREATE }
 I/O attributes to use with System.openFile. More...
 
enum  IOSeek { SET , CUR , END }
 I/O seek modes to use with System.seekFile. More...
 
enum  PowerTimer { AUTO_SUSPEND_TIMER , SCREEN_OFF_TIMER , SCREEN_DIMMING_TIMER }
 Power management timer features. More...
 
enum  ImgFmt { FORMAT_BMP , FORMAT_JPG , FORMAT_PNG }
 Image format modes to use with System.takeScreenshot. More...
 
enum  BtnMode {
  BUTTON_NONE , BUTTON_OK , BUTTON_CANCEL , BUTTON_OK_CANCEL ,
  BUTTON_YES_NO
}
 Buttons schemes for System.setMessage. More...
 
enum  DlgState { RUNNING , FINISHED , CANCELED }
 Dialog states for system messages and system keyboard. More...
 
enum  MntPerm { READ_ONLY , READ_WRITE }
 Mount permissions for partition mounting. More...
 

Functions

int System::openFile (string filename, IOFlags flags)
 Open a file. More...
 
void System::writeFile (int handle, string text, int len)
 Write into an opened file. More...
 
string System::readFile (int handle, int len)
 Read from an opened file. More...
 
void System::seekFile (int handle, int pos, IOSeek seek)
 Move cursor of an opened file. More...
 
int System::sizeFile (int handle)
 Calculate size of an opened file in bytes. More...
 
table System::statFile (string filename)
 Extract info of a file/directory. More...
 
table System::statOpenedFile (int handle)
 Extract info of an opened file. More...
 
void System::closeFile (int handle)
 Close an opened file. More...
 
bool System::doesFileExist (string filename)
 Check if a file exists. More...
 
bool System::doesDirExist (string dirname)
 Check if a folder exists. More...
 
void System::rename (string filename, string filename2)
 Rename or move a file. More...
 
void System::copyFile (string filename, string filename2)
 Copy a file. More...
 
void System::deleteFile (string filename)
 Delete a file. More...
 
void System::deleteDirectory (string dirname)
 Delete a directory. More...
 
void System::createDirectory (string dirname)
 Create a new directory. More...
 
table System::listDirectory (string dirname)
 List a directory contents. More...
 
void System::exit (void)
 Close the interpreter. More...
 
string System::getFirmware (void)
 Get unspoofed system firmware version. More...
 
string System::getSpoofedFirmware (void)
 Get spoofed system firmware version. More...
 
string System::getFactoryFirmware (void)
 Get factory system firmware version. More...
 
void System::wait (int msecs)
 Sleep the application for a certain time. More...
 
bool System::isBatteryCharging (void)
 Check if the battery is under charge. More...
 
int System::getBatteryPercentage (void)
 Get current battery life percentage. More...
 
int System::getBatteryLife (void)
 Get current battery life. More...
 
int System::getBatteryCapacity (void)
 Get current battery capacity. More...
 
int System::getBatteryFullCapacity (void)
 Get full battery capacity. More...
 
int System::getBatteryTemp (void)
 Get battery temperature. More...
 
int System::getBatteryVolt (void)
 Get battery voltage. More...
 
int System::getBatteryHealth (void)
 Get battery state of health percentage. More...
 
int System::getBatteryCycles (void)
 Get battery cycles count. More...
 
void System::disableTimer (PowerTimer timer)
 Disable a power management timer feature. More...
 
void System::enableTimer (PowerTimer timer)
 Enable a power management timer feature. More...
 
void System::resetTimer (PowerTimer timer)
 Reset a power management timer feature. More...
 
void System::setCpuSpeed (int clock)
 Set CPU clock speed. More...
 
void System::setGpuSpeed (int clock)
 Set GPU clock speed. More...
 
void System::setBusSpeed (int clock)
 Set BUS clock speed. More...
 
int System::getCpuSpeed (void)
 Get CPU clock speed. More...
 
int System::getGpuSpeed (void)
 Get GPU clock speed. More...
 
int System::getBusSpeed (void)
 Get BUS clock speed. More...
 
int System::getGpuXbarSpeed (void)
 Get GPU Crossbar clock speed. More...
 
void System::launchEboot (string filename)
 Launches a binary file. More...
 
void System::launchApp (string titleid)
 Launches an installed application. More...
 
void System::getFreeSpace (string dev)
 Get free space for a given device. More...
 
void System::getTotalSpace (string dev)
 Get total space for a given device. More...
 
int[] System::getTime (void)
 Get console time. More...
 
int[] System::getDate (void)
 Get console date. More...
 
string System::getUsername (void)
 Get account username. More...
 
int System::getLanguage (void)
 Get console language. More...
 
int System::getModel (void)
 Get console model. More...
 
string System::getPsId (void)
 Get console unique PsId. More...
 
string System::getTitle (void)
 Get running application title. More...
 
string System::getTitleID (void)
 Get running application title ID. More...
 
table System::extractSfo (string filename)
 Extract info from an SFO file. More...
 
void System::extractPbp (string filename, string dirname)
 Extract a PBP file (synchronous). More...
 
void System::extractZip (string filename, string dirname)
 Extract a ZIP file (synchronous). More...
 
void System::extractFromZip (string filename, string file, string destname)
 Extract a specific file from a ZIP file (synchronous). More...
 
void System::extractZipAsync (string filename, string dirname)
 Extract a ZIP file (asynchronous). More...
 
void System::extractFromZipAsync (string filename, string file, string destname)
 Extract a specific file from a ZIP file (asynchronous). More...
 
void System::compressZip (string path, string filename, int ratio)
 Compress a file or a folder in a ZIP file (synchronous). More...
 
void System::addToZip (string path, string filename, string parent, int ratio)
 Add a file or a folder in a ZIP file (synchronous). More...
 
int System::getAsyncState (void)
 Get current state of an asynchronous task. More...
 
string System::getAsyncResult (void)
 Get result from a finished asynchronous task. More...
 
void System::takeScreenshot (string filename, ImgFmt format, int ratio)
 Take a screenshot. More...
 
void System::executeUri (string uri)
 Execute an URI call. More...
 
int System::reboot (void)
 Reboot the console. More...
 
int System::shutdown (void)
 Shutdown the console. More...
 
int System::standby (void)
 Put the console in standby. More...
 
bool System::isSafeMode (void)
 Get if application is running in safe mode. More...
 
void System::setMessage (string text, bool progressbar, BtnMode buttons)
 Start a system message instance. More...
 
DlgState System::getMessageState (void)
 Get current system message instance state. More...
 
void System::setMessageProgress (int progress)
 Set current progress for the system message instance. More...
 
void System::setMessageProgMsg (string text)
 Set a submessage for the system message instance. More...
 
void System::closeMessage (void)
 Close the current system message instance. More...
 
void System::unmountPartition (int idx)
 Unmount an already mounted partition. More...
 
void System::mountPartition (int idx, MntPerm perms)
 Mount an unmounted partition. More...
 
void System::installApp (string dir)
 Install an extracted app. More...
 
void System::uninstallApp (string titleid)
 Uninstall an installed app. More...
 
bool System::doesAppExist (string titleid)
 Check if an app is installed. More...
 
string System::getBootParams (void)
 Retrieve params used at app boot. More...
 
int System::loadUserPlugin (string path)
 Load and start an user plugin. More...
 
int System::loadKernelPlugin (string path)
 Load and start a kernel plugin. More...
 
void System::unloadUserPlugin (int plug_id)
 Stop and unload an user plugin. More...
 
void System::unmountMountpoint (string mnt)
 Unmount a virtual mountpoint. More...
 

Detailed Description

Module that handles system related utilities.

Enumeration Type Documentation

◆ IOFlags

enum IOFlags

I/O attributes to use with System.openFile.

Enumerator
FREAD 

Read attribute.

FWRITE 

Write attribute.

FRDWR 

Read/Write attribute.

FCREATE 

Create/Write attribute.

◆ IOSeek

enum IOSeek

I/O seek modes to use with System.seekFile.

Enumerator
SET 

Starts from the begin of the file.

CUR 

Starts from current position.

END 

Starts from the end of the file.

◆ PowerTimer

enum PowerTimer

Power management timer features.

Enumerator
AUTO_SUSPEND_TIMER 

Automatic console suspension.

SCREEN_OFF_TIMER 

Automatic screen disabling.

SCREEN_DIMMING_TIMER 

Automatic screen dimming.

◆ ImgFmt

enum ImgFmt

Image format modes to use with System.takeScreenshot.

Enumerator
FORMAT_BMP 

32bpp BMP format.

FORMAT_JPG 

JPG format.

FORMAT_PNG 

8bpp paletted PNG format.

◆ BtnMode

enum BtnMode

Buttons schemes for System.setMessage.

Enumerator
BUTTON_NONE 

No buttons.

BUTTON_OK 

OK button only.

BUTTON_CANCEL 

CANCEL button only.

BUTTON_OK_CANCEL 

OK and CANCEL buttons.

BUTTON_YES_NO 

YES and NO buttons.

◆ DlgState

enum DlgState

Dialog states for system messages and system keyboard.

Enumerator
RUNNING 

Dialog running.

FINISHED 

Dialog finished successfully.

CANCELED 

Dialog canceled by user.

◆ MntPerm

enum MntPerm

Mount permissions for partition mounting.

Enumerator
READ_ONLY 

Read only permissions.

READ_WRITE 

Read/Write permissions.

Function Documentation

◆ openFile()

int System::openFile ( string  filename,
IOFlags  flags 
)

Open a file.

Usage example:
handle = System.openFile("ux0:/data/file.txt", FREAD)
Definition: luaSystem.cpp:78
int openFile(string filename, IOFlags flags)
Open a file.
@ FREAD
Read attribute.
Definition: luaSystem.cpp:11
Parameters
filename- Filename to be opened.
flags- An attribute flag.
Returns
A valid file handle.

◆ writeFile()

void System::writeFile ( int  handle,
string  text,
int  len 
)

Write into an opened file.

Usage example:
System.writeFile(handle, "Test", 4)
void writeFile(int handle, string text, int len)
Write into an opened file.
Parameters
handle- A file handle opened with System.openFile.
text- The text to write on file.
len- Length of the text.

◆ readFile()

string System::readFile ( int  handle,
int  len 
)

Read from an opened file.

Usage example:
text = System.readFile(handle, 4)
string readFile(int handle, int len)
Read from an opened file.
Parameters
handle- A file handle opened with System.openFile.
len- Length of the string to read in bytes.
Returns
The read string.

◆ seekFile()

void System::seekFile ( int  handle,
int  pos,
IOSeek  seek 
)

Move cursor of an opened file.

Usage example:
System.seekFile(handle, 0, END)
void seekFile(int handle, int pos, IOSeek seek)
Move cursor of an opened file.
@ END
Starts from the end of the file.
Definition: luaSystem.cpp:24
Parameters
handle- A file handle opened with System.openFile.
pos- Position to set.
seek- Start point for the position.

◆ sizeFile()

int System::sizeFile ( int  handle)

Calculate size of an opened file in bytes.

Usage example:
size = System.sizeFile(handle)
int sizeFile(int handle)
Calculate size of an opened file in bytes.
Parameters
handle- A file handle opened with System.openFile.
Returns
Filesize in bytes.

◆ statFile()

table System::statFile ( string  filename)

Extract info of a file/directory.

Usage example:
info = System.statFile("ux0:/data/file.txt")
creation_year = info.creation_time.year
last_access_year = info.access_time.year
last_modification_year = info.mod_time.year
is_directory = info.directory
filesize = info.size
table statFile(string filename)
Extract info of a file/directory.
Parameters
filename- Filename to be checked.
Returns
A table with a proper set of info (Look at the sample above).

◆ statOpenedFile()

table System::statOpenedFile ( int  handle)

Extract info of an opened file.

Usage example:
info = System.statOpenedFile(handle)
creation_year = info.creation_time.year
last_access_year = info.access_time.year
last_modification_year = info.mod_time.year
is_directory = info.directory
filesize = info.size
table statOpenedFile(int handle)
Extract info of an opened file.
Parameters
handle- A file handle opened with System.openFile.
Returns
A table with a proper set of info (Look at the sample above).

◆ closeFile()

void System::closeFile ( int  handle)

Close an opened file.

Usage example:
void closeFile(int handle)
Close an opened file.
Parameters
handle- A file handle opened with System.openFile.

◆ doesFileExist()

bool System::doesFileExist ( string  filename)

Check if a file exists.

Usage example:
if System.doesFileExist("ux0:/data/file.txt") then
handle = System.openFile("ux0:/data/file.txt", FREAD)
end
bool doesFileExist(string filename)
Check if a file exists.
Parameters
filename- Filename to be checked.
Returns
true if exists, false otherwise.

◆ doesDirExist()

bool System::doesDirExist ( string  dirname)

Check if a folder exists.

Usage example:
if System.doesDirExist("ux0:/data") then
list = System.listDirectory("ux0:/data")
end
bool doesDirExist(string dirname)
Check if a folder exists.
table listDirectory(string dirname)
List a directory contents.
Parameters
dirname- Folder name to be checked.
Returns
true if exists, false otherwise.

◆ rename()

void System::rename ( string  filename,
string  filename2 
)

Rename or move a file.

Usage example:
System.rename("ux0:/data/old.txt", "ux0:/data/new.txt")
void rename(string filename, string filename2)
Rename or move a file.
Parameters
filename- Filename to be renamed.
filename2- New filename.

◆ copyFile()

void System::copyFile ( string  filename,
string  filename2 
)

Copy a file.

Usage example:
System.copyFile("ux0:/data/old.txt", "ux0:/data/new.txt")
void copyFile(string filename, string filename2)
Copy a file.
Parameters
filename- Filename to be copied.
filename2- New filename.

◆ deleteFile()

void System::deleteFile ( string  filename)

Delete a file.

Usage example:
System.deleteFile("ux0:/data/file.txt")
void deleteFile(string filename)
Delete a file.
Parameters
filename- Filename to be removed.

◆ deleteDirectory()

void System::deleteDirectory ( string  dirname)

Delete a directory.

Usage example:
System.deleteDirectory("ux0:/data/dir")
void deleteDirectory(string dirname)
Delete a directory.
Parameters
dirname- Path to be removed.

◆ createDirectory()

void System::createDirectory ( string  dirname)

Create a new directory.

Usage example:
System.createDirectory("ux0:/data/dir")
void createDirectory(string dirname)
Create a new directory.
Parameters
dirname- Path to be created.

◆ listDirectory()

table System::listDirectory ( string  dirname)

List a directory contents.

Usage example:
files = System.listDirectory("ux0:/data/dir")
name = files[0].name
size = files[0].size
is_directory = files[0].directory
Parameters
dirname- Path to be listed.
Returns
A table with the listed files info (See the example above).

◆ exit()

void System::exit ( void  )

Close the interpreter.

Usage example:
void exit(void)
Close the interpreter.

◆ getFirmware()

string System::getFirmware ( void  )

Get unspoofed system firmware version.

Usage example:
string getFirmware(void)
Get unspoofed system firmware version.
Returns
The unspoofed system firmware version.
Note
This function is available only in unsafe mode.

◆ getSpoofedFirmware()

string System::getSpoofedFirmware ( void  )

Get spoofed system firmware version.

Usage example:
string getSpoofedFirmware(void)
Get spoofed system firmware version.
Returns
The spoofed system firmware version.

◆ getFactoryFirmware()

string System::getFactoryFirmware ( void  )

Get factory system firmware version.

Usage example:
string getFactoryFirmware(void)
Get factory system firmware version.
Returns
The factory system firmware version.
Note
This function is available only in unsafe mode.

◆ wait()

void System::wait ( int  msecs)

Sleep the application for a certain time.

Usage example:
System.wait(1000000)
void wait(int msecs)
Sleep the application for a certain time.
Parameters
msecs- Time to wait in microseconds.

◆ isBatteryCharging()

bool System::isBatteryCharging ( void  )

Check if the battery is under charge.

Usage example:
Graphics.debugPrint(0, 0, "Battery is charging", Color.new(255, 255, 255))
end
Definition: luaColor.cpp:6
Definition: luaGraphics.cpp:15
int new(int r, int g, int b, int a)
Create a new color.
void debugPrint(number x, number y, string text, int color)
Print a text on screen using system font.
bool isBatteryCharging(void)
Check if the battery is under charge.
Returns
true if charging, false otherwise.

◆ getBatteryPercentage()

int System::getBatteryPercentage ( void  )

Get current battery life percentage.

Usage example:
int getBatteryPercentage(void)
Get current battery life percentage.
Returns
The battery life percentage.

◆ getBatteryLife()

int System::getBatteryLife ( void  )

Get current battery life.

Usage example:
int getBatteryLife(void)
Get current battery life.
Returns
The battery life in minutes.

◆ getBatteryCapacity()

int System::getBatteryCapacity ( void  )

Get current battery capacity.

Usage example:
int getBatteryCapacity(void)
Get current battery capacity.
Returns
The battery capacity in mAh.

◆ getBatteryFullCapacity()

int System::getBatteryFullCapacity ( void  )

Get full battery capacity.

Usage example:
int getBatteryFullCapacity(void)
Get full battery capacity.
Returns
The battery full capacity in mAh.

◆ getBatteryTemp()

int System::getBatteryTemp ( void  )

Get battery temperature.

Usage example:
int getBatteryTemp(void)
Get battery temperature.
Returns
The battery temperature in Celsius.

◆ getBatteryVolt()

int System::getBatteryVolt ( void  )

Get battery voltage.

Usage example:
int getBatteryVolt(void)
Get battery voltage.
Returns
The battery voltage in mV.

◆ getBatteryHealth()

int System::getBatteryHealth ( void  )

Get battery state of health percentage.

Usage example:
int getBatteryHealth(void)
Get battery state of health percentage.
Returns
The battery state of health percentage.

◆ getBatteryCycles()

int System::getBatteryCycles ( void  )

Get battery cycles count.

Usage example:
int getBatteryCycles(void)
Get battery cycles count.
Returns
The battery cycles count.

◆ disableTimer()

void System::disableTimer ( PowerTimer  timer)

Disable a power management timer feature.

Usage example:
void disableTimer(PowerTimer timer)
Disable a power management timer feature.
@ SCREEN_DIMMING_TIMER
Automatic screen dimming.
Definition: luaSystem.cpp:34
Parameters
timer- The timer feature to disable.

◆ enableTimer()

void System::enableTimer ( PowerTimer  timer)

Enable a power management timer feature.

Usage example:
void enableTimer(PowerTimer timer)
Enable a power management timer feature.
Parameters
timer- The timer feature to enable.

◆ resetTimer()

void System::resetTimer ( PowerTimer  timer)

Reset a power management timer feature.

Usage example:
void resetTimer(PowerTimer timer)
Reset a power management timer feature.
Parameters
timer- The timer feature to reset.

◆ setCpuSpeed()

void System::setCpuSpeed ( int  clock)

Set CPU clock speed.

Usage example:
void setCpuSpeed(int clock)
Set CPU clock speed.
Parameters
clock- The clock to set in Mhz.
Note
Clock must be between 0 and 444.

◆ setGpuSpeed()

void System::setGpuSpeed ( int  clock)

Set GPU clock speed.

Usage example:
void setGpuSpeed(int clock)
Set GPU clock speed.
Parameters
clock- The clock to set in Mhz.
Note
Clock must be between 0 and 222.

◆ setBusSpeed()

void System::setBusSpeed ( int  clock)

Set BUS clock speed.

Usage example:
void setBusSpeed(int clock)
Set BUS clock speed.
Parameters
clock- The clock to set in Mhz.
Note
Clock must be between 0 and 222.

◆ getCpuSpeed()

int System::getCpuSpeed ( void  )

Get CPU clock speed.

Usage example:
int getCpuSpeed(void)
Get CPU clock speed.
Returns
The CPU clock speed in Mhz.

◆ getGpuSpeed()

int System::getGpuSpeed ( void  )

Get GPU clock speed.

Usage example:
int getGpuSpeed(void)
Get GPU clock speed.
Returns
The GPU clock speed in Mhz.

◆ getBusSpeed()

int System::getBusSpeed ( void  )

Get BUS clock speed.

Usage example:
int getBusSpeed(void)
Get BUS clock speed.
Returns
The BUS clock speed in Mhz.

◆ getGpuXbarSpeed()

int System::getGpuXbarSpeed ( void  )

Get GPU Crossbar clock speed.

Usage example:
int getGpuXbarSpeed(void)
Get GPU Crossbar clock speed.
Returns
The GPU Crossbar clock speed in Mhz.

◆ launchEboot()

void System::launchEboot ( string  filename)

Launches a binary file.

Usage example:
System.launchEboot("app0:/updater.bin")
void launchEboot(string filename)
Launches a binary file.
Parameters
filename- The file to start.
Note
The binary file to launch must be in app0 partition.

◆ launchApp()

void System::launchApp ( string  titleid)

Launches an installed application.

Usage example:
System.launchApp("MLCL00001")
void launchApp(string titleid)
Launches an installed application.
Parameters
titleid- The title ID of the application to start.

◆ getFreeSpace()

void System::getFreeSpace ( string  dev)

Get free space for a given device.

Usage example:
Graphics.debugPrint(5, 5, System.getFreeSpace("ux0:") .. "/" .. System.getTotalSpace("ux0:"), Color.new(255, 255, 255))
void getTotalSpace(string dev)
Get total space for a given device.
void getFreeSpace(string dev)
Get free space for a given device.
Parameters
dev- The device name.

◆ getTotalSpace()

void System::getTotalSpace ( string  dev)

Get total space for a given device.

Usage example:
Graphics.debugPrint(5, 5, System.getFreeSpace("ux0:") .. "/" .. System.getTotalSpace("ux0:"), Color.new(255, 255, 255))
Parameters
dev- The device name.

◆ getTime()

int [] System::getTime ( void  )

Get console time.

Usage example:
h,m,s = System.getTime()
int[] getTime(void)
Get console time.
Returns
Three values owning hours, minutes and seconds.

◆ getDate()

int [] System::getDate ( void  )

Get console date.

Usage example:
day_num, d, m, y = System.getDate()
if day_num == 1 then
day_name = "Monday"
end
int[] getDate(void)
Get console date.
Returns
Four values owning day value, day, month, year.

◆ getUsername()

string System::getUsername ( void  )

Get account username.

Usage example:
username = System.getUsername()
string getUsername(void)
Get account username.
Returns
The username set on the running console account.

◆ getLanguage()

int System::getLanguage ( void  )

Get console language.

Usage example:
int getLanguage(void)
Get console language.
Returns
The language ID currently set on the console.
Note
For the available language IDs look at this.

◆ getModel()

int System::getModel ( void  )

Get console model.

Usage example:
model = System.getModel()
int getModel(void)
Get console model.
Returns
0x10000 if PSVITA, 0x20000 if PSTV.

◆ getPsId()

string System::getPsId ( void  )

Get console unique PsId.

Usage example:
psid = System.getPsId()
string getPsId(void)
Get console unique PsId.
Returns
The console unique PsId.

◆ getTitle()

string System::getTitle ( void  )

Get running application title.

Usage example:
title = System.getTitle()
string getTitle(void)
Get running application title.
Returns
The running application title.

◆ getTitleID()

string System::getTitleID ( void  )

Get running application title ID.

Usage example:
title_id = System.getTitleID()
string getTitleID(void)
Get running application title ID.
Returns
The running application title ID.

◆ extractSfo()

table System::extractSfo ( string  filename)

Extract info from an SFO file.

Usage example:
info = System.extractSfo("app0:/sce_sys/param.sfo")
app_version = info.version
app_title = info.title
app_short_title = info.short_title
app_category = info.category
app_titleid = info.titleid
table extractSfo(string filename)
Extract info from an SFO file.
Parameters
filename- The filename to extract info from.
Returns
A table with a proper set of info (Look at the sample above).
Note
This function can be used also to extract info from PARAM.SFO bundled inside PBP files.

◆ extractPbp()

void System::extractPbp ( string  filename,
string  dirname 
)

Extract a PBP file (synchronous).

Usage example:
System.extractPbp("app0:/files.zip", "ux0:/data/app_files")
void extractPbp(string filename, string dirname)
Extract a PBP file (synchronous).
Parameters
filename- The filename to extract.
dirname- The path where to extract files.
Note
If dirname doesn't exist, it will be automatically created.

◆ extractZip()

void System::extractZip ( string  filename,
string  dirname 
)

Extract a ZIP file (synchronous).

Usage example:
System.extractZip("app0:/files.zip", "ux0:/data/app_files")
void extractZip(string filename, string dirname)
Extract a ZIP file (synchronous).
Parameters
filename- The filename to extract.
dirname- The path where to extract files.
Note
If dirname doesn't exist, it will be automatically created.

◆ extractFromZip()

void System::extractFromZip ( string  filename,
string  file,
string  destname 
)

Extract a specific file from a ZIP file (synchronous).

Usage example:
System.extractFromZip("app0:/files.zip", "image.jpg", "ux0:/data/app_files/my_image.jpg")
void extractFromZip(string filename, string file, string destname)
Extract a specific file from a ZIP file (synchronous).
Parameters
filename- The filename of the ZIP archive.
file- The file to extract.
destname- The filename where to extract file.

◆ extractZipAsync()

void System::extractZipAsync ( string  filename,
string  dirname 
)

Extract a ZIP file (asynchronous).

Usage example:
System.extractZipAsync("app0:/files.zip", "ux0:/data/app_files")
void extractZipAsync(string filename, string dirname)
Extract a ZIP file (asynchronous).
Parameters
filename- The filename to extract.
dirname- The path where to extract files.
Note
If dirname doesn't exist, it will be automatically created.

◆ extractFromZipAsync()

void System::extractFromZipAsync ( string  filename,
string  file,
string  destname 
)

Extract a specific file from a ZIP file (asynchronous).

Usage example:
System.extractFromZipAsync("app0:/files.zip", "image.jpg", "ux0:/data/app_files/my_image.jpg")
void extractFromZipAsync(string filename, string file, string destname)
Extract a specific file from a ZIP file (asynchronous).
Parameters
filename- The filename of the ZIP archive.
file- The file to extract.
destname- The filename where to extract file.

◆ compressZip()

void System::compressZip ( string  path,
string  filename,
int  ratio 
)

Compress a file or a folder in a ZIP file (synchronous).

Usage example:
System.compressZip("app0:/sce_sys", "ux0:/data/file.zip", 9)
void compressZip(string path, string filename, int ratio)
Compress a file or a folder in a ZIP file (synchronous).
Parameters
path- The filename or path to compress.
filename- The filename of the resulting zip file.
ratio- The compression ratio to use (optional).
Note
ratio must be between 0 and 9.

◆ addToZip()

void System::addToZip ( string  path,
string  filename,
string  parent,
int  ratio 
)

Add a file or a folder in a ZIP file (synchronous).

Usage example:
System.addToZip("app0:/sce_sys/icon0.png", "ux0:/data/file.zip", "sce_sys", 9)
void addToZip(string path, string filename, string parent, int ratio)
Add a file or a folder in a ZIP file (synchronous).
Parameters
path- The filename or path to compress.
filename- The filename of the resulting zip file.
parent- The parent folder inside the zip file where to place the path.
ratio- The compression ratio to use (optional).
Note
ratio must be between 0 and 9.

◆ getAsyncState()

int System::getAsyncState ( void  )

Get current state of an asynchronous task.

Usage example:
while System.getAsyncState() == 0 do
running = true
end
running = false
int getAsyncState(void)
Get current state of an asynchronous task.
Returns
0 if running, 1 if successfully finished, -1 otherwise.

◆ getAsyncResult()

string System::getAsyncResult ( void  )

Get result from a finished asynchronous task.

Usage example:
if System.getAsyncState() == 1 then
end
string getAsyncResult(void)
Get result from a finished asynchronous task.
Returns
A string with the result for Network.requestStringAsync() result, nil otherwise.

◆ takeScreenshot()

void System::takeScreenshot ( string  filename,
ImgFmt  format,
int  ratio 
)

Take a screenshot.

Usage example:
System.takeScreenshot("ux0:/data/shot.jpg", FORMAT_JPG, 255)
void takeScreenshot(string filename, ImgFmt format, int ratio)
Take a screenshot.
@ FORMAT_JPG
JPG format.
Definition: luaSystem.cpp:43
Parameters
filename- The filename of the screenshot output.
format- The format to use for the output file (optional).
ratio- Compression ratio for JPG compression (optional).
Note
ratio must be between 0 and 255.

◆ executeUri()

void System::executeUri ( string  uri)

Execute an URI call.

Usage example:
System.executeUri("psgm:play?titleid=MLCL00001")
void executeUri(string uri)
Execute an URI call.
Parameters
uri- URI to exec.

◆ reboot()

int System::reboot ( void  )

Reboot the console.

Usage example:
int reboot(void)
Reboot the console.

◆ shutdown()

int System::shutdown ( void  )

Shutdown the console.

Usage example:
int shutdown(void)
Shutdown the console.

◆ standby()

int System::standby ( void  )

Put the console in standby.

Usage example:
int standby(void)
Put the console in standby.

◆ isSafeMode()

bool System::isSafeMode ( void  )

Get if application is running in safe mode.

Usage example:
if System.isSafeMode() then
mode = "safe"
end
bool isSafeMode(void)
Get if application is running in safe mode.
Returns
true if in safe mode, false otherwise.

◆ setMessage()

void System::setMessage ( string  text,
bool  progressbar,
BtnMode  buttons 
)

Start a system message instance.

Usage example:
System.setMessage("Do you want to start this app?", false, BUTTON_YES_NO)
void setMessage(string text, bool progressbar, BtnMode buttons)
Start a system message instance.
@ BUTTON_YES_NO
YES and NO buttons.
Definition: luaSystem.cpp:56
Parameters
text- The text of the system message.
progressbar- Progressbar mode.
buttons- Buttons scheme to use (optional).
Note
If progressbar is true, buttons will not affect the system message.

◆ getMessageState()

DlgState System::getMessageState ( void  )

Get current system message instance state.

Usage example:
DlgState getMessageState(void)
Get current system message instance state.
Returns
Current state of the system message instance.

◆ setMessageProgress()

void System::setMessageProgress ( int  progress)

Set current progress for the system message instance.

Usage example:
void setMessageProgress(int progress)
Set current progress for the system message instance.
Parameters
progress- Progress percentage.
Note
This function affects only progressbar system messages.
progress must be between 0 and 100.

◆ setMessageProgMsg()

void System::setMessageProgMsg ( string  text)

Set a submessage for the system message instance.

Usage example:
void setMessageProgMsg(string text)
Set a submessage for the system message instance.
Parameters
text- Submessage text to set.
Note
This function affects only progressbar system messages.

◆ closeMessage()

void System::closeMessage ( void  )

Close the current system message instance.

Usage example:
void closeMessage(void)
Close the current system message instance.

◆ unmountPartition()

void System::unmountPartition ( int  idx)

Unmount an already mounted partition.

Usage example:
void unmountPartition(int idx)
Unmount an already mounted partition.
Parameters
idx- The index number of the partition.
Note
For the index value, look at VSH Mount ID here.
This function is available only in unsafe mode.

◆ mountPartition()

void System::mountPartition ( int  idx,
MntPerm  perms 
)

Mount an unmounted partition.

Usage example:
void mountPartition(int idx, MntPerm perms)
Mount an unmounted partition.
@ READ_WRITE
Read/Write permissions.
Definition: luaSystem.cpp:75
Parameters
idx- The index number of the partition.
perms- Permissions to set for the mounted partition.
Note
For the index value, look at VSH Mount ID here.
This function is available only in unsafe mode.

◆ installApp()

void System::installApp ( string  dir)

Install an extracted app.

Usage example:
System.installApp("ux0:/vitaQuake")
void installApp(string dir)
Install an extracted app.
Parameters
dir- The path to the extracted app.
Note
This function is available only in unsafe mode.

◆ uninstallApp()

void System::uninstallApp ( string  titleid)

Uninstall an installed app.

Usage example:
System.uninstallApp("GTAVCECTY")
void uninstallApp(string titleid)
Uninstall an installed app.
Parameters
titleid- The titleid of the app to uninstall.
Note
This function is available only in unsafe mode.

◆ doesAppExist()

bool System::doesAppExist ( string  titleid)

Check if an app is installed.

Usage example:
if System.doesAppExist("GTAVCECTY") then
System.uninstallApp("GTAVCECTY")
end
bool doesAppExist(string titleid)
Check if an app is installed.
Parameters
titleid- The titleid of the app to check.
Returns
true if installed, false otherwise.
Note
This function is available only in unsafe mode.

◆ getBootParams()

string System::getBootParams ( void  )

Retrieve params used at app boot.

Usage example:
string getBootParams(void)
Retrieve params used at app boot.
Returns
The params passed to the app when it got launched.

◆ loadUserPlugin()

int System::loadUserPlugin ( string  path)

Load and start an user plugin.

Usage example:
plug_id = System.loadUserPlugin("ux0:data/plugin.suprx")
int loadUserPlugin(string path)
Load and start an user plugin.
Parameters
path- The path to the plugin to load.
Returns
An identifier to the loaded module.
Note
This function is available only in unsafe mode.

◆ loadKernelPlugin()

int System::loadKernelPlugin ( string  path)

Load and start a kernel plugin.

Usage example:
plug_id = System.loadKernelPlugin("ux0:data/plugin.skprx")
int loadKernelPlugin(string path)
Load and start a kernel plugin.
Parameters
path- The path to the plugin to load.
Returns
An identifier to the loaded module.
Note
This function is available only in unsafe mode.

◆ unloadUserPlugin()

void System::unloadUserPlugin ( int  plug_id)

Stop and unload an user plugin.

Usage example:
void unloadUserPlugin(int plug_id)
Stop and unload an user plugin.
Parameters
plug_id- The module identifier for the plugin to unload.
Note
This function is available only in unsafe mode.

◆ unmountMountpoint()

void System::unmountMountpoint ( string  mnt)

Unmount a virtual mountpoint.

Usage example:
void unmountMountpoint(string mnt)
Unmount a virtual mountpoint.
Parameters
mnt- The mountpoint to unmount.
Note
This function is available only in unsafe mode.