diff --git a/mainmem.audio.s b/mainmem.audio.s index 26e59d0..5661d09 100644 --- a/mainmem.audio.s +++ b/mainmem.audio.s @@ -1,7 +1,10 @@ * MAINMEM.AUDIO.S * (c) Bobbi 2022 GPLv3 * -* Applecorn audio code +* Applecorn audio code. +* This is the implementation of the audio-engine. The code is +* device-independent, using the Ensoniq driver in MAINMEM.ENSQ.S +* or the Mockingboard driver in MAINMEM.MOCK.S. * SYSCLOCK DB $00 ; Centisecond counter (5 bytes) @@ -729,6 +732,7 @@ ADSRPHASE STX OSCNUM :S1 TYA ; Change/step -> A CLC ADC CURRAMP,X ; Add change to current amp + BCS :CLAMP ; If overflow, clamp to target CMP :TARGET ; Compare with target BCS :CLAMP ; If target < sum, clamp to target BRA :UPDATE @@ -739,6 +743,7 @@ ADSRPHASE STX OSCNUM :S2 TYA ; Change/step -> A CLC ADC CURRAMP,X ; Add change to current amp + BCS :CLAMP ; If overflow, clamp to target CMP :TARGET ; Compare with target BCC :CLAMP ; If target >= sum, clamp to target BRA :UPDATE