Add Nitro/IMG unmounting

This commit is contained in:
RocketRobz 2020-02-21 02:22:59 -07:00
parent 2a43eb2370
commit 999241b0a0
4 changed files with 25 additions and 0 deletions

View File

@ -165,6 +165,10 @@ void dm_drawBottomScreen(void) {
printf ("\x1B[47m"); // Print foreground white color
printf ("\x1b[23;0H");
printf (titleName);
if (nitroMounted || imgMounted) {
printf ("\n");
printf (IMAGETEXT);
}
if (isDSiMode() && sdMountedDone) {
if (isRegularDS || sdMounted) {
printf ("\n");
@ -409,6 +413,20 @@ void driveMenu (void) {
}
}
// Unmount/Remount FAT image
if ((held & KEY_R) && (pressed & KEY_X)) {
dmTextPrinted = false;
if (nitroMounted) {
currentDrive = 5;
chdir("nitro:/");
nitroUnmount();
} else if (imgMounted) {
currentDrive = 6;
chdir("img:/");
imgUnmount();
}
}
// Unmount/Remount SD card
if ((held & KEY_R) && (pressed & KEY_B)) {
dmTextPrinted = false;

View File

@ -344,6 +344,11 @@ TWL_CODE void ramdrive2Mount(void) {
ramdrive2Mounted = (access("ram2:/", F_OK) == 0);
}
void nitroUnmount(void) {
fatUnmount("nitro");
nitroMounted = false;
}
bool imgMount(const char* imgName) {
extern const char* currentImgName;

View File

@ -41,6 +41,7 @@ extern bool flashcardMount(void);
extern void flashcardUnmount(void);
extern void ramdrive1Mount(void);
extern void ramdrive2Mount(void);
extern void nitroUnmount(void);
extern bool imgMount(const char* imgName);
extern void imgUnmount(void);

View File

@ -5,6 +5,7 @@
#define POWERTEXT "POWER - Reboot/[+held] Poweroff"
#define POWERTEXT_3DS "POWER - Sleep Mode screen"
#define HOMETEXT "HOME - HOME Menu prompt"
#define IMAGETEXT "R+X - Unmount image"
#define SCREENSHOTTEXT "R+L - Make a screenshot"
extern char titleName[32];