![Phew :phew:](https://www.eevblog.com/forum/Smileys/default/phew.gif.pagespeed.ce.n2uLOVFYMP.gif)
OK, here we go. You'll need to test everything as my availability will be shrinking at the end of the month.
I configured the sound system in Dual YM2149 & Stereo mixer-filter mode.
PSG_a operates on address 0-15 and outputs channels A,B,C.
PSG_b operates on address 16-31 and outputs channels D,E,F.
The Left channel Mixer operates on address 128-143.
The Right channel Mixer operates on address 144-159.
These are each mixer's controls and their power-up defaults:
.RST_REGS ( '{ 64, 64, 64, 64, 64, 64, 0, 8'b00000000 , 3, 128, 128, 0, 0, 0, 0, 0 } )
VolA,VolB,VolC,VolD,VolE,VolF, n/a, INV{xxFEDCBA},bass,treb,mvol,n/a,n/a,n/a,n/a,n/a.
1) Volume A-F:
A volumes of 255 will output full amplitude for that channel, however, remember that there are normally 3 channels and usually having 3 on means if the PSG outputs full volume on all 3 voices, you will get distortion due to the impossible 300% required output waveform. For maximum distortion free output, you would want to set each volume to 33.3% of 256, IE: 85,85,85. Now, this leaves zero room for deliberate analog switching on and off 'POP' effect which you may want. Cutting this volume in half to 43,43,43 will guarantee every nuance and full amplitude of the effect matches an original analog circuit. Using values like 64,64,64 offers a middle ground givin you greater sample volume yet still offer most of that 'pop' effect. If you want to mix all 6 channels, A-F, then I would probably use 43,43,43,43,43,43.
Note that when changing volume, there will usually be a 'pop' effect due to the DC output nature of the YM2149 PSG. The only way to get rid of this is to ramp the volume figures up and down. All 6 channels may be ramped simultaneously and I recommend incrementing / decrementing 1 at a time, ~0.01-0.02 sec each step. Note that the invert waveform 'INV{F,E,D,C,B,A}' also will make a loud pop, so to prevent this, ramp down the volume of that or all channels down to 0, swap the INV bits you wish to, then ramp back up the volume. I recommend using Dolby-Pro-Logic 2 mixing factors for side and rear channels to generate your desired simulated surround wide stereo effect.
2) Bass : Supports 1 through 63. Upper bits are ignored. 0 allows DC through, so, do not use except for special circumstances. 1 has very low frequency support. I set the default to 3. 32 should have very little bass. This control can be freely changed without the worry of any 'pop' effect.
3) Treble : 255= unfiltered full bandwidth through. 128 = some really high frequency smoothing. 64= a bit softer. 0 = muffled. This control can be freely changed without the worry of any 'pop' effect.
4) MVol : Master volume. 128 = default full volume. 255= a 2x boost, signals over the edges here will be clipped. anything below 128 will just lower the volume by that 1/128 factor. Though this volume wont really pop like the individual volume channels A-F, it is still good practice to smoothly move it. I personally would leave it at 128 unless you need a headphone volume control for the DECA's line out.
Let me know how it goes. I could only visually see the PSG waveforms in Modelsim, so I did everything by eye.