mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 01:25:33 -07:00
Give the OPTi 931 its PnP quaternary IDE controller
This commit is contained in:
@@ -3010,6 +3010,36 @@ ide_pnp_config_changed_1addr(uint8_t ld, isapnp_device_config_t *config, void *p
|
||||
}
|
||||
}
|
||||
|
||||
/* OPTi 931 PnP ROM flips the main and side IDE I/O port ranges */
|
||||
void
|
||||
ide_pnp_config_changed_opti931(uint8_t ld, isapnp_device_config_t *config, void *priv)
|
||||
{
|
||||
intptr_t board = (intptr_t) priv;
|
||||
|
||||
if (ld)
|
||||
return;
|
||||
|
||||
if (ide_boards[board]->base[0] || ide_boards[board]->base[1]) {
|
||||
ide_remove_handlers(board);
|
||||
ide_boards[board]->base[0] = ide_boards[board]->base[1] = 0;
|
||||
}
|
||||
|
||||
ide_boards[board]->irq = -1;
|
||||
|
||||
if (config->activate) {
|
||||
ide_boards[board]->base[1] = (config->io[0].base != ISAPNP_IO_DISABLED) ?
|
||||
config->io[0].base : 0x0000;
|
||||
ide_boards[board]->base[0] = (config->io[1].base != ISAPNP_IO_DISABLED) ?
|
||||
config->io[1].base : 0x0000;
|
||||
|
||||
if (ide_boards[board]->base[0] && ide_boards[board]->base[1])
|
||||
ide_set_handlers(board);
|
||||
|
||||
if (config->irq[0].irq != ISAPNP_IRQ_DISABLED)
|
||||
ide_boards[board]->irq = config->irq[0].irq;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ide_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv)
|
||||
{
|
||||
|
||||
@@ -210,6 +210,7 @@ extern void ide_handlers(uint8_t board, int set);
|
||||
extern void ide_board_set_force_ata3(int board, int force_ata3);
|
||||
#ifdef EMU_ISAPNP_H
|
||||
extern void ide_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv);
|
||||
extern void ide_pnp_config_changed_opti931(uint8_t ld, isapnp_device_config_t *config, void *priv);
|
||||
extern void ide_pnp_config_changed_1addr(uint8_t ld, isapnp_device_config_t *config, void *priv);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/plat_unused.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/isapnp.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/log.h>
|
||||
|
||||
#define PNP_ROM_OPTI931 "roms/sound/opti931/adsrom.bin"
|
||||
@@ -889,7 +891,8 @@ opti931_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *pri
|
||||
optimc_log(optimc->log, "PnP Config changed\n");
|
||||
|
||||
switch (ld) {
|
||||
case 0: /* Aux Device */
|
||||
case 0: /* IDE CD-ROM */
|
||||
ide_pnp_config_changed_opti931(0, config, (void *) 3);
|
||||
break;
|
||||
case 1: /* WSS/OPL3/SBPro/Control regs */
|
||||
if (optimc->cur_wss_addr) {
|
||||
@@ -1155,6 +1158,11 @@ optimc_init(const device_t *info)
|
||||
/* Set up ISAPnP handlers to intercept Read Data port changes */
|
||||
io_sethandler(0x279, 0x0001, NULL, NULL, NULL, opti931_isapnp_write, NULL, NULL, optimc);
|
||||
io_sethandler(0xA79, 0x0001, NULL, NULL, NULL, opti931_isapnp_write, NULL, NULL, optimc);
|
||||
|
||||
/* Add ISAPnP quaternary IDE controller */
|
||||
device_add(&ide_qua_pnp_device);
|
||||
other_ide_present++;
|
||||
ide_remove_handlers(3);
|
||||
}
|
||||
|
||||
/* OPTi 930 DOS sound test utility starts DMA playback without setting a time constant likely making */
|
||||
|
||||
Reference in New Issue
Block a user