Subversion Repositories Kolibri OS

Rev

Rev 502 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 502 Rev 957
1
;
1
;
2
;   Vertical Refresh Rate programm
2
;   Vertical Refresh Rate programm
3
;
3
;
4
;   Author:  Trans <<< 13 >>>
4
;   Author:  Trans <<< 13 >>>
5
;   Date:    February-May 2003 (09.05.2003)
5
;   Date:    February-May 2003 (09.05.2003)
6
;   Version: 2.0
6
;   Version: 2.0
7
;   Last Modification: 30.07.2003
7
;   Last Modification: 30.07.2003
8
;   Compile with FASM for Menuet
8
;   Compile with FASM for Menuet
9
;
9
;
10
use32
10
use32
11
   
11
   
12
        org    0x0
12
        org    0x0
13
   
13
   
14
        db     'MENUET01'   ; 8 byte id
14
        db     'MENUET01'   ; 8 byte id
15
        dd     0x01         ; header version
15
        dd     0x01         ; header version
16
        dd     START        ; start of code
16
        dd     START        ; start of code
17
        dd     I_END        ; size of image
17
        dd     I_END        ; size of image
18
        dd     0x5000       ; memory for app
18
        dd     0x5000       ; memory for app
19
        dd     0x4ff0       ; esp
19
        dd     0x4ff0       ; esp
20
        dd     0x0 , 0x0    ; I_Param , I_Icon
20
        dd     0x0 , 0x0    ; I_Param , I_Icon
21
   
21
   
22
include '..\..\..\macros.inc'
22
include '..\..\..\macros.inc'
23
START:    ; start of execution
23
START:    ; start of execution
24
   
24
   
25
    mov eax,14
25
    mov eax,14
26
    mcall
26
    mcall
27
    mov ebx,eax
27
    mov ebx,eax
28
    shr ebx,16
28
    shr ebx,16
29
    mov [oldX],ebx
29
    mov [oldX],ebx
30
    shl eax,16
30
    shl eax,16
31
    shr eax,16
31
    shr eax,16
32
    mov [oldY],eax
32
    mov [oldY],eax
33
   
33
   
34
; Test on installed video driver
34
; Test on installed video driver
35
    mov eax,21
35
    mov eax,21
36
    mov ebx,13
36
    mov ebx,13
37
    mov ecx,1
37
    mov ecx,1
38
    mov edx,drvinfo
38
    mov edx,drvinfo
39
    mcall
39
    mcall
40
    cmp eax,0FFFFFFFFh ; = -1 - error or not installed
40
    cmp eax,0FFFFFFFFh ; = -1 - error or not installed
41
    jne vrr_00
41
    jne vrr_00
42
    call warning_info
42
    call warning_info
43
    retn
43
    retn
44
;
44
;
45
   
45
   
46
vrr_00:
46
vrr_00:
47
    call get_vert_rate
47
    call get_vert_rate
48
    mov eax,[currvm]
48
    mov eax,[currvm]
49
    mov [oldvm],eax
49
    mov [oldvm],eax
50
    call get_pid
50
    call get_pid
51
red:
51
red:
52
    call draw_window  ; at first, draw the window
52
    call draw_window  ; at first, draw the window
53
   
53
   
54
still:
54
still:
55
   
55
   
56
    mov  eax,10   ; check here for event
56
    mov  eax,10   ; check here for event
57
    mcall
57
    mcall
58
   
58
   
59
    cmp  eax,1   ; redraw request ?
59
    cmp  eax,1   ; redraw request ?
60
    je  red
60
    je  red
61
    cmp  eax,2   ; key in buffer ?
61
    cmp  eax,2   ; key in buffer ?
62
    je  key
62
    je  key
63
    cmp  eax,3   ; button in buffer ?
63
    cmp  eax,3   ; button in buffer ?
64
    je  button
64
    je  button
65
    call get_pid
65
    call get_pid
66
    jmp  still
66
    jmp  still
67
      
67
      
68
  key:    ; key
68
  key:    ; key
69
    mov  al,2   ; just read it
69
    mov  al,2   ; just read it
70
    mcall
70
    mcall
71
    cmp ah,'1'
71
    cmp ah,'1'
72
    jne key_loc_00
72
    jne key_loc_00
73
    call safekey
73
    call safekey
74
    jmp still
74
    jmp still
75
key_loc_00:
75
key_loc_00:
76
    cmp ah,'2'
76
    cmp ah,'2'
77
    jne key_loc_01
77
    jne key_loc_01
78
    call safekey
78
    call safekey
79
    jmp still
79
    jmp still
80
key_loc_01:
80
key_loc_01:
81
    cmp ah,'3'
81
    cmp ah,'3'
82
    jne key_loc_02
82
    jne key_loc_02
83
    call safekey
83
    call safekey
84
    jmp still
84
    jmp still
85
key_loc_02:
85
key_loc_02:
86
    cmp ah,'4'
86
    cmp ah,'4'
87
    jne key_loc_03
87
    jne key_loc_03
88
    call safekey
88
    call safekey
89
    jmp still
89
    jmp still
90
key_loc_03:
90
key_loc_03:
91
    cmp ah,'5'
91
    cmp ah,'5'
92
    jne key_loc_04
92
    jne key_loc_04
93
    call safekey
93
    call safekey
94
    jmp still
94
    jmp still
95
key_loc_04:
95
key_loc_04:
96
    cmp ah,'-'
96
    cmp ah,'-'
97
    jne key_loc_05
97
    jne key_loc_05
98
    xor eax,eax
98
    xor eax,eax
99
    call inc_dec_rate
99
    call inc_dec_rate
100
    jmp still
100
    jmp still
101
key_loc_05:
101
key_loc_05:
102
    cmp ah,'+'
102
    cmp ah,'+'
103
    jne key_loc_06
103
    jne key_loc_06
104
    xor eax,eax
104
    xor eax,eax
105
    inc eax
105
    inc eax
106
    call inc_dec_rate
106
    call inc_dec_rate
107
    jmp  still
107
    jmp  still
108
key_loc_06:
108
key_loc_06:
109
    cmp ah,'r'         ;Return in last stable mode
109
    cmp ah,'r'         ;Return in last stable mode
110
    jne key_loc_07
110
    jne key_loc_07
111
    call restore_mode
111
    call restore_mode
112
    jmp red
112
    jmp red
113
key_loc_07:
113
key_loc_07:
114
    cmp ah,13          ;Apply select mode
114
    cmp ah,13          ;Apply select mode
115
    jne still
115
    jne still
116
    xor eax,eax
116
    xor eax,eax
117
    mov ax,[vmselect]
117
    mov ax,[vmselect]
118
    cmp al,0
118
    cmp al,0
119
    je still
119
    je still
120
    xor ebx,ebx
120
    xor ebx,ebx
121
    mov bl,al
121
    mov bl,al
122
    dec bl
122
    dec bl
123
    shl bx,1      ; ebx=(ebx-1)*2
123
    shl bx,1      ; ebx=(ebx-1)*2
124
    xor edx,edx
124
    xor edx,edx
125
    mov dx,[vidmode+ebx]
125
    mov dx,[vidmode+ebx]
126
    mov ecx,ebx
126
    mov ecx,ebx
127
    shl ebx,2
127
    shl ebx,2
128
    add ebx,ecx   ; ebx=ebx*5
128
    add ebx,ecx   ; ebx=ebx*5
129
    shr ax,8
129
    shr ax,8
130
    dec ax
130
    dec ax
131
    shl ax,1
131
    shl ax,1
132
    add ebx,eax
132
    add ebx,eax
133
    ror edx,16
133
    ror edx,16
134
    mov dx,[_m1+ebx]
