forked from Mirror/GodMode9
parent
f13a5c6e4f
commit
75a23a15c3
@ -2,6 +2,7 @@
|
|||||||
#include "fsgame.h"
|
#include "fsgame.h"
|
||||||
#include "fsinit.h"
|
#include "fsinit.h"
|
||||||
#include "virtual.h"
|
#include "virtual.h"
|
||||||
|
#include "vcart.h"
|
||||||
#include "sddata.h"
|
#include "sddata.h"
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
@ -85,6 +86,9 @@ bool GetRootDirContentsWorker(DirStruct* contents) {
|
|||||||
char sdlabel[16];
|
char sdlabel[16];
|
||||||
if (!GetFATVolumeLabel("0:", sdlabel))
|
if (!GetFATVolumeLabel("0:", sdlabel))
|
||||||
snprintf(sdlabel, 16, "NOLABEL");
|
snprintf(sdlabel, 16, "NOLABEL");
|
||||||
|
|
||||||
|
char carttype[16];
|
||||||
|
GetVCartTypeString(carttype);
|
||||||
|
|
||||||
// virtual root objects hacked in
|
// virtual root objects hacked in
|
||||||
for (u32 i = 0; (i < NORM_FS+VIRT_FS) && (n_entries < MAX_DIR_ENTRIES); i++) {
|
for (u32 i = 0; (i < NORM_FS+VIRT_FS) && (n_entries < MAX_DIR_ENTRIES); i++) {
|
||||||
@ -109,6 +113,8 @@ bool GetRootDirContentsWorker(DirStruct* contents) {
|
|||||||
(GetMountState() & GAME_NDS ) ? "NDS" :
|
(GetMountState() & GAME_NDS ) ? "NDS" :
|
||||||
(GetMountState() & SYS_FIRM ) ? "FIRM" :
|
(GetMountState() & SYS_FIRM ) ? "FIRM" :
|
||||||
(GetMountState() & GAME_TAD ) ? "DSIWARE" : "UNK", drvname[i]);
|
(GetMountState() & GAME_TAD ) ? "DSIWARE" : "UNK", drvname[i]);
|
||||||
|
else if (*(drvnum[i]) == 'C') // Game cart handling
|
||||||
|
snprintf(entry->name, 32, "[%s] %s (%s)", drvnum[i], drvname[i], carttype);
|
||||||
else if (*(drvnum[i]) == '0') // SD card handling
|
else if (*(drvnum[i]) == '0') // SD card handling
|
||||||
snprintf(entry->name, 32, "[%s] %s (%s)", drvnum[i], drvname[i], sdlabel);
|
snprintf(entry->name, 32, "[%s] %s (%s)", drvnum[i], drvname[i], sdlabel);
|
||||||
else snprintf(entry->name, 32, "[%s] %s", drvnum[i], drvname[i]);
|
else snprintf(entry->name, 32, "[%s] %s", drvnum[i], drvname[i]);
|
||||||
|
@ -70,3 +70,13 @@ int ReadVCartFile(const VirtualFile* vfile, void* buffer, u64 offset, u64 count)
|
|||||||
u64 GetVCartDriveSize(void) {
|
u64 GetVCartDriveSize(void) {
|
||||||
return cart_init ? cdata->cart_size : 0;
|
return cart_init ? cdata->cart_size : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetVCartTypeString(char* typestr) {
|
||||||
|
// typestr needs to be at least 11 + 1 chars big
|
||||||
|
if (!cart_init || !cdata) sprintf(typestr, "EMPTY");
|
||||||
|
else sprintf(typestr, "%s%08lX",
|
||||||
|
(cdata->cart_type & CART_CTR) ? "CTR" :
|
||||||
|
(cdata->cart_type & CART_TWL) ? "TWL" :
|
||||||
|
(cdata->cart_type & CART_NTR) ? "NTR" : "???",
|
||||||
|
cdata->cart_id);
|
||||||
|
}
|
||||||
|
@ -8,3 +8,4 @@ bool ReadVCartDir(VirtualFile* vfile, VirtualDir* vdir);
|
|||||||
int ReadVCartFile(const VirtualFile* vfile, void* buffer, u64 offset, u64 count);
|
int ReadVCartFile(const VirtualFile* vfile, void* buffer, u64 offset, u64 count);
|
||||||
// int WriteVCartFile(const VirtualFile* vfile, const void* buffer, u64 offset, u64 count); // no writes
|
// int WriteVCartFile(const VirtualFile* vfile, const void* buffer, u64 offset, u64 count); // no writes
|
||||||
u64 GetVCartDriveSize(void);
|
u64 GetVCartDriveSize(void);
|
||||||
|
void GetVCartTypeString(char* typestr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user