Advertisement
Guest User

Untitled

a guest
Apr 15th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .proc create_hdma_table
  2.     ;it's OK to trash all registers here
  3.    
  4.     lda #0
  5.     pha ;"done" flag on stack
  6.    
  7.     lda #127 ;there are 127 scanlines of data following
  8.     tay
  9.     ora #$80
  10.     sta rainbow_hdma+0
  11.     ldx #0 ;start offset
  12.     lda #0
  13.    
  14.     loop:
  15.     sta rainbow_hdma+1,x
  16.     inc
  17.     dey
  18.     bne after
  19.     inx
  20.     inx
  21.     jmp loop
  22.    
  23.     after:
  24.     pla ;if set, we have gone through part 2
  25.     beq part2
  26.    
  27.     ret
  28.    
  29.     part2:
  30.     lda #1
  31.     pha
  32.    
  33.     lda #97
  34.     tay
  35.     ora #$80
  36.     sta rainbow_hdma+255
  37.     ldx #256
  38.     lda #128
  39.     jmp loop
  40. .endproc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement