Subversion Repositories Kolibri OS

Rev

Rev 5093 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
880 serge 1
 
5093 clevermous 2
880 serge 3
 
4
{
5
  .frame            dd ?
6
  .grab             dd ?
7
  .work_3d_dark      dd ?
6196 leency 8
  .work_3d_light dd ?
9
  .grab_text        dd ?
880 serge 10
  .work             dd ?
11
  .work_button      dd ?
12
  .work_button_text dd ?
13
  .work_text        dd ?
14
  .work_graph       dd ?
15
}
16
17
 
18
19
 
20
dd 1
21
dd start
22
dd i_end
23
dd mem
24
dd mem
25
dd 0
26
dd 0
27
28
 
29
30
 
31
start:
32
           call load_pxlib
33
           test eax, eax
34
           jz .fail
35
36
 
37
38
 
39
           mov ebx, esp
40
           mov ecx, -1
41
           int 0x40
42
43
 
44
           mov eax, 18
45
           mov ebx, 21
46
           int 0x40
47
48
 
49
50
 
51
52
 
53
           mov  ebx,3
54
           mov  ecx,sc
55
           mov  edx,10*4
56
           int 0x40
57
.redraw:
58
           call draw_window
59
60
 
61
62
 
63
           mov ebx, 7
64
           int 0x40
65
           cmp eax, [slot]
66
           jne .skip_draw
67
68
 
69
70
 
71
           mov ebx, esp
72
           mov ecx, -1
73
           int 0x40
74
75
 
76
           mov ecx, [esp+0x26]; ywin
77
           add edx, [esp+0x36]
78
           add ecx, [esp+0x3A]
79
80
 
81
           mov ebx, [esp+0x42]
82
83
 
84
85
 
86
           jle .skip_draw
87
           test ebx, ebx
88
           jle .skip_draw
89
90
 
91
           push eax
92
           push ecx
93
           push edx
94
           call _Draw
95
           add esp, 16
96
97
 
98
99
 
100
        ;   mov eax, 23
101
        ;   int 0x40
102
103
 
104
           int 0x40
105
106
 
107
          js .wait_event
108
109
 
110
           dec eax                     ;   else if event = 2
111
           jz  .key                    ;   jump to key handler
112
           dec eax
113
           jz  .button
114
115
 
116
117
 
118
           mov al, 17                  ;   get button identifier
119
           int 0x40
120
121
 
122
           jne .wait_event             ;   return if button id != 1
123
.exit:
124
                                       ; restore old screen and cleanup
125
.fail:
126
           or eax, -1                  ;   exit application
127
           int 0x40
128
.key:                                  ; key event handler
129
           mov al, 2                   ;   get key code
130
           int 0x40
131
132
 
133
134
 
135
           mov eax, 12                 ; start drawing
136
           mov ebx, 1
137
           int 0x40
138
139
 
140
           mov  ebx, 100*65536+320     ; (window_cx)*65536+(window_sx)
141
           mov  ecx, 100*65536+240     ; (window_cy)*65536+(window_sy)
142
           mov  edx, [sc.work]         ; work area color
143
           or   edx, 0x33000000        ; & window type 3
144
           mov  edi, title             ; window title
145
           int  0x40
146
147
 
148
           mov  ebx, 2
149
           int  0x40
150
151
 
152
153
 
154
PTR   equ
155
156
 
157
        push    ebp
158
        xor     edx, edx
159
        push    edi
160
        push    esi
161
        push    ebx
162
        sub     esp, 44
163
        imul    eax, DWORD PTR [_glSeed], 69069
164
        mov     ebp, DWORD PTR [esp+72]
165
        mov     ecx, DWORD PTR [esp+76]
166
        inc     eax
167
        mov     DWORD PTR [esp+32], eax
168
        imul    eax, eax, 69069
169
        inc     eax
170
        mov     DWORD PTR [esp+36], eax
171
        imul    eax, eax, 69069
172
        inc     eax
173
        mov     DWORD PTR [esp+40], eax
174
        imul    eax, eax, 69069
175
        lea     ebx, [eax+1]
176
        mov     eax, ebx
177
        div     ebp
178
        imul    eax, ebx, 69069
179
        lea     ebx, [eax+1]
180
        mov     eax, ebx
181
        mov     edi, edx
182
        xor     edx, edx
183
        div     ecx
184
        imul    eax, ebx, 69069
185
        lea     ebx, [eax+1]
186
        mov     eax, ebx
187
        mov     esi, edx
188
        xor     edx, edx
189
        div     ebp
190
        imul    eax, ebx, 69069
191
        inc     eax
192
        mov     DWORD PTR [_glSeed], eax
193
        mov     ebp, edx
194
        mov     DWORD PTR [esp+28], edx
195
        xor     edx, edx
196
        div     ecx
197
        cmp     ebp, edi
198
        mov     ebx, edx
199
        jge     L2
200
        mov     DWORD PTR [esp+28], edi
201
        mov     edi, ebp
202
L2:
203
        cmp     ebx, esi
204
        jge     L4
205
        mov     ebx, esi
206
        mov     esi, edx
207
L4:
208
        push    eax
209
        mov     ecx, 255
210
        push    -16777216
211
        mov     eax, DWORD PTR [esp+40]
212
        xor     edx, edx
213
        div     ecx
214
        mov     eax, DWORD PTR [esp+48]
215
        mov     ebp, edx
216
        xor     edx, edx
217
        div     ecx
218
        mov     eax, DWORD PTR [esp+44]
219
        sal     ebp, 16
220
        or      ebp, -16777216
221
        mov     DWORD PTR [esp+8], edx
222
        or      ebp, edx
223
        xor     edx, edx
224
        div     ecx
225
        lea     eax, [ebx+1]
226
        sub     eax, esi
227
        sal     edx, 8
228
        or      ebp, edx
229
        push    ebp
230
        push    eax
231
        mov     eax, DWORD PTR [esp+44]
232
        inc     eax
233
        sub     eax, edi
234
        push    eax
235
        mov     eax, esi
236
        add     eax, DWORD PTR [esp+88]
237
        push    eax
238
        mov     eax, edi
239
        add     eax, DWORD PTR [esp+88]
240
        push    eax
241
        push    -1
242
        call    [imp_DrawRect]
243
        add     esp, 76
244
        pop     ebx
245
        pop     esi
246
        pop     edi
247
        pop     ebp
248
        ret
249
align 4
250
251
 
252
_glSeed     dd  -365387184
253
254
 
255
256
 
257
258
 
259
260
 
261
262
 
263
264
 
265
266
 
267
 
268
mem:
269