Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bootloader/storage/emummc.h
1476 views
1
/*
2
* Copyright (c) 2019-2021 CTCaer
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#ifndef EMUMMC_H
18
#define EMUMMC_H
19
20
#include <bdk.h>
21
22
typedef enum
23
{
24
EMUMMC_TYPE_NONE = 0,
25
EMUMMC_TYPE_PARTITION = 1,
26
EMUMMC_TYPE_FILES = 2,
27
} emummc_type_t;
28
29
typedef enum {
30
EMUMMC_MMC_NAND = 0,
31
EMUMMC_MMC_SD = 1,
32
EMUMMC_MMC_GC = 2,
33
} emummc_mmc_t;
34
35
typedef struct _emummc_cfg_t
36
{
37
int enabled;
38
u64 sector;
39
u32 id;
40
char *path;
41
char *nintendo_path;
42
// Internal.
43
char *emummc_file_based_path;
44
u32 file_based_part_size;
45
u32 active_part;
46
int fs_ver;
47
} emummc_cfg_t;
48
49
extern emummc_cfg_t emu_cfg;
50
51
void emummc_load_cfg();
52
bool emummc_set_path(char *path);
53
int emummc_storage_init_mmc();
54
int emummc_storage_end();
55
int emummc_storage_read(u32 sector, u32 num_sectors, void *buf);
56
int emummc_storage_write(u32 sector, u32 num_sectors, void *buf);
57
int emummc_storage_set_mmc_partition(u32 partition);
58
59
#endif
60