Subversion Repositories Kolibri OS

Rev

Rev 2974 | Rev 5388 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2974 Rev 3969
1
use32
1
use32
2
	org 0x0
2
	org 0x0
3
	db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
3
	db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
4
	dd 0x1
4
	dd 0x1
5
	dd start
5
	dd start
6
	dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
6
	dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
7
	dd mem
7
	dd mem
8
	dd stacktop
8
	dd stacktop
9
	dd 0
9
	dd 0
10
	dd sys_path
10
	dd sys_path
11
 
11
 
12
include '../../../../programs/macros.inc'
12
include '../../../../programs/macros.inc'
13
include '../../../../programs/proc32.inc'
13
include '../../../../programs/proc32.inc'
14
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
14
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
15
include '../trunk/mem.inc'
-
 
16
include '../trunk/dll.inc'
15
include '../../../../programs/dll.inc'
17
include '../trunk/vox_draw.inc'
16
include '../trunk/vox_draw.inc'
-
 
17
include '../trunk/vox_rotate.inc'
18
 
18
 
19
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
19
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
20
caption db 'Voxel mover 13.09.12',0 ;¯®¤¯¨áì ®ª­ 
20
caption db 'Voxel mover 13.09.12',0 ;¯®¤¯¨áì ®ª­ 
21
 
21
 
22
struct FileInfoBlock
22
struct FileInfoBlock
23
	Function dd ?
23
	Function dd ?
24
	Position dd ?
24
	Position dd ?
25
	Flags	 dd ?
25
	Flags	 dd ?
26
	Count	 dd ?
26
	Count	 dd ?
27
	Buffer	 dd ?
27
	Buffer	 dd ?
28
		db ?
28
		db ?
29
	FileName dd ?
29
	FileName dd ?
30
ends
30
ends
31
 
31
 
32
run_file_70 FileInfoBlock
32
run_file_70 FileInfoBlock
33
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
33
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
34
 
34
 
35
fn_toolbar db 'toolbar_m.png',0
35
fn_toolbar db 'toolbar_m.png',0
36
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
36
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
37
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*18
37
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*18
38
image_data_toolbar dd 0
38
image_data_toolbar dd 0
39
 
39
 
40
;§­ ç¥­¨ï § ¤ ¢ ¥¬ë¥ ¯® 㬮«ç ­¨î, ¡¥§ ini ä ©« 
40
;§­ ç¥­¨ï § ¤ ¢ ¥¬ë¥ ¯® 㬮«ç ­¨î, ¡¥§ ini ä ©« 
41
ini_def_window_t equ 10
41
ini_def_window_t equ 10
42
ini_def_window_l equ 10
42
ini_def_window_l equ 10
43
ini_def_window_w equ 550
43
ini_def_window_w equ 550
44
ini_def_window_h equ 415
44
ini_def_window_h equ 415
45
ini_def_buf_w equ 198 ;=192+6
45
ini_def_buf_w equ 198 ;=192+6
46
ini_def_buf_h equ 231 ;=224+7
46
ini_def_buf_h equ 231 ;=224+7
47
ini_def_s_zoom equ 5
47
ini_def_s_zoom equ 5
48
ini_def_t_size equ 10
48
ini_def_t_size equ 10
49
ini_def_color_b equ 0xffffff
49
ini_def_color_b equ 0xffffff
50
;®¯¨á ­¨¥ ¯ à ¬ â஢ ¤«ï ini ä ©« 
50
;®¯¨á ­¨¥ ¯ à ¬ â஢ ¤«ï ini ä ©« 
51
ini_name db 'vox_mover.ini',0
51
ini_name db 'vox_mover.ini',0
52
ini_sec_window db 'Window',0
52
ini_sec_window db 'Window',0
53
key_window_t db 't',0
53
key_window_t db 't',0
54
key_window_l db 'l',0
54
key_window_l db 'l',0
55
key_window_w db 'w',0
55
key_window_w db 'w',0
56
key_window_h db 'h',0
56
key_window_h db 'h',0
57
key_buf_w db 'buf_w',0
57
key_buf_w db 'buf_w',0
58
key_buf_h db 'buf_h',0
58
key_buf_h db 'buf_h',0
59
ini_sec_options db 'Options',0
59
ini_sec_options db 'Options',0
60
key_s_zoom db 's_zoom',0
60
key_s_zoom db 's_zoom',0
61
key_t_size db 'tile_size',0
61
key_t_size db 'tile_size',0
62
key_f_size db 'file_size',0
62
key_f_size db 'file_size',0
63
key_col_b db 'c_background',0
63
key_col_b db 'c_background',0
64
 
64
 
65
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
65
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
66
	;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
66
	;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
67
	if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
67
	if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
68
		jmp @f
68
		jmp @f
69
			local .path_str
69
			local .path_str
70
			.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
70
			.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
71
			db 0
71
			db 0
72
		@@:
72
		@@:
73
		;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
73
		;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
74
		copy_path .path_str,[32],file_name,0x0
74
		copy_path .path_str,[32],file_name,0x0
75
	else
75
	else
76
		copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
76
		copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
77
	end if
77
	end if
78
 
78
 
79
	stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
79
	stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
80
	mov [buf],eax
80
	mov [buf],eax
81
 
81
 
82
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
82
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
83
	mov [run_file_70.Function], 0
83
	mov [run_file_70.Function], 0
84
	mov [run_file_70.Position], 0
84
	mov [run_file_70.Position], 0
85
	mov [run_file_70.Flags], 0
85
	mov [run_file_70.Flags], 0
86
	mov [run_file_70.Count], dword size
86
	mov [run_file_70.Count], dword size
87
	m2m [run_file_70.Buffer], [buf]
87
	m2m [run_file_70.Buffer], [buf]
88
	mov byte[run_file_70+20], 0
88
	mov byte[run_file_70+20], 0
89
	mov [run_file_70.FileName], file_name
89
	mov [run_file_70.FileName], file_name
90
	mov ebx,run_file_70
90
	mov ebx,run_file_70
91
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
91
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
92
	cmp ebx,0xffffffff
92
	cmp ebx,0xffffffff
93
	je @f
93
	je @f
94
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
94
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
95
		stdcall dword[img_decode], dword[buf],ebx,0
95
		stdcall dword[img_decode], dword[buf],ebx,0
96
		mov dword[image_data],eax
96
		mov dword[image_data],eax
97
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
97
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
98
		stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
98
		stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
99
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
99
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
100
		stdcall dword[img_destroy], dword[image_data]
100
		stdcall dword[img_destroy], dword[image_data]
101
	@@:
101
	@@:
102
}
102
}
103
 
103
 
104
OT_MAP_X  equ  0
104
OT_MAP_X  equ  0
105
OT_MAP_Y  equ  0
105
OT_MAP_Y  equ  0
106
OT_CAPT_X_COLOR equ  5 ;®âáâ㯠¤«ï ¯®¤¯¨á¨ 梥â 
106
OT_CAPT_X_COLOR equ  5 ;®âáâ㯠¤«ï ¯®¤¯¨á¨ 梥â 
107
OT_CAPT_Y_COLOR equ 30
107
OT_CAPT_Y_COLOR equ 30
108
PEN_MODE_NONE equ -1
108
PEN_MODE_NONE equ -1
109
PEN_MODE_CLEAR equ 0 ;०¨¬ áâ¨à ­¨ï
109
PEN_MODE_CLEAR equ 0 ;०¨¬ áâ¨à ­¨ï
110
PEN_MODE_SELECT_COLOR equ 2 ;०¨¬ ¢ë¡®à  梥â 
110
PEN_MODE_SELECT_COLOR equ 2 ;०¨¬ ¢ë¡®à  梥â 
111
 
111
 
112
align 4
112
align 4
113
start:
113
start:
114
	load_libraries l_libs_start,l_libs_end
114
	load_libraries l_libs_start,l_libs_end
115
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
115
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
116
	mov	ebp,lib_2
116
	mov	ebp,lib_2
117
	cmp	dword [ebp+ll_struc_size-4],0
117
	cmp	dword [ebp+ll_struc_size-4],0
118
	jz	@f
118
	jz	@f
119
		mcall -1 ;exit not correct
119
		mcall -1 ;exit not correct
120
	@@:
120
	@@:
121
	mcall 48,3,sc,sizeof.system_colors
121
	mcall 48,3,sc,sizeof.system_colors
122
	mcall 40,0x27
122
	mcall 40,0x27
123
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
123
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
124
 
124
 
125
;--- load ini file ---
125
;--- load ini file ---
126
	copy_path ini_name,sys_path,file_name,0
126
	copy_path ini_name,sys_path,file_name,0
127
	;window startup pozition
127
	;window startup pozition
128
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
128
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
129
	mov word[wnd_s_pos+2],ax
129
	mov word[wnd_s_pos+2],ax
130
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
130
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
131
	mov word[wnd_s_pos],ax
131
	mov word[wnd_s_pos],ax
132
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
132
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
133
	mov word[wnd_s_pos+6],ax
133
	mov word[wnd_s_pos+6],ax
134
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
134
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
135
	mov word[wnd_s_pos+4],ax
135
	mov word[wnd_s_pos+4],ax
136
	;image buffer size
136
	;image buffer size
137
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_w,ini_def_buf_w
137
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_w,ini_def_buf_w
138
	mov [buf_0.w],eax
138
	mov [buf_0.w],eax
139
	mov [buf_0z.w],eax
139
	mov [buf_0z.w],eax
140
	add ax,15
140
	add ax,15
141
	mov [buf_pl.l],ax ;®âáâ㯠¤«ï ¯à ¢®£® ®ª­ 
141
	mov [buf_pl.l],ax ;®âáâ㯠¤«ï ¯à ¢®£® ®ª­ 
142
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_h,ini_def_buf_h
142
	stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_h,ini_def_buf_h
143
	mov [buf_0.h],eax
143
	mov [buf_0.h],eax
144
	mov [buf_0z.h],eax
144
	mov [buf_0z.h],eax
145
	;梥â ä®­ 
145
	;梥â ä®­ 
146
	stdcall dword[ini_get_color],file_name,ini_sec_window,key_col_b,ini_def_color_b
146
	stdcall dword[ini_get_color],file_name,ini_sec_window,key_col_b,ini_def_color_b
147
	mov [buf_0.color],eax
147
	mov [buf_0.color],eax
148
	mov [buf_pl.color],eax
148
	mov [buf_pl.color],eax
149
 
149
 
150
	;¬ áâ ¡, ¯®á«¥ ª®â®à®£® ¡ã¤¥â 㢥«¨ç¥­¨¥
150
	;¬ áâ ¡, ¯®á«¥ ª®â®à®£® ¡ã¤¥â 㢥«¨ç¥­¨¥
151
	stdcall dword[ini_get_int],file_name,ini_sec_options,key_s_zoom,ini_def_s_zoom
151
	stdcall dword[ini_get_int],file_name,ini_sec_options,key_s_zoom,ini_def_s_zoom
152
	mov [scaled_zoom],eax
152
	mov [scaled_zoom],eax
153
	;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á¥ç¥­¨ï
153
	;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á¥ç¥­¨ï
154
	stdcall dword[ini_get_int],file_name,ini_sec_options,key_t_size,ini_def_t_size
154
	stdcall dword[ini_get_int],file_name,ini_sec_options,key_t_size,ini_def_t_size
155
	mov [tile_size],eax
155
	mov [tile_size],eax
156
 
156
 
157
	stdcall dword[ini_get_int],file_name,ini_sec_options,key_f_size,64
157
	stdcall dword[ini_get_int],file_name,ini_sec_options,key_f_size,64
158
	shl eax,10
158
	shl eax,10
159
	mov [max_open_file_size],eax
159
	mov [max_open_file_size],eax
160
 
160
 
161
	mov ecx,[scaled_zoom]
161
	mov ecx,[scaled_zoom]
162
	xor eax,eax
162
	xor eax,eax
163
	inc eax
163
	inc eax
164
	shl eax,cl
164
	shl eax,cl
165
	imul eax,[tile_size]
165
	imul eax,[tile_size]
166
	mov [buf_pl.w],eax
166
	mov [buf_pl.w],eax
167
	add eax,[tile_size]
167
	add eax,[tile_size]
168
	mov [buf_pl.h],eax
168
	mov [buf_pl.h],eax
169
 
169
 
170
 
170
 
171
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
171
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
172
	stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
172
	stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
173
	stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
173
	stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
174
 
174
 
175
	stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
175
	stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
176
 
176
 
177
	load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
177
	load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
178
 
178
 
179
	stdcall mem.Alloc,[max_open_file_size]
179
	stdcall mem.Alloc,[max_open_file_size]
180
	mov dword[open_file_vox],eax
180
	mov dword[open_file_vox],eax
181
	stdcall mem.Alloc,[max_open_file_size]
181
	stdcall mem.Alloc,[max_open_file_size]
182
	mov dword[moved_file_vox],eax
182
	mov dword[moved_file_vox],eax
183
 
183
 
184
	stdcall but_new_file, [open_file_vox]
184
	stdcall but_new_file, [open_file_vox]
185
	stdcall but_new_file, [moved_file_vox]
185
	stdcall but_new_file, [moved_file_vox]
186
 
186
 
187
align 4
187
align 4
188
red_win:
188
red_win:
189
	call draw_window
189
	call draw_window
190
 
190
 
191
align 4
191
align 4
192
still:
192
still:
193
	mcall 10
193
	mcall 10
194
 
194
 
195
	cmp al,1
195
	cmp al,1
196
	jz red_win
196
	jz red_win
197
	cmp al,2
197
	cmp al,2
198
	jz key
198
	jz key
199
	cmp al,3
199
	cmp al,3
200
	jz button
200
	jz button
201
	cmp al,6
201
	cmp al,6
202
	jne @f
202
	jne @f
203
		mcall 9,procinfo,-1
203
		mcall 9,procinfo,-1
204
		cmp ax,word[procinfo+4]
204
		cmp ax,word[procinfo+4]
205
		jne @f ;®ª­® ­¥  ªâ¨¢­®
205
		jne @f ;®ª­® ­¥  ªâ¨¢­®
206
		call mouse
206
		call mouse
207
	@@:
207
	@@:
208
	jmp still
208
	jmp still
209
 
209
 
