More of the same

This commit is contained in:
Lior Halphon 2023-06-21 21:49:23 +03:00
parent 207851bc56
commit 1b50856dcf
1 changed files with 2 additions and 2 deletions

View File

@ -729,7 +729,7 @@ void GB_apu_run(GB_gameboy_t *gb, bool force)
update_square_sample(gb, i);
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) {
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;
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:
return gb->apu.noise_channel.current_volume;