Front SD ELF loader added
[svpe-wii.git] / sdelfloader / loader / source / diskio.c
bloba38a55973ef27728a48fe825a929da4ac1e910f7
1 /*
2 * Copyright (C) 2008 svpe, #wiidev at efnet
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #include <gccore.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 #include "sdio.h"
22 #include "diskio.h"
25 DSTATUS disk_initialize (BYTE drv)
27 s32 r;
28 if(drv != 0)
29 return RES_PARERR;
31 r = sd_init();
33 if(r == 0)
34 return RES_OK;
35 else
36 return RES_NOTRDY;
39 DSTATUS disk_status ( BYTE drv )
41 return RES_OK;
44 DRESULT disk_read (
45 BYTE drv, /* Physical drive nmuber (0) */
46 BYTE *buff, /* Data buffer to store read data */
47 DWORD sector, /* Sector number (LBA) */
48 BYTE count /* Sector count (1..255) */
51 s32 r = -1;
52 u32 i;
54 for(i = 0; i < count; i++)
56 r = sd_read(sector + i, buff + (0x200 * i));
57 if(r < 0)
58 return RES_NOTRDY;
61 return RES_OK;
64 DRESULT disk_ioctl (
65 BYTE drv, /* Physical drive nmuber */
66 BYTE ctrl, /* Control code */
67 void *buff /* Buffer to send/receive data block */
70 return RES_OK;
73 u32 get_fattime( void )
75 return 0;