210
align 4
210
align 4
211
mouse:
211
mouse:
212
	pushad
212
	pushad
213
	mcall 37,2
213
	mcall 37,2
214
	bt eax,1 ;right button
214
	bt eax,1 ;right button
215
	jnc @f
215
	jnc @f
216
		mcall 37,1 ;get mouse coords
216
		mcall 37,1 ;get mouse coords
217
		mov ebx,eax
217
		mov ebx,eax
218
		shr ebx,16
218
		shr ebx,16
219
		and eax,0xffff
219
		and eax,0xffff
220
		stdcall get_buf_color, buf_0
220
		stdcall get_buf_color, buf_0
221
		stdcall get_buf_color, buf_pl
221
		stdcall get_buf_color, buf_pl
222
		jmp .end_f
222
		jmp .end_f
223
	@@:
223
	@@:
224
	bt eax,0 ;left button
224
	bt eax,0 ;left button
225
	jnc .end_f
225
	jnc .end_f
226
		mcall 37,1 ;get mouse coords
226
		mcall 37,1 ;get mouse coords
227
		mov ebx,eax
227
		mov ebx,eax
228
		shr ebx,16
228
		shr ebx,16
229
		and eax,0xffff
229
		and eax,0xffff
230
 
230
 
231
		push eax ebx
231
		push eax ebx
232
		mov edx,[v_zoom]
232
		mov edx,[v_zoom]
233
		cmp edx,[scaled_zoom]
233
		cmp edx,[scaled_zoom]
234
		jle @f
234
		jle @f
235
		;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
235
		;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
236
		sub edx,[scaled_zoom]
236
		sub edx,[scaled_zoom]
237
		sub ax,word[buf_0.t]
237
		sub ax,word[buf_0.t]
238
		sub bx,word[buf_0.l]
238
		sub bx,word[buf_0.l]
239
		stdcall get_mouse_ev_scale, buf_vox, ebx, eax, [scaled_zoom],edx
239
		stdcall get_mouse_ev_scale, buf_vox, ebx, eax, [scaled_zoom],edx
240
		cmp eax,0
240
		cmp eax,0
241
		je @f
241
		je @f
242
			mov ebx,eax
242
			mov ebx,eax
243
			and eax,0x3fffffff
243
			and eax,0x3fffffff
244
			rol ebx,2
244
			rol ebx,2
245
			and ebx,3
245
			and ebx,3
246
			dec ebx
246
			dec ebx
247
 
247
 
248
			shl ebx,2
248
			shl ebx,2
249
			add ebx,cam_x
249
			add ebx,cam_x
250
			mov dword[ebx],eax ;change [cam_x] or [cam_y] or [cam_z]
250
			mov dword[ebx],eax ;change [cam_x] or [cam_y] or [cam_z]
251
			call draw_objects
251
			call draw_objects
252
 
252
 
253
			pop ebx eax
253
			pop ebx eax
254
			jmp .end_f
254
			jmp .end_f
255
		@@:
255
		@@:
256
		pop ebx eax
256
		pop ebx eax
257
 
257
 
258
 
258
 
259
		;eax - mouse coord y
259
		;eax - mouse coord y
260
		;ebx - mouse coord x
260
		;ebx - mouse coord x
261
		movzx edx,word[buf_pl.t]
261
		movzx edx,word[buf_pl.t]
262
		add edx,OT_MAP_Y
262
		add edx,OT_MAP_Y
263
		cmp eax,edx
263
		cmp eax,edx
264
		jl .end_f
264
		jl .end_f
265
			sub eax,edx
265
			sub eax,edx
266
			xor edx,edx
266
			xor edx,edx
267
			mov ecx,[tile_size] ;H
267
			mov ecx,[tile_size] ;H
268
			div ecx
268
			div ecx
269
		movzx edx,word[buf_pl.l]
269
		movzx edx,word[buf_pl.l]
270
		add edx,OT_MAP_X
270
		add edx,OT_MAP_X
271
		cmp ebx,edx
271
		cmp ebx,edx
272
		jl .end_f
272
		jl .end_f
273
			call convert_y ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ âë y
273
			call convert_y ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ âë y
274
			cmp eax,0
274
			cmp eax,0
275
			jge .end_0 ;®£à ­¨ç¥­¨¥ ¯® ­¨¦­¥© ª®®à¤¨­ â¥ y
275
			jge .end_0 ;®£à ­¨ç¥­¨¥ ¯® ­¨¦­¥© ª®®à¤¨­ â¥ y
276
				cmp eax,-1
276
				cmp eax,-1
277
				jne .end_f
277
				jne .end_f
278
				;¬¥­ï¥¬ á¥ç¥­¨¥, ¯®¯ «¨ ­  ª¢ ¤à â¨ª
278
				;¬¥­ï¥¬ á¥ç¥­¨¥, ¯®¯ «¨ ­  ª¢ ¤à â¨ª
279
				sub ebx,edx
279
				sub ebx,edx
280
				mov eax,ebx
280
				mov eax,ebx
281
				xor edx,edx
281
				xor edx,edx
282
				mov ecx,[tile_size] ;W
282
				mov ecx,[tile_size] ;W
283
				div ecx
283
				div ecx
284
				mov [n_plane],eax
284
				mov [n_plane],eax
285
				jmp .end_1
285
				jmp .end_1
286
			.end_0:
286
			.end_0:
287
			mov [v_cur_y],eax ;Y-coord
287
			mov [v_cur_y],eax ;Y-coord
288
			sub ebx,edx
288
			sub ebx,edx
289
			mov eax,ebx
289
			mov eax,ebx
290
			xor edx,edx
290
			xor edx,edx
291
			mov ecx,[tile_size] ;W
291
			mov ecx,[tile_size] ;W
292
			div ecx
292
			div ecx
293
			mov [v_cur_x],eax ;X-coord
293
			mov [v_cur_x],eax ;X-coord
294
 
294
 
295
			.end_1:
295
			.end_1:
296
			call draw_objects
296
			call draw_objects
297
			call draw_pok
297
			call draw_pok
298
	.end_f:
298
	.end_f:
299
	popad
299
	popad
300
	ret
300
	ret
301
 
301
 
302
;input:
302
;input:
303
; eax - coord y
303
; eax - coord y
304
; ebx - coord x
304
; ebx - coord x
305
align 4
305
align 4
306
proc get_buf_color, buf:dword
306
proc get_buf_color, buf:dword
307
pushad
307
pushad
308
	mov edi,[buf]
308
	mov edi,[buf]
309
	cmp ax,buf2d_t
309
	cmp ax,buf2d_t
310
	jl .end_f
310
	jl .end_f
311
	sub ax,buf2d_t
311
	sub ax,buf2d_t
312
	cmp eax,buf2d_h
312
	cmp eax,buf2d_h
313
	jg .end_f
313
	jg .end_f
314
	cmp bx,buf2d_l
314
	cmp bx,buf2d_l
315
	jl .end_f
315
	jl .end_f
316
	sub bx,buf2d_l
316
	sub bx,buf2d_l
317
	cmp ebx,buf2d_w
317
	cmp ebx,buf2d_w
318
	jg .end_f
318
	jg .end_f
319
		stdcall [buf2d_get_pixel], edi,ebx,eax
319
		stdcall [buf2d_get_pixel], edi,ebx,eax
320
		mov [v_color],eax
320
		mov [v_color],eax
321
		call on_change_color ;®â®¡à ¦ ¥¬ ¨§¬¥­¥­¨ï 梥â 
321
		call on_change_color ;®â®¡à ¦ ¥¬ ¨§¬¥­¥­¨ï 梥â 
322
	.end_f:
322
	.end_f:
323
popad
323
popad
324
	ret
324
	ret
325
endp
325
endp
326
 
326
 
327
;¯à¥®¡à §®¢ë¢ ¥¬ ª®®à¤¨­ âã y (§­ ç¥­¨¥ ¤®«¦­® 㢥«¨ç¨¢ âìáï á ­¨§ã ¢¢¥àå)
327
;¯à¥®¡à §®¢ë¢ ¥¬ ª®®à¤¨­ âã y (§­ ç¥­¨¥ ¤®«¦­® 㢥«¨ç¨¢ âìáï á ­¨§ã ¢¢¥àå)
328
align 4
328
align 4
329
convert_y:
329
convert_y:
330
	push ecx edx
330
	push ecx edx
331
	mov ecx,[v_zoom]
331
	mov ecx,[v_zoom]
332
	cmp ecx,[scaled_zoom]
332
	cmp ecx,[scaled_zoom]
333
	jle @f
333
	jle @f
334
		mov ecx,[scaled_zoom]
334
		mov ecx,[scaled_zoom]
335
	@@:
335
	@@:
336
	mov edx,1
336
	mov edx,1
337
	cmp ecx,1
337
	cmp ecx,1
338
	jl @f
338
	jl @f
339
		shl edx,cl
339
		shl edx,cl
340
	@@:
340
	@@:
341
	sub edx,eax
341
	sub edx,eax
342
	dec edx
342
	dec edx
343
	mov eax,edx
343
	mov eax,edx
344
	pop edx ecx
344
	pop edx ecx
345
	ret
345
	ret
346
 
346
 
347
align 4
347
align 4
348
draw_window:
348
draw_window:
349
pushad
349
pushad
350
	mcall 12,1
350
	mcall 12,1
351
 
351
 
352
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
352
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
353
	mov edx,[sc.work]
353
	mov edx,[sc.work]
354
	or  edx,(3 shl 24)+0x30000000
354
	or  edx,(3 shl 24)+0x30000000
355
	mov edi,caption
355
	mov edi,caption
356
	mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4]
356
	mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4]
357
 
357
 
358
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
358
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
359
	mov eax,8
359
	mov eax,8
360
	mov ebx,(5 shl 16)+20
360
	mov ebx,(5 shl 16)+20
361
	mov ecx,(5 shl 16)+20
361
	mov ecx,(5 shl 16)+20
362
	mov edx,3
362
	mov edx,3
363
	mov esi,[sc.work_button]
363
	mov esi,[sc.work_button]
364
	int 0x40
364
	int 0x40
365
 
365
 
366
	mov ebx,(30 shl 16)+20
366
	mov ebx,(30 shl 16)+20
367
	mov edx,4
367
	mov edx,4
368
	int 0x40
368
	int 0x40
369
	add ebx,25 shl 16
369
	add ebx,25 shl 16
370
	mov edx,5
370
	mov edx,5
371
	int 0x40
371
	int 0x40
372
	add ebx,30 shl 16
372
	add ebx,30 shl 16
373
	mov edx,6
373
	mov edx,6
374
	int 0x40
374
	int 0x40
375
	add ebx,25 shl 16
375
	add ebx,25 shl 16
376
	mov edx,7
376
	mov edx,7
377
	int 0x40
377
	int 0x40
378
	add ebx,25 shl 16
378
	add ebx,25 shl 16
379
	mov edx,8
379
	mov edx,8
380
	int 0x40
380
	int 0x40
381
	add ebx,25 shl 16
381
	add ebx,25 shl 16
382
	mov edx,9
382
	mov edx,9
383
	int 0x40
383
	int 0x40
384
	add ebx,25 shl 16
384
	add ebx,25 shl 16
385
	mov edx,10
385
	mov edx,10
386
	int 0x40
386
	int 0x40
387
	add ebx,25 shl 16
387
	add ebx,25 shl 16
388
	mov edx,11
388
	mov edx,11
389
	int 0x40
389
	int 0x40
390
	add ebx,25 shl 16
390
	add ebx,25 shl 16
391
	mov edx,12
391
	mov edx,12
392
	int 0x40
392
	int 0x40
393
	add ebx,25 shl 16
393
	add ebx,25 shl 16
394
	mov edx,13
394
	mov edx,13
395
	int 0x40
395
	int 0x40
396
	add ebx,25 shl 16
396
	add ebx,25 shl 16
397
	mov edx,14
397
	mov edx,14
398
	int 0x40
398
	int 0x40
399
	add ebx,25 shl 16
399
	add ebx,25 shl 16
400
	mov edx,15
400
	mov edx,15
401
	int 0x40
401
	int 0x40
402
	add ebx,25 shl 16
402
	add ebx,25 shl 16
403
	mov edx,16
403
	mov edx,16
404
	int 0x40
404
	int 0x40
405
	add ebx,25 shl 16
405
	add ebx,25 shl 16
406
	mov edx,17
406
	mov edx,17
407
	int 0x40
407
	int 0x40
408
	add ebx,25 shl 16
408
	add ebx,25 shl 16
409
	mov edx,18
409
	mov edx,18
410
	int 0x40
410
	int 0x40
411
	add ebx,25 shl 16
411
	add ebx,25 shl 16
412
	mov edx,19
412
	mov edx,19
413
	int 0x40
413
	int 0x40
414
	add ebx,25 shl 16
414
	add ebx,25 shl 16
415
	mov edx,20
415
	mov edx,20
416
	int 0x40
416
	int 0x40
417
 
417
 
418
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
418
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
419
	mov eax,7
419
	mov eax,7
420
	mov ebx,[image_data_toolbar]
420
	mov ebx,[image_data_toolbar]
421
	mov ecx,(16 shl 16)+16
421
	mov ecx,(16 shl 16)+16
422
	mov edx,(7 shl 16)+7 ;icon new
422
	mov edx,(7 shl 16)+7 ;icon new
423
	int 0x40
423
	int 0x40
424
 
424
 
425
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
425
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
426
	add edx,(25 shl 16) ;icon open
426
	add edx,(25 shl 16) ;icon open
427
	int 0x40
427
	int 0x40
428
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
428
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
429
	add edx,(25 shl 16) ;icon save
429
	add edx,(25 shl 16) ;icon save
430
	int 0x40
430
	int 0x40
431
 
431
 
432
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
432
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
433
	add edx,(30 shl 16) ;㢥«¨ç. ¬ áèâ ¡
433
	add edx,(30 shl 16) ;㢥«¨ç. ¬ áèâ ¡
434
	int 0x40
434
	int 0x40
435
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
435
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
436
	add edx,(25 shl 16) ;㬥­ìè. ¬ áèâ ¡
436
	add edx,(25 shl 16) ;㬥­ìè. ¬ áèâ ¡
437
	int 0x40
437
	int 0x40
438
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
438
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
439
	add edx,(25 shl 16) ;¯®¢®à®â 1
