****************************************** ** PseudoReplay - Made by The Vampire ** ** additional optm: LT ** ** all rights by: PseudoDOS Group TM ** ** Version 1.0 NT - 11.4.1992 ** ****************************************** vp_data: dc.l 0 ; move.l module-adr to this ptr mt_songpos: dc.w 0 ; 0 mt_break: dc.b 0 ; 1 mt_pattpos: dc.b 0 ; 2 mt_speed: dc.b 0 ; 3 mt_counter: dc.b 0 ; 4 mt_dmacon: dc.w 0 ; 5 vp_init: move.l vp_data(pc),a0 lea vp_adr(pc),a1 lea $1c(a0),a2 move.b -1(a2),positio+3 ; modif-code for positions move.b -3(a2),maxeff+3 ; . . . moveq #0,d0 moveq #0,d1 moveq #0,d2 move.w (a2)+,d0 ; size of all patterns move.b (a2)+,d1 ; number of patterns move.b (a2)+,d2 ; number of included effect-words lea $f8(a2),a2 move.w positio+2(pc),d3 lea (a2,d3.w),a2 move.l a2,d3 btst #0,d3 beq.s vp_ini2 addq.l #1,a2 vp_ini2 move.l a2,(a1)+ addq.b #1,d1 lsl.w #4,d1 add.l d1,a2 move.l a2,(a1)+ add.w d2,d2 add.l d2,a2 move.l a2,(a1)+ add.l d0,a2 move.l a2,(a1)+ moveq #$1d,d0 lea $20(a0),a0 vp_ini3:moveq #0,d1 move.w (a0),d1 add.w d1,d1 add.l d1,a2 lea $8(a0),a0 move.l a2,(a1)+ dbf d0,vp_ini3 or.b #2,$bfe001 lea mt_songpos(pc),a0 clr.l (a0) move.b #6,4(a0) vp_end: moveq #0,d0 lea $dff000,a0 move.w d0,$a8(a0) move.w d0,$b8(a0) move.w d0,$c8(a0) move.w d0,$d8(a0) move.w #$f,$96(a0) rts DecrDatas: ; a0=dest / a2=source / a4=nmost moveq #0,d0 move.b (a2)+,d0 cmp.w d4,d0 bgt.s dn_1 add.w d0,d0 ; normal move.w (a4,d0.w),(a0)+ rts dn_1: sub.b d4,d0 ; packed move.b d0,(a6) moveq #0,d1 move.b (a2)+,d1 add.w d1,d1 move.w (a4,d1.w),(a0)+ rts vp_music: move.l vp_data(pc),a0 lea mt_songpos+1(pc),a6 addq.b #1,4(a6) ; counter move.b mt_counter(pc),d0 cmp.b mt_speed(pc),d0 blt.L mt_nonew clr.b 4(a6) ; counter lea $20(a0),a3 tst.b 2(a6) ; pattpos bne.s vp_npt move.w mt_songpos(pc),d0 lea $118(a0),a0 move.b (a0,d0.w),d0 lsl.w #4,d0 move.l ADR_mask(pc),a1 move.l ADR_patt(pc),a5 lea (a1,d0.w),a1 ; offsets of 8 columns to play lea ADR_vocs(pc),a4 moveq #7,d1 moveq #0,d0 getadr move.w (a1)+,d0 move.l a5,a0 add.l d0,a0 move.l a0,(a4)+ dbf d1,getadr clr.l num_vocs-mt_songpos-1(a6) clr.l num_vocs+4-mt_songpos-1(a6) vp_npt: ; decrunch line movem.l a2/a6,-(a7) ; a0=dest lea mt_voice1(pc),a0 lea ADR_vocs(pc),a5 lea num_vocs(pc),a6 moveq #3,d7 vp_dp_1 move.l (a5),a2 ; sourceptr tst.b (a6) bne.s vp_dp_2 lea nmost(pc),a4 moveq #$50,d4 bsr.L DecrDatas bra.s vp_dp_3 vp_dp_2 subq.b #1,(a6) addq.l #2,a0 ; next destination vp_dp_3 addq.l #1,a6 move.l a2,(a5)+ move.l (a5),a2 ; sourceptr tst.b (a6) bne.s vp_dp_4 move.l ADR_emost(pc),a4 maxeff move.w #$00,d4 bsr.L DecrDatas lea 24(a0),a0 bra.s vp_dp_5 vp_dp_4 subq.b #1,(a6) lea 26(a0),a0 ; next destination vp_dp_5 addq.l #1,a6 move.l a2,(a5)+ dbf d7,vp_dp_1 movem.l (a7)+,a2/a6 clr.w 5(a6) ; mt_dmacon lea $dff0a0,a5 lea mt_voice1(pc),a4 moveq #3,d7 vp_play bsr.L mt_playvoice lea $10(a5),a5 lea 28(a4),a4 dbf d7,vp_play lea -$da(a5),a3 move.w mt_dmacon(pc),d0 beq.s mt_nodma bsr.s mt_wait or.w #$8000,d0 move.w d0,$90(a3) bsr.s mt_wait mt_nodma: lea mt_voice1+$a(pc),a4 lea $9a(a3),a3 moveq #3,d0 vp_dma1 move.l (a4)+,(a3)+ move.w (a4),(a3) lea $1c-4(a4),a4 lea $10-4(a3),a3 dbf d0,vp_dma1 addq.b #$1,2(a6) ; pattpos cmp.b #$40,2(a6) ; pattpos bne.s vp_exit vp_next:clr.w 1(a6) ; pattpos / break addq.b #1,(a6) ; songpos positio move.w #0,d0 cmp.b (a6),d0 bne.s vp_exit clr.b (a6) vp_exit:tst.b 1(a6) bne.s vp_next rts ; leave player mt_wait:moveq #3,d3 mt_wai2:move.b (a3),d2 mt_wai3:cmp.b (a3),d2 beq.s mt_wai3 dbf d3,mt_wai2 moveq #8,d2 mt_wai4:dbf d2,mt_wai4 rts mt_nonew: lea mt_voice1(pc),a4 lea $dff0a0,a5 moveq #3,d7 vp_no bsr.L mt_com lea 28(a4),a4 lea $10(a5),a5 dbf d7,vp_no bra.s vp_exit ; leave replay mt_playvoice: moveq #0,d2 move.b 2(a4),d2 lsr.b #4,d2 move.b (a4),d0 and.b #$f0,d0 or.b d0,d2 beq.s mt_oldinstr lea vp_samplestarts(pc),a1 subq.l #1,d2 add.w d2,d2 add.w d2,d2 move.l (a1,d2.w),4(a4) ; smp adr add.w d2,d2 lea (a3,d2.w),a2 move.w (a2)+,8(a4) move.w (a2)+,$12(a4) move.w (a2),d3 tst.w d3 beq.s mt_noloop move.l 4(a4),a0 add.w d3,d3 lea (a0,d3.w),a0 move.l a0,$a(a4) move.w (a2),d0 add.w 2(a2),d0 move.w d0,8(a4) bra.s mt_hejaSverige mt_noloop: move.l 4(a4),$a(a4) mt_hejaSverige: move.w 2(a2),$e(a4) moveq #0,d0 move.b $13(a4),d0 move.w d0,8(a5) mt_oldinstr: move.w (a4),d0 and.w #$fff,d0 beq.L mt_com2 tst.w 8(a4) beq.s mt_stopsound tst.b $12(a4) bne.s mt_stopsound move.b 2(a4),d0 and.b #$f,d0 cmp.b #5,d0 beq.s mt_setport cmp.b #3,d0 beq.s mt_setport move.w (a4),$10(a4) and.w #$fff,$10(a4) move.w $1a(a4),$dff096 clr.b $19(a4) move.l 4(a4),(a5) move.w 8(a4),4(a5) move.w $10(a4),6(a5) move.w $1a(a4),d0 ;dmaset or.w d0,5(a6) ;mt_dmacon bra.L mt_com2 mt_stopsound: move.w $1a(a4),$dff096 bra.L mt_com2 mt_setport: move.w (a4),d2 and.w #$fff,d2 move.w d2,$16(a4) move.w $10(a4),d0 clr.b $14(a4) cmp.w d0,d2 beq.s mt_clrport bge.L mt_com2 move.b #1,$14(a4) bra.L mt_com2 mt_clrport: clr.w $16(a4) rts mt_port:move.b 3(a4),d0 beq.s mt_port2 move.b d0,$15(a4) clr.b 3(a4) mt_port2: tst.w $16(a4) beq.s mt_rts moveq #0,d0 move.b $15(a4),d0 tst.b $14(a4) bne.s mt_sub add.w d0,$10(a4) move.w $16(a4),d0 cmp.w $10(a4),d0 bgt.s mt_portok move.w $16(a4),$10(a4) clr.w $16(a4) mt_portok: move.w $10(a4),6(a5) mt_rts: rts mt_sub: sub.w d0,$10(a4) move.w $16(a4),d0 cmp.w $10(a4),d0 blt.s mt_portok move.w $16(a4),$10(a4) clr.w $16(a4) move.w $10(a4),6(a5) rts mt_sin: dc.b $00,$18,$31,$4a,$61,$78,$8d,$a1,$b4,$c5,$d4,$e0,$eb,$f4,$fa,$fd dc.b $ff,$fd,$fa,$f4,$eb,$e0,$d4,$c5,$b4,$a1,$8d,$78,$61,$4a,$31,$18 mt_vib: move.b $3(a4),d0 beq.s mt_vib2 move.b d0,$18(a4) mt_vib2:move.b $19(a4),d0 lsr.w #2,d0 and.w #$1f,d0 moveq #0,d2 move.b mt_sin(pc,d0.w),d2 move.b $18(a4),d0 and.w #$f,d0 mulu d0,d2 lsr.w #7,d2 move.w $10(a4),d0 tst.b $19(a4) bmi.s mt_vibsub add.w d2,d0 bra.s mt_vib3 mt_vibsub: sub.w d2,d0 mt_vib3:move.w d0,6(a5) move.b $18(a4),d0 lsr.w #2,d0 and.w #$3c,d0 add.b d0,$19(a4) rts mt_arp: move.b mt_counter(pc),d0 and.w #3,d0 beq.s mt_arp0 cmp.b #2,d0 bge.s mt_arp2 mt_arp1:moveq #0,d0 move.b 3(a4),d0 lsr.b #4,d0 bra.s mt_arpdo mt_arp2:move.b 3(a4),d0 and.w #$f,d0 mt_arpdo: add.w d0,d0 move.w $10(a4),d1 and.w #$fff,d1 lea mt_peri(pc),a0 moveq #$24,d2 mt_arp3:cmp.w (a0)+,d1 bge.s mt_arpfound dbf d2,mt_arp3 mt_arp0:move.w $10(a4),6(a5) rts mt_arpfound: move.w -2(a0,d0.w),6(a5) rts mt_com: move.w 2(a4),d0 and.w #$fff,d0 beq.s mt_arp0 move.b 2(a4),d0 and.w #$f,d0 beq.s mt_arp cmp.b #6,d0 bgt.s vp_comx add.w d0,d0 move.w vp_comjmp-2(pc,d0.w),d0 jmp (a6,d0.w) vp_comx bsr.s mt_arp0 cmp.b #$a,d0 beq.s mt_volslide rts vp_comjmp: dc.w mt_portup-mt_songpos-1 ; 1 dc.w mt_portdown-mt_songpos-1 ; 2 dc.w mt_port-mt_songpos-1 ; 3 dc.w mt_vib-mt_songpos-1 ; 4 dc.w mt_volport-mt_songpos-1 ; 5 dc.w mt_volvib-mt_songpos-1 ; 6 mt_portup: moveq #$71,d1 moveq #$10,d2 moveq #0,d0 move.b 3(a4),d0 sub.w d0,(a4,d2.w) move.w (a4,d2.w),d0 cmp.w d1,d0 bpl.s mt_portup2 move.w d1,(a4,d2.w) mt_portup2: move.w (a4,d2.w),6(a5) rts mt_portdown: move.w #$358,d1 moveq #$10,d2 moveq #0,d0 move.b 3(a4),d0 add.w (a4,d2.w),d0 cmp.w d1,d0 bmi.s mt_portdown2 move.w d1,d0 mt_portdown2: move.w d0,6(a5) move.w d0,(a4,d2.w) rts mt_volvib: bsr.L mt_vib2 bra.s mt_volslide mt_volport: bsr.L mt_port2 mt_volslide: moveq #$13,d2 moveq #$40,d1 moveq #0,d0 move.b 3(a4),d0 lsr.b #4,d0 beq.s mt_vol3 add.b (a4,d2.w),d0 cmp.b d1,d0 bmi.s mt_vol2 move.b d1,d0 mt_vol2:move.b d0,9(a5) move.b d0,(a4,d2.w) rts mt_vol3:move.b 3(a4),d0 and.b #$f,d0 sub.b d0,(a4,d2.w) bpl.s mt_vol4 clr.b (a4,d2.w) mt_vol4:move.b (a4,d2.w),9(a5) rts mt_com2:move.b $2(a4),d0 and.w #$f,d0 cmp.b #$e,d0 bne.s mt_pattbreak move.b 3(a4),d0 ; Filter and.b #1,d0 add.b d0,d0 and.b #$fd,$bfe001 or.b d0,$bfe001 rts mt_pattbreak: cmp.b #$d,d0 bne.s mt_songjmp seq 1(a6) rts mt_songjmp: cmp.b #$b,d0 bne.s mt_setvol seq 1(a6) move.b 3(a4),d0 subq.b #1,d0 move.b d0,(a6) rts mt_setvol: cmp.b #$c,d0 bne.s mt_setspeed move.b 3(a4),d0 move.b d0,$13(a4) move.b d0,9(a5) rts mt_setspeed: cmp.b #$f,d0 bne.s vp_cm2x move.b 3(a4),3(a6) vp_cm2x rts dc.b ' PseudoReplay by Vampire of PseudoDOS Group ' nmost: dc.w $1358,$1328,$12fa,$12d0,$12a6,$1280,$125c,$123a,$121a,$11fc dc.w $11e0,$11c5,$11ac,$1194,$117d,$1168,$1153,$1140,$112e,$111d dc.w $110d,$10fe,$10f0,$10e2,$10d6,$10ca,$10be,$10b4,$10aa,$10a0 dc.w $1097,$108f,$1087,$107f,$1078,$1071,$1000 mt_peri:dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c,$023a,$021a,$01fc dc.w $01e0,$01c5,$01ac,$0194,$017d,$0168,$0153,$0140,$012e,$011d dc.w $010d,$00fe,$00f0,$00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0 dc.w $0097,$008f,$0087,$007f,$0078,$0071,$0000 mt_voice1: blk.w 13,0 dc.w 1 mt_voice2: blk.w 13,0 dc.w 2 mt_voice3: blk.w 13,0 dc.w 4 mt_voice4: blk.w 13,0 dc.w 8 ADR_vocs: blk.l 8,0 num_vocs: blk.b 8,0 vp_adr: ADR_mask dc.l 0 ADR_emost dc.l 0 ADR_patt dc.l 0 vp_samplestarts: blk.l $1f dc.b 'Ende !' .