diff --git a/src/engine/platform/ym2203.cpp b/src/engine/platform/ym2203.cpp index 53d2cfe06..913f84045 100644 --- a/src/engine/platform/ym2203.cpp +++ b/src/engine/platform/ym2203.cpp @@ -231,7 +231,7 @@ void DivPlatformYM2203::acquire_combo(short** buf, size_t len) { buf[0][h]=os; for (int i=0; i<3; i++) { - oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[i]<<1,-32768,32767); } for (int i=3; i<6; i++) { @@ -282,7 +282,8 @@ void DivPlatformYM2203::acquire_ymfm(short** buf, size_t len) { for (int i=0; i<3; i++) { - oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767); } for (int i=3; i<6; i++) { diff --git a/src/engine/platform/ym2608.cpp b/src/engine/platform/ym2608.cpp index 743cfab46..9ec5518b0 100644 --- a/src/engine/platform/ym2608.cpp +++ b/src/engine/platform/ym2608.cpp @@ -402,7 +402,7 @@ void DivPlatformYM2608::acquire_combo(short** buf, size_t len) { for (int i=0; idata[oscBuf[i]->needle++]=fm_nuked.ch_out[i]<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[i]<<1,-32768,32767); } ssge->get_last_out(ssgOut); @@ -471,7 +471,8 @@ void DivPlatformYM2608::acquire_ymfm(short** buf, size_t len) { buf[1][h]=os[1]; for (int i=0; i<6; i++) { - oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767); } ssge->get_last_out(ssgOut); diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index 173d882a6..01d5a3bb6 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -333,7 +333,7 @@ void DivPlatformYM2610::acquire_combo(short** buf, size_t len) { for (int i=0; idata[oscBuf[i]->needle++]=fm_nuked.ch_out[bchOffs[i]]<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[bchOffs[i]]<<1,-32768,32767); } ssge->get_last_out(ssgOut); @@ -404,7 +404,8 @@ void DivPlatformYM2610::acquire_ymfm(short** buf, size_t len) { buf[1][h]=os[1]; for (int i=0; idata[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767); } ssge->get_last_out(ssgOut); diff --git a/src/engine/platform/ym2610b.cpp b/src/engine/platform/ym2610b.cpp index 4f00a7761..1937abd62 100644 --- a/src/engine/platform/ym2610b.cpp +++ b/src/engine/platform/ym2610b.cpp @@ -401,7 +401,7 @@ void DivPlatformYM2610B::acquire_combo(short** buf, size_t len) { for (int i=0; idata[oscBuf[i]->needle++]=fm_nuked.ch_out[i]<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[i]<<1,-32768,32767); } ssge->get_last_out(ssgOut); @@ -471,7 +471,8 @@ void DivPlatformYM2610B::acquire_ymfm(short** buf, size_t len) { for (int i=0; idata[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1; + oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767); } ssge->get_last_out(ssgOut);