439
	add edx,(25 shl 16) ;¯®¢®à®â 1
440
	int 0x40
440
	int 0x40
441
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
441
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
442
	add edx,(25 shl 16) ;¯®¢®à®â 2
442
	add edx,(25 shl 16) ;¯®¢®à®â 2
443
	int 0x40
443
	int 0x40
444
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
444
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
445
	add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠+
445
	add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠+
446
	int 0x40
446
	int 0x40
447
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
447
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
448
	add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠-
448
	add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠-
449
	int 0x40
449
	int 0x40
450
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
450
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
451
	add edx,(25 shl 16) ;®á¢¥é¥­¨¥
451
	add edx,(25 shl 16) ;®á¢¥é¥­¨¥
452
	int 0x40
452
	int 0x40
453
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
453
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
454
	add edx,(25 shl 16) ;७¤¥à 2*2
454
	add edx,(25 shl 16) ;७¤¥à 2*2
455
	int 0x40
455
	int 0x40
456
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
456
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
457
	add edx,(25 shl 16) ;
457
	add edx,(25 shl 16) ;
458
	int 0x40
458
	int 0x40
459
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
459
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
460
	add edx,(25 shl 16) ;
460
	add edx,(25 shl 16) ;
461
	int 0x40
461
	int 0x40
462
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
462
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
463
	add edx,(25 shl 16) ;
463
	add edx,(25 shl 16) ;
464
	int 0x40
464
	int 0x40
465
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
465
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
466
	add edx,(25 shl 16) ;
466
	add edx,(25 shl 16) ;
467
	int 0x40
467
	int 0x40
468
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
468
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
469
	add edx,(25 shl 16) ;
469
	add edx,(25 shl 16) ;
470
	int 0x40
470
	int 0x40
471
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
471
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
472
	add edx,(25 shl 16) ;
472
	add edx,(25 shl 16) ;
473
	int 0x40
473
	int 0x40
474
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
474
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
475
	add edx,(25 shl 16) ;
475
	add edx,(25 shl 16) ;
476
	int 0x40
476
	int 0x40
477
 
477
 
478
	; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
478
	; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
479
	call draw_objects
479
	call draw_objects
480
	call draw_pok
480
	call draw_pok
481
 
481
 
482
	mcall 12,2
482
	mcall 12,2
483
popad
483
popad
484
	ret
484
	ret
485
 
485
 
486
align 4
486
align 4
487
draw_pok:
487
draw_pok:
488
	mov eax,47
488
	mov eax,47
489
	mov ecx,[v_zoom]
489
	mov ecx,[v_zoom]
490
	mov ebx,(3 shl 16)+(1 shl 31)
490
	mov ebx,(3 shl 16)+(1 shl 31)
