Re: [hatari-devel] 8 runes of aerillion doesn't have sound |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Le 10/03/2024 à 08:32, Laurent Sallafranque a écrit :
Maybe this can help. I use a variable : "music_sequence_index" to keep the current sample index.I've traced my code and I see that "music_sequence_index" goes from 0(*8) to 2(*8) immediately at the beginning of the music, which means there's an interrupt played immediately after the beginning of the music.The VHS intro plays a sample without interrupts. I stop the music between the VHS screen and the intro of the demo.The sample is bigger than the effect length, so, I stop it, load the 1st music sample into memory and start to play the music.In the music_start code, I add #8 to "music_sequence_index" because I read this value at the beginning of the interrupt code to load the next sample. I also increment by #8 this variable during each interrupt in the interrupt code.The traced value of 2(*8) for the variable means that there's a first interrupt triggered.
Hi thanks for the information.What Hatari does at the moment is that it triggers an interrupt (TAI or GPIP7) when sample start playing (this is because SNDINT signal goes from idle to playing). And optionaly it triggers an interrupt when reaching the end of the sample buffer (if value is set at $FF8901)
I thought signal always goes from idle to playing when starting a sound, but from what you describe it seems it's not the case, because this extra interrupt at start explains why sample 1 is not played and it "jumps" directly to sample 2.
That would mean DMA sound triggers an interrupt at start only if FF8901 is not enabled to trigger an interrupt at the end (Hatari allows both at the moment)
I need to write a small test program for falcon that would check the different cases (loop yes/no and interrupt at end yes/no), because so far the lack of real documentation from Atari makes it difficult to emulate.
Nicolas
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |