From b540acafeda718f52e109523cba70b5c9d03067d Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Sun, 16 Jul 2006 07:37:24 +0000 Subject: [PATCH] Added fatInitDefault to fat.h and libfat.c --- gba/include/fat.h | 11 +++++++++++ include/fat.h | 11 +++++++++++ nds/include/fat.h | 11 +++++++++++ source/libfat.c | 12 ++++++++++++ 4 files changed, 45 insertions(+) diff --git a/gba/include/fat.h b/gba/include/fat.h index 6c1e302..510a298 100644 --- a/gba/include/fat.h +++ b/gba/include/fat.h @@ -27,6 +27,12 @@ 2006-07-11 - Chishm * Original release + + 2006-07-14 + * fatInitialise renamed to fatInit + + 2006-07-16 - Chishm + * Added fatInitDefault */ @@ -51,6 +57,11 @@ setAsDefaultDevice: if true, make this the default device driver for file operat */ bool fatInit (u32 cacheSize, bool setAsDefaultDevice); +/* +Calls fatInit with setAsDefaultDevice = true and cacheSize optimised for the host system. +*/ +bool fatInitDefault (void); + /* Mount the device specified by partitionNumber PD_DEFAULT is not allowed, use _FAT_partition_setDefaultDevice diff --git a/include/fat.h b/include/fat.h index c3de1d1..3c308d5 100644 --- a/include/fat.h +++ b/include/fat.h @@ -27,6 +27,12 @@ 2006-07-11 - Chishm * Original release + + 2006-07-14 + * fatInitialise renamed to fatInit + + 2006-07-16 - Chishm + * Added fatInitDefault */ @@ -66,6 +72,11 @@ setAsDefaultDevice: if true, make this the default device driver for file operat */ bool fatInit (u32 cacheSize, bool setAsDefaultDevice); +/* +Calls fatInit with setAsDefaultDevice = true and cacheSize optimised for the host system. +*/ +bool fatInitDefault (void); + /* Mount the device specified by partitionNumber PD_DEFAULT is not allowed, use _FAT_partition_setDefaultDevice diff --git a/nds/include/fat.h b/nds/include/fat.h index d889b4e..fad4f63 100644 --- a/nds/include/fat.h +++ b/nds/include/fat.h @@ -27,6 +27,12 @@ 2006-07-11 - Chishm * Original release + + 2006-07-14 + * fatInitialise renamed to fatInit + + 2006-07-16 - Chishm + * Added fatInitDefault */ @@ -56,6 +62,11 @@ setAsDefaultDevice: if true, make this the default device driver for file operat */ bool fatInit (u32 cacheSize, bool setAsDefaultDevice); +/* +Calls fatInit with setAsDefaultDevice = true and cacheSize optimised for the host system. +*/ +bool fatInitDefault (void); + /* Mount the device specified by partitionNumber PD_DEFAULT is not allowed, use _FAT_partition_setDefaultDevice diff --git a/source/libfat.c b/source/libfat.c index 6390dfd..959a9cf 100644 --- a/source/libfat.c +++ b/source/libfat.c @@ -35,6 +35,10 @@ #include "partition.h" #include "fatfile.h" +#define GBA_DEFAULT_CACHE_PAGES 2 +#define NDS_DEFAULT_CACHE_PAGES 8 + + const devoptab_t dotab_fat = { "fat", sizeof (FILE_STRUCT), @@ -89,6 +93,14 @@ bool fatInit (u32 cacheSize, bool setAsDefaultDevice) { return true; } +bool fatInitDefault (void) { +#ifdef NDS + return fatInit (NDS_DEFAULT_CACHE_PAGES, true); +#else + return fatInit (GBA_DEFAULT_CACHE_PAGES, true); +#endif +} + bool fatMountNormalInterface (PARTITION_INTERFACE partitionNumber, u32 cacheSize) { return _FAT_partition_mount (partitionNumber, cacheSize); }