Skip to navigation

Sound: FlushSoundBuffers

Name: FlushSoundBuffers [Show more] Type: Subroutine Category: Sound Summary: Flush all four sound channel buffers
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MainGameLoop calls FlushSoundBuffers * ProcessPauseKeys calls FlushSoundBuffers * ShowGameOverScreen calls FlushSoundBuffers
.FlushSoundBuffers LDX #7 \ To flush all four sound channel buffers we need to \ pass the values 4, 5, 6 and 7 to the FlushBuffer \ routine, so set X to loop through those values .fbuf1 JSR FlushBuffer \ Call FlushBuffer to flush the buffer specified in X DEX \ Decrement the loop counter CPX #4 \ Loop back until we have flushed the buffers for all BCS fbuf1 \ four sound channels RTS \ Return from the subroutine