Subversion Repositories Kolibri OS

Rev

Rev 1741 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1741 Rev 2474
Line -... Line 1...
-
 
1
;------------------------------------------------------------------------------
1
; <--- description --->
2
; Display Test for KolibriOS
-
 
3
;------------------------------------------------------------------------------
-
 
4
; version:	0.41
-
 
5
; last update:  17/03/2012
-
 
6
; written by:   Marat Zakiyanov aka Mario79, aka Mario
-
 
7
; changes:      some optimisations and code refactoring
-
 
8
;------------------------------------------------------------------------------
2
; compiler:     FASM 1.50
9
; compiler:        FASM 1.50
3
; name:         Display Test
10
; name:            Display Test
4
; version:      0.4
11
; version:         0.4
5
; author:       barsuk
12
; original author: barsuk
6
 
-
 
Line 7... Line 13...
7
 
13
 
8
; <--- include all MeOS stuff --->
14
; <--- include all MeOS stuff --->
9
include "lang.inc"
15
include "lang.inc"
Line 15... Line 21...
15
;include "..\..\..\debug.inc"
21
;include "..\..\..\debug.inc"
Line 16... Line 22...
16
 
22
 
17
 
23
 
18
; <--- start of code --->
-
 
19
CODE
-
 
20
	mov     eax, 37
-
 
21
	mov     ebx, 4
24
; <--- start of code --->
22
	mov     edx, 2
-
 
23
	mov     ecx, cursor
25
CODE
24
	int     0x40
26
	mcall	37,4,cursor,2
25
	or      eax, eax
27
	or      eax, eax
-
 
28
	jz      exit
26
	jz      exit
29
	mov     [cursorID], eax
27
	mov     [cursorID], eax
30
;------------------------------------------------------------------------------
28
 
-
 
-
 
31
redraw:
29
	call	draw_window		  ; at first create and draw the window
32
	call	draw_window		  ; at first create and draw the window
30
 
33
;------------------------------------------------------------------------------
31
  wait_event:				  ; main cycle
34
wait_event:				  ; main cycle
32
	xor	ebx, ebx
-
 
Line 33... Line 35...
33
	mov	eax, 10
35
	xor	ebx, ebx
34
	int	0x40
36
	mcall	10
35
 
37
 
36
	cmp	eax, 1			  ;   if event == 1
38
	cmp	eax, 1			  ;   if event == 1
37
	je	 redraw 		  ;     jump to redraw handler
39
	je	 redraw 		  ;     jump to redraw handler
38
	cmp	eax, 2			  ;   else if event == 2
40
	cmp	eax, 2			  ;   else if event == 2
Line 39... Line 41...
39
	je	 key				;       jump to key handler
41
	je	 key				;       jump to key handler
40
	cmp	eax, 3			  ;   else if event == 3
-
 
41
	je	 button 		  ;     jump to button handler
-
 
42
 
42
	cmp	eax, 3			  ;   else if event == 3
43
	jmp	wait_event		   ;   else return to the start of main cycle
-
 
44
 
-
 
45
 
-
 
46
  redraw:					 ; redraw event handler
-
 
47
	call	draw_window
43
	je	 button 		  ;     jump to button handler
48
	jmp	wait_event
44
 
49
 
-
 
Line 50... Line 45...
50
 
45
	jmp	wait_event		   ;   else return to the start of main cycle
51
  key:						; key event handler
46
;------------------------------------------------------------------------------
Line 52... Line 47...
52
	mov	eax, 2			  ;   get key code
47
key:						; key event handler
Line 81... Line 76...
81
 
76
 
82
	cmp	ah, 'D'
77
	cmp	ah, 'D'
Line 83... Line 78...
83
	jz	redraw
78
	jz	redraw
84
 
-
 
-
 
79
 
85
	jmp	wait_event
80
	jmp	wait_event
86
 
81
;------------------------------------------------------------------------------
87
next_test:
82
next_test:
Line 88... Line 83...
88
	cmp	dword [test_done], 1
83
	cmp	dword [test_done], 1
89
	jz	wait_event
84
	jz	wait_event
90
 
85
 
91
	inc	dword [test_num]
-
 
-
 
86
	inc	dword [test_num]
92
	call	draw_window
87
	call	draw_window
93
	jmp	wait_event
88
	jmp	wait_event
94
 
89
;------------------------------------------------------------------------------
Line 95... Line 90...
95
prev_test:
90
prev_test:
96
	cmp	dword [test_num], ebx
91
	cmp	dword [test_num], ebx
97
	jz	wait_event
92
	jz	wait_event
98
 
93
 
99
	dec	dword [test_num]
-
 
100
	mov	dword [test_done], ebx
-
 
-
 
94
	dec	dword [test_num]
101
	call	draw_window
95
	mov	dword [test_done], ebx
102
	jmp	wait_event
96
	call	draw_window
103
 
97
	jmp	wait_event
104
 
98
;------------------------------------------------------------------------------
105
toggle_info:
-
 
-
 
99
toggle_info:
106
	xor	dword [show_info], 1
100
	xor	dword [show_info], 1
107
	call	draw_window
101
	call	draw_window
108
	jmp	wait_event
102
	jmp	wait_event
109
 
103
;------------------------------------------------------------------------------
Line 110... Line 104...
110
toggle_cursor:
104
toggle_cursor:
111
	mov	eax, cursorVisible
105
	mov	eax, cursorVisible
112
	cmp	dword [eax], 0
106
	cmp	dword [eax], 0
-
 
107
	jz	.no_cursor
113
	jz	.no_cursor
108
 
114
 
109
	mov	dword [eax], 0
115
	mov	dword [eax], 0
110
	mov	ecx, [cursorID]
-
 
111
	jmp	.set
116
	mov	ecx, [cursorID]
112
;--------------------------------------
117
	jmp	.set
-
 
118
.no_cursor:
113
.no_cursor:
119
	mov	dword [eax], 1
-
 
120
	xor	ecx, ecx
-
 
121
.set:
-
 
122
	mov	eax, 37
114
	mov	dword [eax], 1
123
	mov	ebx, 5
115
	xor	ecx, ecx
124
	int	0x40
-
 
-
 
116
;--------------------------------------
125
	mov	eax, 18
117
.set:
126
	mov	ebx, 15
118
	mcall	37,5
127
	int	0x40			; çâ®¡ë ®¡­®¢¨«áï
-
 
128
	jmp	wait_event
-
 
129
 
119
	mcall	18,15			; çâ®¡ë ®¡­®¢¨«áï
130
button: 				 ; button event handler
120
	jmp	wait_event
131
	mov	eax, 17 		 ;   get button identifier
-
 
-
 
121
;------------------------------------------------------------------------------
132
	int	0x40
122
button: 				 ; button event handler
133
 
123
	mcall	17		 ;   get button identifier
134
	cmp	ah, 1
124
	cmp	ah, 1
135
	jne	wait_event		   ;   return if button id != 1
-
 
136
 
-
 
-
 
125
	jne	wait_event		   ;   return if button id != 1
137
exit:
126
;--------------------------------------
138
	or	 eax, -1			 ;   exit application
-
 
139
	int	0x40
127
exit:
140
 
-
 
Line 141... Line 128...
141
 
128
	or	 eax, -1			 ;   exit application
142
draw_window:
129
	mcall
143
	mov	eax, 12 		 ; start drawing
130
;------------------------------------------------------------------------------
144
	mov	ebx, 1
131
draw_window:
145
	int	0x40
132
	mcall	12,1
Line 146... Line 133...
146
 
133
 
147
	; ªãàá®à
134
	; ªãàá®à
148
	;mov     eax, 37
135
	;mov     eax, 37
149
	;mov     ebx, 5
136
	;mov     ebx, 5
150
	;mov     ecx, cursorID
137
	;mov     ecx, cursorID
151
	;int     0x40
138
	;int     0x40
152
 
139
 
153
	mov	eax, 14 		; screen size
140
	mcall	14 		; screen size
Line 154... Line 141...
154
	int	0x40
141
 
155
	mov	ebx, eax
142
	mov	ebx, eax
156
	shr	ebx, 16
143
	shr	ebx, 16
157
	mov	ecx, eax
144
	mov	ecx, eax
158
	and	ecx, 0xffff
145
	and	ecx, 0xffff
159
	mov	[screenx], ebx
146
	mov	[screenx], ebx
160
	mov	[screeny], ecx
-
 
161
 
147
	mov	[screeny], ecx
162
	inc	ebx
-
 
163
	inc	ecx
-
 
164
	mov	eax, 0			  ; create and draw the window
148
 
165
	mov	edx, 0x01000000
149
	inc	ebx
-
 
150
	inc	ecx
166
	mov	esi, edx
151
	xor	eax, eax			  ; create and draw the window
167
	int	0x40
152
	mov	edx, 0x01000000
Line 168... Line 153...
168
 
153
	mov	esi, edx
169
	; áâ¥à¥âì £à ­¨æë ®ª­ 
154
	mcall
170
 
155
	; áâ¥à¥âì £à ­¨æë ®ª­ 
171
	mov	eax, 13 		; £àã¡® â ª
156
	xor	edx, edx
172
	xor	edx, edx
157
	mcall	13 		; £àã¡® â ª
173
	int	0x40
158
 
-
 
159
	dec	ebx
174
	dec	ebx
160
	dec	ecx
175
	dec	ecx
-
 
176
 
-
 
177
	mov	eax, [test_num]
-
 
178
	mov	eax, [test_proc + eax*4]
-
 
179
	or	eax, eax
161
 
180
	jz	end_of_test
-
 
181
	call	eax
162
	mov	eax, [test_num]
182
	jmp	exit_draw
163
	mov	eax, [test_proc + eax*4]
183
end_of_test:
-
 
-
 
164
	or	eax, eax
184
	mov	eax, 4
165
	jz	end_of_test
185
	mov	ebx, 8 * 65536 + 8
-
 
186
	mov	ecx, 0xffffff
166
	call	eax
187
	mov	edx, test_finish
167
	jmp	exit_draw
188
	mov	esi, test_finish.size
-
 
189
	int	0x40
168
;--------------------------------------
190
	mov	dword [test_done], 1
169
end_of_test:
191
	jmp	no_info
170
	mcall	4,<8,8>,0xffffff,test_finish,test_finish.size
192
 
-
 
193
exit_draw:
171
	mov	dword [test_done], 1
194
 
-
 
195
	cmp	dword [show_info], 1
172
	jmp	no_info
196
	jnz	no_info
173
;--------------------------------------
197
 
-
 
198
; á­®¢  à §¬¥àë íªà ­ 
174
exit_draw:
199
	mov	ebx, [screenx]
175
	cmp	dword [show_info], 1
200
	mov	ecx, [screeny]
176
	jnz	no_info
201
 
177
; á­®¢  à §¬¥àë íªà ­ 
202
; ᣥ­¥à¨âì áâà®çªã á à §à¥è¥­¨¥¬ íªà ­ . … ­ã¦­®, ¯®â®¬ã çâ® ¯¯æ
178
	mov	ebx, [screenx]
203
 
179
	mov	ecx, [screeny]
204
	; ¯àאַ㣮«ì­¨ª 200å40 á ¨­ä®©
180
; ᣥ­¥à¨âì áâà®çªã á à §à¥è¥­¨¥¬ íªà ­ . … ­ã¦­®, ¯®â®¬ã çâ® ¯¯æ
205
	mov	edx, 200
181
	; ¯àאַ㣮«ì­¨ª 200å40 á ¨­ä®©
206
	mov	eax, 13
182
	mov	edx, 200
207
	sub	ebx, edx
183
	sub	ebx, edx
208
	shl	ebx, 15
184
	shl	ebx, 15
209
	mov	bx, dx
185
	mov	bx, dx
210
	mov	edx, 40
186
	mov	edx, 40
211
	sub	ecx, edx
-
 
212
	shl	ecx, 15
-
 
213
	mov	cx, dx
