bugfix for SIMPLE_WRITE_SOUND

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@342 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2008-01-29 23:29:30 +00:00
parent 03a265e5eb
commit e0978fa87d
3 changed files with 3 additions and 5 deletions

View file

@ -256,6 +256,7 @@ static int CheckIdle(void)
static __inline void getSamples(int y)
{
#if SIMPLE_WRITE_SOUND
if (y != 224) return;
PsndRender(0, PsndLen);
if (PicoWriteSound) PicoWriteSound(PsndLen);
PsndClear();

View file

@ -89,10 +89,9 @@ static int WriteSeg()
// Lock the segment at 'LoopWrite' and copy the next segment in
LoopBuffer->Lock(LoopWrite<<((PicoOpt&8) ? 2 : 1),PsndLen<<((PicoOpt&8) ? 2 : 1), &mema,&sizea, &memb,&sizeb, 0);
//dprintf2("lock %p, cpy %x\n", mema, sizea);
if (mema) memcpy(mema,DSoundNext,sizea);
// if (memb) memcpy(memb,DSoundNext+sizea,sizeb);
if (sizeb != 0) dprintf2("sizeb is not 0! (%i)\n", sizeb);
LoopBuffer->Unlock(mema,sizea, memb,0);
@ -109,8 +108,6 @@ int DSoundUpdate()
LoopBuffer->GetCurrentPosition(&play,NULL);
pos=play>>((PicoOpt&8) ? 2 : 1);
//dprintf2("loop %i pos %i\n", LoopWrite, pos);
// 'LoopWrite' is the next seg in the loop that we want to write
// First check that the sound 'play' pointer has moved out of it:
if (pos>=LoopWrite && pos<LoopWrite+PsndLen) return 1; // No, it hasn't

View file

@ -13,7 +13,7 @@ int LoopInit()
// bits LSb->MSb:
// enable_ym2612&dac, enable_sn76496, enable_z80, stereo_sound;
// alt_renderer, 6button_gamepad, accurate_timing, accurate_sprites
PicoOpt=0xbcc7;
PicoOpt=0xbccf;
PsndRate=44100;
// Init Direct3D: