Skip to navigation

Sound: MakeSoundEnvelope

Name: MakeSoundEnvelope [Show more] Type: Subroutine Category: Sound Summary: Either make a sound or set up an envelope
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MakeSound calls MakeSoundEnvelope

Arguments: A The action: * 7 = make a sound * 8 = define a sound envelope X The low byte of the address of the OSWORD block
.MakeSoundEnvelope LDY #HI(soundData) \ Set Y to the high byte of the soundData block address, \ which is the same as the high byte of the envelopeData \ block address, so (Y X) now points to the relevant \ envelope or sound or sound data block JMP 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) \ \ and return from the subroutine using a tail call