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: * A = 7 make a sound * A = 8 to define a sound envelope X The low byte of the address of the OSWORD block C flag The outcome of the addition of the low bytes of (Y X)
.MakeSoundEnvelope LDY #HI(envelopeData) \ Set y to the high byte of the envelopeData block \ address, so (Y X) now points to the relevant envelope \ or sound data block BCC senv1 \ If the addition we did before calling the routine \ didn't overflow, skip the next instruction INY \ The above addition overflowed, so increment the high \ byte of (Y X) to point to the next page in memory .senv1 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) RTS \ Return from the subroutine NOP \ This instruction appears to be unused