diff options
author | Michael Pavone <pavone@retrodev.com> | 2014-02-11 12:52:28 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2014-02-11 12:52:28 -0800 |
commit | 6ed58ab3da90a6987bf3b8d51c7db27ed1513460 (patch) | |
tree | 95911e4d14b5eaaf2dd0eee8adea8b6c3176acdf /ym2612.c | |
parent | 94a138521f2ac37d238ca75ee0a052587fcfad87 (diff) |
Adjust PSG and YM-2612 volume to be closer to the real console
Diffstat (limited to 'ym2612.c')
-rw-r--r-- | ym2612.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -232,7 +232,8 @@ void ym_init(ym2612_context * context, uint32_t sample_rate, uint32_t master_clo } } -#define YM_VOLUME_DIVIDER 2 +#define YM_VOLUME_MULTIPLIER 2 +#define YM_VOLUME_DIVIDER 3 #define YM_MOD_SHIFT 1 #define TIMER_A_MAX 1023 @@ -455,7 +456,7 @@ void ym_run(ym2612_context * context, uint32_t to_cycle) if (value & 0x2000) { value |= 0xC000; } - dfprintf(debug_file, "channel %d output: %d\n", channel, value / YM_VOLUME_DIVIDER); + dfprintf(debug_file, "channel %d output: %d\n", channel, (value * YM_VOLUME_MULTIPLIER) / YM_VOLUME_DIVIDER); } } //puts("operator update done"); @@ -485,10 +486,10 @@ void ym_run(ym2612_context * context, uint32_t to_cycle) fwrite(&value, sizeof(value), 1, context->channels[i].logfile); } if (context->channels[i].lr & 0x80) { - context->audio_buffer[context->buffer_pos] += value / YM_VOLUME_DIVIDER; + context->audio_buffer[context->buffer_pos] += (value * YM_VOLUME_MULTIPLIER) / YM_VOLUME_DIVIDER; } if (context->channels[i].lr & 0x40) { - context->audio_buffer[context->buffer_pos+1] += value / YM_VOLUME_DIVIDER; + context->audio_buffer[context->buffer_pos+1] += (value * YM_VOLUME_MULTIPLIER) / YM_VOLUME_DIVIDER; } } context->buffer_pos += 2; |