home *** CD-ROM | disk | FTP | other *** search
/ Dream 57 / Amiga_Dream_57.iso / Amiga / Programmation / c / QuakeC / qtools0.2-src.lha / src / libqdisplay / drawSpans8flat-m68k2.S < prev    next >
Encoding:
Text File  |  1998-08-11  |  1.0 KB  |  55 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. void draw_spans8flat(register int y __asm__("a4"), register int ey __asm__("d5"));
  7.  
  8.     __asm ("
  9.  
  10.     .equ    y,a4
  11.     .equ    dest,a3
  12.     .equ    mults,a2
  13.     .equ    scan,a1
  14.     .equ    buf,a0        | parameter ...
  15.     
  16.     .equ    ey,d5
  17.     .equ    textcolor,d2
  18.     .equ    len,d1
  19.     .equ    sx,d0
  20.  
  21. .text
  22.     .globl    _draw_spans8flat
  23. | void draw_spans8flat(register int y __asm__ (a4), register int ey __asm__ (d5))
  24. _draw_spans8flat:
  25.     subl    y,ey            | y < ey
  26.     subql    #1,ey            | (y - 1) <= ey
  27.     blt    .bigEnd8flat
  28.  
  29.     moveml    d2/a2-a3,sp@-
  30.     movel    _localDim+26,dest    | localDim.frameBuffer
  31.     moveb    _textureColor,textcolor
  32.  
  33.     lea    @(_scan, y:l:8), scan    | scan[y][]
  34.     movel    _multRows,mults
  35.     lea    mults@(y:l:4),mults
  36. .bigLoop8flat:
  37.     movel    mults@+,buf        | multRows[y]
  38.     movel    scan@+,sx        | FIX_INT(scan[y][0])
  39.     movel    scan@+,len        | FIX_INT(scan[y][1])
  40.     subl    sx,len            | scan[y][1] - sx
  41.     bles    .noSpan8flat        | len > 0
  42.     addl    dest,buf        | localDim.frameBuffer + multRows[y]
  43.     addl    sx,buf
  44.     subql    #1,len
  45. .fillflat:
  46.     moveb    textcolor,buf@+
  47.     dbra    len,.fillflat
  48. .noSpan8flat:
  49.     dbra    ey,.bigLoop8flat
  50.     moveml    sp@+,d2/a2-a3
  51. .bigEnd8flat:
  52.     rts
  53.     .even
  54.     ");
  55.