Guest User

Untitled

a guest
Jul 1st, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     MouseRightDeset9th:
  2.     LDA OAM_HighTable_00.w
  3.     EOR #$01.b
  4.     STA OAM_HighTable_00.w
  5.     INC OAM_Update.w
  6.     BRA MRReturn
  7.  
  8. UpdateCursor:
  9.     LDA mouse_sp1.w
  10.     TAY
  11.    
  12.     LDA mouse_x1.w
  13.     BMI MouseMinusX
  14.     BEQ MouseY
  15.  
  16.     ; MOUSE MOVE RIGHT
  17.     LDA OAM_LowTable_00X.w
  18.     JMP MRS_Start
  19.    
  20.     MouseRightSpeed:
  21.     CLC
  22.     ADC mouse_x1.w
  23.     MRS_Start:          ; Speed = 0/1/2 --> Move 1/3/5 Pixel
  24.     CLC
  25.     ADC mouse_x1.w
  26.     DEY
  27.     BPL MouseRightSpeed
  28.    
  29.     PHA
  30.     PHA
  31.    
  32.     LDA OAM_HighTable_00.w
  33.     ORA #%00000001.b
  34.     BNE MR_No9thXBit        ; Is the 9th X-bit set?
  35.    
  36.     PLA
  37.     CMP OAM_LowTable_00X.w  ; Store new X value if new X isn't lower than old X
  38.     BCC MouseRightDeset9th      ; (This happens if it rounds beyound the screen)
  39.     MRReturn:
  40.     PLA
  41.     STA OAM_LowTable_00X.w
  42.     INC OAM_Update.w
  43.     BRA MouseY
  44.  
  45.  
  46.     MR_No9thXBit:           ; 9th X-bit not set
  47.     PLA
  48.     CMP #$F8.b
  49.     BCS MouseRightReplace       ; Replace new X value if it's beyond the boarder
  50.     CMP OAM_LowTable_00X.w  ; Store new X value if new X isn't lower than old X
  51.     BCS MouseRightStore     ; (This happens if it rounds beyound the screen)
  52.    
  53.     MouseRightReplace:
  54.     PLA
  55.     LDA #$F8.b
  56.     PHA
  57.    
  58.     MouseRightStore:
  59.     PLA
  60.    
  61.     STA OAM_LowTable_00X.w
  62.     INC OAM_Update.w
  63.     BRA MouseY
  64.    
  65.     ; MOUSE MOVE LEFT
  66.     MouseMinusX:
  67.     AND #%01111111.b
  68.     BEQ MouseY
  69.     STA TEMP3.b
  70.     LDA OAM_LowTable_00X.w
  71.     JMP MLS_Start
  72.    
  73.     MouseLeftSpeed:
  74.     SEC
  75.     SBC TEMP3.b
  76.     MLS_Start:          ; Speed = 0/1/2 --> Move 1/3/5 Pixel
  77.     SEC
  78.     SBC TEMP3.b
  79.     DEY
  80.     BPL MouseLeftSpeed
  81.  
  82.     ; UNTESTED
  83.     PHA
  84.  
  85. ;   CMP #$F8.b
  86. ;   BCS MouseLeftReplace        ; Replace new X value if it's beyond the boarder
  87.     CMP OAM_LowTable_00X.w  ; Store new X value if new X isn't lower than old X
  88.     BCS MouseLeft9th        ; (This happens if it rounds beyound the screen)
  89.     BRA MouseLeftStore
  90.    
  91. ;   MouseLeftReplace:
  92. ;   PLA
  93. ;   LDA #$00.b
  94. ;   PHA
  95.    
  96.     MouseLeft9th:
  97.     LDA OAM_HighTable_00.w
  98.     ORA #%00000001.b
  99.     BEQ MouseLeftStore
  100.     LDA OAM_HighTable_00.w
  101.     EOR #$01.b
  102.     STA OAM_HighTable_00.w
  103.     INC OAM_Update.w
  104.    
  105.     MouseLeftStore:
  106.     PLA
  107.     ; /UNTESTED
  108.  
  109.     STA OAM_LowTable_00X.w
  110.     INC OAM_Update.w
  111.  
  112.     ; MOUSE VERTICAL MOVE
  113.     MouseY:
  114.     LDA mouse_y1.w
  115.     BEQ MouseExit
  116.     BMI MouseMinusY
  117.  
  118.     ; MOUSE MOVE DOWN
  119.     LDA OAM_LowTable_00Y.w
  120.     JMP MDS_Start
  121.    
  122.     MouseDownSpeed:
  123.     CLC
  124.     ADC mouse_y1.w
  125.     MDS_Start:          ; Speed = 0/1/2 --> Move 1/3/5 Pixel
  126.     CLC
  127.     ADC mouse_y1.w
  128.     DEY
  129.     BPL MouseDownSpeed 
  130.     STA OAM_LowTable_00Y.w
  131.     INC OAM_Update.w
  132.     RTS
  133.    
  134.     ; MOUSE MOVE UP
  135.     MouseMinusY:
  136.     AND #%01111111.b
  137.     BEQ MouseExit
  138.     STA TEMP3.b
  139.     LDA OAM_LowTable_00Y.w
  140.     JMP MUS_Start
  141.    
  142.     MouseUpSpeed:
  143.     SEC
  144.     SBC TEMP3.b
  145.     MUS_Start:          ; Speed = 0/1/2 --> Move 1/3/5 Pixel
  146.     SEC
  147.     SBC TEMP3.b
  148.     DEY
  149.     BPL MouseUpSpeed
  150.     STA OAM_LowTable_00Y.w
  151.     INC OAM_Update.w
  152.    
  153.     MouseExit:
  154.     RTS
Advertisement
Add Comment
Please, Sign In to add comment