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