134
    mov dx,[_m1+ebx]
135
    rol edx,16
135
    rol edx,16
136
    call set_my_mode
136
    call set_my_mode
137
    call protect_and_return
137
    call protect_and_return
138
    xor ax,ax
138
    xor ax,ax
139
    mov [vmselect],ax
139
    mov [vmselect],ax
140
    jmp red
140
    jmp red
141
   
141
   
142
button:   ; button
142
button:   ; button
143
    mov  al,17   ; get id
143
    mov  al,17   ; get id
144
    mcall
144
    mcall
145
   
145
   
146
    cmp  ah,1   ; button id=1 ?
146
    cmp  ah,1   ; button id=1 ?
147
    jne  noclose
147
    jne  noclose
148
    mov  eax,-1           ; close this program
148
    mov  eax,-1           ; close this program
149
    mcall
149
    mcall
150
  noclose:
150
  noclose:
151
    cmp ah,2              ;'+' screen width
151
    cmp ah,2              ;'+' screen width
152
    jne button_loc_01
152
    jne button_loc_01
153
    xor eax,eax
153
    xor eax,eax
154
    inc eax
154
    inc eax
155
    call inc_dec_rate
155
    call inc_dec_rate
156
    jmp still
156
    jmp still
157
button_loc_01:
157
button_loc_01:
158
    cmp ah,3              ;'-' screen width
158
    cmp ah,3              ;'-' screen width
159
    jne button_loc_02
159
    jne button_loc_02
160
    xor eax,eax
160
    xor eax,eax
161
    call inc_dec_rate
161
    call inc_dec_rate
162
    jmp still
162
    jmp still
163
button_loc_02:
163
button_loc_02:
164
    cmp ah,4              ; Ok
164
    cmp ah,4              ; Ok
165
    jne button_loc_03
165
    jne button_loc_03
166
    mov ah,13
166
    mov ah,13
167
    jmp key_loc_07
167
    jmp key_loc_07
168
button_loc_03:
168
button_loc_03:
169
    cmp ah,5              ; Cancel
169
    cmp ah,5              ; Cancel
170
    jne button_loc_04
170
    jne button_loc_04
171
    mov [vmselect],word 00h
171
    mov [vmselect],word 00h
172
    jmp red
172
    jmp red
173
button_loc_04:
173
button_loc_04:
174
    cmp ah,6              ; Return
174
    cmp ah,6              ; Return
175
    jne button_loc_05
175
    jne button_loc_05
176
    mov ah,'r'
176
    mov ah,'r'
177
    jmp key_loc_06
177
    jmp key_loc_06
178
button_loc_05:
178
button_loc_05:
179
    cmp ah,7              ; Default
179
    cmp ah,7              ; Default
180
    jne button_loc_06
180
    jne button_loc_06
181
    call restore_mode
181
    call restore_mode
182
button_loc_06:
182
button_loc_06:
183
    jmp  still
183
    jmp  still
184
   
184
   
185
   
185
   
186
;   *********************************************
186
;   *********************************************
187
;   *******  WINDOW DEFINITIONS AND DRAW ********
187
;   *******  WINDOW DEFINITIONS AND DRAW ********
188
;   *********************************************
188
;   *********************************************
189
   
189
   
190
   
190
   
191
draw_window:
191
draw_window:
192
   
192
   
193
dw_continue:
193
dw_continue:
194
   
194
   
195
    mov  eax,12      ; function 12:tell os about windowdraw
195
    mov  eax,12      ; function 12:tell os about windowdraw
196
    mov  ebx,1      ; 1, start of draw
196
    mov  ebx,1      ; 1, start of draw
197
    mcall
197
    mcall
198
   
198
   
199
       ; DRAW WINDOW
199
       ; DRAW WINDOW
200
    mov  eax,0      ; function 0 : define and draw window
200
    mov  eax,0      ; function 0 : define and draw window
201
    mov  ebx,100*65536+400    ; [x start] *65536 + [x size]
201
    mov  ebx,100*65536+400    ; [x start] *65536 + [x size]
202
    mov  ecx,100*65536+200    ; [y start] *65536 + [y size]
202
    mov  ecx,100*65536+200    ; [y start] *65536 + [y size]
203
    mov  edx,0x130020C0;0x00000040 ; color of work area RRGGBB,8->color glide
203
    mov  edx,0x140020C0;0x00000040 ; color of work area RRGGBB,8->color glide
204
    mov  edi,title
204
    mov  edi,title
205
    mcall
205
    mcall
206
   
206
   
207
       ; BUTTONS
207
       ; BUTTONS
208
    mov eax,8
208
    mov eax,8
209
    mov edx,0
209
    mov edx,0
210
    mov ebx,330*65536+20
210
    mov ebx,330*65536+20
211
    mov ecx,84*65536+48
211
    mov ecx,84*65536+48
212
    mov dl,2
212
    mov dl,2
213
    mov  esi,0x5599cc     ; button color RRGGBB
213
    mov  esi,0x5599cc     ; button color RRGGBB
214
    mcall               ; Button '+'Width
214
    mcall               ; Button '+'Width
215
    add ebx,30*65536
215
    add ebx,30*65536
216
    mov dl,3
216
    mov dl,3
217
    mcall               ; Button '-'Width
217
    mcall               ; Button '-'Width
218
    mov ebx,22*65536+85
218
    mov ebx,22*65536+85
219
    mov ecx,170*65536+15
219
    mov ecx,170*65536+15
220
    inc dl ;dl=4
220
    inc dl ;dl=4
221
    mcall               ; Button 'Ok'
221
    mcall               ; Button 'Ok'
222
    add ebx,90*65536
222
    add ebx,90*65536
223
    inc dl ;dl=5
223
    inc dl ;dl=5
224
    mcall               ; Button 'Cancel'
224
    mcall               ; Button 'Cancel'
225
    add ebx,90*65536
225
    add ebx,90*65536
226
    inc dl ;dl=6
226
    inc dl ;dl=6
227
    mcall               ; Button 'Return'
227
    mcall               ; Button 'Return'
228
    add ebx,90*65536
228
    add ebx,90*65536
229
    inc dl ;dl=7
229
    inc dl ;dl=7
230
    mcall               ; Button 'Default'
230
    mcall               ; Button 'Default'
231
   
231
   
232
    call draw_face
232
    call draw_face
233
   
233
   
234
    mov  eax,12      ; function 12:tell os about windowdraw
234
    mov  eax,12      ; function 12:tell os about windowdraw
235
    mov  ebx,2      ; 2, end of draw
235
    mov  ebx,2      ; 2, end of draw
236
    mcall
236
    mcall
237
   
237
   
238
    ret
238
    ret
239
   
239
   
240
;------------Subfunctions-----------
240
;------------Subfunctions-----------
241
   
241
   
242
restore_mode:
242
restore_mode:
243
    push eax
243
    push eax
244
    push ebx
244
    push ebx
245
    push edx
245
    push edx
246
    mov eax,21
246
    mov eax,21
247
    mov ebx,13
247
    mov ebx,13
248
    mov ecx,4
248
    mov ecx,4
249
    mcall
249
    mcall
250
    pop edx
250
    pop edx
251
    pop ecx
251
    pop ecx
252
    pop eax
252
    pop eax
253
    retn
253
    retn
254
   
254
   
255
   
255
   
256
   
256
   
257
; IN: edx = RefRate*65536+No.VideoMode
257
; IN: edx = RefRate*65536+No.VideoMode
258
set_my_mode:
258
set_my_mode:
259
    push ecx
259
    push ecx
260
    push ebx
260
    push ebx
261
    push edx
261
    push edx
262
    mov eax,[currvm]
262
    mov eax,[currvm]
263
    mov [oldvm],eax
