Added auxillary registers (used for line in and CD audio) to AdLib Gold mixer

This commit is contained in:
Ompronce
2022-01-20 13:12:28 -04:00
committed by GitHub
parent 0a8b93d58f
commit 415a98fa15

View File

@@ -60,6 +60,7 @@ typedef struct adgold_t
int fm_vol_l, fm_vol_r;
int samp_vol_l, samp_vol_r;
int aux_vol_l, aux_vol_r;
int vol_l, vol_r;
int treble, bass;
@@ -260,6 +261,14 @@ void adgold_write(uint16_t addr, uint8_t val, void *p)
adgold->adgold_38x_regs[0x0c] = val;
adgold->samp_vol_r = (int)(int8_t)(val - 128);
break;
case 0x0d: /*Aux volume left*/
adgold->adgold_38x_regs[0x0d] = val;
adgold->aux_vol_l = (int)(int8_t)(val - 128);
break;
case 0x0e: /*Aux volume right*/
adgold->adgold_38x_regs[0x0e] = val;
adgold->aux_vol_r = (int)(int8_t)(val - 128);
break;
case 0x18: /*Surround*/
adgold->adgold_38x_regs[0x18] = val;
@@ -810,6 +819,8 @@ static void adgold_get_buffer(int32_t *buffer, int len, void *p)
free(adgold_buffer);
}
/*CD audio filter goes here*/
static void adgold_input_msg(void *p, uint8_t *msg, uint32_t len)
{
@@ -899,6 +910,8 @@ void *adgold_init(const device_t *info)
adgold->fm_vol_r = (int)(int8_t)(adgold->adgold_eeprom[0x0a] - 128);
adgold->samp_vol_l = (int)(int8_t)(adgold->adgold_eeprom[0x0b] - 128);
adgold->samp_vol_r = (int)(int8_t)(adgold->adgold_eeprom[0x0c] - 128);
adgold->aux_vol_l = (int)(int8_t)(adgold->adgold_eeprom[0x0d] - 128);
adgold->aux_vol_r = (int)(int8_t)(adgold->adgold_eeprom[0x0e] - 128);
adgold->adgold_mma_enable[0] = 0;
adgold->adgold_mma_fifo_start[0] = adgold->adgold_mma_fifo_end[0] = 0;
@@ -913,6 +926,8 @@ void *adgold_init(const device_t *info)
sound_add_handler(adgold_get_buffer, adgold);
/*sound_set_cd_audio_filter(adgold_filter_cd_audio, adgold);*/
if (device_get_config_int("receive_input"))
midi_in_handler(1, adgold_input_msg, adgold_input_sysex, adgold);