491
	mov edx,((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2
491
	mov edx,((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2
492
	mov esi,[sc.work_button_text]
492
	mov esi,[sc.work_button_text]
493
	or  esi,(1 shl 30)
493
	or  esi,(1 shl 30)
494
	mov edi,[sc.work_button]
494
	mov edi,[sc.work_button]
495
	int 0x40 ;¬ áèâ ¡
495
	int 0x40 ;¬ áèâ ¡
496
	mov ecx,[n_plane]
496
	mov ecx,[n_plane]
497
	add edx,115 shl 16 ;9
497
	add edx,115 shl 16 ;9
498
	int 0x40 ;­®¬¥à á¥ç¥­¨ï
498
	int 0x40 ;­®¬¥à á¥ç¥­¨ï
499
 
499
 
500
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
500
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
501
	mov dword[txt_curor.size],0
501
	mov dword[txt_curor.size],0
502
	mov eax,dword[v_cur_x]
502
	mov eax,dword[v_cur_x]
503
	mov edi,txt_curor.size
503
	mov edi,txt_curor.size
504
	call convert_int_to_str
504
	call convert_int_to_str
505
	stdcall str_cat, edi,txt_mull
505
	stdcall str_cat, edi,txt_mull
506
	mov eax,dword[v_cur_y]
506
	mov eax,dword[v_cur_y]
507
	mov edi,txt_buf
507
	mov edi,txt_buf
508
	call convert_int_to_str
508
	call convert_int_to_str
509
	stdcall str_cat, txt_curor.size,edi
509
	stdcall str_cat, txt_curor.size,edi
510
	stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
510
	stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
511
 
511
 
512
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
512
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
513
	mov dword[txt_mov_offs.size],0
513
	mov dword[txt_mov_offs.size],0
514
	mov eax,dword[mov_x]
514
	mov eax,dword[mov_x]
515
	mov edi,txt_mov_offs.size
515
	mov edi,txt_mov_offs.size
516
	call convert_int_to_str
516
	call convert_int_to_str
517
	stdcall str_cat, edi,txt_space
517
	stdcall str_cat, edi,txt_space
518
	mov eax,dword[mov_y]
518
	mov eax,dword[mov_y]
519
	mov edi,txt_buf
519
	mov edi,txt_buf
520
	call convert_int_to_str
520
	call convert_int_to_str
521
	stdcall str_cat, txt_mov_offs.size,edi
521
	stdcall str_cat, txt_mov_offs.size,edi
522
	stdcall str_cat, txt_mov_offs.size,txt_space
522
	stdcall str_cat, txt_mov_offs.size,txt_space
523
	mov eax,dword[mov_z]
523
	mov eax,dword[mov_z]
524
	mov edi,txt_buf
524
	mov edi,txt_buf
525
	call convert_int_to_str
525
	call convert_int_to_str
526
	stdcall str_cat, txt_mov_offs.size,edi
526
	stdcall str_cat, txt_mov_offs.size,edi
527
	stdcall str_cat, txt_mov_offs.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
527
	stdcall str_cat, txt_mov_offs.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
528
 
528
 
529
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
529
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
530
	mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
530
	mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
531
	mov ecx,[sc.work_text]
531
	mov ecx,[sc.work_text]
532
	or  ecx,0x80000000 ;or (1 shl 30)
532
	or  ecx,0x80000000 ;or (1 shl 30)
533
	mov edx,txt_color
533
	mov edx,txt_color
534
	int 0x40
534
	int 0x40
535
 
535
 
536
	mov edx,txt_curor
536
	mov edx,txt_curor
537
	add ebx,115 shl 16
537
	add ebx,115 shl 16
538
	or  ecx,(1 shl 30)
538
	or  ecx,(1 shl 30)
539
	mov edi,[sc.work]
539
	mov edi,[sc.work]
540
	int 0x40
540
	int 0x40
541
 
541
 
542
	mov edx,txt_mov_offs
542
	mov edx,txt_mov_offs
543
	add ebx,115 shl 16
543
	add ebx,115 shl 16
544
	int 0x40
544
	int 0x40
545
 
545
 
546
	mov edx,txt_zoom
546
	mov edx,txt_zoom
547
	add ebx,115 shl 16
547
	add ebx,115 shl 16
548
	int 0x40
548
	int 0x40
549
 
549
 
550
	mov edx,txt_n_plane
550
	mov edx,txt_n_plane
551
	add ebx,115 shl 16
551
	add ebx,115 shl 16
552
	int 0x40
552
	int 0x40
553
 
553
 
554
	call on_change_color
554
	call on_change_color
555
	ret
555
	ret
556
 
556
 
557
align 4
557
align 4
558
on_change_color:
558
on_change_color:
559
pushad
559
pushad
560
	mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
560
	mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
561
	mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
561
	mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
562
	mov edx,[v_color]
562
	mov edx,[v_color]
563
	mcall 13
563
	mcall 13
564
 
564
 
565
	mov ebx,(1 shl 8)+(6 shl 16)
565
	mov ebx,(1 shl 8)+(6 shl 16)
566
	mov ecx,edx
566
	mov ecx,edx
567
	mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
567
	mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
568
	mov esi,[sc.work_text]
568
	mov esi,[sc.work_text]
569
	add esi,(1 shl 30)
569
	add esi,(1 shl 30)
570
	mov edi,[sc.work]
570
	mov edi,[sc.work]
571
	mcall 47
571
	mcall 47
572
popad
572
popad
573
	ret
573
	ret
574
 
574
 
575
align 4
575
align 4
576
key:
576
key:
577
	mcall 2
577
	mcall 2
578
	jmp still
578
	jmp still
579
 
579
 
580
 
580
 
581
align 4
581
align 4
582
button:
582
button:
583
	mcall 17
583
	mcall 17
584
	cmp ah,3
584
	cmp ah,3
585
	jne @f
585
	jne @f
586
		stdcall but_new_file, [open_file_vox]
586
		stdcall but_new_file, [open_file_vox]
587
		call draw_objects
587
		call draw_objects
588
		call draw_pok
588
		call draw_pok
589
	@@:
589
	@@:
590
	cmp ah,4
590
	cmp ah,4
591
	jne @f
591
	jne @f
592
		call but_open_file
592
		call but_open_file
593
	@@:
593
	@@:
594
	cmp ah,5
594
	cmp ah,5
595
	jne @f
595
	jne @f
596
		call but_save_file
596
		call but_save_file
597
	@@:
597
	@@:
598
	cmp ah,6
598
	cmp ah,6
599
	jne @f
599
	jne @f
600
		call but_zoom_p
600
		call but_zoom_p
601
	@@:
601
	@@:
602
	cmp ah,7
602
	cmp ah,7
603
	jne @f
603
	jne @f
604
		call but_zoom_m
604
		call but_zoom_m
605
	@@:
605
	@@:
606
	cmp ah,8
606
	cmp ah,8
607
	jne @f
607
	jne @f
608
		call but_3
608
		call but_3
609
	@@:
609
	@@:
610
	cmp ah,9
610
	cmp ah,9
611
	jne @f
611
	jne @f
612
		call but_4
612
		call but_4
613
	@@:
613
	@@:
614
	cmp ah,10
614
	cmp ah,10
615
	jne @f
615
	jne @f
616
		call but_plane_inc
616
		call but_plane_inc
617
	@@:
617
	@@:
618
	cmp ah,11
618
	cmp ah,11
619
	jne @f
619
	jne @f
620
		call but_plane_dec
620
		call but_plane_dec
621
	@@:
621
	@@:
622
	cmp ah,12
622
	cmp ah,12
623
	jne @f
623
	jne @f
624
		call but_light
624
		call but_light
625
	@@:
625
	@@:
626
	cmp ah,13
626
	cmp ah,13
627
	jne @f
627
	jne @f
628
		call but_rend_2_2
628
		call but_rend_2_2
629
	@@:
629
	@@:
630
	cmp ah,14
630
	cmp ah,14
631
	jne @f
631
	jne @f
632
		call but_move
632
		call but_move
633
	@@:
633
	@@:
634
	cmp ah,15
634
	cmp ah,15
635
	jne @f
635
	jne @f
636
		dec dword[mov_x]
636
		dec dword[mov_x]
637
		call draw_pok
637
		call draw_pok
638
	@@:
638
	@@:
639
	cmp ah,16
639
	cmp ah,16
640
	jne @f
640
	jne @f
641
		inc dword[mov_x]
641
		inc dword[mov_x]
642
		call draw_pok
642
		call draw_pok
643
	@@:
643
	@@:
644
	cmp ah,17
644
	cmp ah,17
645
	jne @f
645
	jne @f
646
		dec dword[mov_y]
646
		dec dword[mov_y]
647
		call draw_pok
647
		call draw_pok
648
	@@:
648
	@@:
649
	cmp ah,18
649
	cmp ah,18
650
	jne @f
650
	jne @f
651
		inc dword[mov_y]
651
		inc dword[mov_y]
652
		call draw_pok
652
		call draw_pok
653
	@@:
653
	@@:
654
	cmp ah,19
654
	cmp ah,19
655
	jne @f
655
	jne @f
656
		dec dword[mov_z]
656
		dec dword[mov_z]
657
		call draw_pok
657
		call draw_pok
658
	@@:
658
	@@:
659
	cmp ah,20
659
	cmp ah,20
660
	jne @f
660
	jne @f
661
		inc dword[mov_z]
661
		inc dword[mov_z]
662
		call draw_pok
662
		call draw_pok
663
	@@:
663
	@@:
664
	cmp ah,1
664
	cmp ah,1
665
	jne still
665
	jne still
666
.exit:
666
.exit:
667
	stdcall [buf2d_delete],buf_0
667
	stdcall [buf2d_delete],buf_0
668
	stdcall [buf2d_delete],buf_0z
668
	stdcall [buf2d_delete],buf_0z
669
	cmp dword[buf_r_img],0
669
	cmp dword[buf_r_img],0
670
	je @f
670
	je @f
671
		stdcall [buf2d_delete],buf_r_img
671
		stdcall [buf2d_delete],buf_r_img
672
		stdcall [buf2d_delete],buf_r_z
672
		stdcall [buf2d_delete],buf_r_z
673
	@@:
673
	@@:
674
	stdcall [buf2d_vox_brush_delete], buf_vox
674
	stdcall [buf2d_vox_brush_delete], buf_vox
675
	stdcall mem.Free,[image_data_toolbar]
675
	stdcall mem.Free,[image_data_toolbar]
676
	stdcall mem.Free,[open_file_vox]
676
	stdcall mem.Free,[open_file_vox]
677
	stdcall mem.Free,[moved_file_vox]
677
	stdcall mem.Free,[moved_file_vox]
678
	mcall -1
678
	mcall -1
679
 
679
 
680
;¤ ­­ë¥ ¤«ï ¨­¨æ¨ «¨§ æ¨¨ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
680
;¤ ­­ë¥ ¤«ï ¨­¨æ¨ «¨§ æ¨¨ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
681
align 4
681
align 4
682
vox_new_data:
682
vox_new_data:
683
	db 2,0,0,0
683
	db 2,0,0,0
684
	db 0,1,2,3, 4,5,6,7 ;default table
684
	db 0,1,2,3, 4,5,6,7 ;default table
685
	dd 0 ;null node
685
	dd 0 ;null node
686
 
686
 
687
;¨­¨æ¨ «¨§ æ¨ï ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
687
;¨­¨æ¨ «¨§ æ¨ï ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
688
align 4
688
align 4
689
proc but_new_file uses ecx edi esi, file_data:dword
689
proc but_new_file uses ecx edi esi, file_data:dword
690
	mov ecx,vox_offs_data+4
690
	mov ecx,vox_offs_data+4
691
	mov esi,vox_new_data
691
	mov esi,vox_new_data
692
	mov edi,[file_data]
692
	mov edi,[file_data]
693
	cld
693
	cld
694
	rep movsb
694
	rep movsb
695
	ret
695
	ret
696
endp
696
endp
697
 
697
 
698
align 4
698
align 4
699
open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
699
open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
700
moved_file_vox dd 0
700
moved_file_vox dd 0
701
 
701
 
702
align 4
702
align 4
703
but_open_file:
703
but_open_file:
704
	pushad
704
	pushad
705
	copy_path open_dialog_name,communication_area_default_path,file_name,0
705
	copy_path open_dialog_name,communication_area_default_path,file_name,0
706
	mov [OpenDialog_data.type],0
706
	mov [OpenDialog_data.type],0
707
	stdcall [OpenDialog_Start],OpenDialog_data
707
	stdcall [OpenDialog_Start],OpenDialog_data
708
	cmp [OpenDialog_data.status],2
708
	cmp [OpenDialog_data.status],2
709
	je .end_open_file
709
	je .end_open_file
710
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
710
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
711
 
711
 
712
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
712
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
713
	mov [run_file_70.Function], 0
713
	mov [run_file_70.Function], 0
714
	mov [run_file_70.Position], 0
714
	mov [run_file_70.Position], 0
715
	mov [run_file_70.Flags], 0
715
	mov [run_file_70.Flags], 0
716
	m2m dword[run_file_70.Count], dword[max_open_file_size]
716
	m2m dword[run_file_70.Count], dword[max_open_file_size]
717
	m2m [run_file_70.Buffer], [open_file_vox]
717
	m2m [run_file_70.Buffer], [open_file_vox]
718
	mov byte[run_file_70+20], 0
718
	mov byte[run_file_70+20], 0
719
	mov dword[run_file_70.FileName], openfile_path
719
	mov dword[run_file_70.FileName], openfile_path
720
	mov ebx,run_file_70
720
	mov ebx,run_file_70
721
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
721
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
722
	cmp ebx,0xffffffff
722
	cmp ebx,0xffffffff
723
	je .end_open_file
723
	je .end_open_file
724
 
724
 
725
	;add ebx,[open_file_vox]
725
	;add ebx,[open_file_vox]
726
	;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
726
	;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
727
	mcall 71,1,openfile_path
727
	mcall 71,1,openfile_path
728
 
728
 
729
	;---
729
	;---
730
	mov eax,[open_file_vox]
730
	mov eax,[open_file_vox]
731
	movzx eax,byte[eax]
731
	movzx eax,byte[eax]
732
	and eax,0xff ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
732
	and eax,0xff ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
733
	mov dword[v_zoom],eax ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
733
	mov dword[v_zoom],eax ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
734
	mov dword[cam_x],0
734
	mov dword[cam_x],0
735
	mov dword[cam_y],0
735
	mov dword[cam_y],0
736
	mov dword[cam_z],0
736
	mov dword[cam_z],0
737
	call draw_objects
737
	call draw_objects
738
	.end_open_file:
738
	.end_open_file:
739
	popad
739
	popad
740
	ret
740
	ret
741
 
741
 
742
align 4
742
align 4
743
but_save_file:
743
but_save_file:
744
	pushad
744
	pushad
745
		copy_path open_dialog_name,communication_area_default_path,file_name,0
745
		copy_path open_dialog_name,communication_area_default_path,file_name,0
746
		mov [OpenDialog_data.type],1
746
		mov [OpenDialog_data.type],1
747
		stdcall [OpenDialog_Start],OpenDialog_data
747
		stdcall [OpenDialog_Start],OpenDialog_data
748
		cmp [OpenDialog_data.status],2
748
		cmp [OpenDialog_data.status],2
749
		je .end_save_file
749
		je .end_save_file
750
		;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
750
		;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
751
 
751
 
752
		mov eax,dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
752
		mov eax,dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
753
		mov ebx,[moved_file_vox]
753
		mov ebx,[moved_file_vox]
754
		mov byte[ebx],al
754
		mov byte[ebx],al
755
 
755
 
756
		stdcall buf2d_vox_obj_get_size, ebx
756
		stdcall buf2d_vox_obj_get_size, ebx
757
		mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
757
		mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
758
		mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
758
		mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
759
		mov [run_file_70.Function], 2
759
		mov [run_file_70.Function], 2
760
		mov [run_file_70.Position], 0
760
		mov [run_file_70.Position], 0
761
		mov [run_file_70.Flags], 0
761
		mov [run_file_70.Flags], 0
762
		mov ebx, dword[moved_file_vox]
762
		mov ebx, dword[moved_file_vox]
763
		mov [run_file_70.Buffer], ebx
763
		mov [run_file_70.Buffer], ebx
764
		mov byte[run_file_70+20], 0
764
		mov byte[run_file_70+20], 0
765
		mov dword[run_file_70.FileName], openfile_path
765
		mov dword[run_file_70.FileName], openfile_path
766
		mov ebx,run_file_70
766
		mov ebx,run_file_70
767
		int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
767
		int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
768
		cmp ebx,0xffffffff
768
		cmp ebx,0xffffffff
769
		je .end_save_file
769
		je .end_save_file
770
 
770
 
771
		.end_save_file:
771
		.end_save_file:
772
	popad
772
	popad
773
	ret
773
	ret
774
 
774
 
775
;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
775
;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
776
align 4
776
align 4
777
but_zoom_p:
777
but_zoom_p:
778
	cmp dword[v_zoom],10 ;¬ ªá¨¬ «ì­ë© à §¬¥à, ¤® ª®â®à®£® ¬®¦­® 㢥«¨ç¨âì 2^10=1024
778
	cmp dword[v_zoom],10 ;¬ ªá¨¬ «ì­ë© à §¬¥à, ¤® ª®â®à®£® ¬®¦­® 㢥«¨ç¨âì 2^10=1024
779
	jge @f
779
	jge @f
780
		inc dword[v_zoom]
780
		inc dword[v_zoom]
781
		shl dword[n_plane],1
781
		shl dword[n_plane],1
782
		push eax
782
		push eax
783
		mov eax,[v_zoom]
783
		mov eax,[v_zoom]
784
		cmp eax,[scaled_zoom]
784
		cmp eax,[scaled_zoom]
785
		jl .end_0
785
		jl .end_0
786
			push ecx
786
			push ecx
787
			mov ecx,[scaled_zoom]
787
			mov ecx,[scaled_zoom]
788
			xor eax,eax
788
			xor eax,eax
789
			inc eax
789
			inc eax
790
			shl eax,cl
790
			shl eax,cl
791
			shl dword[cam_x],1
791
			shl dword[cam_x],1
792
			shl dword[cam_y],1
792
			shl dword[cam_y],1
793
			shl dword[cam_z],1
793
			shl dword[cam_z],1
794
			cmp eax,[n_plane]
794
			cmp eax,[n_plane]
795
			jg .end_1
795
			jg .end_1
796
				;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
796
				;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
797
				sub [n_plane],eax
797
				sub [n_plane],eax
798
				inc dword[cam_y]
798
				inc dword[cam_y]
799
			.end_1:
799
			.end_1:
800
			pop ecx
800
			pop ecx
801
		.end_0:
801
		.end_0:
802
		pop eax
802
		pop eax
803
		call draw_objects
803
		call draw_objects
804
		call draw_pok
804
		call draw_pok
805
	@@:
805
	@@:
806
	ret
806
	ret
807
 
807
 
808
;㬥­ì襭¨¥ ¬ áèâ ¡ 
808
;㬥­ì襭¨¥ ¬ áèâ ¡ 
809
align 4
809
align 4
810
but_zoom_m:
810
but_zoom_m:
811
	cmp dword[v_zoom],1
811
	cmp dword[v_zoom],1
812
	jl @f
812
	jl @f
813
		dec dword[v_zoom]
813
		dec dword[v_zoom]
814
		shr dword[n_plane],1
814
		shr dword[n_plane],1
815
		push eax
815
		push eax
816
		mov eax,[v_zoom]
816
		mov eax,[v_zoom]
817
		cmp eax,[scaled_zoom]
817
		cmp eax,[scaled_zoom]
818
		jl .end_0
818
		jl .end_0
819
			shr dword[cam_x],1
819
			shr dword[cam_x],1
820
			shr dword[cam_y],1
820
			shr dword[cam_y],1
821
			jnc .end_1
821
			jnc .end_1
822
				;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
822
				;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
823
				push ecx
823
				push ecx
824
				mov ecx,[scaled_zoom]
824
				mov ecx,[scaled_zoom]
825
				dec ecx
825
				dec ecx
826
				xor eax,eax
826
				xor eax,eax
827
				inc eax
827
				inc eax
828
				shl eax,cl
828
				shl eax,cl
829
				add [n_plane],eax
829
				add [n_plane],eax
830
				pop ecx
830
				pop ecx
831
			.end_1:
831
			.end_1:
832
			shr dword[cam_z],1
832
			shr dword[cam_z],1
833
		.end_0:
833
		.end_0:
834
		pop eax
834
		pop eax
835
		call draw_objects
835
		call draw_objects
836
		call draw_pok
836
		call draw_pok
837
	@@:
837
	@@:
838
	ret
838
	ret
839
 
839
 
840
align 4
840
align 4
841
but_3:
841
but_3:
842
	stdcall vox_obj_rot_z, [open_file_vox]
842
	stdcall vox_obj_rot_z, [open_file_vox]
843
	call draw_objects
843
	call draw_objects
844
	ret
844
	ret
845
 
845
 
846
align 4
846
align 4
847
but_4:
847
but_4:
848
	stdcall vox_obj_rot_x, [open_file_vox]
848
	stdcall vox_obj_rot_x, [open_file_vox]
849
	call draw_objects
849
	call draw_objects
850
	ret
850
	ret
851
 
851
 
852
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
852
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
853
align 4
853
align 4
854
but_plane_inc:
854
but_plane_inc:
855
push eax ecx
855
push eax ecx
856
	inc dword[n_plane]
856
	inc dword[n_plane]
857
	mov eax,[v_zoom]
857
	mov eax,[v_zoom]
858
	cmp eax,[scaled_zoom]
858
	cmp eax,[scaled_zoom]
859
	jle .end_0
859
	jle .end_0
860
		;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
860
		;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
861
		mov ecx,[scaled_zoom]
861
		mov ecx,[scaled_zoom]
862
		xor eax,eax
862
		xor eax,eax
863
		inc eax
863
		inc eax
864
		shl eax,cl
864
		shl eax,cl
865
		cmp eax,[n_plane]
865
		cmp eax,[n_plane]
866
		jg @f
866
		jg @f
867
			mov dword[n_plane],0
867
			mov dword[n_plane],0
868
			inc dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
868
			inc dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
869
			neg ecx
869
			neg ecx
870
			;inc ecx
870
			;inc ecx
871
			add ecx,[v_zoom]
871
			add ecx,[v_zoom]
872
			xor eax,eax
872
			xor eax,eax
873
			inc eax
873
			inc eax
874
			shl eax,cl
874
			shl eax,cl
875
			cmp eax,[cam_y]
875
			cmp eax,[cam_y]
876
			jg @f
876
			jg @f
877
				mov dword[cam_y],0 ;§ æ¨ª«¨¢ ¥¬ ¥á«¨ ¢ë«¥§«¨ §  ¯à¥¤¥«ë ¯®á«¥¤­¥£® ªã¡ 
877
				mov dword[cam_y],0 ;§ æ¨ª«¨¢ ¥¬ ¥á«¨ ¢ë«¥§«¨ §  ¯à¥¤¥«ë ¯®á«¥¤­¥£® ªã¡ 
878
		@@:
878
		@@:
879
		jmp .end_1
879
		jmp .end_1
880
	.end_0:
880
	.end_0:
881
		;¬ áèâ ¡¨à®¢ ­¨¥ ­¥ ¯à®¨á室¨â
881
		;¬ áèâ ¡¨à®¢ ­¨¥ ­¥ ¯à®¨á室¨â
882
		mov ecx,eax
882
		mov ecx,eax
883
		xor eax,eax
883
		xor eax,eax
884
		inc eax
884
		inc eax
885
		shl eax,cl
885
		shl eax,cl
886
		cmp eax,[n_plane]
886
		cmp eax,[n_plane]
887
		jg .end_1
887
		jg .end_1
888
			mov dword[n_plane],0
888
			mov dword[n_plane],0
889
	.end_1:
889
	.end_1:
890
	call draw_objects
890
	call draw_objects
891
	call draw_pok
891
	call draw_pok
892
pop ecx eax
892
pop ecx eax
893
	ret
893
	ret
894
 
894
 
895
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
895
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
896
align 4
896
align 4
897
but_plane_dec:
897
but_plane_dec:
898
	dec dword[n_plane]
898
	dec dword[n_plane]
899
	cmp dword[n_plane],0
899
	cmp dword[n_plane],0
900
	jge .end_f
900
	jge .end_f
901
push eax ecx
901
push eax ecx
902
	mov ecx,[scaled_zoom]
902
	mov ecx,[scaled_zoom]
903
	xor eax,eax
903
	xor eax,eax
904
	inc eax
904
	inc eax
905
	shl eax,cl
905
	shl eax,cl
906
	dec eax
906
	dec eax
907
	mov dword[n_plane],eax
907
	mov dword[n_plane],eax
908
 
908
 
909
	mov eax,[v_zoom]
909
	mov eax,[v_zoom]
910
	cmp eax,[scaled_zoom]
910
	cmp eax,[scaled_zoom]
911
	jle .end_0
911
	jle .end_0
912
		;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
912
		;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
913
		dec dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
913
		dec dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
914
		cmp dword[cam_y],0
914
		cmp dword[cam_y],0
915
		jge .end_0
915
		jge .end_0
916
 
916
 
917
		mov ecx,eax
917
		mov ecx,eax
918
		sub ecx,[scaled_zoom]
918
		sub ecx,[scaled_zoom]
919
		xor eax,eax
919
		xor eax,eax
920
		inc eax
920
		inc eax
921
		shl eax,cl
921
		shl eax,cl
922
		dec eax
922
		dec eax
923
		mov dword[cam_y],eax ;¥á«¨ ­®¬¥à ªã¡  ®ª § «áï ¬¥­ìè¥ 0 ¨á¯à ¢«ï¥¬ ­  ¬ ªá¨¬ «ì­®¥ §­ ç¥­¨¥
923
		mov dword[cam_y],eax ;¥á«¨ ­®¬¥à ªã¡  ®ª § «áï ¬¥­ìè¥ 0 ¨á¯à ¢«ï¥¬ ­  ¬ ªá¨¬ «ì­®¥ §­ ç¥­¨¥
924
	.end_0:
924
	.end_0:
925
pop ecx eax
925
pop ecx eax
926
	.end_f:
926
	.end_f:
927
	call draw_objects
927
	call draw_objects
928
	call draw_pok
928
	call draw_pok
929
	ret
929
	ret
930
 
930
 
931
align 4
931
align 4
932
but_light:
932
but_light:
933
	xor dword[mode_light],1
933
	xor dword[mode_light],1
934
	call draw_objects
934
	call draw_objects
935
	ret
935
	ret
936
 
936
 
937
align 4
937
align 4
938
but_rend_2_2:
938
but_rend_2_2:
939
push edi
939
push edi
940
	cmp dword[buf_r_img],0
940
	cmp dword[buf_r_img],0
941
	jne @f
941
	jne @f
942
		;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï ७¤¥à 
942
		;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï ७¤¥à 
943
		push ecx esi
943
		push ecx esi
944
		mov edi,buf_r_img
944
		mov edi,buf_r_img
945
		mov esi,buf_0
945
		mov esi,buf_0
946
		mov ecx,BUF_STRUCT_SIZE
946
		mov ecx,BUF_STRUCT_SIZE
947
		cld
947
		cld
948
		rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
948
		rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
949
		mov edi,buf_r_img
949
		mov edi,buf_r_img
950
		mov buf2d_data,0
950
		mov buf2d_data,0
951
		shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
951
		shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
952
		shl buf2d_h,1
952
		shl buf2d_h,1
953
		stdcall [buf2d_create],buf_r_img
953
		stdcall [buf2d_create],buf_r_img
954
 
954
 
955
		mov edi,buf_r_z
955
		mov edi,buf_r_z
956
		mov esi,buf_0z
956
		mov esi,buf_0z
957
		mov ecx,BUF_STRUCT_SIZE
957
		mov ecx,BUF_STRUCT_SIZE
958
		cld
958
		cld
959
		rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
959
		rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
960
		mov edi,buf_r_z
960
		mov edi,buf_r_z
961
		mov buf2d_data,0
961
		mov buf2d_data,0
962
		shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
962
		shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
963
		shl buf2d_h,1
963
		shl buf2d_h,1
964
		stdcall [buf2d_create],buf_r_z
964
		stdcall [buf2d_create],buf_r_z
965
		pop esi ecx
965
		pop esi ecx
966
	@@:
966
	@@:
967
	stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
967
	stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
968
	stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
968
	stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
969
 
969
 
970
	push eax ebx ecx
970
	push eax ebx ecx
971
		mov eax,[v_zoom]
971
		mov eax,[v_zoom]
972
		cmp eax,[scaled_zoom]
972
		cmp eax,[scaled_zoom]
973
		jle .end_scaled
973
		jle .end_scaled
974
			;७¤¥à 㢥«¨ç¥­­®© ç á⨠®¡ê¥ªâ 
974
			;७¤¥à 㢥«¨ç¥­­®© ç á⨠®¡ê¥ªâ 
975
			mov ebx,[scaled_zoom]
975
			mov ebx,[scaled_zoom]
976
			sub eax,ebx
976
			sub eax,ebx
977
			inc ebx
977
			inc ebx
978
			stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, buf_vox,\
978
			stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, buf_vox,\
979
				[open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph]
979
				[open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph]
980
			bt dword[mode_light],0
980
			bt dword[mode_light],0
981
			jnc @f
981
			jnc @f
982
				stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, ebx, 3
982
				stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, ebx, 3
983
			@@:
983
			@@:
984
			xor ebx,ebx
984
			xor ebx,ebx
985
			xor ecx,ecx
985
			xor ecx,ecx
986
			mov edi,buf_r_img
986
			mov edi,buf_r_img
987
			stdcall [buf2d_img_hdiv2], edi
987
			stdcall [buf2d_img_hdiv2], edi
988
			shr buf2d_h,1
988
			shr buf2d_h,1
989
			stdcall [buf2d_img_wdiv2], edi
989
			stdcall [buf2d_img_wdiv2], edi
990
			shr buf2d_w,1
990
			shr buf2d_w,1
991
			jmp .show
991
			jmp .show
992
		.end_scaled:
992
		.end_scaled:
993
 
993
 
994
		inc eax
994
		inc eax
995
		stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax
995
		stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax
996
		stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax
996
		stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax
997
		bt dword[mode_light],0
997
		bt dword[mode_light],0
998
		jnc @f
998
		jnc @f
999
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3
999
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3
1000
		@@:
1000
		@@:
1001
 
1001
 
1002
		mov edi,buf_r_img
1002
		mov edi,buf_r_img
1003
		stdcall [buf2d_img_hdiv2], edi
1003
		stdcall [buf2d_img_hdiv2], edi
1004
		shr buf2d_h,1
1004
		shr buf2d_h,1
1005
		stdcall [buf2d_img_wdiv2], edi
1005
		stdcall [buf2d_img_wdiv2], edi
1006
		shr buf2d_w,1
1006
		shr buf2d_w,1
1007
 
1007
 
1008
		stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
1008
		stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
1009
		mov ebx,[buf_0.w]
1009
		mov ebx,[buf_0.w]
1010
		sub ebx,eax
1010
		sub ebx,eax
1011
		shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
1011
		shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
1012
		stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
1012
		stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
1013
		cmp eax,[buf_0.h]
1013
		cmp eax,[buf_0.h]
1014
		jg @f
1014
		jg @f
1015
			mov ecx,[buf_0.h]
1015
			mov ecx,[buf_0.h]
1016
			sub ecx,eax
1016
			sub ecx,eax
1017
			shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
1017
			shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
1018
		@@:
1018
		@@:
1019
		.show:
1019
		.show:
1020
		stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
1020
		stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
1021
		shl buf2d_h,1
1021
		shl buf2d_h,1
1022
		shl buf2d_w,1
1022
		shl buf2d_w,1
1023
	pop ecx ebx eax
1023
	pop ecx ebx eax
1024
pop edi
1024
pop edi
1025
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1025
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1026
	ret
1026
	ret
1027
 
1027
 
1028
align 4
1028
align 4
1029
but_move:
1029
but_move:
1030
push eax
1030
push eax
1031
	stdcall but_new_file, [moved_file_vox]
1031
	stdcall but_new_file, [moved_file_vox]
1032
	mov eax,[v_zoom]
1032
	mov eax,[v_zoom]
1033
	stdcall buf_vox_obj_recreat, [open_file_vox], [moved_file_vox],\
1033
	stdcall buf_vox_obj_recreat, [open_file_vox], [moved_file_vox],\
1034
		[mov_x],[mov_y],[mov_z], eax
1034
		[mov_x],[mov_y],[mov_z], eax
1035
 
1035
 
1036
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1036
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1037
	stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
1037
	stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
1038
	cmp eax,[scaled_zoom]
1038
	cmp eax,[scaled_zoom]
1039
	jle @f
1039
	jle @f
1040
		mov eax,[scaled_zoom]
1040
		mov eax,[scaled_zoom]
1041
	@@:
1041
	@@:
1042
	stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox, [moved_file_vox],		0,0,0, eax
1042
	stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox, [moved_file_vox],		0,0,0, eax
1043
pop eax
1043
pop eax
1044
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1044
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1045
	ret
1045
	ret
1046
 
1046
 
1047
;description:
1047
;description:
1048
; äã­ªæ¨ï à¨áãîé ï ¢®ªá¥«ì­ë© ®¡ê¥ªâ (¢¨¤­® 3 £à ­¨)
1048
; äã­ªæ¨ï à¨áãîé ï ¢®ªá¥«ì­ë© ®¡ê¥ªâ (¢¨¤­® 3 £à ­¨)
1049
;input:
1049
;input:
1050
; v_obj - ¢®ªá¥«ì­ë© ®¡ê¥ªâ
1050
; v_obj - ¢®ªá¥«ì­ë© ®¡ê¥ªâ
1051
; k_scale - ª®íä. ¤«ï ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
1051
; k_scale - ª®íä. ¤«ï ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
1052
align 4
1052
align 4
1053
proc buf_vox_obj_recreat, v_obj:dword, obj_n:dword,\
1053
proc buf_vox_obj_recreat, v_obj:dword, obj_n:dword,\
1054
coord_x:dword, coord_y:dword, coord_z:dword, k_scale:dword
1054
coord_x:dword, coord_y:dword, coord_z:dword, k_scale:dword
1055
pushad
1055
pushad
1056
	mov edi,[v_obj]
1056
	mov edi,[v_obj]
1057
	mov ecx,[k_scale]
1057
	mov ecx,[k_scale]
1058
	mov ebx,[coord_x]
1058
	mov ebx,[coord_x]
1059
	mov edx,[coord_y]
1059
	mov edx,[coord_y]
1060
	add edi,vox_offs_data
1060
	add edi,vox_offs_data
1061
	mov esi,[coord_z]
1061
	mov esi,[coord_z]
1062
	stdcall vox_go_in_node, [v_obj], [obj_n]
1062
	stdcall vox_go_in_node, [v_obj], [obj_n]
1063
popad
1063
popad
1064
	ret
1064
	ret
1065
endp
1065
endp
1066
 
1066
 
1067
;input:
1067
;input:
1068
; ebx - coord_x
1068
; ebx - coord_x
1069
; edx - coord_y
1069
; edx - coord_y
1070
; esi - coord_z
1070
; esi - coord_z
1071
; ecx - ã஢¥­ì ⥪ã襣® 㧫 
1071
; ecx - ã஢¥­ì ⥪ã襣® 㧫 
1072
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
1072
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
1073
align 4
1073
align 4
1074
proc vox_go_in_node, v_obj:dword, obj_n:dword
1074
proc vox_go_in_node, v_obj:dword, obj_n:dword
1075
	cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
1075
	cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
1076
	je .sub_trees
1076
	je .sub_trees
1077
		;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
1077
		;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
1078
		push eax edx
1078
		push eax edx
1079
 
1079
 
1080
		;¯à®à¨á®¢ª  à ¬ª¨ ¥á«¨ à §¬¥à 㧫  = 1
1080
		;¯à®à¨á®¢ª  à ¬ª¨ ¥á«¨ à §¬¥à 㧫  = 1
1081
		cmp ecx,0
1081
		cmp ecx,0
1082
		jne @f
1082
		jne @f
1083
			stdcall buf2d_vox_obj_create_node, [obj_n], ebx,edx,esi, [v_zoom], [edi]
1083
			stdcall buf2d_vox_obj_create_node, [obj_n], ebx,edx,esi, [v_zoom], [edi]
1084
		@@:
1084
		@@:
1085
 
1085
 
1086
		;¢å®¤ ¢­ãâàì 㧫 
1086
		;¢å®¤ ¢­ãâàì 㧫 
1087
		dec ecx
1087
		dec ecx
1088
		mov ah,byte[edi+3]
1088
		mov ah,byte[edi+3]
1089
		add edi,4
1089
		add edi,4
1090
		mov al,8
1090
		mov al,8
1091
		.cycle:
1091
		.cycle:
1092
			bt ax,8 ;â¥áâ¨à㥬 ⮫쪮 ah
1092
			bt ax,8 ;â¥áâ¨à㥬 ⮫쪮 ah
1093
			jnc .c_next
1093
			jnc .c_next
1094
				push ebx edx esi
1094
				push ebx edx esi
1095
				stdcall vox_corect_coords, [v_obj]
1095
				stdcall vox_corect_coords, [v_obj]
1096
				stdcall vox_go_in_node, [v_obj], [obj_n]
1096
				stdcall vox_go_in_node, [v_obj], [obj_n]
1097
				pop esi edx ebx
1097
				pop esi edx ebx
1098
			.c_next:
1098
			.c_next:
1099
			shr ah,1
1099
			shr ah,1
1100
			dec al
1100
			dec al
1101
			jnz .cycle
1101
			jnz .cycle
1102
 
1102
 
1103
		;¢ë室 ¨§ 㧫 
1103
		;¢ë室 ¨§ 㧫 
1104
		inc ecx
1104
		inc ecx
1105
		pop edx eax
1105
		pop edx eax
1106
 
1106
 
1107
		jmp .end_f
1107
		jmp .end_f
1108
	.sub_trees:
1108
	.sub_trees:
1109
		;à¨á㥬 㧥«
1109
		;à¨á㥬 㧥«
1110
		cmp ecx,0
1110
		cmp ecx,0
1111
		jne @f
1111
		jne @f
1112
			stdcall buf2d_vox_obj_create_node, [obj_n], ebx,edx,esi, [v_zoom], [edi]
1112
			stdcall buf2d_vox_obj_create_node, [obj_n], ebx,edx,esi, [v_zoom], [edi]
1113
		@@:
1113
		@@:
1114
 
1114
 
1115
		add edi,4
1115
		add edi,4
1116
	.end_f:
1116
	.end_f:
1117
	ret
1117
	ret
1118
endp
1118
endp
1119
 
1119
 
1120
;description:
1120
;description:
1121
;äã­ªæ¨ï ¤«ï ª®à¥ªâ¨à®¢ª¨ ª®®à¤¨­ â
1121
;äã­ªæ¨ï ¤«ï ª®à¥ªâ¨à®¢ª¨ ª®®à¤¨­ â
1122
;­ ¯à ¢«¥­¨ï ®á¥© ª®®à¤¨­ â ¢ ¢®ªá¥«¥:
1122
;­ ¯à ¢«¥­¨ï ®á¥© ª®®à¤¨­ â ¢ ¢®ªá¥«¥:
1123
;*z
1123
;*z
1124
;|
1124
;|
1125
;+
1125
;+
1126
;  * y
1126
;  * y
1127
; /
1127
; /
1128
;+
1128
;+
1129
; \
1129
; \
1130
;  * x
1130
;  * x
1131
;input:
1131
;input:
1132
;  al - ­®¬¥à 㧫  ¢ ¤¥à¥¢¥ (®â 1 ¤® 8)
1132
;  al - ­®¬¥à 㧫  ¢ ¤¥à¥¢¥ (®â 1 ¤® 8)
1133
; ebx - ª®®à¤¨­ â  x
1133
; ebx - ª®®à¤¨­ â  x
1134
; edx - ª®®à¤¨­ â  y
1134
; edx - ª®®à¤¨­ â  y
1135
; esi - ª®®à¤¨­ â  z
1135
; esi - ª®®à¤¨­ â  z
1136
; ecx - ã஢¥­ì ⥪ã襣® 㧫 
1136
; ecx - ã஢¥­ì ⥪ã襣® 㧫 
1137
;output:
1137
;output:
1138
; ebx - ­®¢ ï ª®®à¤¨­ â  x
1138
; ebx - ­®¢ ï ª®®à¤¨­ â  x
1139
; edx - ­®¢ ï ª®®à¤¨­ â  y
1139
; edx - ­®¢ ï ª®®à¤¨­ â  y
1140
; esi - ­®¢ ï ª®®à¤¨­ â  z
1140
; esi - ­®¢ ï ª®®à¤¨­ â  z
1141
align 4
1141
align 4
1142
proc vox_corect_coords, v_obj:dword
1142
proc vox_corect_coords, v_obj:dword
1143
	cmp ecx,0
1143
	cmp ecx,0
1144
	jl .end_f ;¤«ï ã᪮७¨ï ®âà¨á®¢ª¨
1144
	jl .end_f ;¤«ï ã᪮७¨ï ®âà¨á®¢ª¨
1145
 
1145
 
1146
	push eax edi
1146
	push eax edi
1147
	and eax,15 ;¢ë¤¥«ï¥¬ ­®¬¥à 㧫  ¢ ¤¥à¥¢¥
1147
	and eax,15 ;¢ë¤¥«ï¥¬ ­®¬¥à 㧫  ¢ ¤¥à¥¢¥
1148
	mov edi,[v_obj]
1148
	mov edi,[v_obj]
1149
	add edi,vox_offs_tree_table
1149
	add edi,vox_offs_tree_table
1150
	add edi,8
1150
	add edi,8
1151
	sub edi,eax
1151
	sub edi,eax
1152
 
1152
 
1153
	xor eax,eax
1153
	xor eax,eax
1154
	inc eax
1154
	inc eax
1155
	cmp ecx,1
1155
	cmp ecx,1
1156
	jl .no_scale ;¢® ¨§¡¥¦ ­¨¥ § æ¨ª«¨¢ ­¨ï
1156
	jl .no_scale ;¢® ¨§¡¥¦ ­¨¥ § æ¨ª«¨¢ ­¨ï
1157
		shl eax,cl
1157
		shl eax,cl
1158
	.no_scale:
1158
	.no_scale:
1159
 
1159
 
1160
	bt word[edi],0 ;test voxel coord x
1160
	bt word[edi],0 ;test voxel coord x
1161
	jnc @f
1161
	jnc @f
1162
		add ebx,eax
1162
		add ebx,eax
1163
	@@:
1163
	@@:
1164
	bt word[edi],1 ;test voxel coord y
1164
	bt word[edi],1 ;test voxel coord y
1165
	jnc @f
1165
	jnc @f
1166
		add edx,eax
1166
		add edx,eax
1167
	@@:
1167
	@@:
1168
	bt word[edi],2 ;test voxel coord z
1168
	bt word[edi],2 ;test voxel coord z
1169
	jnc @f
1169
	jnc @f
1170
		add esi,eax
1170
		add esi,eax
1171
	@@:
1171
	@@:
1172
	pop edi eax
1172
	pop edi eax
1173
	.end_f:
1173
	.end_f:
1174
	ret
1174
	ret
1175
endp
1175
endp
1176
 
1176
 
1177
align 4
1177
align 4
1178
v_zoom dd 3 ;⥪ã騩 ¬ áèâ ¡
1178
v_zoom dd 3 ;⥪ã騩 ¬ áèâ ¡
1179
v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
1179
v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
1180
v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
1180
v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
1181
n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
1181
n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
1182
v_color dd 0xff ;梥⠪ à ­¤ è 
1182
v_color dd 0xff ;梥⠪ à ­¤ è 
1183
mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
1183
mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
1184
cam_x dd 0
1184
cam_x dd 0
1185
cam_y dd 0
1185
cam_y dd 0
1186
cam_z dd 0
1186
cam_z dd 0
1187
;ᤢ¨£¨ ®¡ê¥ªâ  ¯à¨ ¯¥à¥á®§¤ ­¨¨ (¯¥à¥¤¢¨¦¥­¨¨)
1187
;ᤢ¨£¨ ®¡ê¥ªâ  ¯à¨ ¯¥à¥á®§¤ ­¨¨ (¯¥à¥¤¢¨¦¥­¨¨)
1188
mov_x dd 0
1188
mov_x dd 0
1189
mov_y dd 0
1189
mov_y dd 0
1190
mov_z dd 0
1190
mov_z dd 0
1191
scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
1191
scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
1192
tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
1192
tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
1193
max_open_file_size dd ?
1193
max_open_file_size dd ?
1194
brush_w dd 5 ;è¨à¨­  ª¨áâ¨
1194
brush_w dd 5 ;è¨à¨­  ª¨áâ¨
1195
brush_h dd 5 ;¢ëá®â  ª¨áâ¨
1195
brush_h dd 5 ;¢ëá®â  ª¨áâ¨
1196
brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
1196
brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
1197
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1197
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1198
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1198
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1199
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1199
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1200
dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
1200
dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
1201
rd 999 ;32*32-25
1201
rd 999 ;32*32-25
1202
 
1202
 
1203
txt_zoom db 'Œ áèâ ¡:',0
1203
txt_zoom db 'Œ áèâ ¡:',0
1204
txt_curor: db 'Šãàá®à: '
1204
txt_curor: db 'Šãàá®à: '
1205
.size: rb 10
1205
.size: rb 10
1206
txt_n_plane db '‘¥ç¥­¨¥:',0
1206
txt_n_plane db '‘¥ç¥­¨¥:',0
1207
txt_color db '–¢¥â:',0
1207
txt_color db '–¢¥â:',0
1208
txt_mov_offs: db '‘¬¥é¥­¨¥: '
1208
txt_mov_offs: db '‘¬¥é¥­¨¥: '
1209
.size: rb 30
1209
.size: rb 30
1210
txt_mull db '*',0
1210
txt_mull db '*',0
1211
txt_space db ' ',0
1211
txt_space db ' ',0
1212
txt_buf rb 16
1212
txt_buf rb 16
1213
 
1213
 
1214
align 4
1214
align 4
1215
draw_objects:
1215
draw_objects:
1216
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1216
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1217
	stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
1217
	stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
1218
	stdcall [buf2d_clear], buf_pl, [buf_pl.color] ;ç¨á⨬ ¡ãä¥à
1218
	stdcall [buf2d_clear], buf_pl, [buf_pl.color] ;ç¨á⨬ ¡ãä¥à
1219
 
1219
 
1220
	push eax ebx ecx
1220
	push eax ebx ecx
1221
	stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
1221
	stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
1222
	mov ebx,[buf_0.w]
1222
	mov ebx,[buf_0.w]
1223
	sub ebx,eax
1223
	sub ebx,eax
1224
	shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
1224
	shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
1225
 
1225
 
1226
	xor ecx,ecx
1226
	xor ecx,ecx
1227
	stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
1227
	stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
1228
	cmp eax,[buf_0.h]
1228
	cmp eax,[buf_0.h]
1229
	jg @f
1229
	jg @f
1230
		mov ecx,[buf_0.h]
1230
		mov ecx,[buf_0.h]
1231
		sub ecx,eax
1231
		sub ecx,eax
1232
		shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
1232
		shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
1233
	@@:
1233
	@@:
1234
 
1234
 
1235
	mov eax,[v_zoom]
1235
	mov eax,[v_zoom]
1236
	cmp eax,[scaled_zoom]
1236
	cmp eax,[scaled_zoom]
1237
	jg @f
1237
	jg @f
1238
		;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
1238
		;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
1239
		stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
1239
		stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
1240
			[open_file_vox], ebx,ecx, 0, eax
1240
			[open_file_vox], ebx,ecx, 0, eax
1241
		stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\
1241
		stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\
1242
			OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph]
1242
			OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph]
1243
		stdcall [buf2d_vox_obj_draw_1g], buf_0, buf_0z,\
1243
		stdcall [buf2d_vox_obj_draw_1g], buf_0, buf_0z,\
1244
			[open_file_vox], 0,0, eax
1244
			[open_file_vox], 0,0, eax
1245
		bt dword[mode_light],0
1245
		bt dword[mode_light],0
1246
		jnc .end_1
1246
		jnc .end_1
1247
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, ebx,ecx, 0, eax, 3
1247
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, ebx,ecx, 0, eax, 3
1248
		.end_1:
1248
		.end_1:
1249
		jmp .end_0
1249
		jmp .end_0
1250
	@@:
1250
	@@:
1251
		;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
1251
		;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
1252
		sub eax,[scaled_zoom]
1252
		sub eax,[scaled_zoom]
1253
		stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, buf_vox,\
1253
		stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, buf_vox,\
1254
			[open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
1254
			[open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
1255
		stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
1255
		stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
1256
			OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
1256
			OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
1257
		bt dword[mode_light],0
1257
		bt dword[mode_light],0
1258
		jnc .end_2
1258
		jnc .end_2
1259
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, 0,0, 0, [scaled_zoom], 3
1259
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, 0,0, 0, [scaled_zoom], 3
1260
		.end_2:
1260
		.end_2:
1261
	.end_0:
1261
	.end_0:
1262
	pop ecx ebx eax
1262
	pop ecx ebx eax
1263
 
1263
 
1264
	call draw_vox_cursor
1264
	call draw_vox_cursor
1265
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1265
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1266
	stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1266
	stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1267
	.end_f:
1267
	.end_f:
1268
	ret
1268
	ret
1269
 
1269
 
1270
;à¨á®¢ ­¨¥ ªãàá®à 
1270
;à¨á®¢ ­¨¥ ªãàá®à 
1271
align 4
1271
align 4
1272
draw_vox_cursor:
1272
draw_vox_cursor:
1273
pushad
1273
pushad
1274
	mov ecx,[v_zoom]
1274
	mov ecx,[v_zoom]
1275
	cmp ecx,[scaled_zoom]
1275
	cmp ecx,[scaled_zoom]
1276
	jle @f
1276
	jle @f
1277
		mov ecx,[scaled_zoom]
1277
		mov ecx,[scaled_zoom]
1278
	@@:
1278
	@@:
1279
	xor edx,edx
1279
	xor edx,edx
1280
	inc edx
1280
	inc edx
1281
	shl edx,cl
1281
	shl edx,cl
1282
 
1282
 
1283
	mov eax,[v_cur_x]
1283
	mov eax,[v_cur_x]
1284
	cmp eax,edx
1284
	cmp eax,edx
1285
	jge .end_f ;ªãàá®à §  ¯à¥¤¥« ¬¨ ¯®«ï
1285
	jge .end_f ;ªãàá®à §  ¯à¥¤¥« ¬¨ ¯®«ï
1286
	mov edi,[tile_size]
1286
	mov edi,[tile_size]
1287
	imul eax,edi
1287
	imul eax,edi
1288
	add eax,OT_MAP_X
1288
	add eax,OT_MAP_X
1289
	mov ebx,edx
1289
	mov ebx,edx
1290
	dec ebx
1290
	dec ebx
1291
	sub ebx,[v_cur_y]
1291
	sub ebx,[v_cur_y]
1292
	imul ebx,edi
1292
	imul ebx,edi
1293
	add ebx,OT_MAP_Y
1293
	add ebx,OT_MAP_Y
1294
	inc eax
1294
	inc eax
1295
	inc ebx
1295
	inc ebx
1296
	sub edi,2
1296
	sub edi,2
1297
	stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,edi,[sc.work_graph]
1297
	stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,edi,[sc.work_graph]
1298
	dec ebx
1298
	dec ebx
1299
	add edi,2
1299
	add edi,2
1300
 
1300
 
1301
	;£®à¨§®­â «ì­ë¥ «¨­¨¨
1301
	;£®à¨§®­â «ì­ë¥ «¨­¨¨
1302
	sub eax,2
1302
	sub eax,2
1303
	mov ecx,edi
1303
	mov ecx,edi
1304
	imul edi,edx
1304
	imul edi,edx
1305
	shr ecx,1
1305
	shr ecx,1
1306
	add ebx,ecx ;業â஢ª  ¯® á¥à¥¤¨­¥ ª«¥âª¨
1306
	add ebx,ecx ;業â஢ª  ¯® á¥à¥¤¨­¥ ª«¥âª¨
1307
	mov ecx,OT_MAP_X
1307
	mov ecx,OT_MAP_X
1308
	add edi,ecx
1308
	add edi,ecx
1309
	stdcall [buf2d_line], buf_pl, ecx,ebx, eax,ebx,[sc.work_graph]
1309
	stdcall [buf2d_line], buf_pl, ecx,ebx, eax,ebx,[sc.work_graph]
1310
	add eax,[tile_size]
1310
	add eax,[tile_size]
1311
	inc eax
1311
	inc eax
1312
	cmp eax,edi
1312
	cmp eax,edi
1313
	jge @f ;¥á«¨ ªãàá®à ­  ªà î ¯®«ï
1313
	jge @f ;¥á«¨ ªãàá®à ­  ªà î ¯®«ï
1314
		dec edi
1314
		dec edi
1315
		stdcall [buf2d_line], buf_pl, eax,ebx, edi,ebx,[sc.work_graph]
1315
		stdcall [buf2d_line], buf_pl, eax,ebx, edi,ebx,[sc.work_graph]
1316
	@@:
1316
	@@:
1317
 
1317
 
1318
	.end_f:
1318
	.end_f:
1319
popad
1319
popad
1320
	ret
1320
	ret
1321
 
1321
 
1322
if 0
1322
if 0
1323
;input:
1323
;input:
1324
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
1324
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
1325
;output:
1325
;output:
1326
; eax - ç¨á«®
1326
; eax - ç¨á«®
1327
align 4
1327
align 4
1328
proc conv_str_to_int, buf:dword
1328
proc conv_str_to_int, buf:dword
1329
	xor eax,eax
1329
	xor eax,eax
1330
	push ebx ecx esi
1330
	push ebx ecx esi
1331
	xor ebx,ebx
1331
	xor ebx,ebx
1332
	mov esi,[buf]
1332
	mov esi,[buf]
1333
	;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
1333
	;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
1334
	xor ecx,ecx
1334
	xor ecx,ecx
1335
	inc ecx
1335
	inc ecx
1336
	cmp byte[esi],'-'
1336
	cmp byte[esi],'-'
1337
	jne @f
1337
	jne @f
1338
		dec ecx
1338
		dec ecx
1339
		inc esi
1339
		inc esi
1340
	@@:
1340
	@@:
1341
 
1341
 
1342
	cmp word[esi],'0x'
1342
	cmp word[esi],'0x'
1343
	je .load_digit_16
1343
	je .load_digit_16
1344
 
1344
 
1345
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
1345
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
1346
		mov bl,byte[esi]
1346
		mov bl,byte[esi]
1347
		cmp bl,'0'
1347
		cmp bl,'0'
1348
		jl @f
1348
		jl @f
1349
		cmp bl,'9'
1349
		cmp bl,'9'
1350
		jg @f
1350
		jg @f
1351
			sub bl,'0'
1351
			sub bl,'0'
1352
			imul eax,10
1352
			imul eax,10
1353
			add eax,ebx
1353
			add eax,ebx
1354
			inc esi
1354
			inc esi
1355
			jmp .load_digit_10
1355
			jmp .load_digit_10
1356
	jmp @f
1356
	jmp @f
1357
 
1357
 
1358
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
1358
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
1359
		add esi,2
1359
		add esi,2
1360
	.cycle_16:
1360
	.cycle_16:
1361
		mov bl,byte[esi]
1361
		mov bl,byte[esi]
1362
		cmp bl,'0'
1362
		cmp bl,'0'
1363
		jl @f
1363
		jl @f
1364
		cmp bl,'f'
1364
		cmp bl,'f'
1365
		jg @f
1365
		jg @f
1366
		cmp bl,'9'
1366
		cmp bl,'9'
1367
		jle .us1
1367
		jle .us1
1368
			cmp bl,'A'
1368
			cmp bl,'A'
1369
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
1369
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
1370
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
1370
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
1371
		cmp bl,'F'
1371
		cmp bl,'F'
1372
		jle .us2
1372
		jle .us2
1373
			cmp bl,'a'
1373
			cmp bl,'a'
1374
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
1374
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
1375
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
1375
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
1376
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
1376
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
1377
			sub bl,'0'
1377
			sub bl,'0'
1378
			cmp bl,9
1378
			cmp bl,9
1379
			jle .cor1
1379
			jle .cor1
1380
				sub bl,7 ;convert 'A' to '10'
1380
				sub bl,7 ;convert 'A' to '10'
1381
			.cor1:
1381
			.cor1:
1382
			shl eax,4
1382
			shl eax,4
1383
			add eax,ebx
1383
			add eax,ebx
1384
			inc esi
1384
			inc esi
1385
			jmp .cycle_16
1385
			jmp .cycle_16
1386
	@@:
1386
	@@:
1387
	cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
1387
	cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
1388
	jne @f
1388
	jne @f
1389
		sub ecx,eax
1389
		sub ecx,eax
1390
		mov eax,ecx
1390
		mov eax,ecx
1391
	@@:
1391
	@@:
1392
	pop esi ecx ebx
1392
	pop esi ecx ebx
1393
	ret
1393
	ret
1394
endp
1394
endp
1395
end if
1395
end if
1396
 
1396
 
1397
;input:
1397
;input:
1398
; eax = value
1398
; eax = value
1399
; edi = string buffer
1399
; edi = string buffer
1400
;output:
1400
;output:
1401
align 4
1401
align 4
1402
convert_int_to_str:
1402
convert_int_to_str:
1403
	pushad
1403
	pushad
1404
		bt eax,31
1404
		bt eax,31
1405
		jae @f
1405
		jae @f
1406
			;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
1406
			;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
1407
			neg eax
1407
			neg eax
1408
			;inc eax
1408
			;inc eax
1409
			;clc
1409
			;clc
1410
			mov byte[edi],'-'
1410
			mov byte[edi],'-'
1411
			inc edi
1411
			inc edi
1412
		@@:
1412
		@@:
1413
		mov dword[edi+1],0
1413
		mov dword[edi+1],0
1414
		mov word[edi+5],0
1414
		mov word[edi+5],0
1415
		call .str
1415
		call .str
1416
	popad
1416
	popad
1417
	ret
1417
	ret
1418
 
1418
 
1419
align 4
1419
align 4
1420
.str:
1420
.str:
1421
	mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
1421
	mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
1422
    ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®© 
1422
    ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®© 
1423
	cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
1423
	cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
1424
	jb @f
1424
	jb @f
1425
		xor edx,edx  ;®ç¨áâ¨âì edx
1425
		xor edx,edx  ;®ç¨áâ¨âì edx
1426
		div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
1426
		div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
1427
		push edx     ;¯®«®¦¨âì ¢ á⥪
1427
		push edx     ;¯®«®¦¨âì ¢ á⥪
1428
		;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
1428
		;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
1429
		call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
1429
		call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
1430
		pop eax
1430
		pop eax
1431
	@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
1431
	@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
1432
	or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  祬 ¤¢¥ ¢ëè¥
1432
	or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  祬 ¤¢¥ ¢ëè¥
1433
	stosb	    ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
1433
	stosb	    ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
1434
	ret	      ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
1434
	ret	      ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
1435
 
1435
 
1436
align 4
1436
align 4
1437
proc str_cat, str1:dword, str2:dword
1437
proc str_cat, str1:dword, str2:dword
1438
	push eax ecx edi esi
1438
	push eax ecx edi esi
1439
	mov esi,dword[str2]
1439
	mov esi,dword[str2]
1440
	stdcall str_len,esi
1440
	stdcall str_len,esi
1441
	mov ecx,eax
1441
	mov ecx,eax
1442
	inc ecx
1442
	inc ecx
1443
	mov edi,dword[str1]
1443
	mov edi,dword[str1]
1444
	stdcall str_len,edi
1444
	stdcall str_len,edi
1445
	add edi,eax
1445
	add edi,eax
1446
	cld
1446
	cld
1447
	repne movsb
1447
	repne movsb
1448
	pop esi edi ecx eax
1448
	pop esi edi ecx eax
1449
	ret
1449
	ret
1450
endp
1450
endp
1451
 
1451
 
1452
;output:
1452
;output:
1453
; eax = strlen
1453
; eax = strlen
1454
align 4
1454
align 4
1455
proc str_len, str1:dword
1455
proc str_len, str1:dword
1456
	mov eax,[str1]
1456
	mov eax,[str1]
1457
	@@:
1457
	@@:
1458
		cmp byte[eax],0
1458
		cmp byte[eax],0
1459
		je @f
1459
		je @f
1460
		inc eax
1460
		inc eax
1461
		jmp @b
1461
		jmp @b
1462
	@@:
1462
	@@:
1463
	sub eax,[str1]
1463
	sub eax,[str1]
1464
	ret
1464
	ret
1465
endp
1465
endp
1466
 
1466
 
1467
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
1467
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
1468
align 4
1468
align 4
1469
OpenDialog_data:
1469
OpenDialog_data:
1470
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
1470
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
1471
.procinfo		dd procinfo	;+4
1471
.procinfo		dd procinfo	;+4
1472
.com_area_name		dd communication_area_name	;+8
1472
.com_area_name		dd communication_area_name	;+8
1473
.com_area		dd 0	;+12
1473
.com_area		dd 0	;+12
1474
.opendir_path		dd plugin_path	;+16
1474
.opendir_path		dd plugin_path	;+16
1475
.dir_default_path	dd default_dir ;+20
1475
.dir_default_path	dd default_dir ;+20
1476
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
1476
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
1477
.draw_window		dd draw_window	;+28
1477
.draw_window		dd draw_window	;+28
1478
.status 		dd 0	;+32
1478
.status 		dd 0	;+32
1479
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
1479
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
1480
.filename_area		dd filename_area	;+40
1480
.filename_area		dd filename_area	;+40
1481
.filter_area		dd Filter
1481
.filter_area		dd Filter
1482
.x:
1482
.x:
1483
.x_size 		dw 420 ;+48 ; Window X size
1483
.x_size 		dw 420 ;+48 ; Window X size
1484
.x_start		dw 10 ;+50 ; Window X position
1484
.x_start		dw 10 ;+50 ; Window X position
1485
.y:
1485
.y:
1486
.y_size 		dw 320 ;+52 ; Window y size
1486
.y_size 		dw 320 ;+52 ; Window y size
1487
.y_start		dw 10 ;+54 ; Window Y position
1487
.y_start		dw 10 ;+54 ; Window Y position
1488
 
1488
 
1489
default_dir db '/rd/1',0
1489
default_dir db '/rd/1',0
1490
 
1490
 
1491
communication_area_name:
1491
communication_area_name:
1492
	db 'FFFFFFFF_open_dialog',0
1492
	db 'FFFFFFFF_open_dialog',0
1493
open_dialog_name:
1493
open_dialog_name:
1494
	db 'opendial',0
1494
	db 'opendial',0
1495
communication_area_default_path:
1495
communication_area_default_path:
1496
	db '/rd/1/File managers/',0
1496
	db '/rd/1/File managers/',0
1497
 
1497
 
1498
Filter:
1498
Filter:
1499
dd Filter.end - Filter ;.1
1499
dd Filter.end - Filter ;.1
1500
.1:
1500
.1:
1501
db 'VOX',0
1501
db 'VOX',0
1502
.end:
1502
.end:
1503
db 0
1503
db 0
1504
 
1504
 
1505
 
1505
 
1506
 
1506
 
1507
head_f_i:
1507
head_f_i:
1508
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
1508
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
1509
 
1509
 
1510
system_dir_0 db '/sys/lib/'
1510
system_dir_0 db '/sys/lib/'
1511
lib_name_0 db 'proc_lib.obj',0
1511
lib_name_0 db 'proc_lib.obj',0
1512
err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
1512
err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
1513
err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
1513
err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
1514
 
1514
 
1515
system_dir_1 db '/sys/lib/'
1515
system_dir_1 db '/sys/lib/'
1516
lib_name_1 db 'libimg.obj',0
1516
lib_name_1 db 'libimg.obj',0
1517
err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
1517
err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
1518
err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
1518
err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
1519
 
1519
 
1520
system_dir_2 db '/sys/lib/'
1520
system_dir_2 db '/sys/lib/'
1521
lib_name_2 db 'buf2d.obj',0
1521
lib_name_2 db 'buf2d.obj',0
1522
err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
1522
err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
1523
err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
1523
err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
1524
 
1524
 
1525
system_dir_3 db '/sys/lib/'
1525
system_dir_3 db '/sys/lib/'
1526
lib_name_3 db 'libini.obj',0
1526
lib_name_3 db 'libini.obj',0
1527
err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
1527
err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
1528
err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini',39,0
1528
err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini',39,0
1529
 
1529
 
1530
l_libs_start:
1530
l_libs_start:
1531
	lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
1531
	lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
1532
		err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
1532
		err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
1533
	lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
1533
	lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
1534
		err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
1534
		err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
1535
	lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
1535
	lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
1536
		err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
1536
		err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
1537
	lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
1537
	lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
1538
		err_msg_found_lib_3,head_f_l,import_libini,err_msg_import_3,head_f_i
1538
		err_msg_found_lib_3,head_f_l,import_libini,err_msg_import_3,head_f_i
1539
l_libs_end:
1539
l_libs_end:
1540
 
1540
 
1541
align 4
1541
align 4
1542
import_libimg:
1542
import_libimg:
1543
	dd alib_init1
1543
	dd alib_init1
1544
	img_is_img  dd aimg_is_img
1544
	img_is_img  dd aimg_is_img
1545
	img_info    dd aimg_info
1545
	img_info    dd aimg_info
1546
	img_from_file dd aimg_from_file
1546
	img_from_file dd aimg_from_file
1547
	img_to_file dd aimg_to_file
1547
	img_to_file dd aimg_to_file
1548
	img_from_rgb dd aimg_from_rgb
1548
	img_from_rgb dd aimg_from_rgb
1549
	img_to_rgb  dd aimg_to_rgb
1549
	img_to_rgb  dd aimg_to_rgb
1550
	img_to_rgb2 dd aimg_to_rgb2
1550
	img_to_rgb2 dd aimg_to_rgb2
1551
	img_decode  dd aimg_decode
1551
	img_decode  dd aimg_decode
1552
	img_encode  dd aimg_encode
1552
	img_encode  dd aimg_encode
1553
	img_create  dd aimg_create
1553
	img_create  dd aimg_create
1554
	img_destroy dd aimg_destroy
1554
	img_destroy dd aimg_destroy
1555
	img_destroy_layer dd aimg_destroy_layer
1555
	img_destroy_layer dd aimg_destroy_layer
1556
	img_count   dd aimg_count
1556
	img_count   dd aimg_count
1557
	img_lock_bits dd aimg_lock_bits
1557
	img_lock_bits dd aimg_lock_bits
1558
	img_unlock_bits dd aimg_unlock_bits
1558
	img_unlock_bits dd aimg_unlock_bits
1559
	img_flip    dd aimg_flip
1559
	img_flip    dd aimg_flip
1560
	img_flip_layer dd aimg_flip_layer
1560
	img_flip_layer dd aimg_flip_layer
1561
	img_rotate  dd aimg_rotate
1561
	img_rotate  dd aimg_rotate
1562
	img_rotate_layer dd aimg_rotate_layer
1562
	img_rotate_layer dd aimg_rotate_layer
1563
	img_draw    dd aimg_draw
1563
	img_draw    dd aimg_draw
1564
 
1564
 
1565
	dd 0,0
1565
	dd 0,0
1566
	alib_init1   db 'lib_init',0
1566
	alib_init1   db 'lib_init',0
1567
	aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
1567
	aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
1568
	aimg_info    db 'img_info',0
1568
	aimg_info    db 'img_info',0
1569
	aimg_from_file db 'img_from_file',0
1569
	aimg_from_file db 'img_from_file',0
1570
	aimg_to_file db 'img_to_file',0
1570
	aimg_to_file db 'img_to_file',0
1571
	aimg_from_rgb db 'img_from_rgb',0
1571
	aimg_from_rgb db 'img_from_rgb',0
1572
	aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
1572
	aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
1573
	aimg_to_rgb2 db 'img_to_rgb2',0
1573
	aimg_to_rgb2 db 'img_to_rgb2',0
1574
	aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
1574
	aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
1575
	aimg_encode  db 'img_encode',0
1575
	aimg_encode  db 'img_encode',0
1576
	aimg_create  db 'img_create',0
1576
	aimg_create  db 'img_create',0
1577
	aimg_destroy db 'img_destroy',0
1577
	aimg_destroy db 'img_destroy',0
1578
	aimg_destroy_layer db 'img_destroy_layer',0
1578
	aimg_destroy_layer db 'img_destroy_layer',0
1579
	aimg_count   db 'img_count',0
1579
	aimg_count   db 'img_count',0
1580
	aimg_lock_bits db 'img_lock_bits',0
1580
	aimg_lock_bits db 'img_lock_bits',0
1581
	aimg_unlock_bits db 'img_unlock_bits',0
1581
	aimg_unlock_bits db 'img_unlock_bits',0
1582
	aimg_flip    db 'img_flip',0
1582
	aimg_flip    db 'img_flip',0
1583
	aimg_flip_layer db 'img_flip_layer',0
1583
	aimg_flip_layer db 'img_flip_layer',0
1584
	aimg_rotate  db 'img_rotate',0
1584
	aimg_rotate  db 'img_rotate',0
1585
	aimg_rotate_layer db 'img_rotate_layer',0
1585
	aimg_rotate_layer db 'img_rotate_layer',0
1586
	aimg_draw    db 'img_draw',0
1586
	aimg_draw    db 'img_draw',0
1587
 
1587
 
1588
align 4
1588
align 4
1589
proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
1589
proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
1590
	OpenDialog_Init dd aOpenDialog_Init
1590
	OpenDialog_Init dd aOpenDialog_Init
1591
	OpenDialog_Start dd aOpenDialog_Start
1591
	OpenDialog_Start dd aOpenDialog_Start
1592
dd 0,0
1592
dd 0,0
1593
	aOpenDialog_Init db 'OpenDialog_init',0
1593
	aOpenDialog_Init db 'OpenDialog_init',0
1594
	aOpenDialog_Start db 'OpenDialog_start',0
1594
	aOpenDialog_Start db 'OpenDialog_start',0
1595
 
1595
 
1596
align 4
1596
align 4
1597
import_buf2d:
1597
import_buf2d:
1598
	init dd sz_init
1598
	init dd sz_init
1599
	buf2d_create dd sz_buf2d_create
1599
	buf2d_create dd sz_buf2d_create
1600
	buf2d_create_f_img dd sz_buf2d_create_f_img
1600
	buf2d_create_f_img dd sz_buf2d_create_f_img
1601
	buf2d_clear dd sz_buf2d_clear
1601
	buf2d_clear dd sz_buf2d_clear
1602
	buf2d_draw dd sz_buf2d_draw
1602
	buf2d_draw dd sz_buf2d_draw
1603
	buf2d_delete dd sz_buf2d_delete
1603
	buf2d_delete dd sz_buf2d_delete
1604
	buf2d_line dd sz_buf2d_line
1604
	buf2d_line dd sz_buf2d_line
1605
	buf2d_rect_by_size dd sz_buf2d_rect_by_size
1605
	buf2d_rect_by_size dd sz_buf2d_rect_by_size
1606
	buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
1606
	buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
1607
	buf2d_circle dd sz_buf2d_circle
1607
	buf2d_circle dd sz_buf2d_circle
1608
	buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
1608
	buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
1609
	buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
1609
	buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
1610
	buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
1610
	buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
1611
	buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
1611
	buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
1612
	buf2d_bit_blt dd sz_buf2d_bit_blt
1612
	buf2d_bit_blt dd sz_buf2d_bit_blt
1613
	buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
1613
	buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
1614
	buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
1614
	buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
1615
	buf2d_curve_bezier dd sz_buf2d_curve_bezier
1615
	buf2d_curve_bezier dd sz_buf2d_curve_bezier
1616
	buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
1616
	buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
1617
	buf2d_draw_text dd sz_buf2d_draw_text
1617
	buf2d_draw_text dd sz_buf2d_draw_text
1618
	buf2d_crop_color dd sz_buf2d_crop_color
1618
	buf2d_crop_color dd sz_buf2d_crop_color
1619
	buf2d_offset_h dd sz_buf2d_offset_h
1619
	buf2d_offset_h dd sz_buf2d_offset_h
1620
	buf2d_flood_fill dd sz_buf2d_flood_fill
1620
	buf2d_flood_fill dd sz_buf2d_flood_fill
1621
	buf2d_set_pixel dd sz_buf2d_set_pixel
1621
	buf2d_set_pixel dd sz_buf2d_set_pixel
1622
	buf2d_get_pixel dd sz_buf2d_get_pixel
1622
	buf2d_get_pixel dd sz_buf2d_get_pixel
1623
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1623
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1624
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
1624
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
1625
	buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
1625
	buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
1626
	buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
1626
	buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
1627
	buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
1627
	buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
1628
	buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
1628
	buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
1629
	buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
1629
	buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
1630
	buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
1630
	buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
1631
	buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
1631
	buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
1632
	buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
1632
	buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
1633
 
1633
 
1634
	dd 0,0
1634
	dd 0,0
1635
	sz_init db 'lib_init',0
1635
	sz_init db 'lib_init',0
1636
	sz_buf2d_create db 'buf2d_create',0
1636
	sz_buf2d_create db 'buf2d_create',0
1637
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
1637
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
1638
	sz_buf2d_clear db 'buf2d_clear',0
1638
	sz_buf2d_clear db 'buf2d_clear',0
1639
	sz_buf2d_draw db 'buf2d_draw',0
1639
	sz_buf2d_draw db 'buf2d_draw',0
1640
	sz_buf2d_delete db 'buf2d_delete',0
1640
	sz_buf2d_delete db 'buf2d_delete',0
1641
	sz_buf2d_line db 'buf2d_line',0
1641
	sz_buf2d_line db 'buf2d_line',0
1642
	sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
1642
	sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
1643
	sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
1643
	sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
1644
	sz_buf2d_circle db 'buf2d_circle',0
1644
	sz_buf2d_circle db 'buf2d_circle',0
1645
	sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
1645
	sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
1646
	sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
1646
	sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
1647
	sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
1647
	sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
1648
	sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
1648
	sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
1649
	sz_buf2d_bit_blt db 'buf2d_bit_blt',0
1649
	sz_buf2d_bit_blt db 'buf2d_bit_blt',0
1650
	sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
1650
	sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
1651
	sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
1651
	sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
1652
	sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
1652
	sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
1653
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
1653
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
1654
	sz_buf2d_draw_text db 'buf2d_draw_text',0
1654
	sz_buf2d_draw_text db 'buf2d_draw_text',0
1655
	sz_buf2d_crop_color db 'buf2d_crop_color',0
1655
	sz_buf2d_crop_color db 'buf2d_crop_color',0
1656
	sz_buf2d_offset_h db 'buf2d_offset_h',0
1656
	sz_buf2d_offset_h db 'buf2d_offset_h',0
1657
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
1657
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
1658
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
1658
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
1659
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
1659
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
1660
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
1660
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
1661
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
1661
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
1662
	sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
1662
	sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
1663
	sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
1663
	sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
1664
	sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
1664
	sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
1665
	sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
1665
	sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
1666
	sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
1666
	sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
1667
	sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
1667
	sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
1668
	sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
1668
	sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
1669
	sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
1669
	sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
1670
 
1670
 
1671
align 4
1671
align 4
1672
import_libini:
1672
import_libini:
1673
	dd alib_init2
1673
	dd alib_init2
1674
	ini_get_str   dd aini_get_str
1674
	ini_get_str   dd aini_get_str
1675
	ini_get_int   dd aini_get_int
1675
	ini_get_int   dd aini_get_int
1676
	ini_get_color dd aini_get_color
1676
	ini_get_color dd aini_get_color
1677
dd 0,0
1677
dd 0,0
1678
	alib_init2     db 'lib_init',0
1678
	alib_init2     db 'lib_init',0
1679
	aini_get_str   db 'ini_get_str',0
1679
	aini_get_str   db 'ini_get_str',0
1680
	aini_get_int   db 'ini_get_int',0
1680
	aini_get_int   db 'ini_get_int',0
1681
	aini_get_color db 'ini_get_color',0
1681
	aini_get_color db 'ini_get_color',0
1682
 
1682
 
1683
mouse_dd dd 0x0
1683
mouse_dd dd 0x0
1684
sc system_colors 
1684
sc system_colors 
1685
 
1685
 
1686
align 16
1686
align 16
1687
procinfo process_information 
1687
procinfo process_information 
1688
 
1688
 
1689
;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1689
;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1690
align 4
1690
align 4
1691
buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
1691
buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
1692
.l: dw 5 ;+4 left
1692
.l: dw 5 ;+4 left
1693
.t: dw 45 ;+6 top
1693
.t: dw 45 ;+6 top
1694
.w: dd 192+6 ;+8 w
1694
.w: dd 192+6 ;+8 w
1695
.h: dd 224+7 ;+12 h
1695
.h: dd 224+7 ;+12 h
1696
.color: dd 0xffffff ;+16 color
1696
.color: dd 0xffffff ;+16 color
1697
	db 24 ;+20 bit in pixel
1697
	db 24 ;+20 bit in pixel
1698
 
1698
 
1699
;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1699
;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1700
align 4
1700
align 4
1701
buf_0z: dd 0
1701
buf_0z: dd 0
1702
	dw 0 ;+4 left
1702
	dw 0 ;+4 left
1703
	dw 0 ;+6 top
1703
	dw 0 ;+6 top
1704
.w: dd 192+6 ;+8 w
1704
.w: dd 192+6 ;+8 w
1705
.h: dd 224+7 ;+12 h
1705
.h: dd 224+7 ;+12 h
1706
.color: dd 0 ;+16 color
1706
.color: dd 0 ;+16 color
1707
	db 32 ;+20 bit in pixel
1707
	db 32 ;+20 bit in pixel
1708
 
1708
 
1709
;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
1709
;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
1710
align 4
1710
align 4
1711
buf_pl: dd 0
1711
buf_pl: dd 0
1712
.l: dw 15+192+6 ;+4 left
1712
.l: dw 15+192+6 ;+4 left
1713
.t: dw 45 ;+6 top
1713
.t: dw 45 ;+6 top
1714
.w: dd 320 ;+8 w
1714
.w: dd 320 ;+8 w
1715
.h: dd 330 ;+12 h
1715
.h: dd 330 ;+12 h
1716
.color: dd 0xffffff ;+16 color
1716
.color: dd 0xffffff ;+16 color
1717
	db 24 ;+20 bit in pixel
1717
	db 24 ;+20 bit in pixel
1718
 
1718
 
1719
;¡ãä¥à ¤«ï ã«ãç襭®£® ७¤¥à 
1719
;¡ãä¥à ¤«ï ã«ãç襭®£® ७¤¥à 
1720
align 4
1720
align 4
1721
buf_r_img:
1721
buf_r_img:
1722
	rb BUF_STRUCT_SIZE
1722
	rb BUF_STRUCT_SIZE
1723
align 4
1723
align 4
1724
buf_r_z:
1724
buf_r_z:
1725
	rb BUF_STRUCT_SIZE
1725
	rb BUF_STRUCT_SIZE
1726
 
1726
 
1727
align 4
1727
align 4
1728
cursor_pointer dd 0 ;㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï ªãàá®à 
1728
cursor_pointer dd 0 ;㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï ªãàá®à 
1729
 
1729
 
1730
 
1730
 
1731
;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
1731
;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
1732
align 4
1732
align 4
1733
vox_6_7_z:
1733
vox_6_7_z:
1734
dd 0,0,1,1,0,0,\
1734
dd 0,0,1,1,0,0,\
1735
   0,2,2,2,2,0,\
1735
   0,2,2,2,2,0,\
1736
   2,2,2,2,2,2,\
1736
   2,2,2,2,2,2,\
1737
   2,3,2,2,3,2,\
1737
   2,3,2,2,3,2,\
1738
   2,3,3,3,3,2,\
1738
   2,3,3,3,3,2,\
1739
   0,3,3,3,3,0,\
1739
   0,3,3,3,3,0,\
1740
   0,0,3,3,0,0
1740
   0,0,3,3,0,0
1741
 
1741
 
1742
align 4
1742
align 4
1743
buf_vox:
1743
buf_vox:
1744
	db 6,7,4,3 ;w,h,h_osn,n
1744
	db 6,7,4,3 ;w,h,h_osn,n
1745
	rb BUF_STRUCT_SIZE*(3+1)
1745
	rb BUF_STRUCT_SIZE*(3+1)
1746
 
1746
 
1747
i_end:
1747
i_end:
1748
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
1748
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
1749
		rq 0
1749
		rq 0
1750
	rb 4096 ;2048
1750
	rb 4096 ;2048
1751
stacktop:
1751
stacktop:
1752
	sys_path rb 1024
1752
	sys_path rb 1024
1753
	file_name:
1753
	file_name:
1754
		rb 1024 ;4096 
1754
		rb 1024 ;4096 
1755
	library_path rb 1024
1755
	library_path rb 1024
1756
	plugin_path rb 1024 ;4096
1756
	plugin_path rb 1024 ;4096
1757
	openfile_path rb 1024 ;4096
1757
	openfile_path rb 1024 ;4096
1758
	filename_area rb 256
1758
	filename_area rb 256
1759
mem:
1759
mem:
1760
>
1760
>
1761
>
1761
>