annotate 3rdparty/utils/view/view_gfx2.a @ 1912:37fd74e6fad8

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