;----------------------------------------------------------- ; ; Api92/Api89 Source Code ; ; (c) NeXO Software, Benoit SCHERRER ; e-mail : p.c.scherrer@wanadoo.fr ; ; ; File> vscroll.xas ; Utility> VScroll component ; ;----------------------------------------------------------- ;----------------------------------------------------- ; 00.w : current value ; 02.w : X ; 04.w : Y ; 06.w : Height ; 08.w : Max value ; ;----------------------------------------------------- apilib@006B: _VScrollComponent: movem.l d0-d7/a0-a6,-(a7) move.l a0,a2 subq.l #4,a7 ;create stack frame move.l a7,a3 move.w (a0)+,d6 ;current value move.w (a0)+,d0 ;X move.w (a0)+,d1 ;Y move.w (a0)+,d7 ;Height move.w (a0)+,d4 ;MaxValue bne.s \nozero moveq.w #1,d4 \nozero move.w (a0)+,d5 ;Height of bar moveq.w #4,d2 lea gfx_VScroll1(PC),a0 ;addr bsr _draw_GFX8xn move.b d0,(a3) ;x1 addq.w #5,d1 move.b d1,1(a3) ;y1 move.w d1,-(a7) ;save d1 add.w d7,d1 sub.w #5*2,d1 lea gfx_VScroll2(PC),a0 ;addr bsr _draw_GFX8xn addq.w #7,d0 subq.w #1,d1 move.b d0,2(a3) move.b d1,3(a3) move.l a3,a0 bsr _draw_sSolidRect subq.w #6,d0 ;X sub.w d5,d7 ;height-heightbar sub.w #5*2,d7 ;height of bitmaps mulu.w d6,d7 divu.w d4,d7 ;Y add.w (a7)+,d7 move.w d7,d1 moveq.w #5,d2 ;width subq.w #1,d5 \drawbar bsr _draw_HorizontalLine addq.w #1,d1 dbra.s d5,\drawbar addq.l #4,a7 ;delete stack frame movem.l (a7)+,d0-d7/a0-a6 rts gfx_VScroll1: dc.b %11111111 dc.b %10000001 dc.b %10011001 dc.b %10111101 dc.b %10000001 gfx_VScroll2: dc.b %10000001 dc.b %10111101 dc.b %10011001 dc.b %10000001 dc.b %11111111