Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;================================
  2. ;================================
  3. ;================================
  4. ;================================
  5.  
  6. !align 255,0
  7. color_fade_0f_hi_nybble:
  8. !byte $00, $00, $00, $00, $00, $00, $00, $00
  9. !byte $01, $0d, $03, $0c, $04, $02, $09, $00
  10. !byte $02, $09, $00, $00, $00, $00, $00, $00
  11. !byte $03, $0c, $04, $02, $09, $00, $00, $00
  12. !byte $04, $02, $09, $00, $00, $00, $00, $00
  13. !byte $05, $08, $02, $09, $00, $00, $00, $00
  14. !byte $06, $00, $00, $00, $00, $00, $00, $00
  15. !byte $07, $0f, $05, $08, $02, $09, $00, $00
  16. !byte $08, $02, $09, $00, $00, $00, $00, $00
  17. !byte $09, $00, $00, $00, $00, $00, $00, $00
  18. !byte $0a, $08, $02, $09, $00, $00, $00, $00
  19. !byte $0b, $09, $00, $00, $00, $00, $00, $00
  20. !byte $0c, $04, $02, $09, $00, $00, $00, $00
  21. !byte $0d, $03, $0c, $04, $02, $09, $00, $00
  22. !byte $0e, $04, $02, $09, $00, $00, $00, $00
  23. !byte $0f, $05, $08, $02, $09, $00, $00, $00
  24. !align 255,0
  25.  
  26. color_fade_0f_lo_nybble:
  27. !byte $00, $00, $00, $00, $00, $00, $00, $00
  28. !byte $10, $d0, $30, $c0, $40, $20, $90, $00
  29. !byte $20, $90, $00, $00, $00, $00, $00, $00
  30. !byte $30, $c0, $40, $20, $90, $00, $00, $00
  31. !byte $40, $20, $90, $00, $00, $00, $00, $00
  32. !byte $50, $80, $20, $90, $00, $00, $00, $00
  33. !byte $60, $00, $00, $00, $00, $00, $00, $00
  34. !byte $70, $f0, $50, $80, $20, $90, $00, $00
  35. !byte $80, $20, $90, $00, $00, $00, $00, $00
  36. !byte $90, $00, $00, $00, $00, $00, $00, $00
  37. !byte $a0, $80, $20, $90, $00, $00, $00, $00
  38. !byte $b0, $90, $00, $00, $00, $00, $00, $00
  39. !byte $c0, $40, $20, $90, $00, $00, $00, $00
  40. !byte $d0, $30, $c0, $40, $20, $90, $00, $00
  41. !byte $e0, $40, $20, $90, $00, $00, $00, $00
  42. !byte $f0, $50, $80, $20, $90, $00, $00, $00
  43.  
  44. anim:
  45. !binary "part2/part2_fade.bin"
  46.  
  47.  
  48. table_of_8:
  49. !byte 0, 8, 16, 24, 32, 40, 48, 56, 64
  50. !byte 72, 80, 88, 96, 104, 112, 120, 128
  51.  
  52. table_of_8_fadein:
  53. !byte >color_fadein_table + (0*256)
  54. !byte >color_fadein_table + (1*256)
  55. !byte >color_fadein_table + (2*256)
  56. !byte >color_fadein_table + (3*256)
  57. !byte >color_fadein_table + (4*256)
  58. !byte >color_fadein_table + (5*256)
  59. !byte >color_fadein_table + (6*256)
  60. !byte >color_fadein_table + (7*256)
  61. !byte >color_fadein_table + (8*256)
  62.  
  63. sprite_color_flash:
  64. !byte $1,$d,$3,$c,$4,$2,$9,$0
  65. !byte $0,$6,$b,$4,$c,$3,$d,$1
  66.  
  67.  
  68.  
  69. generate_fadein_table:
  70.     ldx #00
  71. --:
  72.     lda #00
  73.     sta $11
  74. -:
  75.     lda $11
  76.     and #$0f
  77.     tay
  78.     lda table_of_8, y
  79.     sta hi_nybble_ptr
  80. hi_nybble_ptr = *+1
  81.     lda color_fade_0f_hi_nybble, x
  82.     sta $10
  83.  
  84.     lda $11
  85.     and #$f0
  86.     lsr
  87.     lsr
  88.     lsr
  89.     lsr
  90.     tay
  91.     lda table_of_8, y
  92.     sta lo_nybble_ptr
  93. lo_nybble_ptr = *+1
  94.     lda color_fade_0f_lo_nybble, x
  95.     ora $10
  96. bitmap_dst_ptr = *+1
  97.     sta color_fadein_table
  98.     inc bitmap_dst_ptr
  99.     bne +
  100.     inc bitmap_dst_ptr + 1
  101. +:
  102.     inc $11
  103.     bne -
  104.     inx
  105.     cpx #8
  106.     bne --
  107.     rts
  108.    
  109. bitmap_fadein:
  110. bitmap_fadein_begin
  111. anim_ptr_1 = *+1
  112.     ldx anim, y
  113.     beq nextChar
  114.     dex
  115.     txa
  116. anim_ptr_2 = *+1
  117.     sta anim, y
  118.     cmp #8
  119.     bcs nextChar
  120.    
  121.     lda table_of_8_fadein, x
  122.     sta bitmap_table_page
  123. src_ptr_1 = *+1
  124.     ldx bitmap_color_src, y
  125. bitmap_table_page = *+2
  126.     lda color_fadein_table, x
  127. dst_ptr_1 = *+1
  128.     sta bitmap_color_dst, y
  129.    
  130. nextChar:
  131.     iny
  132.     bne ++
  133.     inc anim_ptr_1 + 1
  134.     inc anim_ptr_2 + 1
  135.     inc src_ptr_1 + 1
  136.     inc dst_ptr_1 + 1
  137. ++:  
  138.     cpy #<(bitmap_color_dst + (1000))
  139.     bne bitmap_fadein_begin
  140.     lda dst_ptr_1 + 1
  141.     cmp #>(bitmap_color_dst + (1000))
  142.     bne bitmap_fadein_begin
  143. reset_fadeout_ptrs:  
  144.     lda #>anim
  145.     sta anim_ptr_1+1
  146.     sta anim_ptr_2+1
  147.    
  148.     lda #>bitmap_color_src
  149.     sta src_ptr_1+1
  150.    
  151.     lda #>bitmap_color_dst
  152.     sta dst_ptr_1 + 1
  153.     ldy #0
  154.  
  155.     rts
  156.  
  157. bitmap_color_src = $6400
  158. bitmap_color_dst = $6000
  159.  
  160. color_fadein_table = $b000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement