Advertisement
Guest User

scrolling code

a guest
Dec 21st, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. REP #$20 ;Make A 16 bits wide
  2. LDA $1462 ;Load the layer 1 x position
  3. LSR ;Divide by 2. The more times you use LSR the slower the background will scroll horizontally.
  4. LSR ;If you use ASL (multiply by 2) instead the background will scroll <i>faster</i> than the foreground.
  5. STA $22 ;Store to the layer 3 x position
  6.  
  7. LDA $1464 ;Load the layer 1 y position
  8. LSR ;Same as above, but vertically.
  9. LSR
  10. SEC ;These two lines are for shifting your background vertically.
  11. SBC #$0038 ;If you're using a background that loops you probably won't have to use this.
  12. STA $24 ;Store to the layer 3 y position
  13. SEP #$20 ;Make A 8 bits wide
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement