PIT timers can now be restarted using GATE input - CPU speed detection on SiS496/497 now works.

Added missing port 0x61 to Olivetti M24 - PC speaker now works on that machine.
Some code tidying.
This commit is contained in:
TomW 2013-11-08 22:32:34 +00:00
commit 36cdd540b2
9 changed files with 57 additions and 26 deletions

View file

@ -302,7 +302,26 @@ void pit_poll()
}
}
void pit_set_gate(int channel, int gate)
{
if (gate && !pit.gate[channel])
{
switch (pit.m[channel])
{
case 1: /*Hardware retriggerable one-shot*/
case 2: /*Rate generator*/
case 3: /*Square wave mode*/
case 5: /*Hardware triggered strobe (retriggerable)*/
pit.c[channel] = pit.l[2] * PITCONST;
break;
}
}
pit.gate[channel] = gate;
}
void pit_init()
{
io_sethandler(0x0040, 0x0004, pit_read, NULL, NULL, pit_write, NULL, NULL, NULL);
pit.gate[0] = pit.gate[1] = 1;
pit.gate[2] = 0;
}