XgmSetBusProtection

Last Modified: 1/3/2021

Enable 68000 bus protection during DMA.

Arguments

NameTypeRequiredDescription
Enabled Boolean Yes Enable or disable bus protection using True or False.

Example

Syntax: XgmSetBusProtection <Enabled>
    XgmTrack MyMusicTrack
    XgmStartMusic
    
    On vInt GoSub Vbl
    Enable vInt
    
    While 1
        j = JoyPad()
        If j.0 Then
            XgmSetTempo 100
        End If
        If j.1 Then
            XgmSetTempo 30
        End If
        WaitPadUp 0
        Sleep 1
    Wend
    
Vbl:
    XgmVintProc
 
    XgmSetBusProtection True
    DmaLoad MyTiles,1,0
    XgmSetBusProtection False
    Return
 
MyTiles:
   DataLong $11111111
   DataLong $11111111
   DataLong $11111111
   DataLong $11111111
   DataLong $11111111
   DataLong $11111111
   DataLong $11111111
   DataLong $11111111
   DataLong $22222222
   DataLong $22222222
   DataLong $22222222
   DataLong $22222222
   DataLong $22222222
   DataLong $22222222
   DataLong $22222222
   DataLong $22222222
   DataLong $22222222

Remarks

This will help prevent degredation of XGM's playback during DMA operations. XGM expects DMA operations to happen during the VBlank, so that's where this would work best.

See Also

XgmPlayPcm, XgmResumeMusic, XgmSetPcm, XgmSetTempo, XgmStartMusic, XgmStopMusic, XgmStopPcm, XgmTrack, XgmVintProc