263
    mov [oldvm],eax
264
    mov [currvm],edx
264
    mov [currvm],edx
265
    pop edx
265
    pop edx
266
    push edx
266
    push edx
267
    mov eax,21
267
    mov eax,21
268
    mov ebx,13
268
    mov ebx,13
269
    mov ecx,3
269
    mov ecx,3
270
    mcall
270
    mcall
271
    mcall 5,50
271
    mcall 5,50
272
    mcall 15,3
272
    mcall 15,3
273
    pop edx
273
    pop edx
274
    pop ebx
274
    pop ebx
275
    pop ecx
275
    pop ecx
276
    retn
276
    retn
277
   
277
   
278
; IN: eax = 0/1  -  -/+ 1Hz
278
; IN: eax = 0/1  -  -/+ 1Hz
279
inc_dec_rate:
279
inc_dec_rate:
280
    push ebx
280
    push ebx
281
    push ecx
281
    push ecx
282
    push edx
282
    push edx
283
    mov edx,eax
283
    mov edx,eax
284
    mov eax,21
284
    mov eax,21
285
    mov ebx,13
285
    mov ebx,13
286
    mov ecx,5
286
    mov ecx,5
287
    mcall
287
    mcall
288
    pop edx
288
    pop edx
289
    pop ecx
289
    pop ecx
290
    pop ebx
290
    pop ebx
291
    retn
291
    retn
292
   
292
   
293
get_pid:
293
get_pid:
294
    mov eax,9
294
    mov eax,9
295
    mov ebx,buffer
295
    mov ebx,buffer
296
    xor ecx,ecx
296
    xor ecx,ecx
297
    dec ecx
297
    dec ecx
298
    mcall
298
    mcall
299
    mov [totp],eax
299
    mov [totp],eax
300
    mov eax,[ebx+30]
300
    mov eax,[ebx+30]
301
    mov [mypid],eax
301
    mov [mypid],eax
302
    mov ax,[ebx+4]
302
    mov ax,[ebx+4]
303
    mov [mypno],ax
303
    mov [mypno],ax
304
    retn
304
    retn
305
   
305
   
306
get_vert_rate:
306
get_vert_rate:
307
    xor eax,eax
307
    xor eax,eax
308
    mov ebx,eax
308
    mov ebx,eax
309
    mov ecx,eax
309
    mov ecx,eax
310
    mov al,21
310
    mov al,21
311
    mov bl,13
311
    mov bl,13
312
    mov cl,2
312
    mov cl,2
313
    mcall
313
    mcall
314
    mov [initrr],ebx
314
    mov [initrr],ebx
315
    mov [refrate],ebx
315
    mov [refrate],ebx
316
    ror ecx,16
316
    ror ecx,16
317
    mov cx,bx
317
    mov cx,bx
318
    rol ecx,16
318
    rol ecx,16
319
    mov [currvm],ecx
319
    mov [currvm],ecx
320
    retn
320
    retn
321
   
321
   
322
get_initial_videomode:
322
get_initial_videomode:
323
    retn
323
    retn
324
   
324
   
325
   
325
   
326
draw_table:
326
draw_table:
327
    mov eax,13
327
    mov eax,13
328
    mov ebx,9*65536+303
328
    mov ebx,9*65536+303
329
    mov ecx,59*65536+87
329
    mov ecx,59*65536+87
330
    xor edx,edx
330
    xor edx,edx
331
    mcall
331
    mcall
332
    mov ebx,10*65536+300
332
    mov ebx,10*65536+300
333
    mov ecx,60*65536+24
333
    mov ecx,60*65536+24
334
    mov edx,00FF00FFh
334
    mov edx,00FF00FFh
335
    mcall
335
    mcall
336
    mov ebx,10*65536+36
336
    mov ebx,10*65536+36
337
    mov ecx,72*65536+72
337
    mov ecx,72*65536+72
338
    mov edx,0000FFFFh
338
    mov edx,0000FFFFh
339
    mcall
339
    mcall
340
    mov eax,38
340
    mov eax,38
341
    mov edx,00FFFFFFh
341
    mov edx,00FFFFFFh
342
    mov ebx,10*65536+310
342
    mov ebx,10*65536+310
343
    mov edi,60*65536+60
343
    mov edi,60*65536+60
344
    mov esi,12*65536+12
344
    mov esi,12*65536+12
345
    xor ecx,ecx
345
    xor ecx,ecx
346
    mov cl,8
346
    mov cl,8
347
dt_loc_hor_line:
347
dt_loc_hor_line:
348
    push ecx
348
    push ecx
349
    mov ecx,edi
349
    mov ecx,edi
350
    mcall
350
    mcall
351
    add edi,esi
351
    add edi,esi
352
    pop ecx
352
    pop ecx
353
    loop dt_loc_hor_line
353
    loop dt_loc_hor_line
354
    mov ebx,10*65536+10
354
    mov ebx,10*65536+10
355
    mov edi,60*65536+144
355
    mov edi,60*65536+144
356
    mov esi,66*65536+66
356
    mov esi,66*65536+66
357
    mov ecx,edi
357
    mov ecx,edi
358
    mcall
358
    mcall
359
    add ebx,36*65536+36
359
    add ebx,36*65536+36
360
    xor ecx,ecx
360
    xor ecx,ecx
361
    mov cl,5
361
    mov cl,5
362
dt_loc_vert_line:
362
dt_loc_vert_line:
363
    push ecx
363
    push ecx
364
    mov ecx,edi
364
    mov ecx,edi
365
    mcall
365
    mcall
366
    add ebx,esi
366
    add ebx,esi
367
    pop ecx
367
    pop ecx
368
    loop dt_loc_vert_line
368
    loop dt_loc_vert_line
369
    mov eax,4
369
    mov eax,4
370
    mov ebx,52*65536+75
370
    mov ebx,52*65536+75
371
    mov ecx,000000FFh
371
    mov ecx,000000FFh
372
    mov edx,_m1280x1024
372
    mov edx,_m1280x1024
373
    mov esi,9
373
    mov esi,9
374
    mcall
374
    mcall
375
    add edx,9
375
    add edx,9
376
    add ebx,66*65536
376
    add ebx,66*65536
377
    mcall
377
    mcall
378
    add edx,9
378
    add edx,9
379
    add ebx,66*65536
379
    add ebx,66*65536
380
    mcall
380
    mcall
381
    add edx,9
381
    add edx,9
382
    add ebx,66*65536
382
    add ebx,66*65536
383
    mcall
383
    mcall
384
    xor eax,eax
384
    xor eax,eax
385
    mov ebx,eax
385
    mov ebx,eax
386
    mov ecx,eax
386
    mov ecx,eax
387
    mov al,47
387
    mov al,47
388
    inc ebx
388
    inc ebx
389
    shl ebx,16
389
    shl ebx,16
390
    inc ecx
390
    inc ecx
391
    mov edi,ecx
391
    mov edi,ecx
392
    mov edx,22*65536+86
392
    mov edx,22*65536+86
393
    mov esi,00FF0000h
393
    mov esi,00FF0000h
394
    mov ecx,5
394
    mov ecx,5
395
dt_loc_00:
395
dt_loc_00:
396
    push ecx
396
    push ecx
397
    mov ecx,edi
397
    mov ecx,edi
398
    mcall
398
    mcall
399
    inc edi
399
    inc edi
400
    add dx,12
400
    add dx,12
401
    pop ecx
401
    pop ecx
402
    loop dt_loc_00
402
    loop dt_loc_00
403
    xor ecx,ecx
403
    xor ecx,ecx
404
    inc ecx
404
    inc ecx
405
    mov edi,ecx
405
    mov edi,ecx
