From d1a7bf5eb558e7db4a1a27e15ebedb02e6b7f804 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Mon, 4 Feb 2013 23:45:44 -0500 Subject: Fully integrate BassAceGold's libraries, finally. The README still states that 1.2 is required to overwrite 0.13's stuff; really, 0.13 is needed only for `gcc`. So the sequence goes 0.13's `gcc` -> 1.2 -> BassAceGold's libraries -> make `libds2a.a`. DMA function names changed to match BassAceGold's. --- sdk-modifications/libsrc/fs/bit_ops.h | 0 sdk-modifications/libsrc/fs/cache.c | 0 sdk-modifications/libsrc/fs/directory.c | 0 sdk-modifications/libsrc/fs/directory.h | 0 sdk-modifications/libsrc/fs/disc_io/disc.c | 0 sdk-modifications/libsrc/fs/disc_io/disc.h | 0 sdk-modifications/libsrc/fs/disc_io/disc_io.h | 0 sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.c | 0 sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.h | 0 sdk-modifications/libsrc/fs/ds2_fcntl.c | 0 sdk-modifications/libsrc/fs/ds2_fcntl.h | 0 sdk-modifications/libsrc/fs/ds2_unistd.c | 0 sdk-modifications/libsrc/fs/ds2_unistd.h | 0 sdk-modifications/libsrc/fs/fat.h | 0 sdk-modifications/libsrc/fs/fat_misc.c | 52 +++++++++++----------- sdk-modifications/libsrc/fs/fat_misc.h | 0 sdk-modifications/libsrc/fs/fatdir.h | 0 sdk-modifications/libsrc/fs/fatdir_ex.c | 0 sdk-modifications/libsrc/fs/fatdir_ex.h | 0 sdk-modifications/libsrc/fs/fatfile.c | 0 sdk-modifications/libsrc/fs/fatfile.h | 0 sdk-modifications/libsrc/fs/fatfile_ex.c | 0 sdk-modifications/libsrc/fs/fatfile_ex.h | 0 .../libsrc/fs/file_allocation_table.h | 0 sdk-modifications/libsrc/fs/filetime.c | 0 sdk-modifications/libsrc/fs/filetime.h | 0 sdk-modifications/libsrc/fs/fs.mk | 2 +- sdk-modifications/libsrc/fs/fs_api.c | 0 sdk-modifications/libsrc/fs/fs_api.h | 0 sdk-modifications/libsrc/fs/fs_cache.h | 0 sdk-modifications/libsrc/fs/fs_common.h | 0 sdk-modifications/libsrc/fs/fs_unicode.c | 0 sdk-modifications/libsrc/fs/fs_unicode.h | 0 sdk-modifications/libsrc/fs/libfat.c | 0 sdk-modifications/libsrc/fs/mem_allocate.h | 0 sdk-modifications/libsrc/fs/partition.c | 0 sdk-modifications/libsrc/fs/partition.h | 0 37 files changed, 28 insertions(+), 26 deletions(-) mode change 100644 => 100755 sdk-modifications/libsrc/fs/bit_ops.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/cache.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/directory.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/directory.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/disc_io/disc.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/disc_io/disc.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/disc_io/disc_io.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/ds2_fcntl.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/ds2_fcntl.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/ds2_unistd.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/ds2_unistd.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fat.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fat_misc.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fatdir.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fatdir_ex.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/fatdir_ex.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fatfile.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/fatfile.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fatfile_ex.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/fatfile_ex.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/file_allocation_table.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/filetime.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/filetime.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fs_api.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/fs_api.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fs_cache.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fs_common.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/fs_unicode.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/fs_unicode.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/libfat.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/mem_allocate.h mode change 100644 => 100755 sdk-modifications/libsrc/fs/partition.c mode change 100644 => 100755 sdk-modifications/libsrc/fs/partition.h (limited to 'sdk-modifications/libsrc/fs') diff --git a/sdk-modifications/libsrc/fs/bit_ops.h b/sdk-modifications/libsrc/fs/bit_ops.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/cache.c b/sdk-modifications/libsrc/fs/cache.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/directory.c b/sdk-modifications/libsrc/fs/directory.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/directory.h b/sdk-modifications/libsrc/fs/directory.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/disc_io/disc.c b/sdk-modifications/libsrc/fs/disc_io/disc.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/disc_io/disc.h b/sdk-modifications/libsrc/fs/disc_io/disc.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/disc_io/disc_io.h b/sdk-modifications/libsrc/fs/disc_io/disc_io.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.c b/sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.h b/sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/ds2_fcntl.c b/sdk-modifications/libsrc/fs/ds2_fcntl.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/ds2_fcntl.h b/sdk-modifications/libsrc/fs/ds2_fcntl.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/ds2_unistd.c b/sdk-modifications/libsrc/fs/ds2_unistd.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/ds2_unistd.h b/sdk-modifications/libsrc/fs/ds2_unistd.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fat.h b/sdk-modifications/libsrc/fs/fat.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fat_misc.c b/sdk-modifications/libsrc/fs/fat_misc.c index c0f62ac..335ab59 100644 --- a/sdk-modifications/libsrc/fs/fat_misc.c +++ b/sdk-modifications/libsrc/fs/fat_misc.c @@ -1,9 +1,9 @@ -//fat_misc.c -//v1.0 - +//fat_misc.c +//v1.0 + #include "fat_misc.h" -#include "fs_api.h" - +#include "fs_api.h" + static unsigned int _usedSecNums; static int strFindFromEnd( char *str,char strValue ) @@ -40,11 +40,11 @@ static int strFindFromEnd( char *str,char strValue ) int getDirSize( const char * path, int includeSubdirs, unsigned int * dirSize ) { - char dirPath[MAX_FILENAME_LENGTH]; + char dirPath[MAX_FILENAME_LENGTH]; unsigned int size = 0; if( "" == path ){ return false; - } + } memset( dirPath,0,MAX_FILENAME_LENGTH ); strcpy( dirPath,path ); @@ -54,29 +54,31 @@ int getDirSize( const char * path, int includeSubdirs, unsigned int * dirSize ) if( strlen(dirPath) > MAX_FILENAME_LENGTH ) return false; - DIR_STATE_STRUCT *dir; dir = fat_opendir((const char*)dirPath); + DIR_STATE_STRUCT *dir; + dir = fat_opendir((const char*)dirPath); if (dir == NULL) - return false; - struct stat stat_buf; - DIR_ENTRY *currentEntry; - char* filename; - - while(fat_readdir_ex(dir, &stat_buf) != NULL) + return false; + + struct stat stat_buf; + DIR_ENTRY *currentEntry; + char* filename; + + while((currentEntry = fat_readdir_ex(dir, &stat_buf)) != NULL) { - filename = currentEntry->d_name; - + filename = currentEntry->d_name; + if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0) continue; if (!(stat_buf.st_mode & S_IFDIR)) { size += (stat_buf.st_size+511)/512; _usedSecNums +=(stat_buf.st_size+511)/512; - } - else if (includeSubdirs) + } + else if (includeSubdirs) { // calculate the size recursively - unsigned int subDirSize = 0; - char dirPathBuffer[MAX_FILENAME_LENGTH]; + unsigned int subDirSize = 0; + char dirPathBuffer[MAX_FILENAME_LENGTH]; memset( dirPathBuffer,0,MAX_FILENAME_LENGTH ); strcpy( dirPathBuffer,dirPath ); @@ -90,8 +92,8 @@ int getDirSize( const char * path, int includeSubdirs, unsigned int * dirSize ) memset( dirPath,0,MAX_FILENAME_LENGTH ); strcpy( dirPath,dirPathBuffer ); } - } - + } + fat_closedir(dir); *dirSize = size; @@ -102,7 +104,7 @@ int fat_getDiskTotalSpace( char * diskName, unsigned int * diskSpace ) { if( !strcmp("",diskName) ) return false; - + unsigned int len = strlen(diskName); if( *(diskName+len-1) != '/' ){ *(diskName+len) = '/'; @@ -116,10 +118,10 @@ int fat_getDiskTotalSpace( char * diskName, unsigned int * diskSpace ) return true; } -int fat_getDiskSpaceInfo( char * diskName, unsigned int * total, unsigned int * used, unsigned int * freeSpace ) +int fat_getDiskSpaceInfo( char * diskName, unsigned int * total, unsigned int * used, unsigned int * freeSpace ) { _usedSecNums = 0; - + if( !strcmp("",diskName) ) return -1; if( !fat_getDiskTotalSpace(diskName, total) ) diff --git a/sdk-modifications/libsrc/fs/fat_misc.h b/sdk-modifications/libsrc/fs/fat_misc.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fatdir.h b/sdk-modifications/libsrc/fs/fatdir.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fatdir_ex.c b/sdk-modifications/libsrc/fs/fatdir_ex.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fatdir_ex.h b/sdk-modifications/libsrc/fs/fatdir_ex.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fatfile.c b/sdk-modifications/libsrc/fs/fatfile.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fatfile.h b/sdk-modifications/libsrc/fs/fatfile.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fatfile_ex.c b/sdk-modifications/libsrc/fs/fatfile_ex.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fatfile_ex.h b/sdk-modifications/libsrc/fs/fatfile_ex.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/file_allocation_table.h b/sdk-modifications/libsrc/fs/file_allocation_table.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/filetime.c b/sdk-modifications/libsrc/fs/filetime.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/filetime.h b/sdk-modifications/libsrc/fs/filetime.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fs.mk b/sdk-modifications/libsrc/fs/fs.mk index 9b17c48..3fee249 100644 --- a/sdk-modifications/libsrc/fs/fs.mk +++ b/sdk-modifications/libsrc/fs/fs.mk @@ -14,7 +14,7 @@ SRC += $(FS_DIR)/cache.c \ $(FS_DIR)/disc_io/disc.c \ $(FS_DIR)/disc_io/io_ds2_mmcf.c \ $(FS_DIR)/ds2_fcntl.c \ - $(FS_DIR)/ds2_unistd.c \ + $(FS_DIR)/ds2_unistd.c SSRC += diff --git a/sdk-modifications/libsrc/fs/fs_api.c b/sdk-modifications/libsrc/fs/fs_api.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fs_api.h b/sdk-modifications/libsrc/fs/fs_api.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fs_cache.h b/sdk-modifications/libsrc/fs/fs_cache.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fs_common.h b/sdk-modifications/libsrc/fs/fs_common.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fs_unicode.c b/sdk-modifications/libsrc/fs/fs_unicode.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/fs_unicode.h b/sdk-modifications/libsrc/fs/fs_unicode.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/libfat.c b/sdk-modifications/libsrc/fs/libfat.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/mem_allocate.h b/sdk-modifications/libsrc/fs/mem_allocate.h old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/partition.c b/sdk-modifications/libsrc/fs/partition.c old mode 100644 new mode 100755 diff --git a/sdk-modifications/libsrc/fs/partition.h b/sdk-modifications/libsrc/fs/partition.h old mode 100644 new mode 100755 -- cgit v1.2.3