Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
386 mikedld 1
;=============================================================================
4915 mario79 2
; Kolibri Graphics Benchmark 0.81
3339 mario79 3
;--------------------------------------
386 mikedld 4
; MGB - Menuet Graphics Benchmark 0.3
5
; Compile with FASM
6
;
7
;=============================================================================
4915 mario79 8
; version:	0.81
9
; last update:  01/05/2014
10
; written by:   Marat Zakiyanov aka Mario79, aka Mario
11
; changes:      fix "benchmark GS selector" for some display sizes
12
;               (for example, 1366 by horizontal) and code optimization
13
;---------------------------------------------------------------------
3782 mario79 14
; version:	0.8
15
; last update:  08/07/2013
16
; written by:   Marat Zakiyanov aka Mario79, aka Mario
17
; changes:      benchmark f4 with memory + f65
18
;---------------------------------------------------------------------
3446 mario79 19
; version:	0.7
20
; last update:  05/04/2013
21
; written by:   Marat Zakiyanov aka Mario79, aka Mario
22
; changes:      benchmark GS selector - read screen area
23
;---------------------------------------------------------------------
3377 mario79 24
; version:	0.6
25
; last update:  14/03/2013
26
; written by:   Marat Zakiyanov aka Mario79, aka Mario
27
; changes:      benchmark f36 - read screen area
28
;---------------------------------------------------------------------
3339 mario79 29
; version:	0.5
30
; last update:  05/03/2013
31
; written by:   Marat Zakiyanov aka Mario79, aka Mario
32
; changes:      benchmark f73-blitter
33
;---------------------------------------------------------------------
1621 mario79 34
; version:	0.4
35
; last update:  18/09//2010
36
; written by:   Marat Zakiyanov aka Mario79, aka Mario
37
; changes:      select path with OpenDialog,
38
;               use of Box_Lib and Proc_Lib,
39
;               support start with path for *.mgb file
40
;               optimization code and size of use memory
41
;---------------------------------------------------------------------
386 mikedld 42
; Original author and copyrights holder:
43
;     Mikhail Lisovin a.k.a. Mihasik
44
;     lisovin@26.ru
45
;
46
; Disassembled with IDA 5.0.0.879:
47
;     http://www.datarescue.com/
48
; With use of 'ida.int' and 'kloader.ldw':
49
;     Eugene Grechnikov a.k.a. diamond
50
;     diamondz@land.ru
51
;     http://diamondz.land.ru/
52
;
53
; Modified for version 0.3:
54
;     Mike Semenako a.k.a mike.dld
55
;     mike.dld@gmail.com
56
;     http://www.mikedld.com/
57
;
58
;=============================================================================
59
 
60
org 0x0
61
use32
62
 
1621 mario79 63
	db 'MENUET01'
64
	dd 1
65
	dd start
66
	dd IM_END
67
	dd I_END	;0x200000
68
	dd stacktop	;0x07FFF0
69
	dd fname_buf
70
	dd cur_dir_path
386 mikedld 71
 
1702 Lrz 72
include '../../../config.inc'		;for nightbuild
485 heavyiron 73
include '..\..\..\macros.inc'
1621 mario79 74
include '..\..\..\proc32.inc'
3446 mario79 75
;include '..\..\..\debug.inc'
1621 mario79 76
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
77
include '../../../develop/libraries/box_lib/load_lib.mac'
3628 fedesco 78
include 'lang.inc'	;language support
1621 mario79 79
	@use_library
80
;---------------------------------------------------------------------
81
start:
82
	mcall	68,11
478 Ghost 83
 
3782 mario79 84
	mcall	68,12,8+9*6*38*4	; 7352
85
	mov	[text_scren_buffer],eax
86
 
87
	mcall	68,12,8+9*6*38*4	; 8216
88
	mov	[text_scren_buffer2],eax
89
 
1621 mario79 90
load_libraries l_libs_start,end_l_libs
386 mikedld 91
 
1621 mario79 92
	cmp	eax,-1
93
	jz	close
94
;---------------------------------------------------------------------
95
	mov	edi,filename_area
96
	mov	esi,start_temp_file_name
97
	call	copy_str_1
386 mikedld 98
 
1621 mario79 99
	mov	edi,comment_string_1
100
	mov	esi,aComment1
101
	call	copy_str_1
386 mikedld 102
 
1621 mario79 103
	mov	edi,comment_string_2
104
	mov	esi,aComment2
105
	call	copy_str_1
386 mikedld 106
 
1621 mario79 107
	mov	edi,fname_buf
108
	cmp	[edi],byte 0
109
	jne	@f
110
	mov	esi,path4
111
	call	copy_str_1
112
	jmp	.OpenDialog
113
@@:
114
	call	locLoadFile
3352 mario79 115
	xor	dword [wFlags],1
1621 mario79 116
.OpenDialog:
117
;OpenDialog	initialisation
3352 mario79 118
	push	dword OpenDialog_data
119
	call	[OpenDialog_Init]
1621 mario79 120
;---------------------------------------------------------------------
3943 mario79 121
	mcall	40,0x80000027
1621 mario79 122
red:
123
	call	draw_window
124
still:
125
	mcall	10
126
	cmp	eax,1
127
	jz	red
128
	cmp	eax,2
129
	jz	key
130
	cmp	eax,3
131
	jz	button
132
	jmp	still
133
;---------------------------------------------------------------------
134
copy_str_1:
135
	xor	eax,eax
136
	cld
137
@@:
138
	lodsb
139
	stosb
140
	test	eax,eax
141
	jnz	@b
142
	ret
143
;---------------------------------------------------------------------
144
key:
145
	mcall	2
146
	cmp	ah,'t'
147
	jz	ActionTest
148
	cmp	ah,'c'
149
	jz	ActionComment
150
	cmp	ah,'p'
151
	jz	ActionPattern
152
	cmp	ah,'o'
153
	jz	ActionOpen
154
	cmp	ah,'s'
155
	jz	ActionSave
156
	jmp	still
157
;---------------------------------------------------------------------
158
button:
159
	mcall	17
160
	cmp	ah,1
161
	jnz	NotClose
162
close:
163
	mcall	-1
164
NotClose:
165
	cmp	ah,2
166
	jnz	locNotTest
167
ActionTest:
168
	test	dword [wFlags],1
169
	jnz	still
170
	mcall	51,1,TestWndProc,thread_stack1
171
	jmp	still
172
;---------------------------------------------------------------------
173
locNotTest:
174
	cmp	ah,3
175
	jnz	NotComment
176
ActionComment:
177
	test	dword [wFlags],1
178
	jnz	still
179
	mcall	51,1,thread_comment,thread_stack2
180
	jmp	still
181
;---------------------------------------------------------------------
182
NotComment:
183
	cmp	ah,4
184
	jnz	NotPattern
185
ActionPattern:
186
	test	dword [wFlags],1
187
	jnz	still
188
	mov	esi,results_table
189
	cld
190
@@:
191
	lodsd
192
	mov	[esi],eax
193
	add	esi,TEST_REC_SIZE-4
194
	cmp	dword [esi+TEST_REC_SIZE-4],0
195
	jne	@b
196
	mov	esi,comment_string_1
197
	mov	edi,comment_string_2
198
	call	copy_str_1
199
	call	DrawBars
200
	jmp	still
201
;---------------------------------------------------------------------
202
NotPattern:
203
	cmp	ah,5
204
	jnz	NotOpen
205
ActionOpen:
206
	test	dword [wFlags],1
207
	jnz	still
208
	mov	[OpenDialog_data.type],0 ; open
209
	call	OpenDialog_Start_1
3352 mario79 210
	jne	still
1621 mario79 211
	call	locLoadFile
212
	call	DrawBars
213
.1:
3352 mario79 214
	xor	dword [wFlags],1
1621 mario79 215
	jmp	still
216
;---------------------------------------------------------------------
217
OpenDialog_Start_1:
218
	push    dword OpenDialog_data
3352 mario79 219
	call	[OpenDialog_Start]
1621 mario79 220
	cmp	[OpenDialog_data.status],1
221
	ret
222
;---------------------------------------------------------------------
223
NotOpen:
224
	cmp	ah,6
225
	jnz	still
226
ActionSave:
227
	test	dword [wFlags],1
228
	jnz	still
229
	mov	[OpenDialog_data.type],1 ; save
230
	call	OpenDialog_Start_1
3352 mario79 231
	jne	still
1621 mario79 232
	call	locSaveFile
233
	jmp	ActionOpen.1
234
;---------------------------------------------------------------------
235
TestWndProc:
3377 mario79 236
	mcall	68,12,90*123*3
237
	mov	[area_for_f36],eax
1621 mario79 238
	or	dword [wFlags],1
239
	mov	esi,results_table+8
240
align 4
241
.next_test:
242
	xor	edi,edi
243
	mcall	 26,9
244
	inc	eax
245
	mov	ecx,eax
246
	add	eax,100
247
	mov	[dwTestEndTime],eax
248
align 4
249
@@:
250
	mcall	 26
251
	cmp	eax,ecx
252
	jb	@r
253
align 4
254
@@:
3784 mario79 255
	push	esi edi
1621 mario79 256
	call	dword [esi]
3784 mario79 257
	pop	edi esi
1621 mario79 258
	inc	edi
259
	mcall	26,9
260
	cmp	eax,[dwTestEndTime]
261
	jb	@b
262
	mov	[esi-8],edi
386 mikedld 263
 
1621 mario79 264
	add	esi,TEST_REC_SIZE
5058 clevermous 265
	cmp	dword [esi], testDrawPicture_f73
266
	jnz	@f
267
	call	prepare_f73
268
@@:
1621 mario79 269
	cmp	dword [esi],0
270
	jnz	.next_test
3352 mario79 271
	xor	dword [wFlags],1
3377 mario79 272
	mcall	68,13,[area_for_f36]
5058 clevermous 273
	mcall	68,13,[params_f73.pointer]
1621 mario79 274
	mcall	-1
275
;---------------------------------------------------------------------
276
draw_window:
277
	mcall	12,1
278
	mcall	48,4
279
	mov	ebx,100*65536+72*5+14
280
	mov	ecx,80*65536+TESTS_NUM*LINE_HEIGHT+15+20+35
281
	add	cx,ax
282
	xor	eax,eax
283
	xor	esi,esi
284
	mcall	,,,34000000h,,aCaption
386 mikedld 285
 
1621 mario79 286
	mov	eax,8
287
	mov	ebx,050036h+12
288
	mov	ecx,5*65536+20
289
	mov	edx,2
290
	mov	esi,0x00007F7F
291
@@:
292
	mcall
293
	add	ebx,72*65536
294
	inc	edx
295
	cmp	edx,7
296
	jb	@r
386 mikedld 297
 
1621 mario79 298
	mov	ecx,31
299
	mov	edx,0x00007F7F
300
	mov	esi,(72*5)/2
301
	call	drawSeparator
386 mikedld 302
 
1621 mario79 303
	mcall	4,<27,12>,0x80DDEEFF,aButtonsText
304
	call	DrawBars
386 mikedld 305
 
1621 mario79 306
	mov	ecx,TESTS_NUM*LINE_HEIGHT+15+21
307
	mov	edx,0x00007F7F
308
	mov	esi,(72*5)/2
309
	call	drawSeparator
310
	mcall	12,2
311
	ret
312
;---------------------------------------------------------------------
313
drawSeparator:
314
	mov	eax,1
315
	mov	ebx,3
316
@@:
317
	mcall
318
	add	ebx,2
319
	dec	esi
320
	jnz	@b
321
	ret
322
;---------------------------------------------------------------------
323
align 4
324
testDrawWindow:
325
	xor	eax,eax
326
	mcall	,640145h,4F0190h,3000000h
327
	ret
328
;---------------------------------------------------------------------
329
align 4
330
testDrawBar:
331
	mcall	13,0A0064h,1E00FAh,6A73D0h
332
	ret
333
;---------------------------------------------------------------------
334
align 4
335
testDrawPicture:
3377 mario79 336
;	xor	ebx,ebx
337
	mcall	7,[area_for_f36],<90,123>,<15,33>
1621 mario79 338
	ret
339
;---------------------------------------------------------------------
5058 clevermous 340
prepare_f73:
341
	mcall	68,12,90*123*4
342
	mov	[params_f73.pointer], eax
343
	shr	ecx, 2
344
	mov	ebx, [area_for_f36]
345
@@:
346
	mov	edx, [ebx]
347
	and	edx, 0xFFFFFF
348
	mov	[eax], edx
349
	add	ebx, 3
350
	add	eax, 4
351
	dec	ecx
352
	jnz	@b
353
	ret
1621 mario79 354
align 4
3339 mario79 355
testDrawPicture_f73:
356
	xor	ebx,ebx
357
	mcall	73,,params_f73
358
	ret
359
;---------------------------------------------------------------------
360
align 4
3377 mario79 361
testGetScreen_f36:
362
	xor	ebx,ebx
363
	mcall	36,[area_for_f36],<90,123>,<15,33>
364
	ret
365
;---------------------------------------------------------------------
4915 mario79 366
GS_start_x = 15
367
GS_start_y = 33
368
GS_size_x = 90
369
GS_size_y = 123
370
;-----------------------------------------------------------------------------
3377 mario79 371
align 4
3446 mario79 372
testGetScreen_GS:
373
	push	edi
374
	mov	edi,[area_for_f36]
375
 
376
	mcall	61,2
377
	cmp	eax,24
378
	je	get_area_with_GS_24
379
;-----------------------------------------------------------------------------
380
align 4
3628 fedesco 381
get_area_with_GS_32:
4915 mario79 382
	mcall	61,3
383
	mov	ebx,eax
3446 mario79 384
 
4915 mario79 385
	mov	esi,GS_start_y
3446 mario79 386
	imul	esi,eax
3628 fedesco 387
 
4915 mario79 388
	mov	eax,GS_start_x
3446 mario79 389
	shl	eax,2
390
	add	esi,eax
391
 
4915 mario79 392
	mov	ebp,GS_size_x
393
	mov	eax,ebp
3446 mario79 394
	shl	eax,2
4915 mario79 395
	sub	ebx,eax
3628 fedesco 396
 
4915 mario79 397
	mov	edx,GS_size_y
3446 mario79 398
	sub	esi,ebx
399
;--------------------------------------
400
align 4
401
.start_y:
402
	add	esi,ebx
403
	mov	ecx,ebp
404
;--------------------------------------
405
align 4
3628 fedesco 406
.start_x:
3446 mario79 407
	mov	eax,[gs:esi]
408
	mov	[edi],eax
409
	add	esi,4
410
	add	edi,3
3628 fedesco 411
 
3446 mario79 412
        dec     ecx
413
        jnz     .start_x
3628 fedesco 414
 
3446 mario79 415
        dec     edx
416
        jnz     .start_y
3628 fedesco 417
 
3446 mario79 418
	pop	edi
419
	ret
420
;-----------------------------------------------------------------------------
421
align 4
3628 fedesco 422
get_area_with_GS_24:
4915 mario79 423
	mcall	61,3
424
	mov	ebx,eax
3628 fedesco 425
 
4915 mario79 426
	mov	esi,GS_start_y
3446 mario79 427
	imul	esi,eax
3628 fedesco 428
 
4915 mario79 429
	mov	eax,GS_start_x
3446 mario79 430
	lea	eax,[eax*3]
431
	add	esi,eax
3628 fedesco 432
 
4915 mario79 433
	mov	ebp,GS_size_x
434
	mov	eax,ebp
3446 mario79 435
	lea	eax,[eax*3]
4915 mario79 436
	sub	ebx,eax
3628 fedesco 437
 
4915 mario79 438
	mov	edx,GS_size_y
3446 mario79 439
	sub	esi,ebx
