From 01ac6359fd029dbe028ba4f2f4e338cc0aedadf8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 9 Dec 2014 19:13:35 +0100 Subject: Get rid of gbc_sound_load_wave_ram macro --- sound.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sound.c b/sound.c index bd6e956..78a9daa 100644 --- a/sound.c +++ b/sound.c @@ -406,15 +406,6 @@ u32 gbc_sound_master_volume; gs->sample_index = sample_index; \ gs->tick_counter = tick_counter; \ -#define gbc_sound_load_wave_ram(bank) \ - wave_bank = wave_samples + (bank * 32); \ - for(i = 0, i2 = 0; i < 16; i++, i2 += 2) \ - { \ - current_sample = wave_ram[i]; \ - wave_bank[i2] = (((current_sample >> 4) & 0x0F) - 8); \ - wave_bank[i2 + 1] = ((current_sample & 0x0F) - 8); \ - } \ - void update_gbc_sound(u32 cpu_ticks) { fixed16_16 buffer_ticks = float_to_fp16_16((float)(cpu_ticks - @@ -464,10 +455,17 @@ void update_gbc_sound(u32 cpu_ticks) gs = gbc_sound_channel + 2; if(gbc_sound_wave_update) { - unsigned to_load_wave_bank = (gs->wave_bank == 1) ? 1 : 0; - gbc_sound_load_wave_ram(to_load_wave_bank); + unsigned bank = (gs->wave_bank == 1) ? 1 : 0; + + wave_bank = wave_samples + (bank * 32); + for(i = 0, i2 = 0; i < 16; i++, i2 += 2) + { + current_sample = wave_ram[i]; + wave_bank[i2] = (((current_sample >> 4) & 0x0F) - 8); + wave_bank[i2 + 1] = ((current_sample & 0x0F) - 8); + } - gbc_sound_wave_update = 0; + gbc_sound_wave_update = 0; } if((gs->active_flag) && (gs->master_enable)) -- cgit v1.2.3