Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. color_irq:
  2.         sta $10
  3.         stx $11
  4.         sty $12
  5.        
  6. // set the colors
  7.         lda new_color_1
  8.         sta $d021
  9.         lda new_color_2
  10.         sta $d022
  11.         lda new_color_3
  12.         sta $d023
  13. // test d012
  14.         lda $d012
  15.         cmp #$f9
  16.         bcc less_than_249
  17. // set d011 here and now
  18.        
  19.         lda #$13
  20.         sta $d011
  21. // set music_irq
  22.         lda #<music_irq
  23.         sta $fffe
  24.         lda #>music_irq
  25.         sta $ffff
  26.         lda #20 // some top line
  27.         sta $d012
  28.         bne color_irq_end
  29.        
  30. less_than_249:
  31. // set the special d011 write irq
  32.         lda #<d011_irq
  33.         sta $fffe
  34.         lda #>d011_irq
  35.         sta $ffff
  36.         lda #249
  37.         sta $d012
  38.        
  39. color_irq_end:
  40.         lda #1
  41.         sta $d019
  42.         lda $10
  43.         ldx $11
  44.         ldy $12
  45.         rti
  46.        
  47.        
  48. d011_irq:
  49.         sta $10
  50.         lda #$13
  51.         sta $d011
  52.        
  53. // set music_irq
  54.         lda #<music_irq
  55.         sta $fffe
  56.         lda #>music_irq
  57.         sta $ffff
  58.         lda #20 // some top line
  59.         sta $d012
  60.        
  61.         lda #01
  62.         sta $d019
  63.         lda $10
  64.         rti
  65.        
  66.        
  67. music_irq:
  68.         sta $10
  69.         stx $11
  70.         sty $12
  71.        
  72.         jsr $1003
  73.        
  74.         // rest of the code that sets up color_change_irq when
  75.         // its time and moves it down and all that....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement