Support mouse button1

This commit is contained in:
David Schmenk committed 2026-04-23 13:42:03 -07:00
1 parent a88140dc30
commit a1f077401b
3 files changed
+16 -12

No files matched your search

Binary file not shown.
+14 -10
View File
@@ -2,19 +2,23 @@ import mouse
// //
// Status bits // Status bits
// //
const BUTTON_DOWN = $80 const BUTTON_DOWN = $80
const BUTTON_LAST_DOWN = $40 const BUTTON0_DOWN = $80
const MOUSE_MOVED = $20 const BUTTON_LAST_DOWN = $40
const VBL_INT = $08 const BUTTON0_LAST_DOWN = $40
const BUTTON_INT = $04 const MOUSE_MOVED = $20
const MOVE_INT = $02 const BUTTON1_DOWN = $10
const VBL_INT = $08
const BUTTON_INT = $04
const MOVE_INT = $02
const BUTTON1_LAST_DOWN = $01
// //
// Mode bits // Mode bits
// //
const VBL_INT_ENABLE = $08 const VBL_INT_ENABLE = $08
const BUTTON_INT_ENABLE= $04 const BUTTON_INT_ENABLE = $04
const MOVE_INT_ENABLE = $02 const MOVE_INT_ENABLE = $02
const MOUSE_ENABLE = $01 const MOUSE_ENABLE = $01
// //
// Mouse API // Mouse API
// //
+2 -2
View File
@@ -31,7 +31,7 @@ end
asm vblEvent asm vblEvent
INC VBLINT ; INC VBL EVENT INC VBLINT ; INC VBL EVENT
+ TYA ; MOUSE MOVE OR BUTTON ACTIVE + TYA ; MOUSE MOVE OR BUTTON ACTIVE
AND #$82 AND #$92
end end
asm bttnEvent asm bttnEvent
EOR LASTBTTN EOR LASTBTTN
@@ -40,7 +40,7 @@ end
asm mouseEvent asm mouseEvent
INC MOUINT ; INC MOUSE EVENT INC MOUINT ; INC MOUSE EVENT
+ TYA + TYA
AND #$80 AND #$90
end end
asm updateBttn asm updateBttn
STA LASTBTTN STA LASTBTTN