187
	sub	ecx, edx
214
	mov	edx, 0xffffff
-
 
215
	int	0x40
188
	shl	ecx, 15
216
	xor	edx, edx
189
	mov	cx, dx
217
	add	ebx, 0x0000fffe 	; ®ç¥­ì 㤮¡­® :))))
190
	mcall	13,,,0xffffff
218
	add	ecx, 0x0000fffe
191
 
219
	int	0x40
192
	xor	edx, edx
220
 
193
	add	ebx, 0x0000fffe 	; ®ç¥­ì 㤮¡­® :))))
221
 
194
	add	ecx, 0x0000fffe
222
; ⥪áâ
-
 
223
	mov	eax, 4
-
 
224
	shr	ecx, 16
195
	mcall
225
	mov	bx, cx
196
; ⥪áâ
226
	add	ebx, 0x00010001
197
	shr	ecx, 16
227
	mov	ecx, 0x80ffffff
198
	mov	bx, cx
228
	mov	edx, [test_num]
199
	add	ebx, 0x00010001
229
	mov	edx, [test_info + edx*4]
200
	mov	ecx, 0x80ffffff
230
	int	0x40
-
 
Line -... Line 201...
-
 
201
	mov	edx, [test_num]
-
 
202
	mov	edx, [test_info + edx*4]
-
 
203
	mcall	4
231
	add	ebx, 8
204
 
232
	mov	edx, press_space
-
 
233
	int	0x40
205
	add	ebx, 8
234
	add	ebx, 8
-
 
235
	mov	edx, press_i
-
 
236
	int	0x40
206
	mcall	,,,press_space
237
	add	ebx, 8
-
 
-
 
207
 
238
	mov	edx, press_c
208
	add	ebx, 8
239
	int	0x40
209
	mcall	,,,press_i
240
 
-
 
-
 
210
 
241
no_info:
211
	add	ebx, 8
242
	mov	eax, 12 		 ; finish drawing
212
	mcall	,,,press_c
-
 
213
;--------------------------------------
243
	mov	ebx, 2
214
no_info:
244
	int	0x40
-
 
245
 
215
	mcall	12,2
246
  ret
216
	ret
247
 
-
 
248
; <---- procedures for various tests of display ----->
217
;------------------------------------------------------------------------------
249
; in: ebx = screen_width, ecx = screen_height
218
; <---- procedures for various tests of display ----->
250
 
219
; in: ebx = screen_width, ecx = screen_height
-
 
220
;------------------------------------------------------------------------------
251
lsz i_image_size, ru, "Image Size and Placement"
221
lsz i_image_size, ru, "Image Size and Placement"
252
db	0
222
db	0
253
t_image_size:
223
;------------------------------------------------------------------------------
254
	mov	eax, 38
224
t_image_size:
-
 
225
	mov	esi, ebx
255
	mov	esi, ebx
226
	mov	edi, ecx
256
	mov	edi, ecx
227
; 6 ®â१ª®¢
257
	mov	edx, 0xffffff
228
	xor	ecx, ecx
258
; 6 ®â१ª®¢
229
	mcall	38,,,0xffffff
-
 
230
 
259
	xor	ecx, ecx
231
	mov	ecx, edi
260
	int	0x40
232
	shl	ecx, 16
261
	mov	ecx, edi
233
	xor	ebx, ebx
262
	shl	ecx, 16
234
	mcall
263
	xor	ebx, ebx
235
 
264
	int	0x40
236
	mov	ebx, esi
265
	mov	ebx, esi
237
	shl	ebx, 16
266
	shl	ebx, 16
238
	add	ecx, edi
267
	add	ecx, edi
239
	mcall
268
	int	0x40
240
	
269
	sub	ecx, edi
241
	sub	ecx, edi
-
 
242
	add	ebx, esi
270
	add	ebx, esi
243
	mcall
271
	int	0x40
244
; à ¬ª  £®â®¢ 
272
; à ¬ª  £®â®¢ 
245
	mov	ebx, esi
273
	mov	ebx, esi
246
	shl	ebx, 16
274
	shl	ebx, 16
247
	mov	ecx, edi
275
	mov	ecx, edi
248
	shl	ecx, 15
276
	shl	ecx, 15
-
 
277
	mov	cx, di
249
	mov	cx, di
278
	shr	cx, 1
-
 
-
 
250
	shr	cx, 1
279
	int	0x40
251
	mcall
280
	shr	ebx, 1
252
 
-
 
253
	shr	ebx, 1
281
	mov	bx, si
254
	mov	bx, si
282
	shr	bx, 1
255
	shr	bx, 1
283
	mov	ecx, edi
256
	mov	ecx, edi
284
	shl	ecx, 16
257
	shl	ecx, 16
285
	int	0x40
258
	mcall
Line 298... Line 271...
298
	mov	edx, 0xffffff
271
	mov	edx, 0xffffff
299
	mov	ebp, 0x00400040
272
	mov	ebp, 0x00400040
300
;       £®à¨§®­â «ì­ë¥ «¨­¨¨
273
;       £®à¨§®­â «ì­ë¥ «¨­¨¨
301
	shl	ebx, 16
274
	shl	ebx, 16
302
	xor	ecx, ecx
275
	xor	ecx, ecx
-
 
276
;--------------------------------------
303
grid_next_y:
277
grid_next_y:
304
	int	0x40
278
	mcall
-
 
279
 
305
	add	ecx, ebp
280
	add	ecx, ebp
306
	cmp	cx, di
281
	cmp	cx, di
307
	jnae	grid_next_y
282
	jnae	grid_next_y
308
	sub	ecx, 0x00010001
283
	sub	ecx, 0x00010001
309
	int	0x40
284
	mcall
310
;       ¢¥à⨪ «ì­ë¥ «¨­¨¨
285
;       ¢¥à⨪ «ì­ë¥ «¨­¨¨
311
	mov	ecx, edi
286
	mov	ecx, edi
312
	shl	ecx, 16
287
	shl	ecx, 16
313
	xor	ebx, ebx
288
	xor	ebx, ebx
