mirror of https://github.com/LIJI32/SameBoy.git
More of the same
This commit is contained in:
parent
207851bc56
commit
1b50856dcf
|
@ -729,7 +729,7 @@ void GB_apu_run(GB_gameboy_t *gb, bool force)
|
||||||
update_square_sample(gb, i);
|
update_square_sample(gb, i);
|
||||||
|
|
||||||
uint8_t duty = gb->io_registers[i == GB_SQUARE_1? GB_IO_NR11 :GB_IO_NR21] >> 6;
|
uint8_t duty = gb->io_registers[i == GB_SQUARE_1? GB_IO_NR11 :GB_IO_NR21] >> 6;
|
||||||
uint8_t edge_sample_index = (const uint8_t[]){7, 7, 5, 1}[duty];
|
uint8_t edge_sample_index = inline_const(uint8_t[], {7, 7, 5, 1})[duty];
|
||||||
if (gb->apu.square_channels[i].current_sample_index == edge_sample_index) {
|
if (gb->apu.square_channels[i].current_sample_index == edge_sample_index) {
|
||||||
gb->apu_output.edge_triggered[i] = true;
|
gb->apu_output.edge_triggered[i] = true;
|
||||||
}
|
}
|
||||||
|
@ -1770,7 +1770,7 @@ uint8_t GB_get_channel_volume(GB_gameboy_t *gb, GB_channel_t channel)
|
||||||
return gb->apu.square_channels[channel].current_volume;
|
return gb->apu.square_channels[channel].current_volume;
|
||||||
|
|
||||||
case GB_WAVE:
|
case GB_WAVE:
|
||||||
return (const uint8_t[]){0xF, 8, 4, 0, 0}[gb->apu.wave_channel.shift];
|
return inline_const(uint8_t[], {0xF, 8, 4, 0, 0})[gb->apu.wave_channel.shift];
|
||||||
|
|
||||||
case GB_NOISE:
|
case GB_NOISE:
|
||||||
return gb->apu.noise_channel.current_volume;
|
return gb->apu.noise_channel.current_volume;
|
||||||
|
|
Loading…
Reference in New Issue