Subversion Repositories Kolibri OS

Rev

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

Rev 3969 Rev 5388
Line 13... Line 13...
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 '../../../../programs/dll.inc'
15
include '../../../../programs/dll.inc'
16
include '../trunk/vox_draw.inc'
16
include '../trunk/vox_draw.inc'
17
include '../trunk/vox_rotate.inc'
17
include '../trunk/vox_rotate.inc'
-
 
18
include '../trunk/str.inc'
Line 18... Line 19...
18
 
19
 
19
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
20
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
Line 20... Line 21...
20
caption db 'Voxel mover 13.09.12',0 ;¯®¤¯¨áì ®ª­ 
21
caption db 'Voxel mover 29.01.15',0 ;¯®¤¯¨áì ®ª­ 
21
 
22
 
22
struct FileInfoBlock
23
struct FileInfoBlock
23
	Function dd ?
24
	Function dd ?
Line 30... Line 31...
30
ends
31
ends
Line 31... Line 32...
31
 
32
 
32
run_file_70 FileInfoBlock
33
run_file_70 FileInfoBlock
Line 33... Line -...
33
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
-
 
34
 
34
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
35
fn_toolbar db 'toolbar_m.png',0
35
 
36
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
36
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
Line 37... Line 37...
37
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*18
37
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*18
Line 172... Line 172...
172
	stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
172
	stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
173
	stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
173
	stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
Line 174... Line 174...
174
 
174
 
Line 175... Line 175...
175
	stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
175
	stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
Line 176... Line 176...
176
 
176
 
177
	load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
177
	load_image_file 'toolbar_m.png', image_data_toolbar,IMAGE_TOOLBAR_SIZE
178
 
178
 
179
	stdcall mem.Alloc,[max_open_file_size]
179
	stdcall mem.Alloc,[max_open_file_size]
Line 350... Line 350...
350
	mcall 12,1
350
	mcall 12,1
Line 351... Line 351...
351
 
351
 
352
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
352
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
353
	mov edx,[sc.work]
353
	mov edx,[sc.work]
354
	or  edx,(3 shl 24)+0x30000000
-
 
355
	mov edi,caption
354
	or  edx,(3 shl 24)+0x30000000
Line 356... Line 355...
356
	mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4]
355
	mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4],,,caption
357
 
-
 
358
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
-
 
359
	mov eax,8
-
 
360
	mov ebx,(5 shl 16)+20
-
 
361
	mov ecx,(5 shl 16)+20
356
 
362
	mov edx,3
357
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
Line 363... Line 358...
363
	mov esi,[sc.work_button]
358
	mov esi,[sc.work_button]
364
	int 0x40
359
	mcall 8,(5 shl 16)+20,(5 shl 16)+20,3
365
 
360
 
366
	mov ebx,(30 shl 16)+20
361
	mov ebx,(30 shl 16)+20
Line 414... Line 409...
414
	add ebx,25 shl 16
409
	add ebx,25 shl 16
415
	mov edx,20
410
	mov edx,20
416
	int 0x40
411
	int 0x40
Line 417... Line 412...
417
 
412
 
418
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
-
 
419
	mov eax,7
-
 
420
	mov ebx,[image_data_toolbar]
-
 
421
	mov ecx,(16 shl 16)+16
413
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
422
	mov edx,(7 shl 16)+7 ;icon new
414
	mov edx,(7 shl 16)+7 ;icon new
Line 423... Line 415...
423
	int 0x40
415
	mcall 7,[image_data_toolbar],(16 shl 16)+16
424
 
416
 
425
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
417
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
426
	add edx,(25 shl 16) ;icon open
418
	add edx,(25 shl 16) ;icon open
Line 483... Line 475...
483
popad
475
popad
484
	ret
476
	ret
Line 485... Line 477...
485
 
477
 
486
align 4
478
align 4
487
draw_pok:
-
 
488
	mov eax,47
-
 
489
	mov ecx,[v_zoom]
-
 
490
	mov ebx,(3 shl 16)+(1 shl 31)
-
 
