-
Notifications
You must be signed in to change notification settings - Fork 2
/
mousedemo.s
74 lines (54 loc) · 1.04 KB
/
mousedemo.s
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
;
; mousedemo.s
; Mouse driver sample application
;
; Created by Quinn Dunki on 7/14/15.
; Copyright (c) 2015 One Girl, One Laptop Productions. All rights reserved.
;
.org $6000
COUT = $fded
PRBYTE = $fdda
main: ; BRUN lands here
jsr WGEnableMouse
loop:
; Print current mouse position
lda #'X' + $80
jsr COUT
lda #'=' + $80
jsr COUT
lda WG_MOUSEPOS_X
jsr PRBYTE
lda #' ' + $80
jsr COUT
lda #'Y' + $80
jsr COUT
lda #'=' + $80
jsr COUT
lda WG_MOUSEPOS_Y
jsr PRBYTE
lda WG_MOUSECLICK_X
bmi lineDone
lda #' ' + $80
jsr COUT
lda #'!' + $80
jsr COUT
lda #$ff
sta WG_MOUSECLICK_X
lineDone:
lda #13 + $80
jsr COUT
; Check for any key to quit
lda KBD
bpl loop ; No key pending
; Clean up and return to BASIC
sta KBDSTRB ; Clear strobe
jsr WGDisableMouse
rts
.include "mouse.s"
; Suppress some linker warnings - Must be the last thing in the file
; This is because Quinn doesn't really know how to use ca65 properly
.SEGMENT "ZPSAVE"
.SEGMENT "EXEHDR"
.SEGMENT "STARTUP"
.SEGMENT "INIT"
.SEGMENT "LOWCODE"