Rev 109 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 109 | Rev 316 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | START: ; start of execution |
22 | START: ; start of execution |
23 | mov [procinfo.x_start], 100 |
23 | mov [procinfo.x_start], 100 |
24 | mov [procinfo.x_size], 200 |
24 | mov [procinfo.x_size], 200 |
25 | mov [procinfo.y_start], 80 |
25 | mov [procinfo.y_start], 80 |
26 | mov [procinfo.y_size], 300 |
26 | mov [procinfo.y_size], 300 |
- | 27 | call draw_window |
|
27 | 28 | red: |
|
- | 29 | call get_transparent |
|
28 | call draw_window ; at first, draw the window |
30 | call draw_window ; at first, draw the window |
Line 29... | Line 31... | ||
29 | 31 | ||
Line 30... | Line 32... | ||
30 | still: |
32 | still: |
Line 36... | Line 38... | ||
36 | je red |
38 | je red |
37 | cmp eax,2 ; key in buffer ? |
39 | cmp eax,2 ; key in buffer ? |
38 | je key |
40 | je key |
39 | cmp eax,3 ; button in buffer ? |
41 | cmp eax,3 ; button in buffer ? |
40 | je button |
42 | je button |
41 | - | ||
42 | jmp still |
- | |
43 | - | ||
44 | red: ; redraw |
- | |
45 | call get_transparent |
- | |
46 | call draw_window |
- | |
47 | jmp still |
43 | jmp still |
Line 48... | Line 44... | ||
48 | 44 | ||
49 | key: ; key |
45 | key: ; key |
50 | mov eax,2 ; just read it and ignore |
46 | mov al,2 ; just read it and ignore |
51 | int 0x40 |
47 | int 0x40 |
Line 52... | Line 48... | ||
52 | jmp still |
48 | jmp still |
53 | 49 | ||
54 | button: ; button |
50 | button: ; button |
Line 55... | Line 51... | ||
55 | mov eax,17 ; get id |
51 | mov al,17 ; get id |
56 | int 0x40 |
52 | int 0x40 |
57 | 53 | ||
58 | cmp ah,1 ; button id=1 ? |
54 | cmp ah,1 ; button id=1 ? |
59 | jne noclose |
55 | jne noclose |
Line 60... | Line 56... | ||
60 | mov eax,-1 ; close this program |
56 | or eax,-1 ; close this program |
Line 73... | Line 69... | ||
73 | 69 | ||
74 | mov eax,12 ; function 12:tell os about windowdraw |
70 | mov eax,12 ; function 12:tell os about windowdraw |
75 | mov ebx,1 ; 1, start of draw |
71 | mov ebx,1 ; 1, start of draw |
76 | int 0x40 |
72 | int 0x40 |
77 | ; DRAW WINDOW |
73 | ; DRAW WINDOW |
78 | mov eax,0 ; function 0 : define and draw window |
74 | xor eax,eax ; function 0 : define and draw window |
79 | mov ebx,[procinfo.x_start] |
75 | mov ebx,[procinfo.x_start] |
80 | shl ebx,16 |
76 | shl ebx,16 |
81 | add ebx,[procinfo.x_size] |
- | |
82 | dec ebx |
77 | add ebx,[procinfo.x_size] |
83 | mov ecx,[procinfo.y_start] |
78 | mov ecx,[procinfo.y_start] |
84 | shl ecx,16 |
79 | shl ecx,16 |
85 | add ecx,[procinfo.y_size] |
- | |
86 | dec ecx |
80 | add ecx,[procinfo.y_size] |
- | 81 | mov edx,0x33000000 ; color of work area RRGGBB,8->color gl |
|
87 | mov edx,0x03000000 ; color of work area RRGGBB,8->color gl |
82 | mov edi,header ; WINDOW LABEL |
Line 88... | Line 83... | ||
88 | int 0x40 |
83 | int 0x40 |
89 | - | ||
90 | call draw_transparent |
- | |
91 | ; WINDOW LABEL |
- | |
92 | mov eax,4 ; function 4 : write text to window |
- | |
93 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
- | |
94 | mov ecx,0x10ddeeff ; color of text RRGGBB |
- | |
95 | mov edx,labelt ; pointer to text beginning |
- | |
96 | mov esi,labellen-labelt ; text length |
- | |
97 | int 0x40 |
- | |
Line 98... | Line 84... | ||
98 | 84 | ||
99 | ; call draw_transparent |
85 | call draw_transparent |
100 | 86 | ||
Line 114... | Line 100... | ||
114 | mov eax,7 |
100 | mov eax,7 |
115 | mov ebx,0x1000 |
101 | mov ebx,0x1000 |
116 | mov ecx,[procinfo.x_size] |
102 | mov ecx,[procinfo.x_size] |
117 | shl ecx,16 |
103 | shl ecx,16 |
118 | add ecx,[procinfo.y_size] |
104 | add ecx,[procinfo.y_size] |
119 | mov edx,4*65536+22 |
105 | xor edx,edx |
120 | int 0x40 |
106 | int 0x40 |
Line 121... | Line 107... | ||
121 | 107 | ||
122 | popa |
108 | popa |
Line 129... | Line 115... | ||
129 | 115 | ||
130 | mov eax,9 |
116 | mov eax,9 |
131 | mov ebx,I_END |
117 | mov ebx,I_END |
132 | mov ecx,-1 |
118 | mov ecx,-1 |
133 | int 0x40 |
- | |
134 | ; mov eax,[I_END+34] |
- | |
135 | ; mov [x_start],eax |
- | |
136 | ; mov eax,[I_END+38] |
- | |
Line 137... | Line 119... | ||
137 | ; mov [y_start],eax |
119 | int 0x40 |
138 | 120 | ||
Line 139... | Line 121... | ||
139 | mov eax,14 |
121 | mov eax,14 |
Line 166... | Line 148... | ||
166 | imul ebx,[scx] |
148 | imul ebx,[scx] |
167 | add ebx,eax |
149 | add ebx,eax |
168 | mov eax,35 |
150 | mov eax,35 |
169 | int 0x40 |
151 | int 0x40 |
Line 170... | Line -... | ||
170 | - | ||
171 | ; shr eax,1 |
- | |
172 | ; and eax,0x7f7f7f |
152 | |
Line 173... | Line 153... | ||
173 | or eax, 0x4e4e4e |
153 | or eax, 0x4e4e4e |
174 | 154 | ||
175 | mov ebx,[esp+4] |
155 | mov ebx,[esp+4] |
Line 211... | Line 191... | ||
211 | x_end dd 0 |
191 | x_end dd 0 |
212 | y_end dd 0 |
192 | y_end dd 0 |
Line 213... | Line 193... | ||
213 | 193 | ||
Line 214... | Line -... | ||
214 | scx dd 640 |
- | |
215 | 194 | scx dd 640 |
|
216 | labelt: |
- | |
Line 217... | Line 195... | ||
217 | db 'EXAMPLE APPLICATION' |
195 | |
218 | labellen: |
196 | header db 'Transparent',0 |