home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 44
/
Amiga_Dream_44.iso
/
Amiga
/
workbench
/
pilotes
/
scanners
/
StScan.lha
/
StScan
/
scnplane.s
< prev
next >
Wrap
Text File
|
1997-08-11
|
16KB
|
723 lines
;*
;* $VER: scnplanes.s 3.00D (11.8.97)
;*
;* STScan assembler routines
;*
;* Written by Frank-Christian Kruegel, Henning Peters, Andreas R. Kleinert
;* GNU General Public License V2
;*
SECTION "scnplane",CODE
_p64to16:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),d7
subq.w #1,d7
slp: move.w (a0)+,d0
lsr.w #2,d0
lsl.b #4,d0
lsr.w #4,d0
move.b d0,(a1)+
dbra d7,slp
movem.l (a7)+,d0-d7/a0-a6
rts
_clrscr16:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a1
move.l 68(a7),a2
move.l 72(a7),a3
move.l 76(a7),a4
move.w 80(a7),d5
subq.w #1,d5
clr4lp0:
move.w 82(a7),d7
lsr.w #1,d7
subq.w #1,d7
clr4lp1:
clr.w (a1)+
clr.w (a2)+
clr.w (a3)+
clr.w (a4)+
dbra d7,clr4lp1
lea.l 2(a1),a1
lea.l 2(a2),a2
lea.l 2(a3),a3
lea.l 2(a4),a4
dbra d5,clr4lp0
movem.l (a7)+,d0-d7/a0-a6
rts
_clrscr4:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a1
move.l 68(a7),a2
move.w 72(a7),d5
subq.w #1,d5
clr2lp0:
move.w 74(a7),d7
lsr.w #1,d7
subq.w #1,d7
clr2lp1:
clr.w (a1)+
clr.w (a2)+
dbra d7,clr2lp1
lea.l 2(a1),a1
lea.l 2(a2),a2
dbra d5,clr2lp0
movem.l (a7)+,d0-d7/a0-a6
rts
_bwview16:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),a3
move.l 80(a7),a4
move.l 84(a7),a5
move.w 88(a7),d5
subq.w #1,d5
bw4lp0: move.l a0,a6
move.w 92(a7),d7
subq.w #1,d7
bw4lp1: move.b (a6)+,d6
move.b d6,(a1)+
clr.b (a2)+
clr.b (a3)+
clr.b (a4)+
dbra d7,bw4lp1
move.w 94(a7),d7
beq.s bw4nb
subq.w #1,d7
bw4lp2: clr.b (a1)+
clr.b (a2)+
clr.b (a3)+
clr.b (a4)+
dbra d7,bw4lp2
bw4nb: lea.l 2(a1),a1
lea.l 2(a2),a2
lea.l 2(a3),a3
lea.l 2(a4),a4
adda.l a5,a0
dbra d5,bw4lp0
move.w 90(a7),d5
beq.s bw4x
subq.w #1,d5
move.w 92(a7),d4
add.w 94(a7),d4
subq.w #1,d4
bw4lp3: move.w d4,d7
bw4lp4: clr.b (a1)+
clr.b (a2)+
clr.b (a3)+
clr.b (a4)+
dbra d7,bw4lp4
lea.l 2(a1),a1
lea.l 2(a2),a2
lea.l 2(a3),a3
lea.l 2(a4),a4
dbra d5,bw4lp3
bw4x: movem.l (a7)+,d0-d7/a0-a6
rts
_bwview4:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),a5
move.w 80(a7),d5
subq.w #1,d5
bw2lp0: move.l a0,a6
move.w 84(a7),d7
subq.w #1,d7
bw2lp1: move.b (a6)+,d6
move.b d6,(a1)+
clr.b (a2)+
dbra d7,bw2lp1
move.w 86(a7),d7
beq.s bw2nb
subq.w #1,d7
bw2lp2: clr.b (a1)+
clr.b (a2)+
dbra d7,bw2lp2
bw2nb: lea.l 2(a1),a1
lea.l 2(a2),a2
adda.l a5,a0
dbra d5,bw2lp0
move.w 82(a7),d5
beq.s bw2x
subq.w #1,d5
move.w 84(a7),d4
add.w 86(a7),d4
subq.w #1,d4
bw2lp3: move.w d4,d7
bw2lp4: clr.b (a1)+
clr.b (a2)+
dbra d7,bw2lp4
lea.l 2(a1),a1
lea.l 2(a2),a2
dbra d5,bw2lp3
bw2x: movem.l (a7)+,d0-d7/a0-a6
rts
_grayview16:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),a3
move.l 80(a7),a4
move.l 84(a7),a5
move.l #$10000000,d6
move.w 88(a7),d5
subq.w #1,d5
gr4lp0: move.l a0,a6
move.w 92(a7),d7
subq.w #1,d7
gr4lp1: move.l (a6)+,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
move.b d1,(a1)+
move.b d2,(a2)+
move.b d3,(a3)+
move.b d4,(a4)+
dbra d7,gr4lp1
move.w 94(a7),d7
beq.s gr4nb
subq.w #1,d7
gr4lp2: clr.b (a1)+
clr.b (a2)+
clr.b (a3)+
clr.b (a4)+
dbra d7,gr4lp2
gr4nb: lea.l 2(a1),a1
lea.l 2(a2),a2
lea.l 2(a3),a3
lea.l 2(a4),a4
adda.l a5,a0
dbra d5,gr4lp0
move.w 90(a7),d5
beq.s gr4x
subq.w #1,d5
move.w 92(a7),d4
add.w 94(a7),d4
subq.w #1,d4
gr4lp3: move.w d4,d7
gr4lp4: clr.b (a1)+
clr.b (a2)+
clr.b (a3)+
clr.b (a4)+
dbra d7,gr4lp4
lea.l 2(a1),a1
lea.l 2(a2),a2
lea.l 2(a3),a3
lea.l 2(a4),a4
dbra d5,gr4lp3
gr4x: movem.l (a7)+,d0-d7/a0-a6
rts
_grayview4:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),a5
move.l #$40000000,d6
move.w 80(a7),d5
subq.w #1,d5
gr2lp0: move.l a0,a6
move.w 84(a7),d7
subq.w #1,d7
gr2lp1: move.l (a6)+,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
move.b d3,(a1)+
move.b d4,(a2)+
dbra d7,gr2lp1
move.w 86(a7),d7
beq.s gr2nb
subq.w #1,d7
gr2lp2: clr.b (a1)+
clr.b (a2)+
dbra d7,gr2lp2
gr2nb: lea.l 2(a1),a1
lea.l 2(a2),a2
adda.l a5,a0
dbra d5,gr2lp0
move.w 82(a7),d5
beq.s gr2x
subq.w #1,d5
move.w 84(a7),d4
add.w 86(a7),d4
subq.w #1,d4
gr2lp3: move.w d4,d7
gr2lp4: clr.b (a1)+
clr.b (a2)+
dbra d7,gr2lp4
lea.l 2(a1),a1
lea.l 2(a2),a2
dbra d5,gr2lp3
gr2x: movem.l (a7)+,d0-d7/a0-a6
rts
_vplanesep16:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),a3
move.l 80(a7),a4
move.l 84(a7),d7
move.l #$10000000,d6
subq.w #1,d7
vp4lp: move.l (a0)+,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
move.b d1,(a1)+
move.b d2,(a2)+
move.b d3,(a3)+
move.b d4,(a4)+
dbra d7,vp4lp
movem.l (a7)+,d0-d7/a0-a6
rts
_vplanesep4:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),d7
move.l #$40000000,d6
subq.w #1,d7
vp2lp: move.l (a0)+,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
add.l d6,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #2,d0
move.b d3,(a1)+
move.b d4,(a2)+
dbra d7,vp2lp
movem.l (a7)+,d0-d7/a0-a6
rts
_fplanesep:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),a3
move.l 80(a7),a4
move.l 84(a7),d7
subq.w #1,d7
fplp: move.l (a0)+,d0
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
lsl.l #1,d0
roxl.b #1,d4
lsl.l #1,d0
roxl.b #1,d3
lsl.l #1,d0
roxl.b #1,d2
lsl.l #1,d0
roxl.b #1,d1
not.b d1
not.b d2
not.b d3
not.b d4
move.b d1,(a1)+
move.b d2,(a2)+
move.b d3,(a3)+
move.b d4,(a4)+
dbra d7,fplp
movem.l (a7)+,d0-d7/a0-a6
rts
_fplanegen:
movem.l d0-d7/a0-a6,-(a7)
move.l 64(a7),a0
move.l 68(a7),a1
move.l 72(a7),a2
move.l 76(a7),a3
move.l 80(a7),a4
move.l 84(a7),d7
subq.w #1,d7
fpglp: move.b (a1)+,d1
not.b d1
move.b (a2)+,d2
not.b d2
move.b (a3)+,d3
not.b d3
move.b (a4)+,d4
not.b d4
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
lsl.b #1,d4
roxl.l #1,d0
lsl.b #1,d3
roxl.l #1,d0
lsl.b #1,d2
roxl.l #1,d0
lsl.b #1,d1
roxl.l #1,d0
move.l d0,(a0)+
dbra d7,fpglp
movem.l (a7)+,d0-d7/a0-a6
rts
XDEF _p64to16
XDEF _clrscr16
XDEF _clrscr4
XDEF _bwview16
XDEF _bwview4
XDEF _grayview16
XDEF _grayview4
XDEF _vplanesep16
XDEF _vplanesep4
XDEF _fplanesep
XDEF _fplanegen
END