Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ---------------------------------------------------------------------------
- ; Subroutine to play a music track
- ; input:
- ; d0 = track to play
- ; ---------------------------------------------------------------------------
- ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
- PlaySample:
- move.w #$100,($A11100).l ; stop the Z80
- @0:
- btst #0,($A11100).l
- bne.s @0
- move.b d0,$A01FFF
- move.w #0,($A11100).l
- rts
- PlaySound:
- cmpi.b #$7F,d0
- ble.s ChkSounds00to7F
- jmp NormalSoundRequest
- ChkSounds00to7F:
- cmpi.b #$01,d0
- bge.s LoadSlots00to7F
- jmp NormalSoundRequest
- LoadSlots00to7F:
- add.b #$80,d0; Add $80 to get slot to starts at $81
- move.b #$01,($FFFFFFFC).w; Move $01 to $FFFFFC to make the sound driver load the secound index
- NormalSoundRequest:
- move.b d0,($FFFFF00A).w
- rts
- ; End of function PlaySound
- ; ---------------------------------------------------------------------------
- ; Subroutine to play a sound effect
- ; ---------------------------------------------------------------------------
- ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
- PlaySound_Special:
- cmpi.b #$7F,d0
- ble.s ChkSounds00to7F_Special
- jmp NormalSoundRequest_Special
- ChkSounds00to7F_Special:
- cmpi.b #$01,d0
- bge.s LoadSlots00to7F_Special
- jmp NormalSoundRequest_Special
- LoadSlots00to7F_Special:
- add.b #$80,d0; Add $80 to get slot to starts at $81
- move.b #$01,($FFFFFFFC).w; Move $01 to $FFFFFC to make the sound driver load the secound index
- NormalSoundRequest_Special:
- move.b d0,($FFFFF00B).w
- rts
- ; End of function PlaySound_Special
- ; ===========================================================================
- ; ---------------------------------------------------------------------------
- ; Unused sound/music subroutine
- ; ---------------------------------------------------------------------------
- PlaySound_Unused:
- cmpi.b #$7F,d0
- ble.s ChkSounds00to7F_Unused
- jmp NormalSoundRequest_Unused
- ChkSounds00to7F_Unused:
- cmpi.b #$01,d0
- bge.s LoadSlots00to7F_Unused
- jmp NormalSoundRequest_Unused
- LoadSlots00to7F_Unused:
- add.b #$80,d0; Add $80 to get slot to starts at $81
- move.b #$01,($FFFFFFFC).w; Move $01 to $FFFFFC to make the sound driver load the secound index
- NormalSoundRequest_Unused:
- move.b d0,(v_snddriver_ram+v_playnull).w
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement