Added the AOpen AP61 and fixed floppies on the LG IBM 440 FX.
This commit is contained in:
@@ -215,8 +215,9 @@ static void
|
||||
w83787f_fdc_handler(w83787f_t *dev)
|
||||
{
|
||||
fdc_remove(dev->fdc);
|
||||
if (!(dev->regs[0] & 0x20) && !(dev->regs[6] & 0x08))
|
||||
if (!(dev->regs[0] & 0x20))
|
||||
fdc_set_base(dev->fdc, (dev->regs[0] & 0x10) ? FDC_PRIMARY_ADDR : FDC_SECONDARY_ADDR);
|
||||
fdc_set_power_down(dev->fdc, !!(dev->regs[6] & 0x08));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -258,10 +259,10 @@ w83787f_write(uint16_t port, uint8_t val, void *priv)
|
||||
return;
|
||||
} else {
|
||||
if (dev->locked) {
|
||||
if (dev->rw_locked)
|
||||
if (dev->rw_locked && (dev->cur_reg <= 0x0b))
|
||||
return;
|
||||
if (dev->cur_reg == 6)
|
||||
val &= 0xF3;
|
||||
val &= 0xFB;
|
||||
valxor = val ^ dev->regs[dev->cur_reg];
|
||||
dev->regs[dev->cur_reg] = val;
|
||||
} else
|
||||
@@ -363,7 +364,7 @@ w83787f_read(uint16_t port, void *priv)
|
||||
else if (port == 0x252) {
|
||||
if (dev->cur_reg == 7)
|
||||
ret = (fdc_get_rwc(dev->fdc, 0) | (fdc_get_rwc(dev->fdc, 1) << 2));
|
||||
else if (!dev->rw_locked)
|
||||
else if (!dev->rw_locked || (dev->cur_reg > 0x0b))
|
||||
ret = dev->regs[dev->cur_reg];
|
||||
}
|
||||
}
|
||||
@@ -406,6 +407,7 @@ w83787f_reset(w83787f_t *dev)
|
||||
dev->regs[0x00] = 0xd0;
|
||||
|
||||
fdc_reset(dev->fdc);
|
||||
w83787f_fdc_handler(dev);
|
||||
|
||||
dev->regs[0x01] = 0x2C;
|
||||
dev->regs[0x03] = 0x70;
|
||||
|
||||
@@ -78,12 +78,12 @@ w83877f_remap(w83877f_t *dev)
|
||||
{
|
||||
uint8_t hefras = HEFRAS;
|
||||
|
||||
io_removehandler(0x250, 0x0002,
|
||||
io_removehandler(0x250, 0x0003,
|
||||
w83877f_read, NULL, NULL, w83877f_write, NULL, NULL, dev);
|
||||
io_removehandler(FDC_PRIMARY_ADDR, 0x0002,
|
||||
w83877f_read, NULL, NULL, w83877f_write, NULL, NULL, dev);
|
||||
dev->base_address = (hefras ? FDC_PRIMARY_ADDR : 0x250);
|
||||
io_sethandler(dev->base_address, 0x0002,
|
||||
io_sethandler(dev->base_address, hefras ? 0x0002 : 0x0003,
|
||||
w83877f_read, NULL, NULL, w83877f_write, NULL, NULL, dev);
|
||||
dev->key_times = hefras + 1;
|
||||
dev->key = (hefras ? 0x86 : 0x88) | HEFERE;
|
||||
@@ -155,8 +155,9 @@ static void
|
||||
w83877f_fdc_handler(w83877f_t *dev)
|
||||
{
|
||||
fdc_remove(dev->fdc);
|
||||
if (!(dev->regs[6] & 0x08) && (dev->regs[0x20] & 0xc0))
|
||||
fdc_set_base(dev->fdc, FDC_PRIMARY_ADDR);
|
||||
if (dev->regs[0x20] & 0xc0)
|
||||
fdc_set_base(dev->fdc, make_port(dev, 0x20));
|
||||
fdc_set_power_down(dev->fdc, !!(dev->regs[6] & 0x08));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -252,7 +253,7 @@ w83877f_write(uint16_t port, uint8_t val, void *priv)
|
||||
if (dev->cur_reg == 0x29)
|
||||
return;
|
||||
if (dev->cur_reg == 6)
|
||||
val &= 0xF3;
|
||||
val &= 0xFB;
|
||||
valxor = val ^ dev->regs[dev->cur_reg];
|
||||
dev->regs[dev->cur_reg] = val;
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user