forked from lewurm/ppcskel
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfat.c
More file actions
41 lines (26 loc) · 672 Bytes
/
fat.c
File metadata and controls
41 lines (26 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
BootMii - a Free Software replacement for the Nintendo/BroadOn bootloader.
Requires mini.
Copyright (C) 2009 Andre Heider "dhewg" <dhewg@wiibrew.org>
# This code is licensed to you under the terms of the GNU GPL, version 2;
# see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
#include "fat.h"
static FATFS fatfs;
u32 fat_mount(void) {
DSTATUS stat;
f_mount(0, NULL);
stat = disk_initialize(0);
if (stat & STA_NODISK)
return -1;
if (stat & STA_NOINIT)
return -2;
return f_mount(0, &fatfs);
}
u32 fat_umount(void) {
f_mount(0, NULL);
return 0;
}
u32 fat_clust2sect(u32 clust) {
return clust2sect(&fatfs, clust);
}