mirror of
https://github.com/wiiu-env/libfat.git
synced 2024-11-22 09:59:18 +01:00
sector buffer in ewram for writing from arm7 (DSi SD fix)
This commit is contained in:
parent
93ec6aad6a
commit
907449094b
@ -54,6 +54,7 @@ static const DISC_INTERFACE* get_io_usbstorage (void) {
|
||||
static const DISC_INTERFACE* get_io_gcsda (void) {
|
||||
return &__io_gcsda;
|
||||
}
|
||||
|
||||
static const DISC_INTERFACE* get_io_gcsdb (void) {
|
||||
return &__io_gcsdb;
|
||||
}
|
||||
@ -87,7 +88,12 @@ const INTERFACE_ID _FAT_disc_interfaces[] = {
|
||||
#elif defined (NDS)
|
||||
#include <nds/arm9/dldi.h>
|
||||
|
||||
static const DISC_INTERFACE* get_io_dsisd (void) {
|
||||
return &__io_dsisd;
|
||||
}
|
||||
|
||||
const INTERFACE_ID _FAT_disc_interfaces[] = {
|
||||
{"sd", get_io_dsisd},
|
||||
{"fat", dldiGetInternal},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -38,11 +38,6 @@
|
||||
#include <ctype.h>
|
||||
#include <sys/iosupport.h>
|
||||
|
||||
/*
|
||||
This device name, as known by devkitPro toolchains
|
||||
*/
|
||||
const char* DEVICE_NAME = "fat";
|
||||
|
||||
/*
|
||||
Data offsets
|
||||
*/
|
||||
@ -108,6 +103,7 @@ static const char FAT_SIG[3] = {'F', 'A', 'T'};
|
||||
static const char FS_INFO_SIG1[4] = {'R', 'R', 'a', 'A'};
|
||||
static const char FS_INFO_SIG2[4] = {'r', 'r', 'A', 'a'};
|
||||
|
||||
static uint8_t sectorBuffer[BYTES_PER_READ] __attribute__((aligned(32)));
|
||||
|
||||
sec_t FindFirstValidPartition(const DISC_INTERFACE* disc)
|
||||
{
|
||||
@ -115,8 +111,6 @@ sec_t FindFirstValidPartition(const DISC_INTERFACE* disc)
|
||||
uint8_t *ptr;
|
||||
int i;
|
||||
|
||||
uint8_t sectorBuffer[BYTES_PER_READ] = {0};
|
||||
|
||||
// Read first sector of disc
|
||||
if (!_FAT_disc_readSectors (disc, 0, 1, sectorBuffer)) {
|
||||
return 0;
|
||||
@ -168,9 +162,9 @@ sec_t FindFirstValidPartition(const DISC_INTERFACE* disc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
PARTITION* _FAT_partition_constructor (const DISC_INTERFACE* disc, uint32_t cacheSize, uint32_t sectorsPerPage, sec_t startSector) {
|
||||
PARTITION* partition;
|
||||
uint8_t sectorBuffer[BYTES_PER_READ] = {0};
|
||||
|
||||
// Read first sector of disc
|
||||
if (!_FAT_disc_readSectors (disc, startSector, 1, sectorBuffer)) {
|
||||
|
@ -34,9 +34,6 @@
|
||||
#include "cache.h"
|
||||
#include "lock.h"
|
||||
|
||||
// Device name
|
||||
extern const char* DEVICE_NAME;
|
||||
|
||||
// Filesystem type
|
||||
typedef enum {FS_UNKNOWN, FS_FAT12, FS_FAT16, FS_FAT32} FS_TYPE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user