home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
369b.lha
/
MED_v2.0
/
Source
/
medsrc
/
med-vbserv.a
< prev
next >
Wrap
Text File
|
1990-05-03
|
3KB
|
155 lines
; MED-vbserv.a: Vertical blank interrupt
xref _pylvkork
xdef _PiirraPylvas
xdef _PylvKesk
xdef DrawEqualizer
xref _pylvasalku0
xref _pylvasalku1
xref _pylvasalku2
xref _midiactive
xref _AddMIDIData
xref _firstdisptrk
xref _soittotila
xref _specialupd
xref _equalizerok
code
; build equalizer: Plane0 = $5a, Plane1 = $3c, Plane3 = $ff
_PiirraPylvas: ;instr. number in d0, height = d1
movem.l a2/a3/d2-d3,-(sp)
tst.l _pylvasalku0
beq.s ex0
lea _pylvkork,a3
move.w d0,d2
clr.b 0(a3,d2.w) ;clear height
movea.l _pylvasalku0,a0
movea.l _pylvasalku1,a1
movea.l _pylvasalku2,a2
add.w #1240,d0 ;d0 = offset of the lowest byte
move.b d1,d3 ;save height
subq.l #1,d1
ppl: move.b #$5a,0(a0,d0.w) ;directly to screen bitmap
move.b #$3c,0(a1,d0.w)
move.b #$ff,0(a2,d0.w)
sub.w #40,d0 ;from down to up
dbf d1,ppl
moveq.l #31,d1
sub.b d3,d1
bmi.s nopclr
ppl2: st.b 0(a0,d0.w)
st.b 0(a1,d0.w)
clr.b 0(a2,d0.w)
sub.w #40,d0
dbf d1,ppl2
nopclr: move.b d3,0(a3,d2.w) ;height
ex0: movem.l (sp)+,a2/a3/d2-d3
rts
_PylvKesk: ;interrupt handler
tst.b _midiactive
beq.s nomidi
subq.b #1,actsens
bne.s nomidi
move.b #15,actsens
move.l a1,-(sp)
moveq.l #1,d0
lea actsens+1(pc),a0
jsr _AddMIDIData(pc)
move.l (sp)+,a1
nomidi: move.l a2,-(sp)
tst.l _pylvasalku0
beq.s ex1
movea.l _pylvasalku0,a0
movea.l _pylvasalku1,a2
movea.l _pylvasalku2,a5
moveq.l #30,d0
ckloop: tst.b 0(a1,d0.w)
ble.s nxloop ;no this "column" (equalizer)
moveq.l #32,d1
sub.b 0(a1,d0.w),d1 ;how many lines from the beginning
mulu #40,d1 ;every line = 40 bytes
add.w d0,d1
st.b 0(a0,d1.w)
st.b 0(a2,d1.w)
clr.b 0(a5,d1.w)
subq.b #1,0(a1,d0.w) ;subtract from the variable
nxloop: dbf d0,ckloop
ex1:
tst.b _equalizerok
beq.s ex2
moveq.l #0,d0 ;handle the channel-equalizer
moveq.l #0,d1
lea eqheight(pc),a2
lea clrptrs(pc),a0
equalloop: movea.l (a0),a1
move.b 0(a2,d1.w),d0
ble.s equalend
clr.l (a1)+
addq.l #8,(a0)
subq.b #2,0(a2,d1.w)
bmi.s equalend
clr.l (a1)
equalend: addq.l #4,a0
addq.b #1,d1
cmp.b #4,d1
blt.s equalloop
ex2: btst #6,$bfe001 ;Panic-stop (both mousebuttons)
bne.s exvb
btst #10,$dff016
bne.s exvb
addq.b #1,panic
bne.s exvb2
clr.w _soittotila
or.b #2,_specialupd
exvb: clr.b panic
exvb2: move.l (sp)+,a2
moveq.l #0,d0
rts ;return control to Exec
actsens: dc.b 0,$FE
panic: dc.w 0
xref _eq1
xref _eq2
xref _eq3
xref _eq4
clrptrs: dc.l 0,0,0,0
eqptrs: dc.l _eq1,_eq2,_eq3,_eq4
eqheight: dc.b 0,0,0,0
DrawEqualizer: tst.b _equalizerok ;draw it??
beq.s enddeql3 ;no...
movem.l a2/d0-d4,-(sp) ;this routine draws the channel-
sub.b _firstdisptrk,d0 ;equalizer (track = d0, vol = d2)
bmi.s enddeql2
cmp.b #4,d0
bge.s enddeql2
lea eqheight(pc,d0.w),a2
clr.b (a2)
move.l #$c0033fff,d3
lsl.b #2,d0
lea clrptrs(pc,d0.w),a0
movea.l 16(a0),a1
adda.l #256,a1
cmp.b #63,d2
ble.s no64
moveq.l #63,d2
no64: move.w d2,d4
subq.b #1,d2
bmi.s vol0
dsprl: move.l d3,-(a1)
dbf d2,dsprl
move.l a1,(a0)
vol0: moveq.l #63,d2
sub.b d4,d2
beq.s enddeql
subq.b #1,d2
moveq.l #0,d3
dsprl2: move.l d3,-(a1)
dbf d2,dsprl2
enddeql: move.b d4,(a2)
enddeql2: movem.l (sp)+,a2/d0-d4
enddeql3: rts
end