Rewrote timer code.

The new code is based on timestamps, rather than delays. This eliminates the
need to update every timer in timer_process(), which cost a non-trivial amount
of CPU time on low-end machines.

This involved changes to every user of the timer code, so this change almost
certainly introduces bugs.
This commit is contained in:
SarahW 2018-08-02 22:06:10 +01:00
commit a7d006b637
79 changed files with 1050 additions and 1033 deletions

View file

@ -76,15 +76,12 @@ static struct
int fdd_swap = 0;
void fdd_seek(int drive, int track_diff)
uint64_t fdd_seek(int drive, int track_diff)
{
drive ^= fdd_swap;
if (drive >= 2)
{
disctime = 5000;
return;
}
return 1000 * TIMER_USEC;
fdd[drive].track += track_diff;
@ -99,7 +96,7 @@ void fdd_seek(int drive, int track_diff)
fdc_discchange_clear(drive);
disc_seek(drive, fdd[drive].track);
disctime = 5000;
return 1000 * TIMER_USEC;
}
void fdd_disc_changed(int drive)