406
    mov edx,76*65536+63
406
    mov edx,76*65536+63
407
    mov esi,000000FFh
407
    mov esi,000000FFh
408
    mov ecx,4
408
    mov ecx,4
409
dt_loc_01:
409
dt_loc_01:
410
    push ecx
410
    push ecx
411
    mov ecx,edi
411
    mov ecx,edi
412
    mcall
412
    mcall
413
    inc edi
413
    inc edi
414
    add edx,66*65536
414
    add edx,66*65536
415
    pop ecx
415
    pop ecx
416
    loop dt_loc_01
416
    loop dt_loc_01
417
    mov eax,4
417
    mov eax,4
418
    mov ebx,16*65536+63
418
    mov ebx,16*65536+63
419
    mov ecx,000000FFh
419
    mov ecx,000000FFh
420
    mov edx,_mk
420
    mov edx,_mk
421
    mov esi,4
421
    mov esi,4
422
    mcall
422
    mcall
423
    shl ecx,16
423
    shl ecx,16
424
    add bx,12
424
    add bx,12
425
    add edx,4
425
    add edx,4
426
    mcall
426
    mcall
427
    retn
427
    retn
428
   
428
   
429
;IN: ah=keycode
429
;IN: ah=keycode
430
safekey:
430
safekey:
431
    sub ah,30h
431
    sub ah,30h
432
    push bx
432
    push bx
433
    mov bx,word [vmselect]
433
    mov bx,word [vmselect]
434
    cmp bx,0
434
    cmp bx,0
435
    jnz sk_loc_00
435
    jnz sk_loc_00
436
    cmp ah,5
436
    cmp ah,5
437
    je sk_loc_01
437
    je sk_loc_01
438
    mov bl,ah
438
    mov bl,ah
439
    mov [vmselect],bx
439
    mov [vmselect],bx
440
    jmp sk_loc_01
440
    jmp sk_loc_01
441
sk_loc_00:
441
sk_loc_00:
442
    push esi
442
    push esi
443
    push edx
443
    push edx
444
    push ecx
444
    push ecx
445
    push eax
445
    push eax
446
    mov bh,ah
446
    mov bh,ah
447
    xor edx,edx
447
    xor edx,edx
448
    mov esi,_m1
448
    mov esi,_m1
449
    mov al,bl
449
    mov al,bl
450
    dec al
450
    dec al
451
    xor ah,ah
451
    xor ah,ah
452
    mov cx,10
452
    mov cx,10
453
    mul cx
453
    mul cx
454
    xor ecx,ecx
454
    xor ecx,ecx
455
    mov cx,ax
455
    mov cx,ax
456
    xor ax,ax
456
    xor ax,ax
457
    mov al,bh
457
    mov al,bh
458
    dec al
458
    dec al
459
    shl ax,1
459
    shl ax,1
460
    add cx,ax
460
    add cx,ax
461
    add esi,ecx
461
    add esi,ecx
462
    lodsw
462
    lodsw
463
    cmp ax,0
463
    cmp ax,0
464
    jnz sk_loc_02
464
    jnz sk_loc_02
465
    xor eax,eax
465
    xor eax,eax
466
    mov bh,ah
466
    mov bh,ah
467
sk_loc_02:
467
sk_loc_02:
468
    mov [vmselect],bx
468
    mov [vmselect],bx
469
    pop eax
469
    pop eax
470
    pop ecx
470
    pop ecx
471
    pop edx
471
    pop edx
472
    pop esi
472
    pop esi
473
sk_loc_01:
473
sk_loc_01:
474
    call draw_window
474
    call draw_window
475
    pop bx
475
    pop bx
476
    retn
476
    retn
477
   
477
   
478
; IN: ebx=Xstart*65536+Xend
478
; IN: ebx=Xstart*65536+Xend
479
;     ecx=Ystart*65536+Yend
479
;     ecx=Ystart*65536+Yend
480
;     edx=color
480
;     edx=color
481
draw_rect:
481
draw_rect:
482
    push eax
482
    push eax
483
    push ebx
483
    push ebx
484
    push ecx
484
    push ecx
485
    push edx
485
    push edx
486
    push edi
486
    push edi
487
    xor eax,eax
487
    xor eax,eax
488
    mov al,38
488
    mov al,38
489
    push ecx
489
    push ecx
490
    mov edi,ecx
490
    mov edi,ecx
491
    shr edi,16
491
    shr edi,16
492
    mov cx,di
492
    mov cx,di
493
    mcall
493
    mcall
494
    pop ecx
494
    pop ecx
495
    push ecx
495
    push ecx
496
    mov edi,ecx
496
    mov edi,ecx
497
    ror ecx,16
497
    ror ecx,16
498
    mov cx,di
498
    mov cx,di
499
    mcall
499
    mcall
500
    pop ecx
500
    pop ecx
501
    push ebx
501
    push ebx
502
    mov edi,ebx
502
    mov edi,ebx
503
    shr edi,16
503
    shr edi,16
504
    mov bx,di
504
    mov bx,di
505
    mcall
505
    mcall
506
    pop ebx
506
    pop ebx
507
    mov edi,ebx
507
    mov edi,ebx
508
    ror ebx,16
508
    ror ebx,16
509
    mov bx,di
509
    mov bx,di
510
    mcall
510
    mcall
511
    pop edi
511
    pop edi
512
    pop edx
512
    pop edx
513
    pop ecx
513
    pop ecx
514
    pop ebx
514
    pop ebx
515
    pop eax
515
    pop eax
516
    retn
516
    retn
517
   
517
   
518
;
518
;
519
; OUT: eax = 0 - no event
519
; OUT: eax = 0 - no event
520
protect_and_return:
520
protect_and_return:
521
    push ebx
521
    push ebx
522
    push ecx
522
    push ecx
523
    xor eax,eax
523
    xor eax,eax
524
    mov al,5
524
    mov al,5
525
    xor ebx,ebx
525
    xor ebx,ebx
526
    mov bx,300
526
    mov bx,300
527
    mcall
527
    mcall
528
    call get_pid
528
    call get_pid
529
    xor eax,eax
529
    xor eax,eax
530
    mov ebx,eax
530
    mov ebx,eax
531
    mov ecx,eax
531
    mov ecx,eax
532
    mov al,18
532
    mov al,18
533
    mov ebx,3
533
    mov ebx,3
534
    mov cx,[mypno]
534
    mov cx,[mypno]
535
    mcall
535
    mcall
536
    pop ecx
536
    pop ecx
537
    pusha
537
    pusha
538
    call draw_window
538
    call draw_window
539
    popa
539
    popa
540
    xor eax,eax
540
    xor eax,eax
541
    mov al,5
541
    mov al,5
542
    xor ebx,ebx
542
    xor ebx,ebx
543
    mov bx,300
543
    mov bx,300
544
    mcall
544
    mcall
545
    xor eax,eax
545
    xor eax,eax
546
    mov al,11
546
    mov al,11
547
    mcall
547
    mcall
548
    cmp eax,1
548
    cmp eax,1
549
    jne par_loc_00
549
    jne par_loc_00
550
    pusha
550
    pusha
551
    call draw_window
551
    call draw_window
552
    popa
552
    popa
553
par_loc_00:
553
par_loc_00:
554
    xor eax,eax
554
    xor eax,eax
555
    mov ebx,eax
555
    mov ebx,eax
556
    mov al,23
556
    mov al,23
557
    mov bx,700
557
    mov bx,700
558
    mcall
558
    mcall
559
    cmp eax,0
559
    cmp eax,0
560
    jnz par_loc_02
560
    jnz par_loc_02
561
; mov [ftr_eax],eax
561
; mov [ftr_eax],eax
562
    mov edx,[oldvm]
