mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-07-07 02:35:52 +00:00
Add CMemoryCardDriver::UpdateCardProbe
This commit is contained in:
parent
b8b83360f4
commit
0a7858ac6b
@ -26,8 +26,8 @@ struct FileHandle {
|
|||||||
|
|
||||||
struct ProbeResults {
|
struct ProbeResults {
|
||||||
ECardResult x0_error;
|
ECardResult x0_error;
|
||||||
uint x4_cardSize; /* in megabits */
|
int x4_cardSize; /* in megabits */
|
||||||
uint x8_sectorSize; /* in bytes */
|
int x8_sectorSize; /* in bytes */
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMemoryCardSys {
|
class CMemoryCardSys {
|
||||||
|
@ -370,7 +370,46 @@ void CMemoryCardDriver::StartCardProbe() {
|
|||||||
UpdateCardProbe();
|
UpdateCardProbe();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMemoryCardDriver::UpdateCardProbe() {}
|
void CMemoryCardDriver::UpdateCardProbe() {
|
||||||
|
ProbeResults result = CMemoryCardSys::IsMemoryCardInserted(x0_cardPort);
|
||||||
|
ECardResult error = result.x0_error;
|
||||||
|
|
||||||
|
if (error == kCR_READY && result.x8_sectorSize != 0x2000) {
|
||||||
|
x10_state = kS_CardProbeFailed;
|
||||||
|
x14_error = kE_CardNon8KSectors;
|
||||||
|
} else if (error != kCR_BUSY) {
|
||||||
|
if (error == kCR_WRONGDEVICE) {
|
||||||
|
x10_state = kS_CardProbeFailed;
|
||||||
|
x14_error = kE_CardWrongDevice;
|
||||||
|
} else if (error != kCR_READY) {
|
||||||
|
NoCardFound();
|
||||||
|
} else {
|
||||||
|
x10_state = kS_CardProbeDone;
|
||||||
|
StartMountCard();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// switch (result.x0_error) {
|
||||||
|
// case kCR_READY:
|
||||||
|
// if (result.x8_sectorSize != 0x2000) {
|
||||||
|
// x10_state = kS_CardProbeFailed;
|
||||||
|
// x14_error = kE_CardNon8KSectors;
|
||||||
|
// } else {
|
||||||
|
// x10_state = kS_CardProbeDone;
|
||||||
|
// StartMountCard();
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case kCR_BUSY:
|
||||||
|
// break;
|
||||||
|
// case kCR_WRONGDEVICE:
|
||||||
|
// x10_state = kS_CardProbeFailed;
|
||||||
|
// x14_error = kE_CardWrongDevice;
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// NoCardFound();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
void CMemoryCardDriver::StartMountCard() {}
|
void CMemoryCardDriver::StartMountCard() {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user