Add support for file/partition based emummc on emmc,

Add support for emuSD
This commit is contained in:
Christoph Baumann
2025-05-09 12:30:41 +02:00
parent 633bb63fc2
commit 886fa9cc97
13 changed files with 346 additions and 130 deletions

View File

@@ -172,8 +172,7 @@ typedef struct {
LBA_t bitbase; /* Allocation bitmap base sector */
#endif
LBA_t winsect; /* Current sector appearing in the win[] */
BYTE pad[4];
BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
__attribute__((aligned(8))) BYTE win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
} FATFS;
@@ -218,7 +217,7 @@ typedef struct {
DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open, set by application) */
#endif
#if !FF_FS_TINY
BYTE buf[FF_MAX_SS]; /* File private data read/write window */
__attribute__((aligned(8))) BYTE buf[FF_MAX_SS]; /* File private data read/write window */
#endif
} FIL;

View File

@@ -16,7 +16,7 @@
#include <exosphere.hpp>
#include "diskio_cpp.h"
#include "../fusee_sd_card.hpp"
#include "../fusee_emummc.hpp"
#include "../fusee_mmc.hpp"
bool diskio_read_sd_card(void *dst, size_t size, size_t sector_index, size_t sector_count) {
return R_SUCCEEDED(::ams::nxboot::ReadSdCard(dst, size, sector_index, sector_count));
@@ -27,9 +27,10 @@ bool diskio_write_sd_card(size_t sector_index, size_t sector_count, const void *
}
bool diskio_read_system(void *dst, size_t size, size_t sector_index, size_t sector_count) {
return false;
return R_SUCCEEDED(::ams::nxboot::ReadMmc(dst, size, ::ams::sdmmc::MmcPartition::MmcPartition_UserData, sector_index, sector_count));
}
bool diskio_write_system(size_t sector_index, size_t sector_count, const void *src, size_t size) {
/* Don't allow writes to eMMC GPP partition */
return false;
}