mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-07 02:50:58 +02:00
Fix AGB mixing – the bias should only be applied if the channel is connected to a terminal
This commit is contained in:
@@ -164,7 +164,7 @@ static void update_sample(GB_gameboy_t *gb, GB_channel_t index, int8_t value, un
|
|||||||
if (index == GB_WAVE) {
|
if (index == GB_WAVE) {
|
||||||
/* For some reason, channel 3 is inverted on the AGB, and has a different "silence" value */
|
/* For some reason, channel 3 is inverted on the AGB, and has a different "silence" value */
|
||||||
value ^= 0xF;
|
value ^= 0xF;
|
||||||
silence = 7;
|
silence = 7 * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t bias = agb_bias_for_channel(gb, index);
|
uint8_t bias = agb_bias_for_channel(gb, index);
|
||||||
@@ -173,8 +173,8 @@ static void update_sample(GB_gameboy_t *gb, GB_channel_t index, int8_t value, un
|
|||||||
bool right = gb->io_registers[GB_IO_NR51] & (1 << index);
|
bool right = gb->io_registers[GB_IO_NR51] & (1 << index);
|
||||||
|
|
||||||
GB_sample_t output = {
|
GB_sample_t output = {
|
||||||
.left = (0xF - (left? value : silence) * 2 + bias) * left_volume,
|
.left = (0xF - (left? value * 2 + bias : silence)) * left_volume,
|
||||||
.right = (0xF - (right? value : silence) * 2 + bias) * right_volume
|
.right = (0xF - (right? value * 2 + bias : silence)) * right_volume
|
||||||
};
|
};
|
||||||
|
|
||||||
if (unlikely(gb->apu_output.channel_muted[index])) {
|
if (unlikely(gb->apu_output.channel_muted[index])) {
|
||||||
|
Reference in New Issue
Block a user