491
	mov edx,((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2
479
draw_pok:
492
	mov esi,[sc.work_button_text]
480
	mov esi,[sc.work_button_text]
493
	or  esi,(1 shl 30)
481
	or  esi,(1 shl 30)
494
	mov edi,[sc.work_button]
482
	mov edi,[sc.work_button]
495
	int 0x40 ;¬ áèâ ¡
483
	mcall 47, (3 shl 16)+(1 shl 31), [v_zoom], ((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2 ;¬ áèâ ¡
496
	mov ecx,[n_plane]
484
	mov ecx,[n_plane]
497
	add edx,115 shl 16 ;9
485
	add edx,115 shl 16 ;9
Line 498... Line 486...
498
	int 0x40 ;­®¬¥à á¥ç¥­¨ï
486
	int 0x40 ;­®¬¥à á¥ç¥­¨ï
499
 
487
 
500
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
488
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
501
	mov dword[txt_curor.size],0
489
	mov dword[txt_curor.size],0
502
	mov eax,dword[v_cur_x]
490
	mov eax,dword[v_cur_x]
503
	mov edi,txt_curor.size
491
	mov edi,txt_curor.size
504
	call convert_int_to_str
492
	stdcall convert_int_to_str,10
505
	stdcall str_cat, edi,txt_mull
493
	stdcall str_cat, edi,txt_mull
506
	mov eax,dword[v_cur_y]
494
	mov eax,dword[v_cur_y]
507
	mov edi,txt_buf
495
	mov edi,txt_buf
508
	call convert_int_to_str
496
	stdcall convert_int_to_str,16
Line 509... Line 497...
509
	stdcall str_cat, txt_curor.size,edi
497
	stdcall str_cat, txt_curor.size,edi
510
	stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
498
	stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
511
 
499
 
512
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
500
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
513
	mov dword[txt_mov_offs.size],0
501
	mov dword[txt_mov_offs.size],0
514
	mov eax,dword[mov_x]
502
	mov eax,dword[mov_x]
515
	mov edi,txt_mov_offs.size
503
	mov edi,txt_mov_offs.size
516
	call convert_int_to_str
504
	stdcall convert_int_to_str,30
517
	stdcall str_cat, edi,txt_space
505
	stdcall str_cat, edi,txt_space
518
	mov eax,dword[mov_y]
506
	mov eax,dword[mov_y]
519
	mov edi,txt_buf
507
	mov edi,txt_buf
520
	call convert_int_to_str
508
	stdcall convert_int_to_str,16
521
	stdcall str_cat, txt_mov_offs.size,edi
509
	stdcall str_cat, txt_mov_offs.size,edi
522
	stdcall str_cat, txt_mov_offs.size,txt_space
510
	stdcall str_cat, txt_mov_offs.size,txt_space
523
	mov eax,dword[mov_z]
511
	mov eax,dword[mov_z]
524
	mov edi,txt_buf
512
	mov edi,txt_buf
Line 525... Line 513...
525
	call convert_int_to_str
513
	stdcall convert_int_to_str,16
526
	stdcall str_cat, txt_mov_offs.size,edi
-
 
527
	stdcall str_cat, txt_mov_offs.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
514
	stdcall str_cat, txt_mov_offs.size,edi
528
 
515
	stdcall str_cat, txt_mov_offs.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
529
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
516
 
530
	mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
-
 
Line 531... Line 517...
531
	mov ecx,[sc.work_text]
517
	;à¨á®¢ ­¨¥ ⥪áâ 
532
	or  ecx,0x80000000 ;or (1 shl 30)
518
	mov ecx,[sc.work_text]
533
	mov edx,txt_color
519
	or  ecx,0x80000000 ;or (1 shl 30)
534
	int 0x40
520
	mcall 4, (OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2,,txt_color
Line 557... Line 543...
557
align 4
543
align 4
558
on_change_color:
544
on_change_color:
559
pushad
545
pushad
560
	mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
546
	mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
561
	mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
547
	mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
562
	mov edx,[v_color]
548
	mcall 13,,,[v_color]
563
	mcall 13
-
 
Line 564... Line -...
564
 
-
 
565
	mov ebx,(1 shl 8)+(6 shl 16)
549
 
566
	mov ecx,edx
550
	mov ecx,edx
567
	mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
551
	mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
568
	mov esi,[sc.work_text]
552
	mov esi,[sc.work_text]
569
	add esi,(1 shl 30)
553
	add esi,(1 shl 30)
570
	mov edi,[sc.work]
554
	mov edi,[sc.work]
571
	mcall 47
555
	mcall 47,(1 shl 8)+(6 shl 16)
572
popad
556
popad
Line 573... Line 557...
573
	ret
557
	ret
574
 
558
 
Line 1317... Line 1301...
1317
 
1301
 
1318
	.end_f:
1302
	.end_f:
1319
popad
1303
popad
Line 1320... Line -...
1320
	ret
-
 
1321
 
-
 
1322
if 0
-
 
1323
;input:
-
 
1324
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
-
 
1325
;output:
-
 
1326
; eax - ç¨á«®
-
 
1327
align 4
-
 
1328
proc conv_str_to_int, buf:dword
-
 
1329
	xor eax,eax
-
 
1330
	push ebx ecx esi
-
 
1331
	xor ebx,ebx
-
 
1332
	mov esi,[buf]
-
 
1333
	;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
-
 
1334
	xor ecx,ecx
-
 
1335
	inc ecx
-
 
1336
	cmp byte[esi],'-'
-
 
1337
	jne @f
-
 
1338
		dec ecx
-
 
1339
		inc esi
-
 
1340
	@@:
-
 
1341
 
-
 
1342
	cmp word[esi],'0x'
-
 
1343
	je .load_digit_16
-
 
1344
 
-
 
1345
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
-
 
1346
		mov bl,byte[esi]
-
 
1347
		cmp bl,'0'
-
 
1348
		jl @f
-
 
1349
		cmp bl,'9'
-
 
1350
		jg @f
-
 
1351
			sub bl,'0'
-
 
1352
			imul eax,10
-
 
1353
			add eax,ebx
-
 
1354
			inc esi
-
 
1355
			jmp .load_digit_10
-
 
1356
	jmp @f
-
 
1357
 
-
 
1358
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
-
 
1359
		add esi,2
-
 
1360
	.cycle_16:
-
 
1361
		mov bl,byte[esi]
-
 
1362
		cmp bl,'0'
-
 
1363
		jl @f
-
 
1364
		cmp bl,'f'
-
 
1365
		jg @f
-
 
1366
		cmp bl,'9'
-
 
1367
		jle .us1
-
 
1368
			cmp bl,'A'
-
 
1369
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
-
 
1370
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
-
 
1371
		cmp bl,'F'
-
 
1372
		jle .us2
-
 
1373
			cmp bl,'a'
-
 
1374
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
-
 
1375
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
-
 
1376
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
-
 
1377
			sub bl,'0'
-
 
1378
			cmp bl,9
-
 
1379
			jle .cor1
-
 
1380
				sub bl,7 ;convert 'A' to '10'
-
 
1381
			.cor1:
-
 
1382
			shl eax,4
-
 
1383
			add eax,ebx
-
 
1384
			inc esi
-
 
1385
			jmp .cycle_16
-
 
1386
	@@:
-
 
1387
	cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
-
 
1388
	jne @f
-
 
1389
		sub ecx,eax
-
 
1390
		mov eax,ecx
-
 
1391
	@@:
-
 
1392
	pop esi ecx ebx
-
 
1393
	ret
-
 
1394
endp
-
 
1395
end if
-
 
1396
 
-
 
1397
;input:
-
 
1398
; eax = value
-
 
1399
; edi = string buffer
-
 
1400
;output:
-
 
1401
align 4
-
 
1402
convert_int_to_str:
-
 
1403
	pushad
-
 
1404
		bt eax,31
-
 
1405
		jae @f
-
 
1406
			;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
-
 
1407
			neg eax
-
 
1408
			;inc eax
-
 
1409
			;clc
-
 
1410
			mov byte[edi],'-'
-
 
1411
			inc edi
-
 
1412
		@@:
-
 
1413
		mov dword[edi+1],0
-
 
1414
		mov word[edi+5],0
-
 
1415
		call .str
-
 
1416
	popad
-
 
1417
	ret
-
 
1418
 
-
 
1419
align 4
-
 
1420
.str:
-
 
1421
	mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
-
 
1422
    ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®© 
-
 
1423
	cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
-
 
1424
	jb @f
-
 
1425
		xor edx,edx  ;®ç¨áâ¨âì edx
-
 
1426
		div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
-
 
1427
		push edx     ;¯®«®¦¨âì ¢ á⥪
-
 
1428
		;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
-
 
1429
		call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
-
 
1430
		pop eax
-
 
1431
	@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
-
 
1432
	or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  祬 ¤¢¥ ¢ëè¥
-
 
1433
	stosb	    ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
-
 
1434
	ret	      ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
-
 
1435
 
-
 
1436
align 4
-
 
1437
proc str_cat, str1:dword, str2:dword
-
 
1438
	push eax ecx edi esi
-
 
1439
	mov esi,dword[str2]
-
 
1440
	stdcall str_len,esi
-
 
1441
	mov ecx,eax
-
 
1442
	inc ecx
-
 
1443
	mov edi,dword[str1]
-
 
1444
	stdcall str_len,edi
-
 
1445
	add edi,eax
-
 
1446
	cld
-
 
1447
	repne movsb
-
 
1448
	pop esi edi ecx eax
-
 
1449
	ret
-
 
1450
endp
-
 
1451
 
-
 
1452
;output:
-
 
1453
; eax = strlen
-
 
1454
align 4
-
 
1455
proc str_len, str1:dword
-
 
1456
	mov eax,[str1]
-
 
1457
	@@:
-
 
1458
		cmp byte[eax],0
-
 
1459
		je @f
-
 
1460
		inc eax
-
 
1461
		jmp @b
-
 
1462
	@@:
-
 
1463
	sub eax,[str1]
-
 
Line 1464... Line 1304...
1464
	ret
1304
	ret
1465
endp
1305
 
1466
 
1306
 
1467
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
1307
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
Line 1742... Line 1582...
1742
align 4
1582
align 4
1743
buf_vox:
1583
buf_vox:
1744
	db 6,7,4,3 ;w,h,h_osn,n
1584
	db 6,7,4,3 ;w,h,h_osn,n
1745
	rb BUF_STRUCT_SIZE*(3+1)
1585
	rb BUF_STRUCT_SIZE*(3+1)
Line -... Line 1586...
-
 
1586
 
1746
 
1587
align 16
1747
i_end:
1588
i_end:
1748
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
1589
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
1749
		rq 0
1590
		rq 0
1750
	rb 4096 ;2048
1591
	rb 4096 ;2048