Chipsets.

This commit is contained in:
OBattler
2022-07-16 03:21:09 +02:00
parent 2fd712d092
commit c58360df3e
3 changed files with 21 additions and 47 deletions

View File

@@ -264,10 +264,8 @@ sio_write(int func, int addr, uint8_t val, void *priv)
dev->fast_off_period = PCICLK * 32768.0;
break;
}
cpu_fast_off_count = dev->regs[0xa8] + 1;
timer_disable(&dev->fast_off_timer);
if (dev->fast_off_period != 0.0)
timer_on_auto(&dev->fast_off_timer, dev->fast_off_period);
cpu_fast_off_count = cpu_fast_off_val + 1;
cpu_fast_off_period_set(cpu_fast_off_val, dev->fast_off_period);
}
break;
case 0xa2:
@@ -306,9 +304,7 @@ sio_write(int func, int addr, uint8_t val, void *priv)
dev->regs[addr] = val & 0xff;
cpu_fast_off_val = val;
cpu_fast_off_count = val + 1;
timer_disable(&dev->fast_off_timer);
if (dev->fast_off_period != 0.0)
timer_on_auto(&dev->fast_off_timer, dev->fast_off_period);
cpu_fast_off_period_set(cpu_fast_off_val, dev->fast_off_period);
break;
}
}
@@ -429,15 +425,8 @@ sio_fast_off_count(void *priv)
{
sio_t *dev = (sio_t *) priv;
cpu_fast_off_count--;
if (cpu_fast_off_count == 0) {
smi_raise();
dev->regs[0xaa] |= 0x20;
cpu_fast_off_count = dev->regs[0xa8] + 1;
}
timer_on_auto(&dev->fast_off_timer, dev->fast_off_period);
smi_raise();
dev->regs[0xaa] |= 0x20;
}
@@ -513,6 +502,8 @@ sio_init(const device_t *info)
if (dev->id == 0x03) {
cpu_fast_off_val = dev->regs[0xa8];
cpu_fast_off_count = cpu_fast_off_val + 1;
cpu_fast_off_register(&dev->fast_off_timer);
} else
cpu_fast_off_val = cpu_fast_off_count = 0;