Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MouseRightDeset9th:
- LDA OAM_HighTable_00.w
- EOR #$01.b
- STA OAM_HighTable_00.w
- INC OAM_Update.w
- BRA MRReturn
- UpdateCursor:
- LDA mouse_sp1.w
- TAY
- LDA mouse_x1.w
- BMI MouseMinusX
- BEQ MouseY
- ; MOUSE MOVE RIGHT
- LDA OAM_LowTable_00X.w
- JMP MRS_Start
- MouseRightSpeed:
- CLC
- ADC mouse_x1.w
- MRS_Start: ; Speed = 0/1/2 --> Move 1/3/5 Pixel
- CLC
- ADC mouse_x1.w
- DEY
- BPL MouseRightSpeed
- PHA
- PHA
- LDA OAM_HighTable_00.w
- ORA #%00000001.b
- BNE MR_No9thXBit ; Is the 9th X-bit set?
- PLA
- CMP OAM_LowTable_00X.w ; Store new X value if new X isn't lower than old X
- BCC MouseRightDeset9th ; (This happens if it rounds beyound the screen)
- MRReturn:
- PLA
- STA OAM_LowTable_00X.w
- INC OAM_Update.w
- BRA MouseY
- MR_No9thXBit: ; 9th X-bit not set
- PLA
- CMP #$F8.b
- BCS MouseRightReplace ; Replace new X value if it's beyond the boarder
- CMP OAM_LowTable_00X.w ; Store new X value if new X isn't lower than old X
- BCS MouseRightStore ; (This happens if it rounds beyound the screen)
- MouseRightReplace:
- PLA
- LDA #$F8.b
- PHA
- MouseRightStore:
- PLA
- STA OAM_LowTable_00X.w
- INC OAM_Update.w
- BRA MouseY
- ; MOUSE MOVE LEFT
- MouseMinusX:
- AND #%01111111.b
- BEQ MouseY
- STA TEMP3.b
- LDA OAM_LowTable_00X.w
- JMP MLS_Start
- MouseLeftSpeed:
- SEC
- SBC TEMP3.b
- MLS_Start: ; Speed = 0/1/2 --> Move 1/3/5 Pixel
- SEC
- SBC TEMP3.b
- DEY
- BPL MouseLeftSpeed
- ; UNTESTED
- PHA
- ; CMP #$F8.b
- ; BCS MouseLeftReplace ; Replace new X value if it's beyond the boarder
- CMP OAM_LowTable_00X.w ; Store new X value if new X isn't lower than old X
- BCS MouseLeft9th ; (This happens if it rounds beyound the screen)
- BRA MouseLeftStore
- ; MouseLeftReplace:
- ; PLA
- ; LDA #$00.b
- ; PHA
- MouseLeft9th:
- LDA OAM_HighTable_00.w
- ORA #%00000001.b
- BEQ MouseLeftStore
- LDA OAM_HighTable_00.w
- EOR #$01.b
- STA OAM_HighTable_00.w
- INC OAM_Update.w
- MouseLeftStore:
- PLA
- ; /UNTESTED
- STA OAM_LowTable_00X.w
- INC OAM_Update.w
- ; MOUSE VERTICAL MOVE
- MouseY:
- LDA mouse_y1.w
- BEQ MouseExit
- BMI MouseMinusY
- ; MOUSE MOVE DOWN
- LDA OAM_LowTable_00Y.w
- JMP MDS_Start
- MouseDownSpeed:
- CLC
- ADC mouse_y1.w
- MDS_Start: ; Speed = 0/1/2 --> Move 1/3/5 Pixel
- CLC
- ADC mouse_y1.w
- DEY
- BPL MouseDownSpeed
- STA OAM_LowTable_00Y.w
- INC OAM_Update.w
- RTS
- ; MOUSE MOVE UP
- MouseMinusY:
- AND #%01111111.b
- BEQ MouseExit
- STA TEMP3.b
- LDA OAM_LowTable_00Y.w
- JMP MUS_Start
- MouseUpSpeed:
- SEC
- SBC TEMP3.b
- MUS_Start: ; Speed = 0/1/2 --> Move 1/3/5 Pixel
- SEC
- SBC TEMP3.b
- DEY
- BPL MouseUpSpeed
- STA OAM_LowTable_00Y.w
- INC OAM_Update.w
- MouseExit:
- RTS
Advertisement
Add Comment
Please, Sign In to add comment