newVolumeScaling, part 4 (final)

This commit is contained in:
tildearrow 2022-06-01 18:27:06 -05:00
parent ad1ed7fe35
commit 2da92b0433
7 changed files with 6 additions and 8 deletions

View file

@ -3,8 +3,6 @@
- additional YM2612 features - additional YM2612 features
- CSM - CSM
- MSM6258 pitch and clock select - MSM6258 pitch and clock select
- the last compat flags
- newVolumeScaling
- collapse/expand pattern and song - collapse/expand pattern and song
- Game Boy envelope macro/sequence - Game Boy envelope macro/sequence
- rewrite the system name detection function anyway - rewrite the system name detection function anyway

View file

@ -139,7 +139,7 @@ void DivPlatformFDS::tick(bool sysTick) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
// ok, why are the volumes like that? // ok, why are the volumes like that?
chan[i].outVol=MIN(32,chan[i].std.vol.val)-(32-MIN(32,chan[i].vol)); chan[i].outVol=VOL_SCALE_LINEAR_BROKEN(chan[i].vol,chan[i].std.vol.val,32);
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
rWrite(0x4080,0x80|chan[i].outVol); rWrite(0x4080,0x80|chan[i].outVol);
} }

View file

@ -107,7 +107,7 @@ void DivPlatformMMC5::tick(bool sysTick) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
// ok, why are the volumes like that? // ok, why are the volumes like that?
chan[i].outVol=MIN(15,chan[i].std.vol.val)-(15-(chan[i].vol&15)); chan[i].outVol=VOL_SCALE_LINEAR_BROKEN(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15);
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
rWrite(0x5000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6)); rWrite(0x5000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
} }

View file

@ -230,7 +230,7 @@ void DivPlatformNES::tick(bool sysTick) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
// ok, why are the volumes like that? // ok, why are the volumes like that?
chan[i].outVol=MIN(15,chan[i].std.vol.val)-(15-(chan[i].vol&15)); chan[i].outVol=VOL_SCALE_LINEAR_BROKEN(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15);
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (i==2) { // triangle if (i==2) { // triangle
rWrite(0x4000+i*4,(chan[i].outVol==0)?0:255); rWrite(0x4000+i*4,(chan[i].outVol==0)?0:255);

View file

@ -154,7 +154,7 @@ void DivPlatformPCE::tick(bool sysTick) {
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
chan[i].outVol=((chan[i].vol&31)*MIN(31,chan[i].std.vol.val))>>5; chan[i].outVol=VOL_SCALE_LOG(chan[i].vol&31,MIN(31,chan[i].std.vol.val),31);
if (chan[i].furnaceDac && chan[i].pcm) { if (chan[i].furnaceDac && chan[i].pcm) {
// ignore for now // ignore for now
} else { } else {

View file

@ -136,7 +136,7 @@ void DivPlatformSAA1099::tick(bool sysTick) {
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
chan[i].outVol=MIN(15,chan[i].std.vol.val)-(15-(chan[i].vol&15)); chan[i].outVol=VOL_SCALE_LINEAR_BROKEN(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15);
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (isMuted[i]) { if (isMuted[i]) {
rWrite(i,0); rWrite(i,0);

View file

@ -88,7 +88,7 @@ void DivPlatformTIA::tick(bool sysTick) {
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
chan[i].outVol=MIN(15,chan[i].std.vol.val)-(15-(chan[i].vol&15)); chan[i].outVol=VOL_SCALE_LINEAR_BROKEN(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15);
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (isMuted[i]) { if (isMuted[i]) {
rWrite(0x19+i,0); rWrite(0x19+i,0);