[Disk] Simplify Seek Timing calculation at expense of accuracy

This commit is contained in:
LuigiBlood 2020-06-06 00:28:02 +02:00
parent cc2c4e8786
commit 737383b695
1 changed files with 8 additions and 17 deletions

View File

@ -108,7 +108,7 @@ void DiskCommand()
if (isSeek) if (isSeek)
{ {
//Emulate Seek Times, send interrupt later //Emulate Seek Times, send interrupt later
uint32_t seektime = 0x179200; uint32_t seektime = 0;
//Start Motor, can take half a second, delay the response //Start Motor, can take half a second, delay the response
if (g_Reg->ASIC_STATUS & DD_STATUS_MTR_N_SPIN) if (g_Reg->ASIC_STATUS & DD_STATUS_MTR_N_SPIN)
@ -133,35 +133,26 @@ void DiskCommand()
} }
} }
//Add delay depending on the zone //Add seek delay depending on the zone (this is inaccurate timing, but close enough)
seektime += 0x179200;
switch (zone) switch (zone)
{ {
case 0: case 0:
default:
break;
case 1: case 1:
seektime += 0x1900; default:
seektime += track * 38;
break; break;
case 2: case 2:
seektime += 0x2A00;
break;
case 3: case 3:
seektime += 0x4500;
break;
case 4: case 4:
seektime += 0x5E00;
break;
case 5: case 5:
seektime += 0x7A00;
break;
case 6: case 6:
seektime += 0x9700;
break;
case 7: case 7:
seektime += 0xAF00; seektime += 0x13C * 38 + (track - 0x13C) * 46;
break; break;
case 8: case 8:
seektime += 0xCC00; seektime += 0x13C * 38 + 0x2E9 * 46 + (track - 0x425) * 58;
break; break;
} }