From dadb60490565eff0835d91d4f04817ed6d1fea64 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Tue, 16 Feb 2016 16:26:46 +0100 Subject: [PATCH] All base io functions working --- source/fatfs/3dsnand.c | 2 +- source/fatfs/diskio.c | 12 ++++++------ source/main.c | 3 --- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/source/fatfs/3dsnand.c b/source/fatfs/3dsnand.c index 3e2395d..665d8be 100644 --- a/source/fatfs/3dsnand.c +++ b/source/fatfs/3dsnand.c @@ -109,7 +109,7 @@ PartitionInfo* GetPartitionInfo(u32 partition_id) u32 GetNandCtr(u8* ctr, u32 offset) { - static const char* versions[] = {"4.x", "5.x", "6.x", "7.x", "8.x", "9.x"}; + // static const char* versions[] = {"4.x", "5.x", "6.x", "7.x", "8.x", "9.x"}; static const u8* version_ctrs[] = { (u8*)0x080D7CAC, (u8*)0x080D858C, diff --git a/source/fatfs/diskio.c b/source/fatfs/diskio.c index 1c0eb19..5711845 100644 --- a/source/fatfs/diskio.c +++ b/source/fatfs/diskio.c @@ -10,7 +10,7 @@ #include "diskio.h" /* FatFs lower layer API */ #include "platform.h" #include "sdmmc.h" -#include "decryptor/nand.h" +#include "3dsnand.h" #define TYPE_SDCARD 0 #define TYPE_SYSNAND 1 @@ -23,7 +23,7 @@ typedef struct { } FATpartition; FATpartition DriveInfo[28] = { - { 0x000000, TYPE_SCARD, 0 }, // 0 - SDCARD + { 0x000000, TYPE_SDCARD, 0 }, // 0 - SDCARD { 0x000000, TYPE_SYSNAND, P_CTRNAND }, // 1 - SYSNAND CTRNAND { 0x000000, TYPE_SYSNAND, P_TWLN }, // 2 - SYSNAND TWLN { 0x000000, TYPE_SYSNAND, P_TWLP }, // 3 - SYSNAND TWLP @@ -96,7 +96,7 @@ DRESULT disk_read ( UINT count /* Number of sectors to read */ ) { - if (DriveInfo[pdrv].type == TYPE_SCARD) { + if (DriveInfo[pdrv].type == TYPE_SDCARD) { if (sdmmc_sdcard_readsectors(sector, count, buff)) { return RES_PARERR; } @@ -127,7 +127,7 @@ DRESULT disk_write ( UINT count /* Number of sectors to write */ ) { - if (DriveInfo[pdrv].type == TYPE_SCARD) { + if (DriveInfo[pdrv].type == TYPE_SDCARD) { if (sdmmc_sdcard_writesectors(sector, count, (BYTE *)buff)) { return RES_PARERR; } @@ -166,11 +166,11 @@ DRESULT disk_ioctl ( *((DWORD*) buff) = 0x200; return RES_OK; case GET_SECTOR_COUNT: - *((DWORD*) buff) = getMMCDevice((DriveInfo[pdrv].type == TYPE_SCARD) ? 1 : 0)->total_size; + *((DWORD*) buff) = getMMCDevice((DriveInfo[pdrv].type == TYPE_SDCARD) ? 1 : 0)->total_size; return RES_OK; case GET_BLOCK_SIZE: *((DWORD*) buff) = 0x2000; - return (DriveInfo[pdrv].type == TYPE_SCARD) ? RES_OK : RES_PARERR; + return (DriveInfo[pdrv].type == TYPE_SDCARD) ? RES_OK : RES_PARERR; case CTRL_SYNC: // nothing to do here - the disk_write function handles that return RES_OK; diff --git a/source/main.c b/source/main.c index 5649e01..7a2917a 100644 --- a/source/main.c +++ b/source/main.c @@ -1,10 +1,7 @@ #include "common.h" #include "draw.h" #include "fs.h" -#include "menu.h" #include "i2c.h" -#include "decryptor/game.h" -#include "decryptor/nand.h" void Reboot() {