Fixed PIT readback command, and timing synchronisation when loading a timer. Fixes Sound Blaster detection in Lemmings 2.
This commit is contained in:
parent
5c3ae2556a
commit
e6d20ca199
1 changed files with 4 additions and 4 deletions
|
|
@ -88,7 +88,7 @@ static void pit_set_out(PIT *pit, int t, int out)
|
|||
static void pit_load(PIT *pit, int t)
|
||||
{
|
||||
int l = pit->l[t] ? pit->l[t] : 0x10000;
|
||||
timer_process();
|
||||
timer_clock();
|
||||
pit->newcount[t] = 0;
|
||||
pit->disabled[t] = 0;
|
||||
// pclog("pit_load: t=%i l=%x\n", t, l);
|
||||
|
|
@ -343,11 +343,11 @@ void pit_write(uint16_t addr, uint8_t val, void *p)
|
|||
if (!(val&0x20))
|
||||
{
|
||||
if (val & 2)
|
||||
pit->rl[0] = pit->using_timer[0] ? ((int)(pit->c[0] / PITCONST) >> TIMER_SHIFT) : pit->count[0];
|
||||
pit->rl[0] = pit_read_timer(pit, 0);
|
||||
if (val & 4)
|
||||
pit->rl[1] = pit->using_timer[1] ? ((int)(pit->c[1] / PITCONST) >> TIMER_SHIFT) : pit->count[1];
|
||||
pit->rl[1] = pit_read_timer(pit, 1);
|
||||
if (val & 8)
|
||||
pit->rl[2] = pit->using_timer[2] ? ((int)(pit->c[2] / PITCONST) >> TIMER_SHIFT) : pit->count[2];
|
||||
pit->rl[2] = pit_read_timer(pit, 2);
|
||||
}
|
||||
if (!(val & 0x10))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue