sms wip: Alex kidd shinobi plays sound

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@759 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-08-23 22:01:55 +00:00
parent 30eb4622c4
commit 2ec9bec58b
4 changed files with 241 additions and 18 deletions

View file

@ -396,3 +396,30 @@ PICO_INTERNAL void PsndGetSamples(int y)
#endif
}
PICO_INTERNAL void PsndGetSamplesMS(void)
{
int *buf32 = PsndBuffer;
int stereo = (PicoOpt & 8) >> 3;
int length = PsndLen;
#if !SIMPLE_WRITE_SOUND
// compensate for float part of PsndLen
PsndLen_exc_cnt += PsndLen_exc_add;
if (PsndLen_exc_cnt >= 0x10000) {
PsndLen_exc_cnt -= 0x10000;
length++;
}
#endif
// PSG
if (PicoOpt & POPT_EN_PSG)
SN76496Update(PsndOut, length, stereo);
// convert + limit to normal 16bit output
PsndMix_32_to_16l(PsndOut, buf32, length);
if (PicoWriteSound != NULL)
PicoWriteSound(length);
PsndClear();
}