mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-23 06:29:38 +00:00
Superdrive: support disk-in-drive status.
This commit is contained in:
parent
00093bdc95
commit
dea863b6e6
@ -31,6 +31,7 @@ using namespace MacSuperdrive;
|
||||
MacSuperDrive::MacSuperDrive()
|
||||
{
|
||||
this->media_kind = MediaKind::high_density;
|
||||
this->has_disk = 0; // drive is empty
|
||||
}
|
||||
|
||||
void MacSuperDrive::command(uint8_t addr, uint8_t value)
|
||||
@ -61,6 +62,8 @@ uint8_t MacSuperDrive::status(uint8_t addr)
|
||||
return 1; // yes, Superdrive is double sided
|
||||
case StatusAddr::Drive_Exists:
|
||||
return 0; // tell the world I'm here
|
||||
case StatusAddr::Disk_In_Drive:
|
||||
return this->has_disk ^ 1; // reverse logic (active low)!
|
||||
case StatusAddr::Media_Kind:
|
||||
return this->media_kind;
|
||||
default:
|
||||
|
@ -30,10 +30,11 @@ namespace MacSuperdrive {
|
||||
|
||||
/** Apple Drive status request addresses. */
|
||||
enum StatusAddr : uint8_t {
|
||||
MFM_Support = 5,
|
||||
Double_Sided = 6,
|
||||
Drive_Exists = 7,
|
||||
Media_Kind = 0xF
|
||||
MFM_Support = 5,
|
||||
Double_Sided = 6,
|
||||
Drive_Exists = 7,
|
||||
Disk_In_Drive = 8,
|
||||
Media_Kind = 0xF
|
||||
};
|
||||
|
||||
/** Apple Drive command addresses. */
|
||||
@ -57,6 +58,7 @@ public:
|
||||
|
||||
private:
|
||||
uint8_t media_kind;
|
||||
uint8_t has_disk;
|
||||
};
|
||||
|
||||
}; // namespace MacSuperdrive
|
||||
|
Loading…
Reference in New Issue
Block a user