Advertisement
Guest User

Untitled

a guest
Jan 10th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------------------------------------------------------
  2. ; Subroutine to play a music track
  3.  
  4. ; input:
  5. ;   d0 = track to play
  6. ; ---------------------------------------------------------------------------
  7.  
  8. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  9.  
  10. PlaySample:
  11.        move.w  #$100,($A11100).l       ; stop the Z80
  12.       @0:
  13.         btst    #0,($A11100).l
  14.         bne.s   @0
  15.         move.b  d0,$A01FFF
  16.         move.w  #0,($A11100).l
  17.         rts
  18.  
  19. PlaySound:
  20.                cmpi.b  #$7F,d0
  21.         ble.s   ChkSounds00to7F
  22.         jmp  NormalSoundRequest
  23. ChkSounds00to7F:
  24.         cmpi.b  #$01,d0
  25.         bge.s   LoadSlots00to7F
  26.         jmp  NormalSoundRequest
  27. LoadSlots00to7F:
  28.         add.b   #$80,d0; Add $80 to get slot to starts at $81          
  29.         move.b  #$01,($FFFFFFFC).w; Move $01 to $FFFFFC to make the sound driver load the secound index
  30. NormalSoundRequest:
  31.         move.b  d0,($FFFFF00A).w
  32.         rts
  33. ; End of function PlaySound
  34.  
  35. ; ---------------------------------------------------------------------------
  36. ; Subroutine to play a sound effect
  37. ; ---------------------------------------------------------------------------
  38.  
  39. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  40.  
  41.  
  42. PlaySound_Special:
  43.         cmpi.b  #$7F,d0
  44.         ble.s   ChkSounds00to7F_Special
  45.         jmp  NormalSoundRequest_Special
  46. ChkSounds00to7F_Special:
  47.  
  48.         cmpi.b  #$01,d0
  49.         bge.s   LoadSlots00to7F_Special
  50.         jmp  NormalSoundRequest_Special
  51. LoadSlots00to7F_Special:
  52.         add.b   #$80,d0; Add $80 to get slot to starts at $81          
  53.         move.b  #$01,($FFFFFFFC).w; Move $01 to $FFFFFC to make the sound driver load the secound index
  54. NormalSoundRequest_Special:
  55.         move.b  d0,($FFFFF00B).w
  56.         rts
  57. ; End of function PlaySound_Special
  58.  
  59. ; ===========================================================================
  60. ; ---------------------------------------------------------------------------
  61. ; Unused sound/music subroutine
  62. ; ---------------------------------------------------------------------------
  63.  
  64. PlaySound_Unused:
  65.         cmpi.b  #$7F,d0
  66.         ble.s   ChkSounds00to7F_Unused
  67.         jmp  NormalSoundRequest_Unused
  68. ChkSounds00to7F_Unused:
  69.  
  70.         cmpi.b  #$01,d0
  71.         bge.s   LoadSlots00to7F_Unused
  72.         jmp  NormalSoundRequest_Unused
  73. LoadSlots00to7F_Unused:
  74.         add.b   #$80,d0; Add $80 to get slot to starts at $81          
  75.         move.b  #$01,($FFFFFFFC).w; Move $01 to $FFFFFC to make the sound driver load the secound index
  76. NormalSoundRequest_Unused:
  77.         move.b  d0,(v_snddriver_ram+v_playnull).w
  78.         rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement