Skip to content

Commit

Permalink
Add Reload Content for psp games
Browse files Browse the repository at this point in the history
  • Loading branch information
ONElua authored Jan 7, 2024
1 parent 9c64ebe commit 926bda8
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 15 deletions.
Binary file modified ONEMenuVita/eboot.bin
Binary file not shown.
29 changes: 28 additions & 1 deletion ONEMenuVita/system/appmanager/system.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ local update_callback = function ()
SubOptions()
end

local restart_callback = function ()
os.delay(150)
os.restart()
end

local reboot_callback = function ()
os.delay(1000)
power.restart()
end

local shutdown_callback = function ()
os.delay(1000)
power.shutdown()
end

local exit_callback = function ()
os.delay(500)
os.exit()
end

function SubOptions()
if __PIC1 == 1 then showpic = STRINGS_APP_YES else showpic = STRINGS_APP_NO end
if __SLIDES == 100 then var = STRINGS_APP_SLIDE_ORIGINAL else var = STRINGS_APP_SLIDE_PS4 end
Expand All @@ -84,6 +104,13 @@ function SubOptions()
{ text = STRINGS_SUBMENU_THEMES, funct = themesONEMenu_callback, descr = STRINGS_THEMES1MENU_DESCR },

{ text = STRINGS_ENABLE_UPDATE.._update, funct = update_callback, pad = true, descr = STRINGS_ENABLE_UPDATE_DESCR },

{ text = STRINGS_SUBMENU_RESTART, funct = restart_callback, descr = STRINGS_RESTART_DESCR },
{ text = STRINGS_SUBMENU_RESET, funct = reboot_callback, descr = STRINGS_REBOOT_DESCR },
{ text = STRINGS_SUBMENU_POWEROFF, funct = shutdown_callback, descr = STRINGS_POWEROFF_DESCR },

{ text = STRINGS_SUBMENU_EXIT, funct = exit_callback, descr = STRINGS_EXIT_DESCR },

}

end
Expand All @@ -109,7 +136,7 @@ function SubSystem()

screen.print(480,y, Sub_Options[i].text,1.0,theme.style.TXTCOLOR,theme.style.TXTBKGCOLOR,__ACENTER)

if i == 1 or i == 4 or i == 6 or i == 8 then
if i == 1 or i == 4 or i == 5 or i == 8 then
y+=36
else
y+=26
Expand Down
8 changes: 6 additions & 2 deletions ONEMenuVita/system/explorer/explorer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ function ctrls_explorer_list()
end

if scroll.list.maxim > 0 then -- Is exists any?
if buttons.up or buttons.analogly < -60 then scroll.list:up() end
if buttons.down or buttons.analogly > 60 then scroll.list:down() end
if buttons.up or buttons.analogly < -60 then
if scroll.list:up() then xtitle=35 end
end
if buttons.down or buttons.analogly > 60 then
if scroll.list:down() then xtitle=35 end
end

if buttons.accept then
if explorer.list[scroll.list.sel].size then
Expand Down
107 changes: 95 additions & 12 deletions ONEMenuVita/system/explorer/refresh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ function refresh_init(img)
end

if img then img:blit(0,0) end
message_wait()
message_wait(STRINGS_LIVEAREA_SEARCH_GAMES)
os.delay(15)

local vbuff = screen.toimage()
if vbuff then vbuff:blit(0,0) elseif img then img:blit(0,0) end


local list = {}
--Scanning ux0:app
local tmp = files.listdirs("ux0:app")
Expand Down Expand Up @@ -179,12 +178,103 @@ function refresh_init(img)
end

else
os.message(STRINGS_LIVEAREA_NO_GAMES)
--os.message(STRINGS_LIVEAREA_NO_GAMES)
end

if count > 0 then os.message(STRINGS_LIVEAREA_GAMES..count) end
if count > 0 then os.message(STRINGS_LIVEAREA_GAMES..count) else os.message(STRINGS_LIVEAREA_NO_GAMES) end

__TITTLEAPP, __IDAPP = "",""
count = 0

if img then img:blit(0,0) elseif vbuff then vbuff:blit(0,0) end
message_wait(STRINGS_LIVEAREA_EXTRAREFRESH)
os.delay(15)

local installs = game.extrarefresh()
os.message(STRINGS_LIVEAREA_TOTAL_EXTRA..installs)

if img then img:blit(0,0) elseif vbuff then vbuff:blit(0,0) end
message_wait(STRINGS_LIVEAREA_SEARCH_PSP)
os.delay(15)

__NOPSPEMUDRM = os.lmodule("NoPspEmuDrm_kern")

--os.message("pspemu: "..tostring(__NOPSPEMUDRM))
if __NOPSPEMUDRM then
--Scanning ux0:pspemu
local tmp = files.listdirs("ux0:pspemu/PSP/GAME")
local list_psp = {}
if tmp and #tmp > 0 then
table.sort(tmp ,function (a,b) return string.lower(a.name)<string.lower(b.name) end)
for i=1, #tmp do
if not game.exists(tmp[i].name) and tmp[i].name:len() == 9 then
--os.message(tmp[i].name)
local sfo = game.info(tmp[i].path.."/EBOOT.PBP")
if sfo and sfo.TITLE then tmp[i].title = sfo.TITLE end
table.insert(list_psp, tmp[i])
end
end
end

for i=1,#list_psp do
if img then img:blit(0,0) end
__TITTLEAPP, __IDAPP = list_psp[i].title, list_psp[i].name
--buttons.homepopup(0)
--os.message("path: "..list_psp[i].path.."\nname: "..list_psp[i].name)
local result = game.refresh_psp(list_psp[i].path,list_psp[i].name)
--buttons.homepopup(1)
if result == 1 then
local _pic1 = game.getpic1(list_psp[i].path.."/EBOOT.PBP")
if _pic1 then
--os.message("save\n"..list_psp[i].path)
image.save(_pic1,"ur0:appmeta/"..list_psp[i].name.."/pic0.png")
end

count += 1
list_psp[i].dev = "ux0"
list_psp[i].id = list_psp[i].name
--Size
list_psp[i].size = files.size(list_psp[i].path)
list_psp[i].sizef = files.sizeformat(list_psp[i].size or 0)

local tmp_db = game.details(list_psp[i].name)
if tmp_db then
list_psp[i].img = image.load("ur0:appmeta/"..list_psp[i].name.."/livearea/contents/startup.png")
if list_psp[i].img then
list_psp[i].img:resize(120,100)
list_psp[i].img:setfilter(__IMG_FILTER_LINEAR, __IMG_FILTER_LINEAR)
end
end

if not list_psp[i].img then
list_psp[i].img = theme.data["icodef"]
end
list_psp[i].path_pic = "ur0:appmeta/"..list_psp[i].name.."/pic0.png"

list_psp[i].region = 4
list_psp[i].Nregion = ""
list_psp[i].type = tmp_db.type
list_psp[i].version = tmp_db.version or "01.00"
list_psp[i].title = tmp_db.title:gsub("\n"," ") or list_psp[i].name
list_psp[i].sdk = tmp_db.sdk

table.insert(appman[4].list, list_psp[i])
SortGeneric(appman[4].list,appman[4].sort,appman[4].asc)
appman[4].scroll:set(appman[4].list,limit)

else
--os.message(STRINGS_LIVEAREA_NOTINSTALLED..list_psp[i].name)
end
end
--if count > 0 then os.message(STRINGS_LIVEAREA_PSP..count) end
end
if count > 0 then os.message(STRINGS_LIVEAREA_PSP..count) else os.message(STRINGS_LIVEAREA_NO_PSP) end

if img then img:blit(0,0) elseif vbuff then vbuff:blit(0,0) end
message_wait(STRINGS_LIVEAREA_SEARCH_PSM)
os.delay(15)

