restore mixer query

This commit is contained in:
Jonathan Campbell 2025-05-04 15:48:58 -07:00
parent c5d2fe2c02
commit 534b710606
2 changed files with 18 additions and 0 deletions

View File

@ -104,6 +104,14 @@ static struct {
bool mute;
} mixer;
uint32_t Mixer_MIXQ(void) {
return ((uint32_t)mixer.freq) |
((uint32_t)2u/*channels*/ << (uint32_t)20u) |
(mixer.swapstereo ? ((uint32_t)1u << (uint32_t)29u) : 0u) |
(mixer.mute ? ((uint32_t)1u << (uint32_t)30u) : 0u) |
(mixer.nosound ? 0u : ((uint32_t)1u << (uint32_t)31u));
}
uint8_t MixTemp[MIXER_BUFSIZE];
inline void MixerChannel::updateSlew(void) {

View File

@ -685,6 +685,7 @@ extern uint16_t countryNo;
bool bootvm = false, bootfast = false;
static std::string dosbox_int_debug_out;
uint32_t Mixer_MIXQ(void);
uint32_t VGA_QuerySizeIG(void);
/* read triggered, update the regsel */
@ -767,6 +768,15 @@ void dosbox_integration_trigger_read() {
dosbox_int_register = machine;
break;
case DOSBOX_ID_REG_MIXER_QUERY: /* query mixer output 'MIXQ' */
/* bits [19:0] = sample rate in Hz or 0 if mixer is not mixing AT ALL
* bits [23:20] = number of channels (at this time, always 2 aka stereo)
* bits [29:29] = 1=swap stereo 0=normal
* bits [30:30] = 1=muted 0=not muted
* bits [31:31] = 1=sound 0=nosound */
dosbox_int_register = Mixer_MIXQ();
break;
case 0x4B6F4400: // DOS kernel status
dosbox_int_register = dos_kernel_disabled ? 0: 1;
break;