Re: [hatari-devel] Falcon left-right sound swapper bug?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


----- Eero Tamminen wrote:
> Hi,
> 
> On torstai 17 huhtikuu 2014, David Savinkoff wrote:
> > crossbar.c is the only file that has:
> > dac.readPosition :: dac.writePosition
> > and:
> > adc2dac_readBufferPosition :: adc2dac_writeBufferPosition
> > 
> > These circular buffer indexes must check that they do not over-run each
> > other.
> > 
> > dmaSnd.c maintains the circular buffer indexes with:
> > static void DmaSnd_FIFO_Refill(void);
> > static Sint8 DmaSnd_FIFO_PullByte(void);
> > 
> > crossbar.c has incomplete functions:
> > void Crossbar_GetMicrophoneDatas(Sint16 *micro_bufferL, Sint16
> > *micro_bufferR, Uint32 microBuffer_size); static void
> > Crossbar_SendDataToDAC(Sint16 value, Uint16 sample_pos); void
> > Crossbar_GenerateSamples(int nMixBufIdx, int nSamplesToGenerate);
> 
> There's following old bug in Hatari Crossbar DMA code:
> http://listengine.tuxfamily.org/lists.tuxfamily.org/hatari-
> devel/2012/02/msg00082.html
> 
> It doesn't check the indeces given by emulated code
> which is really bad because emulated code can then
> corrupt Hatari's own memory.  That might then have also
> other effects.
> 
> 
> 	- Eero
> 
The 'read buffer position' and 'write buffer position' pointers
stay within the buffer's allocated space, but each are unaware
of the others existence and can become unsynchronized.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/