make OSS detect blocking, adjust audio API

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@898 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2010-09-18 16:40:13 +00:00
parent d40231e29a
commit a4edca53b4
11 changed files with 92 additions and 99 deletions

View file

@ -375,7 +375,8 @@ PICO_INTERNAL void PsndGetSamples(int y)
#if SIMPLE_WRITE_SOUND
if (y != 224) return;
PsndRender(0, PsndLen);
if (PicoWriteSound) PicoWriteSound(PsndLen);
if (PicoWriteSound)
PicoWriteSound(PsndLen * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2));
PsndClear();
#else
static int curr_pos = 0;
@ -385,8 +386,11 @@ PICO_INTERNAL void PsndGetSamples(int y)
if (emustatus & 2)
curr_pos += PsndRender(curr_pos, PsndLen-PsndLen/2);
else curr_pos = PsndRender(0, PsndLen);
if (emustatus&1) emustatus|=2; else emustatus&=~2;
if (PicoWriteSound) PicoWriteSound(curr_pos);
if (emustatus & 1)
emustatus |= 2;
else emustatus &= ~2;
if (PicoWriteSound)
PicoWriteSound(curr_pos * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2));
// clear sound buffer
PsndClear();
}
@ -424,7 +428,7 @@ PICO_INTERNAL void PsndGetSamplesMS(void)
}
if (PicoWriteSound != NULL)
PicoWriteSound(length);
PicoWriteSound(length * ((PicoOpt & POPT_EN_STEREO) ? 4 : 2));
PsndClear();
}