Fixed AGB audio regression
This commit is contained in:
parent
ee03b1e433
commit
56b14c67aa
@ -1130,7 +1130,6 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
|
||||
pending_console_output = nil;
|
||||
}
|
||||
[console_output_lock unlock];
|
||||
|
||||
}
|
||||
|
||||
- (void) log: (const char *) string withAttributes: (GB_log_attributes) attributes
|
||||
|
11
Core/apu.c
11
Core/apu.c
@ -73,8 +73,6 @@ static void update_sample(GB_gameboy_t *gb, unsigned index, int8_t value, unsign
|
||||
value ^= 0xF;
|
||||
}
|
||||
|
||||
if (value == 0 && gb->apu.samples[index] == 0) return;
|
||||
|
||||
if (gb->model >= GB_MODEL_AGB) {
|
||||
/* On the AGB, because no analog mixing is done, the behavior of NR51 is a bit different.
|
||||
A channel that is not connected to a terminal is idenitcal to a connected channel
|
||||
@ -111,6 +109,8 @@ static void update_sample(GB_gameboy_t *gb, unsigned index, int8_t value, unsign
|
||||
return;
|
||||
}
|
||||
|
||||
if (value == 0 && gb->apu.samples[index] == 0) return;
|
||||
|
||||
if (!GB_apu_is_DAC_enabled(gb, index)) {
|
||||
value = gb->apu.samples[index];
|
||||
}
|
||||
@ -283,7 +283,12 @@ static void render(GB_gameboy_t *gb)
|
||||
|
||||
static void update_square_sample(GB_gameboy_t *gb, unsigned index)
|
||||
{
|
||||
if (gb->apu.square_channels[index].sample_surpressed) return;
|
||||
if (gb->apu.square_channels[index].sample_surpressed) {
|
||||
if (gb->model >= GB_MODEL_AGB) {
|
||||
update_sample(gb, index, gb->apu.samples[index], 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t duty = gb->io_registers[index == GB_SQUARE_1? GB_IO_NR11 :GB_IO_NR21] >> 6;
|
||||
update_sample(gb, index,
|
||||
|
Loading…
Reference in New Issue
Block a user