summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2016-06-02 11:24:39 +0100
committer smf- <smf-@users.noreply.github.com>2016-06-02 11:25:37 +0100
commit9d2528e12be5a3f646e00c0bc488fe5ffd4b14db (patch)
tree0e8c6692802ee2095c1d6e799969ad5e9d666005 /src/devices/machine
parentfbd887939539271cdb0f10d6f7a786c829772822 (diff)
Added CHS and LBA limits when the chd doesn't contain identify device data [smf]
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/idehd.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/devices/machine/idehd.cpp b/src/devices/machine/idehd.cpp
index c17e4258fbc..d0207a46f17 100644
--- a/src/devices/machine/idehd.cpp
+++ b/src/devices/machine/idehd.cpp
@@ -170,6 +170,26 @@ void ata_mass_storage_device::ide_build_identify_device()
m_identify_buffer[176] = 0x00; /* 176-205: current media serial number */
m_identify_buffer[206] = 0x00; /* 206-254: reserved */
m_identify_buffer[255] = 0x00; /* 255: integrity word */
+
+ if (total_sectors >= 16514064)
+ {
+ /// CHS limit
+ m_identify_buffer[1] = 16383; /* 1: logical cylinders */
+ m_identify_buffer[3] = 16; /* 3: logical heads */
+ m_identify_buffer[6] = 63; /* 6: logical sectors per logical track */
+ m_identify_buffer[54] = 16383; /* 54: number of current logical cylinders */
+ m_identify_buffer[55] = 16; /* 55: number of current logical heads */
+ m_identify_buffer[56] = 63; /* 56: number of current logical sectors per track */
+ m_identify_buffer[57] = 16514064 & 0xffff; /* 57-58: current capacity in sectors (ATA-1 through ATA-5; obsoleted in ATA-6) */
+ m_identify_buffer[58] = 16514064 >> 16;
+ }
+
+ if (total_sectors > 268435455)
+ {
+ /// LBA limit
+ m_identify_buffer[60] = 268435455 & 0xffff; /* 60-61: total user addressable sectors for LBA mode (ATA-1 through ATA-7) */
+ m_identify_buffer[61] = 268435455 >> 16;
+ }
}
//-------------------------------------------------