;     Titan & MDEM Cooperational Demo
;     For Revision 2013
;
;     main.68k - Main program.  

Demo_Main:

        jsr Plasma_FX
;        move.w #250, d7
 ;       jsr WAITD7
		 
        jsr EmuDetect
		
		
		jsr LoaderMain
        disableints
		
		jsr setvdpdefaults
		jsr ClearEverything
		
        lea InstrumentList, a0
        jsr Echo_Init
        lea DemoTune, a0
        jsr Echo_PlayBGM
        
@needmusic
        waitframe
        Echo_z80request
        move.b ($A01200), d0
        move.b #0, ($A01200)
        echo_z80release
        tst.b d0
        beq.s @NeedMusic
        
        jsr LogoMania
        disableints
		
		jsr setvdpdefaults
		jsr ClearEverything
        disableints
        MOVEQ #0, D0
        MOVEQ #0, D1
        MOVEQ #0, D2
        MOVEQ #0, D3
        MOVEQ #0, D4
        MOVEQ #0, D5
        MOVEQ #0, D6
        MOVEQ #0, D7
        jsr setvdpdefaults
		jsr ClearEverything
        

        jsr Gunstar
    disableints
        MOVEQ #0, D0
        MOVEQ #0, D1
        MOVEQ #0, D2
        MOVEQ #0, D3
        MOVEQ #0, D4
        MOVEQ #0, D5
        MOVEQ #0, D6
        MOVEQ #0, D7
		
		move.w #$8114, VDPCONTROL
		
        jsr setvdpdefaults
		jsr ClearEverything
		move.w #$8174, VDPCONTROL
        
        

        jsr SFMAin
    disableints
        MOVEQ #0, D0
        MOVEQ #0, D1
        MOVEQ #0, D2
        MOVEQ #0, D3
        MOVEQ #0, D4
        MOVEQ #0, D5
        MOVEQ #0, D6
        MOVEQ #0, D7
        
        
		jsr setvdpdefaults
		jsr ClearEverything
        
        jsr Plasma_FX
        DISABLEINTS
		jsr setvdpdefaults
		jsr ClearEverything
        
        jsr Twister
        DISABLEINTS
		jsr setvdpdefaults
		jsr ClearEverything
        
        jsr Axelay
        DISABLEINTS
		jsr setvdpdefaults
		jsr ClearEverything
        jsr liquify
        DISABLEINTS
		jsr setvdpdefaults
		jsr ClearEverything
        
        jsr palpix
        
        
        
        DISABLEINTS
        
		jsr setvdpdefaults
		jsr ClearEverything
        jsr CRAMDMASCROLLER

        DISABLEINTS
        
		jsr setvdpdefaults
		jsr ClearEverything
        
        jsr FullscreenBMP
        DISABLEINTS
        
		jsr setvdpdefaults
		jsr ClearEverything
       
        jsr Circles
        
		DisableInts
		jsr setvdpdefaults
		jsr ClearEverything

        jsr End
        
		jmp *
