From d326017233f5650ef605939e63892e6267220395 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 19 Jun 2020 12:02:17 +0200 Subject: [PATCH] Added the Acer V30 and a number of IDE and AT keyboard changes needed to make it work, closes #367. --- src/device/keyboard_at.c | 50 +--------- src/disk/hdc_ide.c | 179 +++++++++++++++++++++------------- src/disk/hdc_ide_sff8038i.c | 1 + src/disk/mo.c | 2 +- src/disk/zip.c | 2 +- src/floppy/fdc.c | 2 +- src/include/86box/hdc_ide.h | 12 ++- src/include/86box/keyboard.h | 1 + src/include/86box/machine.h | 1 + src/machine/m_at_socket4_5.c | 32 ++++++ src/machine/m_at_socket7_s7.c | 4 +- src/machine/machine_table.c | 1 + src/scsi/scsi_cdrom.c | 2 +- 13 files changed, 169 insertions(+), 120 deletions(-) diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index 39895732d..ee5b0f496 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -1221,7 +1221,7 @@ write64_generic(void *priv, uint8_t val) } else { if (((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_NOREF) && ((dev->flags & KBC_VEN_MASK) != KBC_VEN_INTEL_AMI)) - add_data(dev, (dev->input_port | fixed_bits) & 0xef); + add_data(dev, (dev->input_port | fixed_bits) & (((dev->flags & KBC_VEN_MASK) == KBC_VEN_ACER) ? 0xeb : 0xef)); else add_data(dev, dev->input_port | fixed_bits); dev->input_port = ((dev->input_port + 1) & 3) | @@ -1268,40 +1268,6 @@ write64_generic(void *priv, uint8_t val) } -static uint8_t -write60_acer(void *priv, uint8_t val) -{ -#if 0 - atkbd_t *dev = (atkbd_t *)priv; - - switch(dev->command) { - case 0xc0: /* sent by Acer V30 BIOS */ - return 0; - } -#endif - - return 1; -} - - -static uint8_t -write64_acer(void *priv, uint8_t val) -{ - atkbd_t *dev = (atkbd_t *)priv; - - kbd_log("ACER: write64(%02x, %02x)\n", dev->command, val); - -#if 0 - switch (val) { - case 0xc0: /* sent by Acer V30 BIOS */ - return 0; - } -#endif - - return write64_generic(dev, val); -} - - static uint8_t write60_ami(void *priv, uint8_t val) { @@ -2335,7 +2301,7 @@ kbd_reset(void *priv) dev->key_wantdata = 0; /* Set up the correct Video Type bits. */ - if ((dev->flags & KBC_VEN_MASK) == KBC_VEN_XI8088) + if (((dev->flags & KBC_VEN_MASK) == KBC_VEN_XI8088) || ((dev->flags & KBC_VEN_MASK) == KBC_VEN_ACER)) dev->input_port = video_is_mda() ? 0xb0 : 0xf0; else dev->input_port = video_is_mda() ? 0xf0 : 0xb0; @@ -2414,6 +2380,7 @@ kbd_init(const device_t *info) dev->write64_ven = NULL; switch(dev->flags & KBC_VEN_MASK) { + case KBC_VEN_ACER: case KBC_VEN_GENERIC: case KBC_VEN_IBM_PS1: case KBC_VEN_XI8088: @@ -2439,11 +2406,6 @@ kbd_init(const device_t *info) dev->write60_ven = write60_toshiba; dev->write64_ven = write64_toshiba; break; - - case KBC_VEN_ACER: - dev->write60_ven = write60_acer; - dev->write64_ven = write64_acer; - break; } /* We need this, sadly. */ @@ -2593,14 +2555,10 @@ const device_t keyboard_ps2_intel_ami_pci_device = { NULL, NULL, NULL }; -const device_t keyboard_ps2_acer_device = { +const device_t keyboard_ps2_acer_pci_device = { "PS/2 Keyboard (Acer 90M002A)", DEVICE_PCI, -#ifdef KBC_VEN_ACER KBC_TYPE_PS2_NOREF | KBC_VEN_ACER, -#else - KBC_TYPE_PS2_NOREF | KBC_VEN_GENERIC, -#endif kbd_init, kbd_close, kbd_reset, diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 4312bf54e..5c40d1b69 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -118,6 +118,7 @@ typedef struct { diag, force_ata3; uint16_t base_main, side_main; pc_timer_t timer; + ide_t *ide[2]; } ide_board_t; typedef struct { @@ -129,7 +130,7 @@ typedef struct { static ide_board_t *ide_boards[4] = { NULL, NULL, NULL, NULL }; static ide_bm_t *ide_bm[4] = { NULL, NULL, NULL, NULL }; -static ide_t *ide_drives[IDE_NUM]; +ide_t *ide_drives[IDE_NUM]; int ide_ter_enabled = 0, ide_qua_enabled = 0; static void ide_atapi_callback(ide_t *ide); @@ -280,7 +281,7 @@ ide_irq_raise(ide_t *ide) ide_log("IDE %i: IRQ raise\n", ide->board); - if (!(ide->fdisk & 2)) { + if (!(ide->fdisk & 2) && ide->selected) { if (!ide_boards[ide->board]->force_ata3 && ide_bm[ide->board] && ide_bm[ide->board]->set_irq) ide_bm[ide->board]->set_irq(ide->board | 0x40, ide_bm[ide->board]->priv); else if (ide_boards[ide->board]->irq != -1) @@ -300,9 +301,9 @@ ide_irq_lower(ide_t *ide) /* ide_log("Lowering IRQ %i (board %i)\n", ide_boards[ide->board]->irq, ide->board); */ - ide_log("IDE %i: IRQ lower\n", ide->board); + // ide_log("IDE %i: IRQ lower\n", ide->board); - if (ide->irqstat) { + if (ide->irqstat && ide->selected) { if (!ide_boards[ide->board]->force_ata3 && ide_bm[ide->board] && ide_bm[ide->board]->set_irq) ide_bm[ide->board]->set_irq(ide->board, ide_bm[ide->board]->priv); else if (ide_boards[ide->board]->irq != -1) @@ -330,7 +331,7 @@ ide_irq_update(ide_t *ide) picintc(1 << ide_boards[ide->board]->irq); picint(1 << ide_boards[ide->board]->irq); } - } else if (ide->fdisk & 2) { + } else if ((ide->fdisk & 2) || !ide->irqstat) { ide_log("IDE %i: IRQ update lower\n", ide->board); if (!ide_boards[ide->board]->force_ata3 && ide_bm[ide->board] && ide_bm[ide->board]->set_irq) ide_bm[ide->board]->set_irq(ide->board, ide_bm[ide->board]->priv); @@ -819,6 +820,9 @@ ide_zero(int d) dev->atastat = DRDY_STAT | DSC_STAT; dev->service = 0; dev->board = d >> 1; + dev->selected = !(d & 1); + ide_boards[dev->board]->ide[d & 1] = dev; + timer_add(&dev->timer, ide_callback, dev, 0); } @@ -847,14 +851,31 @@ ide_atapi_attach(ide_t *ide) void -ide_set_callback(uint8_t board, double callback) +ide_set_callback(ide_t *ide, double callback) +{ + ide_log("ide_set_callback(%i)\n", ide->channel); + + if (!ide) { + ide_log("Set callback failed\n"); + return; + } + + if (callback == 0.0) + timer_stop(&ide->timer); + else + timer_on_auto(&ide->timer, callback); +} + + +void +ide_set_board_callback(uint8_t board, double callback) { ide_board_t *dev = ide_boards[board]; ide_log("ide_set_callback(%i)\n", board); if (!dev) { - ide_log("Set callback failed\n"); + ide_log("Set board callback failed\n"); return; } @@ -872,7 +893,7 @@ ide_atapi_command_bus(ide_t *ide) ide->sc->phase = 1; ide->sc->pos = 0; ide->sc->callback = 1.0 * IDE_TIME; - ide_set_callback(ide->board, ide->sc->callback); + ide_set_callback(ide, ide->sc->callback); } @@ -1008,7 +1029,7 @@ ide_atapi_pio_request(ide_t *ide, uint8_t out) dev->status = BSY_STAT; dev->phase = 1; ide_atapi_callback(ide); - ide_set_callback(ide->board >> 1, 0.0); + ide_set_callback(ide, 0.0); dev->request_pos = 0; } @@ -1164,9 +1185,9 @@ ide_write_data(ide_t *ide, uint32_t val, int length) ide->pos=0; ide->atastat = BSY_STAT; if (ide->command == WIN_WRITE_MULTIPLE) - ide_callback(ide_boards[ide->board]); + ide_callback(ide); else - ide_set_callback(ide->board, ide_get_period(ide, 512)); + ide_set_callback(ide, ide_get_period(ide, 512)); } } } @@ -1276,7 +1297,8 @@ ide_write_devctl(uint16_t addr, uint8_t val, void *priv) /* Reset toggled from 0 to 1, initiate reset procedure. */ if (ide->type == IDE_ATAPI) ide->sc->callback = 0.0; - ide_set_callback(ide->board, 0.0); + ide_set_callback(ide, 0.0); + ide_set_callback(ide_other, 0.0); } else if (!(val & 4) && (ide->fdisk & 4)) { /* Reset toggled from 1 to 0. */ if (!(ch & 1)) { @@ -1302,7 +1324,9 @@ ide_write_devctl(uint16_t addr, uint8_t val, void *priv) /* Fire the timer. */ dev->diag = 0; ide->reset = 1; - ide_set_callback(ide->board, 500 * IDE_TIME); + ide_set_callback(ide, 0.0); + ide_set_callback(ide_other, 0.0); + ide_set_board_callback(ide->board, 500 * IDE_TIME); } else { /* Currently active device is 1, simply reset the status and the active device. */ dev_reset(ide); @@ -1313,6 +1337,13 @@ ide_write_devctl(uint16_t addr, uint8_t val, void *priv) ide->sc->error = 1; } dev->cur_dev &= ~1; + ch = dev->cur_dev; + + ide = ide_drives[ch]; + ide->selected = 1; + + ide_other = ide_drives[ch ^ 1]; + ide_other->selected = 0; } } @@ -1418,6 +1449,12 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) ide_boards[ide->board]->cur_dev = ((val >> 4) & 1) + (ide->board << 1); ch = ide_boards[ide->board]->cur_dev; + ide = ide_drives[ch]; + ide->selected = 1; + + ide_other = ide_drives[ch ^ 1]; + ide_other->selected = 0; + if (ide->reset || ide_other->reset) { ide->atastat = ide_other->atastat = DRDY_STAT | DSC_STAT; ide->error = ide_other->error = 1; @@ -1445,11 +1482,11 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) ide_other->cylinder = 0xEB14; } - ide_set_callback(ide->board, 0.0); + ide_set_callback(ide, 0.0); + ide_set_callback(ide_other, 0.0); + ide_set_board_callback(ide->board, 0.0); return; } - - ide = ide_drives[ch]; } ide->head = val & 0xF; @@ -1482,7 +1519,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) if (ide->type == IDE_ATAPI) ide->sc->callback = 100.0 * IDE_TIME; - ide_set_callback(ide->board, 100.0 * IDE_TIME); + ide_set_callback(ide, 100.0 * IDE_TIME); return; } @@ -1494,7 +1531,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) } else ide->atastat = DRDY_STAT; - ide_set_callback(ide->board, 100.0 * IDE_TIME); + ide_set_callback(ide, 100.0 * IDE_TIME); return; case WIN_READ_MULTIPLE: @@ -1522,15 +1559,15 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) if (ide->type == IDE_HDD) { if ((val == WIN_READ_DMA) || (val == WIN_READ_DMA_ALT)) { if (ide->secount) - ide_set_callback(ide->board, ide_get_period(ide, (int) ide->secount << 9)); + ide_set_callback(ide, ide_get_period(ide, (int) ide->secount << 9)); else - ide_set_callback(ide->board, ide_get_period(ide, 131072)); + ide_set_callback(ide, ide_get_period(ide, 131072)); } else if (val == WIN_READ_MULTIPLE) - ide_set_callback(ide->board, 200.0 * IDE_TIME); + ide_set_callback(ide, 200.0 * IDE_TIME); else - ide_set_callback(ide->board, ide_get_period(ide, 512)); + ide_set_callback(ide, ide_get_period(ide, 512)); } else - ide_set_callback(ide->board, 200.0 * IDE_TIME); + ide_set_callback(ide, 200.0 * IDE_TIME); ide->do_initial_read = 1; return; @@ -1570,14 +1607,16 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) if ((ide->type == IDE_HDD) && ((val == WIN_WRITE_DMA) || (val == WIN_WRITE_DMA_ALT))) { if (ide->secount) - ide_set_callback(ide->board, ide_get_period(ide, (int) ide->secount << 9)); + ide_set_callback(ide, ide_get_period(ide, (int) ide->secount << 9)); else - ide_set_callback(ide->board, ide_get_period(ide, 131072)); + ide_set_callback(ide, ide_get_period(ide, 131072)); } else if ((ide->type == IDE_HDD) && ((val == WIN_VERIFY) || (val == WIN_VERIFY_ONCE))) - ide_set_callback(ide->board, ide_get_period(ide, 512)); + ide_set_callback(ide, ide_get_period(ide, 512)); + else if (val == WIN_IDENTIFY) + ide_callback(ide); else - ide_set_callback(ide->board, 200.0 * IDE_TIME); + ide_set_callback(ide, 200.0 * IDE_TIME); return; case WIN_FORMAT: @@ -1596,13 +1635,15 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) } else ide->atastat = BSY_STAT; - ide_set_callback(ide->board, 30.0 * IDE_TIME); + ide_set_callback(ide, 30.0 * IDE_TIME); return; case WIN_DRIVE_DIAGNOSTICS: /* Execute Drive Diagnostics */ dev->cur_dev &= ~1; ide = ide_drives[ch & ~1]; + ide->selected = 1; ide_other = ide_drives[ch | 1]; + ide_other->selected = 0; /* Device 0. */ dev_reset(ide); @@ -1625,7 +1666,9 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) /* Fire the timer. */ dev->diag = 1; ide->reset = 1; - ide_set_callback(ide->board, 200 * IDE_TIME); + ide_set_callback(ide, 0.0); + ide_set_callback(ide_other, 0.0); + ide_set_board_callback(ide->board, 200 * IDE_TIME); return; case WIN_PIDENTIFY: /* Identify Packet Device */ @@ -1640,7 +1683,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) ide->sc->status = BSY_STAT; else ide->atastat = BSY_STAT; - ide_callback(dev); + ide_callback(ide); return; case WIN_PACKETCMD: /* ATAPI Packet */ @@ -1654,7 +1697,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv) ide_irq_raise(ide); /* Interrupt DRQ, requires IRQ on any DRQ. */ } else { ide->atastat = BSY_STAT; - ide_set_callback(ide->board, 200.0 * IDE_TIME); + ide_set_callback(ide, 200.0 * IDE_TIME); ide->pos=0; } return; @@ -1738,9 +1781,9 @@ ide_read_data(ide_t *ide, int length) ide_next_sector(ide); ide->atastat = BSY_STAT | READY_STAT | DSC_STAT; if (ide->command == WIN_READ_MULTIPLE) - ide_callback(ide_boards[ide->board]); + ide_callback(ide); else - ide_set_callback(ide->board, ide_get_period(ide, 512)); + ide_set_callback(ide, ide_get_period(ide, 512)); } else if (ide->command != WIN_READ_MULTIPLE) ui_sb_update_icon(SB_HDD | hdd[ide->hdd_num].bus, 0); } @@ -1946,41 +1989,40 @@ ide_readl(uint16_t addr, void *priv) } +static void +ide_board_callback(void *priv) +{ + ide_board_t *dev = (ide_board_t *) priv; + +#ifdef ENABLE_IDE_LOG + ide_log("CALLBACK RESET\n"); +#endif + + dev->ide[0]->atastat = DRDY_STAT | DSC_STAT; + if (dev->ide[0]->type == IDE_ATAPI) + dev->ide[0]->sc->status = DRDY_STAT | DSC_STAT; + + dev->ide[1]->atastat = DRDY_STAT | DSC_STAT; + if (dev->ide[1]->type == IDE_ATAPI) + dev->ide[1]->sc->status = DRDY_STAT | DSC_STAT; + + dev->cur_dev &= ~1; + + if (dev->diag) { + dev->diag = 0; + ide_irq_raise(dev->ide[0]); + } +} + + static void ide_callback(void *priv) { - ide_t *ide, *ide_other; - int snum, ret = 0, ch; + int snum, ret = 0; - ide_board_t *dev = (ide_board_t *) priv; - ch = dev->cur_dev; + ide_t *ide = (ide_t *) priv; - ide = ide_drives[ch]; - ide_other = ide_drives[ch ^ 1]; - - if (ide->reset) { - ide_log("CALLBACK RESET %i %i\n", ide->reset,ch); - - ide->atastat = DRDY_STAT | DSC_STAT; - if (ide->type == IDE_ATAPI) - ide->sc->status = DRDY_STAT | DSC_STAT; - - ide_other->atastat = DRDY_STAT | DSC_STAT; - if (ide_other->type == IDE_ATAPI) - ide_other->sc->status = DRDY_STAT | DSC_STAT; - - dev->cur_dev &= ~1; - - if (dev->diag) { - dev->diag = 0; - ide_irq_raise(ide); - } - ide->reset = 0; - ide_set_callback(ide->board, 0.0); - return; - } - - ide_log("CALLBACK %02X %i %i\n", ide->command, ide->reset,ch); + ide_log("CALLBACK %02X %i %i\n", ide->command, ide->reset, ide->channel); if (((ide->command >= WIN_RECAL) && (ide->command <= 0x1F)) || ((ide->command >= WIN_SEEK) && (ide->command <= 0x7F))) { @@ -2099,7 +2141,7 @@ ide_callback(void *priv) if (ret == 2) { /* Bus master DMA disabled, simply wait for the host to enable DMA. */ ide->atastat = DRQ_STAT | DRDY_STAT | DSC_STAT; - ide_set_callback(ide->board, 6.0 * IDE_TIME); + ide_set_callback(ide, 6.0 * IDE_TIME); return; } else if (ret == 1) { /*DMA successful*/ @@ -2198,7 +2240,7 @@ ide_callback(void *priv) if (ret == 2) { /* Bus master DMA disabled, simply wait for the host to enable DMA. */ ide->atastat = DRQ_STAT | DRDY_STAT | DSC_STAT; - ide_set_callback(ide->board, 6.0 * IDE_TIME); + ide_set_callback(ide, 6.0 * IDE_TIME); return; } else if (ret == 1) { /*DMA successful*/ @@ -2513,6 +2555,9 @@ ide_board_close(int board) /* Close hard disk image files (if previously open) */ for (d = 0; d < 2; d++) { c = (board << 1) + d; + + ide_boards[board]->ide[d] = NULL; + dev = ide_drives[c]; if (dev == NULL) @@ -2623,7 +2668,7 @@ ide_board_init(int board, int irq, int base_main, int side_main, int type) ide_boards[board]->side_main = side_main; ide_set_handlers(board); - timer_add(&ide_boards[board]->timer, ide_callback, ide_boards[board], 0); + timer_add(&ide_boards[board]->timer, ide_board_callback, ide_boards[board], 0); ide_board_setup(board); @@ -2727,6 +2772,8 @@ ide_drive_reset(int d) ide_drives[d]->atastat = DRDY_STAT | DSC_STAT; ide_drives[d]->service = 0; ide_drives[d]->board = d >> 1; + ide_drives[d]->selected = !(d & 1); + timer_stop(&ide_drives[d]->timer); if (ide_boards[d >> 1]) { ide_boards[d >> 1]->cur_dev = d & ~1; diff --git a/src/disk/hdc_ide_sff8038i.c b/src/disk/hdc_ide_sff8038i.c index 7a1a043ad..6af33b4c7 100644 --- a/src/disk/hdc_ide_sff8038i.c +++ b/src/disk/hdc_ide_sff8038i.c @@ -36,6 +36,7 @@ #include <86box/mem.h> #include <86box/pci.h> #include <86box/pic.h> +#include <86box/timer.h> #include <86box/hdc.h> #include <86box/hdc_ide.h> #include <86box/hdc_ide_sff8038i.h> diff --git a/src/disk/mo.c b/src/disk/mo.c index 59bf031f8..7df757419 100644 --- a/src/disk/mo.c +++ b/src/disk/mo.c @@ -412,7 +412,7 @@ static void mo_set_callback(mo_t *dev) { if (dev->drv->bus_type != MO_BUS_SCSI) - ide_set_callback(dev->drv->ide_channel >> 1, dev->callback); + ide_set_callback(ide_drives[dev->drv->ide_channel], dev->callback); } diff --git a/src/disk/zip.c b/src/disk/zip.c index 5156ce95e..d1f89fff6 100644 --- a/src/disk/zip.c +++ b/src/disk/zip.c @@ -578,7 +578,7 @@ static void zip_set_callback(zip_t *dev) { if (dev->drv->bus_type != ZIP_BUS_SCSI) - ide_set_callback(dev->drv->ide_channel >> 1, dev->callback); + ide_set_callback(ide_drives[dev->drv->ide_channel], dev->callback); } diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 1b45f0128..44bea7b25 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -558,7 +558,7 @@ fdc_update_rate(fdc_t *fdc, int drive) break; } - fdc->bitcell_period = 1000000 / fdc->bit_rate * 2; /*Bitcell period in ns*/ + fdc->bitcell_period = (1000000 / fdc->bit_rate) * 2; /*Bitcell period in ns*/ } diff --git a/src/include/86box/hdc_ide.h b/src/include/86box/hdc_ide.h index b96379d1a..48b7c8939 100644 --- a/src/include/86box/hdc_ide.h +++ b/src/include/86box/hdc_ide.h @@ -29,7 +29,8 @@ enum #ifdef SCSI_DEVICE_H typedef struct ide_s { - uint8_t atastat, error, + uint8_t selected, + atastat, error, command, fdisk; int type, board, irqstat, service, @@ -49,6 +50,8 @@ typedef struct ide_s { uint16_t *buffer; uint8_t *sector_buffer; + pc_timer_t timer; + /* Stuff mostly used by ATAPI */ scsi_common_t *sc; int interrupt_drq; @@ -63,6 +66,8 @@ typedef struct ide_s { void (*command_stop)(scsi_common_t *sc); void (*bus_master_error)(scsi_common_t *sc); } ide_t; + +extern ide_t *ide_drives[IDE_NUM]; #endif /* Type: @@ -133,7 +138,10 @@ extern void ide_sec_disable(void); extern void ide_board_set_force_ata3(int board, int force_ata3); extern double ide_atapi_get_period(uint8_t channel); -extern void ide_set_callback(uint8_t channel, double callback); +#ifdef SCSI_DEVICE_H +extern void ide_set_callback(ide_t *ide, double callback); +#endif +extern void ide_set_board_callback(uint8_t board, double callback); extern void ide_padstr(char *str, const char *src, int len); extern void ide_padstr8(uint8_t *buf, int buf_size, const char *src); diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index d90fff256..e09ca2844 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -82,6 +82,7 @@ extern const device_t keyboard_ps2_quadtel_device; extern const device_t keyboard_ps2_pci_device; extern const device_t keyboard_ps2_ami_pci_device; extern const device_t keyboard_ps2_intel_ami_pci_device; +extern const device_t keyboard_ps2_acer_pci_device; #endif extern void keyboard_init(void); diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 98e1ad1d3..31ed9e28b 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -307,6 +307,7 @@ extern int machine_at_mb500n_init(const machine_t *); extern int machine_at_vectra54_init(const machine_t *); #endif extern int machine_at_powermate_v_init(const machine_t *); +extern int machine_at_acerv30_init(const machine_t *); #ifdef EMU_DEVICE_H extern const device_t *at_endeavor_get_device(void); diff --git a/src/machine/m_at_socket4_5.c b/src/machine/m_at_socket4_5.c index e49eec6dc..eb311d587 100644 --- a/src/machine/m_at_socket4_5.c +++ b/src/machine/m_at_socket4_5.c @@ -35,6 +35,7 @@ #include <86box/fdc.h> #include <86box/keyboard.h> #include <86box/intel_flash.h> +#include <86box/sst_flash.h> #include <86box/nvr.h> #include <86box/sio.h> #include <86box/video.h> @@ -457,3 +458,34 @@ machine_at_powermate_v_init(const machine_t *model) return ret; } + + +int +machine_at_acerv30_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/acerv30/V30R01N9.BIN", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3); + device_add(&i430fx_device); + device_add(&piix_device); + device_add(&keyboard_ps2_acer_pci_device); + device_add(&fdc37c665_device); + + device_add(&sst_flash_29ee010_device); + + return ret; +} diff --git a/src/machine/m_at_socket7_s7.c b/src/machine/m_at_socket7_s7.c index 8f6f82495..41ca9aa55 100644 --- a/src/machine/m_at_socket7_s7.c +++ b/src/machine/m_at_socket7_s7.c @@ -241,7 +241,7 @@ machine_at_acerm3a_init(const machine_t *model) device_add(&fdc37c932fr_device); device_add(&acerm3a_device); - device_add(&intel_flash_bxb_device); + device_add(&sst_flash_29ee010_device); return ret; } @@ -274,7 +274,7 @@ machine_at_acerv35n_init(const machine_t *model) device_add(&fdc37c932fr_device); device_add(&acerm3a_device); - device_add(&intel_flash_bxb_device); + device_add(&sst_flash_29ee010_device); return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 80f8fbf4b..e801a2342 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -241,6 +241,7 @@ const machine_t machines[] = { { "[i430NX] Gigabyte GA-586IP", "430nx", MACHINE_TYPE_SOCKET5, MACHINE_CPUS_PENTIUM_S5, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 2, 128, 2, 127, machine_at_430nx_init, NULL }, /* 430FX */ + { "[i430FX] Acer V30", "acerv30", MACHINE_TYPE_SOCKET5, MACHINE_CPUS_PENTIUM_S5, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_acerv30_init, NULL }, { "[i430FX] Gateway 2000 Zappa", "gw2kzp", MACHINE_TYPE_SOCKET5, MACHINE_CPUS_PENTIUM_S5, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 8, 128, 8, 127, machine_at_gw2kzp_init, NULL }, #if defined(DEV_BRANCH) && defined(USE_VECTRA54) { "[i430FX] HP Vectra VL 5 Series 4", "vectra54", MACHINE_TYPE_SOCKET5, MACHINE_CPUS_PENTIUM_S5, MACHINE_PCI | MACHINE_ISA | MACHINE_AT | MACHINE_HDC | MACHINE_PS2, 8, 128, 8, 511, machine_at_vectra54_init, NULL }, diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index e1c5248fb..8e1b5a55d 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -338,7 +338,7 @@ static void scsi_cdrom_set_callback(scsi_cdrom_t *dev) { if (dev && dev->drv && (dev->drv->bus_type != CDROM_BUS_SCSI)) - ide_set_callback(dev->drv->ide_channel >> 1, dev->callback); + ide_set_callback(ide_drives[dev->drv->ide_channel], dev->callback); }