aboutsummaryrefslogtreecommitdiffstats
path: root/src/gba
diff options
context:
space:
mode:
Diffstat (limited to 'src/gba')
-rw-r--r--src/gba/gba.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gba/gba.h b/src/gba/gba.h
index 74b6942..8ba3de5 100644
--- a/src/gba/gba.h
+++ b/src/gba/gba.h
@@ -524,6 +524,23 @@ sound_volume(SoundChannel channels, u8 volume, u8 pan) {
524 return left | right; 524 return left | right;
525} 525}
526 526
527inline u16 dmg_stereo_vol(u8 vol) {
528 return vol | (vol << 0x4);
529}
530
531inline u16
532channel_vol(SoundChannel channel, s8 pan) {
533 u16 left = (channel << 0xc);
534 u16 right = (channel << 0x8);
535 if (pan == -1) {
536 return left;
537 }
538 if (pan == +1) {
539 return right;
540 }
541 return left | right;
542}
543
527// Sound Direct Sound master bits. 544// Sound Direct Sound master bits.
528#define SOUND_DMG25 0x0 545#define SOUND_DMG25 0x0
529#define SOUND_DMG50 0x1 546#define SOUND_DMG50 0x1