Rev 109 | Rev 551 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 109 | Rev 485 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | dd I_END ; size of image |
15 | dd I_END ; size of image |
16 | dd 0x4000 ; memory for app |
16 | dd 0x4000 ; memory for app |
17 | dd 0x4000 ; esp |
17 | dd 0x4000 ; esp |
18 | dd 0x0 , 0x0 ; I_Param , I_Icon |
18 | dd 0x0 , 0x0 ; I_Param , I_Icon |
Line 19... | Line 19... | ||
19 | 19 | ||
20 | include 'macros.inc' |
- | |
21 | labelt db 'Memory Blocks for Menuet v0.1 Crown Soft (c)' |
- | |
Line -... | Line 20... | ||
- | 20 | include '..\..\..\macros.inc' |
|
Line 22... | Line 21... | ||
22 | labellen: |
21 | |
23 | 22 | title db 'Memory Blocks for Menuet v0.1 Crown Soft (c)',0 |
|
Line 24... | Line 23... | ||
24 | 23 | ||
25 | 24 | ||
26 | START: ; start of execution |
25 | START: ; start of execution |
Line 27... | Line 26... | ||
27 | call initpict |
26 | call initpict |
28 | 27 | ||
29 | still: |
28 | still: |
30 | mov eax,10 ; wait here for event |
29 | mov eax,10 ; wait here for event |
Line 42... | Line 41... | ||
42 | call draw_window |
41 | call draw_window |
43 | jmp still |
42 | jmp still |
Line 44... | Line 43... | ||
44 | 43 | ||
45 | key: ; key |
44 | key: ; key |
46 | mov eax,2 ; just read it and ignore |
45 | mov eax,2 ; just read it and ignore |
47 | int 0x40 |
46 | mcall |
Line 48... | Line 47... | ||
48 | jmp still |
47 | jmp still |
49 | 48 | ||
50 | button: ; button |
49 | button: ; button |
Line 51... | Line 50... | ||
51 | mov eax,17 ; get id |
50 | mov eax,17 ; get id |
52 | int 0x40 |
51 | mcall |
Line 53... | Line 52... | ||
53 | 52 | ||
Line 108... | Line 107... | ||
108 | call initpict |
107 | call initpict |
109 | jmp still |
108 | jmp still |
Line 110... | Line 109... | ||
110 | 109 | ||
111 | close: |
110 | close: |
112 | mov eax,-1 ; close program |
111 | mov eax,-1 ; close program |
Line 113... | Line 112... | ||
113 | int 0x40 |
112 | mcall |
114 | 113 | ||
115 | 114 | ||
116 | 115 | ||
117 | ;====================================================================== |
116 | ;====================================================================== |
118 | ;=============== WINDOW DEFINITIONS AND DRAW ======================== |
117 | ;=============== WINDOW DEFINITIONS AND DRAW ======================== |
119 | ;====================================================================== |
118 | ;====================================================================== |
Line 120... | Line 119... | ||
120 | draw_window: |
119 | draw_window: |
121 | mov eax,12 ; function 12:tell os about windowdraw |
120 | mov eax,12 ; function 12:tell os about windowdraw |
122 | mov ebx,1 ; 1, start of draw |
121 | mov ebx,1 ; 1, start of draw |
123 | int 0x40 |
122 | mcall |
124 | 123 | ||
125 | ; DRAW WINDOW |
- | |
126 | mov eax,0 ; function 0 : define and draw window |
124 | ; DRAW WINDOW |
127 | mov ebx,100*65536+413 ; [x start] *65536 + [x size] |
125 | mov eax,0 ; function 0 : define and draw window |
Line 128... | Line -... | ||
128 | mov ecx,100*65536+295 ; [y start] *65536 + [y size] |
- | |
129 | mov edx,0x83000000 ; color of work area RRGGBB,8->color gl |
- | |
130 | mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl |
- | |
131 | mov edi,0x005080d0 ; color of frames RRGGBB |
- | |
132 | int 0x40 |
- | |
133 | - | ||
134 | ; WINDOW LABEL |
- | |
135 | mov eax,4 ; function 4 : write text to window |
- | |
136 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
- | |
137 | mov ecx,0x00ddeeff ; color of text RRGGBB |
- | |
138 | mov edx,labelt ; pointer to text beginning |
- | |
139 | mov esi,labellen-labelt ; text length |
- | |
140 | int 0x40 |
- | |
141 | - | ||
142 | ; ; CLOSE BUTTON |
- | |
Line 143... | Line 126... | ||
143 | ; mov eax,8 ; function 8 : define and draw button |
126 | mov ebx,100*65536+413 ; [x start] *65536 + [x size] |
144 | ; mov ebx,(411-19)*65536+12 ; [x start] *65536 + [x size] |
127 | mov ecx,100*65536+295 ; [y start] *65536 + [y size] |
145 | ; mov ecx,5*65536+12 ; [y start] *65536 + [y size] |
128 | mov edx,0x93000000 ; color of work area RRGGBB,8->color gl |
146 | ; mov edx,1 ; button id |
129 | mov edi,title ; WINDOW LABEL |
147 | ; mov esi,0x6688dd ; button color RRGGBB |
130 | mcall |
148 | ; int 0x40 |
131 | |
149 | 132 | ||
150 | ; init BUTTON |
133 | ; init BUTTON |
151 | mov eax,8 ; function 8 : define and draw button |
134 | mov eax,8 ; function 8 : define and draw button |
152 | mov ebx,10*65536+55 ; [x start] *65536 + [x size] |
135 | mov ebx,10*65536+55 ; [x start] *65536 + [x size] |
153 | mov ecx,270*65536+12 ; [y start] *65536 + [y size] |
136 | mov ecx,270*65536+12 ; [y start] *65536 + [y size] |
154 | mov edx,100 ; button id |
137 | mov edx,100 ; button id |
155 | mov esi,0x6688dd ; button color RRGGBB |
138 | mov esi,0x6688dd ; button color RRGGBB |
156 | int 0x40 |
139 | mcall |
Line 157... | Line 140... | ||
157 | ; NEW GAME LABEL |
140 | ; NEW GAME LABEL |
158 | mov eax,4 ; function 4 : write text to window |
141 | mov eax,4 ; function 4 : write text to window |
159 | mov ebx,15*65536+273 ; [x start] *65536 + [y start] |
142 | mov ebx,15*65536+273 ; [x start] *65536 + [y start] |
160 | mov ecx,0x00ddeeff ; color of text RRGGBB |
143 | mov ecx,0x00ddeeff ; color of text RRGGBB |
161 | mov edx,labnew ; pointer to text beginning |
144 | mov edx,labnew ; pointer to text beginning |
162 | mov esi,labnewlen-labnew ; text length |
145 | mov esi,labnewlen-labnew ; text length |
Line 163... | Line 146... | ||
163 | int 0x40 |
146 | mcall |
164 | 147 | ||
165 | mov ebx,40001h |
148 | mov ebx,40001h |
Line 191... | Line 174... | ||
191 | 174 | ||
Line 192... | Line 175... | ||
192 | movzx edx,[bitid] ; button id |
175 | movzx edx,[bitid] ; button id |
193 | 176 | ||
194 | mov esi,[coltbl+16*4] ; button color RRGGBB |
177 | mov esi,[coltbl+16*4] ; button color RRGGBB |
Line 195... | Line 178... | ||
195 | mov eax,8 ; function 8 : define and draw button |
178 | mov eax,8 ; function 8 : define and draw button |
196 | int 0x40 |
179 | mcall |
197 | 180 | ||
198 | ; PICTURE |
181 | ; PICTURE |
Line 211... | Line 194... | ||
211 | add edx,10001h |
194 | add edx,10001h |
Line 212... | Line 195... | ||
212 | 195 | ||
213 | mov ebx,mas |
196 | mov ebx,mas |
214 | mov ecx,32*65536+32 ; image size |
197 | mov ecx,32*65536+32 ; image size |
215 | mov eax,7 ; function 7 : putimage |
198 | mov eax,7 ; function 7 : putimage |
216 | int 0x40 |
199 | mcall |
Line 217... | Line 200... | ||
217 | drm3: |
200 | drm3: |
218 | 201 | ||
219 | inc [bitid] |
202 | inc [bitid] |
220 | popad |
203 | popad |
221 | loop drm2 |
204 | loop drm2 |
Line 222... | Line 205... | ||
222 | mov ecx,ebx |
205 | mov ecx,ebx |
223 | loop drm1 |
206 | loop drm1 |
224 | 207 | ||
Line 225... | Line 208... | ||
225 | mov eax,12 ; function 12:tell os about windowdraw |
208 | mov eax,12 ; function 12:tell os about windowdraw |
Line 226... | Line 209... | ||
226 | mov ebx,2 ; 2, end of draw |
209 | mov ebx,2 ; 2, end of draw |
Line 290... | Line 273... | ||
290 | mov al,0ffh |
273 | mov al,0ffh |
291 | rep stosb ; bitpict=0ffh firstbit=0ffh secondbit=0ffh |
274 | rep stosb ; bitpict=0ffh firstbit=0ffh secondbit=0ffh |
Line 292... | Line 275... | ||
292 | 275 | ||
293 | ; Initialize RND |
276 | ; Initialize RND |
294 | mov eax,3 |
277 | mov eax,3 |
295 | int 0x40 ; eax=00SSMMHH |
278 | mcall ; eax=00SSMMHH |
Line 296... | Line 279... | ||
296 | rol eax,16 ; eax=MMHH00SS - fist random number |
279 | rol eax,16 ; eax=MMHH00SS - fist random number |
Line 297... | Line 280... | ||
297 | 280 |