Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2015
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MoveObject
  2. right
  3.     lda controller
  4.     and #%00000001
  5.     beq notRight
  6.     lda object_dx + 1
  7.     bmi notRight
  8.    
  9.     lda object_dx
  10.     clc
  11.     adc object_acc
  12.     sta object_dx
  13.     lda object_dx + 1
  14.     adc #0
  15.     sta object_dx + 1
  16.    
  17.     CLAMP_S16 object_dx, object_dx_min, object_dx_max
  18.    
  19.     jmp dxTox
  20.  
  21. notRight
  22.     lda object_dx + 1
  23.     beq + ; MSB of object_dx is 0, check if LSB needs to be decreased
  24.    
  25.     lda object_dx
  26.     sec
  27.     sbc object_dec
  28.     sta object_dx
  29.     lda object_dx + 1
  30.     sbc #0
  31.     sta object_dx + 1
  32.     jmp dxTox
  33. +
  34.     lda object_dx
  35.     beq left
  36.     sec
  37.     sbc object_dec
  38.     bcs +
  39.     lda #0
  40. +
  41.     sta object_dx
  42.     jmp dxTox
  43.  
  44. left
  45.     lda controller
  46.     and #%00000010
  47.     beq notLeft
  48.     lda object_dx + 1
  49.     beq +
  50.     bpl notLeft
  51. +
  52.     lda object_dx
  53.     sec
  54.     sbc object_acc
  55.     sta object_dx
  56.     lda object_dx + 1
  57.     sbc #0
  58.     sta object_dx + 1
  59.    
  60.     CLAMP_S16 object_dx, object_dx_min, object_dx_max
  61.    
  62.     jmp dxTox
  63.  
  64. notLeft
  65.     lda object_dx + 1
  66.     beq +
  67.    
  68.     lda object_dx
  69.     clc
  70.     adc object_dec
  71.     sta object_dx
  72.     lda object_dx + 1
  73.     adc #0
  74.     sta object_dx + 1
  75.     jmp dxTox
  76. +
  77.     lda object_dx
  78.     beq dxTox
  79.     clc
  80.     adc object_dec
  81.     bcc +
  82.     lda #0
  83. +
  84.     sta object_dx
  85.  
  86.  
  87. dxTox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement