home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Graphics / ViewILBM / Source / ReadPlanarLine8.asm < prev    next >
Assembly Source File  |  1998-11-26  |  2KB  |  90 lines

  1. *
  2. * $Id: ReadPlanarLine8.asm 1.1 1998/11/26 19:17:08 olsen Exp olsen $
  3. *
  4. * :ts=8
  5. *
  6.  
  7.     include "graphics/gfx.i"
  8.  
  9.     section    text,code
  10.  
  11. read    macro
  12.     move.l    -(a0),a1
  13.     move.b    0(a1,a4.l),d7        ; d7=bitmap byte
  14.     add.b    d7,d7
  15.     addx.w    d0,d0
  16.     add.b    d7,d7
  17.     addx.w    d1,d1
  18.     add.b    d7,d7
  19.     addx.w    d2,d2
  20.     add.b    d7,d7
  21.     addx.w    d3,d3
  22.     add.b    d7,d7
  23.     addx.w    d4,d4
  24.     add.b    d7,d7
  25.     addx.w    d5,d5
  26.     add.b    d7,d7
  27.     addx.w    d6,d6
  28.     swap    d6
  29.     add.b    d7,d7
  30.     addx.w    d6,d6
  31.     swap    d6
  32.     endm
  33.  
  34. store    macro
  35.     move.b    \1,(a2)
  36.     add.l    a6,a2
  37.     endm
  38.  
  39. ; VOID __asm ReadPlanarLine8(register __a0 struct BitMap * source,register __a1 UBYTE * line,register __d0 LONG interleave);
  40.  
  41.     xdef    _ReadPlanarLine8
  42.  
  43. _ReadPlanarLine8:
  44.  
  45.     movem.l    d2-d7/a2-a6,-(a7)
  46.  
  47.     move.l    d0,a6            ; keep the interleave
  48.  
  49.     move.l    a1,a2            ; where to store the chunky data
  50.  
  51.     moveq    #0,d0
  52.     move.w    bm_BytesPerRow(a0),d0
  53.     move.l    d0,a3            ; save the width
  54.  
  55.     lea.l    bm_Planes(a0),a0    ; get the address of the first plane to read from
  56.     add.l    #8*4,a0            ; just past the last plane pointer
  57.     move.l    a0,a5            ; save it for later use
  58.  
  59.     move.l    #0,a4            ; that's the column index
  60.  
  61. 1$    read                ; plane #7
  62.     read                ; plane #6
  63.     read                ; plane #5
  64.     read                ; plane #4
  65.     read                ; plane #3
  66.     read                ; plane #2
  67.     read                ; plane #1
  68.     read                ; plane #0
  69.  
  70.     store    d0            ; byte #0
  71.     store    d1            ; byte #1
  72.     store    d2            ; byte #2
  73.     store    d3            ; byte #3
  74.     store    d4            ; byte #4
  75.     store    d5            ; byte #5
  76.     store    d6            ; byte #6
  77.     swap    d6
  78.     store    d6            ; byte #7
  79.  
  80.     move.l    a5,a0            ; get the planes back
  81.     subq.l    #1,a3            ; processed another column
  82.     addq.l    #1,a4            ; move up another column
  83.     tst.l    a3
  84.     bne    1$            ; if there is still another byte, restart
  85.  
  86.     movem.l    (a7)+,d2-d7/a2-a6
  87.     rts                ; and return
  88.  
  89.     end
  90.