From 1889f4fd570adbde35ea83beabff7287d197b685 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Mon, 21 Oct 2019 21:48:53 +0200 Subject: [PATCH] Simplify fsdrive code --- arm9/source/filesys/fsdrive.c | 2 +- arm9/source/filesys/fsdrive.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arm9/source/filesys/fsdrive.c b/arm9/source/filesys/fsdrive.c index a03feaf..f1104d1 100644 --- a/arm9/source/filesys/fsdrive.c +++ b/arm9/source/filesys/fsdrive.c @@ -91,7 +91,7 @@ bool GetRootDirContentsWorker(DirStruct* contents) { GetVCartTypeString(carttype); // 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 < countof(drvnum)) && (n_entries < MAX_DIR_ENTRIES); i++) { DirEntry* entry = &(contents->entry[n_entries]); if (!DriveType(drvnum[i])) continue; // drive not available entry->p_name = 4; diff --git a/arm9/source/filesys/fsdrive.h b/arm9/source/filesys/fsdrive.h index 03c4501..a9a6ed7 100644 --- a/arm9/source/filesys/fsdrive.h +++ b/arm9/source/filesys/fsdrive.h @@ -4,8 +4,7 @@ #include "fsdir.h" #define NORM_FS 10 -#define IMGN_FS 3 // image normal filesystems -#define VIRT_FS 13 +#define IMGN_FS 3 // image normal filesystems // primary drive types #define DRV_UNKNOWN (0<<0)