Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //A procedure that moves <sprite> (A)
- // to <x position> (X (+256 if [(C) = 1]))
- // and <y position> (Y).
- moveSprite: {
- sty y_position
- bcc xPositionIsLow
- xPositionIsHigh:
- ldy #ORA_ABS
- bcs selfModify
- xPositionIsLow:
- ldy #EOR_ABS
- selfModify:
- sty bitwise_opcode
- tay
- lda EXP_TABLE.BYTE_2,y
- bitwise_opcode:
- .byte 0 //<-- on execution, will be the
- .word VIC.SPRITE_X_MSB // ORA_ABS or EOR_ABS opcode
- sta VIC.SPRITE_X_MSB // from self-modify
- lda MULT_TABLE.BYTE_2,y
- tay
- txa
- sta VIC.SPRITE_0_X,y
- .label y_position = [* + 1]
- lda #0
- sta VIC.SPRITE_0_Y,y
- tay
- rts
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement