diff --git a/CHANGELOG.md b/CHANGELOG.md index de23b8f94..ca5c47305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # ARK Changelog +## Version 4.20.60 (2023-??-??): +- ??? +- Implement UNIX-style hidden files/folders in `Custom Launcher` (and `Recovery`). +- `Custom Laucher` (and `Recovery`) will now remember last folder used in `File Browser`. +- Updated and added new translations. +- Improved lots of text displayed in the `Custom Launcher` (and `Recovery`) when using translations. +- `File Browser` can now display game icons and animations. +- Added option to disable file size calculation in `File Browser`. +- A progress bar is now displayed when downloading an update in the `Custom Launcher`. +- Fixed graphical glitch when loading the `Custom Launcher` or `Recovery`. +- Several other fixes and improvements. + +## Version 4.20.59 (2023-06-27): +- https://github.com/PSP-Archive/ARK-4/releases/tag/r42059 +- Heavily improved and refactor of VSH Menu. +- Text Editor will now ask you to save when closing a modified file. +- You can now copy game information to use on Text Editor. +- Several other fixes and improvements. + ## Version 4.20.58 (2023-06-24) - https://github.com/PSP-Archive/ARK-4/releases/tag/r42058 - Added support for `PS Vita Standalone` installations using `NoPspEmuDrm`. diff --git a/common/include/globals.h b/common/include/globals.h index 60846b570..e526a133e 100644 --- a/common/include/globals.h +++ b/common/include/globals.h @@ -55,7 +55,7 @@ #define ARK_BIN_MAX_SIZE 0x8000 #define ARK_MAJOR_VERSION 4 #define ARK_MINOR_VERSION 20 -#define ARK_MICRO_VERSION 59 +#define ARK_MICRO_VERSION 60 #define ARK_REVISION 0 #define MAX_FLASH0_SIZE 0x32000 diff --git a/core/compat/pentazemin/syspatch.c b/core/compat/pentazemin/syspatch.c index c7677d600..1c0dabb8c 100644 --- a/core/compat/pentazemin/syspatch.c +++ b/core/compat/pentazemin/syspatch.c @@ -336,10 +336,6 @@ void AdrenalineOnModuleStart(SceModule2 * mod){ // System fully booted Status static int booted = 0; - if (strcmp(mod->modname, "ARK VitaPOPS Loader") == 0){ - SendAdrenalineCmd(ADRENALINE_VITA_CMD_PAUSE_POPS); - } - if(strcmp(mod->modname, "sceDisplay_Service") == 0) { // can use screen now diff --git a/core/compat/vitapops/popsdisplay.h b/core/compat/vitapops/popsdisplay.h index 6d0df24ea..e2d2a3c4f 100644 --- a/core/compat/vitapops/popsdisplay.h +++ b/core/compat/vitapops/popsdisplay.h @@ -3,6 +3,11 @@ // TN-X patches for PSX exploits on Vita +#define PSP_SCREEN_WIDTH 480 +#define PSP_SCREEN_HEIGHT 272 +#define PSP_SCREEN_LINE 512 +#define SCE_PSPEMU_FRAMEBUFFER_SIZE 0x88000 + #define MAX_VRAM_CONFIGS 2 typedef struct POPSVramConfig{ short x; diff --git a/core/compat/vitapops/syspatch.c b/core/compat/vitapops/syspatch.c index 0ba751c8a..bcca24b88 100644 --- a/core/compat/vitapops/syspatch.c +++ b/core/compat/vitapops/syspatch.c @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -10,12 +9,20 @@ #include #include #include +#include #include #include "popsdisplay.h" extern ARKConfig* ark_config; extern STMOD_HANDLER previous; +static int draw_thread = -1; +static int do_draw = 0; +static u32* g_vram_base = (u32*)0x44000000; +int (* DisplaySetFrameBuf)(void*, int, int, int) = NULL; +int (*DisplayWaitVblankStart)() = NULL; + + KernelFunctions _ktbl = { .KernelDcacheInvalidateRange = &sceKernelDcacheInvalidateRange, .KernelIcacheInvalidateAll = &sceKernelIcacheInvalidateAll, @@ -62,12 +69,56 @@ void patchVitaPopsDisplay(SceModule2* mod){ } } +int pops_draw_thread(int argc, void* argp){ + + while (do_draw){ + SoftRelocateVram(g_vram_base, NULL); + DisplayWaitVblankStart(); + } + + return 0; +} + +int sceKernelSuspendThreadPatched(SceUID thid) { + SceKernelThreadInfo info; + info.size = sizeof(SceKernelThreadInfo); + if (sceKernelReferThreadStatus(thid, &info) == 0) { + if (strcmp(info.name, "popsmain") == 0) { + if (draw_thread < 0){ + do_draw = 1; + draw_thread = sceKernelCreateThread("psxloader", &pops_draw_thread, 0x10, 0x10000, PSP_THREAD_ATTR_VFPU, NULL); + sceKernelStartThread(draw_thread, 0, NULL); + } + } + } + + return sceKernelSuspendThread(thid); +} + +int sceKernelResumeThreadPatched(SceUID thid) { + SceKernelThreadInfo info; + info.size = sizeof(SceKernelThreadInfo); + if (sceKernelReferThreadStatus(thid, &info) == 0) { + if (strcmp(info.name, "popsmain") == 0) { + if (draw_thread >= 0){ + do_draw = 0; + sceKernelWaitThreadEnd(draw_thread, NULL); + draw_thread = -1; + } + } + } + + return sceKernelResumeThread(thid); +} + void ARKVitaPopsOnModuleStart(SceModule2 * mod){ static int booted = 0; // Patch display in PSX exploits if(strcmp(mod->modname, "sceDisplay_Service") == 0) { + DisplaySetFrameBuf = (void*)sctrlHENFindFunction("sceDisplay_Service", "sceDisplay", 0x289D82FE); + DisplayWaitVblankStart = (void*)sctrlHENFindFunction("sceDisplay_Service", "sceDisplay", 0x984C27E7); patchVitaPopsDisplay(mod); goto flush; } @@ -79,12 +130,24 @@ void ARKVitaPopsOnModuleStart(SceModule2 * mod){ goto flush; } + if (strcmp(mod->modname, "CWCHEATPRX") == 0) { + if (sceKernelInitKeyConfig() == PSP_INIT_KEYCONFIG_POPS) { + hookImportByNID(mod, "ThreadManForKernel", 0x9944F31F, sceKernelSuspendThreadPatched); + hookImportByNID(mod, "ThreadManForKernel", 0x75156E8F, sceKernelResumeThreadPatched); + goto flush; + } + } + // Boot Complete Action not done yet if(booted == 0) { // Boot is complete if(isSystemBooted()) { + // Set fake framebuffer so that cwcheat can be displayed + DisplaySetFrameBuf((void *)g_vram_base, PSP_SCREEN_LINE, PSP_DISPLAY_PIXEL_FORMAT_8888, PSP_DISPLAY_SETBUF_NEXTFRAME); + memset((void *)g_vram_base, 0, SCE_PSPEMU_FRAMEBUFFER_SIZE); + // Boot Complete Action done booted = 1; goto flush; diff --git a/extras/menus/arkMenu/Makefile b/extras/menus/arkMenu/Makefile index 303d4275b..8ac726c94 100644 --- a/extras/menus/arkMenu/Makefile +++ b/extras/menus/arkMenu/Makefile @@ -35,6 +35,7 @@ OBJS = \ src/browser.o \ src/browser_entries.o \ src/osk.o \ + src/usb.o \ src/network.o \ src/settingsmenu.o \ src/optionsmenu.o \ diff --git a/extras/menus/arkMenu/include/network.h b/extras/menus/arkMenu/include/network.h index 5e08817e6..49882ba95 100644 --- a/extras/menus/arkMenu/include/network.h +++ b/extras/menus/arkMenu/include/network.h @@ -36,6 +36,6 @@ extern int initializeNetwork(void); extern int connect_to_apctl(void); extern int shutdownNetwork(); extern char* resolveHostAddress(char*); -extern int wget(char* url, char* saveAs); +extern int wget(char* url, char* saveAs, SceULong64* cur_download, SceULong64* max_download); #endif diff --git a/extras/menus/arkMenu/include/usb.h b/extras/menus/arkMenu/include/usb.h new file mode 100644 index 000000000..d8c5f625c --- /dev/null +++ b/extras/menus/arkMenu/include/usb.h @@ -0,0 +1,12 @@ +#ifndef USB_H +#define USB_H + +#include + +namespace USB{ + extern bool is_enabled; + extern void enable(); + extern void disable(); +}; + +#endif \ No newline at end of file diff --git a/extras/menus/arkMenu/src/net_mgr.cpp b/extras/menus/arkMenu/src/net_mgr.cpp index 2747ce955..d5308997d 100644 --- a/extras/menus/arkMenu/src/net_mgr.cpp +++ b/extras/menus/arkMenu/src/net_mgr.cpp @@ -25,6 +25,8 @@ static struct { static SceUID ftp_thread = -1; static char pspIpAddr[32]; +static SceULong64 cur_download=0, max_download=0; + static void addMessage(const char* msg){ if (msg==NULL) return; @@ -83,6 +85,13 @@ void NetworkManager::draw(){ common::printText(30, y, vla.msg[i].c_str()); y+=20; } + + if (max_download){ + double percent = double(cur_download)/double(max_download); + ya2d_draw_rect(20, 265, 450, 5, DARKGRAY, 1); + ya2d_draw_rect(20, 266, 450*percent, 3, LITEGRAY, 1); + } + break; case 1: if (w > 0 || h > 0){ @@ -246,7 +255,7 @@ static void checkUpdates(){ addMessage("Downloading psp-updatelist.txt"); - wget((char*)path.c_str(), "psp-updatelist.txt"); + wget((char*)path.c_str(), "psp-updatelist.txt", &cur_download, &max_download); updater_url = parsePspUpdateList(&update_ver); @@ -263,7 +272,7 @@ static void checkUpdates(){ else{ addMessage("Downloading updater"); sceIoMkdir(update_folder, 0777); - wget((char*)updater_url.c_str(), update_eboot); + wget((char*)updater_url.c_str(), update_eboot, &cur_download, &max_download); } update_end: diff --git a/extras/menus/arkMenu/src/network.cpp b/extras/menus/arkMenu/src/network.cpp index a189352fa..40f1cf4c6 100644 --- a/extras/menus/arkMenu/src/network.cpp +++ b/extras/menus/arkMenu/src/network.cpp @@ -152,17 +152,20 @@ int connect_to_apctl(void) return 0; } -int wget(char* url, char* saveAs){ +int wget(char* url, char* saveAs, SceULong64* cur_download, SceULong64* max_download){ int tpl, cnx, req, ret; u8 buf[16*1024]; if((tpl=sceHttpCreateTemplate("ARK-Launcher/1.0", 1, 1))<0)return tpl; if((cnx=sceHttpCreateConnectionWithURL(tpl, url, 0))<0)return cnx; if((req=sceHttpCreateRequestWithURL(cnx, PSP_HTTP_METHOD_GET, url, 0))<0)return req; if((ret=sceHttpSendRequest(req, 0, 0))<0)return ret; + *cur_download = 0; + sceHttpGetContentLength(req, max_download); if(saveAs){ SceUID fd=sceIoOpen(saveAs, PSP_O_WRONLY | PSP_O_CREAT, 0777); while((ret=sceHttpReadData(req,buf,sizeof(buf)))>0){ sceIoWrite(fd,buf,ret); + *cur_download += ret; } ret=sceIoClose(fd); }else{//store in ram diff --git a/extras/menus/arkMenu/src/usb.cpp b/extras/menus/arkMenu/src/usb.cpp new file mode 100644 index 000000000..b48e5aaa8 --- /dev/null +++ b/extras/menus/arkMenu/src/usb.cpp @@ -0,0 +1,35 @@ +#include "usb.h" +#include "common.h" + +bool USB::is_enabled = false; +static SceUID usbdev_id = -1; + +void USB::enable(){ + if (is_enabled) return; + ARKConfig* ark_conf = common::getArkConfig(); + if (IS_PSP(ark_conf)){ + // load/start USBDEV.PRX + + is_enabled = true; + } + else if (IS_VITA_ADR(ark_conf)){ + // call sctrlStartUsb + + is_enabled = true; + } +} + +void USB::disable(){ + if (!is_enabled) return; + ARKConfig* ark_conf = common::getArkConfig(); + if (IS_PSP(ark_conf)){ + // stop/unload USBDEV.PRX + + is_enabled = false; + } + else if (IS_VITA_ADR(ark_conf)){ + // call sctrlStopUsb + + is_enabled = false; + } +} \ No newline at end of file diff --git a/extras/menus/recovery/Makefile b/extras/menus/recovery/Makefile index 76270f7e4..2495d0fdf 100644 --- a/extras/menus/recovery/Makefile +++ b/extras/menus/recovery/Makefile @@ -25,6 +25,7 @@ OBJS = \ ../arkMenu/src/entry.o \ ../arkMenu/src/eboot.o \ ../arkMenu/src/iso.o \ + ../arkMenu/src/usb.o \ ../arkMenu/src/browser.o \ ../arkMenu/src/browser_entries.o \ ../arkMenu/src/settingsmenu.o \ diff --git a/loader/live/user/psxloader/Makefile b/loader/live/user/psxloader/Makefile index ebba19398..2b07a7944 100644 --- a/loader/live/user/psxloader/Makefile +++ b/loader/live/user/psxloader/Makefile @@ -16,6 +16,7 @@ BUILD_PRX=1 PSPSDK = $(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak +#ChovySign-CLI --pops psxloader.cue --pops-info "ARK-X" ICON0.PNG --pops-eboot psxloader.prx --no-psvimg --vkey-gen act.dat license.rif 000000000000000000000000 2 --rif license.rif simple.h: $(Q)bin2c simple.psp simple.h simple $(Q)mkpsxiso psxloader.xml diff --git a/loader/live/user/psxloader/main.c b/loader/live/user/psxloader/main.c index 193fa7c99..5af178b57 100644 --- a/loader/live/user/psxloader/main.c +++ b/loader/live/user/psxloader/main.c @@ -31,7 +31,7 @@ extern int sceKernelPowerLock(unsigned int, unsigned int); volatile ARKConfig config = { .magic = ARK_CONFIG_MAGIC, .arkpath = DEFAULT_ARK_PATH, // only ms0 available anyways - .launcher = {0}, // use default (if needed) + .launcher = ARK_XMENU, // use default (if needed) .exec_mode = PSV_POPS, // set to Vita Pops mode .exploit_id = "ePSX", // ps1 loader name .recovery = 0, @@ -149,7 +149,7 @@ int module_start(SceSize args, void* argp) { int thid = sceKernelCreateThread("psxloader", &psxloader_thread, 0x10, 0x10000, PSP_THREAD_ATTR_USER|PSP_THREAD_ATTR_VFPU, NULL); - sceKernelStartThread(thid, 0, NULL); + sceKernelStartThread(thid, 0, NULL); return 0; } \ No newline at end of file