Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
2185 IgorA 1
use32
2
	org 0x0
3
	db 'MENUET01' ;идентиф. исполняемого файла всегда 8 байт
4
	dd 0x1
5
	dd start
6
	dd i_end ;размер приложения
7
	dd mem,stacktop
8
	dd 0,cur_dir_path
9
 
10
include '../../../../../macros.inc'
11
include '../../../../../proc32.inc'
12
include '../../../../../develop/libraries/box_lib/load_lib.mac'
3105 IgorA 13
include '../../../../../dll.inc'
2185 IgorA 14
 
15
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
16
 
17
align 4
18
start:
19
	load_library vectors_name, cur_dir_path, library_path, system_path, \
20
		err_message_found_lib, head_f_l, import_buf2d_lib, err_message_import, head_f_i
21
	cmp eax,-1
22
	jz button.exit
23
 
24
	mcall 40,0x27
25
	stdcall [buf2d_create], buf_0 ;создаем буфер
26
	stdcall [buf2d_line], buf_0, 110, 20, 125, 90, 0xffff00 ;рисуем линию
27
	stdcall [buf2d_line], buf_0, 60, 120, 110, 20, 0xd000 ;рисуем линию
28
	stdcall [buf2d_curve_bezier], buf_0, (10 shl 16)+20,(110 shl 16)+10,(50 shl 16)+90, dword 0xff
29
	stdcall [buf2d_circle], buf_0, 125, 90, 30, 0xffffff ;рисуем окружность
30
	stdcall [buf2d_circle], buf_0, 25, 70, 15, 0xff0000 ;рисуем окружность
31
 
32
align 4
33
red_win:
34
	call draw_window
35
 
36
align 4
37
still:
38
	mcall 10
39
	cmp al,1 ;изменилось положение окна
40
	jz red_win
41
	cmp al,2
42
	jz key
43
	cmp al,3
44
	jz button
45
	jmp still
46
 
47
align 4
48
draw_window:
49
	pushad
50
	mcall 12,1
51
 
52
	;mov edx,0x32000000
53
	mov edx,0x33000000
54
	mcall 0,(50 shl 16)+330,(30 shl 16)+275,,,caption
55
 
56
	stdcall [buf2d_draw], buf_0
57
 
58
	mcall 12,2
59
	popad
60
	ret
61
 
62
align 4
63
key:
64
	mcall 2
65
 
66
	cmp ah,27 ;Esc
67
	je button.exit
68
 
69
	jmp still
70
 
71
align 4
72
button:
73
	mcall 17 ;получить код нажатой кнопки
74
	cmp ah,1
75
	jne still
76
.exit:
77
	stdcall [buf2d_delete],buf_0 ;удаляем буфер
78
	mcall -1 ;выход из программы
79
 
80
caption db 'Test buf2d library, [Esc] - exit',0
81
 
82
;--------------------------------------------------
83
align 4
84
import_buf2d_lib:
85
	dd sz_lib_init
86
	buf2d_create dd sz_buf2d_create
87
	buf2d_create_f_img dd sz_buf2d_create_f_img
88
	buf2d_clear dd sz_buf2d_clear
89
	buf2d_draw dd sz_buf2d_draw
90
	buf2d_delete dd sz_buf2d_delete
91
	buf2d_line dd sz_buf2d_line
92
	buf2d_circle dd sz_buf2d_circle
93
	buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
94
	buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
95
	buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
96
	buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
97
	buf2d_bit_blt dd sz_buf2d_bit_blt
98
	buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
99
	buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
100
	buf2d_curve_bezier dd sz_buf2d_curve_bezier
101
	buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
102
	buf2d_draw_text dd sz_buf2d_draw_text
103
	dd 0,0
104
	sz_lib_init db 'lib_init',0
105
	sz_buf2d_create db 'buf2d_create',0
106
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
107
	sz_buf2d_clear db 'buf2d_clear',0
108
	sz_buf2d_draw db 'buf2d_draw',0
109
	sz_buf2d_delete db 'buf2d_delete',0
110
	sz_buf2d_line db 'buf2d_line',0
111
	sz_buf2d_circle db 'buf2d_circle',0 ;рисование окружности
112
	sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
113
	sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
114
	sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
115
	sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
116
	sz_buf2d_bit_blt db 'buf2d_bit_blt',0
117
	sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
118
	sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
119
	sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
120
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
121
	sz_buf2d_draw_text db 'buf2d_draw_text',0
122
 
123
align 4
124
buf_0:
125
	dd 0 ;указатель на буфер изображения
126
	dw 20 ;+4 left
127
	dw 10 ;+6 top
128
	dd 160 ;+8 w
129
	dd 128 ;+12 h
130
	dd 0x80 ;+16 color
131
	db 24 ;+20 bit in pixel
132
 
133
;--------------------------------------------------
134
system_path db '/sys/lib/'
135
vectors_name db 'buf2d.obj',0
136
err_message_found_lib db 'Sorry I cannot load library buf2d.obj',0
137
head_f_i:
138
head_f_l db 'System error',0
139
err_message_import db 'Error on load import library buf2d.obj',0
140
;--------------------------------------------------
141
 
142
i_end: ;конец кода
143
	rb 1024
144
stacktop:
145
cur_dir_path:
146
	rb 4096
147
library_path:
148
	rb 4096
149
mem:
150