-
 
289
;--------------------------------------
314
grid_next_x:
290
grid_next_x:
315
	int	0x40
291
	mcall
316
	add	ebx, ebp
292
	add	ebx, ebp
317
	cmp	bx, si
293
	cmp	bx, si
318
	jnae	grid_next_x
294
	jnae	grid_next_x
319
	sub	ebx, 0x00010001
295
	sub	ebx, 0x00010001
320
	int	0x40
296
	mcall
321
 
-
 
322
	ret
297
	ret
323
 
-
 
-
 
298
;------------------------------------------------------------------------------
324
lsz i_horstr, ru, "Horizontal Straightness"
299
lsz i_horstr, ru, "Horizontal Straightness"
325
db	0
300
db	0
-
 
301
;------------------------------------------------------------------------------
326
t_horstr:
302
t_horstr:
327
	mov	eax, 38
303
	mov	eax, 38
328
	mov	edi, ecx
304
	mov	edi, ecx
329
	mov	edx, 0xffffff
305
	mov	edx, 0xffffff
330
	mov	esi, ecx
306
	mov	esi, ecx
Line 337... Line 313...
337
	shl	ebx, 16
313
	shl	ebx, 16
338
	mov	ecx, ebp
314
	mov	ecx, ebp
339
	shr	ecx, 1
315
	shr	ecx, 1
340
	mov	cx, bp
316
	mov	cx, bp
341
	shr	cx, 1
317
	shr	cx, 1
-
 
318
;--------------------------------------
342
hor_next_y:
319
hor_next_y:
343
	int	0x40
320
	mcall
344
	add	ecx, ebp
321
	add	ecx, ebp
345
	cmp	cx, di
322
	cmp	cx, di
346
	jnae	hor_next_y
323
	jnae	hor_next_y
347
	ret
324
	ret
-
 
325
;------------------------------------------------------------------------------
348
lsz i_vertstr, ru, "Vertical Straightness",0
326
lsz i_vertstr, ru, "Vertical Straightness",0
349
db	0
327
db	0
-
 
328
;------------------------------------------------------------------------------
350
t_vertstr:
329
t_vertstr:
351
	mov	eax, 38
330
	mov	eax, 38
352
	mov	edx, 0xffffff
331
	mov	edx, 0xffffff
353
	mov	esi, ebx
332
	mov	esi, ebx
354
	shl	ecx, 16
333
	shl	ecx, 16
Line 359... Line 338...
359
	mov	bp, di
338
	mov	bp, di
360
	mov	ebx, ebp
339
	mov	ebx, ebp
361
	shr	ebx, 1
340
	shr	ebx, 1
362
	mov	bx, bp
341
	mov	bx, bp
363
	shr	bx, 1
342
	shr	bx, 1
-
 
343
;--------------------------------------
364
vert_next_x:
344
vert_next_x:
365
	int	0x40
345
	mcall
366
	add	ebx, ebp
346
	add	ebx, ebp
367
	cmp	bx, si
347
	cmp	bx, si
368
	jnae	vert_next_x
348
	jnae	vert_next_x
369
 
-
 
370
	ret
349
	ret
371
 
-
 
-
 
350
;------------------------------------------------------------------------------
372
lsz i_distort, ru, "Distortion",0
351
lsz i_distort, ru, "Distortion",0
373
db	0
352
db	0
-
 
353
;------------------------------------------------------------------------------
374
t_distort:
354
t_distort:
375
	mov	edx, 0xffffff
355
	mov	edx, 0xffffff
376
	mov	esi, ebx
356
	mov	esi, ebx
377
	mov	edi, ecx
357
	mov	edi, ecx
378
	mov	ebp, 3
358
	mov	ebp, 3
379
 
-
 
380
	xor	ebx, ebx
359
	xor	ebx, ebx
-
 
360
;--------------------------------------
381
dist_next:
361
dist_next:
382
	mov	eax, 38
-
 
383
	push	ebp
362
	push	ebp
384
	mov	ebp, ebx
363
	mov	ebp, ebx
385
	shl	ebx, 16
364
	shl	ebx, 16
386
	or	ebx, ebp
365
	or	ebx, ebp
Line 387... Line 366...
387
 
366
 
388
	mov	ecx, edi
367
	mov	ecx, edi
389
	shl	ecx, 16
368
	shl	ecx, 16
390
	or	ecx, ebp
369
	or	ecx, ebp
Line 391... Line 370...
391
	int	0x40
370
	mcall	38
392
 
371
 
393
	mov	ebx, esi
372
	mov	ebx, esi
394
	shl	ebx, 16
373
	shl	ebx, 16
Line 395... Line 374...
395
	mov	bx, si
374
	mov	bx, si
396
	int	0x40
375
	mcall
397
 
376
 
398
	mov	bx, bp
377
	mov	bx, bp
399
	mov	ecx, ebp
378
	mov	ecx, ebp
Line 400... Line 379...
400
	shl	ecx, 16
379
	shl	ecx, 16
401
	or	ecx, ebp
380
	or	ecx, ebp
402
	int	0x40
381
	mcall
403
 
382
 
Line 404... Line 383...
404
	mov	ecx, edi
383
	mov	ecx, edi
405
	shl	ecx, 16
384
	shl	ecx, 16
406
	mov	cx, di
385
	mov	cx, di
407
	int	0x40
386
	mcall
408
 
387
 
409
	mov	eax, 30
388
	mov	eax, 30
410
	sub	esi, eax
389
	sub	esi, eax
411
	sub	edi, eax
390
	sub	edi, eax
412
	mov	ebx, ebp
-
 
413
	add	ebx, eax
391
	mov	ebx, ebp
414
	pop	ebp
-
 
-
 
392
	add	ebx, eax
415
	dec	ebp
393
	pop	ebp
416
	jnz	dist_next
394
	dec	ebp
-
 
395
	jnz	dist_next
417
 
396
	ret
418
	ret
397
;------------------------------------------------------------------------------
419
 
398
lsz i_horres, ru, "Horizontal Resolution",0
420
lsz i_horres, ru, "Horizontal Resolution",0
399
db	0
421
db	0
400
;------------------------------------------------------------------------------
422
t_horres:
401
t_horres:
423
	mov	eax, 38
402
	mov	eax, 38
424
	mov	edx, 0xffffff
403
	mov	edx, 0xffffff
425
	mov	edi, ecx
404
	mov	edi, ecx
426
	shl	ecx, 16
-
 
-
 
405
	shl	ecx, 16
427
	mov	esi, ebx
406
	mov	esi, ebx
428
	xor	ebx, ebx
407
	xor	ebx, ebx
429
	mov	edi, 0x003A003A
408
	mov	edi, 0x003A003A
-
 
409
	mov	ebp, 0x00030003
430
	mov	ebp, 0x00030003
410
;--------------------------------------
431
 
411
horres_next:
-
 
412
	add	ebx, edi
432
horres_next:
413
	mcall
433
	add	ebx, edi
414
 
-
 
415
	add	ebx, ebp
434
	int	0x40
416
	mcall
435
	add	ebx, ebp
417
 
-
 
418
	add	ebx, ebp
436
	int	0x40
419
	mcall
437
	add	ebx, ebp
420
 
-
 
421
	add	ebx, ebp
438
	int	0x40
422
	mcall
439
	add	ebx, ebp
423
 
440
	int	0x40
-
 
441
	add	ebx, ebp
424
	add	ebx, ebp
442
	int	0x40
-
 
-
 
425
	mcall
443
	cmp	bx, si
426
 
444
	jna	horres_next
427
	cmp	bx, si
-
 
428
	jna	horres_next
445
 
429
	ret
446
	ret
430
;------------------------------------------------------------------------------
447
 
431
lsz i_vertres, ru, "Vertical Resolution",0
448
lsz i_vertres, ru, "Vertical Resolution",0
432
db	0
449
db	0
433
;------------------------------------------------------------------------------
450
t_vertres:
434
t_vertres:
451
	mov	eax, 38
435
	mov	eax, 38
452
	mov	edx, 0xffffff
436
	mov	edx, 0xffffff
453
;       mov     esi, ebx
437
;       mov     esi, ebx
454
	shl	ebx, 16
-
 
-
 
438
	shl	ebx, 16
455
	mov	edi, ecx
439
	mov	edi, ecx
456
	xor	ecx, ecx
440
	xor	ecx, ecx
457
	mov	ebp, 0x00030003
441
	mov	ebp, 0x00030003
-
 
442
	mov	esi, 0x002A002A
458
	mov	esi, 0x002A002A
443
;--------------------------------------
459
 
444
vertres_next:
-
 
445
	add	ecx, esi
460
vertres_next:
446
	mcall
461
	add	ecx, esi
447
 
-
 
448
	add	ecx, ebp
462
	int	0x40
449
	mcall
463
	add	ecx, ebp
450
 
-
 
451
	add	ecx, ebp
464
	int	0x40
452
	mcall
465
	add	ecx, ebp
453
 
-
 
454
	add	ecx, ebp
466
	int	0x40
455
	mcall
467
	add	ecx, ebp
456
 
468
	int	0x40
457
	add	ecx, ebp
469
	add	ecx, ebp
-
 
470
	int	0x40
458
	mcall
471
	add	ecx, 0x00540054
-
 
-
 
459
 
472
	cmp	cx, di
460
	add	ecx, 0x00540054
473
	jna	vertres_next
461
	cmp	cx, di
-
 
462
	jna	vertres_next
474
 
463
	ret
475
	ret
464
;------------------------------------------------------------------------------
476
 
465
lsz i_moire, ru, "Moire Patterns",0
477
lsz i_moire, ru, "Moire Patterns",0
466
db	0
478
db	0
467
;------------------------------------------------------------------------------
479
t_moire:
468
t_moire:
480
	mov	eax, 38
469
	mov	eax, 38
481
	mov	edx, 0xffffff
470
	mov	edx, 0xffffff
-
 
471
	mov	edi, ecx
482
	mov	edi, ecx
472
	shl	ecx, 16
483
	shl	ecx, 16
473
	mov	esi, ebx
484
	mov	esi, ebx
474
	xor	ebx, ebx
485
	xor	ebx, ebx
475
	mov	ebp, 0x00030003
486
	mov	ebp, 0x00030003
476
;--------------------------------------
487
moire_next:
-
 
488
	int	0x40
477
moire_next:
489
	add	ebx, ebp
-
 
-
 
478
	mcall
490
	cmp	bx, si
479
	add	ebx, ebp
491
	jna	moire_next
480
	cmp	bx, si
-
 
481
	jna	moire_next
492
 
482
	ret
493
	ret
483
;------------------------------------------------------------------------------
494
 
484
lsz i_revsharp, ru, "Reverse Video Sharpness",0
495
lsz i_revsharp, ru, "Reverse Video Sharpness",0
485
db	0
496
db	0
-
 
497
t_revsharp:
486
;------------------------------------------------------------------------------
498
	mov	esi, ebx
-
 
499
	mov	edi, ecx
487
t_revsharp:
500
	shr	ecx, 1
488
	mov	esi, ebx
501
	mov	eax, 13
489
	mov	edi, ecx
502
	mov	edx, 0xffffff
490
	shr	ecx, 1
503
	int	0x40
491
	mcall	13,,,0xffffff
504
;   ⥯¥àì - ¨­¢¥àá­ë¥ «¨­¨¨
492
;   ⥯¥àì - ¨­¢¥àá­ë¥ «¨­¨¨
505
	mov	eax, 38
493
	mov	eax, 38
-
 
494
	mov	ecx, edi
506
	mov	ecx, edi
495
	mov	edx, 0x01000000
507
	mov	edx, 0x01000000
496
	xor	ebx, ebx
508
	xor	ebx, ebx
497
	mov	ebp, 0x00010001
-
 
498
	mov	edi, 0x003F003F
509
	mov	ebp, 0x00010001
499
;--------------------------------------
510
	mov	edi, 0x003F003F
500
revsharp_next:
-
 
501
	add	ebx, edi
511
revsharp_next:
502
	mcall
512
	add	ebx, edi
503
 
-
 
504
	add	ebx, ebp
513
	int	0x40
505
	mcall
514
	add	ebx, ebp
506
 
515
	int	0x40
507
	add	ebx, ebp
-
 
508
	mcall
516
	add	ebx, ebp
509
 
517
	int	0x40
510
	add	ebx, edi
518
	add	ebx, edi
-
 
519
	sub	ebx, ebp
511
	sub	ebx, ebp
520
	int	0x40
-
 
-
 
512
	mcall
521
	cmp	bx, si
513
 
522
	jna	revsharp_next
514
	cmp	bx, si
-
 
515
	jna	revsharp_next
523
 
516
	ret
524
	ret
-
 
525
 
517
;------------------------------------------------------------------------------
526
lsz i_flicker, ru, "Flicker Severity",0
-
 
527
db	0
518
lsz i_flicker, ru, "Flicker Severity",0
528
t_flicker:
-
 
-
 
519
db	0
529
	mov	eax, 13
520
;------------------------------------------------------------------------------
530
	mov	edx, 0xffffff
521
t_flicker:
-
 
522
	mcall	13,,,0xffffff
531
	int	0x40
523
	ret
532
	ret
524
;------------------------------------------------------------------------------
533
 
-
 
-
 
525
lsz i_glare, ru, "Glare Severity",0
534
lsz i_glare, ru, "Glare Severity",0
526
db	0
535
db	0
527
;------------------------------------------------------------------------------
-
 
528
t_glare:		; ®¯â¨¬¨§¨à®¢ âì ­¥ç¥£®
536
t_glare:		; ®¯â¨¬¨§¨à®¢ âì ­¥ç¥£®
529
	ret
537
	ret
530
;------------------------------------------------------------------------------
538
 
531
lsz i_interlace, ru, "Interlacing Detection",0
539
lsz i_interlace, ru, "Interlacing Detection",0
532
db	0
540
db	0
533
;------------------------------------------------------------------------------
541
t_interlace:
534
t_interlace:
-
 
535
	mov	edi, ecx
542
	mov	edi, ecx
536
	mov	eax, 38
543
	mov	eax, 38
537
	mov	edx, 0xffffff
544
	mov	edx, 0xffffff
538
	xor	ecx, ecx
545
	xor	ecx, ecx
539
	mov	ebp, 0x00020002
546
	mov	ebp, 0x00020002
540
;--------------------------------------
547
interlace_next:
-
 
548
	add	ecx, ebp
541
interlace_next:
549
	int	0x40
-
 
-
 
542
	add	ecx, ebp
550
	cmp	cx, di
543
	mcall
551
	jna	interlace_next
544
	cmp	cx, di
-
 
545
	jna	interlace_next
552
 
546
	ret
553
	ret
-
 
554
 
-
 
555
lsz i_scrreg, ru, "Screen Regulation",0
547
;------------------------------------------------------------------------------
556
db	0
548
lsz i_scrreg, ru, "Screen Regulation",0
557
t_scrreg:
549
db	0
558
	mov	eax, 13
550
;------------------------------------------------------------------------------
559
	mov	edx, 0xffffff
551
t_scrreg:
560
	add	ebx, 0x0018FFCD ; +25 ª ­ ç «ã ¨ -50 ®â ¤«¨­ë
-
 
-
 
552
	add	ebx, 0x0018FFCD ; +25 ª ­ ç «ã ¨ -50 ®â ¤«¨­ë
561
	shr	ecx, 1
553
	shr	ecx, 1
562
	add	ecx, 0x0013FFEC ; +19 ª ­ ç «ã ¨ -19 ®â ¤«¨­ë
554
	add	ecx, 0x0013FFEC ; +19 ª ­ ç «ã ¨ -19 ®â ¤«¨­ë
-
 
555
	mcall	13,,,0xffffff
563
	int	0x40
556
	ret
564
	ret
-
 
565
 
557
;------------------------------------------------------------------------------
566
lsz i_pricol, ru, "Primary Color Purity"
558
lsz i_pricol, ru, "Primary Color Purity"
567
db	0
-
 
Line 568... Line 559...
568
t_pricol:
559
db	0
569
 
560
;------------------------------------------------------------------------------
570
	mov	esi, ebx
561
t_pricol:
571
	mov	edi, ecx
562
	mov	esi, ebx
Line 582... Line 573...
582
	mov	cx, di
573
	mov	cx, di
583
	sub	cx, 80
574
	sub	cx, 80
584
	;shr     cx, 1
575
	;shr     cx, 1
Line 585... Line 576...
585
 
576
 
586
	shl	bx, 2
577
	shl	bx, 2
587
	mov	edx, 0xff0000
-
 
Line 588... Line 578...
588
	int	0x40
578
	mcall	13,,,0xff0000
589
 
579
 
590
	add	ebx, ebp
580
	add	ebx, ebp
Line 591... Line 581...
591
	shr	edx, 8
581
	shr	edx, 8
592
	int	0x40
582
	mcall
593
 
583
 
594
	add	ebx, ebp
-
 
595
	shr	edx, 8
584
	add	ebx, ebp
596
	int	0x40
-
 
-
 
585
	shr	edx, 8
597
 
586
	mcall
598
	ret
587
	ret
-
 
588
;------------------------------------------------------------------------------
599
 
589
lsz i_colint, ru, "Color Intensity Gradient"
Line 600... Line 590...
600
lsz i_colint, ru, "Color Intensity Gradient"
590
db	0
601
db	0
591
;------------------------------------------------------------------------------
Line 650... Line 640...
650
	div	esi
640
	div	esi
651
	mov	edi, eax	; edi = 64K/width
641
	mov	edi, eax	; edi = 64K/width
Line 652... Line 642...
652
 
642
 
653
	mov	dword [color_index], 0
643
	mov	dword [color_index], 0
654
	jmp	colint_next
-
 
-
 
644
	jmp	colint_next
655
 
645
;------------------------------------------------------------------------------
656
color_table	dd	0x00ff0000, 0x0000ff00, 0x00ffff00, \
646
color_table	dd	0x00ff0000, 0x0000ff00, 0x00ffff00, \
657
			0x000000ff, 0x00ff00ff, 0x0000ffff, 0x00ffffff
647
			0x000000ff, 0x00ff00ff, 0x0000ffff, 0x00ffffff
658
color_index	dd	0
-
 
-
 
648
color_index	dd	0
659
 
649
;------------------------------------------------------------------------------
660
colint_next:
650
colint_next:
661
	xor	edx, edx
651
	xor	edx, edx
662
	xor	ebx, ebx
652
	xor	ebx, ebx
-
 
653
	mov	eax, 38
663
	mov	eax, 38
654
;--------------------------------------
664
colint_next_line:
655
colint_next_line:
665
	push	edx
656
	push	edx
666
	push	eax
657
	push	eax
667
	movzx	eax, dh
658
	movzx	eax, dh
Line 670... Line 661...
670
	or	edx, eax
661
	or	edx, eax
671
	mov	eax, [color_index]
662
	mov	eax, [color_index]
672
	mov	eax, [color_table + eax * 4]
663
	mov	eax, [color_table + eax * 4]
673
	and	edx, eax
664
	and	edx, eax
674
	pop	eax
665
	pop	eax
675
	int	0x40
666
	mcall
676
	pop	edx
667
	pop	edx
677
	add	ebx, 0x00010001
668
	add	ebx, 0x00010001
678
	add	edx, edi
669
	add	edx, edi
679
	cmp	bx, si
670
	cmp	bx, si
680
	jna	colint_next_line
671
	jna	colint_next_line
Line 681... Line 672...
681
 
672
 
682
	add	ecx, ebp
673
	add	ecx, ebp
683
	inc	dword [color_index]
674
	inc	dword [color_index]
684
	cmp	dword [color_index], 7
675
	cmp	dword [color_index], 7
685
	jb	colint_next
-
 
686
 
676
	jb	colint_next
687
	ret
-
 
-
 
677
	ret
688
 
678
;------------------------------------------------------------------------------
689
lsz i_colalign, ru, "Color Alignment Grid"
679
lsz i_colalign, ru, "Color Alignment Grid"
-
 
680
db	0
690
db	0
681
;------------------------------------------------------------------------------
691
t_colalign:
-
 
692
 
682
t_colalign:
693
; ªà á­ ï á¥âª 
683
; ªà á­ ï á¥âª 
694
	inc	ebx		; â ª ­ã¦­®
684
	inc	ebx		; â ª ­ã¦­®
695
	inc	ecx
685
	inc	ecx
696
	mov	esi, ebx
686
	mov	esi, ebx
Line 705... Line 695...
705
	shl	ebp, 16
695
	shl	ebp, 16
706
	mov	bp, di
696
	mov	bp, di
707
	pop	edi
697
	pop	edi
708
	mov	[yshift], ebp
698
	mov	[yshift], ebp
709
	mov	eax, 38
699
	mov	eax, 38
-
 
700
;--------------------------------------
710
cgrid_next_y:
701
cgrid_next_y:
711
	int	0x40
702
	mcall
712
	add	ecx, ebp
703
	add	ecx, ebp
713
	cmp	cx, di
704
	cmp	cx, di
714
	jnae	cgrid_next_y
705
	jnae	cgrid_next_y
715
	; ¯®á«¥¤­ïï «¨­¨ï:
706
	; ¯®á«¥¤­ïï «¨­¨ï:
716
	sub	ecx, 0x00010001
707
	sub	ecx, 0x00010001
717
	int	0x40
708
	mcall
Line 718... Line 709...
718
 
709
 
719
;       ¢¥à⨪ «ì­ë¥ «¨­¨¨
710
;       ¢¥à⨪ «ì­ë¥ «¨­¨¨
720
	mov	ecx, edi
711
	mov	ecx, edi
721
	shl	ecx, 16
712
	shl	ecx, 16
Line 726... Line 717...
726
	shl	ebp, 16
717
	shl	ebp, 16
727
	mov	bp, si
718
	mov	bp, si
728
	mov	[xshift], ebp
719
	mov	[xshift], ebp
729
	pop	esi
720
	pop	esi
730
	mov	eax, 38
721
	mov	eax, 38
-
 
722
;--------------------------------------
731
cgrid_next_x:
723
cgrid_next_x:
732
	int	0x40
724
	mcall
733
	add	ebx, ebp
725
	add	ebx, ebp
734
	cmp	bx, si
726
	cmp	bx, si
735
	jnae	cgrid_next_x
727
	jnae	cgrid_next_x
736
	; ¯®á«¥¤­ïï «¨­¨ï
728
	; ¯®á«¥¤­ïï «¨­¨ï
737
	sub	ebx, 0x00010001
729
	sub	ebx, 0x00010001
738
	int	0x40
730
	mcall
739
	jmp	cgrid_green
731
	jmp	cgrid_green
740
 
-
 
-
 
732
;------------------------------------------------------------------------------
741
	xshift	dd	0
733
	xshift	dd	0
742
	yshift	dd	0
734
	yshift	dd	0
743
	shift	dd	0
735
	shift	dd	0
-
 
736
;------------------------------------------------------------------------------
744
cgrid_green:
737
cgrid_green:
745
; §¥«¥­ë¥ «¨­¨¨: £®à¨§®­â «ì­ë¥
738
; §¥«¥­ë¥ «¨­¨¨: £®à¨§®­â «ì­ë¥
746
	mov	edx, esi
739
	mov	edx, esi
747
	shr	edx, 5
740
	shr	edx, 5
748
	lea	eax, [edx + edx * 2]
741
	lea	eax, [edx + edx * 2]
Line 751... Line 744...
751
	mov	[shift], edx
744
	mov	[shift], edx
752
	mov	eax, 38
745
	mov	eax, 38
753
	mov	edx, 0x00ff00
746
	mov	edx, 0x00ff00
754
	xor	ecx, ecx
747
	xor	ecx, ecx
755
	mov	ebp, [xshift]
748
	mov	ebp, [xshift]
-
 
749
;--------------------------------------
756
ggrid_next_yy:
750
ggrid_next_yy:
757
	mov	ebx, [shift]
751
	mov	ebx, [shift]
-
 
752
;--------------------------------------
758
ggrid_next_yx:
753
ggrid_next_yx:
759
	int	0x40
754
	mcall
760
	add	ebx, ebp
755
	add	ebx, ebp
761
	cmp	bx, si
756
	cmp	bx, si
762
	jnae	ggrid_next_yx
757
	jnae	ggrid_next_yx
763
	sub	ebx, 0x00010001
758
	sub	ebx, 0x00010001
764
	int	0x40
759
	mcall
Line 765... Line 760...
765
 
760
 
766
	add	ecx, [yshift]
761
	add	ecx, [yshift]
767
	cmp	cx, di
762
	cmp	cx, di
768
	jnae	ggrid_next_yy
763
	jnae	ggrid_next_yy
769
	; last row of lines
764
	; last row of lines
770
	mov	ebx, [shift]
765
	mov	ebx, [shift]
-
 
766
	dec	ecx
771
	dec	ecx
767
;--------------------------------------
772
ggrid_last_yx:
768
ggrid_last_yx:
773
	int	0x40
769
	mcall
774
	add	ebx, ebp
770
	add	ebx, ebp
775
	cmp	bx, si
771
	cmp	bx, si
Line 776... Line 772...
776
	jnae	ggrid_last_yx
772
	jnae	ggrid_last_yx
Line 785... Line 781...
785
 
781
 
786
	mov	eax, 38
782
	mov	eax, 38
787
	mov	edx, 0x00ff00
783
	mov	edx, 0x00ff00
788
	mov	ecx, [shift]
784
	mov	ecx, [shift]
-
 
785
	mov	ebp, [xshift]
789
	mov	ebp, [xshift]
786
;--------------------------------------
790
ggrid_next_xy:
787
ggrid_next_xy:
-
 
788
	xor	ebx, ebx
791
	xor	ebx, ebx
789
;--------------------------------------
792
ggrid_next_xx:
790
ggrid_next_xx:
-
 
791
	mcall
793
	int	0x40
792
 
794
	add	ebx, ebp
793
	add	ebx, ebp
795
	cmp	bx, si
794
	cmp	bx, si
796
	jnae	ggrid_next_xx
795
	jnae	ggrid_next_xx
797
	sub	ebx, 0x00010001
796
	sub	ebx, 0x00010001
Line 798... Line 797...
798
	int	0x40
797
	mcall
799
 
798
 
800
	add	ecx, [yshift]
799
	add	ecx, [yshift]
801
	cmp	cx, di
800
	cmp	cx, di
802
	jnae	ggrid_next_xy
801
	jnae	ggrid_next_xy
-
 
802
	xor	ebx, ebx
803
	xor	ebx, ebx
803
	dec	ecx
804
	dec	ecx
804
;--------------------------------------
805
ggrid_last_xy:
805
ggrid_last_xy:
806
	;int     0x40
806
	;int     0x40
807
	;add     ebx, ebp
807
	;add     ebx, ebp
808
	;cmp     bx, si
-
 
809
	;jnae    ggrid_last_xy
-
 
810
 
-
 
811
 
808
	;cmp     bx, si
812
 
-
 
-
 
809
	;jnae    ggrid_last_xy
813
	ret
810
	ret
814
 
811
;------------------------------------------------------------------------------
-
 
812
lsz i_colsyn, ru, "Color Synchronization"
815
lsz i_colsyn, ru, "Color Synchronization"
813
db	0
816
db	0
-
 
817
t_colsyn:
814
;------------------------------------------------------------------------------
818
 
815
t_colsyn:
819
	inc	ebx
816
	inc	ebx
820
	inc	ecx
817
	inc	ecx
Line 831... Line 828...
831
	shl	ebp, 16
828
	shl	ebp, 16
Line 832... Line 829...
832
 
829
 
833
	mov	edi, 0x0000ffff
830
	mov	edi, 0x0000ffff
834
	add	ecx, 0x003FFF7F
831
	add	ecx, 0x003FFF7F
835
	mov	edx, edi
832
	mov	edx, edi
836
	mov	eax, 13
-
 
Line 837... Line 833...
837
	int	0x40
833
	mcall	13
838
 
834
 
839
	mov	edx, 0x00ff0000
835
	mov	edx, 0x00ff0000
Line 840... Line 836...
840
	add	ebx, ebp
836
	add	ebx, ebp
841
	int	0x40
837
	mcall
842
 
838
 
843
	mov	edx, edi
-
 
844
	add	ebx, ebp
839
	mov	edx, edi
845
	int	0x40
-
 
-
 
840
	add	ebx, ebp
846
 
841
	mcall
847
	ret
842
	ret
848
 
-
 
849
; <--- initialised data --->
843
;------------------------------------------------------------------------------
850
DATA
844
; <--- initialised data --->
Line 851... Line 845...
851
 
845
DATA
852
	screenx 	dd	0
846
	screenx 	dd	0
Line 875... Line 869...
875
 
869
 
Line 876... Line 870...
876
	cursor  dd 32*32 dup(0x00000000)	; ¢á¥ à ¢­® ᮦ¬¥âáï
870
	cursor  dd 32*32 dup(0x00000000)	; ¢á¥ à ¢­® ᮦ¬¥âáï
877
 
871
 
878
	cursorVisible	dd	1
-
 
879
	cursorID	dd	0
-
 
-
 
872
	cursorVisible	dd	1
880
 
873
	cursorID	dd	0
881
 
874
;------------------------------------------------------------------------------
882
; <--- uninitialised data --->
-
 
883
UDATA
-
 
-
 
875
; <--- uninitialised data --->
884
 
876
UDATA
885
 
877
;------------------------------------------------------------------------------
-
 
878
MEOS_APP_END