![]() |
![]() |
![]() |
| |||||
| | #1 |
| PSP Developer ![]() Fecha de Ingreso: abr 2007 Mensajes: 1.574 Thanks: 177 Thanked 219 Times in 79 Posts ![]() ![]() ![]() | iLife PSP v3, como muchos conocen, es una shell, es decir, un homebrew que te permite realizar multitud de funciones multimedia. Está desarrollada en parte C, en parte LUA. La parte C es simple, solo ejecuta el EBOOT de iLife PSP al iniciar tu PSP, usando una función portada del src de DAX (si mal no recuerdo, del bootloader), ya que la función que debería servir para ello (SceKernelLoadExec) provoca un crash en la PSP. Ahora, vamos a comentar la parte más importante y de la cual está compuesto el programa (LUA). Está desarrollado en Lua Player HM v7. Ante todo, os pido a los desarrolladores de LUA, que no lo copiéis descaradamente, podéis hacer modificaciones siempre que me lo digáis por MP o por ilifepsp@gmail.com Ilife PSP v3 se inicia por medio de este archivo, boot.LUA : Código:
tdp=Image.load("themes/images/todopsp.jpg")
--Variable de la función, contiene la dirección de memoria donde ha sido alojada la propia función
function refresh()
--Limpiamos pantalla
screen:clear()
--Mostramos imagen en pantalla
screen:blit(100, 100, tdp)
screen:blit(0,0,fadeimg)
screen:blit(93,2,titleimg)
screen:blit(96,26,shoutimg)
screen:blit(43, 49, textimg)
screen:blit(35, 251, pbar)
screen.flip()
screen.waitVblankStart()
end
function clearlines()
textlines = {" "}
end
function intro()
wsh = {}
for i = 1,7 do
wsh[i] = Image.createEmpty(10,10)
wsh[i]:blit(0,0,tdp,(i-1)*10,273,10,10)
end
temptitle = Image.createEmpty(90,10)
tempshout = Image.createEmpty(288,10)
fadeimg:print(100,20,"Concurso de homebrew 2008 TodoPSP",red)
refresh()
System.sleep(0400)
count = 0
--Usamos el bucle for
for i = 1,49 do
count = (count % 2) + 1
titleimg:clear()
titleimg:blit(0,0,temptitle,0,0,i*2,10)
titleimg:blit((i*2)-9, 0, wsh[count])
refresh()
end
titleimg:clear()
titleimg:blit(0,0,temptitle)
temptitle = nil
refresh()
System.sleep(0500)
count = 0
for i = 1,68 do
count = (count % 2) + 1
shoutimg:clear()
shoutimg:blit(0,0,tempshout,0,0,i*4,10)
shoutimg:blit((i*4)-9, 0, wsh[count])
refresh()
end
shoutimg:clear()
shoutimg:blit(0,0,tempshout)
wsh = nil
count = nil
tempshout = nil
refresh()
System.sleep(0500)
for na = 1,32 do
fadeimg:clear(Color.new(0,0,0,224-(na*7)))
System.memclean()
--Limpiamos memoria para liberar espacio de ella
refresh()
end
fadeimg:clear()
end
--Definición terminada
--Empieza declaración
gotscript = false
titleimg = Image.createEmpty(90,10)
shoutimg = Image.createEmpty(288,10)
fadeimg = Image.createEmpty(480,272)
fadeimg:clear(Color.new(0,0,0,224))
white = Color.new(255,255,255)
red = Color.new(255,0,0)
green = Color.new(0,255,0)
black = Color.new(0,0,0)
dkgrey = Color.new(64,64,64)
textimg = Image.createEmpty(385,180)
textlines = {" "}
hr = "------------------------------------------------"
pbar = Image.createEmpty(200,18)
--Termina declaración
--Función principal
intro()
System.sleep(0800)
--while true do es una expresión que repite siempre un bloque
while true do
dofile("index.lua")
--Cargamos el siguiente archivo LUA
end Ahora analizaremos la estructura de index.lua, mucho más compleja. Código:
options=Image.load("themes/images/files.png")
text=Image.load("themes/images/text.png")
image=Image.load("themes/images/fondmsn.png")
credits=Image.load("themes/images/credits.png")
--Guardamos en la memoria las imágenes que más tarde serán mostradas
mdp = io.open("CONF/pass.conf","r")
mdpbon = mdp:read()
mdp:close()
--Abrimos en MODO LECTURA el archivo pass.conf dándole elnombre
pad = Controls.read()
oldpad = Controls.read()
--Cargamos los controles
gui = {
fonta = Font.createProportional(),
font = Font.createProportional(),
fontsml = Font.createProportional(),
fontmed = Font.createProportional(),
fontsmall = Font.createProportional(),
}
gui.fonta:setPixelSizes(35,35)
gui.font:setPixelSizes(12,12)
gui.fontsml:setPixelSizes(9,9)
gui.fontmed:setPixelSizes(11,11)
gui.fontsmall:setPixelSizes(9,9)
--Definimos el tamaño de las fuentes.
blanco = Color.new ( 255, 255, 255 )
rojo = Color.new ( 255, 0, 0 )
negro = Color.new ( 0, 0, 0 )
pad, oldpad = Controls.read(), pad
opcion_menu, opcion_max = 1, 4
fin_sel_menu, fin_fin_menu = false, false
--Función principal
local function menu()
screen:clear()
screen:blit(0,0,credits)
--Limpiamos pantalla y mostramos imagen
--Texto que aparece en pantalla en forma de menú
screen:fontPrint(gui.fonta, 100, 90, "iLife PSP" , blanco)
screen:fontPrint(gui.font, 140, 140, "Create password" , blanco)
screen:fontPrint(gui.font, 140, 153, "Login" , blanco)
screen:fontPrint(gui.font, 140, 166, "Select your language" , blanco)
screen:fontPrint(gui.font, 140,179, "Exit" , blanco)
--Al posarnos sobre cada opción, cambiará de color blanco a negro
if opcion_menu == 1 then screen:fontPrint(gui.font,140 , 140, "Create password" , negro)
elseif opcion_menu == 2 then screen:fontPrint(gui.font, 140, 153, "Login" , negro)
elseif opcion_menu == 3 then screen:fontPrint(gui.font, 140, 166, "Select your language" , negro)
elseif opcion_menu == 4 then screen:fontPrint(gui.font, 140,179, "Exit" , negro)
end
screen.waitVblankStart() ; screen.flip()
end
repeat
menu()
repeat
pad = Controls.read()
if pad:right() and not oldpad:right() then
opcion_menu = opcion_menu + 1
if opcion_menu > opcion_max then opcion_menu = 1 end
menu()
elseif pad:left() and not oldpad:left() then
opcion_menu = opcion_menu - 1
if opcion_menu < 1 then opcion_menu = opcion_max end
menu()
elseif pad:up() and not oldpad:up() then
opcion_menu = opcion_menu - 1
if opcion_menu < 1 then opcion_menu = opcion_max end
menu()
elseif pad:down() and not oldpad:down() then
opcion_menu = opcion_menu + 1
if opcion_menu > opcion_max then opcion_menu = 1 end
menu()
end
if pad:cross() or pad:circle() then fin_sel_menu = true end
screen.waitVblankStart(2)
oldpad = pad
until fin_sel_menu
fin_sel_menu = false
screen:clear(negro)
--Abrimos un if. Si elegimos la primera opción del menú, saltará aquí, donde debes escribir la contraseña ya escrita en pass.conf
if opcion_menu == 1 then screen:fontPrint(gui.font, 140, 140, "Create password" , negro)
mdpecrit = System.startOSK("","Write your old password")
--Se evalúa la expresión, en caso de que sea idéntico, pues te dirá correct password y deberás escribir la nueva. Luego la sobreescribimos abriendo de nuevo el pass.conf en MODO ESCRITURA. Si está todo correcto se vuelve a cargar este menú mediante la función dofile
if mdpecrit == mdpbon then
System.message("Correct password",0)
pass = System.startOSK("","Write your new password(+3 characters)")
System.message("OK, your new password is: "..pass,0)
file = io.open("CONF/pass.conf" , "w")
file:write(pass)
file:close()
dofile("index.lua")
end
--Si no es correcta, volverá a cargar index.lua
if mdpecrit ~= bon then
System.message("Wrong password",0)
dofile("index.lua")
end
elseif opcion_menu == 2 then screen:fontPrint(gui.font, 140, 153, "Login" , negro)
-Aquí hacemos exactamente igual que antes
mdpecrit = System.startOSK("","Please write your password")
if mdpecrit == mdpbon then
System.message("Correct password",0)
--En este caso, se abrirá english.lua, spanish.lua o french.lua dependiendo del idioma escrito en language.conf Lo abrimos por lo tanto en MODO LECTURA
cup = io.open("CONF/language.conf", "r")
Lg = cup:read()
cup:close()
--Si el lenguaje es francés, abrirá french.lua, y así con los demás idiomas
if Lg == "French" then
dofile("French/french.lua")
end
if Lg == "Spanish" then
dofile("Spanish/Spanish.lua")
end
if Lg == "English" then
dofile("English/English.lua")
end
end
if mdpecrit ~= bon then
System.message("Wrong password or No Language",0)
dofile("index.lua")
end
--Aquí saltaremos a otro menú con funciones muy parecidas a éste en el que se selecciona el idioma y se sobreescribirá language.conf
elseif opcion_menu == 3 then screen:fontPrint(gui.font, 140, 166, "Select your language" , negro)
dofile("language.lua")
elseif opcion_menu == 4 then screen:fontPrint(gui.font, 140,179, "Exit" , negro)
fin_fin_menu = true
end
--Fin de la función
screen.waitVblankStart(); screen.flip()
screen.waitVblankStart( 60 )
until fin_fin_menu
System.Quit() Ahora language.LUA Código: --Abrimos language.conf en MODO LECTURA
mdp = io.open("CONF/language.conf","r")
mdpbon = mdp:read()
mdp:close()
--Creamos colores...
red = Color.new(255, 0, 0)
white = Color.new(255, 255, 255)
black = Color.new(0, 0, 0)
--Archivos del menú
Select = 1
maxSelect = 3
--Leemos los controles...
oldpad = Controls.read()
--Menú
while true do
pad = Controls.read()
--Si se pulsa tal botón, hará tal cosa, en este caso desplazarse por el menú, que como véis es algo diferente al de index.LUA
if pad:up() and oldpad:up() ~= pad:up() then
Select = Select - 1
end
if pad:down() and oldpad:down() ~= pad:down() then
Select = Select + 1
end
if Select > maxSelect then
Select = 1
elseif Select <= 0 then
Select = maxSelect
end
--La primera función estará en color negro, ya definido previamente, y así sucesivamente
if Select == 1 then
screen:fontPrint(gui.font,200,142, "French", black)
screen:fontPrint(gui.font,200,153, "English",white)
screen:fontPrint(gui.font,200,164, "Spanish" ,white)
end
if Select == 2 then
screen:fontPrint(gui.font,200,142, "French", white)
screen:fontPrint(gui.font,200,153, "English",black)
screen:fontPrint(gui.font,200,164, "Spanish" ,white)
end
if Select == 3 then
screen:fontPrint(gui.font,200,142, "French", white)
screen:fontPrint(gui.font,200,153, "English",white)
screen:fontPrint(gui.font,200,164, "Spanish" ,black)
end
if pad:cross() and not oldpad:cross() and Select == 1 then
--Si se elige francés como idioma, abrimos el archivo language.conf en MODO ESCRITURA, y se escribe French, y después cargará el archivo index.LUA
file = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/language.conf" , "w")
file:write("French")
file:close()
System.message("Your language is: ".."French",0)
dofile("index.lua")
end
--Se hace lo mismo que antes
if pad:cross() and not oldpad:cross() and Select == 2 then
file = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/language.conf" , "w")
file:write("English")
file:close()
System.message("Your language is: ".."English",0)
dofile("index.lua")
end
if pad:cross() and not oldpad:cross() and Select == 3 then
file = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/language.conf" , "w")
file:write("Spanish")
file:close()
System.message("Your language is: ".."Spanish",0)
dofile("index.lua")
end
screen.waitVblankStart()
screen.flip()
oldpad = pad
end Código: --iLife PSP v3 by Nikocronaldo
--Definimos variables, para luego usar una función de la CPU
top = "333"
top1 = "0"
--Abrimos en MODO LECTURA cpu.conf
cup = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/cpu.conf", "r")
Speed = cup:read()
--Si la velocidad escrita supera los 333 MHZ(recordemos que ese es el límite), la pone a 333 MHZ.
if Speed > top then
System.message("333 Mhz at least...",0)
System.setcpuspeed(333)
end
--Si es menor de 20 MHZ(una velocidad ya demasiado baja), la ponemos a velocidad normal
if Speed < top1 then
System.message("20 Mhz at least...",0)
System.setcpuspeed(222)
end
cup:close()
--La velocidad de la CPU dependerá de lo escrito en cpu.conf, definido con la variable Speed
System.setcpuspeed(Speed)
--Está función, más que comprobar que existen esas carpetas, las crea o sobreescribe, ya que la función que interviene en ello, System.doesDirExist(), no me funcionó
function checkFolders()
System.createDirectory("ms0:/PICTURE")
System.createDirectory("ms0:/MUSIC")
end
checkFolders()
background2=Image.load("themes/images/button.png")
--Cargamos la imagen
--Definismos como osDir al directorio de iLife
osDir = System.currentDirectory()
-- Leemos controles
pad = Controls.read()
oldpad = Controls.read()
-- Cargamos la configuración definida en system.conf
-- El archivo contiene la configuración del usuario
dofile("CONF/system.conf")
-- Error si el tema no es válido, por lo que carga otro
if not cfg.theme then
cfg.theme = "themes/blue"
end
-- Cargamos la configuracón del tema
dofile(cfg.theme .. "/theme.dat")
-- Si el wallpaper no es válido
if not cfg.wallpaper then
cfg.wallpaper = Image.createEmpty(480,272)
cfg.wallpaper:clear(Color.new(255,255,255))
else
wallpaperName = cfg.wallpaper
theWallpaper = Image.load(cfg.wallpaper)
cfg.wallpaper = theWallpaper
end
-- Cargamos las imágenes de la configuración del tema elegido
skin = {
main = Image.load(cfg.theme .. "/back.png"),
browse = Image.load(cfg.theme .. "/browse.png"),
games = Image.load(cfg.theme .. "/games.png"),
music = Image.load(cfg.theme .. "/music.png"),
photo = Image.load(cfg.theme .. "/photo.png"),
settings = Image.load(cfg.theme .. "/settings.png"),
nopreview = Image.load(cfg.theme .. "/nopreview.png"),
player = Image.load(cfg.theme .. "/repr.png"),
}
-- Variables de la configuración del menú
settingsData = {
selected = 0,
show = true,
usbMode = false,
subSel = 0,
subMax = 3,
}
settingBrowse = false
-- Variables de la font y de imágenes
gui = {
seltab = skin.games,
bg = Image.createEmpty(480,272),
main = Image.createEmpty(480,272),
font = Font.createProportional(),
fontsm = Font.createProportional(),
fontsml = Font.createProportional(),
fontmed = Font.createProportional(),
fontsmall = Font.createProportional(),
}
-- Se configura el tamaño de cada variable de la font ya definida
gui.fontsm:setPixelSizes(25,25)
gui.font:setPixelSizes(12,12)
gui.fontsml:setPixelSizes(9,9)
gui.fontmed:setPixelSizes(11,11)
gui.fontsmall:setPixelSizes(9,9)
-- Variables de control
ctrl = {
tab = 0,
games = true,
music = false,
photo = false,
settings = false,
}
-- Variables de los colores
colours = {
white = Color.new(255,255,255),
black = Color.new(0,0,0),
grey = Color.new(200,200,200),
red = Color.new(255,0,0,130),
clear = Color.new(0,0,0,0),
}
-- Información de la batería
battery = {
life = System.powerGetBatteryLifePercent(),
img = Image.createEmpty(40,20),
}
-- Iniciamos las imágenes...
screen:clear(Color.new(255,255,255))
gui.main:blit(0,0,cfg.wallpaper)
gui.main:blit(0,0,skin.main)
-- Comprobamos la configuración del USB en system.conf
if cfg.autoUSB == true then
System.usbDiskModeActivate()
settingsData.usbMode = true
else
System.usbDiskModeDeactivate()
end
-- Variables del browser
System.currentDirectory("../")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
-- Función de la reproducción de archivos MP3
function playMp3()
Mp3me.stop()
mp3 = Mp3me.load(files[fBrowser.selected].name, true)
dofile(osDir .. "/MUSIC/playerMP3.lua")
end
-- Función de la reproducción de archivos Atrac3
function playAA3ME()
aa3me.Stop()
aa3me = aa3me.load(files[fBrowser.selected].name, true)
dofile(osDir .. "/MUSIC/playerAA3.lua")
end
-- Función de la reproducción de archivos Ogg
function playOgg()
Ogg.stop()
ogg = Ogg.load(files[fBrowser.selected].name)
dofile(osDir .. "/MUSIC/playerOGG.lua")
System.setHigh()
--La CPU en este caso la ponemos al máximo, porque hay problemas entre usar el media engine y el formato ogg, error del luaplayer hm nativo
end
-- La función del menú de configuración
function settingsMenu()
if settingsData.show then
--Esto va a ser el menú
screen:fontPrint(gui.font, 35, 60, "> Theme Settings", colours.grey)
screen:fontPrint(gui.font, 35, 72, "> System Information", colours.grey)
screen:fontPrint(gui.font, 35, 84, "> Dump UMD", colours.grey)
screen:fontPrint(gui.font, 35, 96, "> USB Settings", colours.grey)
screen:fontPrint(gui.font, 35, 108, "> CPU Settings", colours.grey)
screen:fontPrint(gui.font, 35, 120, "> Internet Browser", colours.grey)
screen:fontPrint(gui.font, 35, 132, "> Chat", colours.grey)
screen:fontPrint(gui.font, 35, 144, "> iLife Update", colours.grey)
screen:fontPrint(gui.font, 35, 156, "> Credits", colours.grey)
screen:fontPrint(gui.font, 35, 168, "> Shutdown ", colours.grey)
screen:fontPrint(gui.font, 35, 180,"> Exit to XMB", colours.grey)
screen:fontPrint(gui.font, 35, 192,"> Restart", colours.grey)
-- Definimos cuantos elementos hay en el menú, sabiendo de antemano que el primero es 0
if settingsData.selected < 0 then
settingsData.selected = 11
elseif settingsData.selected > 11 then
settingsData.selected = 0
end
-- Funciones de control sobre el menú
if pad:up() and not oldpad:up() then
settingsData.selected = settingsData.selected - 1
elseif pad:down() and not oldpad:down() then
settingsData.selected = settingsData.selected + 1
end
if pad:cross() and not oldpad:cross() then
-- En la primera opción, saltamos a una función descrita más adelante
if settingsData.selected == 0 then
settingsData.show = false
settingsData.subSel = 0
settingsData.subMax = 1
elseif settingsData.selected == 1 then
-- Lo mismo
settingsData.show = false
settingsData.subSel = 0
settingsData.subMax = 1
elseif settingsData.selected == 2 then
-- Esta función la definí aquí
screen:clear()
-- Damos una variable a la función de comprobar que está insertado el UMD
verifumd = UMD.checkDisk()
-- Si es así, le das un nombre a la ISO, definimos algunas variables, y si el espacio de la MS es mayor a la del UMD, se hace un backup, en caso contrario, te avisa de que no hay espacio suficiente
if verifumd==1 then
isoname = System.startOSK("ms0:/ISO/name.ISO","Write the name of your UMD")
umdsize = UMD.getSize()
mssize = System.getFreeSpace("ms0:/")
if mssize > umdsize then
UMD.ripISO(isoname)
else
System.message("No space",0)
end
-- Si no hubiera UMD, pasaría esto
else
System.message("There is no UMD. Put a UMD and press O",0)
end
elseif settingsData.selected == 3 then
settingsData.show = false
settingsData.subSel = 0
settingsData.subMax = 6
elseif settingsData.selected == 5 then
-- Cargamos el navegador del browser de Sony desde iLife PSP
System.webbrowser("ms0:/psp/game/iLife PSP")
elseif settingsData.selected == 4 then
-- Esto es muy parecido a lo del principio, definimos las variables y abrimos cpu.conf en lectura
top1 = "0"
top = "333"
cup = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/cpu.conf", "w")
Speed = System.startOSK("","Write the new CPU speed")
if Speed > top then
System.message("333 Mhz at the most...",0)
System.setcpuspeed(333)
end
if Speed < top1 then
System.message("20 Mhz at least...",0)
System.setcpuspeed(222)
end
-- Se sobreescribe la velocidad, aunque antes comprueba que no se pase ni que sea menor de 20 Mhz
cup:write(Speed)
cup:close()
-- Se cierra el archivo y ponemos por defecto la velocidad escrita en cpu.conf
System.setcpuspeed(Speed)
elseif settingsData.selected == 6 then
-- Abrimos chat.lua
dofile(osDir .. "/chat.lua")
elseif settingsData.selected == 7 then
-- Descargamos un Update(si lo hay) desde una pág.
System.webbrowser("ms0:/psp/game/iLife PSP", "http://pspstation.org/files/iLife_PSP.zip ")
elseif settingsData.selected == 8 then
-- Cargamos credits.lua
dofile(osDir .. "/English/credits.lua")
screen:fontPrint(gui.font, 225, 262, "Press O to come back", colours.grey)
elseif settingsData.selected == 9 then
-- Se apaga la PSP
System.shutdown()
elseif settingsData.selected == 10 then
-- Salimos
System.Quit()
elseif settingsData.selected == 11 then
--Reiniciamos el programa simplemente ejecutando el EBOOT
System.runeboot("ms0:/PSP/GAME/iLife PSP/EBOOT.PBP")
end
end
if settingsData.selected == 0 then
screen:fontPrint(gui.font, 35, 60, "> Theme Settings", colours.white)
elseif settingsData.selected == 1 then
screen:fontPrint(gui.font, 35, 72, "> System Information", colours.white)
elseif settingsData.selected == 2 then
screen:fontPrint(gui.font, 35, 84, "> Dump UMD", colours.white)
elseif settingsData.selected == 3 then
screen:fontPrint(gui.font, 35, 96, "> USB Settings", colours.white)
elseif settingsData.selected == 4 then
screen:fontPrint(gui.font, 35, 108, "> CPU Settings", colours.white)
elseif settingsData.selected == 5 then
screen:fontPrint(gui.font, 35, 120, "> Internet Browser", colours.white)
elseif settingsData.selected == 6 then
screen:fontPrint(gui.font, 35, 132, "> Chat", colours.white)
elseif settingsData.selected == 7 then
screen:fontPrint(gui.font, 35, 144, "> iLife Update", colours.white)
elseif settingsData.selected == 8 then
screen:fontPrint(gui.font, 35, 156, "> Credits", colours.white)
elseif settingsData.selected == 9 then
screen:fontPrint(gui.font, 35, 168, "> Shutdown", colours.white)
elseif settingsData.selected == 10 then
screen:fontPrint(gui.font, 35, 180,"> Exit to XMB", colours.white)
elseif settingsData.selected == 11 then
screen:fontPrint(gui.font, 35, 192,"> Restart", colours.white)
end
else
if settingsData.subSel < 0 then
settingsData.subSel = settingsData.subMax
elseif settingsData.subSel > settingsData.subMax then
settingsData.subSel = 0
end
if pad:up() and not oldpad:up() then
settingsData.subSel = settingsData.subSel - 1
elseif pad:down() and not oldpad:down() then
settingsData.subSel = settingsData.subSel + 1
end
if settingsData.selected == 3 then
-- Empiezo por la 4º opción del menú, que es un submenú
-- Con los tostrings, recibimos cualquier tipo de argumentos y lo convertimos a un string
screen:fontPrint(gui.font,35,60, "USB Mode <" .. tostring(settingsData.usbMode) .. ">", colours.grey)
screen:fontPrint(gui.font,35,72, "Access Flash0 USB <" .. tostring(settingsData.flash0Mode) .. ">", colours.grey)
screen:fontPrint(gui.font,35,84, "Access Flash1 USB <" .. tostring(settingsData.flash1Mode) .. ">", colours.grey)
screen:fontPrint(gui.font,35,96, "Access Flash2 USB <" .. tostring(settingsData.flash2Mode) .. ">", colours.grey)
screen:fontPrint(gui.font,35,108, "Access Flash3 USB <" .. tostring(settingsData.flash3Mode) .. ">", colours.grey)
screen:fontPrint(gui.font,35,120, "Access UMD USB <" .. tostring(settingsData.UMDMode) .. ">", colours.grey)
screen:fontPrint(gui.font,35,132, "Back", colours.grey)
if pad:cross() and not oldpad:cross() then
-- Se activará la conexión USB si no lo está
if settingsData.subSel == 0 then
if settingsData.usbMode == false then
settingsData.usbMode = true
System.usbDiskModeActivate()
else
-- Si está activada, se desactiva
settingsData.usbMode = false
System.usbDiskModeDeactivate()
end
-- Aquí y con los demás hacemos lo mismo
elseif settingsData.subSel == 1 then
if settingsData.flash0Mode == false then
settingsData.flash0Mode = true
System.usbDevFlash0()
System.usbDiskModeActivate()
else
settingsData.flash0Mode = false
System.usbDevFlash0()
System.usbDiskModeDeactivate()
end
elseif settingsData.subSel == 2 then
if settingsData.flash1Mode == false then
settingsData.flash1Mode = true
System.usbDevFlash1()
System.usbDiskModeActivate()
else
settingsData.flash1Mode = false
System.usbDevFlash1()
System.usbDiskModeDeactivate()
end
elseif settingsData.subSel == 3 then
if settingsData.flash2Mode == false then
settingsData.flash2Mode = true
System.usbDevFlash2()
System.usbDiskModeActivate()
else
settingsData.flash2Mode = false
System.usbDevFlash2()
System.usbDiskModeDeactivate()
end
elseif settingsData.subSel == 4 then
if settingsData.flash3Mode == false then
settingsData.flash3Mode = true
System.usbDevFlash3()
System.usbDiskModeActivate()
else
settingsData.flash3Mode = false
System.usbDevFlash3()
System.usbDiskModeDeactivate()
end
elseif settingsData.subSel == 5 then
if settingsData.UMDMode == false then
settingsData.UMDMode = true
System.usbDevUMD()
System.usbDiskModeActivate()
else
settingsData.UMDMode = false
System.usbDevUMD()
System.usbDiskModeDeactivate()
end
elseif settingsData.subSel == 6 then
settingsData.show = true
end
end
if settingsData.subSel == 0 then
screen:fontPrint(gui.font,35,60, "USB Mode <" .. tostring(settingsData.usbMode) .. ">", colours.white)
elseif settingsData.subSel == 1 then
screen:fontPrint(gui.font,35,72, "Access Flash0 USB <" .. tostring(settingsData.flash0Mode) .. ">", colours.white)
elseif settingsData.subSel == 2 then
screen:fontPrint(gui.font,35,84, "Access Flash1 USB <" .. tostring(settingsData.flash1Mode) .. ">", colours.white)
elseif settingsData.subSel == 3 then
screen:fontPrint(gui.font,35,96, "Access Flash2 USB <" .. tostring(settingsData.flash2Mode) .. ">", colours.white)
elseif settingsData.subSel == 4 then
screen:fontPrint(gui.font,35,108, "Access Flash3 USB <" .. tostring(settingsData.flash3Mode) .. ">", colours.white)
elseif settingsData.subSel == 5 then
screen:fontPrint(gui.font,35,120, "Access UMD USB <" .. tostring(settingsData.UMDMode) .. ">", colours.white)
elseif settingsData.subSel == 6 then
screen:fontPrint(gui.font,35,132, "Back", colours.white)
end
elseif settingsData.selected == 1 then
if not settingBrowse then
-- Aquí mostramos información, mucha información, utilizando la función LUA que corresponda.
--Para calcular en MB, pasamos los bytes a esta medida.
screen:fontPrint(gui.fontsmall,35,52,"Nickname: "..System.nickName(), colours.grey)
screen:fontPrint(gui.fontsmall,35,63,"PSP: "..System.getModel(1).."",colours.grey)
screen:fontPrint(gui.fontsmall,35,74,"CFW Version : "..System.cfwVersion(), colours.grey)
screen:fontPrint(gui.fontsmall,35,85,"MAC Adress : "..Adhoc.getMac(), colours.grey)
screen:fontPrint(gui.fontsmall,35,96,"Full size MS(MB) : "..System.getTotalSize("ms0:/") / 1024 / 1024 , colours.grey)
screen:fontPrint(gui.fontsmall,35,107,"Free space MS(MB) : "..System.getFreeSpace("ms0:/") / 1024 / 1024 , colours.grey)
screen:fontPrint(gui.fontsmall,35,118,"Full size Flash0(bytes) : "..System.getTotalSize("flash0:/"), colours.grey)
screen:fontPrint(gui.fontsmall,35,129,"Free space Flash0(bytes) : "..System.getFreeSpace("flash0:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,140,"Full size Flash1(bytes) : "..System.getTotalSize("flash1:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,151,"Free space Flash1(bytes) : "..System.getFreeSpace("flash1:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,162,"Full size Flash2(bytes) : "..System.getTotalSize("flash2:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,173,"Free space Flash2(bytes) : "..System.getFreeSpace("flash2:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,184,"Full size Flash3(bytes) : "..System.getTotalSize("flash3:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,195,"Free space Flash3(bytes) : "..System.getFreeSpace("flash3:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,206,"Free RAM(MB) : "..System.getFreeMemory() / 1024 / 1024 , colours.grey)
screen:fontPrint(gui.fontsmall,35,217,"CPU Speed(Mhz) : "..System.getCpuSpeed(), colours.grey)
screen:fontPrint(gui.fontsmall,35,228,"Bus Speed(Mhz) : "..System.getBusSpeed(), colours.grey)
screen:fontPrint(gui.fontsmall,35,239,"Battery life percent : "..System.powerGetBatteryLifePercent(), colours.grey)
screen:fontPrint(gui.fontsmall,35,250,"Battery life time(Min) : "..System.powerGetBatteryLifeTime(), colours.grey)
screen:fontPrint(gui.font, 225, 262, "Press O to come back", colours.grey)
if pad:circle() and not oldpad:circle() then
if settingsData.subSel == 0 then
settingsData.show = true
end
end
if settingsData.subSel == 0 then
screen:fontPrint(gui.fontsmall,35,52,"Nickname: "..System.nickName(), colours.grey)
screen:fontPrint(gui.fontsmall,35,63,"PSP: "..System.getModel(1).."",colours.grey)
screen:fontPrint(gui.fontsmall,35,74,"CFW Version : "..System.cfwVersion(), colours.grey)
screen:fontPrint(gui.fontsmall,35,85,"MAC Adress : "..Adhoc.getMac(), colours.grey)
screen:fontPrint(gui.fontsmall,35,96,"Full size MS(MB) : "..System.getTotalSize("ms0:/") / 1024 / 1024 , colours.grey)
screen:fontPrint(gui.fontsmall,35,107,"Free space MS(MB) : "..System.getFreeSpace("ms0:/") / 1024 / 1024 , colours.grey)
screen:fontPrint(gui.fontsmall,35,118,"Full size Flash0(bytes) : "..System.getTotalSize("flash0:/"), colours.grey)
screen:fontPrint(gui.fontsmall,35,129,"Free space Flash0(bytes) : "..System.getFreeSpace("flash0:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,140,"Full size Flash1(bytes) : "..System.getTotalSize("flash1:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,151,"Free space Flash1(bytes) : "..System.getFreeSpace("flash1:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,162,"Full size Flash2(bytes) : "..System.getTotalSize("flash2:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,173,"Free space Flash2(bytes) : "..System.getFreeSpace("flash2:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,184,"Full size Flash3(bytes) : "..System.getTotalSize("flash3:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,195,"Free space Flash3(bytes) : "..System.getFreeSpace("flash3:/") , colours.grey)
screen:fontPrint(gui.fontsmall,35,206,"Free RAM(MB) : "..System.getFreeMemory() / 1024 / 1024 , colours.grey)
screen:fontPrint(gui.fontsmall,35,217,"CPU Speed(Mhz) : "..System.getCpuSpeed(), colours.grey)
screen:fontPrint(gui.fontsmall,35,228,"Bus Speed(Mhz) : "..System.getBusSpeed(), colours.grey)
screen:fontPrint(gui.fontsmall,35,239,"Battery life percent : "..System.powerGetBatteryLifePercent(), colours.grey)
screen:fontPrint(gui.fontsmall,35,250,"Battery life time(Min) : "..System.powerGetBatteryLifeTime(), colours.grey)
screen:fontPrint(gui.font, 225, 262, "Press O to come back", colours.grey)
end
end
-- Esta era la función del tema
elseif settingsData.selected == 0 then
if settingBrowse == false then
-- Submenú
screen:fontPrint(gui.font,35,60, "Theme <" .. cfg.theme .. ">", colours.grey)
screen:fontPrint(gui.font,35,72, "Back", colours.grey)
if pad:cross() and not oldpad:cross() then
-- Aquí abrimos el directorio de themes y elegimos el que nos convenga, siempre y cuando contenga los archivos que necesita. También vemos algunas variables...
if settingsData.subSel == 0 then
System.currentDirectory(osDir .. "/themes")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
settingBrowse = true
elseif settingsData.subSel == 1 then
settingsData.show = true
settingBrowse = false
end
end
if settingsData.subSel == 0 then
screen:fontPrint(gui.font,35,60, "Theme <" .. cfg.theme .. ">", colours.white)
elseif settingsData.subSel == 1 then
screen:fontPrint(gui.font,35,72, "Back", colours.white)
end
elseif settingsData.selected == 2 then
screen:fontPrint(gui.font,35,60,"Back", colours.grey)
if pad:cross() and not oldpad:cross() then
if settingsData.subSel == 0 then
settingsData.show = true
end
end
if settingsData.subSel == 0 then
screen:fontPrint(gui.font,35,60,"Back", colours.white)
end
end
end
end
if pad:triangle() and not oldpad:triangle() then
settingBrowse = false
end
end
-- Edita la información del system.conf. Si hay cosas mal escritas, puede provocar errores al iniciar iLife PSP
function writeConfig()
System.removeFile(osDir .. "/CONF/system.conf")
-- Removemos achivo y abrimos en MODO ESCRITURA el mismo con lo que se haya sobreescrito.
configFile = io.open(osDir .. "/CONF/system.conf","w")
configFile:write("cfg = { " .. 'theme="' .. tostring(cfg.theme) ..'",gameDir="' .. tostring(cfg.gameDir) ..'",musicDir="' .. tostring(cfg.musicDir) ..'",picDir="' .. tostring(cfg.picDir) ..'",autoUSB=' .. tostring(cfg.autoUSB) .." }")
configFile:close()
end
-- Esta función corresponde al sobreescribir la configuración del theme
function writeThemeData()
System.removeFile(osDir .. "/" .. cfg.theme .. "/theme.dat")
configFile = io.open(osDir .. "/" .. cfg.theme .. "/theme.dat","w")
configFile:write('cfg.wallpaper = "' .. wallpaperName .. '"')
configFile:close()
end
-- Actualizamos el tema y el wallpaper
function refreshTheme()
dofile(osDir .. "/" .. cfg.theme .. "/theme.dat")
wallpaperName = cfg.wallpaper
theWallpaper = Image.load(cfg.wallpaper)
cfg.wallpaper = theWallpaper
skin = {
main = Image.load(osDir .. "/" .. cfg.theme .. "/back.png"),
browse = Image.load(osDir .. "/" .. cfg.theme .. "/browse.png"),
games = Image.load(osDir .. "/" .. cfg.theme .. "/games.png"),
music = Image.load(osDir .. "/" .. cfg.theme .. "/music.png"),
photo = Image.load(osDir .. "/" .. cfg.theme .. "/photo.png"),
settings = Image.load(osDir .. "/" .. cfg.theme .. "/settings.png"),
nopreview = Image.load(osDir .. "/" .. cfg.theme .. "/nopreview.png"),
player = Image.load(osDir .. "/" .. cfg.theme .. "/repr.png")
}
gui.main:clear()
gui.main:blit(0,0,cfg.wallpaper)
gui.main:blit(0,0,skin.main)
end
-- Se borra la configuración del archivo de tema
function writeBlankTheme()
System.removeFile(osDir .. "/" .. cfg.theme .. "/theme.dat")
configFile = io.open(osDir .. "/" .. cfg.theme .. "/theme.dat","w")
configFile:close()
end
-- Navegador de iLife PSP
function browseDir()
screen:blit(30,55,skin.browse)
if fBrowser.currAmt > fBrowser.entries then
fBrowser.currAmt = 1
end
-- Abrimos bucle for
for i = ((fBrowser.currAmt-1)*fBrowser.oldAmt)+1, fBrowser.currAmt*fBrowser.oldAmt do
if fBrowser.entries >= i then
screen:fontPrint(gui.font,38,(((i-((fBrowser.currAmt-1)*fBrowser.oldAmt))*13)-10)+90,files[i].name,colours.grey)
elseif fBrowser.entries < i then break end
end
screen:fontPrint(gui.fontsml, 40, 67, string.sub(System.currentDirectory(), 0, 50), colours.white)
screen:fontPrint(gui.font,38,(((fBrowser.selected-((fBrowser.currAmt-1)*fBrowser.oldAmt))*13)-10)+90,files[fBrowser.selected].name,colours.white)
if pad:up() and not oldpad:up() then
fBrowser.selected = fBrowser.selected - 1
elseif pad:down() and not oldpad:down() then
fBrowser.selected = fBrowser.selected + 1
end
if fBrowser.selected > fBrowser.entries then
fBrowser.selected = 1
elseif fBrowser.selected < 1 then
fBrowser.selected = fBrowser.entries
end
if fBrowser.selected > fBrowser.oldAmt*fBrowser.currAmt then
fBrowser.currAmt = fBrowser.currAmt + 1
elseif fBrowser.selected < ((fBrowser.currAmt-1) * fBrowser.oldAmt)+1 then
fBrowser.currAmt = fBrowser.currAmt - 1 fBrowser.selected = (fBrowser.currAmt)*fBrowser.oldAmt
end
-- Usamos la variable de una tabla, para que nos devuelva los elementos
if pad:cross() and not oldpad:cross() then
if files[fBrowser.selected].directory then
if not settingBrowse then
System.currentDirectory(files[fBrowser.selected].name)
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
elseif settingBrowse == true then
if fBrowser.selected > 2 then
cfg.theme = "themes/" .. files[fBrowser.selected].name
writeConfig()
settingBrowse = false
refreshTheme()
end
end
-- A partir de aquí definimos una serie de funciones para cada formato
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
playOgg()
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
playMp3()
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
playAA3ME()
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "cso" then
System.message("OE Isofs required",0)
System.startISO(System.currentDirectory() .. "/" .. files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "txt" then
dofile(osDir .. "/TEXT/textfiles.lua")
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "log" then
dofile(osDir .. "/TEXT/textfiles.lua")
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "pdf" then
dofile(osDir .. "/TEXT/textfiles.lua")
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "htm" then
dofile(osDir .. "/TEXT/textfiles.lua")
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "php" then
dofile(osDir .. "/TEXT/textfiles.lua")
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "iso" then
System.message("OE Isofs required",0)
System.startISO(System.currentDirectory() .. "/" .. files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "lua" then
dofile(System.currentDirectory() .. "/" ..files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "dax" then
System.startISO(System.currentDirectory() .. "/" .. files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "pbp" then
System.runeboot(System.currentDirectory().. "/" .. files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "psx" then
System.startPSX(System.currentDirectory().. "/" .. files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "zip" then
zip = System.currentDirectory()
ZIP.extract(zip.."/"..files[fBrowser.selected].name, "ms0:/","")
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "elf" then
System.loadElf(System.currentDirectory() .. "/" ..files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "prx" then
System.loadPrxKernel(System.currentDirectory() .. "/" ..files[fBrowser.selected].name)
elseif string.lower(string.sub(files[fBrowser.selected].name, -3)) == "jpg" or string.lower(string.sub(files[fBrowser.selected].name, -3)) =="png" or string.lower(string.sub(files[fBrowser.selected].name, -3)) =="bmp" then
screen:clear()
img = Image.load(System.currentDirectory() .. "/" .. files[fBrowser.selected].name)
-- Definimos x e y
x = 0
y = 0
screen:blit(0,0,img)
-- Mostramos imagen
screen.flip()
viewing = true
-- Mientras veamos la imagen , podemos mover el analógico para mover la imagen
while viewing == true do
pad = Controls.read()
if pad:analogY() < -64 then
screen:clear()
y = y - 4
screen:blit(x,y,img)
screen.flip()
end
if pad:analogY() > 64 then
screen:clear()
y = y + 4
screen:blit(x,y,img)
screen.flip()
end
if pad:analogX() < -64 then
screen:clear()
x = x - 4
screen:blit(x,y,img)
screen.flip()
end
if pad:analogX() > 64 then
screen:clear()
x = x + 4
screen:blit(x,y,img)
screen.flip()
end
if pad:up() then
screen:clear()
y = y - 4
screen:blit(x,y,img)
screen.flip()
end
if pad:down() then
screen:clear()
y = y + 4
screen:blit(x,y,img)
screen.flip()
end
if pad:left() then
screen:clear()
x = x - 4
screen:blit(x,y,img)
screen.flip()
end
if pad:right() then
screen:clear()
x = x + 4
screen:blit(x,y,img)
screen.flip()
end
-- Si pulsamos O vaciamos la variable img para tener más espacio en la memoria y la limpiamos de paso. Con un return, volvemos al navegador de iLife PSP
if pad:circle() and not oldpad:circle() then
img = nil
System.memclean()
return
end
screen.waitVblankStart()
end
end
end
-- El triángulo realiza la función de iniciar un UMD
if pad:triangle() and not oldpad:triangle() then
System.startUMD()
end
if pad:circle() and not oldpad:circle() then
System.currentDirectory("../")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
end
end
-- Esta función nos sirve para mostrar la hora, usando la función os.time
function reloj()
date_ = os.date("*t", os.time())
local hora, min_, sec = date_.hour
hora = hora + 1
if hora < 10 then
hora = "0"..hora
end
min_ = date_.min
if min_ < 10 then
min_ = "0"..min_
end
sec = date_.sec
if sec < 10 then
sec = "0"..sec
end
screen:fontPrint(gui.font,405,36,""..hora..":"..min_..":"..sec.."", colours.white)
end
año = System.getDate(1)
mes = System.getDate(2)
dia = System.getDate(3)
-- 12 Hour Clock
-- Handles the GUI layout
function handleGraphics()
screen:clear(colours.white)
if pad:r() and not oldpad:r()then
ctrl.tab = ctrl.tab + 1
settingBrowse = false
if ctrl.tab == 1 then
-- El directorio por defecto a la hora de querer visualizar imágenes es PICTURE
System.currentDirectory("ms0:/PICTURE")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
elseif ctrl.tab == 2 then
-- El directorio por defecto a la hora de querer reproducir música es MUSIC
System.currentDirectory("ms0:/MUSIC")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
elseif ctrl.tab == 0 then
-- El directorio por defecto a la hora de ejecutar demás archivos, por defecto, es el directorio de iLife
System.currentDirectory(osDir .. "../")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
end
elseif pad:l() and not oldpad:l() then
ctrl.tab = ctrl.tab - 1
settingBrowse = false
if ctrl.tab == 1 then
System.currentDirectory("ms0:/PICTURE")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
elseif ctrl.tab == 2 then
System.currentDirectory("ms0:/MUSIC")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
elseif ctrl.tab == 0 then
System.currentDirectory(osDir .. "/../")
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
end
elseif ctrl.tab < 0 then
ctrl.tab = 3
elseif ctrl.tab > 3 then
ctrl.tab = 0
end
if ctrl.tab == 0 then
gui.seltab = skin.games
elseif ctrl.tab == 1 then
gui.seltab = skin.photo
elseif ctrl.tab == 2 then
gui.seltab = skin.music
elseif ctrl.tab == 3 then
gui.seltab = skin.settings
end
screen:blit(0,0,gui.main)
-- Conseguimos memoria
collectgarbage()
screen:blit(16,20,gui.seltab)
-- Info de la batería
battery.life = System.powerGetBatteryLifePercent()
battery.img:clear()
verde=Color.new( 0, 255, 0 )
battery.img:fillRect(0,0,28,13,verde)
battery.img:fillRect(0,0,1,1,colours.clear)
battery.img:fillRect(0,12,1,1,colours.clear)
battery.img:fillRect(27,0,1,1,colours.clear)
battery.img:fillRect(27,12,1,1,colours.clear)
battery.img:fontPrint(gui.fontmed,3,10,battery.life,colours.white)
screen:blit(415,11,battery.img)
reloj()
end
battery.life = 10
-- Handles the processing and functions of the shell
function handleProcess()
-- Check which process is being used
if ctrl.tab == 0 then
ctrl.games = true
else
ctrl.games = false
end
if ctrl.tab == 1 then
ctrl.photo = true
else
ctrl.photo = false
end
if ctrl.tab == 2 then
ctrl.music = true
else
ctrl.music = false
end
if ctrl.tab == 3 then
ctrl.settings = true
else
ctrl.settings = false
end
if settingBrowse then
browseDir()
end
-- Handle each seperate screen
if ctrl.games == true then
browseDir()
screen:blit(325, 100, skin.nopreview)
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "lua" then
screen:fontPrint(gui.font, 325, 80, files[fBrowser.selected].name, colours.white)
end
elseif ctrl.photo == true then
browseDir()
elseif ctrl.music == true then
browseDir()
elseif ctrl.settings == true then
settingsMenu()
end
end
while true do
-- Variable del update de ilife PSP
update = System.doesFileExist("ms0:/PSP/COMMON/iLife_PSP.zip")
--Si encontramos el update de iLife PSP descargado, lo copiamos a la raíz y removemos el anterior( aunque no funciona debidamente por problemas ajenos a mí(código del luaplayer)), y luego ejecutamos update.lua
if update == 1 then
System.copyFile("ms0:/PSP/COMMON/iLife_PSP.zip", "ms0:/iLife_PSP.zip", 1)
System.removeFile("ms0:/PSP/COMMON/iLife_PSP.zip")
dofile("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/UPDATE/update.lua")
end
-- Si no está, se inicia iLife PSP con total normalidad
if update == 0 then
pad = Controls.read()
handleGraphics()
handleProcess()
screen:blit(-299,192,background2)
screen:fontPrint(gui.fontsmall,30,268,"Press to start UMD", colours.grey)
screen:fontPrint(gui.font,135,268,""..dia.."/"..mes.."/"..año,colours.white)
-- Pulsando select, obtenemos una screen
if pad:select() then
picture = System.startOSK("ms0:/screen.jpg","Write the name")
screen:save(picture)
end
-- Pulsando start accedemos al menú de files.lua
if pad:start() and not oldpad:start() then
dofile(osDir .. "/English/files.lua")
end
oldpad = pad
screen.waitVblankStart()
screen.flip()
end
end Código: -- Definimos variables de los colores
red = Color.new(255, 0, 0)
white = Color.new(255, 255, 255)
-- Elementos del menú
Select = 1
maxSelect = 5
oldpad = Controls.read()
-- Menú
while true do
pad = Controls.read()
----Menu---------------------------------------------
if pad:up() and oldpad:up() ~= pad:up() then
Select = Select - 1
end
if pad:down() and oldpad:down() ~= pad:down() then
Select = Select + 1
end
if Select > maxSelect then
Select = 1
elseif Select <= 0 then
Select = maxSelect
end
if Select == 1 then
screen:fontPrint(gui.font,195,140, "Delete file/folder", red)
screen:fontPrint(gui.font,195,157, "Create a new folder",white)
screen:fontPrint(gui.font,195,174, "Rename file/folder" ,white)
screen:fontPrint(gui.font,195,191, "Cut and paste file" ,white)
screen:fontPrint(gui.font,195,208, "Return" ,white)
end
if Select == 2 then
screen:fontPrint(gui.font,195,140, "Delete file/folder", white)
screen:fontPrint(gui.font,195,157, "Create a new folder" ,red)
screen:fontPrint(gui.font,195,174, "Rename file/folder" ,white)
screen:fontPrint(gui.font,195,191, "Cut and paste file" ,white)
screen:fontPrint(gui.font,195,208, "Return" ,white)
end
if Select == 3 then
screen:fontPrint(gui.font,195,140, "Delete file/folder", white)
screen:fontPrint(gui.font,195,157, "Create a new folder" ,white)
screen:fontPrint(gui.font,195,174, "Rename file/folder" ,red)
screen:fontPrint(gui.font,195,191, "Cut and paste file" ,white)
screen:fontPrint(gui.font,195,208, "Return" ,white)
end
if Select == 4 then
screen:fontPrint(gui.font,195,140, "Delete file/folder", white)
screen:fontPrint(gui.font,195,157, "Create a new folder" ,white)
screen:fontPrint(gui.font,195,174, "Rename file/folder" ,white)
screen:fontPrint(gui.font,195,191, "Cut and paste file" ,red)
screen:fontPrint(gui.font,195,208, "Return" ,white)
end
if Select == 5 then
screen:fontPrint(gui.font,195,140, "Delete file/folder", white)
screen:fontPrint(gui.font,195,157, "Create a new folder" ,white)
screen:fontPrint(gui.font,195,174, "Rename file/folder" ,white)
screen:fontPrint(gui.font,195,191, "Cut and paste file" ,white)
screen:fontPrint(gui.font,195,208, "Return" ,red)
end
if pad:cross() and Select == 1 then
-- Asignamos una variable con la que removeremos archivos y carpetas
ms = System.currentDirectory()
System.removeDirectory(ms.."/"..files[fBrowser.selected].name)
System.removeFile(ms.."/"..files[fBrowser.selected].name)
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
end
if pad:cross() and Select == 2 then
-- Crearemos una carpeta con el nombre que le demos
name2 = System.startOSK("ms0:/New folder","Write the new folder")
System.createDirectory(name2)
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
end
if pad:cross() and Select == 3 then
-- Renombraremos un archivo o una carpeta
ms = System.currentDirectory()
rename = System.startOSK(ms.."/"..files[fBrowser.selected].name,"Write the new name")
System.rename(ms.."/"..files[fBrowser.selected].name,rename)
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
end
if pad:cross() and Select == 4 then
-- Copiaremos tal archivo a tal lugar
ms = System.currentDirectory()
copy = System.startOSK(ms.."/"..files[fBrowser.selected].name,"Copy to:")
System.copyFile(ms.."/"..files[fBrowser.selected].name,copy..files[fBrowser.selected].name,1)
files = System.listDirectory()
fBrowser = {
entries = table.getn(files),
selected = 1,
currAmt = 1,
oldAmt = 10,
}
end
if pad:cross() and Select == 5 then
-- Volveremos al menú, y actualizaremos con un "flip" el navegador para que se vean que los cambios de los archivos o carpetas se han producido
screen.flip()
break
end
screen.waitVblankStart()
screen.flip()
oldpad = pad
end Código: while true do -- Limpiamos pantalla y reproducimos imagen ya cargada screen:clear() screen:blit(0,0,credits) screen.waitVblankStart() screen:fontPrint(gui.fontsm, 120, 70, "iLife PSP Version: 3.0", colours.white) screen:fontPrint(gui.font, 80, 100, "Developer and translator: Nikocronaldo", colours.white) screen:fontPrint(gui.font, 80, 113, "Graphic designer: Kogoyin", colours.white) screen:fontPrint(gui.font, 80, 126, "Thanks to ToDoPsp community as well as ", colours.white) screen:fontPrint(gui.font, 80, 139, "PSPStation for uploading the new iLife's Updaters", colours.white) screen:fontPrint(gui.fontsmall, 80, 180, "To report bugs or to send suggestions, send them to us at ilifepsp@gmail.com", colours.white) screen:fontPrint(gui.fontsmall, 90, 230, "BrowsR adaptation", colours.white) screen.flip() pad = Controls.read() if pad:circle() then -- Volvemos con un "break" al menú break end oldpad = pad screen.waitVblankStart() end Código: -- MP3 Player for LUA by nikocronaldo
-- Limpiamos memoria para obtener más
collectgarbage()
System.memclean()
-- Ponemos la CPU a 160 Mhz
System.setcpuspeed(160)
Mp3me.play() -- Reproducimos el MP3
-- La pantalla de la PSP se pondrá negra si pasa un determinado tiempo
System.LCDTimerEnable()
-- Definimos variables de la información de archivos MP3
artist = Mp3me.artist()
title = Mp3me.title()
album = Mp3me.album()
genre = Mp3me.genre()
track = Mp3me.trackNumber()
time = Mp3me.songTime()
layer = Mp3me.layer()
kbit = Mp3me.kbit()
year = Mp3me.year()
ttime = Mp3me.gettime()
percent = Mp3me.percent()
mode = Mp3me.mode()
-- Definimos la variable de la font y su tamaño
fontmmm = Font.createProportional()
fontmmm:setPixelSizes(35,35)
while true do
-- Limpiamos pantalla y mostramos la imagen del reproductor
screen:clear()
screen:blit(0,0,skin.player)
screen.waitVblankStart()
screen:fontPrint(fontmmm, 50, 40, "iLife PSP Music" , colours.white)
-- Abrimos language.conf en MODO LECTURA para poner la info del MP3 en el idioma por defecto
cup = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/language.conf", "r")
Lg = cup:read()
cup:close()
if Lg == "English" then
screen:fontPrint(gui.font,15,75,"Title : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artist : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Genre : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Track Number: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Layer : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Year : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Mode : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Song Time : " .. Mp3me.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Percent : " .. Mp3me.percent(), colours.white)
end
if Lg == "French" then
screen:fontPrint(gui.font,15,75,"Titre : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artiste : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Categorie : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Morceau: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Couche : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Année : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Mode : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Temps : " .. Mp3me.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Pourcentage : " .. Mp3me.percent(), colours.white)
end
if Lg == "Spanish" then
screen:fontPrint(gui.font,15,75,"Titulo : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artista : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Genero : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Pista: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Capa : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Ano : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Modo : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Tiempo cancion : " .. Mp3me.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Porcentaje : " .. Mp3me.percent(), colours.white)
end
screen.flip()
pad = Controls.read()
-- Si pulsas X, se pausa
if pad:cross() and not oldpad:cross() then
Mp3me.pause()
-- Si pulsas O vuelves al navegador
elseif pad:circle() and not oldpad:circle() then
break
end
-- Pulsando R o L avanzamos o retrocedemos canciones
if pad:r() and not oldpad:r() then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected + 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected + 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected + 1
playOgg()
end
end
end
end
if pad:l() and not oldpad:l() then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected - 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected - 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected - 1
playOgg()
end
end
end
end
-- Si la canción ha finalizado, iniciar la siguiente
if Mp3me.eos() == "true" then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected + 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected + 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected + 1
playOgg()
end
end
end
end
-- Con esto podemos navegar por el navegador escuchando música
if pad:square() and not oldpad:square() then
Mp3me.stop()
break
end
oldpad = pad
screen.waitVblankStart()
end Código: collectgarbage()
System.memclean()
System.setcpuspeed(160)
aa3me.play()
System.LCDTimerEnable()
artist = aa3me.artist()
title = aa3me.title()
album = aa3me.album()
genre = aa3me.genre()
track = aa3me.trackNumber()
time = aa3me.songTime()
layer = aa3me.layer()
kbit = aa3me.kbit()
year = aa3me.year()
ttime = aa3me.gettime()
percent = aa3me.percent()
mode = aa3me.mode()
fontmmm = Font.createProportional()
fontmmm:setPixelSizes(35,35)
while true do
screen:clear()
screen:blit(0,0,skin.player)
screen.waitVblankStart()
screen:fontPrint(fontmmm, 50, 40, "iLife PSP Music" , colours.white)
cup = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/language.conf", "r")
Lg = cup:read()
cup:close()
if Lg == "English" then
screen:fontPrint(gui.font,15,75,"Title : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artist : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Genre : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Track Number: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Layer : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Year : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Mode : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Song Time : " .. aa3me.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Percent : " .. aa3me.percent(), colours.white)
end
if Lg == "French" then
screen:fontPrint(gui.font,15,75,"Titre : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artiste : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Categorie : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Morceau: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Couche : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Année : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Mode : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Temps : " .. aa3me.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Pourcentage : " .. aa3me.percent(), colours.white)
end
if Lg == "Spanish" then
screen:fontPrint(gui.font,15,75,"Titulo : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artista : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Genero : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Pista: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Capa : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Ano : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Modo : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Tiempo cancion : " .. aa3me.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Porcentaje : " .. aa3me.percent(), colours.white)
end
screen.flip()
pad = Controls.read()
if pad:cross() and not oldpad:cross() then
aa3me.pause()
elseif pad:circle() and not oldpad:circle() then
break
end
if pad:r() and not oldpad:r() then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected + 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected + 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected + 1
playOgg()
end
end
end
end
if pad:l() and not oldpad:l() then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected - 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected - 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected - 1
playOgg()
end
end
end
end
if aa3me.eos() == "true" then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected + 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected + 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected + 1
playOgg()
end
end
end
end
if pad:square() and not oldpad:square() then
aa3me.stop()
break
end
oldpad = pad
screen.waitVblankStart()
end Código: collectgarbage()
System.memclean()
System.setHigh()
Ogg.play()
System.LCDTimerEnable()
artist = Ogg.artist()
title = Ogg.title()
album = Ogg.album()
genre = Ogg.genre()
track = Ogg.trackNumber()
time = Ogg.songTime()
layer = Ogg.layer()
kbit = Ogg.kbit()
year = Ogg.year()
ttime = Ogg.gettime()
percent = Ogg.percent()
mode = Ogg.mode()
fontmmm = Font.createProportional()
fontmmm:setPixelSizes(35,35)
while true do
screen:clear()
screen:blit(0,0,skin.player)
screen.waitVblankStart()
screen:fontPrint(fontmmm, 50, 40, "iLife PSP Music" , colours.white)
cup = io.open("ms0:/PSP/GAME/iLife PSP/iLife/iLife PSP/CONF/language.conf", "r")
Lg = cup:read()
cup:close()
if Lg == "English" then
screen:fontPrint(gui.font,15,75,"Title : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artist : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Genre : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Track Number: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Layer : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Year : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Mode : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Song Time: " .. Ogg.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Percent: " .. Ogg.percent(), colours.white)
end
if Lg == "French" then
screen:fontPrint(gui.font,15,75,"Titre : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artiste : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Categorie : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Morceau: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Couche : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Année : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Mode : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Temps : " .. Ogg.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Pourcentage : " .. Ogg.percent(), colours.white)
end
if Lg == "Spanish" then
screen:fontPrint(gui.font,15,75,"Titulo : "..title, colours.white)
screen:fontPrint(gui.font,18,115,"Artista : "..artist, colours.white)
screen:fontPrint(gui.font,18,126,"Album : "..album, colours.white)
screen:fontPrint(gui.font,18,137,"Genero : "..genre, colours.white)
screen:fontPrint(gui.font,18,148,"Pista: "..track, colours.white)
screen:fontPrint(gui.font,393,97,""..time, colours.white)
screen:fontPrint(gui.font,18,159,"Capa : "..layer, colours.white)
screen:fontPrint(gui.font,18,170,"kilobyte : "..kbit, colours.white)
screen:fontPrint(gui.font,18,181,"Ano : "..year, colours.white)
screen:fontPrint(gui.font,18,192,"Modo : "..mode, colours.white)
screen:fontPrint(gui.font,18, 203, "Tiempo cancion : " .. Ogg.gettime(), colours.white)
screen:fontPrint(gui.font,18, 214, "Porcentaje : " .. Ogg.percent(), colours.white)
end
screen.flip()
pad = Controls.read()
if pad:cross() and not oldpad:cross() then
Ogg.pause()
elseif pad:circle() and not oldpad:circle() then
break
end
if pad:r() and not oldpad:r() then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected + 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected + 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected + 1
playOgg()
end
end
end
end
if pad:l() and not oldpad:l() then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected - 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected - 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected - 1
playOgg()
end
end
end
end
-- No es un error, es que el formato OGG no es Media Engine y esto es de momento la única forma de esta función
if Ogg.percent() == 100 then
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "mp3" then
fBrowser.selected = fBrowser.selected + 1
playMp3()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "aa3" then
fBrowser.selected = fBrowser.selected + 1
playAA3ME()
if string.lower(string.sub(files[fBrowser.selected].name, -3)) == "ogg" then
fBrowser.selected = fBrowser.selected + 1
playOgg()
end
end
end
end
if pad:square() and not oldpad:square() then
Ogg.stop()
break
end
oldpad = pad
screen.waitVblankStart()
end Código: while true do screen:clear() screen:blit(0,0,text) screen.waitVblankStart() -- Damos variable a y y = 65 -- Se abre el archivo de texto seleccionado archivo = io.open(System.currentDirectory() .. "/" .. files[fBrowser.selected].name,"r") -- Con un simple bucle for, ya podemos leer el archivo for linea in archivo:lines() do y = y + 10 screen:fontPrint(gui.fontsml,55,y,linea,colours.black) end archivo:close() screen.flip() pad = Controls.read() if pad:circle() and not oldpad:circle() then break end oldpad = pad screen.waitVblankStart() end Código: -- Definimos un contador
minutero = Timer.new()
minutero:start()
Adhoc.init()
Adhoc.connect()
while true do
screen:clear()
screen:blit(0,0,image)
pad = Controls.read()
-- El texto que se envíe y el enviado será el que se escriba simplemente.
texto1 = Adhoc.recv()
Adhoc.recv()
screen:fontPrint(gui.font,160,35,"iLife Chat Beta",colours.white)
screen:fontPrint(gui.fontsmall,160,60,"Messages from you",colours.white)
screen:fontPrint(gui.fontsmall,20,35,"Press L1 to write a message",colours.white)
screen:fontPrint(gui.fontsmall,385,35,"Press R1 to send it",colours.white)
screen:fontPrint(gui.fontsmall,160,190,"Messages to you",colours.white)
screen:fontPrint(gui.font,25,190,texto1,negro)
-- Se envía el texto
if pad:l() and not oldpad:l() then
textoenv = System.startOSK("","Write your message")
end
-- Se escribe el texto
if pad:r() and not oldpad:r() then
Adhoc.send(textoenv)
screen:fontPrint(gui.font,20,110,textoenv,negro)
end
currentTime = minutero:time()
if currentTime > 1800 then
minuteur:stop()
minuteur:reset(0)
minuteur:start()
end
if pad:circle() and not oldpad:circle() then
Adhoc.term()
break
end
screen.waitVblankStart()
screen.flip()
end Código: -- Definimos las variables de la font y el tamaño de cada font
gui = {
fonta = Font.createProportional(),
font = Font.createProportional(),
fontsml = Font.createProportional(),
fontmed = Font.createProportional(),
fontsmall = Font.createProportional(),
}
gui.fonta:setPixelSizes(35,35)
gui.font:setPixelSizes(12,12)
gui.fontsml:setPixelSizes(9,9)
gui.fontmed:setPixelSizes(11,11)
gui.fontsmall:setPixelSizes(9,9)
-- Definimos los colores
blanco = Color.new ( 255, 255, 255 )
rojo = Color.new ( 255, 0, 0 )
negro = Color.new ( 0, 0, 0 )
counter = Timer.new()
counter:start()
-- Como LUA tiene ese error de no poder borrar archivos, hacemos esto para asegurarnos
System.rename( "ms0:/PSP/COMMON/iLife_PSP.zip","ms0:/PSP/COMMON/delete.zip")
System.removeFile("ms0:/PSP/GAME/iLife PSP/EBOOT.PBP")
while true do
-- Limpiamos la pantalla y cargamos la imagen
screen:clear()
currentTime = counter:time()
screen:blit(0,0,credits)
screen.waitVblankStart()
screen:fontPrint(gui.fonta, 100, 90, "iLife PSP Update" , blanco)
screen:fontPrint(gui.font, 140, 153, "Installing new iLife PSP version..." , blanco)
if currentTime > 4000 then
-- Extraemos el ZIP
ZIP.extract("ms0:/iLife_PSP.zip", "ms0:/","")
screen:fontPrint(gui.font, 335, 153, "OK" , blanco)
end
if currentTime > 35000 then
-- Reiniciamos el programa ejecutando el EBOOT del nuevo iLife
screen:fontPrint(gui.font, 140, 166, "Rebooting iLife PSP, wait..." , blanco)
end
if currentTime > 40000 then
System.runeboot("ms0:/PSP/GAME/iLife PSP/EBOOT.PBP")
end
screen.flip()
pad = Controls.read()
oldpad = pad
screen.waitVblankStart()
end |
| | |
| | #2 |
| Administrator ![]() | Perfecto, es el momento que todos aquellos programadores noveles os atosiguen a preguntas, que para eso estamos, para aprender y para enseñar lo aprendido. |
| | |
| The Following User Says Thank You to mouth For This Useful Post: | PePePa (27/05/10) |
| | #3 |
| Senior Member Fecha de Ingreso: feb 2010 Ubicación: Teulada Mensajes: 117 Thanks: 15 Thanked 17 Times in 10 Posts ![]() | Para hacer correr dicha shell , se necesita Custom Firme Ware o basta con el exploit de patapon en 6.20 ? __________________ I'm funny, i'm skywalker, i'm the funny skywalker |
| | |
| The Following User Says Thank You to FunnySkywalker For This Useful Post: | PePePa (27/05/10) |
| | #4 |
| PSP Go 6.31 ![]() | supongo que con el CF |
| | |
| | #5 |
| €n Meridian Fecha de Ingreso: jun 2010 Mensajes: 33 Thanks: 0 Thanked 0 Times in 0 Posts ![]() | y para que sirve eso kede medio perdido |
| | |
| | #6 |
| What's up gangsta! Fecha de Ingreso: jun 2010 Mensajes: 484 Thanks: 48 Thanked 75 Times in 67 Posts ![]() | Alguien sabe hacer homebrew |
| | |
| | #7 |
| Pesepero desde 2005 ![]() | Es evidente que tú no. Ni siquiera sabes postear en el foro correcto... __________________ "Hay que ser aprendiz de todo, en beneficio propio. Y hay que ser maestro de algo, en beneficio de los demás" ¿Tienes alguna pregunta para Seneka? ¡Hazla aquí! Lectura recomendada Miembro nº 002 del Comité contra las faltas voluntarias y el lenguaje SMS No respondo dudas por mensaje privado. Los mensajes privados son para asuntos personales. Las dudas van al foro Dudas sobre PSP o al tutorial correspondiente. |
| | |
| The Following User Says Thank You to Yomes For This Useful Post: | oscar47 (13/07/10) |
![]() |
| Herramientas | |
|
|
