-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathtest-mouse-support.arm
More file actions
83 lines (58 loc) · 1.63 KB
/
Copy pathtest-mouse-support.arm
File metadata and controls
83 lines (58 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#AS
///////////////////////////////////////////////////////////
// This program requires keyboard mode to be turned off. //
// This can be done with the --nokeyboard / -nk option //
///////////////////////////////////////////////////////////
///////////////
// Variables //
///////////////
define $pixOffset = 53871 // Beginning of video memory
define $expansionPorts = 53501
define $xPos = 54
define $yPos = 54
//change @EX[1] = 2080
#Update
change $expVal = *[1]$expansionPorts
change $isPressingMouseButton = 0
change $newX = $expVal
change $newY = $expVal
// Bit shift X and remove unused bits
bsr $newX,7 ->$newX
and $newX,0b1111111 ->$newX
// Bit shift Y and remove unused bits
and $newY,0b1111111 -> $newY
// Redraw only if at a new location from last time
change $diff = 0
if $newX!=$xPos:
change $diff = 1
endif
if $newY!=$yPos:
change $diff = 1
endif
// Bit shift Left Mouse Button and remove unused bits
bsr $expVal,14 ->$isPressingMouseButton
if $isPressingMouseButton!=$lastMouseButton:
change $diff = 1
endif
change $lastMouseButton = $isPressingMouseButton
if $diff!=0:
mult $yPos,108 -> $temp
add $xPos,$temp -> $temp
add $pixOffset,$temp -> $temp
change *[1]$temp = 0
change $xPos = $newX
change $yPos = $newY
mult $yPos,108 -> $temp
add $xPos,$temp -> $temp
add $pixOffset,$temp -> $temp
if $isPressingMouseButton==0:
change *[1]$temp = 0b111110000000000
endif
if $isPressingMouseButton==1:
change *[1]$temp = 0b000000000011111
endif
if $isPressingMouseButton==2:
change *[1]$temp = 0b000001111100000
endif
endif
goto #Update