Applied all the mainline PCem PCI commits;

Applied patch from James-F that makes the Sound Blaster filters more accurate.
This commit is contained in:
OBattler
2017-06-02 01:38:25 +02:00
parent fde78d13f8
commit ab847fdecd
20 changed files with 649 additions and 204 deletions

View File

@@ -131,10 +131,10 @@ static __inline float high_cut_iir(int i, float NewSample) {
#undef NCoef
#define NCoef 1
#define NCoef 2
static __inline float sb_iir(int i, float NewSample) {
/* float ACoef[NCoef+1] = {
float ACoef[NCoef+1] = {
0.03356837051492005100,
0.06713674102984010200,
0.03356837051492005100
@@ -144,9 +144,9 @@ static __inline float sb_iir(int i, float NewSample) {
1.00000000000000000000,
-1.41898265221812010000,
0.55326988968868285000
};*/
};
float ACoef[NCoef+1] = {
/* float ACoef[NCoef+1] = {
0.17529642630084405000,
0.17529642630084405000
};
@@ -154,7 +154,8 @@ static __inline float sb_iir(int i, float NewSample) {
float BCoef[NCoef+1] = {
1.00000000000000000000,
-0.64940759319751051000
};
};*/
static float y[2][NCoef+1]; /* output samples */
static float x[2][NCoef+1]; /* input samples */
int n;

View File

@@ -88,8 +88,8 @@ void opl2_update2(opl_t *opl)
opl2_update(1, &opl->buffer[opl->pos*2 + 1], sound_pos_global - opl->pos);
for (; opl->pos < sound_pos_global; opl->pos++)
{
opl->filtbuf[0] = opl->buffer[opl->pos*2] = (opl->buffer[opl->pos*2] / 4) + ((opl->filtbuf[0] * 11) / 16);
opl->filtbuf[1] = opl->buffer[opl->pos*2+1] = (opl->buffer[opl->pos*2+1] / 4) + ((opl->filtbuf[1] * 11) / 16);
opl->filtbuf[0] = opl->buffer[opl->pos*2] = (opl->buffer[opl->pos*2] / 2);
opl->filtbuf[1] = opl->buffer[opl->pos*2+1] = (opl->buffer[opl->pos*2+1] / 2);
}
}
}
@@ -101,8 +101,8 @@ void opl3_update2(opl_t *opl)
opl3_update(0, &opl->buffer[opl->pos*2], sound_pos_global - opl->pos);
for (; opl->pos < sound_pos_global; opl->pos++)
{
opl->filtbuf[0] = opl->buffer[opl->pos*2] = (opl->buffer[opl->pos*2] / 4) + ((opl->filtbuf[0] * 11) / 16);
opl->filtbuf[1] = opl->buffer[opl->pos*2+1] = (opl->buffer[opl->pos*2+1] / 4) + ((opl->filtbuf[1] * 11) / 16);
opl->filtbuf[0] = opl->buffer[opl->pos*2] = (opl->buffer[opl->pos*2] / 2);
opl->filtbuf[1] = opl->buffer[opl->pos*2+1] = (opl->buffer[opl->pos*2+1] / 2);
}
}
}

View File

@@ -81,8 +81,8 @@ static void sb_get_buffer_opl2(int32_t *buffer, int len, void *p)
{
int32_t out_l, out_r;
out_l = ((sb->opl.buffer[c] * mixer->fm_l) >> 16);
out_r = ((sb->opl.buffer[c + 1] * mixer->fm_r) >> 16);
out_l = ((((sb->opl.buffer[c] * mixer->fm_l) >> 16) * 47000) >> 16);
out_r = ((((sb->opl.buffer[c + 1] * mixer->fm_r) >> 16) * 47000) >> 16);
if (sb->mixer.filter)
{
@@ -132,8 +132,8 @@ static void sb_get_buffer_opl3(int32_t *buffer, int len, void *p)
{
int32_t out_l, out_r;
out_l = ((sb->opl.buffer[c] * mixer->fm_l) >> 16);
out_r = ((sb->opl.buffer[c + 1] * mixer->fm_r) >> 16);
out_l = ((((sb->opl.buffer[c] * mixer->fm_l) >> 16) * 47000) >> 16);
out_r = ((((sb->opl.buffer[c + 1] * mixer->fm_r) >> 16) * 47000) >> 16);
if (sb->mixer.filter)
{