Hey guys, I have been trying to play a song in PCM (yes, in PCM; I'm preparing an "easter egg", and of course, can't be in CDDA).
The song takes actually 1024 KB.
I tried to get rid of this by loading a 32kb portion to somewhere in RAM, and another 32kb portion to other place; once a portion finished playing, I try to play the other portion, meanwhile the first one reloads other data, and once it finish playing the second, goes back to the first portion while the second reloads new data.
I tried to do this using an example code a friend gave me, which he told is taken from the 32xDdk.
The first times I tried it, had a lag when going from one portion to another.
After I thought I fixed it, the transitions between the two portions failed in gens.
Any idea about how to do this?
The code (most of the uncommented code before InitPCM is unknown for me):
http://pastebin.com/a8mqCZqk
Thank you very much, and excuse my terrible english.
A question regarding the PCM
Moderator: Mask of Destiny
-
- Very interested
- Posts: 616
- Joined: Thu Nov 30, 2006 6:30 am
I don't see where you setup the next chunk in the linked code. It looks to me like you just load up the first 64K of the sample, start playing it and then loop forever without ever loading more data in to PCM RAM.
That said, I think you're making this more complicated than it needs to be. It's been a while since I last did anything with the PCM chip, but I'm pretty sure playback will loop around back to PCM RAM address 0 when the counter overflows. So you shouldn't need to mess around with LSL and LSH and the 0xFF stop byte until you get to the end of the sample.
That said, I think you're making this more complicated than it needs to be. It's been a while since I last did anything with the PCM chip, but I'm pretty sure playback will loop around back to PCM RAM address 0 when the counter overflows. So you shouldn't need to mess around with LSL and LSH and the 0xFF stop byte until you get to the end of the sample.