Subversion Repositories Kolibri OS

Rev

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

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