562
    mov edx,[oldvm]
563
    call set_my_mode
563
    call set_my_mode
564
par_loc_02:
564
par_loc_02:
565
    pop ebx
565
    pop ebx
566
    retn
566
    retn
567
   
567
   
568
debug_ftr:
568
debug_ftr:
569
;    xor eax,eax
569
;    xor eax,eax
570
;    mov ebx,eax
570
;    mov ebx,eax
571
;    mov al,47
571
;    mov al,47
572
;    mov bl,8
572
;    mov bl,8
573
;    shl ebx,16
573
;    shl ebx,16
574
;    mov bh,1
574
;    mov bh,1
575
;    mov ecx,[ftr_eax]
575
;    mov ecx,[ftr_eax]
576
;    mov edx,20*65536+180
576
;    mov edx,20*65536+180
577
;    mov esi,00FFFFFFh
577
;    mov esi,00FFFFFFh
578
;    mcall
578
;    mcall
579
;    mov ecx,[ftr_ebx]
579
;    mov ecx,[ftr_ebx]
580
;    add edx,54*65536
580
;    add edx,54*65536
581
;    mcall
581
;    mcall
582
    retn
582
    retn
583
   
583
   
584
print_cur_vm:
584
print_cur_vm:
585
    mov eax,4
585
    mov eax,4
586
    mov ebx,20*65536+40
586
    mov ebx,20*65536+40
587
    mov ecx,0000FF00h
587
    mov ecx,0000FF00h
588
    mov edx,curmode
588
    mov edx,curmode
589
    mov esi,cmlen
589
    mov esi,cmlen
590
    mcall
590
    mcall
591
    mov al,14
591
    mov al,14
592
    mcall
592
    mcall
593
    mov esi,00FFFFFFh
593
    mov esi,00FFFFFFh
594
    mov edi,eax
594
    mov edi,eax
595
    shr eax,16
595
    shr eax,16
596
    xor ecx,ecx
596
    xor ecx,ecx
597
    mov cx,ax
597
    mov cx,ax
598
    inc ecx
598
    inc ecx
599
    xor ebx,ebx
599
    xor ebx,ebx
600
    mov bl,4
600
    mov bl,4
601
    shl ebx,16
601
    shl ebx,16
602
    mov edx,104*65536+40
602
    mov edx,104*65536+40
603
    mov eax,47
603
    mov eax,47
604
    mcall
604
    mcall
605
    add edx,30*65536
605
    add edx,30*65536
606
    mov cx,di
606
    mov cx,di
607
    inc ecx
607
    inc ecx
608
    mcall
608
    mcall
609
    add edx,30*65536
609
    add edx,30*65536
610
    mov ecx,[initrr]
610
    mov ecx,[initrr]
611
    sub ebx,1*65536
611
    sub ebx,1*65536
612
    mcall
612
    mcall
613
    mov al,4
613
    mov al,4
614
    mov ebx,200*65536+40
614
    mov ebx,200*65536+40
615
    mov ecx,0000FF00h
615
    mov ecx,0000FF00h
616
    mov edx,selmode
616
    mov edx,selmode
617
    mov esi,cmlen
617
    mov esi,cmlen
618
    mcall
618
    mcall
619
    mov ax,[vmselect]
619
    mov ax,[vmselect]
620
    cmp ax,0
620
    cmp ax,0
621
    jz pcv_loc_00
621
    jz pcv_loc_00
622
    push eax
622
    push eax
623
    xor eax,eax
623
    xor eax,eax
624
    mov al,13
624
    mov al,13
625
    mov ebx,284*65536+54
625
    mov ebx,284*65536+54
626
    mov ecx,40*65536+10
626
    mov ecx,40*65536+10
627
    mov edx,000020C0h
627
    mov edx,000020C0h
628
    mcall
628
    mcall
629
    pop eax
629
    pop eax
630
    push eax
630
    push eax
631
    xor ecx,ecx
631
    xor ecx,ecx
632
    dec al
632
    dec al
633
    mov cl,al
633
    mov cl,al
634
    shl cx,3
634
    shl cx,3
635
    add cl,al   ; cx=(al-1)*9
635
    add cl,al   ; cx=(al-1)*9
636
    mov edx,_m1280x1024
636
    mov edx,_m1280x1024
637
    add edx,ecx
637
    add edx,ecx
638
    xor eax,eax
638
    xor eax,eax
639
    mov al,4
639
    mov al,4
640
    mov esi,9
640
    mov esi,9
641
    mov ebx,284*65536+40
641
    mov ebx,284*65536+40
642
    mov ecx,00ff0000h
642
    mov ecx,00ff0000h
643
    mcall
643
    mcall
644
    pop eax
644
    pop eax
645
    cmp ah,0
645
    cmp ah,0
646
    jz pcv_loc_00
646
    jz pcv_loc_00
647
    push esi
647
    push esi
648
    push edx
648
    push edx
649
    push ecx
649
    push ecx
650
    push eax
650
    push eax
651
    xor eax,eax
651
    xor eax,eax
652
    mov al,13
652
    mov al,13
653
    mov ebx,344*65536+18
653
    mov ebx,344*65536+18
654
    mov ecx,40*65536+10
654
    mov ecx,40*65536+10
655
    mov edx,000020C0h
655
    mov edx,000020C0h
656
    mcall
656
    mcall
657
    pop eax
657
    pop eax
658
    push eax
658
    push eax
659
    mov bx,ax
659
    mov bx,ax
660
    xor edx,edx
660
    xor edx,edx
661
    mov esi,_m1
661
    mov esi,_m1
662
    mov al,bl
662
    mov al,bl
663
    dec al
663
    dec al
664
    xor ah,ah
664
    xor ah,ah
665
    mov cx,10
665
    mov cx,10
666
    mul cx
666
    mul cx
667
    xor ecx,ecx
667
    xor ecx,ecx
668
    mov cx,ax
668
    mov cx,ax
669
    xor ax,ax
669
    xor ax,ax
670
    mov al,bh
670
    mov al,bh
671
    dec al
671
    dec al
672
    shl ax,1
672
    shl ax,1
673
    add cx,ax
673
    add cx,ax
674
    add esi,ecx
674
    add esi,ecx
675
    lodsw
675
    lodsw
676
    xor ecx,ecx
676
    xor ecx,ecx
677
    mov cx,ax
677
    mov cx,ax
678
    xor ebx,ebx
678
    xor ebx,ebx
679
    mov bl,3
679
    mov bl,3
680
    shl ebx,16
680
    shl ebx,16
681
    mov edx,344*65536+40
681
    mov edx,344*65536+40
682
    xor eax,eax
682
    xor eax,eax
683
    mov al,47
683
    mov al,47
684
    mov esi,00ff0000h
684
    mov esi,00ff0000h
685
    mcall
685
    mcall
686
    pop eax
686
    pop eax
687
    pop ecx
687
    pop ecx
688
    pop edx
688
    pop edx
689
    pop esi
689
    pop esi
690
 pcv_loc_00:
690
 pcv_loc_00:
691
     retn
691
     retn
692
   
692
   
693
print_all_herz:
693
print_all_herz:
694
        push esi
694
        push esi
695
        push edi
695
        push edi
696
        push eax
696
        push eax
697
        push ebx
697
        push ebx
698
        push ecx
698
        push ecx
699
        push edx
699
        push edx
700
        cld
700
        cld
701
        mov esi,_m1
701
        mov esi,_m1
702
        mov ebx,(10+36+26)*65536+86
702
        mov ebx,(10+36+26)*65536+86
703
        mov edx,66*65536
703
        mov edx,66*65536
704
        xor ecx,ecx
704
        xor ecx,ecx
705
        mov cl,4
