Match CMemoryCardDriver::StartFileDeleteBad

Former-commit-id: 7ca5b720aa
This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-11 14:50:30 +03:00
parent 4c97e4562b
commit 5b16d7f3d4
4 changed files with 21 additions and 5 deletions

View File

@ -858,8 +858,8 @@ Close__19SMemoryCardFileInfoFv:
/* 8034DF84 0034AEE4 38 21 00 10 */ addi r1, r1, 0x10 /* 8034DF84 0034AEE4 38 21 00 10 */ addi r1, r1, 0x10
/* 8034DF88 0034AEE8 4E 80 00 20 */ blr /* 8034DF88 0034AEE8 4E 80 00 20 */ blr
.global FastDeleteFile__14CMemoryCardSysFii .global FastDeleteFile__14CMemoryCardSysFQ214CMemoryCardSys15EMemoryCardPorti
FastDeleteFile__14CMemoryCardSysFii: FastDeleteFile__14CMemoryCardSysFQ214CMemoryCardSys15EMemoryCardPorti:
/* 8034DF8C 0034AEEC 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8034DF8C 0034AEEC 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8034DF90 0034AEF0 7C 08 02 A6 */ mflr r0 /* 8034DF90 0034AEF0 7C 08 02 A6 */ mflr r0
/* 8034DF94 0034AEF4 38 A0 00 00 */ li r5, 0 /* 8034DF94 0034AEF4 38 A0 00 00 */ li r5, 0

View File

@ -1793,7 +1793,7 @@ StartFileDeleteAlt__17CMemoryCardDriverFv:
/* 8024DA14 0024A974 48 10 10 91 */ bl GetFileNo__19SMemoryCardFileInfoCFv /* 8024DA14 0024A974 48 10 10 91 */ bl GetFileNo__19SMemoryCardFileInfoCFv
/* 8024DA18 0024A978 7C 64 1B 78 */ mr r4, r3 /* 8024DA18 0024A978 7C 64 1B 78 */ mr r4, r3
/* 8024DA1C 0024A97C 80 7F 00 00 */ lwz r3, 0(r31) /* 8024DA1C 0024A97C 80 7F 00 00 */ lwz r3, 0(r31)
/* 8024DA20 0024A980 48 10 05 6D */ bl FastDeleteFile__14CMemoryCardSysFii /* 8024DA20 0024A980 48 10 05 6D */ bl FastDeleteFile__14CMemoryCardSysFQ214CMemoryCardSys15EMemoryCardPorti
/* 8024DA24 0024A984 7C 64 1B 79 */ or. r4, r3, r3 /* 8024DA24 0024A984 7C 64 1B 79 */ or. r4, r3, r3
/* 8024DA28 0024A988 41 82 00 0C */ beq lbl_8024DA34 /* 8024DA28 0024A988 41 82 00 0C */ beq lbl_8024DA34
/* 8024DA2C 0024A98C 7F E3 FB 78 */ mr r3, r31 /* 8024DA2C 0024A98C 7F E3 FB 78 */ mr r3, r31
@ -1829,7 +1829,7 @@ lbl_8024DA7C:
/* 8024DA90 0024A9F0 48 10 10 15 */ bl GetFileNo__19SMemoryCardFileInfoCFv /* 8024DA90 0024A9F0 48 10 10 15 */ bl GetFileNo__19SMemoryCardFileInfoCFv
/* 8024DA94 0024A9F4 7C 64 1B 78 */ mr r4, r3 /* 8024DA94 0024A9F4 7C 64 1B 78 */ mr r4, r3
/* 8024DA98 0024A9F8 80 7F 00 00 */ lwz r3, 0(r31) /* 8024DA98 0024A9F8 80 7F 00 00 */ lwz r3, 0(r31)
/* 8024DA9C 0024A9FC 48 10 04 F1 */ bl FastDeleteFile__14CMemoryCardSysFii /* 8024DA9C 0024A9FC 48 10 04 F1 */ bl FastDeleteFile__14CMemoryCardSysFQ214CMemoryCardSys15EMemoryCardPorti
/* 8024DAA0 0024AA00 7C 64 1B 79 */ or. r4, r3, r3 /* 8024DAA0 0024AA00 7C 64 1B 79 */ or. r4, r3, r3
/* 8024DAA4 0024AA04 41 82 00 1C */ beq lbl_8024DAC0 /* 8024DAA4 0024AA04 41 82 00 1C */ beq lbl_8024DAC0
/* 8024DAA8 0024AA08 7F E3 FB 78 */ mr r3, r31 /* 8024DAA8 0024AA08 7F E3 FB 78 */ mr r3, r31

View File

@ -71,6 +71,7 @@ public:
static ECardResult MountCard(EMemoryCardPort port); static ECardResult MountCard(EMemoryCardPort port);
static ECardResult CheckCard(EMemoryCardPort port); static ECardResult CheckCard(EMemoryCardPort port);
static ECardResult GetStatus(EMemoryCardPort port, int fileNo, CardStat& statOut); static ECardResult GetStatus(EMemoryCardPort port, int fileNo, CardStat& statOut);
static ECardResult FastDeleteFile(EMemoryCardPort port, int fileNo);
static ProbeResults IsMemoryCardInserted(EMemoryCardPort); static ProbeResults IsMemoryCardInserted(EMemoryCardPort);
static ECardResult GetSerialNo(EMemoryCardPort port, long long& serialOut); static ECardResult GetSerialNo(EMemoryCardPort port, long long& serialOut);

View File

@ -516,7 +516,22 @@ void CMemoryCardDriver::IndexFiles() {
} }
} }
void CMemoryCardDriver::StartFileDeleteBad() {} void CMemoryCardDriver::StartFileDeleteBad() {
x14_error = kE_OK;
x10_state = kS_FileDeleteBad;
for (int idx = 0; idx < x100_mcFileInfos.capacity(); ++idx) {
rstl::pair< EFileState, SMemoryCardFileInfo >& info = x100_mcFileInfos[idx];
if (info.first == kFS_BadFile) {
x194_fileIdx = idx;
ECardResult result = CMemoryCardSys::FastDeleteFile(x0_cardPort, info.second.GetFileNo());
if (result != kCR_READY) {
UpdateFileDeleteBad(result);
}
return;
}
}
}
void CMemoryCardDriver::StartFileDeleteAlt() {} void CMemoryCardDriver::StartFileDeleteAlt() {}