#49952 - wiz - Wed Aug 03, 2005 10:40 pm
Hello,
I'm following Deku's sound tutorial, which is really fantastic, but because I'm thick its taking a while for me to understand the first part (Timer and DMA)
For now there are 2 simple things I would like to clear up..
1) What *is* the _L and _H and _X representing on the reg defines? e.g. REG_SOUNDCNT_H (actually this is not a "sound" related question at all)
2) after a lot of messing and testing I have raw sound playing without any stopping in the code below:
I would like to know why its using DMA1, why not DMA2 - I havent set it up to use any... so whats all that about? whats telling it which to use? I dont like when things just work without knowing why or how. ;)
Thanks!!
p.s Deku if you read this, I think there is a small bug on page one.. on the line REG_TM0D = 65536 - (16777216 / soundFreq); <- I changed this to REG_TM1D for it to work.
I'm following Deku's sound tutorial, which is really fantastic, but because I'm thick its taking a while for me to understand the first part (Timer and DMA)
For now there are 2 simple things I would like to clear up..
1) What *is* the _L and _H and _X representing on the reg defines? e.g. REG_SOUNDCNT_H (actually this is not a "sound" related question at all)
2) after a lot of messing and testing I have raw sound playing without any stopping in the code below:
I would like to know why its using DMA1, why not DMA2 - I havent set it up to use any... so whats all that about? whats telling it which to use? I dont like when things just work without knowing why or how. ;)
Code: |
REG_SOUNDCNT_H = SOUNDA_TIMER1 | SOUNDA_VOLUME_100 | SOUNDA_LOUT | SOUNDA_ROUT | SOUNDA_FIFO_RESET; REG_SOUNDCNT_X = SOUND_ENABLE; REG_TM1D = 65536 - 800; REG_TM1CNT = TIMER_ENABLE; REG_DMA1SAD = (u32) (s8*)TestSndSample; REG_DMA1DAD = (u32) &(REG_FIFO_A_H); REG_DMA1CNT_H = DMA_DEST_FIXED | DMA_REPEAT | DMA_WORD | DMA_MODE_FIFO | DMA_ENABLE; |
Thanks!!
p.s Deku if you read this, I think there is a small bug on page one.. on the line REG_TM0D = 65536 - (16777216 / soundFreq); <- I changed this to REG_TM1D for it to work.