# Lua Player Mod 4

#### PSP Monopoly | Drag Mini | Lua Player Mod
PSP eMail and SMS | PSP Tic Tac Toe | Tutorials

Here is a list of functions added on to Lua Player .16! The current version includes many new features, be sure to check them out! Major thanks to alatnet, youresam, blah, and soulkiller for their contributions to Mod 4. Also thanks to Shine and nevyn for making lua player!

##### System Functions

Function | What it Does | Returns
System.Quit() | Quits out of Lua Player back to XMB | nil
System.sha1("string") | Returns sha1 | string
System.nickName() | Gets Nickname | string
System.setLow() | Sets CPU to 100 Mhz | nil
System.setReg() | Sets CPU to 222 Mhz | nil
System.setHigh() | Sets CPU to 333 Mhz | nil

##### MP3 Functions

Function | What it Does | Returns
Mp3.load("filename") | Loads the Mp3 file | nil
Mp3.play() | Plays the Mp3 | nil
Mp3.pause() | Pauses the Mp3 | nil
Mp3.stop() | Stops and Clears the Mp3 from Memory | nil
Mp3.EndOfStream() | Tells if the Mp3 has ended | "true" or "false"
Mp3.getTime() | Returns Mp3's Play Time | HH:MM:SS as string
Mp3.volume(volume) | Sets Mp3 Playback Volume | nil

##### Ogg Functions

Function | What it Does | Returns
Ogg.load("filename") | Loads an Ogg file | nil
Ogg.play() | Plays the loaded Ogg | nil
Ogg.pause() | Pauses the Ogg | nil
Ogg.stop() | Stops and Clears the Ogg from Memory | nil
Ogg.EndOfStream() | Tells if the Ogg has ended | "true" or "false"
Ogg.getHour() | Returns Hours Played | HH as number
Ogg.getMin() | Returns Minuets Played | MM as number
Ogg.getSec() | Returns Seconds Played | SS as number
Ogg.volume(volume) | Sets Ogg Playback Volume | nil

##### Gum/Gu Functions

Function | What it Does | Returns
Gum.lookAt(lookingfromx, lookingfromy,lookingfromz,lookingatx, lookingaty,lookingatz,0,1,0) | Changes Direction of Camera | nil
Gu.start3dv2() | Uses guStart() from graphics.cpp | nil
Gu.end3dv2() | Closes from the Likes of graphics.cpp | nil

Many thanks to blah and Alatnet for the gu/gum additions. Here is a list of some of the new gu/gum functions that still need to be documented...

Gu Functions:
Gu.texSync() - sceGuTexSync
Gu.copyImage() - sceGuCopyImage
Gu.alphaFunc() - sceGuAlphaFunc
Gu.material() - sceGuMaterial
Gu.modelColor() - sceGuModelColor
Gu.frontFace() - sceGuFrontFace
Gu.clearStencil() - sceGuClearStencil
Gu.pixelMask() - sceGuPixelMask
Gu.stencilFunc() - sceGuStencilFunc
Gu.stencilOp() - sceGuStencilOp
Gu.logicalOp() - sceGuLogicalOp
Gu.offset() - sceGuOffset
Gu.scissor() - sceGuScissor
Gu.viewport() - sceGuViewport
Gu.getStatus() - sceGuGetStatus
Gu.geSaveContext() - sceGeSaveContext
Gu.geRestoreContext() - sceGeRestoreContext
// Matrix
Gu.setMatrix() - sceGuSetMatrix
Gu.setDither() - sceGuSetDither

Gum Functions:
Gum.scale() - sceGumScale
Gum.lookAt() - sceGumLookAt
Gum.ortho() - sceGumOrtho
Gum.crossProduct() - gumCrossProduct
Gum.dotProduct() - gumDotProduct
Gum.normalize() - gumNormalize
// Matrix
Gum.multMatrix() - sceGumMultMatrix
Gum.loadMatrix() - sceGumLoadMatrix
Gum.storeMatrix() - sceGumStoreMatrix
Gum.popMatrix() - sceGumPopMatrix
Gum.pushMatrix() - sceGumPushMatrix
Gum.updateMatrix() - sceGumUpdateMatrix
Gum.fullInverse() - sceGumFullInverse
Gum.fastInverse() - sceGumFastInverse

Note: I dont know how to operate some of these functions (mainly the Matrix ones)... sorry

##### HPRM Functions

Thanks to youresam for the HPRM Functions!

Function | What it Does | Returns
Hprm.headphone() | If headphone is plugged in | bool
Hprm.remote() | If remote is plugged in | bool
Hprm.microphone() | If microphone is plugged in | bool
Hprm.read() | Much like Controls.read() | nil
Methods
:playpause() | if Play/Pause is pressed | bool
:forward() | if Forward is pressed | bool
:back() | if Back is pressed | bool
:volup() | if Volume Up is pressed | bool
:voldown() | if Volume Down is pressed | bool
:hold() | if hold switch is down | bool

Example:

remote = Hprm.read()
if remote:forward() then blah end

##### Wlan Functions

Alatnet had created an alternate luawlan file, but it wouldn't always work correctly (issues with udp). I ended up merging working functions from Alatnet's with a netlib one by youresam.

Function | What it Does | Returns
Wlan.useConnectionConfig( int ConnectionConfig, bool manual_state_checking) | Added ability to choose if manual/auto check* | int
Wlan.getConnectionState() | Does Manual Checking | int
Wlan.getSwitchState() | Is your switch up? | bool
Socket.udpConnect(host,port) | Creates a new UDP Socket | Socket
Additional UDP Socket Methods:
:udpSend(string) | Sends a string through UDP | number
:udpRecv() | Recieves info from UDP Socket | string, number

##### FastBlit Functions

Well the theory behind this goes like this: The regular clear/blit functions initialize the gu and de-initialize it after every call to either of the functions, in turn making it slower. If you start the gu, clear/blit to the screen, and then de-init the gu it should provide for a speedup. Thanks to Soulkiller for comming up with the idea!

Function | What it Does | Returns
Image.startBlit() | Call this function to begin blitting, you MUST do this in order to make fastBlit calls | nil
screen:fastBlit( x, y, image [subX, subY, width, height,] alpha) | Call between Image.startBlit() and Image.endBlit(), Its pretty much the same thing as the normal screen:blit() | nil
screen:fastClear() | Call between Image.startBlit() and Image.endBlit(), Its a fast screen clear! | nil
Imag.endBlit() | Call this function to end blitting. fastBlit functions may not be used after this unless a new call to Image.startBlit() is made | nil

##### Download

Lua Player Mod 4 Source Code
Lua Player Mod 4 for 1.5
Lua Player Mod 4 for 1.00_2.XX

Cools Development is © 2006-2007 cools All Rights Reserved
This page is still under construction!