Advertisement
FlannyH

Untitled

Aug 1st, 2021
1,202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     ;Handle Note
  2.     ;TODO - refactor part of this into a jump table? (effects?)
  3.     cp $60 ; if byte < 0x60, it's a note
  4.     jp c, .HandleNote
  5.  
  6.     cp $80 ; else if byte < 0x80, it's a wait instruction
  7.     jp c, .HandleWait
  8.  
  9.     cp $A0 ; else if byte < 0xA0, it's a change instrument instruction
  10.     jp c, .HandleInstrumentChange
  11.  
  12.     cp $B0 ; else if byte < 0xB0, it's a volume change
  13.     jp c, .HandleVolumeChange
  14.  
  15.     cp $C0 ; else if byte < 0xC0, it's a duty change
  16.     jp c, .HandleDutyChange
  17.  
  18.     cp $E0 ; else if byte < 0xE0, it's a tempo change
  19.     jp c, .HandleTempoChange
  20.    
  21.     cp $F8
  22.     jp z, .HandleDelayedNoteStart
  23.  
  24.     cp $F9
  25.     jp z, .HandleDelayedNoteCut
  26.  
  27.     cp $FA
  28.     jp z, .HandleFinePitch
  29.  
  30.     cp $FB
  31.     jp z, .HandleVolumeEnvelope
  32.  
  33.     cp $FC
  34.     jp z, .HandleNote
  35.  
  36.     cp $FD
  37.     jp z, .HandleNote
  38.  
  39.     cp $FE
  40.     jp z, .JumpToFrame
  41.  
  42.     cp $FF
  43.     jp z, .GoToNextFrame
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement