GodMode9i/arm9/source/driveOperations.h
Pk11 d8bf2447ec
Clear cart info on eject outside of drive menu and detect ramdrive eject (#146)
* Fix cart info if ejected not in drive menu

* Fix a couple ramdrive issues

- Unmount ramdrive if Slot-2 RAM is ejected
- Fix potentially reading from the wrong location if numSectors > 1 and crosses between locations
- free ramdLoc on regular DS too
- Use calloc to 0 initialize, I saw it mess up occasionally on DSi too

* Update time in the Vblank handler
2022-01-07 20:35:49 -07:00

62 lines
1.4 KiB
C++

#ifndef FLASHCARD_H
#define FLASHCARD_H
#include <string>
#include <nds/ndstypes.h>
enum class Drive : u8 {
sdCard = 0,
flashcard,
ramDrive,
nand,
nitroFS,
fatImg
};
extern bool nandMounted;
extern bool sdMounted;
extern bool sdMountedDone; // true if SD mount is successful once
extern bool flashcardMounted;
extern bool ramdriveMounted;
extern bool imgMounted;
extern bool nitroMounted;
extern Drive currentDrive;
extern Drive nitroCurrentDrive;
extern Drive imgCurrentDrive;
extern char sdLabel[12];
extern char fatLabel[12];
extern char imgLabel[12];
extern u32 nandSize;
extern u64 sdSize;
extern u64 fatSize;
extern u64 imgSize;
extern u32 ramdSize;
extern std::string getDriveBytes(u64 bytes);
extern const char* getDrivePath(void);
extern bool nandFound(void);
extern bool sdFound(void);
extern bool flashcardFound(void);
extern bool bothSDandFlashcard(void);
extern bool imgFound(void);
extern bool nandMount(void);
extern void nandUnmount(void);
extern bool sdMount(void);
extern void sdUnmount(void);
extern bool flashcardMount(void);
extern void flashcardUnmount(void);
extern void ramdriveMount(bool ram32MB);
extern void ramdriveUnmount(void);
extern void nitroUnmount(void);
extern bool imgMount(const char* imgName, bool dsiwareSave);
extern void imgUnmount(void);
extern u64 getBytesFree(const char* drivePath);
extern bool driveWritable(Drive drive);
extern bool driveRemoved(Drive drive);
#endif //FLASHCARD_H