Moved E-MU 8000 handling to the non-music handler.

This commit is contained in:
OBattler
2024-03-01 12:34:44 +01:00
parent 689f9b3d8e
commit 046a8655b5

View File

@@ -395,6 +395,7 @@ sb_get_buffer_sb16_awe32(int32_t *buffer, int len, void *priv)
{ {
sb_t *sb = (sb_t *) priv; sb_t *sb = (sb_t *) priv;
const sb_ct1745_mixer_t *mixer = &sb->mixer_sb16; const sb_ct1745_mixer_t *mixer = &sb->mixer_sb16;
int c_emu8k = 0;
double out_l = 0.0; double out_l = 0.0;
double out_r = 0.0; double out_r = 0.0;
double bass_treble; double bass_treble;
@@ -405,6 +406,14 @@ sb_get_buffer_sb16_awe32(int32_t *buffer, int len, void *priv)
out_l = 0.0; out_l = 0.0;
out_r = 0.0; out_r = 0.0;
if (sb->dsp.sb_type > SB16)
c_emu8k = ((((c / 2) * FREQ_44100) / MUSIC_FREQ) * 2);
if (sb->dsp.sb_type > SB16) {
out_l += (((double) sb->emu8k.buffer[c_emu8k]) * mixer->fm_l);
out_r += (((double) sb->emu8k.buffer[c_emu8k + 1]) * mixer->fm_r);
}
if (mixer->output_filter) { if (mixer->output_filter) {
/* We divide by 3 to get the volume down to normal. */ /* We divide by 3 to get the volume down to normal. */
out_l += (low_fir_sb16(0, 0, (double) sb->dsp.buffer[c]) * mixer->voice_l) / 3.0; out_l += (low_fir_sb16(0, 0, (double) sb->dsp.buffer[c]) * mixer->voice_l) / 3.0;
@@ -460,6 +469,9 @@ sb_get_buffer_sb16_awe32(int32_t *buffer, int len, void *priv)
} }
sb->dsp.pos = 0; sb->dsp.pos = 0;
if (sb->dsp.sb_type > SB16)
sb->emu8k.pos = 0;
} }
static void static void
@@ -468,7 +480,6 @@ sb_get_music_buffer_sb16_awe32(int32_t *buffer, int len, void *priv)
sb_t *sb = (sb_t *) priv; sb_t *sb = (sb_t *) priv;
const sb_ct1745_mixer_t *mixer = &sb->mixer_sb16; const sb_ct1745_mixer_t *mixer = &sb->mixer_sb16;
int dsp_rec_pos = sb->dsp.record_pos_write; int dsp_rec_pos = sb->dsp.record_pos_write;
int c_emu8k = 0;
int c_record; int c_record;
int32_t in_l; int32_t in_l;
int32_t in_r; int32_t in_r;
@@ -487,19 +498,11 @@ sb_get_music_buffer_sb16_awe32(int32_t *buffer, int len, void *priv)
out_l = 0.0; out_l = 0.0;
out_r = 0.0; out_r = 0.0;
if (sb->dsp.sb_type > SB16)
c_emu8k = ((((c / 2) * FREQ_44100) / MUSIC_FREQ) * 2);
if (sb->opl_enabled) { if (sb->opl_enabled) {
out_l = ((double) opl_buf[c]) * mixer->fm_l * 0.7171630859375; out_l = ((double) opl_buf[c]) * mixer->fm_l * 0.7171630859375;
out_r = ((double) opl_buf[c + 1]) * mixer->fm_r * 0.7171630859375; out_r = ((double) opl_buf[c + 1]) * mixer->fm_r * 0.7171630859375;
} }
if (sb->dsp.sb_type > SB16) {
out_l += (((double) sb->emu8k.buffer[c_emu8k]) * mixer->fm_l);
out_r += (((double) sb->emu8k.buffer[c_emu8k + 1]) * mixer->fm_r);
}
/* TODO: Multi-recording mic with agc/+20db, CD, and line in with channel inversion */ /* TODO: Multi-recording mic with agc/+20db, CD, and line in with channel inversion */
in_l = (mixer->input_selector_left & INPUT_MIDI_L) ? ((int32_t) out_l) : 0 + (mixer->input_selector_left & INPUT_MIDI_R) ? ((int32_t) out_r) in_l = (mixer->input_selector_left & INPUT_MIDI_L) ? ((int32_t) out_l) : 0 + (mixer->input_selector_left & INPUT_MIDI_R) ? ((int32_t) out_r)
: 0; : 0;
@@ -576,9 +579,6 @@ sb_get_music_buffer_sb16_awe32(int32_t *buffer, int len, void *priv)
if (sb->opl_enabled) if (sb->opl_enabled)
sb->opl.reset_buffer(sb->opl.priv); sb->opl.reset_buffer(sb->opl.priv);
if (sb->dsp.sb_type > SB16)
sb->emu8k.pos = 0;
} }
void void