440
;--------------------------------------
441
align 4
442
.start_y:
443
	add	esi,ebx
444
	mov	ecx,ebp
445
;--------------------------------------
446
align 4
3628 fedesco 447
.start_x:
3446 mario79 448
	mov	eax,[gs:esi]
449
	mov	[edi],eax
450
	add	esi,3
451
	add	edi,3
452
 
453
        dec     ecx
454
        jnz     .start_x
3628 fedesco 455
 
3446 mario79 456
        dec     edx
457
        jnz     .start_y
458
 
459
	pop	edi
460
	ret
461
;-----------------------------------------------------------------------------
462
align 4
1621 mario79 463
testDrawVertLine:
464
	mcall	38,<300,300>,<30,380>,1090207Fh
465
	ret
466
;---------------------------------------------------------------------
467
align 4
468
testDrawHorzLine:
469
	mcall	38,<30,300>,<380,380>,1090207Fh
470
	ret
471
;---------------------------------------------------------------------
472
align 4
473
testDrawFreeLine:
474
	mcall	38,<30,300>,<380,30>,1090207Fh
475
	ret
476
;---------------------------------------------------------------------
477
align 4
478
testDrawText1:
3782 mario79 479
	mcall	4,<12,300>,0x0000AA66,aTestText,34
1621 mario79 480
	ret
481
;---------------------------------------------------------------------
482
align 4
3782 mario79 483
testDrawText1m:
484
	mov	eax,[text_scren_buffer]
485
	mov	[eax],dword 6*34
486
	mov	[eax+4],dword 9
487
	mcall	4,<0,0>,0x0800AA66,aTestText,34,[text_scren_buffer]
488
	xor	ebp,ebp
489
	mov	ebx,[text_scren_buffer]
490
	add	ebx,8
491
	mcall	65,,<6*34,9>,<18,309>,32
492
	ret
493
;---------------------------------------------------------------------
494
align 4
1621 mario79 495
testDrawText2:
3782 mario79 496
	mcall	4,<27,315>,0x10E7B850,aTestText,34
1621 mario79 497
	ret
498
;---------------------------------------------------------------------
499
align 4
3782 mario79 500
testDrawText2m:
501
	mov	eax,[text_scren_buffer2]
502
	mov	[eax],dword 6*38
503
	mov	[eax+4],dword 9
504
	mcall	4,<0,0>,0x18E7B850,aTestText,34,[text_scren_buffer2]
505
	xor	ebp,ebp
506
	mov	ebx,[text_scren_buffer2]
507
	add	ebx,8
508
	mcall	65,,<6*38,9>,<33,324>,32
509
	ret
510
;---------------------------------------------------------------------
511
align 4
1621 mario79 512
testDrawNumber:
3782 mario79 513
	mcall	47,0x80000,12345678,<42,333>,0x0E0B27B
1621 mario79 514
	ret
515
;---------------------------------------------------------------------
516
align 4
517
testDrawPixel:
518
	mcall	1,100,100,0FFFFFFh
519
	ret
520
;---------------------------------------------------------------------
521
DrawBars:
522
	mov	edi,results_table
523
	mov	ebx,30+7
524
.next_result:
525
	cmp	dword[edi+TEST_REC_SIZE-4],0
526
	je	.exit
386 mikedld 527
 
1621 mario79 528
	push	ebx
529
	movzx	ecx,bx
530
	add	ecx,-2
531
	shl	ecx,16
532
	mov	cx,LINE_HEIGHT
533
	mov	ebx,0*65536+72*5+5
534
	xor	edx,edx
535
	mcall	13
536
	pop	ebx
386 mikedld 537
 
1621 mario79 538
	and	ebx,0x0000FFFF
539
	or	ebx,5*65536
540
	mov	edx,[edi+TEST_REC_SIZE-4]
541
	mcall	4,,0x8000CCCC
386 mikedld 542
 
1621 mario79 543
	push	'=' 0x00FFFF00 0x00FFFF7F 0x00FFFF7F
544
	mov	eax,[edi+0]
545
	cmp	eax,[edi+4]
546
	je	@f
547
	jb	.lp1
548
	mov	dword[esp+0],0x007FFF7F
549
	mov	dword[esp+4],0x00FF7F7F
550
	mov	dword[esp+8],0x0000FF00
551
	mov	byte[esp+12],'>'
552
.lp1:
553
	ja	@f
554
	mov	dword[esp+0],0x00FF7F7F
555
	mov	dword[esp+4],0x007FFF7F
556
	mov	dword[esp+8],0x00FF0000
557
	mov	byte[esp+12],'<'
558
@@:
559
	pop	ecx
560
	call	int2str
561
	add	ebx,(72*5-6*8*2-6-10-5)*65536 ; 196
562
	mcall	4,,,textarea,8
386 mikedld 563
 
1621 mario79 564
	pop	ecx
565
	mov	eax,[edi+4]
566
	call	int2str
567
	add	ebx,(6*8+6+10)*65536
568
	mcall	4
386 mikedld 569
 
1621 mario79 570
	pop	ecx
571
	add	ebx,(-6-5)*65536
572
	mov	edx,esp
573
	mov	esi,1
574
	mcall
575
	add	esp,4
386 mikedld 576
 
1621 mario79 577
	add	edi,TEST_REC_SIZE
578
	add	bx,LINE_HEIGHT
579
	jmp	.next_result
580
.exit:
581
	mov	ebx, 0*65536+72*5+5
582
	mov	ecx, (TESTS_NUM*LINE_HEIGHT+15+25)*65536+26
583
	xor	edx, edx
584
	mcall	13
386 mikedld 585
 
1621 mario79 586
	mov	ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27)
587
	mcall	4,,0x8000CCCC,aLeft
386 mikedld 588
 
1621 mario79 589
	add	ebx, (6*10)*65536
590
	mcall	,,0x80FFFF00,comment_string_1
386 mikedld 591
 
1621 mario79 592
	mov	ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27+12)
593
	mcall	,,0x8000CCCC,aRight
386 mikedld 594
 
1621 mario79 595
	add	ebx, (6*10)*65536
596
	mcall	,,0x80FFFF00,comment_string_2
597
	ret
598
;---------------------------------------------------------------------
599
int2str:
600
	push	eax ecx edx edi
601
	mov	edi,textarea+7
602
	mov	dword[textarea+0],'    '
603
	mov	dword[textarea+4],'    '
604
	mov	ecx,10
605
@@:
606
	xor	edx,edx
607
	div	ecx
608
	add	dl,'0'
609
	mov	[edi],dl
610
	dec	edi
611
	or	eax,eax
612
	jnz	@b
613
	pop	edi edx ecx eax
614
	ret
615
;---------------------------------------------------------------------
616
thread_comment:
617
	or	dword [wFlags],1
3943 mario79 618
	mcall	40,0x80000027
1621 mario79 619
	mov	esi,comment_string_1
620
	cld
621
@@:
622
	lodsb
623
	test	al,al
624
	jne	@r
625
	sub	esi,comment_string_1
626
	mov	eax,esi
627
	dec	eax
628
	mov	edi, edit1
3352 mario79 629
	mov	[edi+48], eax	;ed_size
630
	mov	[edi+52], eax	;ed_pos
1621 mario79 631
;---------------------------------------------------------------------
632
.red:
633
	call .draw_window
634
.still:
635
	mcall	10	; wait here for event
636
	cmp	eax,1	; redraw request ?
637
	je	.red
638
	cmp	eax,2	; key in buffer ?
639
	je	.key
640
	cmp	eax,3	; button in buffer ?
641
	je	.button
386 mikedld 642
 
3352 mario79 643
	push	dword name_editboxes
644
	call	[edit_box_mouse]
1621 mario79 645
	jmp	.still
646
;---------------------------------------------------------------------
647
.key:		; key
648
	mcall	2
649
	cmp	ah,13
650
	je	.close	;.close_with_open_file
651
	cmp	ah,27
652
	je	.close
3628 fedesco 653
 
3352 mario79 654
	push	dword name_editboxes
655
	call	[edit_box_key]
1621 mario79 656
	jmp	.still
657
;---------------------------------------------------------------------
658
.button:		; button
659
	mcall	17
660
	cmp	ah,1	; button id=1 ?
661
	jne	.still
662
.close:
3352 mario79 663
	xor	dword [wFlags],1
1621 mario79 664
	mcall	-1
665
;---------------------------------------------------------------------
666
.draw_window:
667
	mcall	12,1
668
	xor	eax,eax
669
	xor	esi,esi
670
	mcall	,<100,300>,<100,80>,0x34780078,,aComment
3352 mario79 671
	push	dword name_editboxes
672
	call	[edit_box_draw]
1621 mario79 673
	mcall	12,2
674
	ret
675
;---------------------------------------------------------------------
676
locLoadFile:
677
	mov	[stFileInfoBlock], 0
678
	or	dword [wFlags],1
679
	mcall	70,stFileInfoBlock
680
	mov	esi,mgb_data
681
	mov	edi,results_table+4
682
	cld
683
@@:
684
	cmp	dword[edi+TEST_REC_SIZE-8],0
685
	je	@f
686
	movsd
687
	add	edi,TEST_REC_SIZE-4
688
	jmp	@b
689
@@:
690
	mov	edi,comment_string_2
691
	mov	ecx,44
692
	rep	movsb
693
	ret
694
;---------------------------------------------------------------------
695
locSaveFile:
696
	mov	[stFileInfoBlock], 2
697
	or	dword [wFlags],1
698
	mov	esi,results_table+4
699
	mov	edi,mgb_data
700
	cld
701
@@:
702
	cmp	dword[esi+TEST_REC_SIZE-8],0
703
	je	@f
704
	movsd
705
	add	esi,TEST_REC_SIZE-4
706
	jmp	@b
707
@@:
708
	mov	esi,comment_string_2
709
	mov	ecx,44
710
	rep	movsb
711
	mcall	70,stFileInfoBlock
712
	ret
713
;---------------------------------------------------------------------
714
align 4
715
stFileInfoBlock dd 0,0,0
716
dwDataSize	dd TESTS_NUM*4+44	;1
717
		dd mgb_data
718
		db 0
719
		dd fname_buf
720
;---------------------------------------------------------------------
721
wFlags		dd 0
722
;---------------------------------------------------------------------
723
align 4
724
results_table dd \
3352 mario79 725
	?,?,testDrawWindow,aDrawingWindow,\
726
	?,?,testDrawBar,aDrawingBar,\
3377 mario79 727
	?,?,testGetScreen_f36,aGetScreenF36,\
3446 mario79 728
	?,?,testGetScreen_GS,aGetScreen_GS,\
3352 mario79 729
	?,?,testDrawPicture,aDrawingPicture,\
730
	?,?,testDrawPicture_f73,aDrawingPictF73,\
731
	?,?,testDrawVertLine,aDrawingVLine,\
732
	?,?,testDrawHorzLine,aDrawingHLine,\
733
	?,?,testDrawFreeLine,aDrawingFLine,\
734
	?,?,testDrawText1,aDrawingText1,\
3782 mario79 735
	?,?,testDrawText1m,aDrawingText1m,\
3352 mario79 736
	?,?,testDrawText2,aDrawingText2,\
3782 mario79 737
	?,?,testDrawText2m,aDrawingText2m,\
3352 mario79 738
	?,?,testDrawNumber,aDrawingNumber,\
739
	?,?,testDrawPixel,aDrawingPixel,\
740
	0,0,0,0
1621 mario79 741
;---------------------------------------------------------------------
742
LINE_HEIGHT   = 13
743
TEST_REC_SIZE = 16
744
TESTS_NUM     = ($ - results_table) / TEST_REC_SIZE - 1
745
;---------------------------------------------------------------------
3628 fedesco 746
if lang eq it
747
	aDrawingWindow	db 'Window Of Type #3, 325x400 px',0
748
	aDrawingBar	db 'Filled Rectangle, 100x250 px',0
749
	aDrawingPicture db 'Picture, 90x123, px',0
750
	aDrawingPictF73	db 'Picture for Blitter, 90x123, px',0
751
	aGetScreenF36	db 'Get a piece of screen f.36, 90x123, px',0
752
	aGetScreen_GS	db 'Get a piece of screen GS, 90x123, px',0
753
	aDrawingVLine	db 'Linea verticale, 350 px',0
754
	aDrawingHLine	db 'Linea orizzontale, 270 px',0
755
	aDrawingFLine	db 'Free-angled Line, 350 px',0
756
	aDrawingText1	db 'Fixed-width Text, 34 chars',0
3782 mario79 757
	aDrawingText1m	db 'Fixed-width Text(m), 34 chars',0
3628 fedesco 758
	aDrawingText2	db 'Proportional Text, 34 chars',0
3782 mario79 759
	aDrawingText2m	db 'Proportional Text(m), 34 chars',0
3628 fedesco 760
	aDrawingNumber	db 'Decimal Number, 8 digits',0
761
	aDrawingPixel	db 'Singolo pixel',0
386 mikedld 762
 
3628 fedesco 763
	aTestText	db 'This is a 34-charachters test text'
764
	aButtonsText	db 'Test      Commenti    Pattern+     Apri        Salva',0
4915 mario79 765
	aCaption	db 'Kolibri Graphical Benchmark 0.81',0
386 mikedld 766
 
3628 fedesco 767
	aLeft	db 'Sinistra:',0
768
	aRight	db 'Destra  :',0
386 mikedld 769
 
3628 fedesco 770
	aComment1	db 'Attuale ',0
771
	aComment2	db 'no pattern',0
772
	aComment	db 'Commento',0
773
else
774
	aDrawingWindow	db 'Window Of Type #3, 325x400 px',0
775
	aDrawingBar	db 'Filled Rectangle, 100x250 px',0
776
	aDrawingPicture db 'Picture, 90x123, px',0
777
	aDrawingPictF73	db 'Picture for Blitter, 90x123, px',0
778
	aGetScreenF36	db 'Get a piece of screen f.36, 90x123, px',0
779
	aGetScreen_GS	db 'Get a piece of screen GS, 90x123, px',0
780
	aDrawingVLine	db 'Vertical Line, 350 px',0
781
	aDrawingHLine	db 'Horizontal Line, 270 px',0
782
	aDrawingFLine	db 'Free-angled Line, 350 px',0
783
	aDrawingText1	db 'Fixed-width Text, 34 chars',0
3782 mario79 784
	aDrawingText1m	db 'Fixed-width Text(m), 34 chars',0
3628 fedesco 785
	aDrawingText2	db 'Proportional Text, 34 chars',0
3782 mario79 786
	aDrawingText2m	db 'Proportional Text(m), 34 chars',0
3628 fedesco 787
	aDrawingNumber	db 'Decimal Number, 8 digits',0
788
	aDrawingPixel	db 'Single Pixel',0
789
 
790
	aTestText	db 'This is a 34-charachters test text'
791
	aButtonsText	db 'Test      Comment+    Pattern+      Open        Save',0
4915 mario79 792
	aCaption	db 'Kolibri Graphical Benchmark 0.81',0
3628 fedesco 793
 
794
	aLeft	db 'Left    :',0
795
	aRight	db 'Right   :',0
796
 
797
	aComment1	db 'current',0
798
	aComment2	db 'no pattern',0
799
	aComment	db 'Comment',0
800
end if
1621 mario79 801
;---------------------------------------------------------------------
802
system_dir_Boxlib	db '/sys/lib/box_lib.obj',0
803
system_dir_ProcLib	db '/sys/lib/proc_lib.obj',0
804
;---------------------------------------------------------------------
805
head_f_i:
3628 fedesco 806
if lang eq it
807
	head_f_l	db 'Errore Sistema',0
808
else
809
	head_f_l	db 'System error',0
810
end if
386 mikedld 811
 
1621 mario79 812
err_message_found_lib1	db 'box_lib.obj - Not found!',0
813
err_message_found_lib2	db 'proc_lib.obj - Not found!',0
386 mikedld 814
 
1621 mario79 815
err_message_import1	db 'box_lib.obj - Wrong import!',0
816
err_message_import2	db 'proc_lib.obj - Wrong import!',0
817
;---------------------------------------------------------------------
818
align 4
819
l_libs_start:
386 mikedld 820
 
1621 mario79 821
library01  l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
822
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
386 mikedld 823
 
1621 mario79 824
library02  l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
825
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
386 mikedld 826
 
1621 mario79 827
end_l_libs:
828
;---------------------------------------------------------------------
829
align 4
830
OpenDialog_data:
831
.type			dd 1	; Save
832
.procinfo		dd procinfo	;+4
833
.com_area_name		dd communication_area_name	;+8
834
.com_area		dd 0	;+12
835
.opendir_pach		dd temp_dir_pach	;+16
836
.dir_default_pach	dd communication_area_default_pach	;+20
837
.start_path		dd open_dialog_path	;+24
838
.draw_window		dd draw_window	;+28
839
.status			dd 0	;+32
840
.openfile_pach 		dd fname_buf	;+36
841
.filename_area		dd filename_area	;+40
842
.filter_area		dd Filter
843
.x:
844
.x_size			dw 420 ;+48 ; Window X size
845
.x_start		dw 10 ;+50 ; Window X position
846
.y:
847
.y_size			dw 320 ;+52 ; Window y size
848
.y_start		dw 10 ;+54 ; Window Y position
386 mikedld 849
 
1621 mario79 850
communication_area_name:
851
	db 'FFFFFFFF_open_dialog',0
852
open_dialog_path:
1702 Lrz 853
if __nightbuild eq yes
3352 mario79 854
	db '/sys/MANAGERS/opendial',0
1702 Lrz 855
else
3352 mario79 856
	db '/sys/File Managers/opendial',0
1702 Lrz 857
end if
1621 mario79 858
communication_area_default_pach:
859
	db '/rd0/1/',0
386 mikedld 860
 
1621 mario79 861
Filter:
862
dd	Filter.end - Filter
863
.1:
864
db	'MGB',0
865
.end:
866
db	0
386 mikedld 867
 
1621 mario79 868
start_temp_file_name:	db 'pattern.mgb',0
386 mikedld 869
 
1621 mario79 870
path4	db '/rd/1/pattern.mgb',0
871
;---------------------------------------------------------------------
386 mikedld 872
align 4
3339 mario79 873
params_f73:
874
; destination
875
.offset_X_dest	dd 0	; +0
876
.offset_Y_dest	dd 0	; +4
877
.width_dest	dd 90	; +8
878
.height_dest	dd 123	; +12
879
; source
880
.offset_X_src	dd 0	; +16
881
.offset_Y_src	dd 0	; +20
882
.width_src	dd 90	; +24
883
.height_src	dd 123	; +28
884
; other
885
.pointer	dd 0	; 90*4	; +32
886
.row_size	dd 90*4	; +36
887
;---------------------------------------------------------------------
888
align 4
1621 mario79 889
ProcLib_import:
890
OpenDialog_Init		dd aOpenDialog_Init
891
OpenDialog_Start	dd aOpenDialog_Start
892
;OpenDialog__Version	dd aOpenDialog_Version
3352 mario79 893
	dd 0
894
	dd 0
1621 mario79 895
aOpenDialog_Init	db 'OpenDialog_init',0
896
aOpenDialog_Start	db 'OpenDialog_start',0
897
;aOpenDialog_Version	db 'Version_OpenDialog',0
898
;---------------------------------------------------------------------
899
align 4
3628 fedesco 900
Box_lib_import:
1621 mario79 901
;init_lib		dd a_init
902
;version_lib		dd a_version
386 mikedld 903
 
904
 
1621 mario79 905
edit_box_draw		dd aEdit_box_draw
906
edit_box_key		dd aEdit_box_key
907
edit_box_mouse		dd aEdit_box_mouse
908
;version_ed		dd aVersion_ed
386 mikedld 909
 
1621 mario79 910
;check_box_draw		dd aCheck_box_draw
911
;check_box_mouse	dd aCheck_box_mouse
912
;version_ch		dd aVersion_ch
386 mikedld 913
 
1621 mario79 914
;option_box_draw	dd aOption_box_draw
915
;option_box_mouse	dd aOption_box_mouse
916
;version_op		dd aVersion_op
386 mikedld 917
 
1621 mario79 918
;scrollbar_ver_draw	dd aScrollbar_ver_draw
919
;scrollbar_ver_mouse	dd aScrollbar_ver_mouse
920
;scrollbar_hor_draw	dd aScrollbar_hor_draw
921
;scrollbar_hor_mouse	dd aScrollbar_hor_mouse
922
;version_scrollbar	dd aVersion_scrollbar
386 mikedld 923
 
1621 mario79 924
;dinamic_button_draw	dd aDbutton_draw
925
;dinamic_button_mouse	dd aDbutton_mouse
926
;version_dbutton	dd aVersion_dbutton
386 mikedld 927
 
1621 mario79 928
;menu_bar_draw		dd aMenu_bar_draw
929
;menu_bar_mouse		dd aMenu_bar_mouse
930
;menu_bar_activate	dd aMenu_bar_activate
931
;version_menu_bar	dd aVersion_menu_bar
478 Ghost 932
 
1621 mario79 933
;FileBrowser_draw	dd aFileBrowser_draw
934
;FileBrowser_mouse	dd aFileBrowser_mouse
935
;FileBrowser_key	dd aFileBrowser_key
936
;Version_FileBrowser	dd aVersion_FileBrowser
478 Ghost 937
 
1621 mario79 938
;PathShow_prepare	dd sz_PathShow_prepare
939
;PathShow_draw		dd sz_PathShow_draw
940
;Version_path_show	dd szVersion_path_show
941
			dd 0
942
			dd 0
478 Ghost 943
 
1621 mario79 944
;a_init			db 'lib_init',0
945
;a_version		db 'version',0
386 mikedld 946
 
1621 mario79 947
aEdit_box_draw		db 'edit_box',0
948
aEdit_box_key		db 'edit_box_key',0
949
aEdit_box_mouse		db 'edit_box_mouse',0
950
;aVersion_ed		db 'version_ed',0
386 mikedld 951
 
1621 mario79 952
;aCheck_box_draw	db 'check_box_draw',0
953
;aCheck_box_mouse	db 'check_box_mouse',0
954
;aVersion_ch		db 'version_ch',0
386 mikedld 955
 
1621 mario79 956
;aOption_box_draw	db 'option_box_draw',0
957
;aOption_box_mouse	db 'option_box_mouse',0
958
;aVersion_op		db 'version_op',0
386 mikedld 959
 
1621 mario79 960
;aScrollbar_ver_draw	db 'scrollbar_v_draw',0
961
;aScrollbar_ver_mouse	db 'scrollbar_v_mouse',0
962
;aScrollbar_hor_draw	db 'scrollbar_h_draw',0
963
;aScrollbar_hor_mouse	db 'scrollbar_h_mouse',0
964
;aVersion_scrollbar	db 'version_scrollbar',0
386 mikedld 965
 
1621 mario79 966
;aDbutton_draw		db 'dbutton_draw',0
967
;aDbutton_mouse		db 'dbutton_mouse',0
968
;aVersion_dbutton	db 'version_dbutton',0
386 mikedld 969
 
1621 mario79 970
;aMenu_bar_draw		db 'menu_bar_draw',0
971
;aMenu_bar_mouse		db 'menu_bar_mouse',0
972
;aMenu_bar_activate	db 'menu_bar_activate',0
973
;aVersion_menu_bar	db 'version_menu_bar',0
386 mikedld 974
 
1621 mario79 975
;aFileBrowser_draw	db 'FileBrowser_draw',0
976
;aFileBrowser_mouse	db 'FileBrowser_mouse',0
977
;aFileBrowser_key	db 'FileBrowser_key',0
978
;aVersion_FileBrowser	db 'version_FileBrowser',0
386 mikedld 979
 
1621 mario79 980
;sz_PathShow_prepare	db 'PathShow_prepare',0
981
;sz_PathShow_draw	db 'PathShow_draw',0
982
;szVersion_path_show	db 'version_PathShow',0
983
;---------------------------------------------------------------------
984
; for EDITBOX
985
align 4
986
name_editboxes:
987
edit1 edit_box 200,10,30,0xffffff,0xbbddff,0,0,0,255,comment_string_1,mouse_dd,ed_focus+ed_always_focus,0
988
name_editboxes_end:
989
;---------------------------------------------------------------------
386 mikedld 990
 
1621 mario79 991
IM_END:
3377 mario79 992
align 4
1621 mario79 993
mouse_dd	rd 1
3377 mario79 994
area_for_f36	rd 1
995
dwTestEndTime	rd 1
996
dwMainPID	rd 1
3446 mario79 997
;-----------------------------------------------------------------------------
3782 mario79 998
text_scren_buffer	rd 1
999
text_scren_buffer2	rd 1
1000
;---------------------------------------------------------------------
1621 mario79 1001
textarea:
1002
	rb 8
1003
;---------------------------------------------------------------------
1004
comment_string_1:
1005
	rb 44
1006
;---------------------------------------------------------------------
1007
comment_string_2:
1008
	rb 44
1009
;---------------------------------------------------------------------
1010
mgb_data:
1011
	rb 100
1012
;---------------------------------------------------------------------
1013
procinfo:
1014
	rb 1024
1015
;---------------------------------------------------------------------
1016
cur_dir_path:
1017
	rb 4096
1018
;---------------------------------------------------------------------
1019
library_path:
1020
	rb 4096
1021
;---------------------------------------------------------------------
1022
temp_dir_pach:
1023
	rb 4096
1024
;---------------------------------------------------------------------
1025
fname_buf:
1026
	rb 4096
1027
;---------------------------------------------------------------------
1028
filename_area:
1029
	rb 256
1030
;---------------------------------------------------------------------
3782 mario79 1031
align 4
1621 mario79 1032
	rb 4096
1033
thread_stack2:
1034
;---------------------------------------------------------------------
3782 mario79 1035
align 4
1621 mario79 1036
	rb 4096
1037
thread_stack1:
1038
;---------------------------------------------------------------------
3782 mario79 1039
align 4
1621 mario79 1040
	rb 4096
3339 mario79 1041
	rb 0x2884	; for F73 image size 123*90*4
1621 mario79 1042
stacktop:
3628 fedesco 1043
I_END: