summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwinaphex2014-12-09 19:13:35 +0100
committertwinaphex2014-12-09 19:13:35 +0100
commit01ac6359fd029dbe028ba4f2f4e338cc0aedadf8 (patch)
tree41802b084e2901282c5ab21374c19e162f333fb6
parent109ba4d286bd2b6ff079347607571b6859c86199 (diff)
downloadpicogpsp-01ac6359fd029dbe028ba4f2f4e338cc0aedadf8.tar.gz
picogpsp-01ac6359fd029dbe028ba4f2f4e338cc0aedadf8.tar.bz2
picogpsp-01ac6359fd029dbe028ba4f2f4e338cc0aedadf8.zip
Get rid of gbc_sound_load_wave_ram macro
-rw-r--r--sound.c22
1 files 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))