mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
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:
parent
d40231e29a
commit
a4edca53b4
11 changed files with 92 additions and 99 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue