MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / CARDGetStatus

Function CARDGetStatus

src/dolphin/src/card/CARDStat.c:64–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64s32 CARDGetStatus(s32 chan, s32 fileNo, CARDStat* stat) {
65 CARDControl* card;
66 CARDDir* dir;
67 CARDDir* ent;
68 s32 result;
69
70 if (fileNo < 0 || CARD_MAX_FILE <= fileNo) {
71 return CARD_RESULT_FATAL_ERROR;
72 }
73 result = __CARDGetControlBlock(chan, &card);
74 if (result < 0) {
75 return result;
76 }
77
78 dir = __CARDGetDirBlock(card);
79 ent = &dir[fileNo];
80 result = __CARDIsReadable(card, ent);
81
82 if (result >= 0) {
83 memcpy(stat->gameName, ent->gameName, sizeof(stat->gameName));
84 memcpy(stat->company, ent->company, sizeof(stat->company));
85 stat->length = (u32)ent->length * card->sectorSize;
86 memcpy(stat->fileName, ent->fileName, CARD_FILENAME_MAX);
87 stat->time = ent->time;
88
89 stat->bannerFormat = ent->bannerFormat;
90 stat->iconAddr = ent->iconAddr;
91 stat->iconFormat = ent->iconFormat;
92 stat->iconSpeed = ent->iconSpeed;
93 stat->commentAddr = ent->commentAddr;
94
95 UpdateIconOffsets(ent, stat);
96 }
97 return __CARDPutControlBlock(card, result);
98}
99
100s32 CARDSetStatusAsync(s32 chan, s32 fileNo, CARDStat* stat, CARDCallback callback) {
101 CARDControl* card;

Callers 2

iSG_mc_fopenFunction · 0.85
iSG_mcqa_fwriteFunction · 0.85

Calls 6

__CARDGetControlBlockFunction · 0.85
__CARDGetDirBlockFunction · 0.85
__CARDIsReadableFunction · 0.85
memcpyFunction · 0.85
UpdateIconOffsetsFunction · 0.85
__CARDPutControlBlockFunction · 0.85

Tested by

no test coverage detected