************************************************* * Albedo Musics by Gilles Soulet (1988). * * Adapted by Mr.STYCKX / Nicolas Pomarède * * * * Original replay was in $127be. * * Uses Audio Irq ( VBR+$70 ). * * * * Ripped : 28/10/96 * * Relocated : 1/11/96 * * EaglePlayer / Delitracker port : 4/11/96 * * Volume * * Balance * * SubSong * * EP_Voices * * EP_StructInit (Analyzer) * ************************************************* opt o+ output ram:CUST.Albedo ALB_TEST = 0 ; 0 => BUILD COMPLETE CUSTOM MODULE ; 1 => BUILD SMALL CODE FOR TESTING section Albedo,code incdir "Include:" include "misc/DeliPlayer.i" include "misc/EaglePlayer.i" IFEQ ALB_TEST-0 ; COMPLETE VERSION ;; include "exec/interrupts.i" ;;SetIntVector = -162 PLAYERHEADER PlayerTagArray dc.b '$VER: Albedo Musics (1988) custom player V1.0, ' dc.b 'ripped and adapted by Mr.STYCKX (11/96)',0 EVEN PlayerTagArray dc.l DTP_CustomPlayer,1 ; CustomPlayer - Tag (important !!!) dc.l DTP_Flags,PLYF_CUSTOM dc.l DTP_PlayerVersion,1<<16+0 ; v1.0 dc.l EP_PlayerVersion,1 dc.l DTP_PlayerName,PName dc.l DTP_Creator,CName dc.l DTP_InitPlayer,InitPlay ; alloc audio dc.l DTP_EndPlayer,EndPlay ; free audio dc.l DTP_InitSound,ALB_init ; init custom data dc.l DTP_EndSound,ALB_end ; clear DMA dc.l DTP_SubSongRange,ALB_SubSongRange dc.l DTP_Interrupt,ALB_Play dc.l DTP_Volume,ALB_Volume dc.l DTP_Balance,ALB_Volume dc.l EP_Voices,ALB_SetVoices dc.l EP_StructInit,ALB_StructInit dc.l EP_Flags,EPB_Voices!EPB_Analyzer!EPB_Volume!EPB_Balance dc.l TAG_DONE PName dc.b "Albedo Custom v1.0",0 CName dc.b "Music by G. Soulet (1988).",$a dc.b "Adapted by Mr.STYCKX (4/11/96)",0 EVEN ALB_StructAnalyzer ; transmis à EaglePlayer pour gérer ds.l UPS_SizeOF ; les analyzers *-----------------------------------------------------------------------* ; ; Init Player InitPlay bsr.s SetInter move.l dtg_AudioAlloc(a5),a0 ; Function jmp (a0) ;--------------------------------------- ; Alloc Audio IRQ 7, 8, 9 and A SetInter bsr.s GetVBR move.l VBR(pc),a0 move.l $70(a0),OldInterAudio move.l #ALB_InterAudio,$70(a0) ; personnal inter. rts IFEQ 1 ; obsolete move.l #$12345678,d0 ; valeur bidon, non nulle lea Inter7(pc),a1 move.l #Irq7,IS_CODE(a1) move.l d0,IS_DATA(a1) moveq #7,d0 move.l 4.w,a6 jsr SetIntVector(a6) move.l d0,OldInter7 lea Inter8(pc),a1 move.l #Irq8,IS_CODE(a1) move.l d0,IS_DATA(a1) moveq #8,d0 move.l 4.w,a6 jsr SetIntVector(a6) move.l d0,OldInter8 lea Inter9(pc),a1 move.l #Irq9,IS_CODE(a1) move.l d0,IS_DATA(a1) moveq #9,d0 move.l 4.w,a6 jsr SetIntVector(a6) move.l d0,OldInter9 lea InterA(pc),a1 move.l #IrqA,IS_CODE(a1) move.l d0,IS_DATA(a1) moveq #$a,d0 move.l 4.w,a6 jsr SetIntVector(a6) move.l d0,OldInterA rts ENDC GetVBR move.l $4.w,a6 move.w 296(a6),d0 ;sysflags btst #0,d0 ;afb_68010 beq.s .MC68000 lea .SuperGetVBR(pc),a5 jsr -30(a6) ;_LVOSupervisor rts .MC68000 clr.l VBR rts .SuperGetVBR movem.l a0-a1,-(sp) dc.l $4e7a8801 ; movec VBR,a0 lea VBR(pc),a1 move.l a0,(a1) movem.l (sp)+,a0-a1 rte OldInterAudio dc.l 0 ; ancienne valeur de $70 VBR dc.l 0 ;--------------------------------------- ; Free Audio IRQ 7, 8, 9 and A FreeInter move.l VBR(pc),a0 move.l OldInterAudio(pc),$70(a0) ; restore previous value rts IFEQ 1 ; obsolete move.l OldInter7(pc),a1 moveq #7,d0 move.l 4.w,a6 jsr SetIntVector(a6) move.l OldInter8(pc),a1 moveq #8,d0 move.l 4.w,a6 jsr SetIntVector(a6) move.l OldInter9(pc),a1 moveq #9,d0 move.l 4.w,a6 jsr SetIntVector(a6) move.l OldInterA(pc),a1 moveq #$a,d0 move.l 4.w,a6 jsr SetIntVector(a6) rts Inter7 dcb.b IS_SIZE Inter8 dcb.b IS_SIZE Inter9 dcb.b IS_SIZE InterA dcb.b IS_SIZE OldInter7 dc.l 0 OldInter8 dc.l 0 OldInter9 dc.l 0 OldInterA dc.l 0 ENDC *-----------------------------------------------------------------------* ; ; End Player EndPlay bsr.s FreeInter move.l dtg_AudioFree(a5),a0 ; Function jmp (a0) *-----------------------------------------------------------------------* ; ; Init Custom Replay Routine ALB_init move.w dtg_SndNum(a5),d0 ; sub song nbr (1..3) bsr ALB_InitSong rts *-----------------------------------------------------------------------* ; ; Clear Audio Reg. ALB_end move.w #$f,$dff096 clr.w $dff0a8 clr.w $dff0b8 clr.w $dff0c8 clr.w $dff0d8 rts *-----------------------------------------------------------------------* ; ; Interrupt routine called every 1/50 s ALB_Play bsr ALB_InterVBL rts *-----------------------------------------------------------------------* ; ; Returns min and max sub song ALB_SubSongRange moveq #1,d0 ; min moveq #3,d1 ; max rts *-----------------------------------------------------------------------* ; ; Set Volume ALB_Volume move.w dtg_SndLBal(a5),d0 ; Vol Left mulu dtg_SndVol(a5),d0 ; Vol Max lsr.w #6,d0 move.w d0,ALB_MasterVolA ; final Vol Left move.w d0,ALB_MasterVolD move.w dtg_SndRBal(a5),d0 mulu dtg_SndVol(a5),d0 lsr.w #6,d0 move.w d0,ALB_MasterVolB move.w d0,ALB_MasterVolC rts *-----------------------------------------------------------------------* ; ; Set DMA Voices ALB_SetVoices move.w d0,ALB_DMA_EP ; bit=1 <=> voice is ON rts *-----------------------------------------------------------------------* ; ; Returns address of the UPS structure to EaglePlayer ALB_StructInit lea ALB_StructAnalyzer(pc),a0 rts *-----------------------------------------------------------------------* ELSEIF ; TESTVERSION ;------- ; Small code to test the player under a debugger moveq #1,d0 bsr ALB_InitSong move.l $6c.w,Jmp+2 move.l $78.w,AIrq move.l #Vbl,$6c.w move.l #ALB_InterAudio,$70.w rts End move.w #$f,$dff096 move.w #$780,$dff09a move.w #$780,$dff09c move.l Jmp+2(pc),$6c.w move.l AIrq(pc),$70.w rts Vbl btst #5,$dff01f beq.s Jmp .wa cmp.b #70,$dff006 blt.s .wa move.w #$f00,$dff180 movem.l d0-a6,-(a7) bsr ALB_InterVBL movem.l (a7)+,d0-a6 move.w #$345,$dff180 Jmp jmp 0.l AIrq dc.l 0 ALB_StructAnalyzer ; transmis à EaglePlayer pour gérer ds.l UPS_SizeOF ; les analyzers ENDC ;------------------------------------------------------------------------ ; Données pour EaglePlayer / Delitracker ALB_DMA_EP dc.w %1111 ; voix actives depuis EaglePlayer ALB_MasterVolA dc.w 64 ; 0 .. 64 ALB_MasterVolB dc.w 64 ALB_MasterVolC dc.w 64 ALB_MasterVolD dc.w 64 ALB_OldPer1 dc.w -1 ALB_OldPer2 dc.w -1 ALB_OldPer3 dc.w -1 ALB_OldPer4 dc.w -1 FakeDma dc.w 0 ;----------------------------------------------------------------------- ; Albedo Musics ; Original musics by G. Soullet (located in $127be) in 1988. ; Musics in $14416 - $15f1f ; Relocated on 1/11/96 by Mr.STYCKX ; ; ALB_InitSong : D0 = 1..3 ; ALB_InterVBL : called every VBL ; ALB_InterAudio : in $70 ; ;----------------------------------------------------------------------- ; Init à ne faire qu'une fois ALB_MasterInit lea .Init(pc),a0 tst.w (a0) bne.s .done st (a0) move.w d0,-(sp) lea l12c0c(pc),a0 lea SamplesInfo(pc),a1 lea Samples,a2 move.l a2,d2 sub.l #$d17a,d2 moveq #13+16-1,d0 .smp move.l (a0),d1 ; No du sample mulu #$1a,d1 lea (a1,d1.w),a2 ; Info sample move.l a2,(a0)+ dbf d0,.smp moveq #$c,d0 .rel add.l d2,(a1) add.w #$1a,a1 dbf d0,.rel move.w (sp)+,d0 .done rts .Init dc.w 0 ;----------------------------------------------------------------------- ; Init la subsong D0 (1..3) ALB_InitSong clr.w l1C370 ; stoppe replay bsr.s ALB_MasterInit ; move.w d0,-(sp) ; bsr l13518 ; addq.w #2,sp cmp.w #3,d0 bne.s .music1 move.l #$15e8f-$1530c+Music2,DataA ; D0 = 3 move.l #$15de9-$1530c+Music2,DataB move.l #$15cbc-$1530c+Music2,DataC move.l #Music2,CurrentMusic move.l #l12c40,SamplesAdr move.l #lbB0004C7,lbL0000F0 move.w #1,l127be ; clr.w l127be, gère voix D move.w #0,l127c4 bra.s .common .music1 move.l #$14bd1-$14416+Music1,DataA ; D0 = 1 move.l #$14ebb-$14416+Music1,DataB move.l #$1516e-$14416+Music1,DataC cmp.w #2,d0 bne.s .ok move.l #$14ce4-$14416+Music1,DataA ; D0 = 2 move.l #$14fa6-$14416+Music1,DataB move.l #$151eb-$14416+Music1,DataC .ok move.l #Music1,CurrentMusic move.l #l12c0c,SamplesAdr move.l #lbL0004BA,lbL0000F0 move.w #1,l127be ; gère voix D = voix C move.w #$C,l127c4 .common lea DataA(pc),A0 bsr RestartVoice lea DataB(pc),A0 bsr RestartVoice lea DataC(pc),A0 bsr RestartVoice bsr lbC000CFC ; copie DataC en DataD move.w #1,l1C370 ; replay ON clr.w l1B6AA ; SFX OFF, voix D ON rts ;----------------------------------------------------------------------- ; Routine appelée à chaque VBL ALB_InterVBL movem.l D0/A0,-(sp) lea ALB_StructAnalyzer(pc),a0 move.w #-1,UPS_Enabled(a0) move.w #UPSB_Adr!UPSB_Len!UPSB_Per!UPSB_Vol!UPSB_DMACon,UPS_Flags(a0) move.w ALB_MasterVolA(pc),$dff0a8 move.w #64,UPS_Voice1Vol(a0) move.w ALB_MasterVolB(pc),$dff0b8 move.w #64,UPS_Voice2Vol(a0) move.w ALB_MasterVolC(pc),$dff0c8 move.w #64,UPS_Voice3Vol(a0) move.w ALB_MasterVolD(pc),d0 lsr.w #1,d0 move.w d0,$dff0d8 move.w #32,UPS_Voice4Vol(a0) move.w UPS_Voice1Per(a0),ALB_OldPer1 move.w UPS_Voice2Per(a0),ALB_OldPer2 move.w UPS_Voice3Per(a0),ALB_OldPer3 move.w UPS_Voice4Per(a0),ALB_OldPer4 clr.w UPS_Voice1Per(a0) clr.w UPS_Voice2Per(a0) clr.w UPS_Voice3Per(a0) clr.w UPS_Voice4Per(a0) bsr l1333a ; replay Albedo move.w FakeDma(pc),UPS_DMACon(a0) ; bra.s .0 ; La replay d'Albedo remet la période à chaque VBL,ce qui perturbe ; les analyzers. On ne transmet donc une période que si elle est ; différente de la VBL précédente. lea ALB_StructAnalyzer(pc),a0 move.w UPS_Voice1Per(a0),d0 cmp.w ALB_OldPer1(pc),d0 ; nouvelle fréquence bne.s .2 ; oui clr.w UPS_Voice1Per(a0) ; non, on remet a 0 .2 move.w UPS_Voice2Per(a0),d0 cmp.w ALB_OldPer2(pc),d0 bne.s .3 clr.w UPS_Voice2Per(a0) .3 move.w UPS_Voice3Per(a0),d0 cmp.w ALB_OldPer3(pc),d0 bne.s .4 clr.w UPS_Voice3Per(a0) .4 move.w UPS_Voice4Per(a0),d0 cmp.w ALB_OldPer4(pc),d0 bne.s .0 clr.w UPS_Voice4Per(a0) .0 clr.w UPS_Enabled(a0) movem.l (SP)+,D0/A0 rts ;----------------------------------------------------------------------- l127be dc.w 0 l127c0 dc.w 1 l127c2 dc.w 8 l127c4 dc.w $c l127c6 dc.w 0,$B2E,$A90,$9F6,$968,$8E0,$860,$7E8,$776,$70A dc.w $6A6,$646,$5EC,$597,$547,$4FB,$4B4,$470,$430,$3F4 dc.w $3BB,$385,$353,$323,$2F6,$2CB,$2A3,$27D,$25A,$238 dc.w $218,$1FA,$1DD,$1C2,$1A9,$191,$17B,$165,$151,$13E dc.w $12D,$11C,$10C,$FD,$EE,$E1,$D4,$C8,$BD,$B2,$A8 dc.w $9F,$96,$8E,$86,$7E,$77,$70,$6A,$64,$5E,$59,$54 dc.w $4F,$4B,$47,$43,$3F,$3B,$38,$35,$32,$2F,$2C,$2A dc.w $27,$25,$23,$21,$1F,$1D,$1C,$1A,$19,$17,$16,$15 dc.w $13,$12,$11,$10,$F,$E,$E,$D,$C,$B,$B,$A,9,9,8,8,7 dc.w 7,7,6,6,5 lbB0000DA dc.b 0 lbB0000DB dc.b 0 lbB0000DC dc.b 0 lbB0000DD dcb.b 5,0 lbB0000E2 dcb.b 2,0 lbW0000E4 dc.w 0 lbW0000E6 dc.w $FF CurrentMusic dc.l Music1 SamplesAdr dc.l l12c0c lbL0000F0 dc.l lbL0004BA DataMus1 DataA l128ba lbB0000F4 dc.l $14BD1-$14416+Music1,$14CE4-$14416+Music1,EmptyNote,EmptyNote dc.b 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 dcb.b $16,0 dc.l SamplesInfo dc.b 0,0,0,0,0,0 dc.l $DFF0A0 dc.b 0,0,0,$11,0,0,0,1,$23,$45,0,0 ;lbW00014E dcb.w 4,0 dc.w 1,0,0,0,0,0,0,0,0,0,0 DataB l12932 lbB00016C dc.l $14EBB-$14416+Music1,$14FA6-$14416+Music1,EmptyNote,EmptyNote dc.b 0,1,0,0,0,0,0,0 dcb.b $28,0 dc.l SamplesInfo dc.b 0,0,0,0,0,1 dc.l $DFF0B0 dc.b 0,0,0,$11,0,0,0,1,$23,$45,0,0 ;lbW0001C6 dcb.w 4,0 dc.w 2,0,0,0,0,0,0,0,0,0,0 DataC l129aa lbB0001E4 dc.l $1516E-$14416+Music1,$151EB-$14416+Music1,EmptyNote,EmptyNote dc.b 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 dcb.b $16,0 dc.l SamplesInfo dc.b 0,0,0,0,0,2 dc.l $DFF0C0 dc.b 0,0,0,$11,0,0,0,1,$23,$45,0,0 ;lbW00023E dcb.w 4,0 dc.w 4,0,0,0,0,0,0,0,0,0,0 DataD l12a22 lbB00025C dc.l $1516E-$14416+Music1,$151EB-$14416+Music1,EmptyNote,EmptyNote dc.b 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 dcb.b $16,0 dc.l SamplesInfo dc.b 0,0,0,0,0,2 lbB0002A6 dc.l $DFF0D0 dc.b 0,0,0,$11,0,0,0,1,$23,$45,0,0,0,0,0 dcb.b 5,0 lbB0002BE dc.b 0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 DataMus2 l12a9a lbB0002D4 dc.l $15E8F-$1530c+Music2,EmptyPattern,EmptyNote,EmptyNote dc.b 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 dcb.b $16,0 dc.l SamplesInfo dc.b 0,0,0,0,0,0 dc.l $DFF0A0 dc.b 0,0,0,$11,0,0 dc.b 0,1,$23,$45,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0 dcb.b $D,0 dc.l $15DE9-$1530c+Music2,EmptyPattern,EmptyNote,EmptyNote dc.b 0,1 dcb.b $2E,0 dc.l SamplesInfo dc.b 0,0,0,0,0,1 dc.l $DFF0B0 dc.b 0,0,0,$11,0,0 dc.b 0,1,$23,$45,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0 dcb.b $D,0 dc.l $15CBC-$1530c+Music2,EmptyPattern,EmptyNote,EmptyNote dc.b 0,1 dcb.b $2E,0 dc.l SamplesInfo dc.b 0,0,0,0,0,2 dc.l $DFF0C0 dc.b 0,0,0,$11,0,0 dc.b 0,1,$23,$45,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0 dcb.b $1A,0 l12c0c ; lbL000446 dc.l 0,0,1,2,3,4,5 ; No des samples dc.l 6,7,8,9,$a,$b ; dc.l $1B5EC,$1B5EC,$1B60A,$1B62E,$1B650,$1B66C,$1B68E ; dc.l $1B6B4,$1B728,$1B750,$1AC6A,$1AD0A,$1AD28 l12c40 ; lbL00047A dc.l $b,6,2,3,5,$b,0 dc.l 7,$b,9,7,$a,6,7 dc.l 4,$c ; dc.l $1AD28,$1B6B4,$1B62E,$1B650,$1B68E,$1AD28,$1B5EC ; dc.l $1B728,$1AD28,$1AC6A,$1B728,$1AD0A,$1B6B4,$1B728 ; dc.l $1B66C,$1AD44 lbL0004BA dcb.l 3,0 dc.b 0 lbB0004C7 dcb.b 6,0 dc.b $C,0,0,$C,$C,0,$F4,$C,0,0,0 even DMAON dc.w $8000 ReplStart dc.l 0 ReplLen dc.w 0 RepLenA dc.w 0 RepLenB dc.w 0 RepLenC dc.w 0 RepLenD dc.w 0 RepStartA dc.l 0 RepStartB dc.l 0 RepStartC dc.l 0 RepStartD dc.l 0 lbC0004F8 movem.l D0/A2/A3,-(SP) move.w $62(A0),D0 move.w D0,$DFF096 lsl.w #7,D0 move.w D0,$DFF09A move.w D0,$DFF09C move.l $4A(A0),A2 move.w #1,6(A2) move.w #0,$A(A2) cmp.w #6,$2E(A0) bne.s lbC00054E movem.l D0/A1,-(SP) moveq #0,D0 move.w l127c4,D0 lsl.w #2,D0 move.l SamplesAdr,A1 move.l 0(A1,D0.W),A1 move.l (A1),A3 movem.l (SP)+,D0/A1 bra.s lbC000552 lbC00054E move.l (A1),A3 lbC000552 move.l A3,(A2) move.w 8(A1),D0 lsr.w #1,D0 move.w D0,4(A2) move.l a3,UPS_Voice1Adr(a5) move.w d0,UPS_Voice1Len(a5) move.w $62(A0),D0 or.w D0,DMAON or.w D0,FakeDma moveq #0,D0 move.w 6(A1),D0 add.l D0,A3 move.l A3,ReplStart sub.w 8(A1),D0 neg.w D0 lsr.w #1,D0 move.w D0,ReplLen movem.l (SP)+,D0/A2/A3 rts lbC00058A movem.l D0/A2/A3,-(SP) movem.l D1/D2,-(SP) move.l $4A(A0),A2 move.l (A1),A3 moveq #0,D0 move.w 8(A1),D0 add.l A3,D0 move.w 4(A1),D1 sub.w 8(A1),D1 lsr.w #1,D1 move.w $62(A0),D2 lsl.w #7,D2 move.w D2,$DFF09C or.w #$8000,D2 move.l D0,(A2) move.w D1,4(A2) move.l d0,UPS_Voice1Adr(a5) move.w d1,UPS_Voice1Len(a5) *;* move.w D2,$DFF09A movem.l (SP)+,D1/D2 movem.l (SP)+,D0/A2/A3 rts ;----------------------------------------------------------------------- ; Audio DMA inter. ALB_InterAudio ; $12d98 lbC0005D2 movem.l D0/D1/A0/A1,-(SP) move.w $DFF01E,D0 and.w #$780,D0 and.w $DFF01C,D0 move.w D0,$DFF09C move.w D0,$DFF09A btst #7,D0 beq.s .noA lea DataA(pc),A0 bsr.s SetRep .noA btst #8,D0 beq.s .noB lea DataB(pc),A0 bsr.s SetRep .noB btst #9,D0 beq.s .noC lea DataC(pc),A0 bsr.s SetRep .noC btst #$A,D0 beq.s .noD tst.w l1B6AA beq.s .Don move.w #8,$DFF096 bra.s .noD .Don lea DataD(pc),A0 bsr.s SetRep .noD movem.l (SP)+,D0/D1/A0/A1 rte SetRep move.l $40(A0),A1 moveq #0,D1 move.w 4(A1),D1 subq.w #2,D1 add.l (A1),D1 move.l $4A(A0),A1 ; DFF0A0 | B0 | C0 | D0 move.l D1,(A1) move.w #1,4(A1) rts IFEQ 1 ; obsolete ;--------------------------------------- ; Audio Irq for OS handler Irq7 movem.l d1/a0-a1,-(sp) lea DataA(pc),A0 bsr.s SetRep movem.l (sp)+,d1/a0-a1 rts Irq8 movem.l d1/a0-a1,-(sp) lea DataB(pc),A0 bsr.s SetRep movem.l (sp)+,d1/a0-a1 rts Irq9 movem.l d1/a0-a1,-(sp) lea DataC(pc),A0 bsr.s SetRep movem.l (sp)+,d1/a0-a1 rts IrqA movem.l d1/a0-a1,-(sp) tst.w l1B6AA beq.s .Don move.w #8,$DFF096 bra.s .noD .Don lea DataD(pc),A0 bsr.s SetRep .noD movem.l (sp)+,d1/a0-a1 rts ENDC ;--------------------------------------- lbC000662 movem.l D0/A2,-(SP) lbC000666 move.w $62(A0),D0 move.w D0,$DFF096 move.l $4A(A0),A2 move.w #1,6(A2) move.w #0,$A(A2) not.w D0 and.w D0,DMAON and.w D0,FakeDma not.w D0 lsl.w #7,D0 move.w D0,$DFF09A move.w D0,$DFF09C move.w #0,$54(A0) movem.l (SP)+,D0/A2 rts lbC0006A4 movem.l D0/A2,-(SP) moveq #0,D0 move.w $46(A0),D0 beq.s lbC000666 add.l $1C(A0),D0 cmp.w $54(A0),D0 beq.s lbC0006C8 move.w D0,$54(A0) move.l $4A(A0),A2 move.w D0,6(A2) move.w D0,UPS_Voice1Per(a5) lbC0006C8 movem.l (SP)+,D0/A2 rts lbC0006CE tst.w $5A(A0) beq.s lbC0006D8 rts lbC0006D8 move.l $40(A0),A1 addq.w #1,$28(A0) move.w $28(A0),D0 cmp.w $2C(A0),D0 bcc lbC000868 subq.w #1,$2A(A0) bcc.s lbC0006FE bset #7,$24(A0) bsr lbC00058A lbC0006FE cmp.w $12(A1),D0 bne.s lbC000744 addq.w #1,$24(A0) tst.w $2E(A0) beq.s lbC000744 cmp.w #4,$2E(A0) bcc.s lbC000724 move.w #1,$30(A0) lbC000724 cmp.w #6,$2E(A0) bne.s lbC000744 move.w #0,$2E(A0) bsr lbC0004F8 move.w #6,$2E(A0) move.w #0,$30(A0) lbC000744 cmp.w $14(A1),D0 bne.s lbC000762 addq.w #1,$24(A0) cmp.w #4,$2E(A0) bne.s lbC000762 move.w #0,$30(A0) lbC000762 move.l $18(A0),$44(A0) move.l $40(A0),A1 cmp.w #6,$2E(A0) bne.s lbC00077E tst.w $30(A0) bne.s lbC000786 lbC00077E tst.w $16(A1) beq.s lbC000790 lbC000786 move.w #$175,$46(A0) bra lbC000862 lbC000790 tst.w $30(A0) beq.s lbC0007DC move.l $32(A0),D0 add.l $36(A0),D0 move.l D0,$32(A0) cmp.l $3A(A0),D0 blt.s lbC0007B8 tst.w $36(A0) bmi.s lbC0007D6 bra.s lbC0007C0 lbC0007B8 tst.w $36(A0) bpl.s lbC0007D6 lbC0007C0 move.l $18(A0),$32(A0) cmp.w #3,$2E(A0) bne.s lbC0007D6 move.w #0,$30(A0) lbC0007D6 move.l $32(A0),$44(A0) lbC0007DC move.w $24(A0),D0 and.w #3,D0 beq.s lbC000862 tst.b $B(A1) bmi.s lbC000836 tst.w $30(A0) bne.s lbC000862 move.l $20(A0),D0 btst #0,lbB0000DD beq.s lbC00080E asr.l #1,D0 bra.s lbC00081A lbC00080E btst #1,lbB0000DD beq.s lbC000862 lbC00081A btst #2,lbB0000DB beq.s lbC00082E sub.l D0,$44(A0) bra.s lbC000862 lbC00082E add.l D0,$44(A0) bra.s lbC000862 lbC000836 move.w $E(A1),D0 and.w lbB0000DA,D0 beq.s lbC000862 move.l $18(A0),D0 btst #0,$B(A1) beq.s lbC00085A sub.l $20(A0),D0 bra.s lbC00085E lbC00085A add.l $20(A0),D0 lbC00085E move.l D0,$44(A0) lbC000862 bsr lbC0006A4 rts lbC000868 bsr lbC000662 move.l $C(A0),A2 lbC000870 moveq #0,D0 move.b (A2)+,D0 bmi lbC0009C6 beq.s lbC00088A add.b $13(A0),D0 add.w $18(A1),D0 add.w $60(A0),D0 add.w #$C,D0 lbC00088A move.w D0,$26(A0) lsl.w #1,D0 lea l127c6,A3 add.l D0,A3 move.w (A3),lbW0000E4 moveq #0,D0 move.w D0,$24(A0) move.w D0,$28(A0) move.w D0,$30(A0) move.l D0,$20(A0) move.l D0,$36(A0) move.l D0,$32(A0) moveq #-1,D0 move.l D0,$3A(A0) tst.w $26(A0) beq lbC0009A2 tst.b $B(A1) bmi.s lbC0008EA moveq #0,D0 move.w $C(A1),D0 lsl.w #1,D0 move.w 0(A3,D0.W),D0 sub.l lbB0000E2,D0 lsr.l #6,D0 move.l D0,$20(A0) bra.s lbC000900 lbC0008EA move.w $C(A1),D0 btst #0,$B(A1) beq.s lbC0008FA neg.w D0 lbC0008FA move.l 0(A3,D0.W),$20(A0) lbC000900 move.w $2E(A0),D0 beq lbC0009A2 cmp.w #3,D0 bcc.s lbC000944 move.w $3E(A0),D0 lsl.w #1,D0 move.l 0(A3,D0.W),D0 sub.l lbB0000E2,D0 lsr.l #1,D0 move.l lbB0000E2,$32(A0) move.l D0,$36(A0) btst #0,$2E(A0) beq.s lbC0009A2 neg.l $3A(A0) neg.l $36(A0) bra.s lbC0009A2 lbC000944 cmp.w #3,D0 bne.s lbC00097A move.l $18(A0),$32(A0) move.l lbB0000E2,D0 sub.l $18(A0),D0 moveq #0,D1 move.w $3E(A0),D1 asr.l D1,D0 move.l D0,$36(A0) move.l lbB0000E2,$3A(A0) move.w #1,$30(A0) bra.s lbC0009A2 lbC00097A cmp.w #4,D0 bne.s lbC000994 move.w $3E(A0),D0 ext.w D0 asl.w #2,D0 move.l 0(A3,D0.W),$32(A0) bra.s lbC0009A2 lbC000994 cmp.w #6,D0 bne.s lbC0009A2 move.w #1,$30(A0) lbC0009A2 move.l lbB0000E2,$18(A0) moveq #0,D0 move.b (A2)+,D0 move.w D0,$2C(A0) sub.w $10(A1),D0 move.w D0,$2A(A0) move.l A2,$C(A0) bsr lbC0004F8 bra lbC000762 lbC0009C6 cmp.w #$FF,D0 bne.s lbC000A2A move.w #0,$2E(A0) subq.w #1,$10(A0) beq.s lbC0009E4 move.l 8(A0),A2 bra lbC000870 lbC0009E4 move.l 4(A0),A3 move.b (A3)+,D0 bne.s lbC0009F4 move.w #1,$5A(A0) rts lbC0009F4 move.w D0,$10(A0) moveq #0,D0 move.b 1(A3),D0 lsl.w #8,D0 move.b (A3)+,D0 addq.l #1,A3 add.l CurrentMusic(pc),D0 sub.l #$C000,D0 move.l D0,A2 move.l D0,8(A0) move.b (A3)+,$13(A0) moveq #0,D0 move.b (A3)+,D0 move.w D0,$14(A0) move.l A3,4(A0) bra lbC000870 lbC000A2A and.w #$7F,D0 cmp.w #$10,D0 bcc.s lbC000A6C tst.w D0 bne.s lbC000A40 move.w $14(A0),D0 lbC000A40 move.l D1,-(SP) move.l D0,D1 move.l lbL0000F0,A1 move.b 0(A1,D1.W),$61(A0) smi $60(A0) move.l SamplesAdr(pc),A1 asl.w #2,D1 move.l 0(A1,D1.W),D1 move.l D1,$40(A0) move.l D1,A1 move.l (SP)+,D1 bra lbC000870 lbC000A6C and.w #$F,D0 btst #6,D0 beq.s lbC000A88 move.w #0,$2E(A0) move.w #0,$30(A0) addq.w #1,A2 bra lbC000870 lbC000A88 cmp.w #3,D0 bcc.s lbC000A98 cmp.w #6,D0 beq.s lbC000A98 bra.s lbC000A9C lbC000A98 move.w D0,$2E(A0) lbC000A9C move.b (A2)+,$3F(A0) cmp.w #9,D0 bcs lbC000870 move.w #0,$2E(A0) cmp.w #9,D0 bne.s lbC000AC2 move.w $3E(A0),lbW0000E6 bra.s lbC000AF4 lbC000AC2 cmp.w #$A,D0 bne.s lbC000ADA move.w $3E(A0),D0 ext.w D0 add.w D0,lbW0000E6 bra.s lbC000AF4 lbC000ADA cmp.w #$C,D0 bne.s lbC000AF4 move.w $3E(A0),D0 ext.w D0 ext.l D0 asl.l #4,D0 move.l D0,$1C(A0) bra lbC000870 lbC000AF4 bra lbC000870 EmptyPattern ; 132BE dc.w 0 EmptyNote ; 132c0 dc.w $ff00 RestartVoice move.l (A0),4(A0) move.l #EmptyNote,8(A0) move.l #EmptyNote,$C(A0) move.w #1,$58(A0) move.w #1,$10(A0) move.w #0,$2C(A0) move.w #0,$5A(A0) rts RestartMusic move.l #Music1,CurrentMusic cmp.w #1,l127c0 beq.s lbC000B42 move.l #Music2,CurrentMusic lbC000B42 lea DataA(pc),A0 bsr.s RestartVoice lea DataB(pc),A0 bsr.s RestartVoice lea DataC(pc),A0 bsr.s RestartVoice move.w #$F,lbW0000E6 rts ;--------------------------------------- ; VBL ;;lbC000B74 l1333a tst.w l1C370 bne.s lbC000B7E rts lbC000B7E movem.l D0-D6/A0-A6,-(SP) addq.w #1,lbB0000DA move.b lbB0000DA(pc),D0 and.b #3,D0 bne.s lbC000B96 moveq #1,D0 lbC000B96 move.w D0,lbB0000DC move.w #$8000,DMAON lea ALB_StructAnalyzer(pc),a5 clr.w ReplLen lea DataA(pc),A0 bsr lbC0006CE move.w ReplLen(pc),RepLenA move.l ReplStart(pc),RepStartA lea UPS_Modulo(a5),a5 clr.w ReplLen lea DataB(pc),A0 bsr lbC0006CE move.w ReplLen(pc),RepLenB move.l ReplStart(pc),RepStartB lea UPS_Modulo(a5),a5 clr.w ReplLen lea DataC(pc),A0 bsr lbC0006CE move.w ReplLen(pc),RepLenC move.l ReplStart(pc),RepStartC lea UPS_Modulo(a5),a5 tst.w l127be beq.s lbC000C4C tst.w l127c2 beq.s lbC000C28 subq.w #1,l127c2 bra.s lbC000C4C lbC000C28 clr.w ReplLen lea DataD(pc),A0 bsr lbC0006CE move.w ReplLen(pc),RepLenD move.l ReplStart(pc),RepStartD lbC000C4C move.b $dff006,d0 addq.b #3,d0 .wa1 cmp.b $dff006,d0 bne.s .wa1 move.w ALB_DMA_EP(pc),d0 move.w DMAON(pc),d1 and.b d0,d1 move.w d1,$DFF096 move.b $dff006,d0 addq.b #6,d0 .wa2 cmp.b $dff006,d0 bne.s .wa2 tst.w RepLenA beq.s .noA move.l RepStartA(pc),$DFF0A0 move.w RepLenA(pc),$DFF0A4 .noA tst.w RepLenB beq.s .noB move.l RepStartB(pc),$DFF0B0 move.w RepLenB(pc),$DFF0B4 .noB tst.w RepLenC beq.s .noC move.l RepStartC(pc),$DFF0C0 move.w RepLenC(pc),$DFF0C4 .noC tst.w l127be beq.s .noD tst.w RepLenD beq.s .noD move.l RepStartD(pc),$DFF0D0 move.w RepLenD(pc),$DFF0D4 .noD move.w DataA+$5a(pc),D0 and.w DataB+$5a(pc),D0 and.w DataC+$5a(pc),D0 beq.s lbC000CF6 bsr RestartMusic lbC000CF6 movem.l (SP)+,D0-D6/A0-A6 rts lbC000CFC movem.l A0/A1,-(SP) move.w l1C370,-(SP) clr.w l1C370 lea DataC(pc),A0 lea DataD(pc),A1 lbC000D18 move.w (A0)+,(A1)+ cmp.l #DataD,A0 bcs.s lbC000D18 move.l #$DFF0D0,lbB0002A6 move.w #8,lbB0002BE move.w #8,l127c2 move.w (SP)+,l1C370 movem.l (SP)+,A0/A1 rts l1350e move.w #$F,$DFF096 rts ;--------------------------------------- ; Init (obsolete) l13518 move.l A6,-(SP) move.l SP,A6 movem.l D0-D7/A0-A5,-(SP) move.w l1C370(pc),-(SP) clr.w l1C370 move.w l127c0(pc),D0 cmp.w 8(A6),D0 beq.s lbC000D94 move.w 8(A6),l127c0 lea DataMus1(pc),A0 lea DataMus2(pc),A1 lbC000D86 move.w (A0),D0 move.w (A1),(A0)+ move.w D0,(A1)+ cmp.l #DataD,A0 bcs.s lbC000D86 lbC000D94 jsr lbC000CFC cmp.w #1,8(A6) beq.s lbC000E14 move.l #Music2,CurrentMusic move.l #l12c40,SamplesAdr move.l #lbB0004C7,lbL0000F0 clr.w l127be move.w #0,l127c4 bra.s lbC000E8A lbC000E14 move.w #1,l127be move.l #Music1,CurrentMusic move.l #l12c0c,SamplesAdr move.l #lbL0004BA,lbL0000F0 move.w #$C,l127c4 move.w #$14,$DFF0D8 move.w #8,l127c2 tst.w (SP) bne.s lbC000E8A move.w #$32,$DFF0D8 lbC000E8A move.w (SP)+,l1C370 movem.l (SP)+,D0-D7/A0-A5 move.l (SP)+,A6 rts l1B6AA dc.w 0 ; 0=voix D musique ON / SFX OFF l1C370 ; 0=music OFF dc.w 1 ;----------------------------------------------------------------------- SamplesInfo ; 26 octets d'info sur les 32 samples dc.w $1,$AAB6,$06EC,$06B9,$06CC,0,0,2,2,1,$FF,0,$FFD0 ; samples music dc.w $1,$9CD0,$0DE6,$0D63,$0DA6,0,0,2,1,2,$FF,0,$FFF4 dc.w $1,$7874,$245C,$0011,$244B,0,1,2,1,1,$FF,0,$FFF4 dc.w $1,$6DCA,$0AAA,$0A6C,$0A8A,0,1,2,2,3,$FF,0,$FFF4 dc.w $1,$6094,$0D36,$0CFB,$0D10,0,0,2,5,2,$FF,0,$FFDC dc.w $1,$5716,$097E,$091F,$0949,0,0,2,1,2,$FF,1,0 dc.w $1,$4728,$0FEE,$0FAB,$0FC0,0,0,2,2,1,$FF,0,$FFE8 dc.w $1,$2252,$24D6,$1324,$2375,0,2,2,3,3,$FF,0,$FFDC dc.w $1,$0230,$2022,$1FC9,$1FF0,0,1,2,2,2,3,0,$FFDC dc.w $0,$E784,$1AAC,$1A32,$1A5D,0,2,2,2,2,3,0,$FFDC dc.w $0,$E73C,$0048,$001F,$002B,0,0,2,2,1,$00FF,0,0 dc.w $0,$E18C,$05B0,$057C,$0591,0,0,2,0,0,0,1,0 dc.w $0,$D17A,$1012,$0FB2,$0FE0,0,0,2,2,1,$FF,1,0 dc.w $0,$D132,$0048,$001F,$002B,0,0,2,2,1,$FF,0,0 ; samples SFX dc.w $0,$D0EA,$0048,$001F,$002B,0,0,2,2,1,$FF,0,0 dc.w $0,$D0A2,$0048,$001F,$002B,0,0,2,2,1,$FF,0,0 dc.w $0,$D05A,$0048,$001F,$002B,0,0,2,2,1,$FF,0,0 dc.w $0,$BDAC,$12AE,$122D,$1263,0,0,2,0,0,0,1,0 dc.w $0,$AFEA,$0DC2,$0D21,$0D8B,0,0,2,0,0,0,1,0 dc.w $0,$A926,$06C4,$0011,$06B3,0,0,2,0,0,0,1,0 dc.w $0,$9D6A,$0BBC,$003F,$0BAB,0,0,2,0,0,0,1,0 dc.w $0,$96DE,$068C,$0010,$0675,0,0,2,0,0,0,1,0 dc.w $0,$9290,$044E,$0400,$0400,0,0,2,0,0,0,1,0 dc.w $0,$82F4,$0F9C,$0011,$075C,0,0,2,0,0,0,1,0 dc.w $0,$6C1A,$16DA,$15CE,$1669,0,0,2,0,0,0,1,0 dc.w $0,$5196,$1A84,$0036,$1A73,0,0,2,0,0,0,1,0 dc.w $0,$3EA8,$12EE,$0011,$12DE,0,0,2,0,0,0,1,0 dc.w $0,$2E7C,$102C,$0011,$1003,0,0,2,0,0,0,1,0 dc.w $0,$21E4,$0C98,$002C,$0C85,0,0,2,0,0,0,1,0 dc.w $0,$1232,$0FB2,$0F79,$0F7A,0,0,2,0,0,0,1,0 dc.w $0,$07A4,$0A8E,$0547,$0704,0,0,2,0,0,0,1,0 dc.w $0,$0000,$07A4,$03D2,$0513,0,0,2,0,0,0,1,0 ;----------------------------------------------------------------------- Music1 incbin b:Albedo/Albedo1.mus ; 14416 .. 1530b ; 3830 octets Music2 incbin b:Albedo/Albedo2.mus ; 1530c .. 15f1f ; 3092 octets ;----------------------------------------------------------------------- section AlbedoSmp,data_c Samples incbin b:Albedo/Albedo.smp ; seuls les samples 0 à C sont utilisés ;----------------------------------------------------------------------- end