***************************************************** **** "Lapsuus" - Custom Module **** **** all adaptions by Wanted Team **** ***************************************************** ; requires 68020+, 68000 is too slow incdir "dh2:include/" include 'misc/eagleplayer2.01.i' include 'hardware/intbits.i' include 'exec/exec_lib.i' SECTION Player,Code Lap_Start PLAYERHEADER PlayerTagArray dc.b "$VER: Lapsuus - Custom Module,",10 dc.b 'adapted by Don Adan/Wanted Team',0 even PlayerTagArray dc.l DTP_CustomPlayer,1 dc.l DTP_PlayerName,PlayerName dc.l DTP_StartInt,StartInt dc.l DTP_StopInt,StopInt dc.l DTP_InitPlayer,InitPlayer dc.l DTP_EndPlayer,EndPlayer dc.l DTP_InitSound,InitSound dc.l DTP_EndSound,EndSound dc.l EP_Get_ModuleInfo,Get_ModuleInfo dc.l TAG_DONE PlayerName dc.b "CustomPlay",0 Text dc.b 10 dc.b " LAPSUUS",10 dc.b " by",10 dc.b " Mature Furk",10 dc.b 10 dc.b " Code:",10 dc.b " Petri, Mikko",10 dc.b " Graphics:",10 dc.b " Janne, Eetu, Juha,",10 dc.b " Saku, Timo",10 dc.b " Music:",10 dc.b " Captain",0 even EagleBase dc.l 0 *************************************************************************** ***************************** EP_Get_ModuleInfo *************************** *************************************************************************** Get_ModuleInfo lea InfoBuffer(PC),A0 rts InfoBuffer dc.l MI_SpecialInfo,Text dc.l MI_LoadSize,MusicEnd-Lap_Start+1024*2 dc.l 0 *************************************************************************** ***************************** DTP_InitPlayer ****************************** *************************************************************************** InitPlayer move.l A5,EagleBase move.l 4.W,A0 tst.b $129(A0) ; CPU check beq.b MC68000 move.l dtg_AudioAlloc(A5),A0 jmp (A0) MC68000 moveq #EPR_NeedhigherCPUFPU,D0 rts *************************************************************************** ***************************** DTP_EndPlayer ******************************* *************************************************************************** EndPlayer move.l dtg_AudioFree(A5),A0 jmp (A0) *************************************************************************** ***************************** DTP_InitSound ******************************* *************************************************************************** InitSound lea $DFF000,A0 moveq #64,D0 move.w D0,$A8(A0) move.w D0,$B8(A0) move.w D0,$C8(A0) move.w D0,$D8(A0) bra.w Init *************************************************************************** ***************************** DTP_EndSound ******************************** *************************************************************************** EndSound lea $DFF000,A0 move.w #15,$96(A0) moveq #0,D0 move.w D0,$A8(A0) move.w D0,$B8(A0) move.w D0,$C8(A0) move.w D0,$D8(A0) rts *************************************************************************** ***************************** DTP_StartInt ******************************** *************************************************************************** StartInt movem.l D0/A6,-(A7) lea InterruptStruct(PC),A1 moveq #INTB_AUD0,D0 move.l 4.W,A6 ; baza biblioteki exec do A6 jsr _LVOSetIntVector(A6) move.l D0,Audio0 movem.l (A7)+,D0/A6 move.w #$8080,$DFF09A move.w #$800F,$DFF096 rts InterruptStruct dc.l 0 dc.l 0 dc.b NT_INTERRUPT dc.b 5 ; priority dc.l Name ; ID string dc.l lbL01BD04 dc.l Interrupt Name dc.b 'Lapsuus Aud0 Interrupt',0,0 even Audio0 dc.l 0 *************************************************************************** ***************************** DTP_StopInt ********************************* *************************************************************************** StopInt lea $DFF000,A0 move.w #1,$96(A0) move.w #$80,$9A(A0) move.w #$80,$9C(A0) moveq #INTB_AUD0,D0 move.l Audio0(PC),A1 move.l A6,-(A7) move.l 4.W,A6 jsr _LVOSetIntVector(a6) move.l (A7)+,A6 rts *************************************************************************** ***************************** DTP_Intterrupt ****************************** *************************************************************************** Interrupt movem.l D1-A6,-(SP) bsr.w Play_1 bsr.w Play_2 movem.l (SP)+,D1-A6 moveq #0,D0 rts SongEnd movem.l A1/A5,-(A7) move.l EagleBase(PC),A5 move.l dtg_SongEnd(A5),A1 jsr (A1) movem.l (A7)+,A1/A5 rts *************************************************************************** *************************************************************************** *************************************************************************** ; Music from "Lapsuus" (c) Mature Furk Init ; MOVE.L #$800,D0 ; BSR.L lbC00040A ; alloc $800 bytes MOVE.L #$400,D1 MOVE.L D1,lbL01BD04 ; MOVE.L D0,lbL01BD08 ; allocated buffer ; MOVEA.L D0,A0 ; LEA $400(A0),A1 ; MOVE.L A1,lbL01BD0C ; CLR.W lbW01BD10 ; MOVE.L D0,lbL06A4AA ; MOVEA.L A5,A0 ; BSR.L lbC001574 ; MOVE.L D0,lbL01BD12 ; MOVEA.L A5,A0 ; BSR.L lbC00164C move.l #MusicEnd-Music,D0 ADD.L D0,D0 MOVE.L D0,lbL01BD16 MOVE.L lbL01BD12,lbL01BD1A MOVE.L D0,lbL01BD1E CLR.W lbW01BD22 CLR.W lbW01BD24 ;lbC000DEA MOVE.L SP,D0 ; SUB.L #12,D0 ; CMP.L lbL06BDB8,D0 ; BCS.L lbC008644 ; MOVE.L A6,-(SP) ; TST.L lbL06A4A2 ; BEQ.L lbC000ECC ; BSR.L lbC000ED0 ; MOVEA.L lbL06A4AA,A0 ; MOVEQ #0,D0 ; MOVE.L #$800,D1 ; BSR.L lbC000AB8 MOVE.W #$200,D0 MOVE.L #$400,D1 MOVE.W D0,$DFF0A4 MOVE.W D0,$DFF0B4 MOVE.W D0,$DFF0C4 MOVE.W D0,$DFF0D4 MOVEQ #$7D,D0 MOVE.W D0,$DFF0A6 MOVE.W D0,$DFF0B6 MOVE.W D0,$DFF0C6 MOVE.W D0,$DFF0D6 CLR.W lbW01BD10 MOVEA.L lbL01BD08,A0 LEA lbL01BD04,A1 BSR.L lbC000F2C ; MOVEA.L lbL01BD0C,A0 ; LEA lbL01BD04,A1 ; MOVE.L #$400,D1 ; BSR.L lbC000F2C ; LEA lbL06A4B2,A1 ; MOVEQ #7,D0 ; MOVEA.L 4,A6 ; JSR -$A2(A6) MOVEA.L lbL01BD08,A0 MOVE.L A0,$DFF0A0 MOVE.L A0,$DFF0B0 MOVE.L A0,$DFF0C0 MOVE.L A0,$DFF0D0 ; MOVE.W #$80,$DFF09C ; MOVE.W #$8080,$DFF09A ; MOVE.W #$800F,$DFF096 ;lbC000ECC MOVEA.L (SP)+,A6 RTS ;lbC000ED0 CMPA.L lbL06BDB8,SP ; BCS.L lbC008644 ; TST.L lbL06A4A2 ; BEQ.S lbC000EFA ; MOVE.W #$80,$DFF09C ; MOVE.W #$780,$DFF09A ; MOVE.W #15,$DFF096 ;lbC000EFA RTS ; MOVE.L 4(SP),D0 ;lbC000F00 CMPA.L lbL06BDB8,SP ; BCS.L lbC008644 ; TST.L lbL06A4A2 ; BEQ.S lbC000F2A ; MOVE.W D0,$DFF0A8 ; MOVE.W D0,$DFF0B8 ; MOVE.W D0,$DFF0C8 ; MOVE.W D0,$DFF0D8 ;lbC000F2A RTS lbC000F2C JMP lbC0196B6 Play_2 ;lbC01964C MOVE.W #$80,$9C(A0) MOVE.W 12(A1),D0 EORI.W #1,D0 MOVE.W D0,12(A1) lea $DFF000,A0 move.l A2,$A0(A0) move.l A2,$B0(A0) move.l A2,$C0(A0) move.l A2,$D0(A0) move.w #$80,$9C(A0) rts ; MOVE.L 4(A1,D0.W*4),$A0(A0) ; MOVE.L 4(A1,D0.W*4),$B0(A0) ; MOVE.L 4(A1,D0.W*4),$C0(A0) ; MOVE.L 4(A1,D0.W*4),$D0(A0) ; LEA lbL06A4C8,A1 ; JMP -$B4(A6) Play_1 lbC019680 MOVE.W 12(A1),D0 MOVEA.L 4(A1,D0.W*4),A0 move.l A0,A2 MOVE.L (A1),D0 lbC01968A TST.L D0 BEQ.S lbC0196B4 MOVE.L $1A(A1),D1 BEQ.S lbC0196AA CMP.L D0,D1 BLS.S lbC01969A MOVE.L D0,D1 lbC01969A MOVEM.L D0/D1/A0/A1,-(SP) BSR.S lbC0196B6 MOVEM.L (SP)+,D0/D1/A0/A1 ADDA.L D1,A0 SUB.L D1,D0 BRA.S lbC01968A lbC0196AA MOVE.L D0,D1 BRA.S lbC0196B0 lbC0196AE CLR.B (A0)+ lbC0196B0 DBRA D1,lbC0196AE bsr.w SongEnd clr.w lbW01BD10 ; restart music move.l lbL01BD12(PC),lbL01BD1A move.l lbL01BD16(PC),lbL01BD1E clr.l lbW01BD22 lbC0196B4 RTS lbC0196B6 MOVEM.L D2-D7/A2-A6,-(SP) MOVEA.L A1,A6 MOVEA.L A0,A1 MOVEA.L $16(A6),A0 SUB.L D1,$1A(A6) MOVE.L D1,D0 MOVE.W $1E(A6),D4 EXT.L D4 MOVE.W $20(A6),D5 CLR.W D6 LEA lbW01978A(PC),A3 LEA lbL0197AA(PC),A4 MOVE.L (A4,D5.W*4),D7 BRA.L lbC019770 lbC0196E4 TST.W D6 BNE.S lbC0196F0 MOVE.B (A0)+,D1 MOVE.B D1,D2 LSR.B #4,D2 BRA.S lbC0196F2 lbC0196F0 MOVE.B D1,D2 lbC0196F2 EORI.W #1,D6 AND.W #15,D2 ADD.W (A3,D2.W*2),D5 BPL.S lbC019702 MOVEQ #0,D5 lbC019702 CMPI.W #$58,D5 BMI.S lbC01970A MOVEQ #$58,D5 lbC01970A MOVE.W D2,D3 AND.W #8,D3 MOVE.W D3,lbW019788 AND.W #7,D2 MOVEA.L D7,A5 MOVE.L A5,D3 ASR.L #3,D3 BTST #2,D2 BEQ.S lbC019728 ADD.L D7,D3 lbC019728 BTST #1,D2 BEQ.S lbC019734 MOVEA.L D7,A5 ASR.L #1,D7 ADD.L D7,D3 lbC019734 BTST #0,D2 BEQ.S lbC019740 MOVEA.L D7,A5 ASR.L #2,D7 ADD.L D7,D3 lbC019740 TST.W lbW019788 BEQ.S lbC019748 NEG.L D3 lbC019748 ADD.L D3,D4 CMPI.L #$FFFF8000,D4 BPL.S lbC019758 MOVE.L #$FFFF8000,D4 lbC019758 CMPI.L #$7FFF,D4 BMI.S lbC019766 MOVE.L #$7FFF,D4 lbC019766 MOVE.L (A4,D5.W*4),D7 MOVE.W D4,D2 ASR.W #8,D2 MOVE.B D2,(A1)+ lbC019770 DBRA D0,lbC0196E4 MOVE.L A0,$16(A6) MOVE.W D4,$1E(A6) MOVE.W D5,$20(A6) MOVEM.L (SP)+,D2-D7/A2-A6 RTS NOP lbW019788 dc.w 0 lbW01978A dc.w $FFFF dc.w $FFFF dc.w $FFFF dc.w $FFFF dc.w 2 dc.w 4 dc.w 6 dc.w 8 dc.w $FFFF dc.w $FFFF dc.w $FFFF dc.w $FFFF dc.w 2 dc.w 4 dc.w 6 dc.w 8 lbL0197AA dc.l 7 dc.l 8 dc.l 9 dc.l 10 dc.l 11 dc.l 12 dc.l 13 dc.l 14 dc.l $10 dc.l $11 dc.l $13 dc.l $15 dc.l $17 dc.l $19 dc.l $1C dc.l $1F dc.l $22 dc.l $25 dc.l $29 dc.l $2D dc.l $32 dc.l $37 dc.l $3C dc.l $42 dc.l $49 dc.l $50 dc.l $58 dc.l $61 dc.l $6B dc.l $76 dc.l $82 dc.l $8F dc.l $9D dc.l $AD dc.l $BE dc.l $D1 dc.l $E6 dc.l $FD dc.l $117 dc.l $133 dc.l $151 dc.l $173 dc.l $198 dc.l $1C1 dc.l $1EE dc.l $220 dc.l $256 dc.l $292 dc.l $2D4 dc.l $31C dc.l $36C dc.l $3C3 dc.l $424 dc.l $48E dc.l $502 dc.l $583 dc.l $610 dc.l $6AB dc.l $756 dc.l $812 dc.l $8E0 dc.l $9C3 dc.l $ABD dc.l $BD0 dc.l $CFF dc.l $E4C dc.l $FBA dc.l $114C dc.l $1307 dc.l $14EE dc.l $1706 dc.l $1954 dc.l $1BDC dc.l $1EA5 dc.l $21B6 dc.l $2515 dc.l $28CA dc.l $2CDF dc.l $315B dc.l $364B dc.l $3BB9 dc.l $41B2 dc.l $4844 dc.l $4F7E dc.l $5771 dc.l $602F dc.l $69CE dc.l $7462 dc.l $7FFF lbL01BD04 ds.l 1 lbL01BD08 dc.l Buffy_1 lbL01BD0C dc.l Buffy_2 lbW01BD10 ds.w 1 lbL01BD12 dc.l Music lbL01BD16 ds.l 1 lbL01BD1A ds.l 1 lbL01BD1E ds.l 1 lbW01BD22 ds.w 1 lbW01BD24 ds.w 1 ;lbL06A4B2 dc.l 0 ; dc.l 0 ; dc.w $200 ; dc.l MatureFurkAud.MSG ; dc.l lbL01BD04 ; dc.l lbC01964C ;lbL06A4C8 dc.l 0 ; dc.l 0 ; dc.w $200 ; dc.l MatureFurkAud.MSG0 ; dc.l lbL01BD04 ; dc.l lbC019680 ;MatureFurkAud.MSG dc.b 'MatureFurk Audio Interrupt',0,0 ;MatureFurkAud.MSG0 dc.b 'MatureFurk Audio SoftInt',0,0 Music incbin ram:music.mus MusicEnd Section Buffy,BSS_C Buffy_1 ds.b 1024 Buffy_2 ds.b 1024