diff options
Diffstat (limited to 'backends/platform/ds/arm9/source/fat/disc_io.c')
-rw-r--r-- | backends/platform/ds/arm9/source/fat/disc_io.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/backends/platform/ds/arm9/source/fat/disc_io.c b/backends/platform/ds/arm9/source/fat/disc_io.c index 6d48674d62..9a65812f89 100644 --- a/backends/platform/ds/arm9/source/fat/disc_io.c +++ b/backends/platform/ds/arm9/source/fat/disc_io.c @@ -5,7 +5,7 @@ uniformed io-interface to work with Chishm's FAT library Written by MightyMax - + Modified by Chishm: 2005-11-06 * Added WAIT_CR modifications for NDS @@ -28,13 +28,13 @@ * Added EFA2 support */ -#include "disc_io.h" -#include "scummconsole.h" - #ifdef NDS #include <nds.h> #endif +#include "disc_io.h" +#include "scummconsole.h" + // Include known io-interfaces: #ifdef SUPPORT_MPCF @@ -87,7 +87,7 @@ LPIO_INTERFACE active_interface = 0; Disc Cache functions 2006-02-03: - Added by www.neoflash.com + Added by www.neoflash.com */ int discDetect = 0; @@ -99,7 +99,7 @@ int dldiFound = FALSE; #include <string.h> #define CACHE_FREE 0xFFFFFFFF - + static u8 cacheBuffer[ DISC_CACHE_COUNT * 512 ]; static struct { @@ -112,20 +112,20 @@ FATDevice currentDevice; static u32 disc_CacheFind(u32 sector) { u32 i; - + for( i = 0; i < DISC_CACHE_COUNT; i++ ) { if( cache[ i ].sector == sector ) return i; } - + return CACHE_FREE; } static u32 disc_CacheFindFree(void) { - + u32 i = 0, j; u32 count = -1; - + for( j = 0; j < DISC_CACHE_COUNT; j++ ) { if( cache[ j ].sector == CACHE_FREE ) { @@ -142,7 +142,7 @@ static u32 disc_CacheFindFree(void) { if( cache[ i ].sector != CACHE_FREE && cache[i].dirty != 0 ) { active_interface->fn_WriteSectors( cache[ i ].sector, 1, &cacheBuffer[ i * 512 ] ); - /* todo: handle write error here + // todo: handle write error here cache[ i ].sector = CACHE_FREE; cache[ i ].dirty = 0; @@ -368,7 +368,7 @@ bool disc_setDsSlotInterface (void) active_interface = DLDI_GetInterface(); - if (stricmp(&_dldi_driver_name, "Default (No interface)")) { + if (stricmp((char *)(&_dldi_driver_name), "Default (No interface)")) { char name[48]; memcpy(name, &_dldi_driver_name, 48); name[47] = '\0'; @@ -431,7 +431,7 @@ bool disc_setDsSlotInterface (void) #endif -bool disc_Init(void) +bool disc_Init(void) { #ifdef DISC_CACHE disc_CacheInit(); @@ -455,15 +455,15 @@ bool disc_Init(void) // could not find a working IO Interface active_interface = 0 ; return false ; -} +} -bool disc_IsInserted(void) +bool disc_IsInserted(void) { if (active_interface) return active_interface->fn_IsInserted() ; return false ; -} +} -bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer) +bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer) { #ifdef DISC_CACHE u8 *p=(u8*)buffer; @@ -480,9 +480,9 @@ bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer) if (active_interface) return active_interface->fn_ReadSectors(sector,numSecs,buffer) ; return false ; #endif -} +} -bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer) +bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer) { /*#ifdef DISC_CACHE u8 *p=(u8*)buffer; @@ -513,32 +513,32 @@ bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer) int r; for (r = 0; r < numSecs; r++) { - memcpy(sectorBuffer, &buffer[r * 512], 512); + memcpy(sectorBuffer, &((char *)buffer)[r * 512], 512); if (!active_interface->fn_WriteSectors(sector + r, 1, sectorBuffer)) { return false; } } - + return true; } #else if (active_interface) return active_interface->fn_WriteSectors(sector,numSecs,buffer) ; - return false ; #endif //#endif -} + return false ; +} -bool disc_ClearStatus(void) +bool disc_ClearStatus(void) { if (active_interface) return active_interface->fn_ClearStatus() ; return false ; -} +} -bool disc_Shutdown(void) +bool disc_Shutdown(void) { #ifdef DISC_CACHE disc_CacheFlush(); @@ -546,7 +546,7 @@ bool disc_Shutdown(void) if (active_interface) active_interface->fn_Shutdown() ; active_interface = 0 ; return true ; -} +} u32 disc_HostType (void) { |