.startbd IF _GMA_RELEASE BIT MUDOCK ; If bit 7 of MUDOCK is set then the docking computer BMI startat ; has been configured to play the title music rather ; than the docking music, so jump to startat to set ; (A X) to the address of the title music to play when ; docking LDA #LO(musicstart) ; Set (A X) = musicstart, the address before the start LDX #HI(musicstart) ; of the docking music .startat2 STA value5 ; Set value5(1 0) = (A X) STX value5+1 ; ; So value5 contains the address before the start of the ; music we want to play ENDIF BIT MUPLA ; If bit 7 of MUPLA is set then there is already music BMI itsoff ; playing so we don't want to start any more, so jump to ; itsoff to return from the subroutine (as itsoff ; contains an RTS) BIT MUFOR ; If bit 7 of MUFOR is set then the docking music is BMI april16 ; configured so that it cannot be disabled, so skip the ; following check for MUTOK BIT MUTOK ; If bit 7 of MUTOK is set then the docking music is BMI itsoff ; disabled, so jump to itsoff to return from the ; subroutine without playing the docking music (as ; itsoff contains an RTS) .april16 LDA #%101 ; Call SETL1 to set the 6510 input/output port to the JSR SETL1 ; following: ; ; * LORAM = 1 ; * HIRAM = 0 ; * CHAREN = 1 ; ; This sets the entire 64K memory map to RAM except for ; the I/O memory map at $D000-$DFFF, which gets mapped ; to registers in the VIC-II video controller chip, the ; SID sound chip, the two CIA I/O chips, and so on ; ; See the memory map at the top of page 264 in the ; Programmer's Reference Guide JSR BDENTRY ; Start playing the configured background music LDA #$FF ; Set MUPLA to $FF to indicate that music is now playing STA MUPLA BNE coffeeex ; Jump to coffeeex to restore the memory configuration ; and return from the subroutine (this BNE is ; effectively a JMP as A is never zero)Name: startbd [Show more] Type: Subroutine Category: Sound Summary: Start playing the docking music, if configuredContext: See this subroutine in context in the source code References: This subroutine is called as follows: * Main flight loop (Part 3 of 16) calls startbd * stopbd calls startbd * MUTOKCH calls via april16 * startat calls via startat2
Other entry points: april16 Start playing the docking music, irrespective of the current configuration settings startat2 Start playing the music at address (A X) + 1
[X]
Subroutine BDENTRY (category: Sound)
Start playing a new tune as background music
[X]
Variable MUDOCK in workspace Option variables
Docking music tune configuration setting
[X]
Variable MUFOR in workspace Option variables
Configuration setting that controls whether the docking music can be enabled or disabled
[X]
Variable MUPLA in workspace Option variables
A flag to record whether any music is currently playing
[X]
Variable MUTOK in workspace Option variables
Docking music configuration setting
[X]
Subroutine SETL1 (category: Utility routines)
Set the 6510 input/output port register to control the memory map
[X]
Label musicstart in variable BDJMPTBH
[X]
Subroutine startat (category: Sound)
Start playing the title music, if configured
[X]
Variable value5 in workspace Music variables
The address before the start of the music data for the tune that is configured to play for docking, so this can be changed to alter the docking music