Advertisement
Guest User

Untitled

a guest
Nov 4th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //A procedure that moves a <sprite> to
  2. //  <position y> (Y) and <position x> (X).
  3. .macro moveSprite(sprite) {
  4.     .const xReg = [VIC.SPRITE_0_X + [sprite * 2]]
  5.     .const yReg = [xReg + 1]
  6.     lda VIC.SPRITE_X_MSB
  7.     bcs setMSB
  8.     and #[[1 << sprite] ^ $ff]
  9.     bcc store
  10.     setMSB:
  11.     ora #[1 << sprite]
  12.     store:
  13.     sta VIC.SPRITE_X_MSB
  14.     stx xReg
  15.     sty yReg
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement