home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 3
/
AACD03.BIN
/
AACD
/
Graphics
/
ViewILBM
/
Source
/
ReadPlanarLine8.asm
< prev
next >
Wrap
Assembly Source File
|
1998-11-26
|
2KB
|
90 lines
*
* $Id: ReadPlanarLine8.asm 1.1 1998/11/26 19:17:08 olsen Exp olsen $
*
* :ts=8
*
include "graphics/gfx.i"
section text,code
read macro
move.l -(a0),a1
move.b 0(a1,a4.l),d7 ; d7=bitmap byte
add.b d7,d7
addx.w d0,d0
add.b d7,d7
addx.w d1,d1
add.b d7,d7
addx.w d2,d2
add.b d7,d7
addx.w d3,d3
add.b d7,d7
addx.w d4,d4
add.b d7,d7
addx.w d5,d5
add.b d7,d7
addx.w d6,d6
swap d6
add.b d7,d7
addx.w d6,d6
swap d6
endm
store macro
move.b \1,(a2)
add.l a6,a2
endm
; VOID __asm ReadPlanarLine8(register __a0 struct BitMap * source,register __a1 UBYTE * line,register __d0 LONG interleave);
xdef _ReadPlanarLine8
_ReadPlanarLine8:
movem.l d2-d7/a2-a6,-(a7)
move.l d0,a6 ; keep the interleave
move.l a1,a2 ; where to store the chunky data
moveq #0,d0
move.w bm_BytesPerRow(a0),d0
move.l d0,a3 ; save the width
lea.l bm_Planes(a0),a0 ; get the address of the first plane to read from
add.l #8*4,a0 ; just past the last plane pointer
move.l a0,a5 ; save it for later use
move.l #0,a4 ; that's the column index
1$ read ; plane #7
read ; plane #6
read ; plane #5
read ; plane #4
read ; plane #3
read ; plane #2
read ; plane #1
read ; plane #0
store d0 ; byte #0
store d1 ; byte #1
store d2 ; byte #2
store d3 ; byte #3
store d4 ; byte #4
store d5 ; byte #5
store d6 ; byte #6
swap d6
store d6 ; byte #7
move.l a5,a0 ; get the planes back
subq.l #1,a3 ; processed another column
addq.l #1,a4 ; move up another column
tst.l a3
bne 1$ ; if there is still another byte, restart
movem.l (a7)+,d2-d7/a2-a6
rts ; and return
end