10/31/2023: Localization News - Dead of the Brain 1!

No, NOT a trick, a Halloween treat! Presenting the Dead of the Brain 1 English patch by David Shadoff for the DEAD last official PC Engine CD game published by NEC before exiting the console biz in 1999! I helped edit/betatest and it's also a game I actually finished in 2023, yaaay! Shubibiman also did a French localization. github.com/dshadoff/DeadoftheBrain
twitter.com/NightWolve/PCENews
Main Menu

ADPCM question....

Started by OldRover, 06/11/2016, 09:01 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

OldRover

Been looking for documentation on this but haven't found much. Anyway, what I need to know is how many cycles need to pass between stopping ADPCM playback and starting a new one. They can't be used back-to-back on real hardware (works fine on emulators, naturally), so there is clearly some kind of latency issue I need to take into consideration. I can't test this for real as I don't have real hardware at the moment, so I figured one of y'all might know how much time I need to let pass before telling the ADPCM circuit to play another sample.
Turbo Badass Rank: Janne (6 of 12 clears)
Conquered so far: Sinistron, Violent Soldier, Tatsujin, Super Raiden, Shape Shifter, Rayxanber II

touko

i think the delay is short, may be less than 80 cycles .

TurboXray

According to the dev manual; "AD_STOP: Stop ADPCM playback. Since playback speed is about 16khz, a delay will occur before stopping. Check stop status through AD_STAT."

 Is this what you're doing? Polling AD_STAT call until clear to start another sample?

OldRover

Quote from: TurboXray on 06/11/2016, 11:05 AMAccording to the dev manual; "AD_STOP: Stop ADPCM playback. Since playback speed is about 16khz, a delay will occur before stopping. Check stop status through AD_STAT."

 Is this what you're doing? Polling AD_STAT call until clear to start another sample?
Actually, I was originally doing it the other way around, since I had no access to any kind of proper documentation. So basically I should use AD_STOP, and then poll AD_STAT until it returns a clear status. :D
Turbo Badass Rank: Janne (6 of 12 clears)
Conquered so far: Sinistron, Violent Soldier, Tatsujin, Super Raiden, Shape Shifter, Rayxanber II

TurboXray

That's what I've done. But.. might be a good idea to do a time out part of the loop, just in case for some reason response time/state is stuck(?). And try it next frame, if it falted out on the initial time out? Maybe I'm just paranoid, but I've seen CD games stall before.. I always wondered if it was cause of case scenarios the programmers didn't account for. Better to have a skipped or delayed sample, than a game lock.

OldMan

or call AD_STOP,  and check AD_STAT before you play the new sample.
(ie, if( AD_STAT() == 0 ) { play sample }


FWIW, AD_STAT() check one of the adpcm registers, and returns it in X, iirc.

touko

#6
Like oldman said, why you don't use ad_stat ??

I didn't understand your question the first time i read,i thought you want to know how many cycles takes to stop an old adpcm sample and start a new one,and not the delay between the two.

ad_stat return 1, when a sample is running,so you only wait while ad_stat = 1 before starting a new one,because in cycles you can not answer to that question , because it depends on where you are in your sample,and sample's lenght .