Skip to navigation

Revs on the BBC Micro

Sound: DefineEnvelope

Name: DefineEnvelope [Show more] Type: Subroutine Category: Sound Summary: Define a sound envelope
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ProcessShiftedKeys calls DefineEnvelope * ResetVariables calls DefineEnvelope

Arguments: A The offset of the sound envelope data in envelopeData: * A = 0 for the first (and only) envelope definition Returns: X X is unchanged
.DefineEnvelope STX xStoreSound \ Store the value of X in xStoreSound, so we can \ preserve it through the call to the DefineEnvelope \ routine CLC \ Set (Y X) = envelopeData + A ADC #LO(envelopeData) \ TAX \ starting with the low byte LDA #8 \ Set A = 8 for the OSWORD command to define an envelope \ Fall through into MakeSoundEnvelope to set up Y and \ apply the OSWORD command to the (Y X) block, which \ defines the relevant sound envelope