From cbe96a16b73ef687136a877704544bece166723b Mon Sep 17 00:00:00 2001 From: TheFloW Date: Mon, 12 Sep 2016 22:34:03 +0200 Subject: [PATCH] Release v1.00 --- Makefile | 2 +- README.md | 34 +++++++++++------- audioplayer.c | 40 +++++++++++++++++----- init.c | 2 +- io_process.c | 12 +++---- io_process.h | 1 - language.c | 1 + language.h | 1 + main.c | 1 - main.h | 4 +-- package_installer.c | 8 +++++ pkg/sce_sys/livearea/contents/template.xml | 2 +- resources/changeinfo.txt | 10 ++++++ resources/english_us.txt | 3 +- utils.c | 25 ++++++++++++++ utils.h | 4 +++ 16 files changed, 113 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 0495ea8b..7edf26fc 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ ASFLAGS = $(CFLAGS) all: $(TARGET).vpk %.vpk: eboot.bin - vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=00.95 -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo + vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=01.00 -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo vita-pack-vpk -s param.sfo -b eboot.bin \ --add pkg/sce_sys/icon0.png=sce_sys/icon0.png \ --add pkg/sce_sys/livearea/contents/bg.png=sce_sys/livearea/contents/bg.png \ diff --git a/README.md b/README.md index f9f9c55c..59d2d11c 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,26 @@ https://github.com/xy2iii/vitashell-themes Be sure you pull request your customized design or language file there. +### In order to compile VitaShell you'll need ### +* vitasdk: https://github.com/vitasdk +* vita2dlib: https://github.com/xerpi/vita2dlib +* ftpvitalib https://github.com/xerpi/ftpvitalib +* EasyRPG libraries: https://ci.easyrpg.org/view/Toolchains/job/toolchain-vita/ + +### Credits ### +* Team Molecule for HENkaku +* xerpi for ftpvitalib and vita2dlib +* wololo for the Revitalize contest +* Everybody who contributed on vitasdk + +### Changelog 1.00 ### +- Added audio player with .MP3 and .OGG support (Press /\ to turn off the display while listening to music. Graphics by Valle). +- Added changelog to the VitaShell bubble (press /\ or hold the bubble of VitaShell in the livearea). +- Added ability to resume to the directory you've last visted before exiting VitaShell). +- Leaving to livearea or suspending the device does now no longer corrupt an IO process anymore (while copying things you can leave now VitaShell and resume). +- Improved text editor and added search feature to context menu (press /\). +- Fixed bug where copying to different partitions didn't work. + ### Changelog 0.95 ### - Added ability to install update files as .vpk (for Vitamin). - Added patch to make .vpk installation appearing as full version instead of test version. @@ -184,16 +204,4 @@ Be sure you pull request your customized design or language file there. - Added some cosmetic changes. - Fixed crash when deleting marked entries. - Copied entries now still rest in clipboard after pasting them. -- The application now cleans itself before launching homebrews. - -### In order to compile VitaShell you'll need ### -* vitasdk: https://github.com/vitasdk -* vita2dlib: https://github.com/xerpi/vita2dlib -* ftpvitalib https://github.com/xerpi/ftpvitalib -* EasyRPG libraries: https://ci.easyrpg.org/view/Toolchains/job/toolchain-vita/ - -### Credits ### -* Team Molecule for HENkaku -* xerpi for ftpvitalib and vita2dlib -* wololo for the Revitalize contest -* Everybody who contributed on vitasdk +- The application now cleans itself before launching homebrews. \ No newline at end of file diff --git a/audioplayer.c b/audioplayer.c index 6b763dda..c31ea9e2 100644 --- a/audioplayer.c +++ b/audioplayer.c @@ -26,14 +26,33 @@ #include "audio/player.h" -struct fileInfo *fileinfo = NULL; -vita2d_texture *tex = NULL; +static char title[128], album[128], artist[128], genre[128], year[12]; +static struct fileInfo *fileinfo = NULL; +static vita2d_texture *tex = NULL; + +void shortenString(char *out, char *in, int width) { + strcpy(out, in); + + int i; + for (i = strlen(out) - 1; i > 0; i--) { + if (vita2d_pgf_text_width(font, FONT_SIZE, out) < width) + break; + + out[i] = '\0'; + } +} void getAudioInfo(char *file) { char *buffer = NULL; fileinfo = getInfoFunct(); + shortenString(title, fileinfo->title[0] == '\0' ? "-" : fileinfo->title, 390); + shortenString(album, fileinfo->album[0] == '\0' ? "-" : fileinfo->album, 390); + shortenString(artist, fileinfo->artist[0] == '\0' ? "-" : fileinfo->artist, 390); + shortenString(genre, fileinfo->genre[0] == '\0' ? "-" : fileinfo->genre, 390); + shortenString(year, fileinfo->year[0] == '\0' ? "-" : fileinfo->year, 390); + if (tex) { vita2d_free_texture(tex); tex = NULL; @@ -222,7 +241,8 @@ int audioPlayer(char *file, int type, FileList *list, FileListEntry *entry, int } else { vita2d_draw_texture(cover_image, SHELL_MARGIN_X, START_Y); } - + + // Info float x = 2.0f * SHELL_MARGIN_X + cover_size; pgf_draw_text(x, START_Y + (0 * FONT_Y_SPACE), AUDIO_INFO_ASSIGN, FONT_SIZE, language_container[TITLE]); @@ -231,11 +251,15 @@ int audioPlayer(char *file, int type, FileList *list, FileListEntry *entry, int pgf_draw_text(x, START_Y + (3 * FONT_Y_SPACE), AUDIO_INFO_ASSIGN, FONT_SIZE, language_container[GENRE]); pgf_draw_text(x, START_Y + (4 * FONT_Y_SPACE), AUDIO_INFO_ASSIGN, FONT_SIZE, language_container[YEAR]); - pgf_draw_text(x + 120.0f, START_Y + (0 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, fileinfo->title[0] == '\0' ? "-" : fileinfo->title); - pgf_draw_text(x + 120.0f, START_Y + (1 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, fileinfo->album[0] == '\0' ? "-" : fileinfo->album); - pgf_draw_text(x + 120.0f, START_Y + (2 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, fileinfo->artist[0] == '\0' ? "-" : fileinfo->artist); - pgf_draw_text(x + 120.0f, START_Y + (3 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, fileinfo->genre[0] == '\0' ? "-" : fileinfo->genre); - pgf_draw_text(x + 120.0f, START_Y + (4 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, fileinfo->year[0] == '\0' ? "-" : fileinfo->year); + x += 120.0f; + + pgf_draw_text(x, START_Y + (0 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, title); + pgf_draw_text(x, START_Y + (1 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, album); + pgf_draw_text(x, START_Y + (2 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, artist); + pgf_draw_text(x, START_Y + (3 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, genre); + pgf_draw_text(x, START_Y + (4 * FONT_Y_SPACE), AUDIO_INFO, FONT_SIZE, year); + + x -= 120.0f; float y = SCREEN_HEIGHT - 6.0f * SHELL_MARGIN_Y; diff --git a/init.c b/init.c index a12e7e74..963b7bf0 100644 --- a/init.c +++ b/init.c @@ -210,7 +210,7 @@ void initVitaShell() { // Write changeinfo.xml file to patch SceIoStat stat; memset(&stat, 0, sizeof(stat)); - if (sceIoGetstat("ux0:patch/VITASHELL/sce_sys/changeinfo/changeinfo.xml", &stat) < 0 && (int)stat.st_size != (int)&_binary_resources_changeinfo_txt_size) { + if (sceIoGetstat("ux0:patch/VITASHELL/sce_sys/changeinfo/changeinfo.xml", &stat) < 0 || (int)stat.st_size != (int)&_binary_resources_changeinfo_txt_size) { sceIoMkdir("ux0:patch", 0777); sceIoMkdir("ux0:patch/VITASHELL", 0777); sceIoMkdir("ux0:patch/VITASHELL/sce_sys", 0777); diff --git a/io_process.c b/io_process.c index f6477253..8cf00006 100644 --- a/io_process.c +++ b/io_process.c @@ -25,14 +25,6 @@ static uint64_t current_value = 0; -void closeWaitDialog() { - sceMsgDialogClose(); - - while (updateMessageDialog() != MESSAGE_DIALOG_RESULT_NONE) { - sceKernelDelayThread(1000); - } -} - int cancelHandler() { return (updateMessageDialog() != MESSAGE_DIALOG_RESULT_RUNNING); } @@ -261,6 +253,10 @@ int copy_thread(SceSize args_size, CopyArguments *args) { copy_entry = copy_entry->next; } + // Check memory card free space + if (checkMemoryCardFreeSpace(size)) + goto EXIT; + // Update thread thid = createStartUpdateThread(size + folders); diff --git a/io_process.h b/io_process.h index 59a3ba2c..fa7b3dfa 100644 --- a/io_process.h +++ b/io_process.h @@ -49,7 +49,6 @@ typedef struct { char *file_path; } HashArguments; -void closeWaitDialog(); int cancelHandler(); void SetProgress(uint64_t value, uint64_t max); SceUID createStartUpdateThread(uint64_t max); diff --git a/language.c b/language.c index e7e93b99..1d8ffa6b 100644 --- a/language.c +++ b/language.c @@ -126,6 +126,7 @@ void loadLanguage(int id) { // Others LANGUAGE_ENTRY(SAVE_MODIFICATIONS), + LANGUAGE_ENTRY(NO_SPACE_ERROR), LANGUAGE_ENTRY(WIFI_ERROR), LANGUAGE_ENTRY(FTP_SERVER), LANGUAGE_ENTRY(SYS_INFO), diff --git a/language.h b/language.h index ec78f8f9..d4ad1ebf 100644 --- a/language.h +++ b/language.h @@ -84,6 +84,7 @@ enum LanguageContainer { // Others SAVE_MODIFICATIONS, + NO_SPACE_ERROR, WIFI_ERROR, FTP_SERVER, SYS_INFO, diff --git a/main.c b/main.c index b24ae7bc..91a542a6 100644 --- a/main.c +++ b/main.c @@ -24,7 +24,6 @@ - Duplicate when same location or same name. /lol to /lol - Backup. or overwrite question. - Shortcuts - CPU changement - - Media player */ #include "main.h" diff --git a/main.h b/main.h index 335a60a5..4d728895 100644 --- a/main.h +++ b/main.h @@ -66,8 +66,8 @@ #define ENABLE_FILE_LOGGING 1 // VitaShell version major.minor -#define VITASHELL_VERSION_MAJOR 0x00 -#define VITASHELL_VERSION_MINOR 0x95 +#define VITASHELL_VERSION_MAJOR 0x01 +#define VITASHELL_VERSION_MINOR 0x00 #define VITASHELL_VERSION ((VITASHELL_VERSION_MAJOR << 0x18) | (VITASHELL_VERSION_MINOR << 0x10)) diff --git a/package_installer.c b/package_installer.c index 5ff2d9ea..fdce67d8 100644 --- a/package_installer.c +++ b/package_installer.c @@ -391,6 +391,10 @@ int install_thread(SceSize args_size, InstallArguments *args) { uint32_t folders = 0, files = 0; getArchivePathInfo(src_path, &size, &folders, &files); + // Check memory card free space + if (checkMemoryCardFreeSpace(size)) + goto EXIT; + // Update thread thid = createStartUpdateThread(size + folders); @@ -448,6 +452,10 @@ int install_thread(SceSize args_size, InstallArguments *args) { if (thid >= 0) sceKernelWaitThreadEnd(thid, NULL, NULL); + // Recursively clean up package_temp directory + removePath(PACKAGE_PARENT, NULL); + sceIoMkdir(PACKAGE_PARENT, 0777); + // Unlock power timers powerUnlock(); diff --git a/pkg/sce_sys/livearea/contents/template.xml b/pkg/sce_sys/livearea/contents/template.xml index 76ede863..9bd1b5e2 100644 --- a/pkg/sce_sys/livearea/contents/template.xml +++ b/pkg/sce_sys/livearea/contents/template.xml @@ -28,7 +28,7 @@ - v0.95 + v1.00 diff --git a/resources/changeinfo.txt b/resources/changeinfo.txt index e12dd2c2..b546966f 100644 --- a/resources/changeinfo.txt +++ b/resources/changeinfo.txt @@ -132,4 +132,14 @@ - Dropped GENERAL_COLOR, now all colors are adjustable.
]]> + + +- Added changelog to the VitaShell bubble (press /\ or hold the bubble of VitaShell in the livearea).
+- Added ability to resume to the directory you've last visted before exiting VitaShell).
+- Leaving to livearea or suspending the device does now no longer corrupt an IO process anymore (while copying things you can leave now VitaShell and resume).
+- Improved text editor and added search feature to context menu (press /\).
+- Fixed bug where copying to different partitions didn't work.
+ ]]> +
diff --git a/resources/english_us.txt b/resources/english_us.txt index 061d56be..189560fa 100644 --- a/resources/english_us.txt +++ b/resources/english_us.txt @@ -64,7 +64,8 @@ HASH_FILE_QUESTION = "SHA1 hashing may take a long time. Conti # Others SAVE_MODIFICATIONS = "Do you want to save your modifications?" +NO_SPACE_ERROR = "There is not enough free space on the memory\card.\At least %s more space is needed." WIFI_ERROR = "You must use Wi-Fi to do this." FTP_SERVER = "FTP server is now running at\ftp://%s:%i\\Press 'OK' to keep it in background.\Press 'Cancel' to disconnect." SYS_INFO = "System software: %s\Model: 0x%08X\MAC address: %s\IP address: %s\Memory card: %s/%s" -UPDATE_QUESTION = "VitaShell %s is now available.\\Do you want to update the application?" +UPDATE_QUESTION = "VitaShell %s is now available.\\Do you want to update the application?" \ No newline at end of file diff --git a/utils.c b/utils.c index 17aecfb9..ec204701 100644 --- a/utils.c +++ b/utils.c @@ -89,6 +89,14 @@ void endDrawing() { sceDisplayWaitVblankStart(); } +void closeWaitDialog() { + sceMsgDialogClose(); + + while (updateMessageDialog() != MESSAGE_DIALOG_RESULT_NONE) { + sceKernelDelayThread(1000); + } +} + void errorDialog(int error) { if (error < 0) { initMessageDialog(SCE_MSG_DIALOG_BUTTON_TYPE_OK, language_container[ERROR], error); @@ -108,6 +116,23 @@ void infoDialog(char *msg, ...) { dialog_step = DIALOG_STEP_INFO; } +int checkMemoryCardFreeSpace(uint64_t size) { + uint64_t free_size = 0, max_size = 0; + sceAppMgrGetDevInfo("ux0:", &max_size, &free_size); + + if (size >= (free_size + (40 * 1024 * 1024))) { + closeWaitDialog(); + + char size_string[16]; + getSizeString(size_string, size - (free_size + (40 * 1024 * 1024))); + infoDialog(language_container[NO_SPACE_ERROR], size_string); + + return 1; + } + + return 0; +} + int power_tick_thread(SceSize args, void *argp) { while (1) { if (lock_power > 0) { diff --git a/utils.h b/utils.h index 6de952bd..ea79d53f 100644 --- a/utils.h +++ b/utils.h @@ -50,9 +50,13 @@ extern uint32_t old_buttons, current_buttons, pressed_buttons, hold_buttons, hol void startDrawing(vita2d_texture *bg); void endDrawing(); +void closeWaitDialog(); + void errorDialog(int error); void infoDialog(char *msg, ...); +int checkMemoryCardFreeSpace(uint64_t size); + void initPowerTickThread(); void powerLock(); void powerUnlock();