Subversion Repositories Kolibri OS

Rev

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

Rev 1041 Rev 1068
Line 39... Line 39...
39
	dd	stacktop
39
        dd      stacktop
40
	dd	0x0
40
        dd      0x0
41
	dd	path
41
        dd      path
Line 42... Line 42...
42
 
42
 
-
 
43
include 'MACROS.INC'
43
include 'MACROS.INC'
44
include 'load_lib.mac'
44
;---------------------------------------------------------------------
45
;---------------------------------------------------------------------
45
;---	Start of program	----------------------------------------------
46
;---    Start of program        ----------------------------------------------
46
;---------------------------------------------------------------------
-
 
47
 
47
;---------------------------------------------------------------------
48
START:
48
START:
49
	mcall 68, 11
49
        mcall 68, 11
50
	mcall 66, 1, 1
50
        mcall 66, 1, 1
51
	mcall 40, 0x27
51
        mcall 40, 0x27
Line 54... Line 54...
54
	mcall	68,12,1024
54
        mcall   68,12,1024
55
	mov	[menu_data_1.procinfo],eax
55
        mov     [menu_data_1.procinfo],eax
56
	mov	[menu_data_2.procinfo],eax
56
        mov     [menu_data_2.procinfo],eax
57
;---------------------------------------------------------------------	
57
;---------------------------------------------------------------------  
58
; loading Box_Lib library 
58
; loading Box_Lib library 
-
 
59
load_libraries l_libs_start,end_l_libs
-
 
60
;sys_load_library  boxlib_name, path, file_name, system_dir, \
-
 
61
;er_message_found_lib, ihead_f_l, myimport, er_message_import, ihead_f_i
-
 
62
;        test    eax,eax
-
 
63
;        jnz  button.exit
-
 
64
 
-
 
65
;----------------------------------old
59
	mov	ebx,boxlib_name
66
;        mov     ebx,boxlib_name
60
	mov	esi,path
67
;        mov     esi,path
61
	mov	edi,file_name
68
;        mov     edi,file_name
62
	call	copy_path
69
;        call    copy_path
63
 
70
;
64
	mcall 68,19,file_name ; load of alternative
71
;        mcall 68,19,file_name ; load of alternative
65
	test	eax,eax
72
;        test    eax,eax
66
	jnz @f 
73
;        jnz @f 
67
	
74
;        
68
	mcall 68,19,system_dir ; load of sys directory
75
;        mcall 68,19,system_dir ; load of sys directory
69
	test	eax,eax
76
;        test    eax,eax
70
	jz	button.exit
77
;        jz      button.exit
71
@@:
78
;@@:
72
	call	import_boxlib
79
;        call    import_boxlib
73
;---------------------------------------------------------------------
80
;---------------------------------------------------------------------
74
; Load and convert BMP file for DinamicButton
81
; Load and convert BMP file for DinamicButton
75
; This procedures use cnv_bmp.obj and this module used only for
82
; This procedures use cnv_bmp.obj and this module used only for
76
; demonstration of use DinamicButton
83
; demonstration of use DinamicButton
77
;
-
 
78
 
-
 
79
	mov	ebx,plugin_BMP_name
-
 
80
	mov	esi,path
-
 
81
	mov	edi,file_name
-
 
82
	call	copy_path
-
 
Line -... Line 84...
-
 
84
 
-
 
85
;        mov     ebx,plugin_BMP_name
-
 
86
;        mov     esi,path
-
 
87
;        mov     edi,file_name
-
 
88
	copy_path   plugin_BMP_name,path,file_name
83
 
89
;
84
	mcall 68,19,file_name
90
        mcall 68,19,file_name
85
	test	eax,eax
91
        test    eax,eax
Line 86... Line 92...
86
	jz  button.exit
92
        jz  button.exit
87
	
93
        
Line -... Line 94...
-
 
94
        mov     eax,[eax+4]
-
 
95
        mov     [plugin],eax
-
 
96
 
-
 
97
 
-
 
