There is a lot of spread out information about the APU DMC on the web, and I've been reading up about it. It seems like there is quite a lot of side effects and restrictions to using it, so I figured I'd ask some questions here to clarify.
I'm using the MMC5, setup in PRG mode 3 so that I can switch the PRG bank pages $6000, $8000, $A000, $C000, and $E000.
1. The DMC can only read data from address $C000 (and onwards). At first I figured that means I gotta dedicate the $C000 page for DMC samples, as bankswitching it around for game logic and such would cause corruption in the sound. But then I realized that the last page $E000 where I have my vectors, NMI, IRQ, etc, is actually bank-switchable (but usually best left alone to avoid certain death when the vblank occurs).
But, if I just make sure to clone my vectors and their subroutines at the bottom of the $E000 page, then I can create several ROM banks (at base $E000) with different DMC samples and switch between them freely to play the different samples. The advantage being that I've only locked down one PRG bank page instead of two. Am I correct in this?
2. According to the NESTechFAQ, the DMC freezes your CPU whenever it's using the DMA to fetch out more sample data. Normally this isn't an issue, but if you are doing time critical stuff it can cause trouble. So from my understanding it could potentially eat up some of my vblank time, or it could trigger in my IRQ to mess up my funky scrolling effects. I've been thinking about ways to avoid as much of this problem as possible.
A. Is there some way to temporarily stop the DMC from fetching new samples without stopping playback entirely?
B. If the DMC playback is stopped, is it possible to start it again where it left off?
C. Is the DMC's fetching rate's so deterministic so that you can know roughly where it usually occurs?
I'm using the MMC5, setup in PRG mode 3 so that I can switch the PRG bank pages $6000, $8000, $A000, $C000, and $E000.
1. The DMC can only read data from address $C000 (and onwards). At first I figured that means I gotta dedicate the $C000 page for DMC samples, as bankswitching it around for game logic and such would cause corruption in the sound. But then I realized that the last page $E000 where I have my vectors, NMI, IRQ, etc, is actually bank-switchable (but usually best left alone to avoid certain death when the vblank occurs).
But, if I just make sure to clone my vectors and their subroutines at the bottom of the $E000 page, then I can create several ROM banks (at base $E000) with different DMC samples and switch between them freely to play the different samples. The advantage being that I've only locked down one PRG bank page instead of two. Am I correct in this?
2. According to the NESTechFAQ, the DMC freezes your CPU whenever it's using the DMA to fetch out more sample data. Normally this isn't an issue, but if you are doing time critical stuff it can cause trouble. So from my understanding it could potentially eat up some of my vblank time, or it could trigger in my IRQ to mess up my funky scrolling effects. I've been thinking about ways to avoid as much of this problem as possible.
A. Is there some way to temporarily stop the DMC from fetching new samples without stopping playback entirely?
B. If the DMC playback is stopped, is it possible to start it again where it left off?
C. Is the DMC's fetching rate's so deterministic so that you can know roughly where it usually occurs?