Skip to content

Commit

Permalink
Added ability to mount xmc0: and added said partition to list
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Jun 19, 2018
1 parent ff61831 commit 63f371a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 8 deletions.
1 change: 1 addition & 0 deletions file.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ static char *devices[] = {
"ux0:",
"vd0:",
"vs0:",
"xmc0:",
"host0:",
};

Expand Down
2 changes: 2 additions & 0 deletions language.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void loadLanguage(int id) {
LANGUAGE_ENTRY(REFRESH_LICENSE_DB),
LANGUAGE_ENTRY(MOUNT_UMA0),
LANGUAGE_ENTRY(MOUNT_IMC0),
LANGUAGE_ENTRY(MOUNT_XMC0),
LANGUAGE_ENTRY(MOUNT_USB_UX0),
LANGUAGE_ENTRY(UMOUNT_USB_UX0),
LANGUAGE_ENTRY(MOUNT_GAMECARD_UX0),
Expand Down Expand Up @@ -253,6 +254,7 @@ void loadLanguage(int id) {

// Others
LANGUAGE_ENTRY(IMC0_MOUNTED),
LANGUAGE_ENTRY(XMC0_MOUNTED),
LANGUAGE_ENTRY(SAFE_MODE),
LANGUAGE_ENTRY(UNSAFE_MODE),
LANGUAGE_ENTRY(PLEASE_WAIT),
Expand Down
2 changes: 2 additions & 0 deletions language.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum LanguageContainer {
REFRESH_LICENSE_DB,
MOUNT_UMA0,
MOUNT_IMC0,
MOUNT_XMC0,
MOUNT_USB_UX0,
UMOUNT_USB_UX0,
MOUNT_GAMECARD_UX0,
Expand Down Expand Up @@ -212,6 +213,7 @@ enum LanguageContainer {

// Others
IMC0_MOUNTED,
XMC0_MOUNTED,
SAFE_MODE,
UNSAFE_MODE,
PLEASE_WAIT,
Expand Down
38 changes: 30 additions & 8 deletions main_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,23 @@ enum MenuHomeEntrys {
MENU_HOME_ENTRY_REFRESH_LICENSE_DB,
MENU_HOME_ENTRY_MOUNT_UMA0,
MENU_HOME_ENTRY_MOUNT_IMC0,
MENU_HOME_ENTRY_MOUNT_XMC0,
MENU_HOME_ENTRY_MOUNT_USB_UX0,
MENU_HOME_ENTRY_UMOUNT_USB_UX0,
MENU_HOME_ENTRY_MOUNT_GAMECARD_UX0,
MENU_HOME_ENTRY_UMOUNT_GAMECARD_UX0,
};

MenuEntry menu_home_entries[] = {
{ REFRESH_LIVEAREA, 0, 0, CTX_INVISIBLE },
{ REFRESH_LICENSE_DB, 1, 0, CTX_INVISIBLE },
{ MOUNT_UMA0, 2, 0, CTX_INVISIBLE },
{ MOUNT_IMC0, 3, 0, CTX_INVISIBLE },
{ MOUNT_USB_UX0, 5, 0, CTX_INVISIBLE },
{ UMOUNT_USB_UX0, 6, 0, CTX_INVISIBLE },
{ MOUNT_GAMECARD_UX0, 8, 0, CTX_INVISIBLE },
{ UMOUNT_GAMECARD_UX0,9, 0, CTX_INVISIBLE },
{ REFRESH_LIVEAREA, 0, 0, CTX_INVISIBLE },
{ REFRESH_LICENSE_DB, 1, 0, CTX_INVISIBLE },
{ MOUNT_UMA0, 3, 0, CTX_INVISIBLE },
{ MOUNT_IMC0, 4, 0, CTX_INVISIBLE },
{ MOUNT_XMC0, 5, 0, CTX_INVISIBLE },
{ MOUNT_USB_UX0, 7, 0, CTX_INVISIBLE },
{ UMOUNT_USB_UX0, 8, 0, CTX_INVISIBLE },
{ MOUNT_GAMECARD_UX0, 10, 0, CTX_INVISIBLE },
{ UMOUNT_GAMECARD_UX0, 11, 0, CTX_INVISIBLE },
};

#define N_MENU_HOME_ENTRIES (sizeof(menu_home_entries) / sizeof(MenuEntry))
Expand Down Expand Up @@ -352,6 +354,10 @@ void setContextMenuHomeVisibilities() {
if (!checkFileExist("sdstor0:int-lp-ign-userext") || checkFolderExist("imc0:"))
menu_home_entries[MENU_HOME_ENTRY_MOUNT_IMC0].visibility = CTX_INVISIBLE;

// Invisible if already mounted or there is no Memory Card
if (!checkFileExist("sdstor0:xmc-lp-ign-userext") || checkFolderExist("xmc0:"))
menu_home_entries[MENU_HOME_ENTRY_MOUNT_XMC0].visibility = CTX_INVISIBLE;

// Go to first entry
for (i = 0; i < N_MENU_HOME_ENTRIES; i++) {
if (menu_home_entries[i].visibility == CTX_VISIBLE) {
Expand Down Expand Up @@ -661,6 +667,22 @@ static int contextMenuHomeEnterCallback(int sel, void *context) {
break;
}

case MENU_HOME_ENTRY_MOUNT_XMC0:
{
if (is_safe_mode) {
infoDialog(language_container[EXTENDED_PERMISSIONS_REQUIRED]);
} else {
int res = vshIoMount(0xE00, NULL, 2, 0, 0, 0);
if (res < 0)
errorDialog(res);
else
infoDialog(language_container[XMC0_MOUNTED]);
refreshFileList();
}

break;
}

case MENU_HOME_ENTRY_MOUNT_USB_UX0:
{
if (mountUsbUx0() >= 0) {
Expand Down
2 changes: 2 additions & 0 deletions resources/english_us.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ REFRESH_LIVEAREA = "Refresh LiveArea™"
REFRESH_LICENSE_DB = "Refresh license database"
MOUNT_UMA0 = "Mount uma0:"
MOUNT_IMC0 = "Mount imc0:"
MOUNT_XMC0 = "Mount xmc0:"
MOUNT_USB_UX0 = "Mount USB ux0:"
UMOUNT_USB_UX0 = "Umount USB ux0:"
MOUNT_GAMECARD_UX0 = "Mount gamecard ux0:"
Expand Down Expand Up @@ -193,6 +194,7 @@ ADHOC_CLIENT_DECLINED = "The client has declined your request."

# Others
IMC0_MOUNTED = "imc0: mounted."
XMC0_MOUNTED = "xmc0: mounted."
SAFE_MODE = "SAFE MODE"
UNSAFE_MODE = "UNSAFE MODE"
PLEASE_WAIT = "Please wait..."
Expand Down

0 comments on commit 63f371a

Please sign in to comment.