98
;ïðîâåðêà íà ñêîëüêî óäà÷íî çàãóçèëàñü íàøà ëèáà
-
 
99
        mov     ebp,library01
-
 
100
        cmp     dword [ebp+ll_struc_size-4],0
-
 
101
        jnz     button.exit
-
 
102
;
-
 
103
;        mov     ebp,library02
-
 
104
;        cmp     dword [ebp+ll_struc_size-4],0x2
-
 
105
;        jnz     button.exit
-
 
106
;        mov     eax,dword [ebp+36]
-
 
107
;        mov     eax,[eax+4]
-
 
108
;        mov     [plugin],eax
88
	mov	eax,[eax+4]
109
        
89
	mov	[plugin],eax
110
 
90
	
111
 
91
	mov	ebx,icons_file_name
112
;        mov     ebx,icons_file_name
Line 92... Line 113...
92
	mov	esi,path
113
;        mov     esi,path
Line 93... Line 114...
93
	mov	edi,file_name
114
;        mov     edi,file_name
Line 342... Line 363...
342
	add	ebx,30
363
        add     ebx,30
343
	shl	ebx,16
364
        shl     ebx,16
344
	mov	bx,30
365
        mov     bx,30
345
	mcall 13, , , 0x0
366
        mcall 13, , , 0x0
346
	ret
367
        ret
347
;---------------------------------------------------------------------
-
 
348
copy_path:
-
 
349
	xor	eax,eax
-
 
350
@@:
-
 
351
	cld
-
 
352
	lodsb
-
 
353
	stosb
-
 
354
	test	eax,eax
-
 
355
	jnz	@b
-
 
356
	mov	esi,edi
-
 
357
@@:
-
 
358
	std
-
 
359
	lodsb
-
 
360
	cmp	al,'/'
-
 
361
	jnz	@b
-
 
362
	mov	edi,esi
-
 
363
	add	edi,2
-
 
364
	mov	esi,ebx
-
 
365
@@:
-
 
366
	cld
-
 
367
	lodsb
-
 
368
	stosb
-
 
369
	test	eax,eax
-
 
370
	jnz	@b
-
 
371
	ret
-
 
372
;---------------------------------------------------------------------
-
 
373
; Import procedure written by 
-
 
374
; Copyright (c) 2008, 2009,  
-
 
375
; All rights reserved.
-
 
376
; importing Box_lib entry
-
 
Line 377... Line -...
377
 
-
 
378
import_boxlib:
-
 
379
; initialize import
-
 
380
	mov		edx, eax
-
 
381
	mov		esi,myimport
-
 
382
.import_loop:
-
 
383
	lodsd
-
 
384
	test	 eax, eax
-
 
385
	jz		.import_done
-
 
386
	push	 edx
-
 
387
.import_find:
-
 
388
	mov		ebx, [edx]
-
 
389
	test	 ebx, ebx
-
 
390
	jz		.exit	;import_not_found
-
 
391
	push	 eax
-
 
392
@@:
-
 
393
	mov		cl, [eax]
-
 
394
	cmp		cl, [ebx]
-
 
395
	jnz		.import_find_next
-
 
396
	test	 cl, cl
-
 
397
	jz		.import_found
-
 
398
	inc		eax
-
 
399
	inc		ebx
-
 
400
	jmp		@b
-
 
401
.import_find_next:
-
 
402
	pop		eax
-
 
403
	add		edx, 8
-
 
404
	jmp		.import_find
-
 
405
.import_found:
-
 
406
	pop		eax
-
 
407
	mov		eax, [edx+4]
-
 
408
	mov		[esi-4], eax
-
 
409
	pop		edx
-
 
410
	jmp		.import_loop
-
 
411
.import_done:
-
 
412
	ret
-
 
413
.exit:
-
 
414
	add	esp,4
-
 
415
	jmp	 button.exit
-
 
416
;---------------------------------------------------------------------
368
 
417
include	'data.inc'
369
include 'data.inc'
418
include	'w_about.inc'
370
include 'w_about.inc'
419
IM_END:
371
IM_END:
420
	rb 1024
372
        rb 1024