Copy Link
Add to Bookmark
Report
Digmax-Musicdriver
; Digmax-Musicdriver - Ripped by Zaphod/TLT. 912903
OPT D+,O+,OW-
CLR.L -(SP) ; Supervisor
MOVE.W #$20,-(SP)
TRAP #1
ADDQ.L #6,SP
MOVE.L D0,SUPER
MOVE.W #4,-(SP) ; Get old res
TRAP #14
ADDQ.L #2,SP
MOVE.W D0,REZ
DC.W $A00A ; Hide mouse
CLR.W -(SP) ; Set screen
MOVE.L #-1,-(SP)
MOVE.L #-1,-(SP)
MOVE.W #5,-(SP)
TRAP #14
ADD.L #12,SP
MOVE.W #2,-(SP) ; Physbase
TRAP #14
ADDQ.L #2,SP
MOVE.L D0,SCREEN
MOVEM.L $FFFF8240.W,D0-D7 ; Save old pal
MOVEM.L D0-D7,PALSAVE
LEA INTSAVE,A0 ; Save ints
MOVE.L $70,(A0)+
MOVE.L $114,(A0)+
MOVE.B $FFFFFA07.W,(A0)+
MOVE.B $FFFFFA09.W,(A0)+
MOVE.B $FFFFFA13.W,(A0)+
MOVE.B $FFFFFA15.W,(A0)+
MOVE.B $FFFFFA17.W,(A0)+
MOVE.B $FFFFFA1D.W,(A0)+
MOVE.W SR,(A0)+
MOVE.W #$2700,SR
BCLR #3,$FFFFFA17.W
MOVE.L #VBL,$70 ; New vbi
MOVE.W #$2300,SR
; BSR RELOCATE
MOVE.L #1,D0 ;
JSR MUSIC
JSR MUSIC+8
CLR.W $FFFF8240.W ; Col 0 Black
MOVE.W #$777,$FFFF8242.W ; Col 1 White
WAIT:
CMP.B #185,$FFFFFC02.W ; Wait for space
BNE WAIT
MOVE.W #$2700,SR ; Restore ints
LEA INTSAVE,A0
MOVE.L (A0)+,$70
MOVE.L (A0)+,$114
MOVE.B (A0)+,$FFFFFA07.W
MOVE.B (A0)+,$FFFFFA09.W
MOVE.B (A0)+,$FFFFFA13.W
MOVE.B (A0)+,$FFFFFA15.W
MOVE.B (A0)+,$FFFFFA17.W
MOVE.B (A0)+,$FFFFFA1D.W
MOVE.B #$F0,$FFFFFA23.W
MOVE.W (A0)+,SR
MOVEM.L PALSAVE,D0-D7
MOVEM.L D0-D7,$FFFF8240.W
MOVE.L #$8080000,$FFFF8800.W ; Clear soundchip
MOVE.L #$9090000,$FFFF8800.W
MOVE.L #$A0A0000,$FFFF8800.W
MOVE.L #$707FF00,$FFFF8800.W
MOVE.L #$E0EFE00,$FFFF8800.W
MOVE.W REZ,-(SP) ; Set old screen
MOVE.L #-1,-(SP)
MOVE.L #-1,-(SP)
MOVE.W #5,-(SP)
TRAP #14
ADD.L #12,SP
MOVE.L SUPER,-(SP) ; User mode
MOVE.W #$20,-(SP)
TRAP #1
ADDQ.L #6,SP
DC.W $A009 ; Show mouse
CLR.W -(SP) ; Pterm
TRAP #1
VBL: ; Vbi routine
dcb.w 8000,$4E71
move.w #$700,$FFFF8240.w
MOVEM.L D0-D7/A0-A6,-(SP)
LEA STAPLE1,A0
MOVE.L SCREEN,A1
ADD.L #68,A1
ADD.L #160*100,A1
MOVE.L #15,D7
COPYBAR1:
MOVE.W (A0)+,(A1)
ADD.L #320,A1
DBRA D7,COPYBAR1
LEA STAPLE2,A0
MOVE.L SCREEN,A1
ADD.L #72,A1
ADD.L #160*100,A1
MOVE.L #15,D7
COPYBAR2:
MOVE.W (A0)+,(A1)
ADD.L #320,A1
DBRA D7,COPYBAR2
LEA STAPLE3,A0
MOVE.L SCREEN,A1
ADD.L #80,A1
ADD.L #160*100,A1
MOVE.L #15,D7
COPYBAR3:
MOVE.W (A0)+,(A1)
ADD.L #320,A1
DBRA D7,COPYBAR3
JSR MUSIC+$4
CLR.L D5
CLR.L D6
CLR.L D7
MOVE.B #$8,$FFFF8800.W
MOVE.B $FFFF8800.W,D5
MOVE.B #$9,$FFFF8800.W
MOVE.B $FFFF8800.W,D6
MOVE.B #$A,$FFFF8800.W
MOVE.B $FFFF8800.W,D7
AND.B #15,D5
AND.B #15,D6
AND.B #15,D7
MULU #32,D5
MULU #32,D6
MULU #32,D7
LEA STAPLEZ,A0
ADDA.L D5,A0
LEA STAPLE1,A1
MOVE.L #15,D4
READVOL1:
MOVE.W (A0)+,(A1)+
DBRA D4,READVOL1
LEA STAPLEZ,A0
ADDA.L D6,A0
LEA STAPLE2,A1
MOVE.L #15,D4
READVOL2:
MOVE.W (A0)+,(A1)+
DBRA D4,READVOL2
LEA STAPLEZ,A0
ADDA.L D7,A0
LEA STAPLE3,A1
MOVE.L #15,D4
READVOL3:
MOVE.W (A0)+,(A1)+
DBRA D4,READVOL3
MOVEM.L (SP)+,D0-D7/A0-A6
move.w #$000,$FFFF8240.w
RTE
EVEN
MUSIC: INCBIN TALE.MUS
MUSICEND:
EVEN
SUPER: DC.L 0
SCREEN: DC.L 0
REZ: DC.W 0
STAPLEZ:
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DC.W $00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
SECTION BSS
PALSAVE: DS.W 16
STAPLE1: DS.W 16
STAPLE2: DS.W 16
STAPLE3: DS.W 16
INTSAVE: DS.L 100
END