From 70e96409c3067835ad08e8d7073bf36a660682e1 Mon Sep 17 00:00:00 2001 From: EkeEke Date: Sun, 15 Jul 2012 17:41:09 +0200 Subject: [PATCH] .added configurable size alignment for sound samples buffer --- source/gx/osd.h | 2 ++ source/system.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/gx/osd.h b/source/gx/osd.h index 9c46b20..ebeb2ba 100644 --- a/source/gx/osd.h +++ b/source/gx/osd.h @@ -54,6 +54,8 @@ #define CD_BRAM_JP "/genplus/saves/cd/scd_J.brm" #define CART_BRAM "/genplus/saves/cd/cart.brm" +#define ALIGN_SND 0xfffff8 /* 32 bytes aligned sound buffers (8 samples alignment) */ + /*************************************************/ #ifdef HW_RVL diff --git a/source/system.c b/source/system.c index fe4502e..87c8967 100644 --- a/source/system.c +++ b/source/system.c @@ -178,8 +178,10 @@ int audio_update(int16 *buffer) /* get number of available samples */ int size = sound_update(mcycles_vdp); - /* return an aligned number of samples */ - size &= ~7; +#ifdef ALIGN_SND + /* return an aligned number of samples if necessary*/ + size &= ALIGN_SND; +#endif if (config.hq_fm) {