Mercurial > sdl-ios-xcode
comparison src/audio/dc/aica.c @ 1461:11134dc42da8
Updated for Dreamcast KOS June 2005 snapshot:
http://cadcdev.sourceforge.net/svn/snapshots/
http://gamedev.allusion.net/softprj/kos/dcsetup.php
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 02 Mar 2006 13:16:02 +0000 |
parents | dad72daf44b3 |
children | 782fd950bd46 c121d94672cb |
comparison
equal
deleted
inserted
replaced
1460:d79e6b0c2c19 | 1461:11134dc42da8 |
---|---|
3 * | 3 * |
4 * (c)2000 Dan Potter | 4 * (c)2000 Dan Potter |
5 * modify BERO | 5 * modify BERO |
6 */ | 6 */ |
7 #include "aica.h" | 7 #include "aica.h" |
8 | |
9 #include <arch/irq.h> | |
10 #include <dc/spu.h> | |
8 | 11 |
9 /* #define dc_snd_base ((volatile unsigned char *)0x00800000) */ /* arm side */ | 12 /* #define dc_snd_base ((volatile unsigned char *)0x00800000) */ /* arm side */ |
10 #define dc_snd_base ((volatile unsigned char *)0xa0700000) /* dc side */ | 13 #define dc_snd_base ((volatile unsigned char *)0xa0700000) /* dc side */ |
11 | 14 |
12 /* Some convienence macros */ | 15 /* Some convienence macros */ |
35 irq_restore(OLD); \ | 38 irq_restore(OLD); \ |
36 } while(0) | 39 } while(0) |
37 | 40 |
38 | 41 |
39 void aica_init() { | 42 void aica_init() { |
40 int i, j, old; | 43 int i, j, old = 0; |
41 | 44 |
42 /* Initialize AICA channels */ | 45 /* Initialize AICA channels */ |
43 G2_LOCK(old); | 46 G2_LOCK(old); |
44 SNDREG32(0x2800) = 0x0000; | 47 SNDREG32(0x2800) = 0x0000; |
45 | 48 |
144 pan is a panning constant -- 0 is left, 128 is center, 255 is right. | 147 pan is a panning constant -- 0 is left, 128 is center, 255 is right. |
145 | 148 |
146 This routine (and the similar ones) owe a lot to Marcus' sound example -- | 149 This routine (and the similar ones) owe a lot to Marcus' sound example -- |
147 I hadn't gotten quite this far into dissecting the individual regs yet. */ | 150 I hadn't gotten quite this far into dissecting the individual regs yet. */ |
148 void aica_play(int ch,int mode,unsigned long smpptr,int loopst,int loopend,int freq,int vol,int pan,int loopflag) { | 151 void aica_play(int ch,int mode,unsigned long smpptr,int loopst,int loopend,int freq,int vol,int pan,int loopflag) { |
149 int i; | 152 /* int i; |
153 */ | |
150 int val; | 154 int val; |
151 int old; | 155 int old = 0; |
152 | 156 |
153 /* Stop the channel (if it's already playing) */ | 157 /* Stop the channel (if it's already playing) */ |
154 aica_stop(ch); | 158 aica_stop(ch); |
155 /* doesn't seem to be needed, but it's here just in case */ | 159 /* doesn't seem to be needed, but it's here just in case */ |
156 /* | 160 /* |