Advertisement
Oldbitcollector

Loading Sprites

Feb 4th, 2022 (edited)
1,703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Simple code for display a single sprite
  2.  
  3.  
  4. v = $d000
  5.  
  6. ; Load Sprite into memory from data
  7.  
  8.     lda #13
  9.     sta 2040
  10.     lda #1
  11.     sta v+21
  12.     sta v+39
  13.  
  14.  
  15.     ldx #62
  16. copysprite
  17.     lda racecar,x
  18.     sta $340,x
  19.     dex
  20.     bpl copysprite
  21.  
  22.    
  23.    
  24. ; Display Sprite
  25.  
  26.     lda sprx
  27.     sta v
  28.     lda sprx+1
  29.     sta v+16
  30.     lda spry
  31.     sta v+1
  32.  
  33.  
  34.  
  35. sprx    !byte 135,0
  36. spry    !byte 210
  37.  
  38.  
  39.  
  40. ; sprite 0 / singlecolor / color: $03
  41. racecar
  42. !byte $00,$18,$00,$00,$3c,$00,$00,$3c
  43. !byte $00,$03,$7e,$c0,$03,$ff,$c0,$03
  44. !byte $7e,$c0,$00,$5a,$00,$00,$5a,$00
  45. !byte $00,$c3,$00,$01,$db,$80,$03,$e7
  46. !byte $c0,$07,$ff,$e0,$00,$ff,$00,$07
  47. !byte $66,$e0,$07,$7e,$e0,$07,$e7,$e0
  48. !byte $07,$7e,$e0,$07,$7e,$e0,$00,$24
  49. !byte $00,$03,$ff,$c0,$03,$ff,$c0,$03
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement