Guest User

Untitled

a guest
Jul 27th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. VInt:
  2.      clr.b    (HINTTIMER)
  3.       movem.l  d0-a6, -(sp)                           ; Back up regs
  4.      
  5.       cmp.b    #100, (VBLCount)   ; We increase at the end of this routine - 51 is after the 50th run
  6.       bne.s    @NoReset2
  7.       clr.b    (VBLCount)
  8.      
  9. @NoReset2:
  10. ;     jmp *
  11.       lea      ColourTable, a0
  12.       lea      BarColourArray, a1
  13.       lea      BarColourArray+64, a2
  14.       lea      BarColourArray+128, a3
  15.       lea      Sine, a4
  16.      
  17.       moveq    #0, d0 ; Starting pointeruuuuu Blueu
  18.       moveq    #0, d1 ; Starting pointeruuuuu Redu
  19.       moveq    #0, d2 ; Starting pointeruuuuu Gurenuuu
  20.       moveq    #0, d3
  21.       move.b   (VBLCOUNT), d3
  22.       move.b   (a4,d3.w), d0
  23.       add.b    #16, d3
  24.       move.b   (a4,d3.w), d1
  25.       add.b    #16, d3
  26.       move.b   (a4,d3.w), d2
  27.       moveq    #0, d3
  28.       moveq    #0, d7
  29.       clr.b    (CountBlue)
  30.       clr.b    (CountRed)
  31.       clr.b    (CountGreen)
  32.      
  33. @LoopScanlines:
  34.       moveq    #0, d4
  35.       moveq    #0, d5
  36.       moveq    #0, d6
  37.      
  38.       cmp.b    d0, d3
  39.       blo.s    @NoBlu
  40.       cmp.b    #32, (CountBlue)
  41.       bhs.s    @NoBlu      
  42.       move.w   (a1)+, d4
  43.       addq.b   #1, (CountBlue)
  44. @NoBlu:
  45.  
  46.       cmp.b    d1, d3
  47.       blo.s    @NoRed
  48.       cmp.b    #32, (CountRed)
  49.       bhs.s    @NoRed      
  50.       move.w   (a2)+, d5
  51.       addq.b   #1, (CountRed)
  52. @NoRed:
  53.  
  54.       cmp.b    d2, d3
  55.       blo.s    @NoGrn
  56.       cmp.b    #32, (CountGreen)
  57.       bhs.s    @NoGrn      
  58.       move.w   (a3)+, d6
  59.       addq.b   #1, (CountGreen)
  60. @NoGrn:
  61.       or.w d4, d5
  62.       or.w d5, d6
  63.       move.w  d6, (a0)+
  64.       addq.b #1,d3
  65.  
  66.       cmp.b #224, d3
  67.       bne.s @LoopScanlines
  68.      
  69.       addq.b   #1, (VBLCount)
  70.       movem.l  (sp)+, d0-a6                           ; Restore regs
  71.       rte
Add Comment
Please, Sign In to add comment