Skip to content

Commit

Permalink
Release v1.00
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Sep 12, 2016
1 parent a82bd91 commit cbe96a1
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
40 changes: 32 additions & 8 deletions audioplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 4 additions & 8 deletions io_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion io_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions language.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions language.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ enum LanguageContainer {

// Others
SAVE_MODIFICATIONS,
NO_SPACE_ERROR,
WIFI_ERROR,
FTP_SERVER,
SYS_INFO,
Expand Down
1 change: 0 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
8 changes: 8 additions & 0 deletions package_installer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion pkg/sce_sys/livearea/contents/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<frame id="frame4">
<liveitem>
<text align="left" text-align="left" word-wrap="off" ellipsis="on">
<str size="18" color="#ffffff" shadow="on">v0.95</str>
<str size="18" color="#ffffff" shadow="on">v1.00</str>
</text>
</liveitem>
</frame>
Expand Down
10 changes: 10 additions & 0 deletions resources/changeinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,14 @@
- Dropped GENERAL_COLOR, now all colors are adjustable.<br>
]]>
</changes>
<changes app_ver="01.00">
<![CDATA[
- Added audio player with .MP3 and .OGG support (Press /\ to turn off the display while listening to music. Graphics by Valle).<br>
- Added changelog to the VitaShell bubble (press /\ or hold the bubble of VitaShell in the livearea).<br>
- Added ability to resume to the directory you've last visted before exiting VitaShell).<br>
- 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).<br>
- Improved text editor and added search feature to context menu (press /\).<br>
- Fixed bug where copying to different partitions didn't work.<br>
]]>
</changes>
</changeinfo>
3 changes: 2 additions & 1 deletion resources/english_us.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
25 changes: 25 additions & 0 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit cbe96a1

Please sign in to comment.