.MakeSoundEnvelope LDY #HI(soundData) \ Set y to the high byte of the soundData block \ address, so (Y X) now points to the relevant envelope \ or sound data block JSR OSWORD \ Call OSWORD with action A, as follows: \ \ * A = 7 to make the sound at (Y X) \ \ * A = 8 to set up the sound envelope at (Y X) LDX xStoreSound \ Restore the value of X we stored before calling the \ routine, so it doesn't change RTS \ Return from the subroutineName: MakeSoundEnvelope [Show more] Type: Subroutine Category: Sound Summary: Either make a sound or set up an envelopeContext: See this subroutine in context in the source code References: This subroutine is called as follows: * MakeSound calls MakeSoundEnvelope
Arguments: A The action: * A = 7 make a sound * A = 8 to define a sound envelope X The low byte of the address of the OSWORD block xStoreSound The value of X to restore at the end of the routine
[X]
Configuration variable OSWORD = &FFF1
The address for the OSWORD routine
[X]
Variable soundData (category: Sound)
OSWORD blocks for making the various game sounds
[X]
Variable xStoreSound (category: Sound)
Temporary storage for X so it can be preserved through calls to the sound routines