1706
|
1
|
|
2 * Additional gfx operations.
|
|
3 *
|
|
4 * Uses some variables from view_gfx.a
|
|
5 * numscreens - total number of screens allocated
|
|
6 * screenpaths - array of path number for screens
|
|
7 * curscreen - current screen displayed
|
|
8 *
|
|
9 * Routines included:
|
|
10 * getkey: - poll each open screen for keypress.
|
|
11 * (returns Carry set if no key available)
|
|
12 * setmouse: - Set mouse signal on each open screen
|
|
13 * setkey: - Set key signal on each open screen
|
|
14 * nextline: - Higher-level interface to "putline".
|
|
15 * Automatically increments to next line,
|
|
16 * allocates next screen as appropriate.
|
|
17 * Uses "border" to set screen border for new screens.
|
|
18 *
|
|
19 ifp1
|
1912
|
20 use os9defs.d
|
1706
|
21 endc
|
|
22
|
|
23 check macro
|
|
24 pshs b,cc
|
|
25 ldb #\1
|
|
26 os9 F$PErr
|
|
27 puls b,cc
|
|
28 endm
|
|
29
|
|
30 psect view_gfx2_a,0,0,0,0,0
|
|
31
|
|
32 *
|
|
33 * Poll each open screen
|
|
34 getkey:
|
|
35 pshs b,x,y
|
|
36 leax screenpaths,y
|
|
37 clrb
|
|
38 getkeyloop
|
|
39 lda b,x
|
|
40 pshs b
|
|
41 ldb #SS.Ready
|
|
42 os9 I$GetStt
|
|
43 bcc getkeyok
|
|
44 cmpb #E$NotRdy
|
|
45 lbne _error
|
|
46 puls b
|
|
47 incb
|
|
48 cmpb <numscreens
|
|
49 bne getkeyloop
|
|
50 clra
|
|
51 orcc #Carry Turn on carry
|
|
52 bra getkeyend
|
|
53 getkeyok
|
|
54 tfr s,x
|
|
55 ldy #1
|
|
56 os9 I$Read Read one character
|
|
57 lbcs _error
|
|
58 puls a Get the char into A.
|
|
59 andcc #^Carry Turn off carry
|
|
60 getkeyend
|
|
61 puls b,x,y,pc
|
|
62
|
|
63 setmouse:
|
|
64 pshs a,b,x,y,u
|
|
65 ldb <numscreens Get the number of screens.
|
|
66 clra
|
|
67 leau screenpaths,y
|
|
68 tfr d,y
|
|
69 ldx #MButton Return this signal code.
|
|
70 ldb #SS.MsSig
|
|
71 setmloop
|
|
72 lda ,u+ Get path number
|
|
73 os9 I$SetStt Set the mouse signal.
|
|
74 lbcs _error
|
|
75 leay -1,y
|
|
76 bne setmloop If we haven't done all paths, keep going
|
|
77 puls a,b,x,y,u,pc
|
|
78
|
|
79 setkeysig:
|
|
80 pshs a,b,x,y,u
|
|
81 ldb <numscreens Get the number of screens.
|
|
82 clra
|
|
83 leau screenpaths,y
|
|
84 tfr d,y
|
|
85 ldx #KButton Return this signal code.
|
|
86 ldb #SS.SSig
|
|
87 setkloop
|
|
88 lda ,u+ Get path number
|
|
89 os9 I$SetStt Set the mouse signal.
|
|
90 lbcs _error
|
|
91 leay -1,y
|
|
92 bne setkloop If we haven't done all paths, keep going
|
|
93 puls a,b,x,y,u,pc
|
|
94
|
|
95 vsect dp
|
|
96 curline rmb 2
|
|
97 endsect
|
|
98
|
|
99 nextline:
|
|
100 pshs a,b
|
|
101 ldd curline
|
|
102 cmpd #192 Are we off the screen?
|
|
103 blo nextdoit
|
|
104 lbsr setscreen Get a new screen
|
|
105 lbsr setpals Set the palettes
|
|
106 lda <border
|
|
107 lbsr setborder Set the border color
|
|
108 ldd #0
|
|
109 nextdoit
|
|
110 lbsr putline Put this line
|
|
111 addd #1
|
|
112 std curline
|
|
113 puls a,b,pc
|
|
114
|
|
115 endsect
|