mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 01:25:33 -07:00
Merge pull request #6531 from win2kgamer/audio-wrapup-5.3
Minor audio changes
This commit is contained in:
19
src/config.c
19
src/config.c
@@ -740,6 +740,25 @@ load_sound(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Correct Aztech codec selection in old configs so the OPTi 930 AD1848 type isn't selected */
|
||||
for (int i = 0; i < (sizeof(sound_card_current) / sizeof(sound_card_current[0])); i++) {
|
||||
sprintf(temp, "Aztech Sound Galaxy Pro 16 AB (Washington) #%i", i + 1);
|
||||
ini_section_t c = ini_find_section(config, temp);
|
||||
if (c != NULL) {
|
||||
if (ini_section_get_int(c, "codec", 1) == 2)
|
||||
ini_section_set_int(c, "codec", 3);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < (sizeof(sound_card_current) / sizeof(sound_card_current[0])); i++) {
|
||||
sprintf(temp, "Aztech Sound Galaxy Nova 16 Extra (Clinton) #%i", i + 1);
|
||||
ini_section_t c = ini_find_section(config, temp);
|
||||
if (c != NULL) {
|
||||
if (ini_section_get_int(c, "codec", 1) == 2)
|
||||
ini_section_set_int(c, "codec", 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
memset(temp, '\0', sizeof(temp));
|
||||
p = ini_section_get_string(cat, "sound_type", "float");
|
||||
if (strlen(p) > 511)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -428,7 +428,7 @@ ymf701_init(const device_t *info)
|
||||
ymf701->sb->opl_mixer = ymf701;
|
||||
ymf701->sb->opl_mix = ymf701_filter_opl;
|
||||
|
||||
fm_driver_get(FM_YMF262, &ymf701->sb->opl);
|
||||
fm_driver_get(FM_YMF289B, &ymf701->sb->opl);
|
||||
io_sethandler(ymf701->cur_sb_addr + 0, 0x0004, ymf701->sb->opl.read, NULL, NULL, ymf701->sb->opl.write, NULL, NULL, ymf701->sb->opl.priv);
|
||||
io_sethandler(ymf701->cur_sb_addr + 8, 0x0002, ymf701->sb->opl.read, NULL, NULL, ymf701->sb->opl.write, NULL, NULL, ymf701->sb->opl.priv);
|
||||
io_sethandler(0x0388, 0x0004, ymf701->sb->opl.read, NULL, NULL, ymf701->sb->opl.write, NULL, NULL, ymf701->sb->opl.priv);
|
||||
|
||||
@@ -718,7 +718,7 @@ ymf71x_init(const device_t *info)
|
||||
ymf71x->sb->opl_mixer = ymf71x;
|
||||
ymf71x->sb->opl_mix = ymf71x_filter_opl;
|
||||
|
||||
fm_driver_get(FM_YMF262, &ymf71x->sb->opl);
|
||||
fm_driver_get(FM_YMF289B, &ymf71x->sb->opl);
|
||||
|
||||
sound_add_handler(ymf71x_get_buffer, ymf71x);
|
||||
music_add_handler(sb_get_music_buffer_sbpro, ymf71x->sb);
|
||||
|
||||
Reference in New Issue
Block a user