Re: [hatari-devel] 8 runes of aerillion doesn't have sound -> fixed SNDINT/SOUNDINT |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Le 10/03/2024 à 21:45, Nicolas Pomarède a écrit :
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.
Hi
Laurent and I wrote a test program for this different cases and he ran
it under his own falcon (thanks to him for these tests !)
This allowed to understand how the SOUNDINT/SNDINT signals work and to
add proper emulation in Hatari. "Electric Night" demo and game "8 runes
of aerillion" have correct audio now, no sample are skipped anymore.
Unlike the dma audio on STE/TT,the Falcon SOUNDINT/SNDINT signals are
not always enabled, that is even when playing or recording these signals
won't always go to active state (=0/low on the line)
According to docs floating around Bit 0-3 at $FF8900 allow to set
interrupt at end of frame for play or record, triggering on MFP's TAI or
GPIP7.
In fact when these bits are set to 0, the corresponding SOUNDINT/SNDINT
signal will always be 1/high. So for example if you read GPIP bit 7 at
$FFFA01 you will always get 1 (ie idle) even when sample are played.
The 2 lines will only be updated if corresponding bit is set in FF8900.
Then Timer A input is using AER bit 4, GPIP7 is using AER bit 7
So if you use GPIP7, you can get an interrupt at the start of each
sample by setting AER bit7=0 (at start of a sample SNDINT goes from
idle=1 to active=0) or you can get an inerrupt at the end of each sample
by setting AER bit7=1 (at the end SNDINT goes from active=0 to idle=1)
Same goes for TAI and GPIP4, but beware that AER bit 4 is also used by
the acia, so you should keep AER bit 4 to 0 if you don't want to have
problem with keyboard interrupts
For laurent : you should change your init routine, as we saw in another
mail reading GPIP7 and then setting AER bit 7 to 0 or 1 depending on
GPIP7 value is not "safe".
You should always set AER bit 7 to 0 or to 1, depending if you want
interrupt at start or at end of sample, no need to check GPIP7 before.
Nicolas