******************************************* ** ReTrack - V0.0vp march 16.1992 ** ** Utility by Vampire of PseudoDOS Group ** ******************************************* >extern "dh0:modules/mod.elysium",$2f548 ReTrack: move.l a7,merk move.l $4.w,a6 jsr -132(a6) move.w #$4000,$dff09a bsr x_init loop: move.l $dff004,d0 and.l #$000fff00,d0 cmp.l #$00010000,d0 bne.s loop bsr x_play btst #6,$bfe001 bne.s loop bsr x_end move.l $4.w,a6 jsr -138(a6) exit move.l merk(pc),a7 rts error: move.w d0,$dff180 btst #6,$bfe001 bne.s error bra.s exit merk: dc.l 0 x_init LEA $0002F548.L,A0 MOVE.L $0438(A0),D2 MOVEA.L A0,A2 ADDA.L D2,A2 LEA x_sampleadr(PC),A1 ADDA.L #$0000002A,A0 MOVEQ #$001E,D0 x_initsmp CLR.L (A2) MOVE.L A2,(A1)+ MOVEQ #0,D1 MOVE.W (A0),D1 CLR.B 2(A0) ASL.L #1,D1 ADDA.L D1,A2 ADDA.L #$0000001E,A0 DBRA D0,x_initsmp ORI.B #2,$00BFE001.L MOVE.B #6,L_0000096A MOVEQ #0,D0 LEA $00DFF000.L,A0 MOVE.W D0,$00A8(A0) MOVE.W D0,$00B8(A0) MOVE.W D0,$00C8(A0) MOVE.W D0,$00D8(A0) CLR.B x_songpos CLR.B x_counter CLR.W x_pattpos LEA $0002F900.L,A0 MOVEQ #0,D0 MOVE.B (A0),D0 LSL.W #3,D0 LEA $0002F984.L,A0 ADDA.L D0,A0 MOVE.L #$0002F548,D1 LEA x_voice1,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) LEA x_voice2,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) LEA x_voice3,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) LEA x_voice4,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) RTS x_end CLR.W $00DFF0A8.L CLR.W $00DFF0B8.L CLR.W $00DFF0C8.L CLR.W $00DFF0D8.L MOVE.W #$000F,$00DFF096.L RTS x_play LEA $0002F548.L,A0 ADDQ.B #1,x_counter MOVE.B x_counter(PC),D0 CMP.B x_speed(PC),D0 BLT x_nonew CLR.B x_counter LEA $0002F548.L,A0 LEA $000C(A0),A3 LEA $03B8(A0),A2 LEA $043C(A0),A0 MOVEQ #0,D0 MOVEQ #0,D1 MOVE.B x_songpos(PC),D0 MOVE.B (A2,D0.W),D1 LSL.W #8,D1 LSL.W #2,D1 ADD.W x_pattpos(PC),D1 CLR.W x_dmacon LEA $00DFF0A0.L,A5 LEA x_voice1(PC),A4 BSR x_playvoice BSR x_sub ADDQ.L #4,D1 LEA $00DFF0B0.L,A5 LEA x_voice2(PC),A4 BSR x_playvoice BSR x_sub ADDQ.L #4,D1 LEA $00DFF0C0.L,A5 LEA x_voice3(PC),A4 BSR x_playvoice BSR x_sub ADDQ.L #4,D1 LEA $00DFF0D0.L,A5 LEA x_voice4(PC),A4 BSR x_playvoice BSR x_sub BSR x_wait MOVE.W x_dmacon(PC),D0 ORI.W #-$8000,D0 MOVE.W D0,$00DFF096.L BSR L_000002FE LEA x_voice1(PC),A4 LEA $00DFF000.L,A3 MOVE.L $000A(A4),$00A0(A3) MOVE.W $000E(A4),$00A4(A3) MOVE.W $0012(A4),$00A8(A3) MOVE.L $0032(A4),$00B0(A3) MOVE.W $0036(A4),$00B4(A3) MOVE.W $003A(A4),$00B8(A3) MOVE.L $005A(A4),$00C0(A3) MOVE.W $005E(A4),$00C4(A3) MOVE.W $0062(A4),$00C8(A3) MOVE.L $0082(A4),$00D0(A3) MOVE.W $0086(A4),$00D4(A3) MOVE.W $008A(A4),$00D8(A3) ADDI.W #$0010,x_pattpos CMPI.W #$0400,x_pattpos BNE L_000002D6 L_00000220 CLR.W x_pattpos CLR.B x_break LEA $0002F548.L,A0 ADDQ.B #1,x_songpos ANDI.B #$007F,x_songpos MOVE.B $03B6(A0),D0 CMP.B x_songpos(PC),D0 BNE.S L_00000252 MOVE.B $03B7(A0),x_songpos L_00000252 LEA $0002F900.L,A0 MOVEQ #0,D0 MOVE.B x_songpos,D0 ADDA.L D0,A0 MOVEQ #0,D0 MOVE.B (A0),D0 LSL.W #3,D0 LEA $0002F984.L,A0 ADDA.L D0,A0 MOVE.L #$0002F548,D1 LEA x_voice1,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) LEA x_voice2,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) LEA x_voice3,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) LEA x_voice4,A1 MOVEQ #0,D0 MOVE.W (A0)+,D0 ADD.L D1,D0 MOVE.L D0,$001E(A1) CLR.W $001C(A1) CLR.B $0022(A1) L_000002D6 TST.B x_break BNE L_00000220 RTS x_wait MOVEQ #3,D3 x_wait2 MOVE.B $00DFF006.L,D2 x_wait3 CMP.B $00DFF006.L,D2 BEQ.S x_wait3 DBRA D3,x_wait2 MOVEQ #8,D2 x_wait4 DBRA D2,x_wait4 RTS L_000002FE MOVEQ #3,D3 L_00000300 MOVE.B $00DFF006.L,D2 L_00000306 CMP.B $00DFF006.L,D2 BEQ.S L_00000306 DBRA D3,L_00000300 MOVEQ #8,D2 L_00000314 DBRA D2,L_00000314 RTS x_nonew LEA x_voice1(PC),A4 LEA $00DFF0A0.L,A5 BSR x_com BSR x_sub LEA x_voice2(PC),A4 LEA $00DFF0B0.L,A5 BSR x_com BSR x_sub LEA x_voice3(PC),A4 LEA $00DFF0C0.L,A5 BSR x_com BSR x_sub LEA x_voice4(PC),A4 LEA $00DFF0D0.L,A5 BSR x_com BSR x_sub BRA L_000002D6 L_00000366 DC.L $1E DC.L $3C005A DC.L $780096 DC.L $B400D2 DC.L $F0010E DC.L $12C014A DC.L $1680186 DC.L $1A401C2 DC.L $1E001FE DC.L $21C023A DC.L $2580276 DC.L $29402B2 DC.L $2D002EE DC.L $30C032A DC.L $3480366 DC.L $38403A2 x_playvoice BSR L_00000764 MOVEQ #0,D2 MOVE.B 2(A4),D2 LSR.B #4,D2 MOVE.B (A4),D0 ANDI.B #-$0010,D0 OR.B D0,D2 BEQ.S L_00000414 LEA x_songpos(PC),A1 ASL.W #2,D2 MOVE.L (A1,D2.L),4(A4) LSR.W #1,D2 MOVE.W L_00000366(PC,D2.W),D2 MOVE.W (A3,D2.W),8(A4) MOVE.W 2(A3,D2.W),$0012(A4) MOVE.B $0013(A4),$0022(A4) MOVEQ #0,D3 MOVE.W 4(A3,D2.W),D3 TST.W D3 BEQ.S L_00000404 MOVE.L 4(A4),D0 ASL.W #1,D3 ADD.L D3,D0 MOVE.L D0,$000A(A4) MOVE.W 4(A3,D2.W),D0 ADD.W 6(A3,D2.W),D0 MOVE.W D0,8(A4) BRA.S L_0000040E L_00000404 MOVE.L 4(A4),D0 ADD.L D3,D0 MOVE.L D0,$000A(A4) L_0000040E MOVE.W 6(A3,D2.W),$000E(A4) L_00000414 MOVE.W (A4),D0 ANDI.W #$0FFF,D0 BEQ x_com2 TST.W 8(A4) BEQ.S L_00000472 TST.B $0012(A4) BNE.S L_00000472 MOVE.B 2(A4),D0 ANDI.B #$000F,D0 CMP.B #5,D0 BEQ.S L_0000047E CMP.B #3,D0 BEQ.S L_0000047E MOVE.W (A4),$0010(A4) ANDI.W #$0FFF,$0010(A4) MOVE.W $001A(A4),$00DFF096.L CLR.B $0019(A4) MOVE.L 4(A4),(A5) MOVE.W 8(A4),4(A5) MOVE.W $0010(A4),6(A5) MOVE.W $001A(A4),D0 OR.W D0,x_dmacon BRA x_com2 L_00000472 MOVE.W $001A(A4),$00DFF096.L BRA x_com2 L_0000047E MOVE.W (A4),D2 ANDI.W #$0FFF,D2 MOVE.W D2,$0016(A4) MOVE.W $0010(A4),D0 CLR.B $0014(A4) CMP.W D0,D2 BEQ.S L_000004A2 BGE x_com2 MOVE.B #1,$0014(A4) BRA x_com2 L_000004A2 CLR.W $0016(A4) RTS L_000004A8 MOVE.B 3(A4),D0 BEQ.S L_000004B6 MOVE.B D0,$0015(A4) CLR.B 3(A4) L_000004B6 TST.W $0016(A4) BEQ.S L_000004E6 MOVEQ #0,D0 MOVE.B $0015(A4),D0 TST.B $0014(A4) BNE.S L_000004E8 ADD.W D0,$0010(A4) MOVE.W $0016(A4),D0 CMP.W $0010(A4),D0 BGT.S L_000004E0 MOVE.W $0016(A4),$0010(A4) CLR.W $0016(A4) L_000004E0 MOVE.W $0010(A4),6(A5) L_000004E6 RTS L_000004E8 SUB.W D0,$0010(A4) MOVE.W $0016(A4),D0 CMP.W $0010(A4),D0 BLT.S L_000004E0 MOVE.W $0016(A4),$0010(A4) CLR.W $0016(A4) MOVE.W $0010(A4),6(A5) RTS x_sintab DC.L $18314A DC.L $61788DA1 DC.L -$4B3A2B20 DC.L -$140B0503 DC.L -$2050C DC.L -$141F2B3B DC.L -$4B5E7288 DC.L $614A3118 L_00000528 MOVE.B 3(A4),D0 BEQ.S L_00000532 MOVE.B D0,$0018(A4) L_00000532 MOVE.B $0019(A4),D0 LSR.W #2,D0 ANDI.W #$001F,D0 MOVEQ #0,D2 MOVE.B x_sintab(PC,D0.W),D2 MOVE.B $0018(A4),D0 ANDI.W #$000F,D0 MULU D0,D2 LSR.W #7,D2 MOVE.W $0010(A4),D0 TST.B $0019(A4) BMI.S L_0000055C ADD.W D2,D0 BRA.S L_0000055E L_0000055C SUB.W D2,D0 L_0000055E MOVE.W D0,6(A5) MOVE.B $0018(A4),D0 LSR.W #2,D0 ANDI.W #$003C,D0 ADD.B D0,$0019(A4) RTS x_arptab DC.L $10200 DC.L $1020001 DC.L $2000102 DC.L $10200 DC.L $1020001 DC.L $2000102 DC.L $10200 DC.L $1020001 x_arp MOVEQ #0,D0 MOVE.B x_counter(PC),D0 MOVE.B x_arptab(PC,D0.W),D0 BEQ.S x_arp4 CMP.B #2,D0 BEQ.S x_arp1 MOVEQ #0,D0 MOVE.B 3(A4),D0 LSR.B #4,D0 BRA.S x_arp2 x_arp1 MOVEQ #0,D0 MOVE.B 3(A4),D0 ANDI.B #$000F,D0 x_arp2 ASL.W #1,D0 MOVE.W $0010(A4),D1 ANDI.W #$0FFF,D1 LEA x_periods(PC),A0 MOVEQ #$0024,D2 x_arp3 CMP.W (A0)+,D1 BGE.S x_arp5 DBRA D2,x_arp3 x_arp4 MOVE.W $0010(A4),6(A5) RTS x_arp5 MOVE.W -2(A0,D0.W),6(A5) RTS x_normal MOVE.W $0010(A4),6(A5) RTS x_com MOVE.W 2(A4),D0 ANDI.W #$0FFF,D0 BEQ.S x_normal MOVE.B 2(A4),D0 ANDI.B #$000F,D0 TST.B D0 BEQ.S x_arp CMP.B #1,D0 BEQ.S L_00000634 CMP.B #2,D0 BEQ.S L_00000656 CMP.B #3,D0 BEQ L_000004A8 CMP.B #4,D0 BEQ L_00000528 CMP.B #5,D0 BEQ.S L_0000067E CMP.B #6,D0 BEQ.S L_00000678 MOVE.W $0010(A4),6(A5) CMP.B #$000A,D0 BEQ.S L_00000682 RTS L_00000634 MOVEQ #0,D0 MOVE.B 3(A4),D0 SUB.W D0,$0010(A4) MOVE.W $0010(A4),D0 CMP.W #$0071,D0 BPL.S L_0000064E MOVE.W #$0071,$0010(A4) L_0000064E MOVE.W $0010(A4),6(A5) RTS L_00000656 MOVEQ #0,D0 MOVE.B 3(A4),D0 ADD.W D0,$0010(A4) MOVE.W $0010(A4),D0 CMP.W #$0358,D0 BMI.S L_00000670 MOVE.W #$0358,$0010(A4) L_00000670 MOVE.W $0010(A4),6(A5) RTS L_00000678 BSR L_00000532 BRA.S L_00000682 L_0000067E BSR L_000004B6 L_00000682 MOVEQ #0,D0 MOVE.B 3(A4),D0 LSR.B #4,D0 BEQ.S L_000006AA ADD.B D0,$0013(A4) CMPI.B #$0040,$0013(A4) BMI.S L_0000069E MOVE.B #$0040,$0013(A4) L_0000069E MOVEQ #0,D0 MOVE.B $0013(A4),D0 MOVE.W D0,8(A5) RTS L_000006AA MOVE.B 3(A4),D0 ANDI.B #$000F,D0 SUB.B D0,$0013(A4) BPL.S L_000006BC CLR.B $0013(A4) L_000006BC MOVEQ #0,D0 MOVE.B $0013(A4),D0 MOVE.W D0,8(A5) RTS x_com2 MOVE.B 2(A4),D0 ANDI.B #$000F,D0 CMP.B #$000E,D0 BEQ.S x_filter CMP.B #$000D,D0 BEQ.S x_pattbreak CMP.B #$000B,D0 BEQ.S x_songjmp CMP.B #$000C,D0 BEQ.S x_setvol CMP.B #$000F,D0 BEQ.S x_setspeed RTS x_filter MOVE.B 3(A4),D0 ANDI.B #1,D0 ASL.B #1,D0 ANDI.B #-3,$00BFE001.L OR.B D0,$00BFE001.L RTS x_pattbreak MOVE.B #1,x_break RTS x_songjmp MOVE.B #1,x_break MOVE.B 3(A4),D0 SUBQ.B #1,D0 MOVE.B D0,x_songpos RTS x_setvol CMPI.B #$0040,3(A4) BLS.S x_setvol2 MOVE.B #$0040,3(A4) x_setvol2 MOVEQ #0,D0 MOVE.B 3(A4),D0 MOVE.B D0,$0013(A4) MOVE.W D0,8(A5) RTS x_setspeed MOVEQ #0,D0 MOVE.B 3(A4),D0 CMP.B #$001F,D0 BLS.S L_00000756 MOVEQ #$001F,D0 L_00000756 TST.W D0 BNE.S L_0000075C MOVEQ #1,D0 L_0000075C MOVE.B D0,x_speed RTS L_00000764 MOVE.W $001C(A4),D0 BEQ L_0000077A SUBI.W #1,$001C(A4) MOVE.L #$00000000,(A4) RTS L_0000077A MOVEA.L $001E(A4),A0 MOVE.B (A0),D0 BGE L_000007D0 BTST #6,D0 BEQ L_000007A4 ADDI.L #$00000001,$001E(A4) ANDI.W #$003F,D0 MOVE.W D0,$001C(A4) MOVE.L #$00000000,(A4) RTS L_000007A4 MOVE.W D0,D1 ANDI.W #$0010,D0 OR.B 1(A0),D0 LSL.L #8,D0 MOVE.B 2(A0),D0 LSL.L #8,D0 ANDI.W #$000F,D1 LSL.W #4,D1 MOVE.B D1,D0 LSL.L #8,D0 MOVE.B #0,D0 ADDI.L #$00000003,$001E(A4) MOVE.L D0,(A4) RTS L_000007D0 BTST #6,D0 BEQ L_000007F0 ANDI.W #$003F,D0 LSL.W #8,D0 MOVE.B 1(A0),D0 ADDI.L #$00000002,$001E(A4) EXT.L D0 MOVE.L D0,(A4) RTS L_000007F0 LSL.L #8,D0 MOVE.B 1(A0),D0 LSL.L #8,D0 MOVE.B 2(A0),D0 LSL.L #8,D0 MOVE.B 3(A0),D0 MOVE.L D0,(A4) ADDI.L #$00000004,$001E(A4) RTS x_sub SUBI.B #1,$0022(A4) BGT L_0000081E MOVE.B #0,$0022(A4) L_0000081E RTS x_periods DC.L $3580328 DC.L $2FA02D0 DC.L $2A60280 DC.L $25C023A DC.L $21A01FC DC.L $1E001C5 DC.L $1AC0194 DC.L $17D0168 DC.L $1530140 DC.L $12E011D DC.L $10D00FE DC.L $F000E2 DC.L $D600CA DC.L $BE00B4 DC.L $AA00A0 DC.L $97008F DC.L $87007F DC.L $780071 DC.W 0 x_speed DC.B 4 x_counter DC.B 0 x_pattpos DC.W $1C0 x_songpos DC.B $21 x_break DC.B 0 x_dmacon DC.W 0 x_sampleadr DC.L $33C10 DC.L $3485E DC.L $3AF6E DC.L $3AF6E DC.L $3C008 DC.L $3D0A2 DC.L $40DBA DC.L $44142 DC.L $445FE DC.L $45FDC DC.L $46B7E DC.L $480C8 DC.L $497AC DC.L $4B852 DC.L $4D842 DC.L $4E1FC DC.L $4F0B2 DC.L $4FA06 DC.L $5041C DC.L $51924 DC.L $528CA DC.L $54B88 DC.L $565B2 DC.L $59EFA DC.L $59EFA DC.L $5ADC4 DC.L $5D798 DC.L $5FA56 DC.L $60B04 DC.L $614BE DC.L $62A08 x_voice1 DC.L 0 DC.L $4D842 DC.L $4DD0004 DC.L -$27BDFFFF DC.L $B4002C DC.L $1500000 DC.L $71000001 DC.L 3 DC.L $2B233B00 DC.L 0 x_voice2 DC.L 0 DC.L $445FE DC.L $CEF0004 DC.L $45FE0001 DC.L $BE0029 DC.L $1500000 DC.L $71000002 DC.L 3 DC.L $2B9B2400 DC.L 0 x_voice3 DC.L 0 DC.L $33C10 DC.L $6270003 DC.L $3C100001 DC.L $BE0033 DC.L $1500000 DC.L $76000004 DC.L 3 DC.L $2C022E00 DC.L 0 x_voice4 DC.L 0 DC.L $497AC DC.L $10530004 DC.L -$681BEFC9 DC.L $1400040 DC.L $700000 DC.L $61000008 DC.L $40003 DC.L $2C5B1300 DC.L 0 DC.L $1A88 DC.L $10000 DC.L 1 DC.L $4B DC.L $D DC.L $C0006 DC.L -$531FFFF9 DC.L $E005F4 DC.L $24405F4 DC.L $7A3 DC.L $600060 DC.L $C DC.L $4000C DC.L 2 DC.L $C01D6 DC.L -$12968161 DC.L $18E683D9 DC.L -$12968277 DC.L $18E601D6 DC.L 0 DC.L 1 DC.L $40FC0000 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L 0 DC.L $C046 DC.L $51F09C12 DC.L $3EE10000 DC.L $100 DC.W $944 .