| 62 | } |
| 63 | |
| 64 | s32 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 | |
| 100 | s32 CARDSetStatusAsync(s32 chan, s32 fileNo, CARDStat* stat, CARDCallback callback) { |
| 101 | CARDControl* card; |
no test coverage detected