mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
Implement the Aztech AZTPR16 audio controller (and other Aztech improvements) (#6673)
* Aztech: Clean up unused code and outdated comments, add a standard 86Box header comment and fix a warning in the logging code * Aztech: Implement gameport enable/disable for AZT1605 and AZT2316A * Aztech: Implement SBPro mixer restore from EEPROM for AZT2316A * Implement the Aztech Sound Galaxy Pro 16 (AZTPR16) sound card * AZTPR16: Right shift master volume by 1 during mixer update, fixes quiet audio in DOS WSS sound test * AZTPR16: Set the Panasonic CD-ROM bit in the config word, fixes CR56X.SYS on Packard Bell 141233 boot disk
This commit is contained in:
@@ -2,5 +2,7 @@
|
||||
#define SOUND_AZT2316A_H
|
||||
|
||||
extern void azt2316a_enable_wss(uint8_t enable, void *priv);
|
||||
extern void aztpr16_update_mixer(void *priv);
|
||||
extern void aztpr16_wss_mode(uint8_t mode, void *priv);
|
||||
|
||||
#endif /*SOUND_AZT2316A*/
|
||||
|
||||
@@ -8,16 +8,17 @@
|
||||
#define SB_SUBTYPE_CLONE_AZT2316A_0X11 1 /* Aztech Sound Galaxy Pro 16 AB, DSP 3.1 - SBPRO2 clone */
|
||||
#define SB_SUBTYPE_CLONE_AZT1605_0X0C 2 /* Aztech Sound Galaxy Nova 16 Extra /
|
||||
Packard Bell Forte 16, DSP 2.1 - SBPRO2 clone */
|
||||
#define SB_SUBTYPE_ESS_ES688 3 /* ESS Technology ES688 */
|
||||
#define SB_SUBTYPE_ESS_ES1688 4 /* ESS Technology ES1688 */
|
||||
#define SB_SUBTYPE_CLONE_AZTPR16_0X09 3 /* Aztech Sound Galaxy Pro 16 Extra */
|
||||
#define SB_SUBTYPE_ESS_ES688 4 /* ESS Technology ES688 */
|
||||
#define SB_SUBTYPE_ESS_ES1688 5 /* ESS Technology ES1688 */
|
||||
|
||||
/* ESS-related */
|
||||
#define IS_ESS(dsp) ((dsp)->sb_subtype >= SB_SUBTYPE_ESS_ES688) /* Check for future ESS cards here */
|
||||
#define IS_NOT_ESS(dsp) ((dsp)->sb_subtype < SB_SUBTYPE_ESS_ES688) /* Check for future ESS cards here */
|
||||
|
||||
/* aztech-related */
|
||||
#define IS_AZTECH(dsp) ((dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT2316A_0X11 || (dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT1605_0X0C) /* check for future AZT cards here */
|
||||
#define AZTECH_EEPROM_SIZE 16
|
||||
#define IS_AZTECH(dsp) ((dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT2316A_0X11 || (dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT1605_0X0C || (dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09) /* check for future AZT cards here */
|
||||
#define AZTECH_EEPROM_SIZE 36
|
||||
|
||||
typedef struct sb_dsp_t {
|
||||
int sb_type;
|
||||
|
||||
@@ -134,6 +134,7 @@ extern const device_t azt2316a_device;
|
||||
extern const device_t acermagic_s20_device;
|
||||
extern const device_t mirosound_pcm10_device;
|
||||
extern const device_t azt1605_device;
|
||||
extern const device_t aztpr16_device;
|
||||
|
||||
/* C-Media CMI8x38 */
|
||||
extern const device_t cmi8338_device;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -43,6 +43,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/snd_sb.h>
|
||||
#include <86box/plat_unused.h>
|
||||
#include <86box/snd_azt2316a.h>
|
||||
|
||||
#define SB_1 0
|
||||
#define SB_15 1
|
||||
@@ -863,6 +864,76 @@ sb_ct1345_mixer_write(uint16_t addr, uint8_t val, void *priv)
|
||||
mixer->regs[0x26] = mixer->regs[0x28] = 0xee;
|
||||
mixer->regs[0x2e] = 0x00;
|
||||
sb_dsp_set_stereo(&sb->dsp, mixer->regs[0x0e] & 2);
|
||||
} else if (sb->dsp.sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09) {
|
||||
mixer->regs[mixer->index] = val;
|
||||
sb_log("sb_ct1345: Register WRITE, AZTPR16: %02X\t%02X\n", mixer->index, mixer->regs[mixer->index]);
|
||||
aztpr16_update_mixer(sb->dsp.parent);
|
||||
|
||||
switch (mixer->index) {
|
||||
/* Compatibility: chain registers 0x02 and 0x22 as well as 0x06 and 0x26 */
|
||||
case 0x02:
|
||||
case 0x06:
|
||||
case 0x08:
|
||||
mixer->regs[mixer->index + 0x20] = ((val & 0xe) << 4) | (val & 0xe);
|
||||
break;
|
||||
|
||||
case 0x22:
|
||||
case 0x26:
|
||||
case 0x28:
|
||||
mixer->regs[mixer->index - 0x20] = (val & 0xe);
|
||||
break;
|
||||
|
||||
/* More compatibility:
|
||||
SoundBlaster Pro selects register 020h for 030h, 022h for 032h,
|
||||
026h for 036h, and 028h for 038h. */
|
||||
case 0x30:
|
||||
case 0x32:
|
||||
case 0x36:
|
||||
case 0x38:
|
||||
mixer->regs[mixer->index - 0x10] = (val & 0xee);
|
||||
break;
|
||||
|
||||
case 0x00:
|
||||
case 0x04:
|
||||
case 0x0a:
|
||||
case 0x0c:
|
||||
case 0x0e:
|
||||
case 0x2e:
|
||||
break;
|
||||
|
||||
/* Aztech AZTPR16 mixer */
|
||||
case 0x84:
|
||||
case 0x86:
|
||||
case 0x88:
|
||||
case 0x8a:
|
||||
case 0x8c:
|
||||
case 0x8e:
|
||||
case 0xa0:
|
||||
case 0xa2:
|
||||
case 0xa4:
|
||||
case 0xa6:
|
||||
case 0xa8:
|
||||
case 0xaa:
|
||||
case 0xac:
|
||||
case 0xae:
|
||||
case 0xc2:
|
||||
case 0xc4:
|
||||
case 0xc6:
|
||||
case 0xc8:
|
||||
case 0xca:
|
||||
case 0xcc:
|
||||
case 0xce:
|
||||
case 0xe0:
|
||||
case 0xe2:
|
||||
case 0xe4:
|
||||
case 0xe6:
|
||||
case 0xe8:
|
||||
break;
|
||||
|
||||
default:
|
||||
sb_log("sb_ct1345: Unknown register WRITE: %02X\t%02X\n", mixer->index, mixer->regs[mixer->index]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
mixer->regs[mixer->index] = val;
|
||||
|
||||
@@ -967,6 +1038,36 @@ sb_ct1345_mixer_read(uint16_t addr, void *priv)
|
||||
case 0x38:
|
||||
return mixer->regs[mixer->index];
|
||||
|
||||
/* Aztech AZTPR16 mixer */
|
||||
case 0x84:
|
||||
case 0x86:
|
||||
case 0x88:
|
||||
case 0x8a:
|
||||
case 0x8c:
|
||||
case 0x8e:
|
||||
case 0xa0:
|
||||
case 0xa2:
|
||||
case 0xa4:
|
||||
case 0xa6:
|
||||
case 0xa8:
|
||||
case 0xaa:
|
||||
case 0xac:
|
||||
case 0xae:
|
||||
case 0xc2:
|
||||
case 0xc4:
|
||||
case 0xc6:
|
||||
case 0xc8:
|
||||
case 0xca:
|
||||
case 0xcc:
|
||||
case 0xce:
|
||||
case 0xe0:
|
||||
case 0xe2:
|
||||
case 0xe4:
|
||||
case 0xe6:
|
||||
case 0xe8:
|
||||
if (sb->dsp.sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09)
|
||||
return mixer->regs[mixer->index];
|
||||
|
||||
default:
|
||||
sb_log("sb_ct1345: Unknown register READ: %02X\t%02X\n", mixer->index, mixer->regs[mixer->index]);
|
||||
break;
|
||||
|
||||
@@ -1287,6 +1287,8 @@ sb_exec_command(sb_dsp_t *dsp)
|
||||
sb_add_data(dsp, 0x11); /* AZTECH get type, WASHINGTON/latest - according to devkit. E.g.: The one in the Itautec Infoway Multimidia */
|
||||
else if ((dsp->sb_data[0] == 0x05 || dsp->sb_data[0] == 0x55) && dsp->sb_subtype == SB_SUBTYPE_CLONE_AZT1605_0X0C)
|
||||
sb_add_data(dsp, 0x0C); /* AZTECH get type, CLINTON - according to devkit. E.g.: The one in the Packard Bell Legend 100CD */
|
||||
else if ((dsp->sb_data[0] == 0x05 || dsp->sb_data[0] == 0x55) && dsp->sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09)
|
||||
sb_add_data(dsp, 0x09); /* AZTECH get type, AZTPR16 */
|
||||
else if (dsp->sb_data[0] == 0x08) {
|
||||
/* EEPROM address to write followed by byte */
|
||||
if (dsp->sb_data[1] < 0 || dsp->sb_data[1] >= AZTECH_EEPROM_SIZE)
|
||||
@@ -1307,6 +1309,9 @@ sb_exec_command(sb_dsp_t *dsp)
|
||||
/* HACK: Aztech HWSET seems to rely on RP being incremented for detection to work after EMUTSR is run */
|
||||
dsp->sb_read_rp++;
|
||||
break;
|
||||
} else if ((dsp->sb_data[0] == 0x0f) && (dsp->sb_data[1] == 0xff) && (dsp->sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09)) {
|
||||
sb_dsp_log("AZTPR16: Command 0x08, Subcommand 0x0f/0xff\n");
|
||||
sb_add_data(dsp, 0x80);
|
||||
} else
|
||||
sb_dsp_log("AZT2316A: UNKNOWN 0x08 COMMAND: %02X\n", dsp->sb_data[0]); /* 0x08 (when shutting down, driver tries to read 1 byte of response), 0x55, 0x0D, 0x08D seen */
|
||||
break;
|
||||
@@ -1324,6 +1329,9 @@ sb_exec_command(sb_dsp_t *dsp)
|
||||
} else if (dsp->sb_data[0] == 0x01) {
|
||||
sb_dsp_log("AZT2316A: SB8PROV2 MODE!\n");
|
||||
azt2316a_enable_wss(0, dsp->parent);
|
||||
} else if ((dsp->sb_data[0] == 0x0f) && (dsp->sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09)) {
|
||||
sb_dsp_log("AZTPR16: Mode switch command, params = %02X, %02X\n", dsp->sb_data[0], dsp->sb_data[1]);
|
||||
aztpr16_wss_mode(dsp->sb_data[1], dsp->parent);
|
||||
} else
|
||||
sb_dsp_log("AZT2316A: UNKNOWN MODE! = %02x\n", dsp->sb_data[0]); // sequences 0x02->0xFF, 0x04->0xFF seen
|
||||
}
|
||||
@@ -1738,6 +1746,9 @@ sb_exec_command(sb_dsp_t *dsp)
|
||||
} else if (dsp->sb_subtype == SB_SUBTYPE_CLONE_AZT1605_0X0C) {
|
||||
sb_add_data(dsp, 0x2);
|
||||
sb_add_data(dsp, 0x1);
|
||||
} else if (dsp->sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09) {
|
||||
sb_add_data(dsp, 0x2);
|
||||
sb_add_data(dsp, 0x1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1948,7 +1959,9 @@ sb_write(uint16_t addr, uint8_t val, void *priv)
|
||||
/* variable length commands */
|
||||
if (dsp->sb_command == 0x08 && dsp->sb_data_stat == 1 && dsp->sb_data[0] == 0x08)
|
||||
sb_commands[dsp->sb_command] = 3;
|
||||
else if (dsp->sb_command == 0x08 && dsp->sb_data_stat == 1 && dsp->sb_data[0] == 0x07)
|
||||
else if (dsp->sb_command == 0x08 && dsp->sb_data_stat == 1 && (dsp->sb_data[0] == 0x07 || dsp->sb_data[0] == 0x0f))
|
||||
sb_commands[dsp->sb_command] = 2;
|
||||
else if (dsp->sb_command == 0x09 && dsp->sb_data_stat == 1 && dsp->sb_data[0] == 0x0f)
|
||||
sb_commands[dsp->sb_command] = 2;
|
||||
}
|
||||
}
|
||||
@@ -1957,7 +1970,7 @@ sb_write(uint16_t addr, uint8_t val, void *priv)
|
||||
dsp->sb_data_stat = -1;
|
||||
if (IS_AZTECH(dsp)) {
|
||||
/* variable length commands */
|
||||
if (dsp->sb_command == 0x08)
|
||||
if (dsp->sb_command == 0x08 || dsp->sb_command == 0x09)
|
||||
sb_commands[dsp->sb_command] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ static const SOUND_CARD sound_cards[] = {
|
||||
{ &ad1816_device },
|
||||
{ &azt2316a_device },
|
||||
{ &azt1605_device },
|
||||
{ &aztpr16_device },
|
||||
{ &sb_goldfinch_device },
|
||||
{ &cs4232_device },
|
||||
{ &cs4235_device },
|
||||
|
||||
Reference in New Issue
Block a user