Rev 1829 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1829 | Rev 2108 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | ; PROTECTION TEST |
2 | ; PROTECTION TEST |
3 | ; |
3 | ; |
Line 4... | Line 4... | ||
4 | 4 | ||
Line 5... | Line 5... | ||
5 | use32 |
5 | use32 |
Line 6... | Line 6... | ||
6 | 6 | ||
7 | org 0x0 |
7 | org 0x0 |
8 | 8 | ||
9 | db 'MENUET01' ; 8 byte id |
9 | db 'MENUET01' ; 8 byte id |
10 | dd 0x01 ; header version |
10 | dd 0x01 ; header version |
11 | dd START ; start of code |
11 | dd START ; start of code |
12 | dd I_END ; size of image |
12 | dd I_END ; size of image |
Line 13... | Line 13... | ||
13 | dd 0x10000 ; memory for app |
13 | dd 0x10000 ; memory for app |
Line 14... | Line 14... | ||
14 | dd 0xfff0 ; esp |
14 | dd 0xfff0 ; esp |
Line 15... | Line 15... | ||
15 | dd 0x0 , 0x0 ; I_Param , I_Icon |
15 | dd 0x0 , 0x0 ; I_Param , I_Icon |
Line 16... | Line 16... | ||
16 | 16 | ||
Line 17... | Line 17... | ||
17 | include '../../../macros.inc' |
17 | include '../../../macros.inc' |
18 | - | ||
Line 19... | Line 18... | ||
19 | START: ; start of execution |
18 | |
20 | 19 | START: ; start of execution |
|
21 | call draw_window ; at first, draw the window |
20 | |
22 | 21 | call draw_window ; at first, draw the window |
|
23 | still: |
22 | |
24 | 23 | still: |
|
Line 25... | Line 24... | ||
25 | mov eax,10 ; wait here for event |
24 | |
Line 26... | Line 25... | ||
26 | int 0x40 |
25 | mcall 10 ; wait here for event |
27 | 26 | ||
Line 28... | Line 27... | ||
28 | cmp eax,1 ; redraw request ? |
27 | cmp eax,1 ; redraw request ? |
Line 29... | Line 28... | ||
29 | jz red |
28 | jz red |
30 | cmp eax,2 ; key in buffer ? |
29 | cmp eax,2 ; key in buffer ? |
31 | jz key |
30 | jz key |
Line 32... | Line 31... | ||
32 | cmp eax,3 ; button in buffer ? |
31 | cmp eax,3 ; button in buffer ? |
Line 33... | Line 32... | ||
33 | jz button |
32 | jz button |
34 | 33 | ||
35 | jmp still |
34 | jmp still |
Line 36... | Line 35... | ||
36 | 35 | ||
37 | red: ; redraw |
36 | red: ; redraw |
38 | call draw_window |
37 | call draw_window |
39 | 38 | ||
40 | jmp still |
39 | jmp still |
Line 41... | Line 40... | ||
41 | 40 | ||
42 | key: ; key |
41 | key: ; key |
Line 81... | Line 80... | ||
81 | push eax |
80 | push eax |
82 | notest6: |
81 | notest6: |
Line 83... | Line 82... | ||
83 | 82 | ||
84 | cmp ah,7 |
83 | cmp ah,7 |
85 | jnz notest7 |
84 | jnz notest7 |
86 | in al,0x60 |
85 | in al,0x60 |
Line 87... | Line 86... | ||
87 | notest7: |
86 | notest7: |
88 | 87 | ||
89 | cmp ah,8 |
88 | cmp ah,8 |
Line 102... | Line 101... | ||
102 | ; ********************************************* |
101 | ; ********************************************* |
Line 103... | Line 102... | ||
103 | 102 | ||
Line 104... | Line -... | ||
104 | - | ||
105 | draw_window: |
- | |
106 | 103 | ||
107 | mov eax,12 ; function 12:tell os about windowdraw |
- | |
108 | mov ebx,1 ; 1, start of draw |
- | |
109 | int 0x40 |
- | |
110 | - | ||
111 | ; DRAW WINDOW |
- | |
112 | mov eax,0 ; function 0 : define and draw window |
- | |
113 | mov ebx,100*65536+300 ; [x start] *65536 + [x size] |
- | |
114 | mov ecx,100*65536+240 ; [y start] *65536 + [y size] |
- | |
115 | mov edx,0x02ffffff ; color of work area RRGGBB |
- | |
Line 116... | Line -... | ||
116 | mov esi,0x80597799 ; color of grab bar RRGGBB,8->color glide |
- | |
117 | mov edi,0x00597799 ; color of frames RRGGBB |
- | |
118 | int 0x40 |
- | |
119 | - | ||
120 | ; WINDOW LABEL |
- | |
121 | mov eax,4 ; function 4 : write text to window |
- | |
122 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
104 | draw_window: |
Line 123... | Line -... | ||
123 | mov ecx,0x00ffffff ; color of text RRGGBB |
- | |
124 | mov edx,tlabel ; pointer to text beginning |
- | |
125 | mov esi,labellen-tlabel ; text length |
- | |
126 | int 0x40 |
- | |
127 | 105 | ||
128 | ; CLOSE BUTTON |
- | |
129 | mov eax,8 ; function 8 : define and draw button |
- | |
Line 130... | Line -... | ||
130 | mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size] |
- | |
131 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] |
106 | ;mcall 48, 3, sys_colors, 40 |
132 | mov edx,1 ; button id |
107 | |
133 | mov esi,0x5977bb ; button color RRGGBB |
108 | mcall 12, 1 |
134 | int 0x40 |
109 | |
135 | 110 | mcall 0, <200,292>, <200,230>, 0x14FFFFFF,,tlabel |
|
136 | 111 | ||
137 | mov eax,8 ; function 8 : define and draw button |
112 | mov eax,8 ; function 8 : define and draw button |
138 | mov ebx,25*65536+9 ; [x start] *65536 + [x size] |
113 | mov ebx,32*65536+10 ; [x start] *65536 + [x size] |
139 | mov ecx,74*65536+9 ; [y start] *65536 + [y size] |
114 | mov ecx,75*65536+10 ; [y start] *65536 + [y size] |
140 | mov edx,2 ; button id |
115 | mov edx,2 ; button id |
141 | mov esi,0x5977bb ; button color RRGGBB |
116 | mov esi,0x6888B8 ; button color RRGGBB |
Line 142... | Line 117... | ||
142 | newb: |
117 | newb: |
143 | int 0x40 |
118 | int 0x40 |
144 | add ecx,20*65536 |
119 | add ecx,20*65536 |
145 | inc edx |
120 | inc edx |
146 | cmp edx,9 |
121 | cmp edx,9 |
147 | jb newb |
122 | jb newb |
148 | 123 | ||
Line 158... | Line 133... | ||
158 | add edx,40 |
133 | add edx,40 |
159 | cmp [edx],byte 'x' |
134 | cmp [edx],byte 'x' |
160 | jnz newline |
135 | jnz newline |
Line 161... | Line 136... | ||
161 | 136 | ||
162 | - | ||
163 | mov eax,12 ; function 12:tell os about windowdraw |
- | |
Line 164... | Line -... | ||
164 | mov ebx,2 ; 2, end of draw |
- | |
Line -... | Line 137... | ||
- | 137 | ||
Line 165... | Line 138... | ||
165 | int 0x40 |
138 | mcall 12, 2 ; function 12:tell os about windowdraw |
Line 166... | Line 139... | ||
166 | 139 | ||
Line 167... | Line 140... | ||
167 | ret |
140 | |
168 | 141 | ret |
|
169 | 142 | ||
170 | ; DATA AREA |
143 | ; DATA AREA |
171 | 144 | ||
172 | 145 | ||
173 | text: |
146 | text: |
174 | 147 | ||
Line 192... | Line 165... | ||
192 | db 'x ' |
165 | db 'x ' |
Line 193... | Line 166... | ||
193 | 166 | ||
194 | 167 | ||
195 | 168 | ||
Line 196... | Line 169... | ||
196 | tlabel: |
169 | tlabel: |