filetypes.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* sd2snes - SD card based universal cartridge for the SNES
  2. Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
  3. AVR firmware portion
  4. Inspired by and based on code from sd2iec, written by Ingo Korb et al.
  5. See sdcard.c|h, config.h.
  6. FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
  7. see ff.c|h.
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; version 2 of the License only.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. filetypes.h: directory scanning and file type detection
  19. */
  20. #ifndef FILETYPES_H
  21. #define FILETYPES_H
  22. #ifdef DEBUG_FS
  23. #define DBG_FS
  24. #else
  25. #define DBG_FS while(0)
  26. #endif
  27. #include "ff.h"
  28. #define FS_MAX_DEPTH (10)
  29. #define SYS_DIR_NAME ((const char*)"sd2snes")
  30. typedef enum
  31. {
  32. TYPE_UNKNOWN = 0, /* 0 */
  33. TYPE_SMC, /* 1 */
  34. TYPE_SRM, /* 2 */
  35. TYPE_SPC, /* 3 */
  36. TYPE_IPS /* 4 */
  37. } SNES_FTYPE;
  38. char fs_path[256];
  39. SNES_FTYPE determine_filetype( char *filename );
  40. //uint32_t scan_fs();
  41. uint16_t scan_flat( const char *path );
  42. uint32_t scan_dir( char *path, FILINFO *fno_param, char mkdb, uint32_t this_subdir_tgt );
  43. FRESULT get_db_id( uint32_t * );
  44. int get_num_dirent( uint32_t addr );
  45. void sort_all_dir( uint32_t endaddr );
  46. #endif