@@ -6,36 +6,37 @@ namespace gc::card {
6
6
7
7
extern " C" {
8
8
9
- #define CARD_SLOTA 0 // Memory card slot A
10
- #define CARD_SLOTB 1 // Memory card slot B
9
+ #define CARD_SLOTA 0 // Memory card slot A
10
+ #define CARD_SLOTB 1 // Memory card slot B
11
11
12
- #define CARD_FILENAMELEN 32 // Maximum filename length
13
- #define CARD_MAXICONS 8
12
+ #define CARD_FILENAMELEN 32 // Maximum filename length
13
+ #define CARD_MAXICONS 8
14
14
15
- #define CARD_ERROR_UNLOCKED 1 // Card is being unlocked or is already unlocked
16
- #define CARD_ERROR_READY 0 // Card is ready
17
- #define CARD_ERROR_BUSY -1 // Card is busy
18
- #define CARD_ERROR_WRONGDEVICE -2 // Wrong device connected in slot
19
- #define CARD_ERROR_NOCARD -3 // No memory card in slot
20
- #define CARD_ERROR_NOFILE -4 // Specified file not found
21
- #define CARD_ERROR_IOERROR -5 // Internal EXI I/O error
22
- #define CARD_ERROR_BROKEN -6 // Directory structure or file entry broken
23
- #define CARD_ERROR_EXIST -7 // File already exists with the specified parameters
24
- #define CARD_ERROR_NOENT -8 // Found no empty block to create the file
25
- #define CARD_ERROR_INSSPACE -9 // Not enough space to write the file to the memory card
26
- #define CARD_ERROR_NOPERM -10 // Not enough permissions to operate on the file
27
- #define CARD_ERROR_LIMIT -11 // Card size limit reached
28
- #define CARD_ERROR_NAMETOOLONG -12 // Filename too long
29
- #define CARD_ERROR_ENCODING -13 // Font encoding PAL/SJIS mismatch
30
- #define CARD_ERROR_CANCELED -14 // Card operation canceled
31
- #define CARD_ERROR_FATAL_ERROR -128 // Fatal error, non-recoverable
15
+ #define CARD_RESULT_UNLOCKED 1 // Card is being unlocked or is already unlocked
16
+ #define CARD_RESULT_READY 0 // Card is ready
17
+ #define CARD_RESULT_BUSY -1 // Card is busy
18
+ #define CARD_RESULT_WRONGDEVICE -2 // Wrong device connected in slot
19
+ #define CARD_RESULT_NOCARD -3 // No memory card in slot
20
+ #define CARD_RESULT_NOFILE -4 // Specified file not found
21
+ #define CARD_RESULT_IOERROR -5 // Internal EXI I/O error
22
+ #define CARD_RESULT_BROKEN -6 // Directory structure or file entry broken
23
+ #define CARD_RESULT_EXIST -7 // File already exists with the specified parameters
24
+ #define CARD_RESULT_NOENT -8 // Found no empty block to create the file
25
+ #define CARD_RESULT_INSSPACE -9 // Not enough space to write the file to the memory card
26
+ #define CARD_RESULT_NOPERM -10 // Not enough permissions to operate on the file
27
+ #define CARD_RESULT_LIMIT -11 // Card size limit reached
28
+ #define CARD_RESULT_NAMETOOLONG -12 // Filename too long
29
+ #define CARD_RESULT_ENCODING -13 // Font encoding PAL/SJIS mismatch
30
+ #define CARD_RESULT_CANCELED -14 // Card operation canceled
31
+ #define CARD_RESULT_FATAL_ERROR -128 // Fatal error, non-recoverable
32
32
33
33
typedef struct CARDFileInfo {
34
34
int32_t channel;
35
35
int32_t fileNum;
36
36
int32_t offset;
37
37
int32_t length;
38
38
uint16_t iBlock;
39
+ uint16_t padding;
39
40
} CARDFileInfo;
40
41
41
42
typedef struct CARDStat {
@@ -53,7 +54,7 @@ typedef struct CARDStat {
53
54
uint32_t offsetBannerTlut;
54
55
uint32_t offsetIcon[CARD_MAXICONS];
55
56
uint32_t offsetIconTlut;
56
- uint32_t offsetDada ;
57
+ uint32_t offsetData ;
57
58
} CARDStat;
58
59
59
60
typedef void (*CARDCallback)(int32_t channel, int32_t result);
@@ -62,12 +63,12 @@ int32_t CARDGetResultCode(int32_t channel);
62
63
int32_t CARDProbeEx (int32_t channel, int32_t *memSize, int32_t *sectorSize);
63
64
int32_t CARDMountAsync (int32_t channel, void *workArea, CARDCallback detachCallback, CARDCallback attachCallback);
64
65
int32_t CARDUnmount (int32_t channel);
65
- int32_t CARDOpen (int32_t channel, char *fileName, CARDFileInfo *fileInfo);
66
+ int32_t CARDOpen (int32_t channel, const char *fileName, CARDFileInfo *fileInfo);
66
67
int32_t CARDClose (CARDFileInfo *fileInfo);
67
- int32_t CARDCreateAsync (int32_t channel, char *fileName, uint32_t size, CARDFileInfo *fileInfo, CARDCallback callback);
68
+ int32_t CARDCreateAsync (int32_t channel, const char *fileName, uint32_t size, CARDFileInfo *fileInfo, CARDCallback callback);
68
69
int32_t CARDReadAsync (CARDFileInfo *fileInfo, void *buffer, int32_t length, int32_t offset, CARDCallback callback);
69
70
int32_t CARDWriteAsync (CARDFileInfo *fileInfo, void *buffer, int32_t length, int32_t offset, CARDCallback callback);
70
- int32_t CARDDelete (int32_t channel, char *fileName);
71
+ int32_t CARDDelete (int32_t channel, const char *fileName);
71
72
int32_t CARDGetStatus (int32_t channel, int32_t fileNum, CARDStat *stat);
72
73
int32_t CARDSetStatusAsync (int32_t channel, int32_t fileNum, CARDStat *stat, CARDCallback callback);
73
74
0 commit comments