Skip to navigation

Elite on the BBC Micro and NES

Sound: NO3

[Elite-A, Flight]

Name: NO3 [Show more] Type: Subroutine Category: Sound Summary: Make a sound from a prepared sound block
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * EXNO calls NO3

Make a sound from a prepared sound block in XX16 (if sound is enabled). See routine NOS1 for details of preparing the XX16 sound block.
.NO3 \ --- Mod: Code removed for Elite-A: ------------------> \ LDX DNOIZ \ Set X to the DNOIZ configuration setting \ --- And replaced by: --------------------------------> LDY DNOIZ \ Set Y to the DNOIZ configuration setting \ --- End of replacement ------------------------------> BNE KYTB \ If DNOIZ is non-zero, then sound is disabled, so \ return from the subroutine (as KYTB contains an RTS) \ --- Mod: Code removed for Elite-A: ------------------> \ LDX #LO(XX16) \ Otherwise set (Y X) to point to the sound block in \ LDY #HI(XX16) \ XX16 \ --- And replaced by: --------------------------------> LDX #LO(XX16) \ Otherwise set (Y X) to point to the sound block in \ XX16 (Y is 0 as we didn't take the BNE above, and the \ XX16 block is in zero page, so we don't need to \ explicitly set Y to #HI(XX16) as it's already correct) \ --- End of replacement ------------------------------> LDA #7 \ Call OSWORD 7 to makes the sound, as described in the JMP OSWORD \ documentation for variable SFX, and return from the \ subroutine using a tail call