Skip to content

Commit

Permalink
A bit of ESS
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Mar 1, 2024
1 parent 2148734 commit 7a7313d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
5 changes: 5 additions & 0 deletions src/include/86box/snd_sb_dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#define SB_SUBTYPE_DEFAULT 0 /*Handle as a Creative card*/
#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 */

/* ESS-related */
#define IS_ESS(dsp) ((dsp)->sb_subtype >= SB_SUBTYPE_ESS_ES688)

/* 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 */
Expand Down
27 changes: 18 additions & 9 deletions src/sound/snd_sb_dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,17 +906,21 @@ sb_exec_command(sb_dsp_t *dsp)
dsp->sb_8_pause = 1;
break;
case 0xD1: /* Speaker on */
if (dsp->sb_type < SB15)
dsp->sb_8_pause = 1;
else if (dsp->sb_type < SB16)
dsp->muted = 0;
if (!IS_ESS(dsp)) {
if (dsp->sb_type < SB15)
dsp->sb_8_pause = 1;
else if (dsp->sb_type < SB16)
dsp->muted = 0;
}
dsp->sb_speaker = 1;
break;
case 0xD3: /* Speaker off */
if (dsp->sb_type < SB15)
dsp->sb_8_pause = 1;
else if (dsp->sb_type < SB16)
dsp->muted = 1;
if (!IS_ESS(dsp)) {
if (dsp->sb_type < SB15)
dsp->sb_8_pause = 1;
else if (dsp->sb_type < SB16)
dsp->muted = 1;
}
dsp->sb_speaker = 0;
break;
case 0xD4: /* Continue 8-bit DMA */
Expand Down Expand Up @@ -944,6 +948,11 @@ sb_exec_command(sb_dsp_t *dsp)
sb_add_data(dsp, ~dsp->sb_data[0]);
break;
case 0xE1: /* Get DSP version */
if (IS_ESS(dsp)) {
sb_add_data(dsp, 0x3);
sb_add_data(dsp, 0x1);
break;
}
if (IS_AZTECH(dsp)) {
if (dsp->sb_subtype == SB_SUBTYPE_CLONE_AZT2316A_0X11) {
sb_add_data(dsp, 0x3);
Expand Down Expand Up @@ -1036,7 +1045,7 @@ sb_write(uint16_t a, uint8_t v, void *priv)
sb_dsp_t *dsp = (sb_dsp_t *) priv;

/* Sound Blasters prior to Sound Blaster 16 alias the I/O ports. */
if (dsp->sb_type < SB16)
if (dsp->sb_type < SB16 && (!IS_ESS(dsp) || (IS_ESS(dsp) && ((a & 0xF) != 0xE))))
a &= 0xfffe;

switch (a & 0xF) {
Expand Down

0 comments on commit 7a7313d

Please sign in to comment.