705
        mov cl,4
706
pah_loc_00:
706
pah_loc_00:
707
        push ecx
707
        push ecx
708
        push edx
708
        push edx
709
        push ebx
709
        push ebx
710
        mov cl,5
710
        mov cl,5
711
        xor edx,edx
711
        xor edx,edx
712
        mov dl,12
712
        mov dl,12
713
pah_loc_01:
713
pah_loc_01:
714
        lodsw
714
        lodsw
715
        cmp ax,00h
715
        cmp ax,00h
716
        jnz pah_loc_02
716
        jnz pah_loc_02
717
        call print_noherz
717
        call print_noherz
718
        jmp pah_loc_03
718
        jmp pah_loc_03
719
pah_loc_02:
719
pah_loc_02:
720
        call print_herz
720
        call print_herz
721
pah_loc_03:
721
pah_loc_03:
722
        add ebx,edx
722
        add ebx,edx
723
        loop pah_loc_01
723
        loop pah_loc_01
724
        pop ebx
724
        pop ebx
725
        pop edx
725
        pop edx
726
        add ebx,edx
726
        add ebx,edx
727
        pop ecx
727
        pop ecx
728
        loop pah_loc_00
728
        loop pah_loc_00
729
        pop edx
729
        pop edx
730
        pop ecx
730
        pop ecx
731
        pop ebx
731
        pop ebx
732
        pop eax
732
        pop eax
733
        pop edi
733
        pop edi
734
        pop esi
734
        pop esi
735
        retn
735
        retn
736
   
736
   
737
; IN: ebx=X*65536+Y - coordinate
737
; IN: ebx=X*65536+Y - coordinate
738
print_noherz:
738
print_noherz:
739
        push eax
739
        push eax
740
        push ebx
740
        push ebx
741
        push ecx
741
        push ecx
742
        push edx
742
        push edx
743
        push esi
743
        push esi
744
        xor eax,eax
744
        xor eax,eax
745
        mov al,4
745
        mov al,4
746
        mov ecx,00FFFFFFh
746
        mov ecx,00FFFFFFh
747
        mov edx,noherz
747
        mov edx,noherz
748
        xor esi,esi
748
        xor esi,esi
749
        mov si,3
749
        mov si,3
750
        mcall
750
        mcall
751
        pop esi
751
        pop esi
752
        pop edx
752
        pop edx
753
        pop ecx
753
        pop ecx
754
        pop ebx
754
        pop ebx
755
        pop eax
755
        pop eax
756
        retn
756
        retn
757
   
757
   
758
; IN: eax=numer_of_herz
758
; IN: eax=numer_of_herz
759
;     ebx=X*65536+Y
759
;     ebx=X*65536+Y
760
print_herz:
760
print_herz:
761
        push eax
761
        push eax
762
        push ebx
762
        push ebx
763
        push ecx
763
        push ecx
764
        push edx
764
        push edx
765
        push esi
765
        push esi
766
        mov edx,ebx
766
        mov edx,ebx
767
        xor ebx,ebx
767
        xor ebx,ebx
768
        mov bl,3
768
        mov bl,3
769
        shl ebx,16
769
        shl ebx,16
770
        mov ecx,eax
770
        mov ecx,eax
771
        mov esi,00FFFFFFh
771
        mov esi,00FFFFFFh
772
        xor eax,eax
772
        xor eax,eax
773
        mov al,47
773
        mov al,47
774
        mcall
774
        mcall
775
        pop esi
775
        pop esi
776
        pop edx
776
        pop edx
777
        pop ecx
777
        pop ecx
778
        pop ebx
778
        pop ebx
779
        pop eax
779
        pop eax
780
        retn
780
        retn
781
   
781
   
782
get_pixelclock:
782
get_pixelclock:
783
        retn
783
        retn
784
   
784
   
785
 ; light version of function
785
 ; light version of function
786
calc_refrate:
786
calc_refrate:
787
        retn
787
        retn
788
   
788
   
789
rect_select:
789
rect_select:
790
        mov ax,[vmselect]
790
        mov ax,[vmselect]
791
;     mov [ftr_ebx],eax
791
;     mov [ftr_ebx],eax
792
        cmp ax,00h
792
        cmp ax,00h
793
        je rs_loc_00
793
        je rs_loc_00
794
        cmp ah,0
794
        cmp ah,0
795
        jne rs_loc_01
795
        jne rs_loc_01
796
        dec al
796
        dec al
797
        mov cx,66
797
        mov cx,66
798
        mul cx
798
        mul cx
799
        add ax,46
799
        add ax,46
800
        mov bx,ax
800
        mov bx,ax
801
        shl ebx,16
801
        shl ebx,16
802
        add ax,66
802
        add ax,66
803
        mov bx,ax
803
        mov bx,ax
804
        mov ecx,60*65536+144
804
        mov ecx,60*65536+144
805
        mov edx,00ff0000h
805
        mov edx,00ff0000h
806
        call draw_rect
806
        call draw_rect
807
        retn
807
        retn
808
rs_loc_01:
808
rs_loc_01:
809
        push ax
809
        push ax
810
        xor ah,ah
810
        xor ah,ah
811
        dec al
811
        dec al
812
        xor ebx,ebx
812
        xor ebx,ebx
813
        mov bx,66
813
        mov bx,66
814
        mul bx
814
        mul bx
815
        add ax,46
815
        add ax,46
816
        mov bx,ax
816
        mov bx,ax
817
        shl ebx,16
817
        shl ebx,16
818
        add ax,66
818
        add ax,66
819
        mov bx,ax
819
        mov bx,ax
820
        pop ax
820
        pop ax
821
        xchg ah,al
821
        xchg ah,al
822
        xor ah,ah
822
        xor ah,ah
823
        dec al
823
        dec al
824
        xor ecx,ecx
824
        xor ecx,ecx
825
        mov cx,12
825
        mov cx,12
826
        mul cx
826
        mul cx
827
        add ax,84
827
        add ax,84
828
        mov cx,ax
828
        mov cx,ax
829
        shl ecx,16
829
        shl ecx,16
830
        add ax,12
830
        add ax,12
831
        mov cx,ax
831
        mov cx,ax
832
        mov edx,00ff0000h
832
        mov edx,00ff0000h
833
        call draw_rect
833
        call draw_rect
834
rs_loc_00:
834
rs_loc_00:
835
        retn
835
        retn
836
   
836
   
837
draw_face:
837
draw_face:
838
        call draw_table
838
        call draw_table
839
;
839
;
840
;
840
;
841
        mov ebx,320*65536+390
841
        mov ebx,320*65536+390
842
        mov ecx,66*65536+144
842
        mov ecx,66*65536+144
843
        mov edx,0000FF00h
843
        mov edx,0000FF00h
844
        call draw_rect
844
        call draw_rect
845
        mov ebx,10*65536+390
845
        mov ebx,10*65536+390
846
        mov ecx,27*65536+55
846
        mov ecx,27*65536+55
847
        call draw_rect
847
        call draw_rect
848
        add ebx,2*65536
848
        add ebx,2*65536
849
        sub bx,2
849
        sub bx,2
850
        add ecx,2*65536
850
        add ecx,2*65536
851
        sub cx,2
851
        sub cx,2
852
        call draw_rect
852
        call draw_rect
853
        mov ebx,10*65536+390
853
        mov ebx,10*65536+390
854
        mov ecx,155*65536+193
854
        mov ecx,155*65536+193
855
        call draw_rect
855
        call draw_rect
856
        add ebx,2*65536
856
        add ebx,2*65536
857
        sub bx,2
857
        sub bx,2
858
        add ecx,2*65536
858
        add ecx,2*65536
859
        sub cx,2
859
        sub cx,2
860
        call draw_rect
860
        call draw_rect
861
        xor eax,eax
861
        xor eax,eax
862
        mov al,13
862
        mov al,13
863
        mov ebx,182*65536+36
863
        mov ebx,182*65536+36
864
        mov ecx,26*65536+5
864
        mov ecx,26*65536+5
865
        mov edx,000020C0h
865
        mov edx,000020C0h
866
        mcall
866
        mcall
867
        mov ebx,173*65536+54
867
        mov ebx,173*65536+54
868
        mov ecx,153*65536+7
868
        mov ecx,153*65536+7
869
        mcall
869
        mcall
870
        mov ebx,337*65536+36
870
        mov ebx,337*65536+36
871
        mov ecx,62*65536+10
871
        mov ecx,62*65536+10
872
        mcall
872
        mcall
873
        mov al,4
873
        mov al,4
874
        shr ecx,16
874
        shr ecx,16
875
        mov bx,cx
875
        mov bx,cx
876
        add ebx,3*65536
876
        add ebx,3*65536
877
        mov ecx,00FF0000h
877
        mov ecx,00FF0000h
878
        mov edx,width
878
        mov edx,width
879
        mov esi,5
879
        mov esi,5
880
        mcall
880
        mcall
881
        xor ecx,ecx
881
        xor ecx,ecx
882
        add edx,5
882
        add edx,5
883
        xor esi,esi
883
        xor esi,esi
884
        inc esi
884
        inc esi
885
        mov ebx,335*65536+104
885
        mov ebx,335*65536+104
886
        mcall
886
        mcall
887
        add ebx,36*65536
887
        add ebx,36*65536
888
        inc edx
888
        inc edx
889
        mcall
889
        mcall
890
        mov edx,tmode
890
        mov edx,tmode
891
        mov ecx,00FF0000h
891
        mov ecx,00FF0000h
892
        mov ebx,182*65536+24
892
        mov ebx,182*65536+24
893
        mov esi,6
893
        mov esi,6
894
        mcall
894
        mcall
895
        mov edx,actions
895
        mov edx,actions
896
        mov ebx,173*65536+152
896
        mov ebx,173*65536+152
897
        mov esi,9
897
        mov esi,9
898
        mcall
898
        mcall
899
        xor ecx,ecx
899
        xor ecx,ecx
900
        mov edx,button1
900
        mov edx,button1
901
        mov ebx,59*65536+174
901
        mov ebx,59*65536+174
902
        mov esi,2
902
        mov esi,2
903
        mcall
903
        mcall
904
        add edx,esi
904
        add edx,esi
905
        mov esi,6
905
        mov esi,6
906
        add ebx,78*65536
906
        add ebx,78*65536
907
        mcall
907
        mcall
908
        add edx,esi
908
        add edx,esi
909
        add ebx,90*65536
909
        add ebx,90*65536
910
        mcall
910
        mcall
911
        add edx,esi
911
        add edx,esi
912
        mov esi,7
912
        mov esi,7
913
        add ebx,87*65536
913
        add ebx,87*65536
914
        mcall
914
        mcall
915
        call rect_select
915
        call rect_select
916
;        call debug_ftr
916
;        call debug_ftr
917
        call print_cur_vm
917
        call print_cur_vm
918
        call print_all_herz
918
        call print_all_herz
919
        retn
919
        retn
920
   
920
   
921
warning_info:
921
warning_info:
922
        call warning_window
922
        call warning_window
923
        call warning_loop
923
        call warning_loop
924
        retn
924
        retn
925
   
925
   
926
warning_window:
926
warning_window:
927
        mov  eax,12      ; function 12:tell os about windowdraw
927
        mov  eax,12      ; function 12:tell os about windowdraw
928
        mov  ebx,1      ; 1, start of draw
928
        mov  ebx,1      ; 1, start of draw
929
        mcall
929
        mcall
930
   ; DRAW WARNING WINDOW
930
   ; DRAW WARNING WINDOW
931
        xor  eax,eax      ; function 0 : define and draw window
931
        xor  eax,eax      ; function 0 : define and draw window
932
        mov ebx,[oldX]
932
        mov ebx,[oldX]
933
        shr ebx,1
933
        shr ebx,1
934
        sub ebx,200
934
        sub ebx,200
935
        shl ebx,16
935
        shl ebx,16
936
        mov bx,400
936
        mov bx,400
937
;        mov  ecx,100*65536+200    ; [y start] *65536 + [y size]
937
;        mov  ecx,100*65536+200    ; [y start] *65536 + [y size]
938
        mov ecx,[oldY]
938
        mov ecx,[oldY]
939
        shr ecx,1
939
        shr ecx,1
940
        sub ecx,100
940
        sub ecx,100
941
        shl ecx,16
941
        shl ecx,16
942
        mov cx,200
942
        mov cx,200
943
        mov  edx,0x13808080     ; color of work area RRGGBB,8->color glide
943
        mov  edx,0x13808080     ; color of work area RRGGBB,8->color glide
944
        mov  edi,title
944
        mov  edi,title
945
        mcall
945
        mcall
946
 
946
 
947
   ; WARNING TEXT
947
   ; WARNING TEXT
948
        mov  eax,4      ; function 4 : write text to window
948
        mov  eax,4      ; function 4 : write text to window
949
        mov  ebx,(200-(len_warn00/2)*6)*65536+60    ; [x start] *65536 + [y
949
        mov  ebx,(200-(len_warn00/2)*6)*65536+60    ; [x start] *65536 + [y
950
   ;]
950
   ;]
951
        mov  ecx,0xf0ff0000     ; color of text RRGGBB
951
        mov  ecx,0xf0ff0000     ; color of text RRGGBB
952
        mov  edx,warn00        ; pointer to text beginning
952
        mov  edx,warn00        ; pointer to text beginning
953
        mov  esi,len_warn00     ; text length
953
        mov  esi,len_warn00     ; text length
954
;        mcall
954
;        mcall
955
;        inc  ebx
955
;        inc  ebx
956
        mcall
956
        mcall
957
        add  ebx,1*65536
957
        add  ebx,1*65536
958
        mcall
958
        mcall
959
        mov  ebx,(200-(len_warn01/2)*6)*65536+100
959
        mov  ebx,(200-(len_warn01/2)*6)*65536+100
960
        mov  edx,warn01
960
        mov  edx,warn01
961
        mov  esi,len_warn01
961
        mov  esi,len_warn01
962
        mcall
962
        mcall
963
        mov  edx,button1
963
        mov  edx,button1
964
        add  ecx,0ffffh
964
        add  ecx,0ffffh
965
        mov  ebx,(200-6)*65536+(160-4)
965
        mov  ebx,(200-6)*65536+(160-4)
966
        mov  esi,2
966
        mov  esi,2
967
        mcall
967
        mcall
968
        mov  eax,12      ; function 12:tell os about windowdraw
968
        mov  eax,12      ; function 12:tell os about windowdraw
969
        mov  ebx,2      ; 2, end of draw
969
        mov  ebx,2      ; 2, end of draw
970
        mcall
970
        mcall
971
        retn
971
        retn
972
   
972
   
973
warning_loop:
973
warning_loop:
974
        mov  eax,5
974
        mov  eax,5
975
        mov ebx,13
975
        mov ebx,13
976
        mcall
976
        mcall
977
        mov eax,11
977
        mov eax,11
978
        mcall
978
        mcall
979
        cmp  eax,1      ; redraw request ?
979
        cmp  eax,1      ; redraw request ?
980
        je  warning_red
980
        je  warning_red
981
        cmp  eax,2      ; key in buffer ?
981
        cmp  eax,2      ; key in buffer ?
982
        je  warning_key
982
        je  warning_key
983
        cmp  eax,3      ; button in buffer ?
983
        cmp  eax,3      ; button in buffer ?
984
        je  warning_button
984
        je  warning_button
985
        mov  eax,4
985
        mov  eax,4
986
        mov  ebx,(200-(len_warn01/2)*6)*65536+100
986
        mov  ebx,(200-(len_warn01/2)*6)*65536+100
987
        mov  ecx,[blinkcol]
987
        mov  ecx,[blinkcol]
988
        sub cl,12
988
        sub cl,12
989
        dec cl
989
        dec cl
990
        dec cl
990
        dec cl
991
        dec cl
991
        dec cl
992
        dec cl
992
        dec cl
993
        mov [blinkcol],ecx
993
        mov [blinkcol],ecx
994
        mov ch,0f0h
994
        mov ch,0f0h
995
        shl ecx,16
995
        shl ecx,16
996
        mov  edx,warn01
996
        mov  edx,warn01
997
        mov  esi,len_warn01
997
        mov  esi,len_warn01
998
        mcall
998
        mcall
999
        sub ebx,1*65536
999
        sub ebx,1*65536
1000
        mcall
1000
        mcall
1001
        jmp  warning_loop
1001
        jmp  warning_loop
1002
  warning_red:      ; redraw
1002
  warning_red:      ; redraw
1003
        call warning_window
1003
        call warning_window
1004
        jmp  warning_loop
1004
        jmp  warning_loop
1005
  warning_key:      ; key
1005
  warning_key:      ; key
1006
        mov  eax,2      ;  read key
1006
        mov  eax,2      ;  read key
1007
        mcall
1007
        mcall
1008
        cmp ah,01h
1008
        cmp ah,01h
1009
        jne warning_loop
1009
        jne warning_loop
1010
        xor eax,eax
1010
        xor eax,eax
1011
        dec eax         ; Terminate application
1011
        dec eax         ; Terminate application
1012
        mcall
1012
        mcall
1013
        jmp warning_loop
1013
        jmp warning_loop
1014
  warning_button:   ; button
1014
  warning_button:   ; button
1015
        mov  eax,17     ; get id
1015
        mov  eax,17     ; get id
1016
        mcall
1016
        mcall
1017
        cmp  ah,1   ; button id=1 ?
1017
        cmp  ah,1   ; button id=1 ?
1018
        jne  warning_loop
1018
        jne  warning_loop
1019
        xor eax,eax
1019
        xor eax,eax
1020
        dec eax         ; close this program
1020
        dec eax         ; close this program
1021
        mcall
1021
        mcall
1022
        jmp warning_loop
1022
        jmp warning_loop
1023
        retn
1023
        retn
1024
   
1024
   
1025
;------------DATA AREA---------------
1025
;------------DATA AREA---------------
1026
   
1026
   
1027
oldX       dd ?
1027
oldX       dd ?
1028
oldY       dd ?
1028
oldY       dd ?
1029
initvm     dd ?
1029
initvm     dd ?
1030
currvm     dd 0
1030
currvm     dd 0
1031
oldvm      dd 0
1031
oldvm      dd 0
1032
refrate    dd 0
1032
refrate    dd 0
1033
initrr     dd 0
1033
initrr     dd 0
1034
mypid      dd ?
1034
mypid      dd ?
1035
mypno      dw ?
1035
mypno      dw ?
1036
totp       dd ?
1036
totp       dd ?
1037
vmselect   dw 0
1037
vmselect   dw 0
1038
ftr_eax    dd ?
1038
ftr_eax    dd ?
1039
ftr_ebx    dd ?
1039
ftr_ebx    dd ?
1040
blinkcol   dd 0ffh
1040
blinkcol   dd 0ffh
1041
   
1041
   
1042
;  db 0,0,0,0,0,0,0,0
1042
;  db 0,0,0,0,0,0,0,0
1043
;_m1        dw 0,0,0,0,0
1043
;_m1        dw 0,0,0,0,0
1044
;_m2        dw 0,0,0,0,0
1044
;_m2        dw 0,0,0,0,0
1045
;_m3        dw 0,0,0,0,0
1045
;_m3        dw 0,0,0,0,0
1046
;_m4        dw 0,0,0,0,0
1046
;_m4        dw 0,0,0,0,0
1047
   
1047
   
1048
title     db   'Vertical Refresh Rate v2.0 (C) 2003 TRANS',0
1048
title     db   'Vertical Refresh Rate v2.0 (C) 2003 TRANS',0
1049
   
1049
   
1050
_m1280x1024 db '1280x1024'
1050
_m1280x1024 db '1280x1024'
1051
_m1024x768  db '1024x768 '
1051
_m1024x768  db '1024x768 '
1052
_m800x600   db ' 800x600 '
1052
_m800x600   db ' 800x600 '
1053
_m640x480   db ' 640x480 '
1053
_m640x480   db ' 640x480 '
1054
_mk         db 'Key1Key2'
1054
_mk         db 'Key1Key2'
1055
   
1055
   
1056
curmode     db 'Current mode: '
1056
curmode     db 'Current mode: '
1057
            db '    x    x   Hz'
1057
            db '    x    x   Hz'
1058
cmlen=$-curmode
1058
cmlen=$-curmode
1059
selmode     db ' Select mode: '
1059
selmode     db ' Select mode: '
1060
selcans     db '----x----x---Hz'
1060
selcans     db '----x----x---Hz'
1061
noherz      db '---'
1061
noherz      db '---'
1062
width       db 'Width',11h,10h
1062
width       db 'Width',11h,10h
1063
tmode       db ' Mode '
1063
tmode       db ' Mode '
1064
actions     db ' Actions '
1064
actions     db ' Actions '
1065
button1     db 'Ok'      ;len=2
1065
button1     db 'Ok'      ;len=2
1066
button2     db 'Cancel'  ;len=6
1066
button2     db 'Cancel'  ;len=6
1067
button3     db 'Return'  ;len=6
1067
button3     db 'Return'  ;len=6
1068
button4     db 'Default' ;len=7
1068
button4     db 'Default' ;len=7
1069
   
1069
   
1070
strt  db 'LAUNCHER    '
1070
strt  db 'LAUNCHER    '
1071
   
1071
   
1072
warn00      db ' W  A  R  N  I  N  G  ! '
1072
warn00      db ' W  A  R  N  I  N  G  ! '
1073
len_warn00=$-warn00
1073
len_warn00=$-warn00
1074
warn01      db 'V i d e o  D r i v e r  N O T  I n s t a l l e d'
1074
warn01      db 'V i d e o  D r i v e r  N O T  I n s t a l l e d'
1075
len_warn01=$-warn01
1075
len_warn01=$-warn01
1076
   
1076
   
1077
   
1077
   
1078
drvinfo:   ; 512 bytes driver info area
1078
drvinfo:   ; 512 bytes driver info area
1079
; +0   - Full driver name
1079
; +0   - Full driver name
1080
; +32  - Driver version
1080
; +32  - Driver version
1081
; +64  - Word List of support video modes (max 32 positions)
1081
; +64  - Word List of support video modes (max 32 positions)
1082
; +128 - 5 words list of support vertical rate to each present mode
1082
; +128 - 5 words list of support vertical rate to each present mode
1083
      org $+32
1083
      org $+32
1084
drvver:
1084
drvver:
1085
      org $+32
1085
      org $+32
1086
vidmode:
1086
vidmode:
1087
      org $+64
1087
      org $+64
1088
_m1:
1088
_m1:
1089
      org drvinfo+200h
1089
      org drvinfo+200h
1090
   
1090
   
1091
buffer:
1091
buffer:
1092
I_END:
1092
I_END: