port-work; won't compile or even work
[ppcskel.git] / fat.c
1 /*
2         BootMii - a Free Software replacement for the Nintendo/BroadOn bootloader.
3         Requires mini.
4
5 Copyright (C) 2009              Andre Heider "dhewg" <dhewg@wiibrew.org>
6
7 # This code is licensed to you under the terms of the GNU GPL, version 2;
8 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
9 */
10
11 #include "fat.h"
12
13 static FATFS fatfs;
14
15 u32 fat_mount(void) {
16         DSTATUS stat;
17
18         f_mount(0, NULL);
19
20         stat = disk_initialize(0);
21
22         if (stat & STA_NODISK)
23                 return -1;
24
25         if (stat & STA_NOINIT)
26                 return -2;
27
28         return f_mount(0, &fatfs);
29 }
30
31 u32 fat_umount(void) {
32         f_mount(0, NULL);
33
34         return 0;
35 }
36
37 u32 fat_clust2sect(u32 clust) {
38         return clust2sect(&fatfs, clust);
39 }
40
41