__TITTLEAPP, __IDAPP = "",""
count = 0
--Scanning ux0:psm
local tmp = files.listdirs("ux0:psm")
Expand Down Expand Up @@ -241,16 +331,9 @@ function refresh_init(img)
end
end

if count > 0 then os.message(STRINGS_LIVEAREA_GAMES_PSM..count) end
if count > 0 then os.message(STRINGS_LIVEAREA_GAMES_PSM..count) else os.message(STRINGS_LIVEAREA_NO_PSM) end
__TITTLEAPP, __IDAPP = "",""

if img then img:blit(0,0) elseif vbuff then vbuff:blit(0,0) end
message_wait(STRINGS_LIVEAREA_EXTRAREFRESH)
os.delay(15)

local installs = game.extrarefresh()
os.message(STRINGS_LIVEAREA_TOTAL_EXTRA..installs)

infodevices()
os.delay(15)
if vbuff then vbuff:blit(0,0) elseif img then img:blit(0,0) end
Expand Down
7 changes: 7 additions & 0 deletions ONEMenuVita/system/lang/english_us.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ STRINGS_FOLDERS_DELETE = "Folders Eliminated"
STRINGS_SUBMENU_RESTART = "Restart ONEMenu"
STRINGS_SUBMENU_RESET = "Power Reset"
STRINGS_SUBMENU_POWEROFF = "Shutdown"
STRINGS_SUBMENU_EXIT = "Exit"
STRINGS_SUBMENU_QR = "QR DownLoader"
STRINGS_SUBMENU_QR_SCAN = "QR Scanning"
STRINGS_SUBMENU_QR_ACTIVE = "Active download in the LiveArea"
Expand Down Expand Up @@ -250,9 +251,14 @@ STRINGS_EXPORT_REBOOT = "It is necesary to restart your PS vita"
STRINGS_LIVEAREA_NOTINSTALLED = "\n\nGame not installed: "
STRINGS_LIVEAREA_GAMES = "\n\nTotal Installed Vita Games/Homebrews: "
STRINGS_LIVEAREA_GAMES_PSM = "\n\nTotal Installed PSM Games: "
STRINGS_LIVEAREA_PSP = "\n\nTotal Installed PSP&PSX Games: "
STRINGS_LIVEAREA_NO_GAMES = "\n\nNo Vita Games/Homebrews found"
STRINGS_LIVEAREA_NO_PSM = "\n\nNo PSM Games found"
STRINGS_LIVEAREA_NO_PSP = "\n\nNo PSP & PSX Games found"
STRINGS_LIVEAREA_SEARCH_GAMES = "Search Vita Games/Homebrews"
STRINGS_LIVEAREA_EXTRAREFRESH = "Search DLCs & Updates"
STRINGS_LIVEAREA_SEARCH_PSP = "Search PSP & PSX Games"
STRINGS_LIVEAREA_SEARCH_PSM = "Search PSM Games"
STRINGS_LIVEAREA_TOTAL_EXTRA = "\n\nInstalled DLCs & Updates: "

------------ System SubMenu -----------------------------------------------------------------------------
Expand All @@ -264,6 +270,7 @@ STRINGS_MULTIMEDIA_DESCR = "Delete empty directories on multimedia directories:
STRINGS_RESTART_DESCR = "Restart ONEMenu"
STRINGS_REBOOT_DESCR = "Restart PSVita"
STRINGS_POWEROFF_DESCR = "Shutdown PSVita"
STRINGS_EXIT_DESCR = "Exit ONEMenu"
STRINGS_UPDATE_DB_DESCR = "Update your database without lose your iconlayout"
STRINGS_REBUILD_DB_DESCR = "Rebuild the database (losing your iconlayout)"
STRINGS_CUSTOMTHEMES_DESCR = "You can uninstall CustomThemes (not official themes)"
Expand Down

0 comments on commit 926bda8

Please sign in to comment.