home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 2: Collection B / 17Bit_Collection_B.iso / files / 1882.dms / in.adf / cycle.asm < prev    next >
Encoding:
Assembly Source File  |  1992-04-21  |  1.1 KB  |  60 lines

  1. *************************************************
  2. *
  3. *    Colour cycling routine
  4. *
  5. *    Copyright free
  6. *
  7. *    Written by Martin Jones
  8. *
  9. *    To be called on the Vblank
  10. *    Incbin the palette file you require
  11. *    Colcyc governs whether the routine is
  12. *    running
  13. *
  14. *************************************************
  15.  
  16.  
  17. colcycle    move.w colcyc,d0    cycle the colours
  18.     bne colc1        colour table located
  19.     rts        at (colstart)
  20. colc1    move.l colstart,a0    defined as:
  21.     move.l a0,a1    
  22.     add.l #6,a1        1b cycle (0=no)
  23.     lea $dff180,a2    1b position of colour
  24.     move.l #32,d7    1b speed (1=50 per sec)
  25. colc6    sub.l #1,d7        1b limit (highest colour)
  26.     bpl colc2        1b speed pos (counter)
  27.     rts        1b nothing (even)
  28. colc2    move.b (a0),d0    64w colour info
  29.     bne colc3        
  30.     move.b #0,1(a0)    next colour
  31.     jmp colc5
  32. colc3    add.b #1,4(a0)
  33.     move.b 4(a0),d1
  34.     move.b 2(a0),d2
  35.     cmp.b d1,d2
  36.     bne colc5
  37.     move.b #0,4(a0)
  38.     move.b 1(a0),d1
  39.     move.b 3(a0),d2
  40.     cmp.b d1,d2
  41.     beq colc4
  42.     add.b #1,1(a0)
  43.     jmp colc5
  44. colc4    move.b #0,1(a0)
  45. colc5    move.b 1(a0),d0
  46.     and.b #$ff,d0
  47.     mulu #2,d0
  48.     move.w (a1,d0),(a2)
  49.     add.l #134,a0
  50.     add.l #134,a1
  51.     add.l #2,a2
  52.     jmp colc6
  53.     
  54. colstart    dc.l palette
  55. colcyc    dc.w 1
  56.  
  57. palette    incbin "ram:palette"
  58.  
  59.  
  60.