Re: [hatari-devel] No sound in the Pacemaker Demo

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


Le 05/06/2014 23:54, David Savinkoff a écrit :
----- Nicolas Pomarède wrote:
Le 03/06/2014 20:21, David Savinkoff a écrit :

I looked at the LMC1992 data sheet, here is what I surmise:

1) The mask must be at least eleven consecutive bits long, or the
     LMC1992 is left in an intermediate state, and restarts the sequence
     when there is a break in the mask. Think of the Mask as an enable
     signal.
     (Six usable 11 bit Masks. eg. 0011111111111000, 0000011111111111)
     (Five usable 12 bit Masks)
     (Zero usable Masks less than 11 bits long)

     Note that it may be possible to send two (or more) 16 bit Masks that
     act as a single 32 bit Mask.
     ( 0000000000011111, 1111110000000000 )

Someone should test this 32 bit mask on a real STe because it
probably works. If it doesn't work, it should be determined what
happens.

From Atari's doc, I had the feeling that mask register was locked after you write it, until all 16 bits were rotated, so it can be difficult to write a new value at the precise point. But I never checked this.

Does it rotate endlessly, or only 16 times when a new value is written in data register (I think it's the latter) ? Maybe cyprian could check this.

But for 32 bit mask, this would mean that you need to write a new value in mask reg just after bit 0 was read and before bit 15 is read ; as you need to do this in less than 8 cycles, I'm not sure it is possible with a STE (or maybe using the blitter, but even so, you need to be perfectly synchronised with the shifting to write at the precise time, which can be quite tricky)

This is what I implemented, except I didn't handle the fact that you
could have a mask like 1100 0111 1111 1111 where you should ignore the 5
first bits and check again the 11 other bits. Hopefully, no one used a
mask like this, else I could fix it if needed.

I see you noted this in the source code for future reference.
(I would expect the mask to be shifted 16 bits, not rotated.)

No, as already coded in Hatari and confirmed by cyprian's tests, mask is rotated, but data is shifted. This means you can save some cpu/code by 1st writing a mask, then writing only data for each command you want to send. You can also check that 16 bits of data were sent by reading mask : when mask is the same as the initial value, it means 16 rotations were made (of course, you need to have a mask with a pattern that repeat only after 16 rotations, 0x7ff for example, but not 0xffff)





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