diff options
author | Max Horn | 2007-12-30 13:05:38 +0000 |
---|---|---|
committer | Max Horn | 2007-12-30 13:05:38 +0000 |
commit | c54562d9a3fbcc6bc2249e7e36a92ead78165653 (patch) | |
tree | 9d41d71c915942a42917a1b5c8e1a1138ea52792 /backends/platform/ds/arm9/source | |
parent | 0d3092689b6134671ec8ad1ec767bced43a32333 (diff) | |
download | scummvm-rg350-c54562d9a3fbcc6bc2249e7e36a92ead78165653.tar.gz scummvm-rg350-c54562d9a3fbcc6bc2249e7e36a92ead78165653.tar.bz2 scummvm-rg350-c54562d9a3fbcc6bc2249e7e36a92ead78165653.zip |
The PS2, DS and PalmOS ports currently do not properly implement their SaveFileManagers -- flagging the incorrect & invalid code by making it not compile. Note: Portser should probably also fix their code in the 0.11 branch
svn-id: r30079
Diffstat (limited to 'backends/platform/ds/arm9/source')
-rw-r--r-- | backends/platform/ds/arm9/source/gbampsave.cpp | 58 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/gbampsave.h | 4 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/ramsave.cpp | 15 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/ramsave.h | 7 |
4 files changed, 22 insertions, 62 deletions
diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp index 830073e7a7..b03a1334f7 100644 --- a/backends/platform/ds/arm9/source/gbampsave.cpp +++ b/backends/platform/ds/arm9/source/gbampsave.cpp @@ -164,62 +164,13 @@ GBAMPSaveFile* GBAMPSaveFileManager::openSavefile(char const* name, bool saveOrL } } -void GBAMPSaveFileManager::listSavefiles(char const* prefix, bool* marks, int num) { -// memset(marks, true, num * sizeof(bool)); -// return; - - // Seems like I misunderstood what this function was supposed to do. - // I thought I was meant to set the marks[] array according to which - // saves are present on disk. - enum { TYPE_NO_MORE = 0, TYPE_FILE = 1, TYPE_DIR = 2 }; - char name[128]; - char path[128]; - - DS::std_cwd((char *) getSavePath()); - consolePrintf("Save path: %s\n", getSavePath()); - - int fileType = FAT_FindFirstFileLFN(name); - - for (int r = 0; r < num; r++) { - marks[r] = false; - } - - do { - - if (fileType == TYPE_FILE) { - - FAT_GetLongFilename(name); - - for (int r = 0; r < num; r++) { - char str[128]; - - - sprintf(str, "%s%02d", prefix, r); - consolePrintf("%s != %s", str, name); - if (!stricmp(str, name)) { - marks[r] = true; - consolePrintf("Matched %d", r); - } - - } - - } - - } while ((fileType = FAT_FindNextFileLFN(name))); - - FAT_chdir("/"); -} - -Common::StringList GBAMPSaveFileManager::listSavefiles(const char *regex) { - - +Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) { enum { TYPE_NO_MORE = 0, TYPE_FILE = 1, TYPE_DIR = 2 }; char name[256]; - DS::std_cwd((char *) getSavePath()); -// consolePrintf("Save path: '%s', regex: '%s'\n", getSavePath(),regex); +// consolePrintf("Save path: '%s', pattern: '%s'\n", getSavePath(),pattern); int fileType = FAT_FindFirstFileLFN(name); @@ -238,16 +189,15 @@ Common::StringList GBAMPSaveFileManager::listSavefiles(const char *regex) { } - if (Common::matchString(name, regex)) { + if (Common::matchString(name, pattern)) { list.push_back(name); } } - + } while ((fileType = FAT_FindNextFileLFN(name))); FAT_chdir("/"); - return list; } diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h index 6fd3098b99..b46c9bd53b 100644 --- a/backends/platform/ds/arm9/source/gbampsave.h +++ b/backends/platform/ds/arm9/source/gbampsave.h @@ -71,9 +71,7 @@ public: virtual Common::InSaveFile* openForLoading(const char* filename) { return openSavefile(filename, false); } virtual bool removeSavefile(const char *filename) { return false; } // TODO: Implement this - virtual Common::StringList listSavefiles(const char *regex); - - void listSavefiles(const char *prefix, bool *marks, int num); + virtual Common::StringList listSavefiles(const char *pattern); void deleteFile(char* name); void listFiles(); diff --git a/backends/platform/ds/arm9/source/ramsave.cpp b/backends/platform/ds/arm9/source/ramsave.cpp index 1cd7ff814b..24eea80c5c 100644 --- a/backends/platform/ds/arm9/source/ramsave.cpp +++ b/backends/platform/ds/arm9/source/ramsave.cpp @@ -383,6 +383,18 @@ void DSSaveFileManager::deleteFile(char* name) { flushToSaveRAM(); } +void DSSaveFileManager::removeSavefile(const char *filename) { + TODO: Implement this. Most likely, you just have to use the code of deleteFile? +} + + +Common::StringList DSSaveFileManager::listSavefiles(const char *pattern) { + TODO: Implement this. If you don't understand what it should do, just ask + (e.g. on scummvm-devel or Fingolfin). It should be pretty simple if you + use Common::matchString from common/util.h and read the Doxygen docs, + then combine this with the old code below... + +/* void DSSaveFileManager::listSavefiles(const char *prefix, bool *marks, int num) { memset(marks, true, num * sizeof(bool)); return; @@ -398,6 +410,9 @@ void DSSaveFileManager::listSavefiles(const char *prefix, bool *marks, int num) } } +*/ + +} DSSaveFile *DSSaveFileManager::makeSaveFile(const char *filename, bool saveOrLoad) { diff --git a/backends/platform/ds/arm9/source/ramsave.h b/backends/platform/ds/arm9/source/ramsave.h index 9145a9b29b..d7ba6b5d68 100644 --- a/backends/platform/ds/arm9/source/ramsave.h +++ b/backends/platform/ds/arm9/source/ramsave.h @@ -123,11 +123,8 @@ public: virtual Common::OutSaveFile* openForSaving(const char* filename) { return openSavefile(filename, true); } virtual Common::InSaveFile* openForLoading(const char* filename) { return openSavefile(filename, false); } - virtual bool removeSavefile(const char *filename) { return false; } // TODO: Implement this - virtual Common::StringList listSavefiles(const char *regex) { return Common::StringList(); } // TODO: I don't know what this is for! - - - void listSavefiles(const char *prefix, bool *marks, int num); + virtual bool removeSavefile(const char *filename); + virtual Common::StringList listSavefiles(const char *pattern); void flushToSaveRAM(); |