Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; -------------------------------------------------------------------------
- ; Song data
- ; -------------------------------------------------------------------------
- Songs:
- obj $10000
- include "_midi/songs.asm"
- objend
- Songs_End:
- if (Songs_End-Songs)>$30000
- inform 2,"Song data is too large by $%h bytes!", (Songs_End-Songs)-$30000
- endif
- ; -------------------------------------------------------------------------
- ; Sample data
- ; -------------------------------------------------------------------------
- Samples:
- obj $40000
- include "_midi/samples.asm"
- objend
- Samples_End:
- if (Samples_End-Samples)>$80000
- inform 2,"Sample data is too large by $%h bytes!", (Samples_End-Samples)-$80000
- endif
- ; -------------------------------------------------------------------------
- ; Load MIDI data
- ; -------------------------------------------------------------------------
- LoadMIDIData:
- lea Songs,a0 ; Load song data
- move.l #Songs_End-Songs,d1
- beq.s .LoadSamples
- bsr.s .DoLoad
- moveq #3,d0
- jsr SendSPCmd.w
- .LoadSamples:
- lea Samples,a0 ; Load the first bank of samples
- if (Samples_End-Samples)<=$40000
- move.l #Samples_End-Samples,d1
- beq.s .End
- else
- move.l #$40000,d1
- endif
- bsr.s .DoLoad
- moveq #2,d0
- if (Samples_End-Samples)>=$40000
- jsr SendSPCmd.w
- lea Samples+$40000,a0 ; Load the second bank of samples
- move.l #Samples_End-Samples-$40000,d1
- beq.s .End
- else
- jmp SendSPCmd.w
- endif
- .End:
- rts
- .DoLoad:
- moveq #1,d0 ; Get Word RAM access
- jsr SendSPCmd.w
- lea WORDRAM_2M,a1 ; Word RAM
- .CopyData:
- move.b (a0)+,(a1)+ ; Load data
- subq.l #1,d1
- bne.s .CopyData
- .ReturnWordRAM:
- bset #0,GA_MEM_MODE+1 ; Give Word RAM access back
- beq.s .ReturnWordRAM
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement