Nugget
card.h
1 /*
2 
3 MIT License
4 
5 Copyright (c) 2021 PCSX-Redux authors
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 
25 */
26 
27 #pragma once
28 
29 #include "common/psxlibc/direntry.h"
30 #include "common/psxlibc/stdio.h"
31 
32 int addMemoryCardDevice();
33 int initBackupUnit();
34 int cardInfo(int deviceId);
35 void buLowLevelOpCompleted();
36 int buReadTOC(int deviceId);
37 void buLowLevelOpError1();
38 void buLowLevelOpError2();
39 void buLowLevelOpError3();
40 
41 int dev_bu_open(struct File *file, const char *filename, int mode);
42 int dev_bu_close(struct File *file);
43 int dev_bu_read(struct File *file, void *buffer, int size);
44 int dev_bu_write(struct File *file, void *buffer, int size);
45 void dev_bu_erase();
46 void dev_bu_undelete();
47 struct DirEntry *dev_bu_firstFile(struct File *file, const char *filename, struct DirEntry *entry);
48 struct DirEntry *dev_bu_nextFile(struct File *file, struct DirEntry *entry);
49 int dev_bu_format(struct File *file);
50 void dev_bu_rename();
51 void dev_bu_deinit();
52 
53 extern int g_buOpSectorStart[2];
54 extern int g_buOpSectorCount[2];
55 extern int g_buOpActualSector[2];
56 extern char *g_buOpBuffer[2];
57 extern struct File *g_buOpFile[2];
58 int buRelativeToAbsoluteSector(int port, int block, int sector);
59 int buGetReallocated(int port, int sector);
60 int buSetAutoFormat(int autoFormat);
Definition: direntry.h:33
Definition: stdio.h:96