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 <sprite> (A)
  2. //  to <x position> (X (+256 if [(C) = 1]))
  3. //  and <y position> (Y).
  4. moveSprite: {
  5.     sty y_position
  6.     bcc xPositionIsLow
  7.     xPositionIsHigh:
  8.     ldy #ORA_ABS
  9.     bcs selfModify
  10.     xPositionIsLow:
  11.     ldy #EOR_ABS
  12.     selfModify:
  13.     sty bitwise_opcode
  14.     tay
  15.     lda EXP_TABLE.BYTE_2,y
  16.     bitwise_opcode:
  17.     .byte 0                 //<-- on execution, will be the
  18.     .word VIC.SPRITE_X_MSB  //  ORA_ABS or EOR_ABS opcode
  19.     sta VIC.SPRITE_X_MSB    //  from self-modify
  20.     lda MULT_TABLE.BYTE_2,y
  21.     tay
  22.     txa
  23.     sta VIC.SPRITE_0_X,y
  24.     .label y_position = [* + 1]
  25.     lda #0
  26.     sta VIC.SPRITE_0_Y,y
  27.     tay
  28.     rts
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement