Subversion Repositories Kolibri OS

Rev

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

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