Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1.  
  2. ; -------------------------------------------------------------------------
  3. ; Song data
  4. ; -------------------------------------------------------------------------
  5.  
  6. Songs:
  7. obj $10000
  8. include "_midi/songs.asm"
  9. objend
  10. Songs_End:
  11. if (Songs_End-Songs)>$30000
  12. inform 2,"Song data is too large by $%h bytes!", (Songs_End-Songs)-$30000
  13. endif
  14.  
  15. ; -------------------------------------------------------------------------
  16. ; Sample data
  17. ; -------------------------------------------------------------------------
  18.  
  19. Samples:
  20. obj $40000
  21. include "_midi/samples.asm"
  22. objend
  23. Samples_End:
  24. if (Samples_End-Samples)>$80000
  25. inform 2,"Sample data is too large by $%h bytes!", (Samples_End-Samples)-$80000
  26. endif
  27.  
  28. ; -------------------------------------------------------------------------
  29. ; Load MIDI data
  30. ; -------------------------------------------------------------------------
  31.  
  32. LoadMIDIData:
  33. lea Songs,a0 ; Load song data
  34. move.l #Songs_End-Songs,d1
  35. beq.s .LoadSamples
  36. bsr.s .DoLoad
  37. moveq #3,d0
  38. jsr SendSPCmd.w
  39.  
  40. .LoadSamples:
  41. lea Samples,a0 ; Load the first bank of samples
  42. if (Samples_End-Samples)<=$40000
  43. move.l #Samples_End-Samples,d1
  44. beq.s .End
  45. else
  46. move.l #$40000,d1
  47. endif
  48. bsr.s .DoLoad
  49. moveq #2,d0
  50. if (Samples_End-Samples)>=$40000
  51. jsr SendSPCmd.w
  52. lea Samples+$40000,a0 ; Load the second bank of samples
  53. move.l #Samples_End-Samples-$40000,d1
  54. beq.s .End
  55. else
  56. jmp SendSPCmd.w
  57. endif
  58.  
  59. .End:
  60. rts
  61.  
  62. .DoLoad:
  63. moveq #1,d0 ; Get Word RAM access
  64. jsr SendSPCmd.w
  65.  
  66. lea WORDRAM_2M,a1 ; Word RAM
  67.  
  68. .CopyData:
  69. move.b (a0)+,(a1)+ ; Load data
  70. subq.l #1,d1
  71. bne.s .CopyData
  72.  
  73. .ReturnWordRAM:
  74. bset #0,GA_MEM_MODE+1 ; Give Word RAM access back
  75. beq.s .ReturnWordRAM
  76.  
  77. rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement