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

Function __CARDIsWritable

src/dolphin/src/card/CARDOpen.c:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54s32 __CARDIsWritable(CARDControl *card, CARDDir *entry)
55{
56 const DVDDiskID *diskID = card->diskID;
57 s32 result;
58 u8 perm;
59
60 result = __CARDAccess(card, entry);
61 if (result == CARD_RESULT_NOPERM)
62 {
63 perm = (u8)(entry->permission & __CARDPermMask);
64
65 if ((perm & 0x20) && (memcmp(entry->gameName, __CARDDiskNone.gameName, 4) == 0 && memcmp(entry->company, __CARDDiskNone.company, 2) == 0))
66 {
67 return CARD_RESULT_READY;
68 }
69
70 if ((perm & 0x40) && (memcmp(entry->gameName, __CARDDiskNone.gameName, 4) == 0 && memcmp(entry->company, diskID->company, 2) == 0))
71 {
72 return CARD_RESULT_READY;
73 }
74 }
75 return result;
76}
77
78s32 __CARDIsReadable(CARDControl* card, CARDDir* entry)
79{

Callers 5

CARDWriteAsyncFunction · 0.85
__CARDSetStatusExAsyncFunction · 0.85
__CARDIsReadableFunction · 0.85
CARDSetStatusAsyncFunction · 0.85
CARDRenameAsyncFunction · 0.85

Calls 2

__CARDAccessFunction · 0.85
memcmpFunction · 0.85

Tested by

no test coverage detected