From fe72d5dd7842312606b350785f2fac2b2824fcb6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 7 Jul 2010 23:22:53 +0000 Subject: DS: Fix some quirks in the NDS build system, remove some dead code * remove (S)RAM save code (it has not been in use for quite some time) * remove the lz compressor (was only used by ram save code) * OPT_SPEED was set incorrectly * dsmain.cpp was misspelled as ds_main.cpp * remove unsed arm9 libcartreset (the copy in the arm7 directory still is around, though) svn-id: r50741 --- backends/fs/ds/ds-fs.cpp | 51 +----------------------------------------------- backends/fs/ds/ds-fs.h | 8 +++----- 2 files changed, 4 insertions(+), 55 deletions(-) (limited to 'backends/fs') diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp index 43203eed54..675084ff56 100644 --- a/backends/fs/ds/ds-fs.cpp +++ b/backends/fs/ds/ds-fs.cpp @@ -542,27 +542,6 @@ FILE *std_fopen(const char *name, const char *mode) { assert(r < MAX_FILE_HANDLES); } -#ifdef GBA_SRAM_SAVE - if (strchr(mode, 'w')) { -// consolePrintf("Writing %s\n", realName); - s_handle[r].sramFile = DSSaveFileManager::instance()->openSavefile(realName, true); - } else { -// consolePrintf("Reading %s\n", realName); - s_handle[r].sramFile = DSSaveFileManager::instance()->openSavefile(realName, false); - } -#endif - - if (s_handle[r].sramFile) { - s_handle[r].used = true; - s_handle[r].pos = 0; - s_handle[r].data = NULL; - s_handle[r].size = s_handle[r].sramFile->getSize(); -// consolePrintf("Found it"); - return &s_handle[r]; - } - -// consolePrintf("Not in SRAM!"); - char *data; ZipFile *zip = DSFileSystemNode::getZip(); @@ -615,10 +594,6 @@ void std_fclose(FILE *handle) { } handle->used = false; - if (handle->sramFile) { - delete handle->sramFile; - handle->sramFile = NULL; - } } size_t std_fread(void *ptr, size_t size, size_t numItems, FILE *handle) { @@ -638,21 +613,6 @@ size_t std_fread(void *ptr, size_t size, size_t numItems, FILE *handle) { return numItems; } - if (handle->sramFile) { - int bytes = 0; - int result = 1; - //consolePrintf("fread size=", size * numItems); - for (int r = 0; (r < (s32) size * (s32) numItems) && (result > 0); r++) { - result = handle->sramFile->read((void *) ( ((char *) (ptr)) + r), 1); - bytes += result; - //consolePrintf("'%d',", ((char *) (ptr))[0]); - } - - handle->pos += bytes; - - return bytes / size; - } - if (handle->pos > handle->size) numItems = 0; else if ((int)(handle->pos + size * numItems) > handle->size) @@ -695,12 +655,7 @@ size_t std_fwrite(const void *ptr, size_t size, size_t numItems, FILE *handle) { return numItems; } - if (handle->sramFile) { - handle->sramFile->write(ptr, size); - return size; - } else { - return 0; - } + return 0; } bool std_feof(FILE *handle) { @@ -710,10 +665,6 @@ bool std_feof(FILE *handle) { return readPastEndOfFile && FAT_feof((FAT_FILE *) handle); } - if (handle->sramFile) { - return handle->sramFile->eos(); - } - // consolePrintf("feof %s", handle->pos >= handle->size? "true": "false"); return handle->pos >= handle->size; } diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h index fadfb8a40d..6961022848 100644 --- a/backends/fs/ds/ds-fs.h +++ b/backends/fs/ds/ds-fs.h @@ -26,12 +26,12 @@ #ifndef _DS_FS_H #define _DS_FS_H -//#include #include "common/fs.h" +#include "common/stream.h" +#include "backends/fs/abstract-fs.h" + #include "zipreader.h" -#include "ramsave.h" #include "fat/gba_nds_fat.h" -#include "backends/fs/abstract-fs.h" namespace DS { @@ -166,8 +166,6 @@ struct fileHandle { bool used; char *data; int size; - - DSSaveFile *sramFile; }; -- cgit v1.2.3